fsl_msi.c 15 KB

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