blob: 92ba378b7990a44fa4ca24f004d10cca7a30218a [file] [log] [blame]
Kumar Galaeed32002006-01-13 11:19:13 -06001/*
2 * FSL SoC setup code
3 *
4 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
Kumar Galaeed32002006-01-13 11:19:13 -060012#include <linux/stddef.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/errno.h>
16#include <linux/major.h>
17#include <linux/delay.h>
18#include <linux/irq.h>
19#include <linux/module.h>
20#include <linux/device.h>
21#include <linux/platform_device.h>
22#include <linux/fsl_devices.h>
23
24#include <asm/system.h>
25#include <asm/atomic.h>
26#include <asm/io.h>
27#include <asm/irq.h>
28#include <asm/prom.h>
29#include <sysdev/fsl_soc.h>
30#include <mm/mmu_decl.h>
31
32static phys_addr_t immrbase = -1;
33
34phys_addr_t get_immrbase(void)
35{
36 struct device_node *soc;
37
38 if (immrbase != -1)
39 return immrbase;
40
41 soc = of_find_node_by_type(NULL, "soc");
Kumar Gala2fb07d72006-01-23 16:58:04 -060042 if (soc) {
Kumar Galaeed32002006-01-13 11:19:13 -060043 unsigned int size;
Jeremy Kerra7f67bd2006-07-12 15:35:54 +100044 const void *prop = get_property(soc, "reg", &size);
Kumar Galaeed32002006-01-13 11:19:13 -060045 immrbase = of_translate_address(soc, prop);
46 of_node_put(soc);
47 };
48
49 return immrbase;
50}
Kumar Gala2fb07d72006-01-23 16:58:04 -060051
Kumar Galaeed32002006-01-13 11:19:13 -060052EXPORT_SYMBOL(get_immrbase);
53
Kumar Gala2fb07d72006-01-23 16:58:04 -060054static int __init gfar_mdio_of_init(void)
Kumar Galaeed32002006-01-13 11:19:13 -060055{
56 struct device_node *np;
57 unsigned int i;
Kumar Gala2fb07d72006-01-23 16:58:04 -060058 struct platform_device *mdio_dev;
Kumar Galaeed32002006-01-13 11:19:13 -060059 struct resource res;
60 int ret;
61
Kumar Gala2fb07d72006-01-23 16:58:04 -060062 for (np = NULL, i = 0;
63 (np = of_find_compatible_node(np, "mdio", "gianfar")) != NULL;
64 i++) {
Kumar Galaeed32002006-01-13 11:19:13 -060065 int k;
66 struct device_node *child = NULL;
67 struct gianfar_mdio_data mdio_data;
68
69 memset(&res, 0, sizeof(res));
70 memset(&mdio_data, 0, sizeof(mdio_data));
71
72 ret = of_address_to_resource(np, 0, &res);
73 if (ret)
Kumar Gala2fb07d72006-01-23 16:58:04 -060074 goto err;
Kumar Galaeed32002006-01-13 11:19:13 -060075
Kumar Gala2fb07d72006-01-23 16:58:04 -060076 mdio_dev =
77 platform_device_register_simple("fsl-gianfar_mdio",
78 res.start, &res, 1);
Kumar Galaeed32002006-01-13 11:19:13 -060079 if (IS_ERR(mdio_dev)) {
80 ret = PTR_ERR(mdio_dev);
Kumar Gala2fb07d72006-01-23 16:58:04 -060081 goto err;
Kumar Galaeed32002006-01-13 11:19:13 -060082 }
83
84 for (k = 0; k < 32; k++)
85 mdio_data.irq[k] = -1;
86
87 while ((child = of_get_next_child(np, child)) != NULL) {
Jon Loeliger919fede2006-07-31 15:35:41 -050088 const u32 *id = get_property(child, "reg", NULL);
89 mdio_data.irq[*id] = irq_of_parse_and_map(child, 0);
Kumar Galaeed32002006-01-13 11:19:13 -060090 }
91
Kumar Gala2fb07d72006-01-23 16:58:04 -060092 ret =
93 platform_device_add_data(mdio_dev, &mdio_data,
94 sizeof(struct gianfar_mdio_data));
Kumar Galaeed32002006-01-13 11:19:13 -060095 if (ret)
Kumar Gala2fb07d72006-01-23 16:58:04 -060096 goto unreg;
Kumar Galaeed32002006-01-13 11:19:13 -060097 }
98
Kumar Gala2fb07d72006-01-23 16:58:04 -060099 return 0;
100
101unreg:
102 platform_device_unregister(mdio_dev);
103err:
104 return ret;
105}
106
107arch_initcall(gfar_mdio_of_init);
108
109static const char *gfar_tx_intr = "tx";
110static const char *gfar_rx_intr = "rx";
111static const char *gfar_err_intr = "error";
112
113static int __init gfar_of_init(void)
114{
115 struct device_node *np;
116 unsigned int i;
117 struct platform_device *gfar_dev;
118 struct resource res;
119 int ret;
120
121 for (np = NULL, i = 0;
122 (np = of_find_compatible_node(np, "network", "gianfar")) != NULL;
123 i++) {
Kumar Galaeed32002006-01-13 11:19:13 -0600124 struct resource r[4];
125 struct device_node *phy, *mdio;
126 struct gianfar_platform_data gfar_data;
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000127 const unsigned int *id;
128 const char *model;
129 const void *mac_addr;
130 const phandle *ph;
Jon Loeliger919fede2006-07-31 15:35:41 -0500131 int n_res = 1;
Kumar Galaeed32002006-01-13 11:19:13 -0600132
133 memset(r, 0, sizeof(r));
134 memset(&gfar_data, 0, sizeof(gfar_data));
135
136 ret = of_address_to_resource(np, 0, &r[0]);
137 if (ret)
Kumar Gala2fb07d72006-01-23 16:58:04 -0600138 goto err;
Kumar Galaeed32002006-01-13 11:19:13 -0600139
Jon Loeliger919fede2006-07-31 15:35:41 -0500140 r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
Kumar Galaeed32002006-01-13 11:19:13 -0600141 r[1].flags = IORESOURCE_IRQ;
142
143 model = get_property(np, "model", NULL);
144
145 /* If we aren't the FEC we have multiple interrupts */
146 if (model && strcasecmp(model, "FEC")) {
147 r[1].name = gfar_tx_intr;
148
149 r[2].name = gfar_rx_intr;
Jon Loeliger919fede2006-07-31 15:35:41 -0500150 r[2].start = r[2].end = irq_of_parse_and_map(np, 1);
Kumar Galaeed32002006-01-13 11:19:13 -0600151 r[2].flags = IORESOURCE_IRQ;
152
153 r[3].name = gfar_err_intr;
Jon Loeliger919fede2006-07-31 15:35:41 -0500154 r[3].start = r[3].end = irq_of_parse_and_map(np, 2);
Kumar Galaeed32002006-01-13 11:19:13 -0600155 r[3].flags = IORESOURCE_IRQ;
Jon Loeliger919fede2006-07-31 15:35:41 -0500156
157 n_res += 2;
Kumar Galaeed32002006-01-13 11:19:13 -0600158 }
159
Kumar Gala2fb07d72006-01-23 16:58:04 -0600160 gfar_dev =
161 platform_device_register_simple("fsl-gianfar", i, &r[0],
Jon Loeliger919fede2006-07-31 15:35:41 -0500162 n_res + 1);
Kumar Galaeed32002006-01-13 11:19:13 -0600163
164 if (IS_ERR(gfar_dev)) {
165 ret = PTR_ERR(gfar_dev);
Kumar Gala2fb07d72006-01-23 16:58:04 -0600166 goto err;
Kumar Galaeed32002006-01-13 11:19:13 -0600167 }
168
Jon Loeligerf5831652006-08-17 08:42:35 -0500169 mac_addr = get_property(np, "local-mac-address", NULL);
170 if (mac_addr == NULL)
171 mac_addr = get_property(np, "mac-address", NULL);
172 if (mac_addr == NULL) {
173 /* Obsolete */
174 mac_addr = get_property(np, "address", NULL);
175 }
176
177 if (mac_addr)
178 memcpy(gfar_data.mac_addr, mac_addr, 6);
Kumar Galaeed32002006-01-13 11:19:13 -0600179
180 if (model && !strcasecmp(model, "TSEC"))
181 gfar_data.device_flags =
Kumar Gala2fb07d72006-01-23 16:58:04 -0600182 FSL_GIANFAR_DEV_HAS_GIGABIT |
183 FSL_GIANFAR_DEV_HAS_COALESCE |
184 FSL_GIANFAR_DEV_HAS_RMON |
185 FSL_GIANFAR_DEV_HAS_MULTI_INTR;
Kumar Galaeed32002006-01-13 11:19:13 -0600186 if (model && !strcasecmp(model, "eTSEC"))
187 gfar_data.device_flags =
Kumar Gala2fb07d72006-01-23 16:58:04 -0600188 FSL_GIANFAR_DEV_HAS_GIGABIT |
189 FSL_GIANFAR_DEV_HAS_COALESCE |
190 FSL_GIANFAR_DEV_HAS_RMON |
191 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
192 FSL_GIANFAR_DEV_HAS_CSUM |
193 FSL_GIANFAR_DEV_HAS_VLAN |
194 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH;
Kumar Galaeed32002006-01-13 11:19:13 -0600195
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000196 ph = get_property(np, "phy-handle", NULL);
Kumar Galaeed32002006-01-13 11:19:13 -0600197 phy = of_find_node_by_phandle(*ph);
198
199 if (phy == NULL) {
200 ret = -ENODEV;
Kumar Gala2fb07d72006-01-23 16:58:04 -0600201 goto unreg;
Kumar Galaeed32002006-01-13 11:19:13 -0600202 }
203
204 mdio = of_get_parent(phy);
205
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000206 id = get_property(phy, "reg", NULL);
Kumar Galaeed32002006-01-13 11:19:13 -0600207 ret = of_address_to_resource(mdio, 0, &res);
208 if (ret) {
209 of_node_put(phy);
210 of_node_put(mdio);
Kumar Gala2fb07d72006-01-23 16:58:04 -0600211 goto unreg;
Kumar Galaeed32002006-01-13 11:19:13 -0600212 }
213
214 gfar_data.phy_id = *id;
215 gfar_data.bus_id = res.start;
216
217 of_node_put(phy);
218 of_node_put(mdio);
219
Kumar Gala2fb07d72006-01-23 16:58:04 -0600220 ret =
221 platform_device_add_data(gfar_dev, &gfar_data,
222 sizeof(struct
223 gianfar_platform_data));
Kumar Galaeed32002006-01-13 11:19:13 -0600224 if (ret)
Kumar Gala2fb07d72006-01-23 16:58:04 -0600225 goto unreg;
Kumar Galaeed32002006-01-13 11:19:13 -0600226 }
227
228 return 0;
229
Kumar Gala2fb07d72006-01-23 16:58:04 -0600230unreg:
Kumar Galaeed32002006-01-13 11:19:13 -0600231 platform_device_unregister(gfar_dev);
Kumar Gala2fb07d72006-01-23 16:58:04 -0600232err:
Kumar Galaeed32002006-01-13 11:19:13 -0600233 return ret;
234}
Kumar Gala2fb07d72006-01-23 16:58:04 -0600235
Kumar Galaeed32002006-01-13 11:19:13 -0600236arch_initcall(gfar_of_init);
237
238static int __init fsl_i2c_of_init(void)
239{
240 struct device_node *np;
241 unsigned int i;
242 struct platform_device *i2c_dev;
243 int ret;
244
Kumar Gala2fb07d72006-01-23 16:58:04 -0600245 for (np = NULL, i = 0;
246 (np = of_find_compatible_node(np, "i2c", "fsl-i2c")) != NULL;
247 i++) {
Kumar Galaeed32002006-01-13 11:19:13 -0600248 struct resource r[2];
249 struct fsl_i2c_platform_data i2c_data;
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000250 const unsigned char *flags = NULL;
Kumar Galaeed32002006-01-13 11:19:13 -0600251
252 memset(&r, 0, sizeof(r));
253 memset(&i2c_data, 0, sizeof(i2c_data));
254
255 ret = of_address_to_resource(np, 0, &r[0]);
256 if (ret)
Kumar Gala2fb07d72006-01-23 16:58:04 -0600257 goto err;
Kumar Galaeed32002006-01-13 11:19:13 -0600258
Jon Loeliger919fede2006-07-31 15:35:41 -0500259 r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
Kumar Galaeed32002006-01-13 11:19:13 -0600260 r[1].flags = IORESOURCE_IRQ;
261
262 i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2);
263 if (IS_ERR(i2c_dev)) {
264 ret = PTR_ERR(i2c_dev);
Kumar Gala2fb07d72006-01-23 16:58:04 -0600265 goto err;
Kumar Galaeed32002006-01-13 11:19:13 -0600266 }
267
268 i2c_data.device_flags = 0;
269 flags = get_property(np, "dfsrr", NULL);
270 if (flags)
271 i2c_data.device_flags |= FSL_I2C_DEV_SEPARATE_DFSRR;
272
273 flags = get_property(np, "fsl5200-clocking", NULL);
274 if (flags)
275 i2c_data.device_flags |= FSL_I2C_DEV_CLOCK_5200;
276
Kumar Gala2fb07d72006-01-23 16:58:04 -0600277 ret =
278 platform_device_add_data(i2c_dev, &i2c_data,
279 sizeof(struct
280 fsl_i2c_platform_data));
Kumar Galaeed32002006-01-13 11:19:13 -0600281 if (ret)
Kumar Gala2fb07d72006-01-23 16:58:04 -0600282 goto unreg;
Kumar Galaeed32002006-01-13 11:19:13 -0600283 }
284
285 return 0;
286
Kumar Gala2fb07d72006-01-23 16:58:04 -0600287unreg:
Kumar Galaeed32002006-01-13 11:19:13 -0600288 platform_device_unregister(i2c_dev);
Kumar Gala2fb07d72006-01-23 16:58:04 -0600289err:
Kumar Galaeed32002006-01-13 11:19:13 -0600290 return ret;
291}
Kumar Gala2fb07d72006-01-23 16:58:04 -0600292
Kumar Galaeed32002006-01-13 11:19:13 -0600293arch_initcall(fsl_i2c_of_init);
294
295#ifdef CONFIG_PPC_83xx
296static int __init mpc83xx_wdt_init(void)
297{
298 struct resource r;
299 struct device_node *soc, *np;
300 struct platform_device *dev;
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000301 const unsigned int *freq;
Kumar Galaeed32002006-01-13 11:19:13 -0600302 int ret;
303
304 np = of_find_compatible_node(NULL, "watchdog", "mpc83xx_wdt");
305
306 if (!np) {
307 ret = -ENODEV;
Kumar Gala2fb07d72006-01-23 16:58:04 -0600308 goto nodev;
Kumar Galaeed32002006-01-13 11:19:13 -0600309 }
310
311 soc = of_find_node_by_type(NULL, "soc");
312
313 if (!soc) {
314 ret = -ENODEV;
Kumar Gala2fb07d72006-01-23 16:58:04 -0600315 goto nosoc;
Kumar Galaeed32002006-01-13 11:19:13 -0600316 }
317
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000318 freq = get_property(soc, "bus-frequency", NULL);
Kumar Galaeed32002006-01-13 11:19:13 -0600319 if (!freq) {
320 ret = -ENODEV;
Kumar Gala2fb07d72006-01-23 16:58:04 -0600321 goto err;
Kumar Galaeed32002006-01-13 11:19:13 -0600322 }
323
324 memset(&r, 0, sizeof(r));
325
326 ret = of_address_to_resource(np, 0, &r);
327 if (ret)
Kumar Gala2fb07d72006-01-23 16:58:04 -0600328 goto err;
Kumar Galaeed32002006-01-13 11:19:13 -0600329
330 dev = platform_device_register_simple("mpc83xx_wdt", 0, &r, 1);
331 if (IS_ERR(dev)) {
332 ret = PTR_ERR(dev);
Kumar Gala2fb07d72006-01-23 16:58:04 -0600333 goto err;
Kumar Galaeed32002006-01-13 11:19:13 -0600334 }
335
336 ret = platform_device_add_data(dev, freq, sizeof(int));
337 if (ret)
Kumar Gala2fb07d72006-01-23 16:58:04 -0600338 goto unreg;
Kumar Galaeed32002006-01-13 11:19:13 -0600339
340 of_node_put(soc);
341 of_node_put(np);
342
343 return 0;
344
Kumar Gala2fb07d72006-01-23 16:58:04 -0600345unreg:
Kumar Galaeed32002006-01-13 11:19:13 -0600346 platform_device_unregister(dev);
Kumar Gala2fb07d72006-01-23 16:58:04 -0600347err:
Kumar Galaeed32002006-01-13 11:19:13 -0600348 of_node_put(soc);
Kumar Gala2fb07d72006-01-23 16:58:04 -0600349nosoc:
Kumar Galaeed32002006-01-13 11:19:13 -0600350 of_node_put(np);
Kumar Gala2fb07d72006-01-23 16:58:04 -0600351nodev:
Kumar Galaeed32002006-01-13 11:19:13 -0600352 return ret;
353}
Kumar Gala2fb07d72006-01-23 16:58:04 -0600354
Kumar Galaeed32002006-01-13 11:19:13 -0600355arch_initcall(mpc83xx_wdt_init);
356#endif
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600357
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000358static enum fsl_usb2_phy_modes determine_usb_phy(const char *phy_type)
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600359{
360 if (!phy_type)
361 return FSL_USB2_PHY_NONE;
362 if (!strcasecmp(phy_type, "ulpi"))
363 return FSL_USB2_PHY_ULPI;
364 if (!strcasecmp(phy_type, "utmi"))
365 return FSL_USB2_PHY_UTMI;
366 if (!strcasecmp(phy_type, "utmi_wide"))
367 return FSL_USB2_PHY_UTMI_WIDE;
368 if (!strcasecmp(phy_type, "serial"))
369 return FSL_USB2_PHY_SERIAL;
370
371 return FSL_USB2_PHY_NONE;
372}
373
374static int __init fsl_usb_of_init(void)
375{
376 struct device_node *np;
377 unsigned int i;
Kumar Gala01cced22006-04-11 10:07:16 -0500378 struct platform_device *usb_dev_mph = NULL, *usb_dev_dr = NULL;
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600379 int ret;
380
381 for (np = NULL, i = 0;
382 (np = of_find_compatible_node(np, "usb", "fsl-usb2-mph")) != NULL;
383 i++) {
384 struct resource r[2];
385 struct fsl_usb2_platform_data usb_data;
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000386 const unsigned char *prop = NULL;
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600387
388 memset(&r, 0, sizeof(r));
389 memset(&usb_data, 0, sizeof(usb_data));
390
391 ret = of_address_to_resource(np, 0, &r[0]);
392 if (ret)
393 goto err;
394
Jon Loeliger919fede2006-07-31 15:35:41 -0500395 r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600396 r[1].flags = IORESOURCE_IRQ;
397
Kumar Gala01cced22006-04-11 10:07:16 -0500398 usb_dev_mph =
399 platform_device_register_simple("fsl-ehci", i, r, 2);
400 if (IS_ERR(usb_dev_mph)) {
401 ret = PTR_ERR(usb_dev_mph);
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600402 goto err;
403 }
404
Kumar Gala01cced22006-04-11 10:07:16 -0500405 usb_dev_mph->dev.coherent_dma_mask = 0xffffffffUL;
406 usb_dev_mph->dev.dma_mask = &usb_dev_mph->dev.coherent_dma_mask;
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600407
408 usb_data.operating_mode = FSL_USB2_MPH_HOST;
409
410 prop = get_property(np, "port0", NULL);
411 if (prop)
412 usb_data.port_enables |= FSL_USB2_PORT0_ENABLED;
413
414 prop = get_property(np, "port1", NULL);
415 if (prop)
416 usb_data.port_enables |= FSL_USB2_PORT1_ENABLED;
417
418 prop = get_property(np, "phy_type", NULL);
419 usb_data.phy_mode = determine_usb_phy(prop);
420
421 ret =
Kumar Gala01cced22006-04-11 10:07:16 -0500422 platform_device_add_data(usb_dev_mph, &usb_data,
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600423 sizeof(struct
424 fsl_usb2_platform_data));
425 if (ret)
Kumar Gala01cced22006-04-11 10:07:16 -0500426 goto unreg_mph;
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600427 }
428
Kumar Gala01cced22006-04-11 10:07:16 -0500429 for (np = NULL;
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600430 (np = of_find_compatible_node(np, "usb", "fsl-usb2-dr")) != NULL;
431 i++) {
432 struct resource r[2];
433 struct fsl_usb2_platform_data usb_data;
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000434 const unsigned char *prop = NULL;
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600435
436 memset(&r, 0, sizeof(r));
437 memset(&usb_data, 0, sizeof(usb_data));
438
439 ret = of_address_to_resource(np, 0, &r[0]);
440 if (ret)
Kumar Gala01cced22006-04-11 10:07:16 -0500441 goto unreg_mph;
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600442
Jon Loeliger919fede2006-07-31 15:35:41 -0500443 r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600444 r[1].flags = IORESOURCE_IRQ;
445
Kumar Gala01cced22006-04-11 10:07:16 -0500446 usb_dev_dr =
447 platform_device_register_simple("fsl-ehci", i, r, 2);
448 if (IS_ERR(usb_dev_dr)) {
449 ret = PTR_ERR(usb_dev_dr);
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600450 goto err;
451 }
452
Kumar Gala01cced22006-04-11 10:07:16 -0500453 usb_dev_dr->dev.coherent_dma_mask = 0xffffffffUL;
454 usb_dev_dr->dev.dma_mask = &usb_dev_dr->dev.coherent_dma_mask;
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600455
456 usb_data.operating_mode = FSL_USB2_DR_HOST;
457
458 prop = get_property(np, "phy_type", NULL);
459 usb_data.phy_mode = determine_usb_phy(prop);
460
461 ret =
Kumar Gala01cced22006-04-11 10:07:16 -0500462 platform_device_add_data(usb_dev_dr, &usb_data,
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600463 sizeof(struct
464 fsl_usb2_platform_data));
465 if (ret)
Kumar Gala01cced22006-04-11 10:07:16 -0500466 goto unreg_dr;
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600467 }
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600468 return 0;
469
Kumar Gala01cced22006-04-11 10:07:16 -0500470unreg_dr:
471 if (usb_dev_dr)
472 platform_device_unregister(usb_dev_dr);
473unreg_mph:
474 if (usb_dev_mph)
475 platform_device_unregister(usb_dev_mph);
Kumar Gala4b10cfd2006-02-02 12:31:00 -0600476err:
477 return ret;
478}
479
Kumar Gala01cced22006-04-11 10:07:16 -0500480arch_initcall(fsl_usb_of_init);