pci_fire.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. // SPDX-License-Identifier: GPL-2.0
  2. /* pci_fire.c: Sun4u platform PCI-E controller support.
  3. *
  4. * Copyright (C) 2007 David S. Miller ([email protected])
  5. */
  6. #include <linux/kernel.h>
  7. #include <linux/pci.h>
  8. #include <linux/slab.h>
  9. #include <linux/init.h>
  10. #include <linux/msi.h>
  11. #include <linux/export.h>
  12. #include <linux/irq.h>
  13. #include <linux/of_device.h>
  14. #include <linux/numa.h>
  15. #include <asm/prom.h>
  16. #include <asm/irq.h>
  17. #include <asm/upa.h>
  18. #include "pci_impl.h"
  19. #define DRIVER_NAME "fire"
  20. #define PFX DRIVER_NAME ": "
  21. #define FIRE_IOMMU_CONTROL 0x40000UL
  22. #define FIRE_IOMMU_TSBBASE 0x40008UL
  23. #define FIRE_IOMMU_FLUSH 0x40100UL
  24. #define FIRE_IOMMU_FLUSHINV 0x40108UL
  25. static int pci_fire_pbm_iommu_init(struct pci_pbm_info *pbm)
  26. {
  27. struct iommu *iommu = pbm->iommu;
  28. u32 vdma[2], dma_mask;
  29. u64 control;
  30. int tsbsize, err;
  31. /* No virtual-dma property on these guys, use largest size. */
  32. vdma[0] = 0xc0000000; /* base */
  33. vdma[1] = 0x40000000; /* size */
  34. dma_mask = 0xffffffff;
  35. tsbsize = 128;
  36. /* Register addresses. */
  37. iommu->iommu_control = pbm->pbm_regs + FIRE_IOMMU_CONTROL;
  38. iommu->iommu_tsbbase = pbm->pbm_regs + FIRE_IOMMU_TSBBASE;
  39. iommu->iommu_flush = pbm->pbm_regs + FIRE_IOMMU_FLUSH;
  40. iommu->iommu_flushinv = pbm->pbm_regs + FIRE_IOMMU_FLUSHINV;
  41. /* We use the main control/status register of FIRE as the write
  42. * completion register.
  43. */
  44. iommu->write_complete_reg = pbm->controller_regs + 0x410000UL;
  45. /*
  46. * Invalidate TLB Entries.
  47. */
  48. upa_writeq(~(u64)0, iommu->iommu_flushinv);
  49. err = iommu_table_init(iommu, tsbsize * 8 * 1024, vdma[0], dma_mask,
  50. pbm->numa_node);
  51. if (err)
  52. return err;
  53. upa_writeq(__pa(iommu->page_table) | 0x7UL, iommu->iommu_tsbbase);
  54. control = upa_readq(iommu->iommu_control);
  55. control |= (0x00000400 /* TSB cache snoop enable */ |
  56. 0x00000300 /* Cache mode */ |
  57. 0x00000002 /* Bypass enable */ |
  58. 0x00000001 /* Translation enable */);
  59. upa_writeq(control, iommu->iommu_control);
  60. return 0;
  61. }
  62. #ifdef CONFIG_PCI_MSI
  63. struct pci_msiq_entry {
  64. u64 word0;
  65. #define MSIQ_WORD0_RESV 0x8000000000000000UL
  66. #define MSIQ_WORD0_FMT_TYPE 0x7f00000000000000UL
  67. #define MSIQ_WORD0_FMT_TYPE_SHIFT 56
  68. #define MSIQ_WORD0_LEN 0x00ffc00000000000UL
  69. #define MSIQ_WORD0_LEN_SHIFT 46
  70. #define MSIQ_WORD0_ADDR0 0x00003fff00000000UL
  71. #define MSIQ_WORD0_ADDR0_SHIFT 32
  72. #define MSIQ_WORD0_RID 0x00000000ffff0000UL
  73. #define MSIQ_WORD0_RID_SHIFT 16
  74. #define MSIQ_WORD0_DATA0 0x000000000000ffffUL
  75. #define MSIQ_WORD0_DATA0_SHIFT 0
  76. #define MSIQ_TYPE_MSG 0x6
  77. #define MSIQ_TYPE_MSI32 0xb
  78. #define MSIQ_TYPE_MSI64 0xf
  79. u64 word1;
  80. #define MSIQ_WORD1_ADDR1 0xffffffffffff0000UL
  81. #define MSIQ_WORD1_ADDR1_SHIFT 16
  82. #define MSIQ_WORD1_DATA1 0x000000000000ffffUL
  83. #define MSIQ_WORD1_DATA1_SHIFT 0
  84. u64 resv[6];
  85. };
  86. /* All MSI registers are offset from pbm->pbm_regs */
  87. #define EVENT_QUEUE_BASE_ADDR_REG 0x010000UL
  88. #define EVENT_QUEUE_BASE_ADDR_ALL_ONES 0xfffc000000000000UL
  89. #define EVENT_QUEUE_CONTROL_SET(EQ) (0x011000UL + (EQ) * 0x8UL)
  90. #define EVENT_QUEUE_CONTROL_SET_OFLOW 0x0200000000000000UL
  91. #define EVENT_QUEUE_CONTROL_SET_EN 0x0000100000000000UL
  92. #define EVENT_QUEUE_CONTROL_CLEAR(EQ) (0x011200UL + (EQ) * 0x8UL)
  93. #define EVENT_QUEUE_CONTROL_CLEAR_OF 0x0200000000000000UL
  94. #define EVENT_QUEUE_CONTROL_CLEAR_E2I 0x0000800000000000UL
  95. #define EVENT_QUEUE_CONTROL_CLEAR_DIS 0x0000100000000000UL
  96. #define EVENT_QUEUE_STATE(EQ) (0x011400UL + (EQ) * 0x8UL)
  97. #define EVENT_QUEUE_STATE_MASK 0x0000000000000007UL
  98. #define EVENT_QUEUE_STATE_IDLE 0x0000000000000001UL
  99. #define EVENT_QUEUE_STATE_ACTIVE 0x0000000000000002UL
  100. #define EVENT_QUEUE_STATE_ERROR 0x0000000000000004UL
  101. #define EVENT_QUEUE_TAIL(EQ) (0x011600UL + (EQ) * 0x8UL)
  102. #define EVENT_QUEUE_TAIL_OFLOW 0x0200000000000000UL
  103. #define EVENT_QUEUE_TAIL_VAL 0x000000000000007fUL
  104. #define EVENT_QUEUE_HEAD(EQ) (0x011800UL + (EQ) * 0x8UL)
  105. #define EVENT_QUEUE_HEAD_VAL 0x000000000000007fUL
  106. #define MSI_MAP(MSI) (0x020000UL + (MSI) * 0x8UL)
  107. #define MSI_MAP_VALID 0x8000000000000000UL
  108. #define MSI_MAP_EQWR_N 0x4000000000000000UL
  109. #define MSI_MAP_EQNUM 0x000000000000003fUL
  110. #define MSI_CLEAR(MSI) (0x028000UL + (MSI) * 0x8UL)
  111. #define MSI_CLEAR_EQWR_N 0x4000000000000000UL
  112. #define IMONDO_DATA0 0x02C000UL
  113. #define IMONDO_DATA0_DATA 0xffffffffffffffc0UL
  114. #define IMONDO_DATA1 0x02C008UL
  115. #define IMONDO_DATA1_DATA 0xffffffffffffffffUL
  116. #define MSI_32BIT_ADDR 0x034000UL
  117. #define MSI_32BIT_ADDR_VAL 0x00000000ffff0000UL
  118. #define MSI_64BIT_ADDR 0x034008UL
  119. #define MSI_64BIT_ADDR_VAL 0xffffffffffff0000UL
  120. static int pci_fire_get_head(struct pci_pbm_info *pbm, unsigned long msiqid,
  121. unsigned long *head)
  122. {
  123. *head = upa_readq(pbm->pbm_regs + EVENT_QUEUE_HEAD(msiqid));
  124. return 0;
  125. }
  126. static int pci_fire_dequeue_msi(struct pci_pbm_info *pbm, unsigned long msiqid,
  127. unsigned long *head, unsigned long *msi)
  128. {
  129. unsigned long type_fmt, type, msi_num;
  130. struct pci_msiq_entry *base, *ep;
  131. base = (pbm->msi_queues + ((msiqid - pbm->msiq_first) * 8192));
  132. ep = &base[*head];
  133. if ((ep->word0 & MSIQ_WORD0_FMT_TYPE) == 0)
  134. return 0;
  135. type_fmt = ((ep->word0 & MSIQ_WORD0_FMT_TYPE) >>
  136. MSIQ_WORD0_FMT_TYPE_SHIFT);
  137. type = (type_fmt >> 3);
  138. if (unlikely(type != MSIQ_TYPE_MSI32 &&
  139. type != MSIQ_TYPE_MSI64))
  140. return -EINVAL;
  141. *msi = msi_num = ((ep->word0 & MSIQ_WORD0_DATA0) >>
  142. MSIQ_WORD0_DATA0_SHIFT);
  143. upa_writeq(MSI_CLEAR_EQWR_N, pbm->pbm_regs + MSI_CLEAR(msi_num));
  144. /* Clear the entry. */
  145. ep->word0 &= ~MSIQ_WORD0_FMT_TYPE;
  146. /* Go to next entry in ring. */
  147. (*head)++;
  148. if (*head >= pbm->msiq_ent_count)
  149. *head = 0;
  150. return 1;
  151. }
  152. static int pci_fire_set_head(struct pci_pbm_info *pbm, unsigned long msiqid,
  153. unsigned long head)
  154. {
  155. upa_writeq(head, pbm->pbm_regs + EVENT_QUEUE_HEAD(msiqid));
  156. return 0;
  157. }
  158. static int pci_fire_msi_setup(struct pci_pbm_info *pbm, unsigned long msiqid,
  159. unsigned long msi, int is_msi64)
  160. {
  161. u64 val;
  162. val = upa_readq(pbm->pbm_regs + MSI_MAP(msi));
  163. val &= ~(MSI_MAP_EQNUM);
  164. val |= msiqid;
  165. upa_writeq(val, pbm->pbm_regs + MSI_MAP(msi));
  166. upa_writeq(MSI_CLEAR_EQWR_N, pbm->pbm_regs + MSI_CLEAR(msi));
  167. val = upa_readq(pbm->pbm_regs + MSI_MAP(msi));
  168. val |= MSI_MAP_VALID;
  169. upa_writeq(val, pbm->pbm_regs + MSI_MAP(msi));
  170. return 0;
  171. }
  172. static int pci_fire_msi_teardown(struct pci_pbm_info *pbm, unsigned long msi)
  173. {
  174. u64 val;
  175. val = upa_readq(pbm->pbm_regs + MSI_MAP(msi));
  176. val &= ~MSI_MAP_VALID;
  177. upa_writeq(val, pbm->pbm_regs + MSI_MAP(msi));
  178. return 0;
  179. }
  180. static int pci_fire_msiq_alloc(struct pci_pbm_info *pbm)
  181. {
  182. unsigned long pages, order, i;
  183. order = get_order(512 * 1024);
  184. pages = __get_free_pages(GFP_KERNEL | __GFP_COMP, order);
  185. if (pages == 0UL) {
  186. printk(KERN_ERR "MSI: Cannot allocate MSI queues (o=%lu).\n",
  187. order);
  188. return -ENOMEM;
  189. }
  190. memset((char *)pages, 0, PAGE_SIZE << order);
  191. pbm->msi_queues = (void *) pages;
  192. upa_writeq((EVENT_QUEUE_BASE_ADDR_ALL_ONES |
  193. __pa(pbm->msi_queues)),
  194. pbm->pbm_regs + EVENT_QUEUE_BASE_ADDR_REG);
  195. upa_writeq(pbm->portid << 6, pbm->pbm_regs + IMONDO_DATA0);
  196. upa_writeq(0, pbm->pbm_regs + IMONDO_DATA1);
  197. upa_writeq(pbm->msi32_start, pbm->pbm_regs + MSI_32BIT_ADDR);
  198. upa_writeq(pbm->msi64_start, pbm->pbm_regs + MSI_64BIT_ADDR);
  199. for (i = 0; i < pbm->msiq_num; i++) {
  200. upa_writeq(0, pbm->pbm_regs + EVENT_QUEUE_HEAD(i));
  201. upa_writeq(0, pbm->pbm_regs + EVENT_QUEUE_TAIL(i));
  202. }
  203. return 0;
  204. }
  205. static void pci_fire_msiq_free(struct pci_pbm_info *pbm)
  206. {
  207. unsigned long pages, order;
  208. order = get_order(512 * 1024);
  209. pages = (unsigned long) pbm->msi_queues;
  210. free_pages(pages, order);
  211. pbm->msi_queues = NULL;
  212. }
  213. static int pci_fire_msiq_build_irq(struct pci_pbm_info *pbm,
  214. unsigned long msiqid,
  215. unsigned long devino)
  216. {
  217. unsigned long cregs = (unsigned long) pbm->pbm_regs;
  218. unsigned long imap_reg, iclr_reg, int_ctrlr;
  219. unsigned int irq;
  220. int fixup;
  221. u64 val;
  222. imap_reg = cregs + (0x001000UL + (devino * 0x08UL));
  223. iclr_reg = cregs + (0x001400UL + (devino * 0x08UL));
  224. /* XXX iterate amongst the 4 IRQ controllers XXX */
  225. int_ctrlr = (1UL << 6);
  226. val = upa_readq(imap_reg);
  227. val |= (1UL << 63) | int_ctrlr;
  228. upa_writeq(val, imap_reg);
  229. fixup = ((pbm->portid << 6) | devino) - int_ctrlr;
  230. irq = build_irq(fixup, iclr_reg, imap_reg);
  231. if (!irq)
  232. return -ENOMEM;
  233. upa_writeq(EVENT_QUEUE_CONTROL_SET_EN,
  234. pbm->pbm_regs + EVENT_QUEUE_CONTROL_SET(msiqid));
  235. return irq;
  236. }
  237. static const struct sparc64_msiq_ops pci_fire_msiq_ops = {
  238. .get_head = pci_fire_get_head,
  239. .dequeue_msi = pci_fire_dequeue_msi,
  240. .set_head = pci_fire_set_head,
  241. .msi_setup = pci_fire_msi_setup,
  242. .msi_teardown = pci_fire_msi_teardown,
  243. .msiq_alloc = pci_fire_msiq_alloc,
  244. .msiq_free = pci_fire_msiq_free,
  245. .msiq_build_irq = pci_fire_msiq_build_irq,
  246. };
  247. static void pci_fire_msi_init(struct pci_pbm_info *pbm)
  248. {
  249. sparc64_pbm_msi_init(pbm, &pci_fire_msiq_ops);
  250. }
  251. #else /* CONFIG_PCI_MSI */
  252. static void pci_fire_msi_init(struct pci_pbm_info *pbm)
  253. {
  254. }
  255. #endif /* !(CONFIG_PCI_MSI) */
  256. /* Based at pbm->controller_regs */
  257. #define FIRE_PARITY_CONTROL 0x470010UL
  258. #define FIRE_PARITY_ENAB 0x8000000000000000UL
  259. #define FIRE_FATAL_RESET_CTL 0x471028UL
  260. #define FIRE_FATAL_RESET_SPARE 0x0000000004000000UL
  261. #define FIRE_FATAL_RESET_MB 0x0000000002000000UL
  262. #define FIRE_FATAL_RESET_CPE 0x0000000000008000UL
  263. #define FIRE_FATAL_RESET_APE 0x0000000000004000UL
  264. #define FIRE_FATAL_RESET_PIO 0x0000000000000040UL
  265. #define FIRE_FATAL_RESET_JW 0x0000000000000004UL
  266. #define FIRE_FATAL_RESET_JI 0x0000000000000002UL
  267. #define FIRE_FATAL_RESET_JR 0x0000000000000001UL
  268. #define FIRE_CORE_INTR_ENABLE 0x471800UL
  269. /* Based at pbm->pbm_regs */
  270. #define FIRE_TLU_CTRL 0x80000UL
  271. #define FIRE_TLU_CTRL_TIM 0x00000000da000000UL
  272. #define FIRE_TLU_CTRL_QDET 0x0000000000000100UL
  273. #define FIRE_TLU_CTRL_CFG 0x0000000000000001UL
  274. #define FIRE_TLU_DEV_CTRL 0x90008UL
  275. #define FIRE_TLU_LINK_CTRL 0x90020UL
  276. #define FIRE_TLU_LINK_CTRL_CLK 0x0000000000000040UL
  277. #define FIRE_LPU_RESET 0xe2008UL
  278. #define FIRE_LPU_LLCFG 0xe2200UL
  279. #define FIRE_LPU_LLCFG_VC0 0x0000000000000100UL
  280. #define FIRE_LPU_FCTRL_UCTRL 0xe2240UL
  281. #define FIRE_LPU_FCTRL_UCTRL_N 0x0000000000000002UL
  282. #define FIRE_LPU_FCTRL_UCTRL_P 0x0000000000000001UL
  283. #define FIRE_LPU_TXL_FIFOP 0xe2430UL
  284. #define FIRE_LPU_LTSSM_CFG2 0xe2788UL
  285. #define FIRE_LPU_LTSSM_CFG3 0xe2790UL
  286. #define FIRE_LPU_LTSSM_CFG4 0xe2798UL
  287. #define FIRE_LPU_LTSSM_CFG5 0xe27a0UL
  288. #define FIRE_DMC_IENAB 0x31800UL
  289. #define FIRE_DMC_DBG_SEL_A 0x53000UL
  290. #define FIRE_DMC_DBG_SEL_B 0x53008UL
  291. #define FIRE_PEC_IENAB 0x51800UL
  292. static void pci_fire_hw_init(struct pci_pbm_info *pbm)
  293. {
  294. u64 val;
  295. upa_writeq(FIRE_PARITY_ENAB,
  296. pbm->controller_regs + FIRE_PARITY_CONTROL);
  297. upa_writeq((FIRE_FATAL_RESET_SPARE |
  298. FIRE_FATAL_RESET_MB |
  299. FIRE_FATAL_RESET_CPE |
  300. FIRE_FATAL_RESET_APE |
  301. FIRE_FATAL_RESET_PIO |
  302. FIRE_FATAL_RESET_JW |
  303. FIRE_FATAL_RESET_JI |
  304. FIRE_FATAL_RESET_JR),
  305. pbm->controller_regs + FIRE_FATAL_RESET_CTL);
  306. upa_writeq(~(u64)0, pbm->controller_regs + FIRE_CORE_INTR_ENABLE);
  307. val = upa_readq(pbm->pbm_regs + FIRE_TLU_CTRL);
  308. val |= (FIRE_TLU_CTRL_TIM |
  309. FIRE_TLU_CTRL_QDET |
  310. FIRE_TLU_CTRL_CFG);
  311. upa_writeq(val, pbm->pbm_regs + FIRE_TLU_CTRL);
  312. upa_writeq(0, pbm->pbm_regs + FIRE_TLU_DEV_CTRL);
  313. upa_writeq(FIRE_TLU_LINK_CTRL_CLK,
  314. pbm->pbm_regs + FIRE_TLU_LINK_CTRL);
  315. upa_writeq(0, pbm->pbm_regs + FIRE_LPU_RESET);
  316. upa_writeq(FIRE_LPU_LLCFG_VC0, pbm->pbm_regs + FIRE_LPU_LLCFG);
  317. upa_writeq((FIRE_LPU_FCTRL_UCTRL_N | FIRE_LPU_FCTRL_UCTRL_P),
  318. pbm->pbm_regs + FIRE_LPU_FCTRL_UCTRL);
  319. upa_writeq(((0xffff << 16) | (0x0000 << 0)),
  320. pbm->pbm_regs + FIRE_LPU_TXL_FIFOP);
  321. upa_writeq(3000000, pbm->pbm_regs + FIRE_LPU_LTSSM_CFG2);
  322. upa_writeq(500000, pbm->pbm_regs + FIRE_LPU_LTSSM_CFG3);
  323. upa_writeq((2 << 16) | (140 << 8),
  324. pbm->pbm_regs + FIRE_LPU_LTSSM_CFG4);
  325. upa_writeq(0, pbm->pbm_regs + FIRE_LPU_LTSSM_CFG5);
  326. upa_writeq(~(u64)0, pbm->pbm_regs + FIRE_DMC_IENAB);
  327. upa_writeq(0, pbm->pbm_regs + FIRE_DMC_DBG_SEL_A);
  328. upa_writeq(0, pbm->pbm_regs + FIRE_DMC_DBG_SEL_B);
  329. upa_writeq(~(u64)0, pbm->pbm_regs + FIRE_PEC_IENAB);
  330. }
  331. static int pci_fire_pbm_init(struct pci_pbm_info *pbm,
  332. struct platform_device *op, u32 portid)
  333. {
  334. const struct linux_prom64_registers *regs;
  335. struct device_node *dp = op->dev.of_node;
  336. int err;
  337. pbm->numa_node = NUMA_NO_NODE;
  338. pbm->pci_ops = &sun4u_pci_ops;
  339. pbm->config_space_reg_bits = 12;
  340. pbm->index = pci_num_pbms++;
  341. pbm->portid = portid;
  342. pbm->op = op;
  343. pbm->name = dp->full_name;
  344. regs = of_get_property(dp, "reg", NULL);
  345. pbm->pbm_regs = regs[0].phys_addr;
  346. pbm->controller_regs = regs[1].phys_addr - 0x410000UL;
  347. printk("%s: SUN4U PCIE Bus Module\n", pbm->name);
  348. pci_determine_mem_io_space(pbm);
  349. pci_get_pbm_props(pbm);
  350. pci_fire_hw_init(pbm);
  351. err = pci_fire_pbm_iommu_init(pbm);
  352. if (err)
  353. return err;
  354. pci_fire_msi_init(pbm);
  355. pbm->pci_bus = pci_scan_one_pbm(pbm, &op->dev);
  356. /* XXX register error interrupt handlers XXX */
  357. pbm->next = pci_pbm_root;
  358. pci_pbm_root = pbm;
  359. return 0;
  360. }
  361. static int fire_probe(struct platform_device *op)
  362. {
  363. struct device_node *dp = op->dev.of_node;
  364. struct pci_pbm_info *pbm;
  365. struct iommu *iommu;
  366. u32 portid;
  367. int err;
  368. portid = of_getintprop_default(dp, "portid", 0xff);
  369. err = -ENOMEM;
  370. pbm = kzalloc(sizeof(*pbm), GFP_KERNEL);
  371. if (!pbm) {
  372. printk(KERN_ERR PFX "Cannot allocate pci_pbminfo.\n");
  373. goto out_err;
  374. }
  375. iommu = kzalloc(sizeof(struct iommu), GFP_KERNEL);
  376. if (!iommu) {
  377. printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n");
  378. goto out_free_controller;
  379. }
  380. pbm->iommu = iommu;
  381. err = pci_fire_pbm_init(pbm, op, portid);
  382. if (err)
  383. goto out_free_iommu;
  384. dev_set_drvdata(&op->dev, pbm);
  385. return 0;
  386. out_free_iommu:
  387. kfree(pbm->iommu);
  388. out_free_controller:
  389. kfree(pbm);
  390. out_err:
  391. return err;
  392. }
  393. static const struct of_device_id fire_match[] = {
  394. {
  395. .name = "pci",
  396. .compatible = "pciex108e,80f0",
  397. },
  398. {},
  399. };
  400. static struct platform_driver fire_driver = {
  401. .driver = {
  402. .name = DRIVER_NAME,
  403. .of_match_table = fire_match,
  404. },
  405. .probe = fire_probe,
  406. };
  407. static int __init fire_init(void)
  408. {
  409. return platform_driver_register(&fire_driver);
  410. }
  411. subsys_initcall(fire_init);