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