diff options
author | Vitaly Bordug <vbordug@ru.mvista.com> | 2006-09-21 14:38:05 -0400 |
---|---|---|
committer | Vitaly Bordug <vbordug@ru.mvista.com> | 2006-09-21 14:38:05 -0400 |
commit | d3465c921f79cfef0a4a8ceeeef9a3721bbbb57d (patch) | |
tree | 73d602a02efd3f358990dcfa9231131e69318d3b | |
parent | fc8e50e349aa722d9f97ed9ba30e324ede8fa408 (diff) |
POWERPC: overhaul with cpm2_map mechanism
Incorporating the new way of cpm2 immr access, introduced in the previous
patch, into CPM2 peripheral devices (fs_enet and cpm_uart). Both ppc and
powerpc approved working( real actions taken in powerpc only, ppc just
has a wrapper to keep init stuff consistent).
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_ads.c | 109 | ||||
-rw-r--r-- | arch/powerpc/sysdev/cpm2_common.c | 90 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 7 | ||||
-rw-r--r-- | arch/ppc/platforms/mpc8272ads_setup.c | 8 | ||||
-rw-r--r-- | arch/ppc/platforms/mpc866ads_setup.c | 8 | ||||
-rw-r--r-- | arch/ppc/platforms/mpc885ads_setup.c | 10 | ||||
-rw-r--r-- | drivers/net/fs_enet/fs_enet-main.c | 2 | ||||
-rw-r--r-- | drivers/serial/cpm_uart/cpm_uart_core.c | 4 | ||||
-rw-r--r-- | include/asm-ppc/cpm2.h | 53 | ||||
-rw-r--r-- | include/linux/fs_enet_pd.h | 10 | ||||
-rw-r--r-- | include/linux/fs_uart_pd.h | 4 |
11 files changed, 235 insertions, 70 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c index 7ebfe74bde40..28070e7ae507 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "mpc85xx.h" | 33 | #include "mpc85xx.h" |
34 | 34 | ||
35 | #ifdef CONFIG_CPM2 | 35 | #ifdef CONFIG_CPM2 |
36 | #include <linux/fs_enet_pd.h> | ||
36 | #include <asm/cpm2.h> | 37 | #include <asm/cpm2.h> |
37 | #include <sysdev/cpm2_pic.h> | 38 | #include <sysdev/cpm2_pic.h> |
38 | #include <asm/fs_pd.h> | 39 | #include <asm/fs_pd.h> |
@@ -146,70 +147,81 @@ void __init mpc85xx_ads_pic_init(void) | |||
146 | * Setup the architecture | 147 | * Setup the architecture |
147 | */ | 148 | */ |
148 | #ifdef CONFIG_CPM2 | 149 | #ifdef CONFIG_CPM2 |
149 | static void init_fcc_ioports(void) | 150 | void init_fcc_ioports(struct fs_platform_info *fpi) |
150 | { | 151 | { |
151 | struct immap *immap; | 152 | struct io_port *io = cpm2_map(im_ioport); |
152 | struct io_port *io; | 153 | int fcc_no = fs_get_fcc_index(fpi->fs_no); |
154 | int target; | ||
153 | u32 tempval; | 155 | u32 tempval; |
154 | 156 | ||
155 | immap = cpm2_immr; | 157 | switch(fcc_no) { |
156 | 158 | case 1: | |
157 | io = &immap->im_ioport; | 159 | tempval = in_be32(&io->iop_pdirb); |
158 | /* FCC2/3 are on the ports B/C. */ | 160 | tempval &= ~PB2_DIRB0; |
159 | tempval = in_be32(&io->iop_pdirb); | 161 | tempval |= PB2_DIRB1; |
160 | tempval &= ~PB2_DIRB0; | 162 | out_be32(&io->iop_pdirb, tempval); |
161 | tempval |= PB2_DIRB1; | 163 | |
162 | out_be32(&io->iop_pdirb, tempval); | 164 | tempval = in_be32(&io->iop_psorb); |
163 | 165 | tempval &= ~PB2_PSORB0; | |
164 | tempval = in_be32(&io->iop_psorb); | 166 | tempval |= PB2_PSORB1; |
165 | tempval &= ~PB2_PSORB0; | 167 | out_be32(&io->iop_psorb, tempval); |
166 | tempval |= PB2_PSORB1; | 168 | |
167 | out_be32(&io->iop_psorb, tempval); | 169 | tempval = in_be32(&io->iop_pparb); |
168 | 170 | tempval |= (PB2_DIRB0 | PB2_DIRB1); | |
169 | tempval = in_be32(&io->iop_pparb); | 171 | out_be32(&io->iop_pparb, tempval); |
170 | tempval |= (PB2_DIRB0 | PB2_DIRB1); | 172 | |
171 | out_be32(&io->iop_pparb, tempval); | 173 | target = CPM_CLK_FCC2; |
172 | 174 | break; | |
173 | tempval = in_be32(&io->iop_pdirb); | 175 | case 2: |
174 | tempval &= ~PB3_DIRB0; | 176 | tempval = in_be32(&io->iop_pdirb); |
175 | tempval |= PB3_DIRB1; | 177 | tempval &= ~PB3_DIRB0; |
176 | out_be32(&io->iop_pdirb, tempval); | 178 | tempval |= PB3_DIRB1; |
177 | 179 | out_be32(&io->iop_pdirb, tempval); | |
178 | tempval = in_be32(&io->iop_psorb); | 180 | |
179 | tempval &= ~PB3_PSORB0; | 181 | tempval = in_be32(&io->iop_psorb); |
180 | tempval |= PB3_PSORB1; | 182 | tempval &= ~PB3_PSORB0; |
181 | out_be32(&io->iop_psorb, tempval); | 183 | tempval |= PB3_PSORB1; |
182 | 184 | out_be32(&io->iop_psorb, tempval); | |
183 | tempval = in_be32(&io->iop_pparb); | 185 | |
184 | tempval |= (PB3_DIRB0 | PB3_DIRB1); | 186 | tempval = in_be32(&io->iop_pparb); |
185 | out_be32(&io->iop_pparb, tempval); | 187 | tempval |= (PB3_DIRB0 | PB3_DIRB1); |
186 | 188 | out_be32(&io->iop_pparb, tempval); | |
187 | tempval = in_be32(&io->iop_pdirc); | 189 | |
188 | tempval |= PC3_DIRC1; | 190 | tempval = in_be32(&io->iop_pdirc); |
189 | out_be32(&io->iop_pdirc, tempval); | 191 | tempval |= PC3_DIRC1; |
190 | 192 | out_be32(&io->iop_pdirc, tempval); | |
191 | tempval = in_be32(&io->iop_pparc); | 193 | |
192 | tempval |= PC3_DIRC1; | 194 | tempval = in_be32(&io->iop_pparc); |
193 | out_be32(&io->iop_pparc, tempval); | 195 | tempval |= PC3_DIRC1; |
196 | out_be32(&io->iop_pparc, tempval); | ||
197 | |||
198 | target = CPM_CLK_FCC3; | ||
199 | break; | ||
200 | default: | ||
201 | printk(KERN_ERR "init_fcc_ioports: invalid FCC number\n"); | ||
202 | return; | ||
203 | } | ||
194 | 204 | ||
195 | /* Port C has clocks...... */ | 205 | /* Port C has clocks...... */ |
196 | tempval = in_be32(&io->iop_psorc); | 206 | tempval = in_be32(&io->iop_psorc); |
197 | tempval &= ~(CLK_TRX); | 207 | tempval &= ~(PC_CLK(fpi->clk_rx - 8) | PC_CLK(fpi->clk_tx - 8)); |
198 | out_be32(&io->iop_psorc, tempval); | 208 | out_be32(&io->iop_psorc, tempval); |
199 | 209 | ||
200 | tempval = in_be32(&io->iop_pdirc); | 210 | tempval = in_be32(&io->iop_pdirc); |
201 | tempval &= ~(CLK_TRX); | 211 | tempval &= ~(PC_CLK(fpi->clk_rx - 8) | PC_CLK(fpi->clk_tx - 8)); |
202 | out_be32(&io->iop_pdirc, tempval); | 212 | out_be32(&io->iop_pdirc, tempval); |
203 | tempval = in_be32(&io->iop_pparc); | 213 | tempval = in_be32(&io->iop_pparc); |
204 | tempval |= (CLK_TRX); | 214 | tempval |= (PC_CLK(fpi->clk_rx - 8) | PC_CLK(fpi->clk_tx - 8)); |
205 | out_be32(&io->iop_pparc, tempval); | 215 | out_be32(&io->iop_pparc, tempval); |
206 | 216 | ||
217 | cpm2_unmap(io); | ||
218 | |||
207 | /* Configure Serial Interface clock routing. | 219 | /* Configure Serial Interface clock routing. |
208 | * First, clear all FCC bits to zero, | 220 | * First, clear FCC bits to zero, |
209 | * then set the ones we want. | 221 | * then set the ones we want. |
210 | */ | 222 | */ |
211 | immap->im_cpmux.cmx_fcr &= ~(CPMUX_CLK_MASK); | 223 | cpm2_clk_setup(target, fpi->clk_rx, CPM_CLK_RX); |
212 | immap->im_cpmux.cmx_fcr |= CPMUX_CLK_ROUTE; | 224 | cpm2_clk_setup(target, fpi->clk_tx, CPM_CLK_TX); |
213 | } | 225 | } |
214 | #endif | 226 | #endif |
215 | 227 | ||
@@ -237,7 +249,6 @@ static void __init mpc85xx_ads_setup_arch(void) | |||
237 | 249 | ||
238 | #ifdef CONFIG_CPM2 | 250 | #ifdef CONFIG_CPM2 |
239 | cpm2_reset(); | 251 | cpm2_reset(); |
240 | init_fcc_ioports(); | ||
241 | #endif | 252 | #endif |
242 | 253 | ||
243 | #ifdef CONFIG_PCI | 254 | #ifdef CONFIG_PCI |
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c index 73376f9c1560..ec265995d5d8 100644 --- a/arch/powerpc/sysdev/cpm2_common.c +++ b/arch/powerpc/sysdev/cpm2_common.c | |||
@@ -130,6 +130,96 @@ cpm2_fastbrg(uint brg, uint rate, int div16) | |||
130 | cpm2_unmap(bp); | 130 | cpm2_unmap(bp); |
131 | } | 131 | } |
132 | 132 | ||
133 | int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode) | ||
134 | { | ||
135 | int ret = 0; | ||
136 | int shift; | ||
137 | int i, bits = 0; | ||
138 | cpmux_t *im_cpmux; | ||
139 | u32 *reg; | ||
140 | u32 mask = 7; | ||
141 | u8 clk_map [24][3] = { | ||
142 | {CPM_CLK_FCC1, CPM_BRG5, 0}, | ||
143 | {CPM_CLK_FCC1, CPM_BRG6, 1}, | ||
144 | {CPM_CLK_FCC1, CPM_BRG7, 2}, | ||
145 | {CPM_CLK_FCC1, CPM_BRG8, 3}, | ||
146 | {CPM_CLK_FCC1, CPM_CLK9, 4}, | ||
147 | {CPM_CLK_FCC1, CPM_CLK10, 5}, | ||
148 | {CPM_CLK_FCC1, CPM_CLK11, 6}, | ||
149 | {CPM_CLK_FCC1, CPM_CLK12, 7}, | ||
150 | {CPM_CLK_FCC2, CPM_BRG5, 0}, | ||
151 | {CPM_CLK_FCC2, CPM_BRG6, 1}, | ||
152 | {CPM_CLK_FCC2, CPM_BRG7, 2}, | ||
153 | {CPM_CLK_FCC2, CPM_BRG8, 3}, | ||
154 | {CPM_CLK_FCC2, CPM_CLK13, 4}, | ||
155 | {CPM_CLK_FCC2, CPM_CLK14, 5}, | ||
156 | {CPM_CLK_FCC2, CPM_CLK15, 6}, | ||
157 | {CPM_CLK_FCC2, CPM_CLK16, 7}, | ||
158 | {CPM_CLK_FCC3, CPM_BRG5, 0}, | ||
159 | {CPM_CLK_FCC3, CPM_BRG6, 1}, | ||
160 | {CPM_CLK_FCC3, CPM_BRG7, 2}, | ||
161 | {CPM_CLK_FCC3, CPM_BRG8, 3}, | ||
162 | {CPM_CLK_FCC3, CPM_CLK13, 4}, | ||
163 | {CPM_CLK_FCC3, CPM_CLK14, 5}, | ||
164 | {CPM_CLK_FCC3, CPM_CLK15, 6}, | ||
165 | {CPM_CLK_FCC3, CPM_CLK16, 7} | ||
166 | }; | ||
167 | |||
168 | im_cpmux = cpm2_map(im_cpmux); | ||
169 | |||
170 | switch (target) { | ||
171 | case CPM_CLK_SCC1: | ||
172 | reg = &im_cpmux->cmx_scr; | ||
173 | shift = 24; | ||
174 | case CPM_CLK_SCC2: | ||
175 | reg = &im_cpmux->cmx_scr; | ||
176 | shift = 16; | ||
177 | break; | ||
178 | case CPM_CLK_SCC3: | ||
179 | reg = &im_cpmux->cmx_scr; | ||
180 | shift = 8; | ||
181 | break; | ||
182 | case CPM_CLK_SCC4: | ||
183 | reg = &im_cpmux->cmx_scr; | ||
184 | shift = 0; | ||
185 | break; | ||
186 | case CPM_CLK_FCC1: | ||
187 | reg = &im_cpmux->cmx_fcr; | ||
188 | shift = 24; | ||
189 | break; | ||
190 | case CPM_CLK_FCC2: | ||
191 | reg = &im_cpmux->cmx_fcr; | ||
192 | shift = 16; | ||
193 | break; | ||
194 | case CPM_CLK_FCC3: | ||
195 | reg = &im_cpmux->cmx_fcr; | ||
196 | shift = 8; | ||
197 | break; | ||
198 | default: | ||
199 | printk(KERN_ERR "cpm2_clock_setup: invalid clock target\n"); | ||
200 | return -EINVAL; | ||
201 | } | ||
202 | |||
203 | if (mode == CPM_CLK_RX) | ||
204 | shift +=3; | ||
205 | |||
206 | for (i=0; i<24; i++) { | ||
207 | if (clk_map[i][0] == target && clk_map[i][1] == clock) { | ||
208 | bits = clk_map[i][2]; | ||
209 | break; | ||
210 | } | ||
211 | } | ||
212 | if (i == sizeof(clk_map)/3) | ||
213 | ret = -EINVAL; | ||
214 | |||
215 | bits <<= shift; | ||
216 | mask <<= shift; | ||
217 | out_be32(reg, (in_be32(reg) & ~mask) | bits); | ||
218 | |||
219 | cpm2_unmap(im_cpmux); | ||
220 | return ret; | ||
221 | } | ||
222 | |||
133 | /* | 223 | /* |
134 | * dpalloc / dpfree bits. | 224 | * dpalloc / dpfree bits. |
135 | */ | 225 | */ |
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 0b8a03cc3042..4e72bb983636 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <mm/mmu_decl.h> | 36 | #include <mm/mmu_decl.h> |
37 | #include <asm/cpm2.h> | 37 | #include <asm/cpm2.h> |
38 | 38 | ||
39 | extern void init_fcc_ioports(struct fs_platform_info*); | ||
39 | static phys_addr_t immrbase = -1; | 40 | static phys_addr_t immrbase = -1; |
40 | 41 | ||
41 | phys_addr_t get_immrbase(void) | 42 | phys_addr_t get_immrbase(void) |
@@ -630,6 +631,9 @@ static int __init fs_enet_of_init(void) | |||
630 | goto unreg; | 631 | goto unreg; |
631 | } | 632 | } |
632 | 633 | ||
634 | fs_enet_data.clk_rx = *((u32 *) get_property(np, "rx-clock", NULL)); | ||
635 | fs_enet_data.clk_tx = *((u32 *) get_property(np, "tx-clock", NULL)); | ||
636 | |||
633 | if (strstr(model, "FCC")) { | 637 | if (strstr(model, "FCC")) { |
634 | int fcc_index = fs_get_fcc_index(*id); | 638 | int fcc_index = fs_get_fcc_index(*id); |
635 | 639 | ||
@@ -646,6 +650,7 @@ static int __init fs_enet_of_init(void) | |||
646 | snprintf((char*)&bus_id[(*id)], BUS_ID_SIZE, "%x:%02x", | 650 | snprintf((char*)&bus_id[(*id)], BUS_ID_SIZE, "%x:%02x", |
647 | (u32)res.start, fs_enet_data.phy_addr); | 651 | (u32)res.start, fs_enet_data.phy_addr); |
648 | fs_enet_data.bus_id = (char*)&bus_id[(*id)]; | 652 | fs_enet_data.bus_id = (char*)&bus_id[(*id)]; |
653 | fs_enet_data.init_ioports = init_fcc_ioports; | ||
649 | } | 654 | } |
650 | 655 | ||
651 | of_node_put(phy); | 656 | of_node_put(phy); |
@@ -717,6 +722,8 @@ static int __init cpm_uart_of_init(void) | |||
717 | cpm_uart_data.tx_buf_size = 32; | 722 | cpm_uart_data.tx_buf_size = 32; |
718 | cpm_uart_data.rx_num_fifo = 4; | 723 | cpm_uart_data.rx_num_fifo = 4; |
719 | cpm_uart_data.rx_buf_size = 32; | 724 | cpm_uart_data.rx_buf_size = 32; |
725 | cpm_uart_data.clk_rx = *((u32 *) get_property(np, "rx-clock", NULL)); | ||
726 | cpm_uart_data.clk_tx = *((u32 *) get_property(np, "tx-clock", NULL)); | ||
720 | 727 | ||
721 | ret = | 728 | ret = |
722 | platform_device_add_data(cpm_uart_dev, &cpm_uart_data, | 729 | platform_device_add_data(cpm_uart_dev, &cpm_uart_data, |
diff --git a/arch/ppc/platforms/mpc8272ads_setup.c b/arch/ppc/platforms/mpc8272ads_setup.c index 2a35fe2b9b96..d5d36c372c8e 100644 --- a/arch/ppc/platforms/mpc8272ads_setup.c +++ b/arch/ppc/platforms/mpc8272ads_setup.c | |||
@@ -103,7 +103,7 @@ static struct fs_platform_info mpc82xx_enet_pdata[] = { | |||
103 | }, | 103 | }, |
104 | }; | 104 | }; |
105 | 105 | ||
106 | static void init_fcc1_ioports(void) | 106 | static void init_fcc1_ioports(struct fs_platform_info*) |
107 | { | 107 | { |
108 | struct io_port *io; | 108 | struct io_port *io; |
109 | u32 tempval; | 109 | u32 tempval; |
@@ -144,7 +144,7 @@ static void init_fcc1_ioports(void) | |||
144 | iounmap(immap); | 144 | iounmap(immap); |
145 | } | 145 | } |
146 | 146 | ||
147 | static void init_fcc2_ioports(void) | 147 | static void init_fcc2_ioports(struct fs_platform_info*) |
148 | { | 148 | { |
149 | cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t)); | 149 | cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t)); |
150 | u32 *bcsr = ioremap(BCSR_ADDR+12, sizeof(u32)); | 150 | u32 *bcsr = ioremap(BCSR_ADDR+12, sizeof(u32)); |
@@ -229,7 +229,7 @@ static void mpc8272ads_fixup_uart_pdata(struct platform_device *pdev, | |||
229 | } | 229 | } |
230 | } | 230 | } |
231 | 231 | ||
232 | static void init_scc1_uart_ioports(void) | 232 | static void init_scc1_uart_ioports(struct fs_uart_platform_info*) |
233 | { | 233 | { |
234 | cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t)); | 234 | cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t)); |
235 | 235 | ||
@@ -246,7 +246,7 @@ static void init_scc1_uart_ioports(void) | |||
246 | iounmap(immap); | 246 | iounmap(immap); |
247 | } | 247 | } |
248 | 248 | ||
249 | static void init_scc4_uart_ioports(void) | 249 | static void init_scc4_uart_ioports(struct fs_uart_platform_info*) |
250 | { | 250 | { |
251 | cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t)); | 251 | cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t)); |
252 | 252 | ||
diff --git a/arch/ppc/platforms/mpc866ads_setup.c b/arch/ppc/platforms/mpc866ads_setup.c index e12cece4c9fd..5f130dca3770 100644 --- a/arch/ppc/platforms/mpc866ads_setup.c +++ b/arch/ppc/platforms/mpc866ads_setup.c | |||
@@ -137,7 +137,7 @@ void __init board_init(void) | |||
137 | iounmap(bcsr_io); | 137 | iounmap(bcsr_io); |
138 | } | 138 | } |
139 | 139 | ||
140 | static void setup_fec1_ioports(void) | 140 | static void setup_fec1_ioports(struct fs_platform_info*) |
141 | { | 141 | { |
142 | immap_t *immap = (immap_t *) IMAP_ADDR; | 142 | immap_t *immap = (immap_t *) IMAP_ADDR; |
143 | 143 | ||
@@ -145,7 +145,7 @@ static void setup_fec1_ioports(void) | |||
145 | setbits16(&immap->im_ioport.iop_pddir, 0x1fff); | 145 | setbits16(&immap->im_ioport.iop_pddir, 0x1fff); |
146 | } | 146 | } |
147 | 147 | ||
148 | static void setup_scc1_ioports(void) | 148 | static void setup_scc1_ioports(struct fs_platform_info*) |
149 | { | 149 | { |
150 | immap_t *immap = (immap_t *) IMAP_ADDR; | 150 | immap_t *immap = (immap_t *) IMAP_ADDR; |
151 | unsigned *bcsr_io; | 151 | unsigned *bcsr_io; |
@@ -194,7 +194,7 @@ static void setup_scc1_ioports(void) | |||
194 | 194 | ||
195 | } | 195 | } |
196 | 196 | ||
197 | static void setup_smc1_ioports(void) | 197 | static void setup_smc1_ioports(struct fs_uart_platform_info*) |
198 | { | 198 | { |
199 | immap_t *immap = (immap_t *) IMAP_ADDR; | 199 | immap_t *immap = (immap_t *) IMAP_ADDR; |
200 | unsigned *bcsr_io; | 200 | unsigned *bcsr_io; |
@@ -216,7 +216,7 @@ static void setup_smc1_ioports(void) | |||
216 | 216 | ||
217 | } | 217 | } |
218 | 218 | ||
219 | static void setup_smc2_ioports(void) | 219 | static void setup_smc2_ioports(struct fs_uart_platform_info*) |
220 | { | 220 | { |
221 | immap_t *immap = (immap_t *) IMAP_ADDR; | 221 | immap_t *immap = (immap_t *) IMAP_ADDR; |
222 | unsigned *bcsr_io; | 222 | unsigned *bcsr_io; |
diff --git a/arch/ppc/platforms/mpc885ads_setup.c b/arch/ppc/platforms/mpc885ads_setup.c index 5dfa4e6c2af0..bf388ed04d46 100644 --- a/arch/ppc/platforms/mpc885ads_setup.c +++ b/arch/ppc/platforms/mpc885ads_setup.c | |||
@@ -161,7 +161,7 @@ void __init board_init(void) | |||
161 | #endif | 161 | #endif |
162 | } | 162 | } |
163 | 163 | ||
164 | static void setup_fec1_ioports(void) | 164 | static void setup_fec1_ioports(struct fs_platform_info*) |
165 | { | 165 | { |
166 | immap_t *immap = (immap_t *) IMAP_ADDR; | 166 | immap_t *immap = (immap_t *) IMAP_ADDR; |
167 | 167 | ||
@@ -181,7 +181,7 @@ static void setup_fec1_ioports(void) | |||
181 | clrbits32(&immap->im_cpm.cp_cptr, 0x00000100); | 181 | clrbits32(&immap->im_cpm.cp_cptr, 0x00000100); |
182 | } | 182 | } |
183 | 183 | ||
184 | static void setup_fec2_ioports(void) | 184 | static void setup_fec2_ioports(struct fs_platform_info*) |
185 | { | 185 | { |
186 | immap_t *immap = (immap_t *) IMAP_ADDR; | 186 | immap_t *immap = (immap_t *) IMAP_ADDR; |
187 | 187 | ||
@@ -193,7 +193,7 @@ static void setup_fec2_ioports(void) | |||
193 | clrbits32(&immap->im_cpm.cp_cptr, 0x00000080); | 193 | clrbits32(&immap->im_cpm.cp_cptr, 0x00000080); |
194 | } | 194 | } |
195 | 195 | ||
196 | static void setup_scc3_ioports(void) | 196 | static void setup_scc3_ioports(struct fs_platform_info*) |
197 | { | 197 | { |
198 | immap_t *immap = (immap_t *) IMAP_ADDR; | 198 | immap_t *immap = (immap_t *) IMAP_ADDR; |
199 | unsigned *bcsr_io; | 199 | unsigned *bcsr_io; |
@@ -315,7 +315,7 @@ static void __init mpc885ads_fixup_scc_enet_pdata(struct platform_device *pdev, | |||
315 | mpc885ads_fixup_enet_pdata(pdev, fsid_scc1 + pdev->id - 1); | 315 | mpc885ads_fixup_enet_pdata(pdev, fsid_scc1 + pdev->id - 1); |
316 | } | 316 | } |
317 | 317 | ||
318 | static void setup_smc1_ioports(void) | 318 | static void setup_smc1_ioports(struct fs_uart_platform_info*) |
319 | { | 319 | { |
320 | immap_t *immap = (immap_t *) IMAP_ADDR; | 320 | immap_t *immap = (immap_t *) IMAP_ADDR; |
321 | unsigned *bcsr_io; | 321 | unsigned *bcsr_io; |
@@ -335,7 +335,7 @@ static void setup_smc1_ioports(void) | |||
335 | clrbits16(&immap->im_cpm.cp_pbodr, iobits); | 335 | clrbits16(&immap->im_cpm.cp_pbodr, iobits); |
336 | } | 336 | } |
337 | 337 | ||
338 | static void setup_smc2_ioports(void) | 338 | static void setup_smc2_ioports(struct fs_uart_platform_info*) |
339 | { | 339 | { |
340 | immap_t *immap = (immap_t *) IMAP_ADDR; | 340 | immap_t *immap = (immap_t *) IMAP_ADDR; |
341 | unsigned *bcsr_io; | 341 | unsigned *bcsr_io; |
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index df62506a1787..f358ee61d9b9 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -971,7 +971,7 @@ static struct net_device *fs_init_instance(struct device *dev, | |||
971 | dev_set_drvdata(dev, ndev); | 971 | dev_set_drvdata(dev, ndev); |
972 | fep->fpi = fpi; | 972 | fep->fpi = fpi; |
973 | if (fpi->init_ioports) | 973 | if (fpi->init_ioports) |
974 | fpi->init_ioports(); | 974 | fpi->init_ioports((struct fs_platform_info *)fpi); |
975 | 975 | ||
976 | #ifdef CONFIG_FS_ENET_HAS_FEC | 976 | #ifdef CONFIG_FS_ENET_HAS_FEC |
977 | if (fs_get_fec_index(fpi->fs_no) >= 0) | 977 | if (fs_get_fec_index(fpi->fs_no) >= 0) |
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index dfa06b644957..24613a68f5cc 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c | |||
@@ -1180,7 +1180,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1180 | pdata = pdev->dev.platform_data; | 1180 | pdata = pdev->dev.platform_data; |
1181 | if (pdata) | 1181 | if (pdata) |
1182 | if (pdata->init_ioports) | 1182 | if (pdata->init_ioports) |
1183 | pdata->init_ioports(); | 1183 | pdata->init_ioports(pdata); |
1184 | 1184 | ||
1185 | cpm_uart_drv_get_platform_data(pdev, 1); | 1185 | cpm_uart_drv_get_platform_data(pdev, 1); |
1186 | } | 1186 | } |
@@ -1269,7 +1269,7 @@ static int cpm_uart_drv_probe(struct device *dev) | |||
1269 | return ret; | 1269 | return ret; |
1270 | 1270 | ||
1271 | if (pdata->init_ioports) | 1271 | if (pdata->init_ioports) |
1272 | pdata->init_ioports(); | 1272 | pdata->init_ioports(pdata); |
1273 | 1273 | ||
1274 | ret = uart_add_one_port(&cpm_reg, &cpm_uart_ports[pdata->fs_no].port); | 1274 | ret = uart_add_one_port(&cpm_reg, &cpm_uart_ports[pdata->fs_no].port); |
1275 | 1275 | ||
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h index bd6623aed383..220cc2debe08 100644 --- a/include/asm-ppc/cpm2.h +++ b/include/asm-ppc/cpm2.h | |||
@@ -1196,5 +1196,58 @@ typedef struct im_idma { | |||
1196 | #define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1) | 1196 | #define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1) |
1197 | #define FCC3_MEM_OFFSET FCC_MEM_OFFSET(2) | 1197 | #define FCC3_MEM_OFFSET FCC_MEM_OFFSET(2) |
1198 | 1198 | ||
1199 | /* Clocks and GRG's */ | ||
1200 | |||
1201 | enum cpm_clk_dir { | ||
1202 | CPM_CLK_RX, | ||
1203 | CPM_CLK_TX, | ||
1204 | CPM_CLK_RTX | ||
1205 | }; | ||
1206 | |||
1207 | enum cpm_clk_target { | ||
1208 | CPM_CLK_SCC1, | ||
1209 | CPM_CLK_SCC2, | ||
1210 | CPM_CLK_SCC3, | ||
1211 | CPM_CLK_SCC4, | ||
1212 | CPM_CLK_FCC1, | ||
1213 | CPM_CLK_FCC2, | ||
1214 | CPM_CLK_FCC3 | ||
1215 | }; | ||
1216 | |||
1217 | enum cpm_clk { | ||
1218 | CPM_CLK_NONE = 0, | ||
1219 | CPM_BRG1, /* Baud Rate Generator 1 */ | ||
1220 | CPM_BRG2, /* Baud Rate Generator 2 */ | ||
1221 | CPM_BRG3, /* Baud Rate Generator 3 */ | ||
1222 | CPM_BRG4, /* Baud Rate Generator 4 */ | ||
1223 | CPM_BRG5, /* Baud Rate Generator 5 */ | ||
1224 | CPM_BRG6, /* Baud Rate Generator 6 */ | ||
1225 | CPM_BRG7, /* Baud Rate Generator 7 */ | ||
1226 | CPM_BRG8, /* Baud Rate Generator 8 */ | ||
1227 | CPM_CLK1, /* Clock 1 */ | ||
1228 | CPM_CLK2, /* Clock 2 */ | ||
1229 | CPM_CLK3, /* Clock 3 */ | ||
1230 | CPM_CLK4, /* Clock 4 */ | ||
1231 | CPM_CLK5, /* Clock 5 */ | ||
1232 | CPM_CLK6, /* Clock 6 */ | ||
1233 | CPM_CLK7, /* Clock 7 */ | ||
1234 | CPM_CLK8, /* Clock 8 */ | ||
1235 | CPM_CLK9, /* Clock 9 */ | ||
1236 | CPM_CLK10, /* Clock 10 */ | ||
1237 | CPM_CLK11, /* Clock 11 */ | ||
1238 | CPM_CLK12, /* Clock 12 */ | ||
1239 | CPM_CLK13, /* Clock 13 */ | ||
1240 | CPM_CLK14, /* Clock 14 */ | ||
1241 | CPM_CLK15, /* Clock 15 */ | ||
1242 | CPM_CLK16, /* Clock 16 */ | ||
1243 | CPM_CLK17, /* Clock 17 */ | ||
1244 | CPM_CLK18, /* Clock 18 */ | ||
1245 | CPM_CLK19, /* Clock 19 */ | ||
1246 | CPM_CLK20, /* Clock 20 */ | ||
1247 | CPM_CLK_DUMMY | ||
1248 | }; | ||
1249 | |||
1250 | extern int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode); | ||
1251 | |||
1199 | #endif /* __CPM2__ */ | 1252 | #endif /* __CPM2__ */ |
1200 | #endif /* __KERNEL__ */ | 1253 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h index 74ed35a00a94..932223550aca 100644 --- a/include/linux/fs_enet_pd.h +++ b/include/linux/fs_enet_pd.h | |||
@@ -87,18 +87,20 @@ struct fs_mii_bb_platform_info { | |||
87 | }; | 87 | }; |
88 | 88 | ||
89 | struct fs_platform_info { | 89 | struct fs_platform_info { |
90 | 90 | ||
91 | void(*init_ioports)(void); | 91 | void(*init_ioports)(struct fs_platform_info *); |
92 | /* device specific information */ | 92 | /* device specific information */ |
93 | int fs_no; /* controller index */ | 93 | int fs_no; /* controller index */ |
94 | 94 | ||
95 | u32 cp_page; /* CPM page */ | 95 | u32 cp_page; /* CPM page */ |
96 | u32 cp_block; /* CPM sblock */ | 96 | u32 cp_block; /* CPM sblock */ |
97 | 97 | ||
98 | u32 clk_trx; /* some stuff for pins & mux configuration*/ | 98 | u32 clk_trx; /* some stuff for pins & mux configuration*/ |
99 | u32 clk_rx; | ||
100 | u32 clk_tx; | ||
99 | u32 clk_route; | 101 | u32 clk_route; |
100 | u32 clk_mask; | 102 | u32 clk_mask; |
101 | 103 | ||
102 | u32 mem_offset; | 104 | u32 mem_offset; |
103 | u32 dpram_offset; | 105 | u32 dpram_offset; |
104 | u32 fcc_regs_c; | 106 | u32 fcc_regs_c; |
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h index f5975126b712..a99a020f95c2 100644 --- a/include/linux/fs_uart_pd.h +++ b/include/linux/fs_uart_pd.h | |||
@@ -46,7 +46,7 @@ static inline int fs_uart_id_fsid2smc(int id) | |||
46 | } | 46 | } |
47 | 47 | ||
48 | struct fs_uart_platform_info { | 48 | struct fs_uart_platform_info { |
49 | void(*init_ioports)(void); | 49 | void(*init_ioports)(struct fs_uart_platform_info *); |
50 | /* device specific information */ | 50 | /* device specific information */ |
51 | int fs_no; /* controller index */ | 51 | int fs_no; /* controller index */ |
52 | u32 uart_clk; | 52 | u32 uart_clk; |
@@ -55,6 +55,8 @@ struct fs_uart_platform_info { | |||
55 | u8 rx_num_fifo; | 55 | u8 rx_num_fifo; |
56 | u8 rx_buf_size; | 56 | u8 rx_buf_size; |
57 | u8 brg; | 57 | u8 brg; |
58 | u8 clk_rx; | ||
59 | u8 clk_tx; | ||
58 | }; | 60 | }; |
59 | 61 | ||
60 | #endif | 62 | #endif |