diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-08-18 19:28:17 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-08-25 10:44:06 -0400 |
commit | 818fcac554397a04987d49e2bd2dfc2d394b265c (patch) | |
tree | 5a4a21808be73365ba96c882f28bb8cfa3ba5944 | |
parent | a70e88bc78d220a506394058d48cedd1c491a256 (diff) |
powerpc/82xx: Add CPM USB Gadget support for MPC8272ADS boards
- Add usb node;
- Configure pins and clocks;
- Enable USB function in BCSR.
The support was successfully tested using serial and ethernet gadget
drivers.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/boot/dts/mpc8272ads.dts | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/82xx/mpc8272_ads.c | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts index 60f332778e41..e802ebd88cb1 100644 --- a/arch/powerpc/boot/dts/mpc8272ads.dts +++ b/arch/powerpc/boot/dts/mpc8272ads.dts | |||
@@ -173,6 +173,14 @@ | |||
173 | fsl,cpm-command = <0xce00000>; | 173 | fsl,cpm-command = <0xce00000>; |
174 | }; | 174 | }; |
175 | 175 | ||
176 | usb@11b60 { | ||
177 | compatible = "fsl,mpc8272-cpm-usb"; | ||
178 | reg = <0x11b60 0x40 0x8b00 0x100>; | ||
179 | interrupts = <11 8>; | ||
180 | interrupt-parent = <&PIC>; | ||
181 | mode = "peripheral"; | ||
182 | }; | ||
183 | |||
176 | mdio@10d40 { | 184 | mdio@10d40 { |
177 | device_type = "mdio"; | 185 | device_type = "mdio"; |
178 | compatible = "fsl,mpc8272ads-mdio-bitbang", | 186 | compatible = "fsl,mpc8272ads-mdio-bitbang", |
diff --git a/arch/powerpc/platforms/82xx/mpc8272_ads.c b/arch/powerpc/platforms/82xx/mpc8272_ads.c index 67e2184f4243..30394b409b3f 100644 --- a/arch/powerpc/platforms/82xx/mpc8272_ads.c +++ b/arch/powerpc/platforms/82xx/mpc8272_ads.c | |||
@@ -99,6 +99,15 @@ static struct cpm_pin mpc8272_ads_pins[] = { | |||
99 | /* I2C */ | 99 | /* I2C */ |
100 | {3, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, | 100 | {3, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, |
101 | {3, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, | 101 | {3, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, |
102 | |||
103 | /* USB */ | ||
104 | {2, 10, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
105 | {2, 11, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
106 | {2, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
107 | {2, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
108 | {3, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
109 | {3, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
110 | {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
102 | }; | 111 | }; |
103 | 112 | ||
104 | static void __init init_ioports(void) | 113 | static void __init init_ioports(void) |
@@ -112,6 +121,8 @@ static void __init init_ioports(void) | |||
112 | 121 | ||
113 | cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX); | 122 | cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX); |
114 | cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX); | 123 | cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX); |
124 | cpm2_clk_setup(CPM_CLK_SCC3, CPM_CLK8, CPM_CLK_RX); | ||
125 | cpm2_clk_setup(CPM_CLK_SCC3, CPM_CLK8, CPM_CLK_TX); | ||
115 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_BRG4, CPM_CLK_RX); | 126 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_BRG4, CPM_CLK_RX); |
116 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_BRG4, CPM_CLK_TX); | 127 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_BRG4, CPM_CLK_TX); |
117 | cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK11, CPM_CLK_RX); | 128 | cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK11, CPM_CLK_RX); |
@@ -147,6 +158,7 @@ static void __init mpc8272_ads_setup_arch(void) | |||
147 | #define BCSR1_FETH_RST 0x04000000 | 158 | #define BCSR1_FETH_RST 0x04000000 |
148 | #define BCSR1_RS232_EN1 0x02000000 | 159 | #define BCSR1_RS232_EN1 0x02000000 |
149 | #define BCSR1_RS232_EN2 0x01000000 | 160 | #define BCSR1_RS232_EN2 0x01000000 |
161 | #define BCSR3_USB_nEN 0x80000000 | ||
150 | #define BCSR3_FETHIEN2 0x10000000 | 162 | #define BCSR3_FETHIEN2 0x10000000 |
151 | #define BCSR3_FETH2_RST 0x08000000 | 163 | #define BCSR3_FETH2_RST 0x08000000 |
152 | 164 | ||
@@ -156,6 +168,8 @@ static void __init mpc8272_ads_setup_arch(void) | |||
156 | clrbits32(&bcsr[3], BCSR3_FETHIEN2); | 168 | clrbits32(&bcsr[3], BCSR3_FETHIEN2); |
157 | setbits32(&bcsr[3], BCSR3_FETH2_RST); | 169 | setbits32(&bcsr[3], BCSR3_FETH2_RST); |
158 | 170 | ||
171 | clrbits32(&bcsr[3], BCSR3_USB_nEN); | ||
172 | |||
159 | iounmap(bcsr); | 173 | iounmap(bcsr); |
160 | 174 | ||
161 | init_ioports(); | 175 | init_ioports(); |