diff options
author | Vitaly Bordug <vitb@kernel.crashing.org> | 2007-07-09 14:37:35 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-07-10 01:33:51 -0400 |
commit | 80128ff79d282cf71b1819dbca9b8dd47d8ed3e8 (patch) | |
tree | c09b48586370aad5bb5d424dea4401778bc1bf2a /arch/powerpc/platforms/8xx | |
parent | 90faf4fa7964a08d36160f7bc3c252866ad1275a (diff) |
[POWERPC] 8xx: mpc885ads pcmcia support
Adds support for PowerQuicc on-chip PCMCIA. The driver is implemented as
of_device, so only arch/powerpc stuff is capable to use it, which now implies
only mpc885ads reference board.
To cope with the code that should be hooked inside driver, but is really board
specific (like set_voltage), global structure mpc8xx_pcmcia_ops holds
necessary function pointers that are filled in the BSP code.
[akpm@linux-foundation.org: whitespace diddles]
Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Olof Johansson <olof@lixom.net>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/8xx')
-rw-r--r-- | arch/powerpc/platforms/8xx/m8xx_setup.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/8xx/mpc885ads_setup.c | 71 |
2 files changed, 76 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index 0901dbada350..f1693550c70c 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/root_dev.h> | 32 | #include <linux/root_dev.h> |
33 | #include <linux/time.h> | 33 | #include <linux/time.h> |
34 | #include <linux/rtc.h> | 34 | #include <linux/rtc.h> |
35 | #include <linux/fsl_devices.h> | ||
35 | 36 | ||
36 | #include <asm/mmu.h> | 37 | #include <asm/mmu.h> |
37 | #include <asm/reg.h> | 38 | #include <asm/reg.h> |
@@ -49,6 +50,10 @@ | |||
49 | 50 | ||
50 | #include "sysdev/mpc8xx_pic.h" | 51 | #include "sysdev/mpc8xx_pic.h" |
51 | 52 | ||
53 | #ifdef CONFIG_PCMCIA_M8XX | ||
54 | struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops; | ||
55 | #endif | ||
56 | |||
52 | void m8xx_calibrate_decr(void); | 57 | void m8xx_calibrate_decr(void); |
53 | extern void m8xx_wdt_handler_install(bd_t *bp); | 58 | extern void m8xx_wdt_handler_install(bd_t *bp); |
54 | extern int cpm_pic_init(void); | 59 | extern int cpm_pic_init(void); |
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index c36e475d93dc..dc27dab48df0 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/fs_enet_pd.h> | 23 | #include <linux/fs_enet_pd.h> |
24 | #include <linux/fs_uart_pd.h> | 24 | #include <linux/fs_uart_pd.h> |
25 | #include <linux/fsl_devices.h> | ||
25 | #include <linux/mii.h> | 26 | #include <linux/mii.h> |
26 | 27 | ||
27 | #include <asm/delay.h> | 28 | #include <asm/delay.h> |
@@ -51,6 +52,70 @@ static void init_smc1_uart_ioports(struct fs_uart_platform_info* fpi); | |||
51 | static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi); | 52 | static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi); |
52 | static void init_scc3_ioports(struct fs_platform_info* ptr); | 53 | static void init_scc3_ioports(struct fs_platform_info* ptr); |
53 | 54 | ||
55 | #ifdef CONFIG_PCMCIA_M8XX | ||
56 | static void pcmcia_hw_setup(int slot, int enable) | ||
57 | { | ||
58 | unsigned *bcsr_io; | ||
59 | |||
60 | bcsr_io = ioremap(BCSR1, sizeof(unsigned long)); | ||
61 | if (enable) | ||
62 | clrbits32(bcsr_io, BCSR1_PCCEN); | ||
63 | else | ||
64 | setbits32(bcsr_io, BCSR1_PCCEN); | ||
65 | |||
66 | iounmap(bcsr_io); | ||
67 | } | ||
68 | |||
69 | static int pcmcia_set_voltage(int slot, int vcc, int vpp) | ||
70 | { | ||
71 | u32 reg = 0; | ||
72 | unsigned *bcsr_io; | ||
73 | |||
74 | bcsr_io = ioremap(BCSR1, sizeof(unsigned long)); | ||
75 | |||
76 | switch(vcc) { | ||
77 | case 0: | ||
78 | break; | ||
79 | case 33: | ||
80 | reg |= BCSR1_PCCVCC0; | ||
81 | break; | ||
82 | case 50: | ||
83 | reg |= BCSR1_PCCVCC1; | ||
84 | break; | ||
85 | default: | ||
86 | return 1; | ||
87 | } | ||
88 | |||
89 | switch(vpp) { | ||
90 | case 0: | ||
91 | break; | ||
92 | case 33: | ||
93 | case 50: | ||
94 | if(vcc == vpp) | ||
95 | reg |= BCSR1_PCCVPP1; | ||
96 | else | ||
97 | return 1; | ||
98 | break; | ||
99 | case 120: | ||
100 | if ((vcc == 33) || (vcc == 50)) | ||
101 | reg |= BCSR1_PCCVPP0; | ||
102 | else | ||
103 | return 1; | ||
104 | default: | ||
105 | return 1; | ||
106 | } | ||
107 | |||
108 | /* first, turn off all power */ | ||
109 | clrbits32(bcsr_io, 0x00610000); | ||
110 | |||
111 | /* enable new powersettings */ | ||
112 | setbits32(bcsr_io, reg); | ||
113 | |||
114 | iounmap(bcsr_io); | ||
115 | return 0; | ||
116 | } | ||
117 | #endif | ||
118 | |||
54 | void __init mpc885ads_board_setup(void) | 119 | void __init mpc885ads_board_setup(void) |
55 | { | 120 | { |
56 | cpm8xx_t *cp; | 121 | cpm8xx_t *cp; |
@@ -115,6 +180,12 @@ void __init mpc885ads_board_setup(void) | |||
115 | immr_unmap(io_port); | 180 | immr_unmap(io_port); |
116 | 181 | ||
117 | #endif | 182 | #endif |
183 | |||
184 | #ifdef CONFIG_PCMCIA_M8XX | ||
185 | /*Set up board specific hook-ups*/ | ||
186 | m8xx_pcmcia_ops.hw_ctrl = pcmcia_hw_setup; | ||
187 | m8xx_pcmcia_ops.voltage_set = pcmcia_set_voltage; | ||
188 | #endif | ||
118 | } | 189 | } |
119 | 190 | ||
120 | 191 | ||