diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2009-04-23 21:15:04 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-04-28 22:44:09 +0100 |
commit | bd41b99d4661e775ff152f2842782c43dbb30a59 (patch) | |
tree | 3cbf711bd296286ea57235baba79ececd253edb9 /arch/arm/mach-u300/padmux.c | |
parent | fa59440d0c7b5a2bcdc9e35f25fdac693e54c86a (diff) | |
download | blackbird-op-linux-bd41b99d4661e775ff152f2842782c43dbb30a59.tar.gz blackbird-op-linux-bd41b99d4661e775ff152f2842782c43dbb30a59.zip |
[ARM] 5471/2: U300 GPIO and PADMUX support
This adds GPIO and PADMUX headers and implementation for
the U300 platform. This is an implementation in isolation
that depend on later patches in this series to plug into
the framework.
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-u300/padmux.c')
-rw-r--r-- | arch/arm/mach-u300/padmux.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/arch/arm/mach-u300/padmux.c b/arch/arm/mach-u300/padmux.c new file mode 100644 index 000000000000..f3664564f086 --- /dev/null +++ b/arch/arm/mach-u300/padmux.c @@ -0,0 +1,58 @@ +/* + * + * arch/arm/mach-u300/padmux.c + * + * + * Copyright (C) 2009 ST-Ericsson AB + * License terms: GNU General Public License (GPL) version 2 + * U300 PADMUX functions + * Author: Linus Walleij <linus.walleij@stericsson.com> + * + */ +#include <linux/io.h> +#include <linux/err.h> +#include <mach/u300-regs.h> +#include <mach/syscon.h> + +#include "padmux.h" + +/* Set the PAD MUX to route the MMC reader correctly to GPIO0. */ +void pmx_set_mission_mode_mmc(void) +{ + u16 val; + + val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMC1LR); + val &= ~U300_SYSCON_PMC1LR_MMCSD_MASK; + writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMC1LR); + val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMC1HR); + val &= ~U300_SYSCON_PMC1HR_APP_GPIO_1_MASK; + val |= U300_SYSCON_PMC1HR_APP_GPIO_1_MMC; + writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMC1HR); +} + +void pmx_set_mission_mode_spi(void) +{ + u16 val; + + /* Set up padmuxing so the SPI port and its chipselects are active */ + val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMC1HR); + /* + * Activate the SPI port (disable the use of these pins for generic + * GPIO, DSP, AAIF + */ + val &= ~U300_SYSCON_PMC1HR_APP_SPI_2_MASK; + val |= U300_SYSCON_PMC1HR_APP_SPI_2_SPI; + /* + * Use GPIO pin SPI CS1 for CS1 actually (it can be used for other + * things also) + */ + val &= ~U300_SYSCON_PMC1HR_APP_SPI_CS_1_MASK; + val |= U300_SYSCON_PMC1HR_APP_SPI_CS_1_SPI; + /* + * Use GPIO pin SPI CS2 for CS2 actually (it can be used for other + * things also) + */ + val &= ~U300_SYSCON_PMC1HR_APP_SPI_CS_2_MASK; + val |= U300_SYSCON_PMC1HR_APP_SPI_CS_2_SPI; + writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMC1HR); +} |