aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/85xx/mpc85xx_ads.c
diff options
context:
space:
mode:
authorVitaly Bordug <vbordug@ru.mvista.com>2006-09-21 14:31:26 -0400
committerVitaly Bordug <vbordug@ru.mvista.com>2006-09-21 14:31:26 -0400
commit902f392d011d0a781ea4695c464345faa6664540 (patch)
treed47305185bba9e2c1d1cc5a7a87aeba7b3c64aa7 /arch/powerpc/platforms/85xx/mpc85xx_ads.c
parentb0c110b4f19b226dcc9f7805759bf17f8ef4dca4 (diff)
POWERPC: Add support for the mpc8560 eval board
This makes the 8560 evaluation board fully supported under arch/powerpc, as the first board with CPM2 SoC peripherals. The brand new devicetree nodes are introduced (intending to be a subset of the QuiccEngine-equipped models, with dts sources placed into the kernel according to the new convention. Assuming all the preceding stuff applied (PAL+fs_enet related+ CPM_UART update), the both TSEC eth ,FCC Eths, and both SCC UARTs are working. The relevant drivers are still capable to drive users in ppc, which was verified with 8272ADS (SCC uart+FCC eth). This is also verified on mpc8540 and actually make it work (PCI stuff working as well) Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Diffstat (limited to 'arch/powerpc/platforms/85xx/mpc85xx_ads.c')
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c109
1 files changed, 109 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index cae6b73357d5..7ebfe74bde40 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -32,6 +32,12 @@
32#include <sysdev/fsl_soc.h> 32#include <sysdev/fsl_soc.h>
33#include "mpc85xx.h" 33#include "mpc85xx.h"
34 34
35#ifdef CONFIG_CPM2
36#include <asm/cpm2.h>
37#include <sysdev/cpm2_pic.h>
38#include <asm/fs_pd.h>
39#endif
40
35#ifndef CONFIG_PCI 41#ifndef CONFIG_PCI
36unsigned long isa_io_base = 0; 42unsigned long isa_io_base = 0;
37unsigned long isa_mem_base = 0; 43unsigned long isa_mem_base = 0;
@@ -57,12 +63,29 @@ mpc85xx_pcibios_fixup(void)
57} 63}
58#endif /* CONFIG_PCI */ 64#endif /* CONFIG_PCI */
59 65
66#ifdef CONFIG_CPM2
67
68static void cpm2_cascade(unsigned int irq, struct irq_desc *desc,
69 struct pt_regs *regs)
70{
71 int cascade_irq;
72
73 while ((cascade_irq = cpm2_get_irq(regs)) >= 0) {
74 generic_handle_irq(cascade_irq, regs);
75 }
76 desc->chip->eoi(irq);
77}
78
79#endif /* CONFIG_CPM2 */
60 80
61void __init mpc85xx_ads_pic_init(void) 81void __init mpc85xx_ads_pic_init(void)
62{ 82{
63 struct mpic *mpic; 83 struct mpic *mpic;
64 struct resource r; 84 struct resource r;
65 struct device_node *np = NULL; 85 struct device_node *np = NULL;
86#ifdef CONFIG_CPM2
87 int irq;
88#endif
66 89
67 np = of_find_node_by_type(np, "open-pic"); 90 np = of_find_node_by_type(np, "open-pic");
68 91
@@ -104,11 +127,92 @@ void __init mpc85xx_ads_pic_init(void)
104 mpic_assign_isu(mpic, 14, r.start + 0x10100); 127 mpic_assign_isu(mpic, 14, r.start + 0x10100);
105 128
106 mpic_init(mpic); 129 mpic_init(mpic);
130
131#ifdef CONFIG_CPM2
132 /* Setup CPM2 PIC */
133 np = of_find_node_by_type(NULL, "cpm-pic");
134 if (np == NULL) {
135 printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
136 return;
137 }
138 irq = irq_of_parse_and_map(np, 0);
139
140 cpm2_pic_init(np);
141 set_irq_chained_handler(irq, cpm2_cascade);
142#endif
107} 143}
108 144
109/* 145/*
110 * Setup the architecture 146 * Setup the architecture
111 */ 147 */
148#ifdef CONFIG_CPM2
149static void init_fcc_ioports(void)
150{
151 struct immap *immap;
152 struct io_port *io;
153 u32 tempval;
154
155 immap = cpm2_immr;
156
157 io = &immap->im_ioport;
158 /* FCC2/3 are on the ports B/C. */
159 tempval = in_be32(&io->iop_pdirb);
160 tempval &= ~PB2_DIRB0;
161 tempval |= PB2_DIRB1;
162 out_be32(&io->iop_pdirb, tempval);
163
164 tempval = in_be32(&io->iop_psorb);
165 tempval &= ~PB2_PSORB0;
166 tempval |= PB2_PSORB1;
167 out_be32(&io->iop_psorb, tempval);
168
169 tempval = in_be32(&io->iop_pparb);
170 tempval |= (PB2_DIRB0 | PB2_DIRB1);
171 out_be32(&io->iop_pparb, tempval);
172
173 tempval = in_be32(&io->iop_pdirb);
174 tempval &= ~PB3_DIRB0;
175 tempval |= PB3_DIRB1;
176 out_be32(&io->iop_pdirb, tempval);
177
178 tempval = in_be32(&io->iop_psorb);
179 tempval &= ~PB3_PSORB0;
180 tempval |= PB3_PSORB1;
181 out_be32(&io->iop_psorb, tempval);
182
183 tempval = in_be32(&io->iop_pparb);
184 tempval |= (PB3_DIRB0 | PB3_DIRB1);
185 out_be32(&io->iop_pparb, tempval);
186
187 tempval = in_be32(&io->iop_pdirc);
188 tempval |= PC3_DIRC1;
189 out_be32(&io->iop_pdirc, tempval);
190
191 tempval = in_be32(&io->iop_pparc);
192 tempval |= PC3_DIRC1;
193 out_be32(&io->iop_pparc, tempval);
194
195 /* Port C has clocks...... */
196 tempval = in_be32(&io->iop_psorc);
197 tempval &= ~(CLK_TRX);
198 out_be32(&io->iop_psorc, tempval);
199
200 tempval = in_be32(&io->iop_pdirc);
201 tempval &= ~(CLK_TRX);
202 out_be32(&io->iop_pdirc, tempval);
203 tempval = in_be32(&io->iop_pparc);
204 tempval |= (CLK_TRX);
205 out_be32(&io->iop_pparc, tempval);
206
207 /* Configure Serial Interface clock routing.
208 * First, clear all FCC bits to zero,
209 * then set the ones we want.
210 */
211 immap->im_cpmux.cmx_fcr &= ~(CPMUX_CLK_MASK);
212 immap->im_cpmux.cmx_fcr |= CPMUX_CLK_ROUTE;
213}
214#endif
215
112static void __init mpc85xx_ads_setup_arch(void) 216static void __init mpc85xx_ads_setup_arch(void)
113{ 217{
114 struct device_node *cpu; 218 struct device_node *cpu;
@@ -131,6 +235,11 @@ static void __init mpc85xx_ads_setup_arch(void)
131 of_node_put(cpu); 235 of_node_put(cpu);
132 } 236 }
133 237
238#ifdef CONFIG_CPM2
239 cpm2_reset();
240 init_fcc_ioports();
241#endif
242
134#ifdef CONFIG_PCI 243#ifdef CONFIG_PCI
135 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 244 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
136 add_bridge(np); 245 add_bridge(np);