diff options
author | Heiko Schocher <hs@denx.de> | 2009-08-03 03:34:50 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-08-19 20:27:30 -0400 |
commit | 9239c89bc9c51c412b89eb8040077eaaee361326 (patch) | |
tree | 39693452f20f9897893ffcf3ed050466c7cb1de2 /arch/powerpc | |
parent | 8640d3bf71fa0f25adf86527fe69a32372427d4b (diff) |
powerpc/82xx: mgcoge - updates for 2.6.32
- add I2C support
- add FCC1 and FCC2 support
- fix bogus gpio numbering in plattform code
Signed-off-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/boot/dts/mgcoge.dts | 53 | ||||
-rw-r--r-- | arch/powerpc/platforms/82xx/mgcoge.c | 69 |
2 files changed, 113 insertions, 9 deletions
diff --git a/arch/powerpc/boot/dts/mgcoge.dts b/arch/powerpc/boot/dts/mgcoge.dts index 633255a97557..0ce96644176d 100644 --- a/arch/powerpc/boot/dts/mgcoge.dts +++ b/arch/powerpc/boot/dts/mgcoge.dts | |||
@@ -162,6 +162,59 @@ | |||
162 | fixed-link = <0 0 10 0 0>; | 162 | fixed-link = <0 0 10 0 0>; |
163 | }; | 163 | }; |
164 | 164 | ||
165 | i2c@11860 { | ||
166 | compatible = "fsl,mpc8272-i2c", | ||
167 | "fsl,cpm2-i2c"; | ||
168 | reg = <0x11860 0x20 0x8afc 0x2>; | ||
169 | interrupts = <1 8>; | ||
170 | interrupt-parent = <&PIC>; | ||
171 | fsl,cpm-command = <0x29600000>; | ||
172 | #address-cells = <1>; | ||
173 | #size-cells = <0>; | ||
174 | }; | ||
175 | |||
176 | mdio@10d40 { | ||
177 | compatible = "fsl,cpm2-mdio-bitbang"; | ||
178 | reg = <0x10d00 0x14>; | ||
179 | #address-cells = <1>; | ||
180 | #size-cells = <0>; | ||
181 | fsl,mdio-pin = <12>; | ||
182 | fsl,mdc-pin = <13>; | ||
183 | |||
184 | phy0: ethernet-phy@0 { | ||
185 | reg = <0x0>; | ||
186 | }; | ||
187 | |||
188 | phy1: ethernet-phy@1 { | ||
189 | reg = <0x1>; | ||
190 | }; | ||
191 | }; | ||
192 | |||
193 | /* FCC1 management to switch */ | ||
194 | ethernet@11300 { | ||
195 | device_type = "network"; | ||
196 | compatible = "fsl,cpm2-fcc-enet"; | ||
197 | reg = <0x11300 0x20 0x8400 0x100 0x11390 0x1>; | ||
198 | local-mac-address = [ 00 01 02 03 04 07 ]; | ||
199 | interrupts = <32 8>; | ||
200 | interrupt-parent = <&PIC>; | ||
201 | phy-handle = <&phy0>; | ||
202 | linux,network-index = <1>; | ||
203 | fsl,cpm-command = <0x12000300>; | ||
204 | }; | ||
205 | |||
206 | /* FCC2 to redundant core unit over backplane */ | ||
207 | ethernet@11320 { | ||
208 | device_type = "network"; | ||
209 | compatible = "fsl,cpm2-fcc-enet"; | ||
210 | reg = <0x11320 0x20 0x8500 0x100 0x113b0 0x1>; | ||
211 | local-mac-address = [ 00 01 02 03 04 08 ]; | ||
212 | interrupts = <33 8>; | ||
213 | interrupt-parent = <&PIC>; | ||
214 | phy-handle = <&phy1>; | ||
215 | linux,network-index = <2>; | ||
216 | fsl,cpm-command = <0x16200300>; | ||
217 | }; | ||
165 | }; | 218 | }; |
166 | 219 | ||
167 | PIC: interrupt-controller@10c00 { | 220 | PIC: interrupt-controller@10c00 { |
diff --git a/arch/powerpc/platforms/82xx/mgcoge.c b/arch/powerpc/platforms/82xx/mgcoge.c index c2af169c1d1d..7a5de9eb3c73 100644 --- a/arch/powerpc/platforms/82xx/mgcoge.c +++ b/arch/powerpc/platforms/82xx/mgcoge.c | |||
@@ -50,16 +50,63 @@ struct cpm_pin { | |||
50 | static __initdata struct cpm_pin mgcoge_pins[] = { | 50 | static __initdata struct cpm_pin mgcoge_pins[] = { |
51 | 51 | ||
52 | /* SMC2 */ | 52 | /* SMC2 */ |
53 | {1, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | 53 | {0, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, |
54 | {1, 9, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | 54 | {0, 9, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, |
55 | 55 | ||
56 | /* SCC4 */ | 56 | /* SCC4 */ |
57 | {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | 57 | {2, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, |
58 | {3, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | 58 | {2, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, |
59 | {3, 9, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | 59 | {2, 9, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, |
60 | {3, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | 60 | {2, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, |
61 | {4, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | 61 | {3, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, |
62 | {4, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | 62 | {3, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, |
63 | |||
64 | /* FCC1 */ | ||
65 | {0, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
66 | {0, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
67 | {0, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
68 | {0, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
69 | {0, 18, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
70 | {0, 19, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
71 | {0, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
72 | {0, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
73 | {0, 26, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, | ||
74 | {0, 27, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, | ||
75 | {0, 28, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, | ||
76 | {0, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, | ||
77 | {0, 30, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, | ||
78 | {0, 31, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, | ||
79 | |||
80 | {2, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
81 | {2, 23, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
82 | |||
83 | /* FCC2 */ | ||
84 | {1, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
85 | {1, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
86 | {1, 20, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
87 | {1, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
88 | {1, 22, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
89 | {1, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
90 | {1, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
91 | {1, 25, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
92 | {1, 26, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
93 | {1, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
94 | {1, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
95 | {1, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, | ||
96 | {1, 30, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
97 | {1, 31, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
98 | |||
99 | {2, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
100 | {2, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
101 | |||
102 | /* MDC */ | ||
103 | {0, 13, CPM_PIN_OUTPUT | CPM_PIN_GPIO}, | ||
104 | |||
105 | #if defined(CONFIG_I2C_CPM) | ||
106 | /* I2C */ | ||
107 | {3, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, | ||
108 | {3, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, | ||
109 | #endif | ||
63 | }; | 110 | }; |
64 | 111 | ||
65 | static void __init init_ioports(void) | 112 | static void __init init_ioports(void) |
@@ -68,12 +115,16 @@ static void __init init_ioports(void) | |||
68 | 115 | ||
69 | for (i = 0; i < ARRAY_SIZE(mgcoge_pins); i++) { | 116 | for (i = 0; i < ARRAY_SIZE(mgcoge_pins); i++) { |
70 | const struct cpm_pin *pin = &mgcoge_pins[i]; | 117 | const struct cpm_pin *pin = &mgcoge_pins[i]; |
71 | cpm2_set_pin(pin->port - 1, pin->pin, pin->flags); | 118 | cpm2_set_pin(pin->port, pin->pin, pin->flags); |
72 | } | 119 | } |
73 | 120 | ||
74 | cpm2_smc_clk_setup(CPM_CLK_SMC2, CPM_BRG8); | 121 | cpm2_smc_clk_setup(CPM_CLK_SMC2, CPM_BRG8); |
75 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK7, CPM_CLK_RX); | 122 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK7, CPM_CLK_RX); |
76 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK8, CPM_CLK_TX); | 123 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK8, CPM_CLK_TX); |
124 | cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_RX); | ||
125 | cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK9, CPM_CLK_TX); | ||
126 | cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX); | ||
127 | cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX); | ||
77 | } | 128 | } |
78 | 129 | ||
79 | static void __init mgcoge_setup_arch(void) | 130 | static void __init mgcoge_setup_arch(void) |