musb_dsps.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. /*
  2. * Texas Instruments DSPS platforms "glue layer"
  3. *
  4. * Copyright (C) 2012, by Texas Instruments
  5. *
  6. * Based on the am35x "glue layer" code.
  7. *
  8. * This file is part of the Inventra Controller Driver for Linux.
  9. *
  10. * The Inventra Controller Driver for Linux is free software; you
  11. * can redistribute it and/or modify it under the terms of the GNU
  12. * General Public License version 2 as published by the Free Software
  13. * Foundation.
  14. *
  15. * The Inventra Controller Driver for Linux is distributed in
  16. * the hope that it will be useful, but WITHOUT ANY WARRANTY;
  17. * without even the implied warranty of MERCHANTABILITY or
  18. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  19. * License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with The Inventra Controller Driver for Linux ; if not,
  23. * write to the Free Software Foundation, Inc., 59 Temple Place,
  24. * Suite 330, Boston, MA 02111-1307 USA
  25. *
  26. * musb_dsps.c will be a common file for all the TI DSPS platforms
  27. * such as dm64x, dm36x, dm35x, da8x, am35x and ti81x.
  28. * For now only ti81x is using this and in future davinci.c, am35x.c
  29. * da8xx.c would be merged to this file after testing.
  30. */
  31. #include <linux/init.h>
  32. #include <linux/io.h>
  33. #include <linux/err.h>
  34. #include <linux/platform_device.h>
  35. #include <linux/dma-mapping.h>
  36. #include <linux/pm_runtime.h>
  37. #include <linux/module.h>
  38. #include <linux/usb/usb_phy_gen_xceiv.h>
  39. #include <linux/platform_data/usb-omap.h>
  40. #include <linux/sizes.h>
  41. #include <linux/of.h>
  42. #include <linux/of_device.h>
  43. #include <linux/of_address.h>
  44. #include <linux/of_irq.h>
  45. #include <linux/usb/of.h>
  46. #include "musb_core.h"
  47. static const struct of_device_id musb_dsps_of_match[];
  48. /**
  49. * avoid using musb_readx()/musb_writex() as glue layer should not be
  50. * dependent on musb core layer symbols.
  51. */
  52. static inline u8 dsps_readb(const void __iomem *addr, unsigned offset)
  53. { return __raw_readb(addr + offset); }
  54. static inline u32 dsps_readl(const void __iomem *addr, unsigned offset)
  55. { return __raw_readl(addr + offset); }
  56. static inline void dsps_writeb(void __iomem *addr, unsigned offset, u8 data)
  57. { __raw_writeb(data, addr + offset); }
  58. static inline void dsps_writel(void __iomem *addr, unsigned offset, u32 data)
  59. { __raw_writel(data, addr + offset); }
  60. /**
  61. * DSPS musb wrapper register offset.
  62. * FIXME: This should be expanded to have all the wrapper registers from TI DSPS
  63. * musb ips.
  64. */
  65. struct dsps_musb_wrapper {
  66. u16 revision;
  67. u16 control;
  68. u16 status;
  69. u16 epintr_set;
  70. u16 epintr_clear;
  71. u16 epintr_status;
  72. u16 coreintr_set;
  73. u16 coreintr_clear;
  74. u16 coreintr_status;
  75. u16 phy_utmi;
  76. u16 mode;
  77. /* bit positions for control */
  78. unsigned reset:5;
  79. /* bit positions for interrupt */
  80. unsigned usb_shift:5;
  81. u32 usb_mask;
  82. u32 usb_bitmap;
  83. unsigned drvvbus:5;
  84. unsigned txep_shift:5;
  85. u32 txep_mask;
  86. u32 txep_bitmap;
  87. unsigned rxep_shift:5;
  88. u32 rxep_mask;
  89. u32 rxep_bitmap;
  90. /* bit positions for phy_utmi */
  91. unsigned otg_disable:5;
  92. /* bit positions for mode */
  93. unsigned iddig:5;
  94. /* miscellaneous stuff */
  95. u8 poll_seconds;
  96. };
  97. /**
  98. * DSPS glue structure.
  99. */
  100. struct dsps_glue {
  101. struct device *dev;
  102. struct platform_device *musb; /* child musb pdev */
  103. const struct dsps_musb_wrapper *wrp; /* wrapper register offsets */
  104. struct timer_list timer; /* otg_workaround timer */
  105. unsigned long last_timer; /* last timer data for each instance */
  106. };
  107. static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
  108. {
  109. struct device *dev = musb->controller;
  110. struct dsps_glue *glue = dev_get_drvdata(dev->parent);
  111. if (timeout == 0)
  112. timeout = jiffies + msecs_to_jiffies(3);
  113. /* Never idle if active, or when VBUS timeout is not set as host */
  114. if (musb->is_active || (musb->a_wait_bcon == 0 &&
  115. musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
  116. dev_dbg(musb->controller, "%s active, deleting timer\n",
  117. usb_otg_state_string(musb->xceiv->state));
  118. del_timer(&glue->timer);
  119. glue->last_timer = jiffies;
  120. return;
  121. }
  122. if (musb->port_mode != MUSB_PORT_MODE_DUAL_ROLE)
  123. return;
  124. if (!musb->g.dev.driver)
  125. return;
  126. if (time_after(glue->last_timer, timeout) &&
  127. timer_pending(&glue->timer)) {
  128. dev_dbg(musb->controller,
  129. "Longer idle timer already pending, ignoring...\n");
  130. return;
  131. }
  132. glue->last_timer = timeout;
  133. dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n",
  134. usb_otg_state_string(musb->xceiv->state),
  135. jiffies_to_msecs(timeout - jiffies));
  136. mod_timer(&glue->timer, timeout);
  137. }
  138. /**
  139. * dsps_musb_enable - enable interrupts
  140. */
  141. static void dsps_musb_enable(struct musb *musb)
  142. {
  143. struct device *dev = musb->controller;
  144. struct platform_device *pdev = to_platform_device(dev->parent);
  145. struct dsps_glue *glue = platform_get_drvdata(pdev);
  146. const struct dsps_musb_wrapper *wrp = glue->wrp;
  147. void __iomem *reg_base = musb->ctrl_base;
  148. u32 epmask, coremask;
  149. /* Workaround: setup IRQs through both register sets. */
  150. epmask = ((musb->epmask & wrp->txep_mask) << wrp->txep_shift) |
  151. ((musb->epmask & wrp->rxep_mask) << wrp->rxep_shift);
  152. coremask = (wrp->usb_bitmap & ~MUSB_INTR_SOF);
  153. dsps_writel(reg_base, wrp->epintr_set, epmask);
  154. dsps_writel(reg_base, wrp->coreintr_set, coremask);
  155. /* Force the DRVVBUS IRQ so we can start polling for ID change. */
  156. dsps_writel(reg_base, wrp->coreintr_set,
  157. (1 << wrp->drvvbus) << wrp->usb_shift);
  158. dsps_musb_try_idle(musb, 0);
  159. }
  160. /**
  161. * dsps_musb_disable - disable HDRC and flush interrupts
  162. */
  163. static void dsps_musb_disable(struct musb *musb)
  164. {
  165. struct device *dev = musb->controller;
  166. struct platform_device *pdev = to_platform_device(dev->parent);
  167. struct dsps_glue *glue = platform_get_drvdata(pdev);
  168. const struct dsps_musb_wrapper *wrp = glue->wrp;
  169. void __iomem *reg_base = musb->ctrl_base;
  170. dsps_writel(reg_base, wrp->coreintr_clear, wrp->usb_bitmap);
  171. dsps_writel(reg_base, wrp->epintr_clear,
  172. wrp->txep_bitmap | wrp->rxep_bitmap);
  173. dsps_writeb(musb->mregs, MUSB_DEVCTL, 0);
  174. }
  175. static void otg_timer(unsigned long _musb)
  176. {
  177. struct musb *musb = (void *)_musb;
  178. void __iomem *mregs = musb->mregs;
  179. struct device *dev = musb->controller;
  180. struct dsps_glue *glue = dev_get_drvdata(dev->parent);
  181. const struct dsps_musb_wrapper *wrp = glue->wrp;
  182. u8 devctl;
  183. unsigned long flags;
  184. int skip_session = 0;
  185. /*
  186. * We poll because DSPS IP's won't expose several OTG-critical
  187. * status change events (from the transceiver) otherwise.
  188. */
  189. devctl = dsps_readb(mregs, MUSB_DEVCTL);
  190. dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl,
  191. usb_otg_state_string(musb->xceiv->state));
  192. spin_lock_irqsave(&musb->lock, flags);
  193. switch (musb->xceiv->state) {
  194. case OTG_STATE_A_WAIT_BCON:
  195. dsps_writeb(musb->mregs, MUSB_DEVCTL, 0);
  196. skip_session = 1;
  197. /* fall */
  198. case OTG_STATE_A_IDLE:
  199. case OTG_STATE_B_IDLE:
  200. if (devctl & MUSB_DEVCTL_BDEVICE) {
  201. musb->xceiv->state = OTG_STATE_B_IDLE;
  202. MUSB_DEV_MODE(musb);
  203. } else {
  204. musb->xceiv->state = OTG_STATE_A_IDLE;
  205. MUSB_HST_MODE(musb);
  206. }
  207. if (!(devctl & MUSB_DEVCTL_SESSION) && !skip_session)
  208. dsps_writeb(mregs, MUSB_DEVCTL, MUSB_DEVCTL_SESSION);
  209. mod_timer(&glue->timer, jiffies + wrp->poll_seconds * HZ);
  210. break;
  211. case OTG_STATE_A_WAIT_VFALL:
  212. musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
  213. dsps_writel(musb->ctrl_base, wrp->coreintr_set,
  214. MUSB_INTR_VBUSERROR << wrp->usb_shift);
  215. break;
  216. default:
  217. break;
  218. }
  219. spin_unlock_irqrestore(&musb->lock, flags);
  220. }
  221. static irqreturn_t dsps_interrupt(int irq, void *hci)
  222. {
  223. struct musb *musb = hci;
  224. void __iomem *reg_base = musb->ctrl_base;
  225. struct device *dev = musb->controller;
  226. struct dsps_glue *glue = dev_get_drvdata(dev->parent);
  227. const struct dsps_musb_wrapper *wrp = glue->wrp;
  228. unsigned long flags;
  229. irqreturn_t ret = IRQ_NONE;
  230. u32 epintr, usbintr;
  231. spin_lock_irqsave(&musb->lock, flags);
  232. /* Get endpoint interrupts */
  233. epintr = dsps_readl(reg_base, wrp->epintr_status);
  234. musb->int_rx = (epintr & wrp->rxep_bitmap) >> wrp->rxep_shift;
  235. musb->int_tx = (epintr & wrp->txep_bitmap) >> wrp->txep_shift;
  236. if (epintr)
  237. dsps_writel(reg_base, wrp->epintr_status, epintr);
  238. /* Get usb core interrupts */
  239. usbintr = dsps_readl(reg_base, wrp->coreintr_status);
  240. if (!usbintr && !epintr)
  241. goto out;
  242. musb->int_usb = (usbintr & wrp->usb_bitmap) >> wrp->usb_shift;
  243. if (usbintr)
  244. dsps_writel(reg_base, wrp->coreintr_status, usbintr);
  245. dev_dbg(musb->controller, "usbintr (%x) epintr(%x)\n",
  246. usbintr, epintr);
  247. /*
  248. * DRVVBUS IRQs are the only proxy we have (a very poor one!) for
  249. * DSPS IP's missing ID change IRQ. We need an ID change IRQ to
  250. * switch appropriately between halves of the OTG state machine.
  251. * Managing DEVCTL.SESSION per Mentor docs requires that we know its
  252. * value but DEVCTL.BDEVICE is invalid without DEVCTL.SESSION set.
  253. * Also, DRVVBUS pulses for SRP (but not at 5V) ...
  254. */
  255. if (is_host_active(musb) && usbintr & MUSB_INTR_BABBLE)
  256. pr_info("CAUTION: musb: Babble Interrupt Occurred\n");
  257. if (usbintr & ((1 << wrp->drvvbus) << wrp->usb_shift)) {
  258. int drvvbus = dsps_readl(reg_base, wrp->status);
  259. void __iomem *mregs = musb->mregs;
  260. u8 devctl = dsps_readb(mregs, MUSB_DEVCTL);
  261. int err;
  262. err = musb->int_usb & MUSB_INTR_VBUSERROR;
  263. if (err) {
  264. /*
  265. * The Mentor core doesn't debounce VBUS as needed
  266. * to cope with device connect current spikes. This
  267. * means it's not uncommon for bus-powered devices
  268. * to get VBUS errors during enumeration.
  269. *
  270. * This is a workaround, but newer RTL from Mentor
  271. * seems to allow a better one: "re"-starting sessions
  272. * without waiting for VBUS to stop registering in
  273. * devctl.
  274. */
  275. musb->int_usb &= ~MUSB_INTR_VBUSERROR;
  276. musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
  277. mod_timer(&glue->timer,
  278. jiffies + wrp->poll_seconds * HZ);
  279. WARNING("VBUS error workaround (delay coming)\n");
  280. } else if (drvvbus) {
  281. MUSB_HST_MODE(musb);
  282. musb->xceiv->otg->default_a = 1;
  283. musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
  284. del_timer(&glue->timer);
  285. } else {
  286. musb->is_active = 0;
  287. MUSB_DEV_MODE(musb);
  288. musb->xceiv->otg->default_a = 0;
  289. musb->xceiv->state = OTG_STATE_B_IDLE;
  290. }
  291. /* NOTE: this must complete power-on within 100 ms. */
  292. dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
  293. drvvbus ? "on" : "off",
  294. usb_otg_state_string(musb->xceiv->state),
  295. err ? " ERROR" : "",
  296. devctl);
  297. ret = IRQ_HANDLED;
  298. }
  299. if (musb->int_tx || musb->int_rx || musb->int_usb)
  300. ret |= musb_interrupt(musb);
  301. /* Poll for ID change */
  302. if (musb->xceiv->state == OTG_STATE_B_IDLE)
  303. mod_timer(&glue->timer, jiffies + wrp->poll_seconds * HZ);
  304. out:
  305. spin_unlock_irqrestore(&musb->lock, flags);
  306. return ret;
  307. }
  308. static int dsps_musb_init(struct musb *musb)
  309. {
  310. struct device *dev = musb->controller;
  311. struct dsps_glue *glue = dev_get_drvdata(dev->parent);
  312. struct platform_device *parent = to_platform_device(dev->parent);
  313. const struct dsps_musb_wrapper *wrp = glue->wrp;
  314. void __iomem *reg_base;
  315. struct resource *r;
  316. u32 rev, val;
  317. r = platform_get_resource_byname(parent, IORESOURCE_MEM, "control");
  318. if (!r)
  319. return -EINVAL;
  320. reg_base = devm_ioremap_resource(dev, r);
  321. if (IS_ERR(reg_base))
  322. return PTR_ERR(reg_base);
  323. musb->ctrl_base = reg_base;
  324. /* NOP driver needs change if supporting dual instance */
  325. musb->xceiv = devm_usb_get_phy_by_phandle(dev, "phys", 0);
  326. if (IS_ERR(musb->xceiv))
  327. return PTR_ERR(musb->xceiv);
  328. /* Returns zero if e.g. not clocked */
  329. rev = dsps_readl(reg_base, wrp->revision);
  330. if (!rev)
  331. return -ENODEV;
  332. usb_phy_init(musb->xceiv);
  333. setup_timer(&glue->timer, otg_timer, (unsigned long) musb);
  334. /* Reset the musb */
  335. dsps_writel(reg_base, wrp->control, (1 << wrp->reset));
  336. musb->isr = dsps_interrupt;
  337. /* reset the otgdisable bit, needed for host mode to work */
  338. val = dsps_readl(reg_base, wrp->phy_utmi);
  339. val &= ~(1 << wrp->otg_disable);
  340. dsps_writel(musb->ctrl_base, wrp->phy_utmi, val);
  341. return 0;
  342. }
  343. static int dsps_musb_exit(struct musb *musb)
  344. {
  345. struct device *dev = musb->controller;
  346. struct dsps_glue *glue = dev_get_drvdata(dev->parent);
  347. del_timer_sync(&glue->timer);
  348. usb_phy_shutdown(musb->xceiv);
  349. return 0;
  350. }
  351. static struct musb_platform_ops dsps_ops = {
  352. .init = dsps_musb_init,
  353. .exit = dsps_musb_exit,
  354. .enable = dsps_musb_enable,
  355. .disable = dsps_musb_disable,
  356. .try_idle = dsps_musb_try_idle,
  357. };
  358. static u64 musb_dmamask = DMA_BIT_MASK(32);
  359. static int get_int_prop(struct device_node *dn, const char *s)
  360. {
  361. int ret;
  362. u32 val;
  363. ret = of_property_read_u32(dn, s, &val);
  364. if (ret)
  365. return 0;
  366. return val;
  367. }
  368. static int get_musb_port_mode(struct device *dev)
  369. {
  370. enum usb_dr_mode mode;
  371. mode = of_usb_get_dr_mode(dev->of_node);
  372. switch (mode) {
  373. case USB_DR_MODE_HOST:
  374. return MUSB_PORT_MODE_HOST;
  375. case USB_DR_MODE_PERIPHERAL:
  376. return MUSB_PORT_MODE_GADGET;
  377. case USB_DR_MODE_UNKNOWN:
  378. case USB_DR_MODE_OTG:
  379. default:
  380. return MUSB_PORT_MODE_DUAL_ROLE;
  381. }
  382. }
  383. static int dsps_create_musb_pdev(struct dsps_glue *glue,
  384. struct platform_device *parent)
  385. {
  386. struct musb_hdrc_platform_data pdata;
  387. struct resource resources[2];
  388. struct resource *res;
  389. struct device *dev = &parent->dev;
  390. struct musb_hdrc_config *config;
  391. struct platform_device *musb;
  392. struct device_node *dn = parent->dev.of_node;
  393. int ret;
  394. memset(resources, 0, sizeof(resources));
  395. res = platform_get_resource_byname(parent, IORESOURCE_MEM, "mc");
  396. if (!res) {
  397. dev_err(dev, "failed to get memory.\n");
  398. return -EINVAL;
  399. }
  400. resources[0] = *res;
  401. res = platform_get_resource_byname(parent, IORESOURCE_IRQ, "mc");
  402. if (!res) {
  403. dev_err(dev, "failed to get irq.\n");
  404. return -EINVAL;
  405. }
  406. resources[1] = *res;
  407. /* allocate the child platform device */
  408. musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
  409. if (!musb) {
  410. dev_err(dev, "failed to allocate musb device\n");
  411. return -ENOMEM;
  412. }
  413. musb->dev.parent = dev;
  414. musb->dev.dma_mask = &musb_dmamask;
  415. musb->dev.coherent_dma_mask = musb_dmamask;
  416. musb->dev.of_node = of_node_get(dn);
  417. glue->musb = musb;
  418. ret = platform_device_add_resources(musb, resources,
  419. ARRAY_SIZE(resources));
  420. if (ret) {
  421. dev_err(dev, "failed to add resources\n");
  422. goto err;
  423. }
  424. config = devm_kzalloc(&parent->dev, sizeof(*config), GFP_KERNEL);
  425. if (!config) {
  426. dev_err(dev, "failed to allocate musb hdrc config\n");
  427. ret = -ENOMEM;
  428. goto err;
  429. }
  430. pdata.config = config;
  431. pdata.platform_ops = &dsps_ops;
  432. config->num_eps = get_int_prop(dn, "mentor,num-eps");
  433. config->ram_bits = get_int_prop(dn, "mentor,ram-bits");
  434. pdata.mode = get_musb_port_mode(dev);
  435. /* DT keeps this entry in mA, musb expects it as per USB spec */
  436. pdata.power = get_int_prop(dn, "mentor,power") / 2;
  437. config->multipoint = of_property_read_bool(dn, "mentor,multipoint");
  438. ret = platform_device_add_data(musb, &pdata, sizeof(pdata));
  439. if (ret) {
  440. dev_err(dev, "failed to add platform_data\n");
  441. goto err;
  442. }
  443. ret = platform_device_add(musb);
  444. if (ret) {
  445. dev_err(dev, "failed to register musb device\n");
  446. goto err;
  447. }
  448. return 0;
  449. err:
  450. platform_device_put(musb);
  451. return ret;
  452. }
  453. static int dsps_probe(struct platform_device *pdev)
  454. {
  455. const struct of_device_id *match;
  456. const struct dsps_musb_wrapper *wrp;
  457. struct dsps_glue *glue;
  458. int ret;
  459. if (!strcmp(pdev->name, "musb-hdrc"))
  460. return -ENODEV;
  461. match = of_match_node(musb_dsps_of_match, pdev->dev.of_node);
  462. if (!match) {
  463. dev_err(&pdev->dev, "fail to get matching of_match struct\n");
  464. return -EINVAL;
  465. }
  466. wrp = match->data;
  467. /* allocate glue */
  468. glue = kzalloc(sizeof(*glue), GFP_KERNEL);
  469. if (!glue) {
  470. dev_err(&pdev->dev, "unable to allocate glue memory\n");
  471. return -ENOMEM;
  472. }
  473. glue->dev = &pdev->dev;
  474. glue->wrp = wrp;
  475. platform_set_drvdata(pdev, glue);
  476. pm_runtime_enable(&pdev->dev);
  477. ret = pm_runtime_get_sync(&pdev->dev);
  478. if (ret < 0) {
  479. dev_err(&pdev->dev, "pm_runtime_get_sync FAILED");
  480. goto err2;
  481. }
  482. ret = dsps_create_musb_pdev(glue, pdev);
  483. if (ret)
  484. goto err3;
  485. return 0;
  486. err3:
  487. pm_runtime_put(&pdev->dev);
  488. err2:
  489. pm_runtime_disable(&pdev->dev);
  490. kfree(glue);
  491. return ret;
  492. }
  493. static int dsps_remove(struct platform_device *pdev)
  494. {
  495. struct dsps_glue *glue = platform_get_drvdata(pdev);
  496. platform_device_unregister(glue->musb);
  497. /* disable usbss clocks */
  498. pm_runtime_put(&pdev->dev);
  499. pm_runtime_disable(&pdev->dev);
  500. kfree(glue);
  501. return 0;
  502. }
  503. static const struct dsps_musb_wrapper am33xx_driver_data = {
  504. .revision = 0x00,
  505. .control = 0x14,
  506. .status = 0x18,
  507. .epintr_set = 0x38,
  508. .epintr_clear = 0x40,
  509. .epintr_status = 0x30,
  510. .coreintr_set = 0x3c,
  511. .coreintr_clear = 0x44,
  512. .coreintr_status = 0x34,
  513. .phy_utmi = 0xe0,
  514. .mode = 0xe8,
  515. .reset = 0,
  516. .otg_disable = 21,
  517. .iddig = 8,
  518. .usb_shift = 0,
  519. .usb_mask = 0x1ff,
  520. .usb_bitmap = (0x1ff << 0),
  521. .drvvbus = 8,
  522. .txep_shift = 0,
  523. .txep_mask = 0xffff,
  524. .txep_bitmap = (0xffff << 0),
  525. .rxep_shift = 16,
  526. .rxep_mask = 0xfffe,
  527. .rxep_bitmap = (0xfffe << 16),
  528. .poll_seconds = 2,
  529. };
  530. static const struct of_device_id musb_dsps_of_match[] = {
  531. { .compatible = "ti,musb-am33xx",
  532. .data = (void *) &am33xx_driver_data, },
  533. { },
  534. };
  535. MODULE_DEVICE_TABLE(of, musb_dsps_of_match);
  536. static struct platform_driver dsps_usbss_driver = {
  537. .probe = dsps_probe,
  538. .remove = dsps_remove,
  539. .driver = {
  540. .name = "musb-dsps",
  541. .of_match_table = musb_dsps_of_match,
  542. },
  543. };
  544. MODULE_DESCRIPTION("TI DSPS MUSB Glue Layer");
  545. MODULE_AUTHOR("Ravi B <ravibabu@ti.com>");
  546. MODULE_AUTHOR("Ajay Kumar Gupta <ajay.gupta@ti.com>");
  547. MODULE_LICENSE("GPL v2");
  548. module_platform_driver(dsps_usbss_driver);