diff options
author | Holger Brunck <holger.brunck@keymile.com> | 2011-03-10 06:52:45 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2011-03-15 11:06:37 -0400 |
commit | c513e7c9f7df989124d3b668245df419e9141ca9 (patch) | |
tree | 616bf027406341db0062c23a2dc1d2b80a083ab8 /arch/powerpc/platforms | |
parent | 93e2b95c81042da479656b213acc92f7542c6c39 (diff) |
powerpc/82xx: rename and update mgcoge board support
The mgcoge board from keymile is now base for some other
similar boards. Therefore the board specific name mgcoge
was renamed to a generic name km82xx. Additionally some
enhancements were made:
- rework partition table in dts file
- add cpm2_pio_c gpio controller in dts file
- update defconfig
- add pin description for SCC1
- add pin description and configuration for USB
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Heiko Schocher <hs@denx.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/82xx/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/82xx/km82xx.c (renamed from arch/powerpc/platforms/82xx/mgcoge.c) | 62 |
2 files changed, 45 insertions, 19 deletions
diff --git a/arch/powerpc/platforms/82xx/Makefile b/arch/powerpc/platforms/82xx/Makefile index d982793f4dbd..455fe21e37c4 100644 --- a/arch/powerpc/platforms/82xx/Makefile +++ b/arch/powerpc/platforms/82xx/Makefile | |||
@@ -6,4 +6,4 @@ obj-$(CONFIG_CPM2) += pq2.o | |||
6 | obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o | 6 | obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o |
7 | obj-$(CONFIG_PQ2FADS) += pq2fads.o | 7 | obj-$(CONFIG_PQ2FADS) += pq2fads.o |
8 | obj-$(CONFIG_EP8248E) += ep8248e.o | 8 | obj-$(CONFIG_EP8248E) += ep8248e.o |
9 | obj-$(CONFIG_MGCOGE) += mgcoge.o | 9 | obj-$(CONFIG_MGCOGE) += km82xx.o |
diff --git a/arch/powerpc/platforms/82xx/mgcoge.c b/arch/powerpc/platforms/82xx/km82xx.c index 7a5de9eb3c73..428c5e0a0e75 100644 --- a/arch/powerpc/platforms/82xx/mgcoge.c +++ b/arch/powerpc/platforms/82xx/km82xx.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Keymile mgcoge support | 2 | * Keymile km82xx support |
3 | * Copyright 2008 DENX Software Engineering GmbH | 3 | * Copyright 2008-2011 DENX Software Engineering GmbH |
4 | * Author: Heiko Schocher <hs@denx.de> | 4 | * Author: Heiko Schocher <hs@denx.de> |
5 | * | 5 | * |
6 | * based on code from: | 6 | * based on code from: |
@@ -31,9 +31,10 @@ | |||
31 | 31 | ||
32 | #include "pq2.h" | 32 | #include "pq2.h" |
33 | 33 | ||
34 | static void __init mgcoge_pic_init(void) | 34 | static void __init km82xx_pic_init(void) |
35 | { | 35 | { |
36 | struct device_node *np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic"); | 36 | struct device_node *np = of_find_compatible_node(NULL, NULL, |
37 | "fsl,pq2-pic"); | ||
37 | if (!np) { | 38 | if (!np) { |
38 | printk(KERN_ERR "PIC init: can not find cpm-pic node\n"); | 39 | printk(KERN_ERR "PIC init: can not find cpm-pic node\n"); |
39 | return; | 40 | return; |
@@ -47,12 +48,18 @@ struct cpm_pin { | |||
47 | int port, pin, flags; | 48 | int port, pin, flags; |
48 | }; | 49 | }; |
49 | 50 | ||
50 | static __initdata struct cpm_pin mgcoge_pins[] = { | 51 | static __initdata struct cpm_pin km82xx_pins[] = { |
51 | 52 | ||
52 | /* SMC2 */ | 53 | /* SMC2 */ |
53 | {0, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | 54 | {0, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, |
54 | {0, 9, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | 55 | {0, 9, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, |
55 | 56 | ||
57 | /* SCC1 */ | ||
58 | {2, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
59 | {2, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
60 | {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
61 | {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, | ||
62 | |||
56 | /* SCC4 */ | 63 | /* SCC4 */ |
57 | {2, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | 64 | {2, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, |
58 | {2, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | 65 | {2, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, |
@@ -107,30 +114,49 @@ static __initdata struct cpm_pin mgcoge_pins[] = { | |||
107 | {3, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, | 114 | {3, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, |
108 | {3, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, | 115 | {3, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, |
109 | #endif | 116 | #endif |
117 | |||
118 | /* USB */ | ||
119 | {0, 10, CPM_PIN_OUTPUT | CPM_PIN_GPIO}, /* FULL_SPEED */ | ||
120 | {0, 11, CPM_PIN_OUTPUT | CPM_PIN_GPIO}, /*/SLAVE */ | ||
121 | {2, 10, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* RXN */ | ||
122 | {2, 11, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* RXP */ | ||
123 | {2, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, /* /OE */ | ||
124 | {2, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* RXCLK */ | ||
125 | {3, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, /* TXP */ | ||
126 | {3, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, /* TXN */ | ||
127 | {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* RXD */ | ||
110 | }; | 128 | }; |
111 | 129 | ||
112 | static void __init init_ioports(void) | 130 | static void __init init_ioports(void) |
113 | { | 131 | { |
114 | int i; | 132 | int i; |
115 | 133 | ||
116 | for (i = 0; i < ARRAY_SIZE(mgcoge_pins); i++) { | 134 | for (i = 0; i < ARRAY_SIZE(km82xx_pins); i++) { |
117 | const struct cpm_pin *pin = &mgcoge_pins[i]; | 135 | const struct cpm_pin *pin = &km82xx_pins[i]; |
118 | cpm2_set_pin(pin->port, pin->pin, pin->flags); | 136 | cpm2_set_pin(pin->port, pin->pin, pin->flags); |
119 | } | 137 | } |
120 | 138 | ||
121 | cpm2_smc_clk_setup(CPM_CLK_SMC2, CPM_BRG8); | 139 | cpm2_smc_clk_setup(CPM_CLK_SMC2, CPM_BRG8); |
140 | cpm2_clk_setup(CPM_CLK_SCC1, CPM_CLK11, CPM_CLK_RX); | ||
141 | cpm2_clk_setup(CPM_CLK_SCC1, CPM_CLK11, CPM_CLK_TX); | ||
142 | cpm2_clk_setup(CPM_CLK_SCC3, CPM_CLK5, CPM_CLK_RTX); | ||
122 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK7, CPM_CLK_RX); | 143 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK7, CPM_CLK_RX); |
123 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK8, CPM_CLK_TX); | 144 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK8, CPM_CLK_TX); |
124 | cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_RX); | 145 | cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_RX); |
125 | cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK9, CPM_CLK_TX); | 146 | cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK9, CPM_CLK_TX); |
126 | cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX); | 147 | cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX); |
127 | cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX); | 148 | cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX); |
149 | |||
150 | /* Force USB FULL SPEED bit to '1' */ | ||
151 | setbits32(&cpm2_immr->im_ioport.iop_pdata, 1 << (31 - 10)); | ||
152 | /* clear USB_SLAVE */ | ||
153 | clrbits32(&cpm2_immr->im_ioport.iop_pdata, 1 << (31 - 11)); | ||
128 | } | 154 | } |
129 | 155 | ||
130 | static void __init mgcoge_setup_arch(void) | 156 | static void __init km82xx_setup_arch(void) |
131 | { | 157 | { |
132 | if (ppc_md.progress) | 158 | if (ppc_md.progress) |
133 | ppc_md.progress("mgcoge_setup_arch()", 0); | 159 | ppc_md.progress("km82xx_setup_arch()", 0); |
134 | 160 | ||
135 | cpm2_reset(); | 161 | cpm2_reset(); |
136 | 162 | ||
@@ -142,7 +168,7 @@ static void __init mgcoge_setup_arch(void) | |||
142 | init_ioports(); | 168 | init_ioports(); |
143 | 169 | ||
144 | if (ppc_md.progress) | 170 | if (ppc_md.progress) |
145 | ppc_md.progress("mgcoge_setup_arch(), finish", 0); | 171 | ppc_md.progress("km82xx_setup_arch(), finish", 0); |
146 | } | 172 | } |
147 | 173 | ||
148 | static __initdata struct of_device_id of_bus_ids[] = { | 174 | static __initdata struct of_device_id of_bus_ids[] = { |
@@ -156,23 +182,23 @@ static int __init declare_of_platform_devices(void) | |||
156 | 182 | ||
157 | return 0; | 183 | return 0; |
158 | } | 184 | } |
159 | machine_device_initcall(mgcoge, declare_of_platform_devices); | 185 | machine_device_initcall(km82xx, declare_of_platform_devices); |
160 | 186 | ||
161 | /* | 187 | /* |
162 | * Called very early, device-tree isn't unflattened | 188 | * Called very early, device-tree isn't unflattened |
163 | */ | 189 | */ |
164 | static int __init mgcoge_probe(void) | 190 | static int __init km82xx_probe(void) |
165 | { | 191 | { |
166 | unsigned long root = of_get_flat_dt_root(); | 192 | unsigned long root = of_get_flat_dt_root(); |
167 | return of_flat_dt_is_compatible(root, "keymile,mgcoge"); | 193 | return of_flat_dt_is_compatible(root, "keymile,km82xx"); |
168 | } | 194 | } |
169 | 195 | ||
170 | define_machine(mgcoge) | 196 | define_machine(km82xx) |
171 | { | 197 | { |
172 | .name = "Keymile MGCOGE", | 198 | .name = "Keymile km82xx", |
173 | .probe = mgcoge_probe, | 199 | .probe = km82xx_probe, |
174 | .setup_arch = mgcoge_setup_arch, | 200 | .setup_arch = km82xx_setup_arch, |
175 | .init_IRQ = mgcoge_pic_init, | 201 | .init_IRQ = km82xx_pic_init, |
176 | .get_irq = cpm2_get_irq, | 202 | .get_irq = cpm2_get_irq, |
177 | .calibrate_decr = generic_calibrate_decr, | 203 | .calibrate_decr = generic_calibrate_decr, |
178 | .restart = pq2_restart, | 204 | .restart = pq2_restart, |