pcc.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright (C) 2014 Linaro Ltd.
  4. * Author: Ashwin Chaugule <ashwin.chaugule@linaro.org>
  5. *
  6. * PCC (Platform Communication Channel) is defined in the ACPI 5.0+
  7. * specification. It is a mailbox like mechanism to allow clients
  8. * such as CPPC (Collaborative Processor Performance Control), RAS
  9. * (Reliability, Availability and Serviceability) and MPST (Memory
  10. * Node Power State Table) to talk to the platform (e.g. BMC) through
  11. * shared memory regions as defined in the PCC table entries. The PCC
  12. * specification supports a Doorbell mechanism for the PCC clients
  13. * to notify the platform about new data. This Doorbell information
  14. * is also specified in each PCC table entry.
  15. *
  16. * Typical high level flow of operation is:
  17. *
  18. * PCC Reads:
  19. * * Client tries to acquire a channel lock.
  20. * * After it is acquired it writes READ cmd in communication region cmd
  21. * address.
  22. * * Client issues mbox_send_message() which rings the PCC doorbell
  23. * for its PCC channel.
  24. * * If command completes, then client has control over channel and
  25. * it can proceed with its reads.
  26. * * Client releases lock.
  27. *
  28. * PCC Writes:
  29. * * Client tries to acquire channel lock.
  30. * * Client writes to its communication region after it acquires a
  31. * channel lock.
  32. * * Client writes WRITE cmd in communication region cmd address.
  33. * * Client issues mbox_send_message() which rings the PCC doorbell
  34. * for its PCC channel.
  35. * * If command completes, then writes have succeded and it can release
  36. * the channel lock.
  37. *
  38. * There is a Nominal latency defined for each channel which indicates
  39. * how long to wait until a command completes. If command is not complete
  40. * the client needs to retry or assume failure.
  41. *
  42. * For more details about PCC, please see the ACPI specification from
  43. * http://www.uefi.org/ACPIv5.1 Section 14.
  44. *
  45. * This file implements PCC as a Mailbox controller and allows for PCC
  46. * clients to be implemented as its Mailbox Client Channels.
  47. */
  48. #include <linux/acpi.h>
  49. #include <linux/delay.h>
  50. #include <linux/io.h>
  51. #include <linux/init.h>
  52. #include <linux/interrupt.h>
  53. #include <linux/list.h>
  54. #include <linux/platform_device.h>
  55. #include <linux/mailbox_controller.h>
  56. #include <linux/mailbox_client.h>
  57. #include <linux/io-64-nonatomic-lo-hi.h>
  58. #include <acpi/pcc.h>
  59. #include "mailbox.h"
  60. #define MBOX_IRQ_NAME "pcc-mbox"
  61. static struct mbox_chan *pcc_mbox_channels;
  62. /* Array of cached virtual address for doorbell registers */
  63. static void __iomem **pcc_doorbell_vaddr;
  64. /* Array of cached virtual address for doorbell ack registers */
  65. static void __iomem **pcc_doorbell_ack_vaddr;
  66. /* Array of doorbell interrupts */
  67. static int *pcc_doorbell_irq;
  68. static struct mbox_controller pcc_mbox_ctrl = {};
  69. /**
  70. * get_pcc_channel - Given a PCC subspace idx, get
  71. * the respective mbox_channel.
  72. * @id: PCC subspace index.
  73. *
  74. * Return: ERR_PTR(errno) if error, else pointer
  75. * to mbox channel.
  76. */
  77. static struct mbox_chan *get_pcc_channel(int id)
  78. {
  79. if (id < 0 || id >= pcc_mbox_ctrl.num_chans)
  80. return ERR_PTR(-ENOENT);
  81. return &pcc_mbox_channels[id];
  82. }
  83. /*
  84. * PCC can be used with perf critical drivers such as CPPC
  85. * So it makes sense to locally cache the virtual address and
  86. * use it to read/write to PCC registers such as doorbell register
  87. *
  88. * The below read_register and write_registers are used to read and
  89. * write from perf critical registers such as PCC doorbell register
  90. */
  91. static int read_register(void __iomem *vaddr, u64 *val, unsigned int bit_width)
  92. {
  93. int ret_val = 0;
  94. switch (bit_width) {
  95. case 8:
  96. *val = readb(vaddr);
  97. break;
  98. case 16:
  99. *val = readw(vaddr);
  100. break;
  101. case 32:
  102. *val = readl(vaddr);
  103. break;
  104. case 64:
  105. *val = readq(vaddr);
  106. break;
  107. default:
  108. pr_debug("Error: Cannot read register of %u bit width",
  109. bit_width);
  110. ret_val = -EFAULT;
  111. break;
  112. }
  113. return ret_val;
  114. }
  115. static int write_register(void __iomem *vaddr, u64 val, unsigned int bit_width)
  116. {
  117. int ret_val = 0;
  118. switch (bit_width) {
  119. case 8:
  120. writeb(val, vaddr);
  121. break;
  122. case 16:
  123. writew(val, vaddr);
  124. break;
  125. case 32:
  126. writel(val, vaddr);
  127. break;
  128. case 64:
  129. writeq(val, vaddr);
  130. break;
  131. default:
  132. pr_debug("Error: Cannot write register of %u bit width",
  133. bit_width);
  134. ret_val = -EFAULT;
  135. break;
  136. }
  137. return ret_val;
  138. }
  139. /**
  140. * pcc_map_interrupt - Map a PCC subspace GSI to a linux IRQ number
  141. * @interrupt: GSI number.
  142. * @flags: interrupt flags
  143. *
  144. * Returns: a valid linux IRQ number on success
  145. * 0 or -EINVAL on failure
  146. */
  147. static int pcc_map_interrupt(u32 interrupt, u32 flags)
  148. {
  149. int trigger, polarity;
  150. if (!interrupt)
  151. return 0;
  152. trigger = (flags & ACPI_PCCT_INTERRUPT_MODE) ? ACPI_EDGE_SENSITIVE
  153. : ACPI_LEVEL_SENSITIVE;
  154. polarity = (flags & ACPI_PCCT_INTERRUPT_POLARITY) ? ACPI_ACTIVE_LOW
  155. : ACPI_ACTIVE_HIGH;
  156. return acpi_register_gsi(NULL, interrupt, trigger, polarity);
  157. }
  158. /**
  159. * pcc_mbox_irq - PCC mailbox interrupt handler
  160. */
  161. static irqreturn_t pcc_mbox_irq(int irq, void *p)
  162. {
  163. struct acpi_generic_address *doorbell_ack;
  164. struct acpi_pcct_hw_reduced *pcct_ss;
  165. struct mbox_chan *chan = p;
  166. u64 doorbell_ack_preserve;
  167. u64 doorbell_ack_write;
  168. u64 doorbell_ack_val;
  169. int ret;
  170. pcct_ss = chan->con_priv;
  171. mbox_chan_received_data(chan, NULL);
  172. if (pcct_ss->header.type == ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2) {
  173. struct acpi_pcct_hw_reduced_type2 *pcct2_ss = chan->con_priv;
  174. u32 id = chan - pcc_mbox_channels;
  175. doorbell_ack = &pcct2_ss->platform_ack_register;
  176. doorbell_ack_preserve = pcct2_ss->ack_preserve_mask;
  177. doorbell_ack_write = pcct2_ss->ack_write_mask;
  178. ret = read_register(pcc_doorbell_ack_vaddr[id],
  179. &doorbell_ack_val,
  180. doorbell_ack->bit_width);
  181. if (ret)
  182. return IRQ_NONE;
  183. ret = write_register(pcc_doorbell_ack_vaddr[id],
  184. (doorbell_ack_val & doorbell_ack_preserve)
  185. | doorbell_ack_write,
  186. doorbell_ack->bit_width);
  187. if (ret)
  188. return IRQ_NONE;
  189. }
  190. return IRQ_HANDLED;
  191. }
  192. /**
  193. * pcc_mbox_request_channel - PCC clients call this function to
  194. * request a pointer to their PCC subspace, from which they
  195. * can get the details of communicating with the remote.
  196. * @cl: Pointer to Mailbox client, so we know where to bind the
  197. * Channel.
  198. * @subspace_id: The PCC Subspace index as parsed in the PCC client
  199. * ACPI package. This is used to lookup the array of PCC
  200. * subspaces as parsed by the PCC Mailbox controller.
  201. *
  202. * Return: Pointer to the Mailbox Channel if successful or
  203. * ERR_PTR.
  204. */
  205. struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
  206. int subspace_id)
  207. {
  208. struct device *dev = pcc_mbox_ctrl.dev;
  209. struct mbox_chan *chan;
  210. unsigned long flags;
  211. /*
  212. * Each PCC Subspace is a Mailbox Channel.
  213. * The PCC Clients get their PCC Subspace ID
  214. * from their own tables and pass it here.
  215. * This returns a pointer to the PCC subspace
  216. * for the Client to operate on.
  217. */
  218. chan = get_pcc_channel(subspace_id);
  219. if (IS_ERR(chan) || chan->cl) {
  220. dev_err(dev, "Channel not found for idx: %d\n", subspace_id);
  221. return ERR_PTR(-EBUSY);
  222. }
  223. spin_lock_irqsave(&chan->lock, flags);
  224. chan->msg_free = 0;
  225. chan->msg_count = 0;
  226. chan->active_req = NULL;
  227. chan->cl = cl;
  228. init_completion(&chan->tx_complete);
  229. if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
  230. chan->txdone_method = TXDONE_BY_ACK;
  231. spin_unlock_irqrestore(&chan->lock, flags);
  232. if (pcc_doorbell_irq[subspace_id] > 0) {
  233. int rc;
  234. rc = devm_request_irq(dev, pcc_doorbell_irq[subspace_id],
  235. pcc_mbox_irq, 0, MBOX_IRQ_NAME, chan);
  236. if (unlikely(rc)) {
  237. dev_err(dev, "failed to register PCC interrupt %d\n",
  238. pcc_doorbell_irq[subspace_id]);
  239. pcc_mbox_free_channel(chan);
  240. chan = ERR_PTR(rc);
  241. }
  242. }
  243. return chan;
  244. }
  245. EXPORT_SYMBOL_GPL(pcc_mbox_request_channel);
  246. /**
  247. * pcc_mbox_free_channel - Clients call this to free their Channel.
  248. *
  249. * @chan: Pointer to the mailbox channel as returned by
  250. * pcc_mbox_request_channel()
  251. */
  252. void pcc_mbox_free_channel(struct mbox_chan *chan)
  253. {
  254. u32 id = chan - pcc_mbox_channels;
  255. unsigned long flags;
  256. if (!chan || !chan->cl)
  257. return;
  258. if (id >= pcc_mbox_ctrl.num_chans) {
  259. pr_debug("pcc_mbox_free_channel: Invalid mbox_chan passed\n");
  260. return;
  261. }
  262. if (pcc_doorbell_irq[id] > 0)
  263. devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan);
  264. spin_lock_irqsave(&chan->lock, flags);
  265. chan->cl = NULL;
  266. chan->active_req = NULL;
  267. if (chan->txdone_method == TXDONE_BY_ACK)
  268. chan->txdone_method = TXDONE_BY_POLL;
  269. spin_unlock_irqrestore(&chan->lock, flags);
  270. }
  271. EXPORT_SYMBOL_GPL(pcc_mbox_free_channel);
  272. /**
  273. * pcc_send_data - Called from Mailbox Controller code. Used
  274. * here only to ring the channel doorbell. The PCC client
  275. * specific read/write is done in the client driver in
  276. * order to maintain atomicity over PCC channel once
  277. * OS has control over it. See above for flow of operations.
  278. * @chan: Pointer to Mailbox channel over which to send data.
  279. * @data: Client specific data written over channel. Used here
  280. * only for debug after PCC transaction completes.
  281. *
  282. * Return: Err if something failed else 0 for success.
  283. */
  284. static int pcc_send_data(struct mbox_chan *chan, void *data)
  285. {
  286. struct acpi_pcct_hw_reduced *pcct_ss = chan->con_priv;
  287. struct acpi_generic_address *doorbell;
  288. u64 doorbell_preserve;
  289. u64 doorbell_val;
  290. u64 doorbell_write;
  291. u32 id = chan - pcc_mbox_channels;
  292. int ret = 0;
  293. if (id >= pcc_mbox_ctrl.num_chans) {
  294. pr_debug("pcc_send_data: Invalid mbox_chan passed\n");
  295. return -ENOENT;
  296. }
  297. doorbell = &pcct_ss->doorbell_register;
  298. doorbell_preserve = pcct_ss->preserve_mask;
  299. doorbell_write = pcct_ss->write_mask;
  300. /* Sync notification from OS to Platform. */
  301. if (pcc_doorbell_vaddr[id]) {
  302. ret = read_register(pcc_doorbell_vaddr[id], &doorbell_val,
  303. doorbell->bit_width);
  304. if (ret)
  305. return ret;
  306. ret = write_register(pcc_doorbell_vaddr[id],
  307. (doorbell_val & doorbell_preserve) | doorbell_write,
  308. doorbell->bit_width);
  309. } else {
  310. ret = acpi_read(&doorbell_val, doorbell);
  311. if (ret)
  312. return ret;
  313. ret = acpi_write((doorbell_val & doorbell_preserve) | doorbell_write,
  314. doorbell);
  315. }
  316. return ret;
  317. }
  318. static const struct mbox_chan_ops pcc_chan_ops = {
  319. .send_data = pcc_send_data,
  320. };
  321. /**
  322. * parse_pcc_subspaces -- Count PCC subspaces defined
  323. * @header: Pointer to the ACPI subtable header under the PCCT.
  324. * @end: End of subtable entry.
  325. *
  326. * Return: If we find a PCC subspace entry of a valid type, return 0.
  327. * Otherwise, return -EINVAL.
  328. *
  329. * This gets called for each entry in the PCC table.
  330. */
  331. static int parse_pcc_subspace(union acpi_subtable_headers *header,
  332. const unsigned long end)
  333. {
  334. struct acpi_pcct_subspace *ss = (struct acpi_pcct_subspace *) header;
  335. if (ss->header.type < ACPI_PCCT_TYPE_RESERVED)
  336. return 0;
  337. return -EINVAL;
  338. }
  339. /**
  340. * pcc_parse_subspace_irq - Parse the PCC IRQ and PCC ACK register
  341. * There should be one entry per PCC client.
  342. * @id: PCC subspace index.
  343. * @pcct_ss: Pointer to the ACPI subtable header under the PCCT.
  344. *
  345. * Return: 0 for Success, else errno.
  346. *
  347. * This gets called for each entry in the PCC table.
  348. */
  349. static int pcc_parse_subspace_irq(int id,
  350. struct acpi_pcct_hw_reduced *pcct_ss)
  351. {
  352. pcc_doorbell_irq[id] = pcc_map_interrupt(pcct_ss->platform_interrupt,
  353. (u32)pcct_ss->flags);
  354. if (pcc_doorbell_irq[id] <= 0) {
  355. pr_err("PCC GSI %d not registered\n",
  356. pcct_ss->platform_interrupt);
  357. return -EINVAL;
  358. }
  359. if (pcct_ss->header.type
  360. == ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2) {
  361. struct acpi_pcct_hw_reduced_type2 *pcct2_ss = (void *)pcct_ss;
  362. pcc_doorbell_ack_vaddr[id] = acpi_os_ioremap(
  363. pcct2_ss->platform_ack_register.address,
  364. pcct2_ss->platform_ack_register.bit_width / 8);
  365. if (!pcc_doorbell_ack_vaddr[id]) {
  366. pr_err("Failed to ioremap PCC ACK register\n");
  367. return -ENOMEM;
  368. }
  369. }
  370. return 0;
  371. }
  372. /**
  373. * acpi_pcc_probe - Parse the ACPI tree for the PCCT.
  374. *
  375. * Return: 0 for Success, else errno.
  376. */
  377. static int __init acpi_pcc_probe(void)
  378. {
  379. struct acpi_table_header *pcct_tbl;
  380. struct acpi_subtable_header *pcct_entry;
  381. struct acpi_table_pcct *acpi_pcct_tbl;
  382. struct acpi_subtable_proc proc[ACPI_PCCT_TYPE_RESERVED];
  383. int count, i, rc;
  384. acpi_status status = AE_OK;
  385. /* Search for PCCT */
  386. status = acpi_get_table(ACPI_SIG_PCCT, 0, &pcct_tbl);
  387. if (ACPI_FAILURE(status) || !pcct_tbl)
  388. return -ENODEV;
  389. /* Set up the subtable handlers */
  390. for (i = ACPI_PCCT_TYPE_GENERIC_SUBSPACE;
  391. i < ACPI_PCCT_TYPE_RESERVED; i++) {
  392. proc[i].id = i;
  393. proc[i].count = 0;
  394. proc[i].handler = parse_pcc_subspace;
  395. }
  396. count = acpi_table_parse_entries_array(ACPI_SIG_PCCT,
  397. sizeof(struct acpi_table_pcct), proc,
  398. ACPI_PCCT_TYPE_RESERVED, MAX_PCC_SUBSPACES);
  399. if (count <= 0 || count > MAX_PCC_SUBSPACES) {
  400. if (count < 0)
  401. pr_warn("Error parsing PCC subspaces from PCCT\n");
  402. else
  403. pr_warn("Invalid PCCT: %d PCC subspaces\n", count);
  404. rc = -EINVAL;
  405. goto err_put_pcct;
  406. }
  407. pcc_mbox_channels = kcalloc(count, sizeof(struct mbox_chan),
  408. GFP_KERNEL);
  409. if (!pcc_mbox_channels) {
  410. pr_err("Could not allocate space for PCC mbox channels\n");
  411. rc = -ENOMEM;
  412. goto err_put_pcct;
  413. }
  414. pcc_doorbell_vaddr = kcalloc(count, sizeof(void *), GFP_KERNEL);
  415. if (!pcc_doorbell_vaddr) {
  416. rc = -ENOMEM;
  417. goto err_free_mbox;
  418. }
  419. pcc_doorbell_ack_vaddr = kcalloc(count, sizeof(void *), GFP_KERNEL);
  420. if (!pcc_doorbell_ack_vaddr) {
  421. rc = -ENOMEM;
  422. goto err_free_db_vaddr;
  423. }
  424. pcc_doorbell_irq = kcalloc(count, sizeof(int), GFP_KERNEL);
  425. if (!pcc_doorbell_irq) {
  426. rc = -ENOMEM;
  427. goto err_free_db_ack_vaddr;
  428. }
  429. /* Point to the first PCC subspace entry */
  430. pcct_entry = (struct acpi_subtable_header *) (
  431. (unsigned long) pcct_tbl + sizeof(struct acpi_table_pcct));
  432. acpi_pcct_tbl = (struct acpi_table_pcct *) pcct_tbl;
  433. if (acpi_pcct_tbl->flags & ACPI_PCCT_DOORBELL)
  434. pcc_mbox_ctrl.txdone_irq = true;
  435. for (i = 0; i < count; i++) {
  436. struct acpi_generic_address *db_reg;
  437. struct acpi_pcct_subspace *pcct_ss;
  438. pcc_mbox_channels[i].con_priv = pcct_entry;
  439. if (pcct_entry->type == ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE ||
  440. pcct_entry->type == ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2) {
  441. struct acpi_pcct_hw_reduced *pcct_hrss;
  442. pcct_hrss = (struct acpi_pcct_hw_reduced *) pcct_entry;
  443. if (pcc_mbox_ctrl.txdone_irq) {
  444. rc = pcc_parse_subspace_irq(i, pcct_hrss);
  445. if (rc < 0)
  446. goto err;
  447. }
  448. }
  449. pcct_ss = (struct acpi_pcct_subspace *) pcct_entry;
  450. /* If doorbell is in system memory cache the virt address */
  451. db_reg = &pcct_ss->doorbell_register;
  452. if (db_reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
  453. pcc_doorbell_vaddr[i] = acpi_os_ioremap(db_reg->address,
  454. db_reg->bit_width/8);
  455. pcct_entry = (struct acpi_subtable_header *)
  456. ((unsigned long) pcct_entry + pcct_entry->length);
  457. }
  458. pcc_mbox_ctrl.num_chans = count;
  459. pr_info("Detected %d PCC Subspaces\n", pcc_mbox_ctrl.num_chans);
  460. return 0;
  461. err:
  462. kfree(pcc_doorbell_irq);
  463. err_free_db_ack_vaddr:
  464. kfree(pcc_doorbell_ack_vaddr);
  465. err_free_db_vaddr:
  466. kfree(pcc_doorbell_vaddr);
  467. err_free_mbox:
  468. kfree(pcc_mbox_channels);
  469. err_put_pcct:
  470. acpi_put_table(pcct_tbl);
  471. return rc;
  472. }
  473. /**
  474. * pcc_mbox_probe - Called when we find a match for the
  475. * PCCT platform device. This is purely used to represent
  476. * the PCCT as a virtual device for registering with the
  477. * generic Mailbox framework.
  478. *
  479. * @pdev: Pointer to platform device returned when a match
  480. * is found.
  481. *
  482. * Return: 0 for Success, else errno.
  483. */
  484. static int pcc_mbox_probe(struct platform_device *pdev)
  485. {
  486. int ret = 0;
  487. pcc_mbox_ctrl.chans = pcc_mbox_channels;
  488. pcc_mbox_ctrl.ops = &pcc_chan_ops;
  489. pcc_mbox_ctrl.dev = &pdev->dev;
  490. pr_info("Registering PCC driver as Mailbox controller\n");
  491. ret = mbox_controller_register(&pcc_mbox_ctrl);
  492. if (ret) {
  493. pr_err("Err registering PCC as Mailbox controller: %d\n", ret);
  494. ret = -ENODEV;
  495. }
  496. return ret;
  497. }
  498. static struct platform_driver pcc_mbox_driver = {
  499. .probe = pcc_mbox_probe,
  500. .driver = {
  501. .name = "PCCT",
  502. .owner = THIS_MODULE,
  503. },
  504. };
  505. static int __init pcc_init(void)
  506. {
  507. int ret;
  508. struct platform_device *pcc_pdev;
  509. if (acpi_disabled)
  510. return -ENODEV;
  511. /* Check if PCC support is available. */
  512. ret = acpi_pcc_probe();
  513. if (ret) {
  514. pr_debug("ACPI PCC probe failed.\n");
  515. return -ENODEV;
  516. }
  517. pcc_pdev = platform_create_bundle(&pcc_mbox_driver,
  518. pcc_mbox_probe, NULL, 0, NULL, 0);
  519. if (IS_ERR(pcc_pdev)) {
  520. pr_debug("Err creating PCC platform bundle\n");
  521. return PTR_ERR(pcc_pdev);
  522. }
  523. return 0;
  524. }
  525. /*
  526. * Make PCC init postcore so that users of this mailbox
  527. * such as the ACPI Processor driver have it available
  528. * at their init.
  529. */
  530. postcore_initcall(pcc_init);