pci_fire.c 14 KB

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