qe.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. /*
  2. * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved.
  3. *
  4. * Authors: Shlomi Gridish <gridish@freescale.com>
  5. * Li Yang <leoli@freescale.com>
  6. * Based on cpm2_common.c from Dan Malek (dmalek@jlc.net)
  7. *
  8. * Description:
  9. * General Purpose functions for the global management of the
  10. * QUICC Engine (QE).
  11. *
  12. * This program is free software; you can redistribute it and/or modify it
  13. * under the terms of the GNU General Public License as published by the
  14. * Free Software Foundation; either version 2 of the License, or (at your
  15. * option) any later version.
  16. */
  17. #include <linux/errno.h>
  18. #include <linux/sched.h>
  19. #include <linux/kernel.h>
  20. #include <linux/param.h>
  21. #include <linux/string.h>
  22. #include <linux/mm.h>
  23. #include <linux/interrupt.h>
  24. #include <linux/bootmem.h>
  25. #include <linux/module.h>
  26. #include <linux/delay.h>
  27. #include <linux/ioport.h>
  28. #include <linux/crc32.h>
  29. #include <asm/irq.h>
  30. #include <asm/page.h>
  31. #include <asm/pgtable.h>
  32. #include <asm/immap_qe.h>
  33. #include <asm/qe.h>
  34. #include <asm/prom.h>
  35. #include <asm/rheap.h>
  36. static void qe_snums_init(void);
  37. static void qe_muram_init(void);
  38. static int qe_sdma_init(void);
  39. static DEFINE_SPINLOCK(qe_lock);
  40. /* QE snum state */
  41. enum qe_snum_state {
  42. QE_SNUM_STATE_USED,
  43. QE_SNUM_STATE_FREE
  44. };
  45. /* QE snum */
  46. struct qe_snum {
  47. u8 num;
  48. enum qe_snum_state state;
  49. };
  50. /* We allocate this here because it is used almost exclusively for
  51. * the communication processor devices.
  52. */
  53. struct qe_immap __iomem *qe_immr;
  54. EXPORT_SYMBOL(qe_immr);
  55. static struct qe_snum snums[QE_NUM_OF_SNUM]; /* Dynamically allocated SNUMs */
  56. static phys_addr_t qebase = -1;
  57. phys_addr_t get_qe_base(void)
  58. {
  59. struct device_node *qe;
  60. unsigned int size;
  61. const u32 *prop;
  62. if (qebase != -1)
  63. return qebase;
  64. qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
  65. if (!qe) {
  66. qe = of_find_node_by_type(NULL, "qe");
  67. if (!qe)
  68. return qebase;
  69. }
  70. prop = of_get_property(qe, "reg", &size);
  71. if (prop && size >= sizeof(*prop))
  72. qebase = of_translate_address(qe, prop);
  73. of_node_put(qe);
  74. return qebase;
  75. }
  76. EXPORT_SYMBOL(get_qe_base);
  77. void qe_reset(void)
  78. {
  79. if (qe_immr == NULL)
  80. qe_immr = ioremap(get_qe_base(), QE_IMMAP_SIZE);
  81. qe_snums_init();
  82. qe_issue_cmd(QE_RESET, QE_CR_SUBBLOCK_INVALID,
  83. QE_CR_PROTOCOL_UNSPECIFIED, 0);
  84. /* Reclaim the MURAM memory for our use. */
  85. qe_muram_init();
  86. if (qe_sdma_init())
  87. panic("sdma init failed!");
  88. }
  89. int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input)
  90. {
  91. unsigned long flags;
  92. u8 mcn_shift = 0, dev_shift = 0;
  93. spin_lock_irqsave(&qe_lock, flags);
  94. if (cmd == QE_RESET) {
  95. out_be32(&qe_immr->cp.cecr, (u32) (cmd | QE_CR_FLG));
  96. } else {
  97. if (cmd == QE_ASSIGN_PAGE) {
  98. /* Here device is the SNUM, not sub-block */
  99. dev_shift = QE_CR_SNUM_SHIFT;
  100. } else if (cmd == QE_ASSIGN_RISC) {
  101. /* Here device is the SNUM, and mcnProtocol is
  102. * e_QeCmdRiscAssignment value */
  103. dev_shift = QE_CR_SNUM_SHIFT;
  104. mcn_shift = QE_CR_MCN_RISC_ASSIGN_SHIFT;
  105. } else {
  106. if (device == QE_CR_SUBBLOCK_USB)
  107. mcn_shift = QE_CR_MCN_USB_SHIFT;
  108. else
  109. mcn_shift = QE_CR_MCN_NORMAL_SHIFT;
  110. }
  111. out_be32(&qe_immr->cp.cecdr, cmd_input);
  112. out_be32(&qe_immr->cp.cecr,
  113. (cmd | QE_CR_FLG | ((u32) device << dev_shift) | (u32)
  114. mcn_protocol << mcn_shift));
  115. }
  116. /* wait for the QE_CR_FLG to clear */
  117. while(in_be32(&qe_immr->cp.cecr) & QE_CR_FLG)
  118. cpu_relax();
  119. spin_unlock_irqrestore(&qe_lock, flags);
  120. return 0;
  121. }
  122. EXPORT_SYMBOL(qe_issue_cmd);
  123. /* Set a baud rate generator. This needs lots of work. There are
  124. * 16 BRGs, which can be connected to the QE channels or output
  125. * as clocks. The BRGs are in two different block of internal
  126. * memory mapped space.
  127. * The BRG clock is the QE clock divided by 2.
  128. * It was set up long ago during the initial boot phase and is
  129. * is given to us.
  130. * Baud rate clocks are zero-based in the driver code (as that maps
  131. * to port numbers). Documentation uses 1-based numbering.
  132. */
  133. static unsigned int brg_clk = 0;
  134. unsigned int qe_get_brg_clk(void)
  135. {
  136. struct device_node *qe;
  137. unsigned int size;
  138. const u32 *prop;
  139. if (brg_clk)
  140. return brg_clk;
  141. qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
  142. if (!qe) {
  143. qe = of_find_node_by_type(NULL, "qe");
  144. if (!qe)
  145. return brg_clk;
  146. }
  147. prop = of_get_property(qe, "brg-frequency", &size);
  148. if (prop && size == sizeof(*prop))
  149. brg_clk = *prop;
  150. of_node_put(qe);
  151. return brg_clk;
  152. }
  153. EXPORT_SYMBOL(qe_get_brg_clk);
  154. /* Program the BRG to the given sampling rate and multiplier
  155. *
  156. * @brg: the BRG, QE_BRG1 - QE_BRG16
  157. * @rate: the desired sampling rate
  158. * @multiplier: corresponds to the value programmed in GUMR_L[RDCR] or
  159. * GUMR_L[TDCR]. E.g., if this BRG is the RX clock, and GUMR_L[RDCR]=01,
  160. * then 'multiplier' should be 8.
  161. */
  162. int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
  163. {
  164. u32 divisor, tempval;
  165. u32 div16 = 0;
  166. if ((brg < QE_BRG1) || (brg > QE_BRG16))
  167. return -EINVAL;
  168. divisor = qe_get_brg_clk() / (rate * multiplier);
  169. if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
  170. div16 = QE_BRGC_DIV16;
  171. divisor /= 16;
  172. }
  173. /* Errata QE_General4, which affects some MPC832x and MPC836x SOCs, says
  174. that the BRG divisor must be even if you're not using divide-by-16
  175. mode. */
  176. if (!div16 && (divisor & 1))
  177. divisor++;
  178. tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
  179. QE_BRGC_ENABLE | div16;
  180. out_be32(&qe_immr->brg.brgc[brg - QE_BRG1], tempval);
  181. return 0;
  182. }
  183. EXPORT_SYMBOL(qe_setbrg);
  184. /* Convert a string to a QE clock source enum
  185. *
  186. * This function takes a string, typically from a property in the device
  187. * tree, and returns the corresponding "enum qe_clock" value.
  188. */
  189. enum qe_clock qe_clock_source(const char *source)
  190. {
  191. unsigned int i;
  192. if (strcasecmp(source, "none") == 0)
  193. return QE_CLK_NONE;
  194. if (strncasecmp(source, "brg", 3) == 0) {
  195. i = simple_strtoul(source + 3, NULL, 10);
  196. if ((i >= 1) && (i <= 16))
  197. return (QE_BRG1 - 1) + i;
  198. else
  199. return QE_CLK_DUMMY;
  200. }
  201. if (strncasecmp(source, "clk", 3) == 0) {
  202. i = simple_strtoul(source + 3, NULL, 10);
  203. if ((i >= 1) && (i <= 24))
  204. return (QE_CLK1 - 1) + i;
  205. else
  206. return QE_CLK_DUMMY;
  207. }
  208. return QE_CLK_DUMMY;
  209. }
  210. EXPORT_SYMBOL(qe_clock_source);
  211. /* Initialize SNUMs (thread serial numbers) according to
  212. * QE Module Control chapter, SNUM table
  213. */
  214. static void qe_snums_init(void)
  215. {
  216. int i;
  217. static const u8 snum_init[] = {
  218. 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D,
  219. 0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, 0x88, 0x89,
  220. 0x98, 0x99, 0xA8, 0xA9, 0xB8, 0xB9, 0xC8, 0xC9,
  221. 0xD8, 0xD9, 0xE8, 0xE9,
  222. };
  223. for (i = 0; i < QE_NUM_OF_SNUM; i++) {
  224. snums[i].num = snum_init[i];
  225. snums[i].state = QE_SNUM_STATE_FREE;
  226. }
  227. }
  228. int qe_get_snum(void)
  229. {
  230. unsigned long flags;
  231. int snum = -EBUSY;
  232. int i;
  233. spin_lock_irqsave(&qe_lock, flags);
  234. for (i = 0; i < QE_NUM_OF_SNUM; i++) {
  235. if (snums[i].state == QE_SNUM_STATE_FREE) {
  236. snums[i].state = QE_SNUM_STATE_USED;
  237. snum = snums[i].num;
  238. break;
  239. }
  240. }
  241. spin_unlock_irqrestore(&qe_lock, flags);
  242. return snum;
  243. }
  244. EXPORT_SYMBOL(qe_get_snum);
  245. void qe_put_snum(u8 snum)
  246. {
  247. int i;
  248. for (i = 0; i < QE_NUM_OF_SNUM; i++) {
  249. if (snums[i].num == snum) {
  250. snums[i].state = QE_SNUM_STATE_FREE;
  251. break;
  252. }
  253. }
  254. }
  255. EXPORT_SYMBOL(qe_put_snum);
  256. static int qe_sdma_init(void)
  257. {
  258. struct sdma *sdma = &qe_immr->sdma;
  259. unsigned long sdma_buf_offset;
  260. if (!sdma)
  261. return -ENODEV;
  262. /* allocate 2 internal temporary buffers (512 bytes size each) for
  263. * the SDMA */
  264. sdma_buf_offset = qe_muram_alloc(512 * 2, 4096);
  265. if (IS_ERR_VALUE(sdma_buf_offset))
  266. return -ENOMEM;
  267. out_be32(&sdma->sdebcr, (u32) sdma_buf_offset & QE_SDEBCR_BA_MASK);
  268. out_be32(&sdma->sdmr, (QE_SDMR_GLB_1_MSK |
  269. (0x1 << QE_SDMR_CEN_SHIFT)));
  270. return 0;
  271. }
  272. /*
  273. * muram_alloc / muram_free bits.
  274. */
  275. static DEFINE_SPINLOCK(qe_muram_lock);
  276. /* 16 blocks should be enough to satisfy all requests
  277. * until the memory subsystem goes up... */
  278. static rh_block_t qe_boot_muram_rh_block[16];
  279. static rh_info_t qe_muram_info;
  280. static void qe_muram_init(void)
  281. {
  282. struct device_node *np;
  283. const u32 *address;
  284. u64 size;
  285. unsigned int flags;
  286. /* initialize the info header */
  287. rh_init(&qe_muram_info, 1,
  288. sizeof(qe_boot_muram_rh_block) /
  289. sizeof(qe_boot_muram_rh_block[0]), qe_boot_muram_rh_block);
  290. /* Attach the usable muram area */
  291. /* XXX: This is a subset of the available muram. It
  292. * varies with the processor and the microcode patches activated.
  293. */
  294. np = of_find_compatible_node(NULL, NULL, "fsl,qe-muram-data");
  295. if (!np) {
  296. np = of_find_node_by_name(NULL, "data-only");
  297. if (!np) {
  298. WARN_ON(1);
  299. return;
  300. }
  301. }
  302. address = of_get_address(np, 0, &size, &flags);
  303. WARN_ON(!address);
  304. of_node_put(np);
  305. if (address)
  306. rh_attach_region(&qe_muram_info, *address, (int)size);
  307. }
  308. /* This function returns an index into the MURAM area.
  309. */
  310. unsigned long qe_muram_alloc(int size, int align)
  311. {
  312. unsigned long start;
  313. unsigned long flags;
  314. spin_lock_irqsave(&qe_muram_lock, flags);
  315. start = rh_alloc_align(&qe_muram_info, size, align, "QE");
  316. spin_unlock_irqrestore(&qe_muram_lock, flags);
  317. return start;
  318. }
  319. EXPORT_SYMBOL(qe_muram_alloc);
  320. int qe_muram_free(unsigned long offset)
  321. {
  322. int ret;
  323. unsigned long flags;
  324. spin_lock_irqsave(&qe_muram_lock, flags);
  325. ret = rh_free(&qe_muram_info, offset);
  326. spin_unlock_irqrestore(&qe_muram_lock, flags);
  327. return ret;
  328. }
  329. EXPORT_SYMBOL(qe_muram_free);
  330. /* not sure if this is ever needed */
  331. unsigned long qe_muram_alloc_fixed(unsigned long offset, int size)
  332. {
  333. unsigned long start;
  334. unsigned long flags;
  335. spin_lock_irqsave(&qe_muram_lock, flags);
  336. start = rh_alloc_fixed(&qe_muram_info, offset, size, "commproc");
  337. spin_unlock_irqrestore(&qe_muram_lock, flags);
  338. return start;
  339. }
  340. EXPORT_SYMBOL(qe_muram_alloc_fixed);
  341. void qe_muram_dump(void)
  342. {
  343. rh_dump(&qe_muram_info);
  344. }
  345. EXPORT_SYMBOL(qe_muram_dump);
  346. /* The maximum number of RISCs we support */
  347. #define MAX_QE_RISC 2
  348. /* Firmware information stored here for qe_get_firmware_info() */
  349. static struct qe_firmware_info qe_firmware_info;
  350. /*
  351. * Set to 1 if QE firmware has been uploaded, and therefore
  352. * qe_firmware_info contains valid data.
  353. */
  354. static int qe_firmware_uploaded;
  355. /*
  356. * Upload a QE microcode
  357. *
  358. * This function is a worker function for qe_upload_firmware(). It does
  359. * the actual uploading of the microcode.
  360. */
  361. static void qe_upload_microcode(const void *base,
  362. const struct qe_microcode *ucode)
  363. {
  364. const __be32 *code = base + be32_to_cpu(ucode->code_offset);
  365. unsigned int i;
  366. if (ucode->major || ucode->minor || ucode->revision)
  367. printk(KERN_INFO "qe-firmware: "
  368. "uploading microcode '%s' version %u.%u.%u\n",
  369. ucode->id, ucode->major, ucode->minor, ucode->revision);
  370. else
  371. printk(KERN_INFO "qe-firmware: "
  372. "uploading microcode '%s'\n", ucode->id);
  373. /* Use auto-increment */
  374. out_be32(&qe_immr->iram.iadd, be32_to_cpu(ucode->iram_offset) |
  375. QE_IRAM_IADD_AIE | QE_IRAM_IADD_BADDR);
  376. for (i = 0; i < be32_to_cpu(ucode->count); i++)
  377. out_be32(&qe_immr->iram.idata, be32_to_cpu(code[i]));
  378. }
  379. /*
  380. * Upload a microcode to the I-RAM at a specific address.
  381. *
  382. * See Documentation/powerpc/qe-firmware.txt for information on QE microcode
  383. * uploading.
  384. *
  385. * Currently, only version 1 is supported, so the 'version' field must be
  386. * set to 1.
  387. *
  388. * The SOC model and revision are not validated, they are only displayed for
  389. * informational purposes.
  390. *
  391. * 'calc_size' is the calculated size, in bytes, of the firmware structure and
  392. * all of the microcode structures, minus the CRC.
  393. *
  394. * 'length' is the size that the structure says it is, including the CRC.
  395. */
  396. int qe_upload_firmware(const struct qe_firmware *firmware)
  397. {
  398. unsigned int i;
  399. unsigned int j;
  400. u32 crc;
  401. size_t calc_size = sizeof(struct qe_firmware);
  402. size_t length;
  403. const struct qe_header *hdr;
  404. if (!firmware) {
  405. printk(KERN_ERR "qe-firmware: invalid pointer\n");
  406. return -EINVAL;
  407. }
  408. hdr = &firmware->header;
  409. length = be32_to_cpu(hdr->length);
  410. /* Check the magic */
  411. if ((hdr->magic[0] != 'Q') || (hdr->magic[1] != 'E') ||
  412. (hdr->magic[2] != 'F')) {
  413. printk(KERN_ERR "qe-firmware: not a microcode\n");
  414. return -EPERM;
  415. }
  416. /* Check the version */
  417. if (hdr->version != 1) {
  418. printk(KERN_ERR "qe-firmware: unsupported version\n");
  419. return -EPERM;
  420. }
  421. /* Validate some of the fields */
  422. if ((firmware->count < 1) || (firmware->count > MAX_QE_RISC)) {
  423. printk(KERN_ERR "qe-firmware: invalid data\n");
  424. return -EINVAL;
  425. }
  426. /* Validate the length and check if there's a CRC */
  427. calc_size += (firmware->count - 1) * sizeof(struct qe_microcode);
  428. for (i = 0; i < firmware->count; i++)
  429. /*
  430. * For situations where the second RISC uses the same microcode
  431. * as the first, the 'code_offset' and 'count' fields will be
  432. * zero, so it's okay to add those.
  433. */
  434. calc_size += sizeof(__be32) *
  435. be32_to_cpu(firmware->microcode[i].count);
  436. /* Validate the length */
  437. if (length != calc_size + sizeof(__be32)) {
  438. printk(KERN_ERR "qe-firmware: invalid length\n");
  439. return -EPERM;
  440. }
  441. /* Validate the CRC */
  442. crc = be32_to_cpu(*(__be32 *)((void *)firmware + calc_size));
  443. if (crc != crc32(0, firmware, calc_size)) {
  444. printk(KERN_ERR "qe-firmware: firmware CRC is invalid\n");
  445. return -EIO;
  446. }
  447. /*
  448. * If the microcode calls for it, split the I-RAM.
  449. */
  450. if (!firmware->split)
  451. setbits16(&qe_immr->cp.cercr, QE_CP_CERCR_CIR);
  452. if (firmware->soc.model)
  453. printk(KERN_INFO
  454. "qe-firmware: firmware '%s' for %u V%u.%u\n",
  455. firmware->id, be16_to_cpu(firmware->soc.model),
  456. firmware->soc.major, firmware->soc.minor);
  457. else
  458. printk(KERN_INFO "qe-firmware: firmware '%s'\n",
  459. firmware->id);
  460. /*
  461. * The QE only supports one microcode per RISC, so clear out all the
  462. * saved microcode information and put in the new.
  463. */
  464. memset(&qe_firmware_info, 0, sizeof(qe_firmware_info));
  465. strcpy(qe_firmware_info.id, firmware->id);
  466. qe_firmware_info.extended_modes = firmware->extended_modes;
  467. memcpy(qe_firmware_info.vtraps, firmware->vtraps,
  468. sizeof(firmware->vtraps));
  469. /* Loop through each microcode. */
  470. for (i = 0; i < firmware->count; i++) {
  471. const struct qe_microcode *ucode = &firmware->microcode[i];
  472. /* Upload a microcode if it's present */
  473. if (ucode->code_offset)
  474. qe_upload_microcode(firmware, ucode);
  475. /* Program the traps for this processor */
  476. for (j = 0; j < 16; j++) {
  477. u32 trap = be32_to_cpu(ucode->traps[j]);
  478. if (trap)
  479. out_be32(&qe_immr->rsp[i].tibcr[j], trap);
  480. }
  481. /* Enable traps */
  482. out_be32(&qe_immr->rsp[i].eccr, be32_to_cpu(ucode->eccr));
  483. }
  484. qe_firmware_uploaded = 1;
  485. return 0;
  486. }
  487. EXPORT_SYMBOL(qe_upload_firmware);
  488. /*
  489. * Get info on the currently-loaded firmware
  490. *
  491. * This function also checks the device tree to see if the boot loader has
  492. * uploaded a firmware already.
  493. */
  494. struct qe_firmware_info *qe_get_firmware_info(void)
  495. {
  496. static int initialized;
  497. struct property *prop;
  498. struct device_node *qe;
  499. struct device_node *fw = NULL;
  500. const char *sprop;
  501. unsigned int i;
  502. /*
  503. * If we haven't checked yet, and a driver hasn't uploaded a firmware
  504. * yet, then check the device tree for information.
  505. */
  506. if (qe_firmware_uploaded)
  507. return &qe_firmware_info;
  508. if (initialized)
  509. return NULL;
  510. initialized = 1;
  511. /*
  512. * Newer device trees have an "fsl,qe" compatible property for the QE
  513. * node, but we still need to support older device trees.
  514. */
  515. qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
  516. if (!qe) {
  517. qe = of_find_node_by_type(NULL, "qe");
  518. if (!qe)
  519. return NULL;
  520. }
  521. /* Find the 'firmware' child node */
  522. for_each_child_of_node(qe, fw) {
  523. if (strcmp(fw->name, "firmware") == 0)
  524. break;
  525. }
  526. of_node_put(qe);
  527. /* Did we find the 'firmware' node? */
  528. if (!fw)
  529. return NULL;
  530. qe_firmware_uploaded = 1;
  531. /* Copy the data into qe_firmware_info*/
  532. sprop = of_get_property(fw, "id", NULL);
  533. if (sprop)
  534. strncpy(qe_firmware_info.id, sprop,
  535. sizeof(qe_firmware_info.id) - 1);
  536. prop = of_find_property(fw, "extended-modes", NULL);
  537. if (prop && (prop->length == sizeof(u64))) {
  538. const u64 *iprop = prop->value;
  539. qe_firmware_info.extended_modes = *iprop;
  540. }
  541. prop = of_find_property(fw, "virtual-traps", NULL);
  542. if (prop && (prop->length == 32)) {
  543. const u32 *iprop = prop->value;
  544. for (i = 0; i < ARRAY_SIZE(qe_firmware_info.vtraps); i++)
  545. qe_firmware_info.vtraps[i] = iprop[i];
  546. }
  547. of_node_put(fw);
  548. return &qe_firmware_info;
  549. }
  550. EXPORT_SYMBOL(qe_get_firmware_info);