usb.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. /*
  2. * Platform level USB initialization for FS USB OTG controller on omap1
  3. *
  4. * Copyright (C) 2004 Texas Instruments, Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #include <linux/module.h>
  21. #include <linux/kernel.h>
  22. #include <linux/init.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/io.h>
  25. #include <asm/irq.h>
  26. #include <mach/mux.h>
  27. #include <mach/usb.h>
  28. #include "common.h"
  29. /* These routines should handle the standard chip-specific modes
  30. * for usb0/1/2 ports, covering basic mux and transceiver setup.
  31. *
  32. * Some board-*.c files will need to set up additional mux options,
  33. * like for suspend handling, vbus sensing, GPIOs, and the D+ pullup.
  34. */
  35. /* TESTED ON:
  36. * - 1611B H2 (with usb1 mini-AB) using standard Mini-B or OTG cables
  37. * - 5912 OSK OHCI (with usb0 standard-A), standard A-to-B cables
  38. * - 5912 OSK UDC, with *nonstandard* A-to-A cable
  39. * - 1510 Innovator UDC with bundled usb0 cable
  40. * - 1510 Innovator OHCI with bundled usb1/usb2 cable
  41. * - 1510 Innovator OHCI with custom usb0 cable, feeding 5V VBUS
  42. * - 1710 custom development board using alternate pin group
  43. * - 1710 H3 (with usb1 mini-AB) using standard Mini-B or OTG cables
  44. */
  45. #define INT_USB_IRQ_GEN IH2_BASE + 20
  46. #define INT_USB_IRQ_NISO IH2_BASE + 30
  47. #define INT_USB_IRQ_ISO IH2_BASE + 29
  48. #define INT_USB_IRQ_HGEN INT_USB_HHC_1
  49. #define INT_USB_IRQ_OTG IH2_BASE + 8
  50. #ifdef CONFIG_ARCH_OMAP_OTG
  51. static void __init
  52. omap_otg_init(struct omap_usb_config *config)
  53. {
  54. u32 syscon;
  55. int alt_pingroup = 0;
  56. u16 w;
  57. /* NOTE: no bus or clock setup (yet?) */
  58. syscon = omap_readl(OTG_SYSCON_1) & 0xffff;
  59. if (!(syscon & OTG_RESET_DONE))
  60. pr_debug("USB resets not complete?\n");
  61. //omap_writew(0, OTG_IRQ_EN);
  62. /* pin muxing and transceiver pinouts */
  63. if (config->pins[0] > 2) /* alt pingroup 2 */
  64. alt_pingroup = 1;
  65. syscon |= config->usb0_init(config->pins[0], is_usb0_device(config));
  66. syscon |= config->usb1_init(config->pins[1]);
  67. syscon |= config->usb2_init(config->pins[2], alt_pingroup);
  68. pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
  69. omap_writel(syscon, OTG_SYSCON_1);
  70. syscon = config->hmc_mode;
  71. syscon |= USBX_SYNCHRO | (4 << 16) /* B_ASE0_BRST */;
  72. #ifdef CONFIG_USB_OTG
  73. if (config->otg)
  74. syscon |= OTG_EN;
  75. #endif
  76. pr_debug("USB_TRANSCEIVER_CTRL = %03x\n",
  77. omap_readl(USB_TRANSCEIVER_CTRL));
  78. pr_debug("OTG_SYSCON_2 = %08x\n", omap_readl(OTG_SYSCON_2));
  79. omap_writel(syscon, OTG_SYSCON_2);
  80. printk("USB: hmc %d", config->hmc_mode);
  81. if (!alt_pingroup)
  82. pr_cont(", usb2 alt %d wires", config->pins[2]);
  83. else if (config->pins[0])
  84. pr_cont(", usb0 %d wires%s", config->pins[0],
  85. is_usb0_device(config) ? " (dev)" : "");
  86. if (config->pins[1])
  87. pr_cont(", usb1 %d wires", config->pins[1]);
  88. if (!alt_pingroup && config->pins[2])
  89. pr_cont(", usb2 %d wires", config->pins[2]);
  90. if (config->otg)
  91. pr_cont(", Mini-AB on usb%d", config->otg - 1);
  92. pr_cont("\n");
  93. /* leave USB clocks/controllers off until needed */
  94. w = omap_readw(ULPD_SOFT_REQ);
  95. w &= ~SOFT_USB_CLK_REQ;
  96. omap_writew(w, ULPD_SOFT_REQ);
  97. w = omap_readw(ULPD_CLOCK_CTRL);
  98. w &= ~USB_MCLK_EN;
  99. w |= DIS_USB_PVCI_CLK;
  100. omap_writew(w, ULPD_CLOCK_CTRL);
  101. syscon = omap_readl(OTG_SYSCON_1);
  102. syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN;
  103. #if IS_ENABLED(CONFIG_USB_OMAP)
  104. if (config->otg || config->register_dev) {
  105. struct platform_device *udc_device = config->udc_device;
  106. int status;
  107. syscon &= ~DEV_IDLE_EN;
  108. udc_device->dev.platform_data = config;
  109. status = platform_device_register(udc_device);
  110. if (status)
  111. pr_debug("can't register UDC device, %d\n", status);
  112. }
  113. #endif
  114. #if IS_ENABLED(CONFIG_USB_OHCI_HCD)
  115. if (config->otg || config->register_host) {
  116. struct platform_device *ohci_device = config->ohci_device;
  117. int status;
  118. syscon &= ~HST_IDLE_EN;
  119. ohci_device->dev.platform_data = config;
  120. status = platform_device_register(ohci_device);
  121. if (status)
  122. pr_debug("can't register OHCI device, %d\n", status);
  123. }
  124. #endif
  125. #ifdef CONFIG_USB_OTG
  126. if (config->otg) {
  127. struct platform_device *otg_device = config->otg_device;
  128. int status;
  129. syscon &= ~OTG_IDLE_EN;
  130. otg_device->dev.platform_data = config;
  131. status = platform_device_register(otg_device);
  132. if (status)
  133. pr_debug("can't register OTG device, %d\n", status);
  134. }
  135. #endif
  136. pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
  137. omap_writel(syscon, OTG_SYSCON_1);
  138. }
  139. #else
  140. static void omap_otg_init(struct omap_usb_config *config) {}
  141. #endif
  142. #if IS_ENABLED(CONFIG_USB_OMAP)
  143. static struct resource udc_resources[] = {
  144. /* order is significant! */
  145. { /* registers */
  146. .start = UDC_BASE,
  147. .end = UDC_BASE + 0xff,
  148. .flags = IORESOURCE_MEM,
  149. }, { /* general IRQ */
  150. .start = INT_USB_IRQ_GEN,
  151. .flags = IORESOURCE_IRQ,
  152. }, { /* PIO IRQ */
  153. .start = INT_USB_IRQ_NISO,
  154. .flags = IORESOURCE_IRQ,
  155. }, { /* SOF IRQ */
  156. .start = INT_USB_IRQ_ISO,
  157. .flags = IORESOURCE_IRQ,
  158. },
  159. };
  160. static u64 udc_dmamask = ~(u32)0;
  161. static struct platform_device udc_device = {
  162. .name = "omap_udc",
  163. .id = -1,
  164. .dev = {
  165. .dma_mask = &udc_dmamask,
  166. .coherent_dma_mask = 0xffffffff,
  167. },
  168. .num_resources = ARRAY_SIZE(udc_resources),
  169. .resource = udc_resources,
  170. };
  171. static inline void udc_device_init(struct omap_usb_config *pdata)
  172. {
  173. /* IRQ numbers for omap7xx */
  174. if(cpu_is_omap7xx()) {
  175. udc_resources[1].start = INT_7XX_USB_GENI;
  176. udc_resources[2].start = INT_7XX_USB_NON_ISO;
  177. udc_resources[3].start = INT_7XX_USB_ISO;
  178. }
  179. pdata->udc_device = &udc_device;
  180. }
  181. #else
  182. static inline void udc_device_init(struct omap_usb_config *pdata)
  183. {
  184. }
  185. #endif
  186. #if IS_ENABLED(CONFIG_USB_OHCI_HCD)
  187. /* The dmamask must be set for OHCI to work */
  188. static u64 ohci_dmamask = ~(u32)0;
  189. static struct resource ohci_resources[] = {
  190. {
  191. .start = OMAP_OHCI_BASE,
  192. .end = OMAP_OHCI_BASE + 0xff,
  193. .flags = IORESOURCE_MEM,
  194. },
  195. {
  196. .start = INT_USB_IRQ_HGEN,
  197. .flags = IORESOURCE_IRQ,
  198. },
  199. };
  200. static struct platform_device ohci_device = {
  201. .name = "ohci",
  202. .id = -1,
  203. .dev = {
  204. .dma_mask = &ohci_dmamask,
  205. .coherent_dma_mask = 0xffffffff,
  206. },
  207. .num_resources = ARRAY_SIZE(ohci_resources),
  208. .resource = ohci_resources,
  209. };
  210. static inline void ohci_device_init(struct omap_usb_config *pdata)
  211. {
  212. if (cpu_is_omap7xx())
  213. ohci_resources[1].start = INT_7XX_USB_HHC_1;
  214. pdata->ohci_device = &ohci_device;
  215. pdata->ocpi_enable = &ocpi_enable;
  216. }
  217. #else
  218. static inline void ohci_device_init(struct omap_usb_config *pdata)
  219. {
  220. }
  221. #endif
  222. #if defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG)
  223. static struct resource otg_resources[] = {
  224. /* order is significant! */
  225. {
  226. .start = OTG_BASE,
  227. .end = OTG_BASE + 0xff,
  228. .flags = IORESOURCE_MEM,
  229. }, {
  230. .start = INT_USB_IRQ_OTG,
  231. .flags = IORESOURCE_IRQ,
  232. },
  233. };
  234. static struct platform_device otg_device = {
  235. .name = "omap_otg",
  236. .id = -1,
  237. .num_resources = ARRAY_SIZE(otg_resources),
  238. .resource = otg_resources,
  239. };
  240. static inline void otg_device_init(struct omap_usb_config *pdata)
  241. {
  242. if (cpu_is_omap7xx())
  243. otg_resources[1].start = INT_7XX_USB_OTG;
  244. pdata->otg_device = &otg_device;
  245. }
  246. #else
  247. static inline void otg_device_init(struct omap_usb_config *pdata)
  248. {
  249. }
  250. #endif
  251. static u32 __init omap1_usb0_init(unsigned nwires, unsigned is_device)
  252. {
  253. u32 syscon1 = 0;
  254. if (nwires == 0) {
  255. if (!cpu_is_omap15xx()) {
  256. u32 l;
  257. /* pulldown D+/D- */
  258. l = omap_readl(USB_TRANSCEIVER_CTRL);
  259. l &= ~(3 << 1);
  260. omap_writel(l, USB_TRANSCEIVER_CTRL);
  261. }
  262. return 0;
  263. }
  264. if (is_device) {
  265. if (cpu_is_omap7xx()) {
  266. omap_cfg_reg(AA17_7XX_USB_DM);
  267. omap_cfg_reg(W16_7XX_USB_PU_EN);
  268. omap_cfg_reg(W17_7XX_USB_VBUSI);
  269. omap_cfg_reg(W18_7XX_USB_DMCK_OUT);
  270. omap_cfg_reg(W19_7XX_USB_DCRST);
  271. } else
  272. omap_cfg_reg(W4_USB_PUEN);
  273. }
  274. if (nwires == 2) {
  275. u32 l;
  276. // omap_cfg_reg(P9_USB_DP);
  277. // omap_cfg_reg(R8_USB_DM);
  278. if (cpu_is_omap15xx()) {
  279. /* This works on 1510-Innovator */
  280. return 0;
  281. }
  282. /* NOTES:
  283. * - peripheral should configure VBUS detection!
  284. * - only peripherals may use the internal D+/D- pulldowns
  285. * - OTG support on this port not yet written
  286. */
  287. /* Don't do this for omap7xx -- it causes USB to not work correctly */
  288. if (!cpu_is_omap7xx()) {
  289. l = omap_readl(USB_TRANSCEIVER_CTRL);
  290. l &= ~(7 << 4);
  291. if (!is_device)
  292. l |= (3 << 1);
  293. omap_writel(l, USB_TRANSCEIVER_CTRL);
  294. }
  295. return 3 << 16;
  296. }
  297. /* alternate pin config, external transceiver */
  298. if (cpu_is_omap15xx()) {
  299. printk(KERN_ERR "no usb0 alt pin config on 15xx\n");
  300. return 0;
  301. }
  302. omap_cfg_reg(V6_USB0_TXD);
  303. omap_cfg_reg(W9_USB0_TXEN);
  304. omap_cfg_reg(W5_USB0_SE0);
  305. if (nwires != 3)
  306. omap_cfg_reg(Y5_USB0_RCV);
  307. /* NOTE: SPEED and SUSP aren't configured here. OTG hosts
  308. * may be able to use I2C requests to set those bits along
  309. * with VBUS switching and overcurrent detection.
  310. */
  311. if (nwires != 6) {
  312. u32 l;
  313. l = omap_readl(USB_TRANSCEIVER_CTRL);
  314. l &= ~CONF_USB2_UNI_R;
  315. omap_writel(l, USB_TRANSCEIVER_CTRL);
  316. }
  317. switch (nwires) {
  318. case 3:
  319. syscon1 = 2;
  320. break;
  321. case 4:
  322. syscon1 = 1;
  323. break;
  324. case 6:
  325. syscon1 = 3;
  326. {
  327. u32 l;
  328. omap_cfg_reg(AA9_USB0_VP);
  329. omap_cfg_reg(R9_USB0_VM);
  330. l = omap_readl(USB_TRANSCEIVER_CTRL);
  331. l |= CONF_USB2_UNI_R;
  332. omap_writel(l, USB_TRANSCEIVER_CTRL);
  333. }
  334. break;
  335. default:
  336. printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
  337. 0, nwires);
  338. }
  339. return syscon1 << 16;
  340. }
  341. static u32 __init omap1_usb1_init(unsigned nwires)
  342. {
  343. u32 syscon1 = 0;
  344. if (!cpu_is_omap15xx() && nwires != 6) {
  345. u32 l;
  346. l = omap_readl(USB_TRANSCEIVER_CTRL);
  347. l &= ~CONF_USB1_UNI_R;
  348. omap_writel(l, USB_TRANSCEIVER_CTRL);
  349. }
  350. if (nwires == 0)
  351. return 0;
  352. /* external transceiver */
  353. omap_cfg_reg(USB1_TXD);
  354. omap_cfg_reg(USB1_TXEN);
  355. if (nwires != 3)
  356. omap_cfg_reg(USB1_RCV);
  357. if (cpu_is_omap15xx()) {
  358. omap_cfg_reg(USB1_SEO);
  359. omap_cfg_reg(USB1_SPEED);
  360. // SUSP
  361. } else if (cpu_is_omap1610() || cpu_is_omap5912()) {
  362. omap_cfg_reg(W13_1610_USB1_SE0);
  363. omap_cfg_reg(R13_1610_USB1_SPEED);
  364. // SUSP
  365. } else if (cpu_is_omap1710()) {
  366. omap_cfg_reg(R13_1710_USB1_SE0);
  367. // SUSP
  368. } else {
  369. pr_debug("usb%d cpu unrecognized\n", 1);
  370. return 0;
  371. }
  372. switch (nwires) {
  373. case 2:
  374. goto bad;
  375. case 3:
  376. syscon1 = 2;
  377. break;
  378. case 4:
  379. syscon1 = 1;
  380. break;
  381. case 6:
  382. syscon1 = 3;
  383. omap_cfg_reg(USB1_VP);
  384. omap_cfg_reg(USB1_VM);
  385. if (!cpu_is_omap15xx()) {
  386. u32 l;
  387. l = omap_readl(USB_TRANSCEIVER_CTRL);
  388. l |= CONF_USB1_UNI_R;
  389. omap_writel(l, USB_TRANSCEIVER_CTRL);
  390. }
  391. break;
  392. default:
  393. bad:
  394. printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
  395. 1, nwires);
  396. }
  397. return syscon1 << 20;
  398. }
  399. static u32 __init omap1_usb2_init(unsigned nwires, unsigned alt_pingroup)
  400. {
  401. u32 syscon1 = 0;
  402. /* NOTE omap1 erratum: must leave USB2_UNI_R set if usb0 in use */
  403. if (alt_pingroup || nwires == 0)
  404. return 0;
  405. if (!cpu_is_omap15xx() && nwires != 6) {
  406. u32 l;
  407. l = omap_readl(USB_TRANSCEIVER_CTRL);
  408. l &= ~CONF_USB2_UNI_R;
  409. omap_writel(l, USB_TRANSCEIVER_CTRL);
  410. }
  411. /* external transceiver */
  412. if (cpu_is_omap15xx()) {
  413. omap_cfg_reg(USB2_TXD);
  414. omap_cfg_reg(USB2_TXEN);
  415. omap_cfg_reg(USB2_SEO);
  416. if (nwires != 3)
  417. omap_cfg_reg(USB2_RCV);
  418. /* there is no USB2_SPEED */
  419. } else if (cpu_is_omap16xx()) {
  420. omap_cfg_reg(V6_USB2_TXD);
  421. omap_cfg_reg(W9_USB2_TXEN);
  422. omap_cfg_reg(W5_USB2_SE0);
  423. if (nwires != 3)
  424. omap_cfg_reg(Y5_USB2_RCV);
  425. // FIXME omap_cfg_reg(USB2_SPEED);
  426. } else {
  427. pr_debug("usb%d cpu unrecognized\n", 1);
  428. return 0;
  429. }
  430. // omap_cfg_reg(USB2_SUSP);
  431. switch (nwires) {
  432. case 2:
  433. goto bad;
  434. case 3:
  435. syscon1 = 2;
  436. break;
  437. case 4:
  438. syscon1 = 1;
  439. break;
  440. case 5:
  441. goto bad;
  442. case 6:
  443. syscon1 = 3;
  444. if (cpu_is_omap15xx()) {
  445. omap_cfg_reg(USB2_VP);
  446. omap_cfg_reg(USB2_VM);
  447. } else {
  448. u32 l;
  449. omap_cfg_reg(AA9_USB2_VP);
  450. omap_cfg_reg(R9_USB2_VM);
  451. l = omap_readl(USB_TRANSCEIVER_CTRL);
  452. l |= CONF_USB2_UNI_R;
  453. omap_writel(l, USB_TRANSCEIVER_CTRL);
  454. }
  455. break;
  456. default:
  457. bad:
  458. printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
  459. 2, nwires);
  460. }
  461. return syscon1 << 24;
  462. }
  463. #ifdef CONFIG_ARCH_OMAP15XX
  464. /* ULPD_DPLL_CTRL */
  465. #define DPLL_IOB (1 << 13)
  466. #define DPLL_PLL_ENABLE (1 << 4)
  467. #define DPLL_LOCK (1 << 0)
  468. /* ULPD_APLL_CTRL */
  469. #define APLL_NDPLL_SWITCH (1 << 0)
  470. static void __init omap_1510_usb_init(struct omap_usb_config *config)
  471. {
  472. unsigned int val;
  473. u16 w;
  474. config->usb0_init(config->pins[0], is_usb0_device(config));
  475. config->usb1_init(config->pins[1]);
  476. config->usb2_init(config->pins[2], 0);
  477. val = omap_readl(MOD_CONF_CTRL_0) & ~(0x3f << 1);
  478. val |= (config->hmc_mode << 1);
  479. omap_writel(val, MOD_CONF_CTRL_0);
  480. printk("USB: hmc %d", config->hmc_mode);
  481. if (config->pins[0])
  482. pr_cont(", usb0 %d wires%s", config->pins[0],
  483. is_usb0_device(config) ? " (dev)" : "");
  484. if (config->pins[1])
  485. pr_cont(", usb1 %d wires", config->pins[1]);
  486. if (config->pins[2])
  487. pr_cont(", usb2 %d wires", config->pins[2]);
  488. pr_cont("\n");
  489. /* use DPLL for 48 MHz function clock */
  490. pr_debug("APLL %04x DPLL %04x REQ %04x\n", omap_readw(ULPD_APLL_CTRL),
  491. omap_readw(ULPD_DPLL_CTRL), omap_readw(ULPD_SOFT_REQ));
  492. w = omap_readw(ULPD_APLL_CTRL);
  493. w &= ~APLL_NDPLL_SWITCH;
  494. omap_writew(w, ULPD_APLL_CTRL);
  495. w = omap_readw(ULPD_DPLL_CTRL);
  496. w |= DPLL_IOB | DPLL_PLL_ENABLE;
  497. omap_writew(w, ULPD_DPLL_CTRL);
  498. w = omap_readw(ULPD_SOFT_REQ);
  499. w |= SOFT_UDC_REQ | SOFT_DPLL_REQ;
  500. omap_writew(w, ULPD_SOFT_REQ);
  501. while (!(omap_readw(ULPD_DPLL_CTRL) & DPLL_LOCK))
  502. cpu_relax();
  503. #if IS_ENABLED(CONFIG_USB_OMAP)
  504. if (config->register_dev) {
  505. int status;
  506. udc_device.dev.platform_data = config;
  507. status = platform_device_register(&udc_device);
  508. if (status)
  509. pr_debug("can't register UDC device, %d\n", status);
  510. /* udc driver gates 48MHz by D+ pullup */
  511. }
  512. #endif
  513. #if IS_ENABLED(CONFIG_USB_OHCI_HCD)
  514. if (config->register_host) {
  515. int status;
  516. ohci_device.dev.platform_data = config;
  517. status = platform_device_register(&ohci_device);
  518. if (status)
  519. pr_debug("can't register OHCI device, %d\n", status);
  520. /* hcd explicitly gates 48MHz */
  521. }
  522. #endif
  523. }
  524. #else
  525. static inline void omap_1510_usb_init(struct omap_usb_config *config) {}
  526. #endif
  527. void __init omap1_usb_init(struct omap_usb_config *_pdata)
  528. {
  529. struct omap_usb_config *pdata;
  530. pdata = kmemdup(_pdata, sizeof(*pdata), GFP_KERNEL);
  531. if (!pdata)
  532. return;
  533. pdata->usb0_init = omap1_usb0_init;
  534. pdata->usb1_init = omap1_usb1_init;
  535. pdata->usb2_init = omap1_usb2_init;
  536. udc_device_init(pdata);
  537. ohci_device_init(pdata);
  538. otg_device_init(pdata);
  539. if (cpu_is_omap7xx() || cpu_is_omap16xx())
  540. omap_otg_init(pdata);
  541. else if (cpu_is_omap15xx())
  542. omap_1510_usb_init(pdata);
  543. else
  544. printk(KERN_ERR "USB: No init for your chip yet\n");
  545. }