fsl_msi.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2007-2011 Freescale Semiconductor, Inc.
  4. *
  5. * Author: Tony Li <[email protected]>
  6. * Jason Jin <[email protected]>
  7. *
  8. * The hwirq alloc and free code reuse from sysdev/mpic_msi.c
  9. */
  10. #include <linux/irq.h>
  11. #include <linux/msi.h>
  12. #include <linux/pci.h>
  13. #include <linux/slab.h>
  14. #include <linux/of_address.h>
  15. #include <linux/of_irq.h>
  16. #include <linux/of_platform.h>
  17. #include <linux/interrupt.h>
  18. #include <linux/irqdomain.h>
  19. #include <linux/seq_file.h>
  20. #include <sysdev/fsl_soc.h>
  21. #include <asm/hw_irq.h>
  22. #include <asm/ppc-pci.h>
  23. #include <asm/mpic.h>
  24. #include <asm/fsl_hcalls.h>
  25. #include "fsl_msi.h"
  26. #include "fsl_pci.h"
  27. #define MSIIR_OFFSET_MASK 0xfffff
  28. #define MSIIR_IBS_SHIFT 0
  29. #define MSIIR_SRS_SHIFT 5
  30. #define MSIIR1_IBS_SHIFT 4
  31. #define MSIIR1_SRS_SHIFT 0
  32. #define MSI_SRS_MASK 0xf
  33. #define MSI_IBS_MASK 0x1f
  34. #define msi_hwirq(msi, msir_index, intr_index) \
  35. ((msir_index) << (msi)->srs_shift | \
  36. ((intr_index) << (msi)->ibs_shift))
  37. static LIST_HEAD(msi_head);
  38. struct fsl_msi_feature {
  39. u32 fsl_pic_ip;
  40. u32 msiir_offset; /* Offset of MSIIR, relative to start of MSIR bank */
  41. };
  42. struct fsl_msi_cascade_data {
  43. struct fsl_msi *msi_data;
  44. int index;
  45. int virq;
  46. };
  47. static inline u32 fsl_msi_read(u32 __iomem *base, unsigned int reg)
  48. {
  49. return in_be32(base + (reg >> 2));
  50. }
  51. /*
  52. * We do not need this actually. The MSIR register has been read once
  53. * in the cascade interrupt. So, this MSI interrupt has been acked
  54. */
  55. static void fsl_msi_end_irq(struct irq_data *d)
  56. {
  57. }
  58. static void fsl_msi_print_chip(struct irq_data *irqd, struct seq_file *p)
  59. {
  60. struct fsl_msi *msi_data = irqd->domain->host_data;
  61. irq_hw_number_t hwirq = irqd_to_hwirq(irqd);
  62. int cascade_virq, srs;
  63. srs = (hwirq >> msi_data->srs_shift) & MSI_SRS_MASK;
  64. cascade_virq = msi_data->cascade_array[srs]->virq;
  65. seq_printf(p, " fsl-msi-%d", cascade_virq);
  66. }
  67. static struct irq_chip fsl_msi_chip = {
  68. .irq_mask = pci_msi_mask_irq,
  69. .irq_unmask = pci_msi_unmask_irq,
  70. .irq_ack = fsl_msi_end_irq,
  71. .irq_print_chip = fsl_msi_print_chip,
  72. };
  73. static int fsl_msi_host_map(struct irq_domain *h, unsigned int virq,
  74. irq_hw_number_t hw)
  75. {
  76. struct fsl_msi *msi_data = h->host_data;
  77. struct irq_chip *chip = &fsl_msi_chip;
  78. irq_set_status_flags(virq, IRQ_TYPE_EDGE_FALLING);
  79. irq_set_chip_data(virq, msi_data);
  80. irq_set_chip_and_handler(virq, chip, handle_edge_irq);
  81. return 0;
  82. }
  83. static const struct irq_domain_ops fsl_msi_host_ops = {
  84. .map = fsl_msi_host_map,
  85. };
  86. static int fsl_msi_init_allocator(struct fsl_msi *msi_data)
  87. {
  88. int rc, hwirq;
  89. rc = msi_bitmap_alloc(&msi_data->bitmap, NR_MSI_IRQS_MAX,
  90. irq_domain_get_of_node(msi_data->irqhost));
  91. if (rc)
  92. return rc;
  93. /*
  94. * Reserve all the hwirqs
  95. * The available hwirqs will be released in fsl_msi_setup_hwirq()
  96. */
  97. for (hwirq = 0; hwirq < NR_MSI_IRQS_MAX; hwirq++)
  98. msi_bitmap_reserve_hwirq(&msi_data->bitmap, hwirq);
  99. return 0;
  100. }
  101. static void fsl_teardown_msi_irqs(struct pci_dev *pdev)
  102. {
  103. struct msi_desc *entry;
  104. struct fsl_msi *msi_data;
  105. irq_hw_number_t hwirq;
  106. msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) {
  107. hwirq = virq_to_hw(entry->irq);
  108. msi_data = irq_get_chip_data(entry->irq);
  109. irq_set_msi_desc(entry->irq, NULL);
  110. irq_dispose_mapping(entry->irq);
  111. msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1);
  112. }
  113. }
  114. static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
  115. struct msi_msg *msg,
  116. struct fsl_msi *fsl_msi_data)
  117. {
  118. struct fsl_msi *msi_data = fsl_msi_data;
  119. struct pci_controller *hose = pci_bus_to_host(pdev->bus);
  120. u64 address; /* Physical address of the MSIIR */
  121. int len;
  122. const __be64 *reg;
  123. /* If the msi-address-64 property exists, then use it */
  124. reg = of_get_property(hose->dn, "msi-address-64", &len);
  125. if (reg && (len == sizeof(u64)))
  126. address = be64_to_cpup(reg);
  127. else
  128. address = fsl_pci_immrbar_base(hose) + msi_data->msiir_offset;
  129. msg->address_lo = lower_32_bits(address);
  130. msg->address_hi = upper_32_bits(address);
  131. /*
  132. * MPIC version 2.0 has erratum PIC1. It causes
  133. * that neither MSI nor MSI-X can work fine.
  134. * This is a workaround to allow MSI-X to function
  135. * properly. It only works for MSI-X, we prevent
  136. * MSI on buggy chips in fsl_setup_msi_irqs().
  137. */
  138. if (msi_data->feature & MSI_HW_ERRATA_ENDIAN)
  139. msg->data = __swab32(hwirq);
  140. else
  141. msg->data = hwirq;
  142. pr_debug("%s: allocated srs: %d, ibs: %d\n", __func__,
  143. (hwirq >> msi_data->srs_shift) & MSI_SRS_MASK,
  144. (hwirq >> msi_data->ibs_shift) & MSI_IBS_MASK);
  145. }
  146. static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
  147. {
  148. struct pci_controller *hose = pci_bus_to_host(pdev->bus);
  149. struct device_node *np;
  150. phandle phandle = 0;
  151. int rc, hwirq = -ENOMEM;
  152. unsigned int virq;
  153. struct msi_desc *entry;
  154. struct msi_msg msg;
  155. struct fsl_msi *msi_data;
  156. if (type == PCI_CAP_ID_MSI) {
  157. /*
  158. * MPIC version 2.0 has erratum PIC1. For now MSI
  159. * could not work. So check to prevent MSI from
  160. * being used on the board with this erratum.
  161. */
  162. list_for_each_entry(msi_data, &msi_head, list)
  163. if (msi_data->feature & MSI_HW_ERRATA_ENDIAN)
  164. return -EINVAL;
  165. }
  166. /*
  167. * If the PCI node has an fsl,msi property, then we need to use it
  168. * to find the specific MSI.
  169. */
  170. np = of_parse_phandle(hose->dn, "fsl,msi", 0);
  171. if (np) {
  172. if (of_device_is_compatible(np, "fsl,mpic-msi") ||
  173. of_device_is_compatible(np, "fsl,vmpic-msi") ||
  174. of_device_is_compatible(np, "fsl,vmpic-msi-v4.3"))
  175. phandle = np->phandle;
  176. else {
  177. dev_err(&pdev->dev,
  178. "node %pOF has an invalid fsl,msi phandle %u\n",
  179. hose->dn, np->phandle);
  180. of_node_put(np);
  181. return -EINVAL;
  182. }
  183. of_node_put(np);
  184. }
  185. msi_for_each_desc(entry, &pdev->dev, MSI_DESC_NOTASSOCIATED) {
  186. /*
  187. * Loop over all the MSI devices until we find one that has an
  188. * available interrupt.
  189. */
  190. list_for_each_entry(msi_data, &msi_head, list) {
  191. /*
  192. * If the PCI node has an fsl,msi property, then we
  193. * restrict our search to the corresponding MSI node.
  194. * The simplest way is to skip over MSI nodes with the
  195. * wrong phandle. Under the Freescale hypervisor, this
  196. * has the additional benefit of skipping over MSI
  197. * nodes that are not mapped in the PAMU.
  198. */
  199. if (phandle && (phandle != msi_data->phandle))
  200. continue;
  201. hwirq = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1);
  202. if (hwirq >= 0)
  203. break;
  204. }
  205. if (hwirq < 0) {
  206. rc = hwirq;
  207. dev_err(&pdev->dev, "could not allocate MSI interrupt\n");
  208. goto out_free;
  209. }
  210. virq = irq_create_mapping(msi_data->irqhost, hwirq);
  211. if (!virq) {
  212. dev_err(&pdev->dev, "fail mapping hwirq %i\n", hwirq);
  213. msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1);
  214. rc = -ENOSPC;
  215. goto out_free;
  216. }
  217. /* chip_data is msi_data via host->hostdata in host->map() */
  218. irq_set_msi_desc(virq, entry);
  219. fsl_compose_msi_msg(pdev, hwirq, &msg, msi_data);
  220. pci_write_msi_msg(virq, &msg);
  221. }
  222. return 0;
  223. out_free:
  224. /* free by the caller of this function */
  225. return rc;
  226. }
  227. static irqreturn_t fsl_msi_cascade(int irq, void *data)
  228. {
  229. struct fsl_msi *msi_data;
  230. int msir_index = -1;
  231. u32 msir_value = 0;
  232. u32 intr_index;
  233. u32 have_shift = 0;
  234. struct fsl_msi_cascade_data *cascade_data = data;
  235. irqreturn_t ret = IRQ_NONE;
  236. msi_data = cascade_data->msi_data;
  237. msir_index = cascade_data->index;
  238. switch (msi_data->feature & FSL_PIC_IP_MASK) {
  239. case FSL_PIC_IP_MPIC:
  240. msir_value = fsl_msi_read(msi_data->msi_regs,
  241. msir_index * 0x10);
  242. break;
  243. case FSL_PIC_IP_IPIC:
  244. msir_value = fsl_msi_read(msi_data->msi_regs, msir_index * 0x4);
  245. break;
  246. #ifdef CONFIG_EPAPR_PARAVIRT
  247. case FSL_PIC_IP_VMPIC: {
  248. unsigned int ret;
  249. ret = fh_vmpic_get_msir(virq_to_hw(irq), &msir_value);
  250. if (ret) {
  251. pr_err("fsl-msi: fh_vmpic_get_msir() failed for "
  252. "irq %u (ret=%u)\n", irq, ret);
  253. msir_value = 0;
  254. }
  255. break;
  256. }
  257. #endif
  258. }
  259. while (msir_value) {
  260. int err;
  261. intr_index = ffs(msir_value) - 1;
  262. err = generic_handle_domain_irq(msi_data->irqhost,
  263. msi_hwirq(msi_data, msir_index,
  264. intr_index + have_shift));
  265. if (!err)
  266. ret = IRQ_HANDLED;
  267. have_shift += intr_index + 1;
  268. msir_value = msir_value >> (intr_index + 1);
  269. }
  270. return ret;
  271. }
  272. static int fsl_of_msi_remove(struct platform_device *ofdev)
  273. {
  274. struct fsl_msi *msi = platform_get_drvdata(ofdev);
  275. int virq, i;
  276. if (msi->list.prev != NULL)
  277. list_del(&msi->list);
  278. for (i = 0; i < NR_MSI_REG_MAX; i++) {
  279. if (msi->cascade_array[i]) {
  280. virq = msi->cascade_array[i]->virq;
  281. BUG_ON(!virq);
  282. free_irq(virq, msi->cascade_array[i]);
  283. kfree(msi->cascade_array[i]);
  284. irq_dispose_mapping(virq);
  285. }
  286. }
  287. if (msi->bitmap.bitmap)
  288. msi_bitmap_free(&msi->bitmap);
  289. if ((msi->feature & FSL_PIC_IP_MASK) != FSL_PIC_IP_VMPIC)
  290. iounmap(msi->msi_regs);
  291. kfree(msi);
  292. return 0;
  293. }
  294. static struct lock_class_key fsl_msi_irq_class;
  295. static struct lock_class_key fsl_msi_irq_request_class;
  296. static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev,
  297. int offset, int irq_index)
  298. {
  299. struct fsl_msi_cascade_data *cascade_data = NULL;
  300. int virt_msir, i, ret;
  301. virt_msir = irq_of_parse_and_map(dev->dev.of_node, irq_index);
  302. if (!virt_msir) {
  303. dev_err(&dev->dev, "%s: Cannot translate IRQ index %d\n",
  304. __func__, irq_index);
  305. return 0;
  306. }
  307. cascade_data = kzalloc(sizeof(struct fsl_msi_cascade_data), GFP_KERNEL);
  308. if (!cascade_data) {
  309. dev_err(&dev->dev, "No memory for MSI cascade data\n");
  310. return -ENOMEM;
  311. }
  312. irq_set_lockdep_class(virt_msir, &fsl_msi_irq_class,
  313. &fsl_msi_irq_request_class);
  314. cascade_data->index = offset;
  315. cascade_data->msi_data = msi;
  316. cascade_data->virq = virt_msir;
  317. msi->cascade_array[irq_index] = cascade_data;
  318. ret = request_irq(virt_msir, fsl_msi_cascade, IRQF_NO_THREAD,
  319. "fsl-msi-cascade", cascade_data);
  320. if (ret) {
  321. dev_err(&dev->dev, "failed to request_irq(%d), ret = %d\n",
  322. virt_msir, ret);
  323. return ret;
  324. }
  325. /* Release the hwirqs corresponding to this MSI register */
  326. for (i = 0; i < IRQS_PER_MSI_REG; i++)
  327. msi_bitmap_free_hwirqs(&msi->bitmap,
  328. msi_hwirq(msi, offset, i), 1);
  329. return 0;
  330. }
  331. static const struct of_device_id fsl_of_msi_ids[];
  332. static int fsl_of_msi_probe(struct platform_device *dev)
  333. {
  334. const struct of_device_id *match;
  335. struct fsl_msi *msi;
  336. struct resource res, msiir;
  337. int err, i, j, irq_index, count;
  338. const u32 *p;
  339. const struct fsl_msi_feature *features;
  340. int len;
  341. u32 offset;
  342. struct pci_controller *phb;
  343. match = of_match_device(fsl_of_msi_ids, &dev->dev);
  344. if (!match)
  345. return -EINVAL;
  346. features = match->data;
  347. printk(KERN_DEBUG "Setting up Freescale MSI support\n");
  348. msi = kzalloc(sizeof(struct fsl_msi), GFP_KERNEL);
  349. if (!msi) {
  350. dev_err(&dev->dev, "No memory for MSI structure\n");
  351. return -ENOMEM;
  352. }
  353. platform_set_drvdata(dev, msi);
  354. msi->irqhost = irq_domain_add_linear(dev->dev.of_node,
  355. NR_MSI_IRQS_MAX, &fsl_msi_host_ops, msi);
  356. if (msi->irqhost == NULL) {
  357. dev_err(&dev->dev, "No memory for MSI irqhost\n");
  358. err = -ENOMEM;
  359. goto error_out;
  360. }
  361. /*
  362. * Under the Freescale hypervisor, the msi nodes don't have a 'reg'
  363. * property. Instead, we use hypercalls to access the MSI.
  364. */
  365. if ((features->fsl_pic_ip & FSL_PIC_IP_MASK) != FSL_PIC_IP_VMPIC) {
  366. err = of_address_to_resource(dev->dev.of_node, 0, &res);
  367. if (err) {
  368. dev_err(&dev->dev, "invalid resource for node %pOF\n",
  369. dev->dev.of_node);
  370. goto error_out;
  371. }
  372. msi->msi_regs = ioremap(res.start, resource_size(&res));
  373. if (!msi->msi_regs) {
  374. err = -ENOMEM;
  375. dev_err(&dev->dev, "could not map node %pOF\n",
  376. dev->dev.of_node);
  377. goto error_out;
  378. }
  379. msi->msiir_offset =
  380. features->msiir_offset + (res.start & 0xfffff);
  381. /*
  382. * First read the MSIIR/MSIIR1 offset from dts
  383. * On failure use the hardcode MSIIR offset
  384. */
  385. if (of_address_to_resource(dev->dev.of_node, 1, &msiir))
  386. msi->msiir_offset = features->msiir_offset +
  387. (res.start & MSIIR_OFFSET_MASK);
  388. else
  389. msi->msiir_offset = msiir.start & MSIIR_OFFSET_MASK;
  390. }
  391. msi->feature = features->fsl_pic_ip;
  392. /* For erratum PIC1 on MPIC version 2.0*/
  393. if ((features->fsl_pic_ip & FSL_PIC_IP_MASK) == FSL_PIC_IP_MPIC
  394. && (fsl_mpic_primary_get_version() == 0x0200))
  395. msi->feature |= MSI_HW_ERRATA_ENDIAN;
  396. /*
  397. * Remember the phandle, so that we can match with any PCI nodes
  398. * that have an "fsl,msi" property.
  399. */
  400. msi->phandle = dev->dev.of_node->phandle;
  401. err = fsl_msi_init_allocator(msi);
  402. if (err) {
  403. dev_err(&dev->dev, "Error allocating MSI bitmap\n");
  404. goto error_out;
  405. }
  406. p = of_get_property(dev->dev.of_node, "msi-available-ranges", &len);
  407. if (of_device_is_compatible(dev->dev.of_node, "fsl,mpic-msi-v4.3") ||
  408. of_device_is_compatible(dev->dev.of_node, "fsl,vmpic-msi-v4.3")) {
  409. msi->srs_shift = MSIIR1_SRS_SHIFT;
  410. msi->ibs_shift = MSIIR1_IBS_SHIFT;
  411. if (p)
  412. dev_warn(&dev->dev, "%s: dose not support msi-available-ranges property\n",
  413. __func__);
  414. for (irq_index = 0; irq_index < NR_MSI_REG_MSIIR1;
  415. irq_index++) {
  416. err = fsl_msi_setup_hwirq(msi, dev,
  417. irq_index, irq_index);
  418. if (err)
  419. goto error_out;
  420. }
  421. } else {
  422. static const u32 all_avail[] =
  423. { 0, NR_MSI_REG_MSIIR * IRQS_PER_MSI_REG };
  424. msi->srs_shift = MSIIR_SRS_SHIFT;
  425. msi->ibs_shift = MSIIR_IBS_SHIFT;
  426. if (p && len % (2 * sizeof(u32)) != 0) {
  427. dev_err(&dev->dev, "%s: Malformed msi-available-ranges property\n",
  428. __func__);
  429. err = -EINVAL;
  430. goto error_out;
  431. }
  432. if (!p) {
  433. p = all_avail;
  434. len = sizeof(all_avail);
  435. }
  436. for (irq_index = 0, i = 0; i < len / (2 * sizeof(u32)); i++) {
  437. if (p[i * 2] % IRQS_PER_MSI_REG ||
  438. p[i * 2 + 1] % IRQS_PER_MSI_REG) {
  439. pr_warn("%s: %pOF: msi available range of %u at %u is not IRQ-aligned\n",
  440. __func__, dev->dev.of_node,
  441. p[i * 2 + 1], p[i * 2]);
  442. err = -EINVAL;
  443. goto error_out;
  444. }
  445. offset = p[i * 2] / IRQS_PER_MSI_REG;
  446. count = p[i * 2 + 1] / IRQS_PER_MSI_REG;
  447. for (j = 0; j < count; j++, irq_index++) {
  448. err = fsl_msi_setup_hwirq(msi, dev, offset + j,
  449. irq_index);
  450. if (err)
  451. goto error_out;
  452. }
  453. }
  454. }
  455. list_add_tail(&msi->list, &msi_head);
  456. /*
  457. * Apply the MSI ops to all the controllers.
  458. * It doesn't hurt to reassign the same ops,
  459. * but bail out if we find another MSI driver.
  460. */
  461. list_for_each_entry(phb, &hose_list, list_node) {
  462. if (!phb->controller_ops.setup_msi_irqs) {
  463. phb->controller_ops.setup_msi_irqs = fsl_setup_msi_irqs;
  464. phb->controller_ops.teardown_msi_irqs = fsl_teardown_msi_irqs;
  465. } else if (phb->controller_ops.setup_msi_irqs != fsl_setup_msi_irqs) {
  466. dev_err(&dev->dev, "Different MSI driver already installed!\n");
  467. err = -ENODEV;
  468. goto error_out;
  469. }
  470. }
  471. return 0;
  472. error_out:
  473. fsl_of_msi_remove(dev);
  474. return err;
  475. }
  476. static const struct fsl_msi_feature mpic_msi_feature = {
  477. .fsl_pic_ip = FSL_PIC_IP_MPIC,
  478. .msiir_offset = 0x140,
  479. };
  480. static const struct fsl_msi_feature ipic_msi_feature = {
  481. .fsl_pic_ip = FSL_PIC_IP_IPIC,
  482. .msiir_offset = 0x38,
  483. };
  484. static const struct fsl_msi_feature vmpic_msi_feature = {
  485. .fsl_pic_ip = FSL_PIC_IP_VMPIC,
  486. .msiir_offset = 0,
  487. };
  488. static const struct of_device_id fsl_of_msi_ids[] = {
  489. {
  490. .compatible = "fsl,mpic-msi",
  491. .data = &mpic_msi_feature,
  492. },
  493. {
  494. .compatible = "fsl,mpic-msi-v4.3",
  495. .data = &mpic_msi_feature,
  496. },
  497. {
  498. .compatible = "fsl,ipic-msi",
  499. .data = &ipic_msi_feature,
  500. },
  501. #ifdef CONFIG_EPAPR_PARAVIRT
  502. {
  503. .compatible = "fsl,vmpic-msi",
  504. .data = &vmpic_msi_feature,
  505. },
  506. {
  507. .compatible = "fsl,vmpic-msi-v4.3",
  508. .data = &vmpic_msi_feature,
  509. },
  510. #endif
  511. {}
  512. };
  513. static struct platform_driver fsl_of_msi_driver = {
  514. .driver = {
  515. .name = "fsl-msi",
  516. .of_match_table = fsl_of_msi_ids,
  517. },
  518. .probe = fsl_of_msi_probe,
  519. .remove = fsl_of_msi_remove,
  520. };
  521. static __init int fsl_of_msi_init(void)
  522. {
  523. return platform_driver_register(&fsl_of_msi_driver);
  524. }
  525. subsys_initcall(fsl_of_msi_init);