pcc.c 17 KB

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