pcc.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  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 MAX_PCC_SUBSPACES 256
  70. #define MBOX_IRQ_NAME "pcc-mbox"
  71. static struct mbox_chan *pcc_mbox_channels;
  72. /* Array of cached virtual address for doorbell registers */
  73. static void __iomem **pcc_doorbell_vaddr;
  74. /* Array of cached virtual address for doorbell ack registers */
  75. static void __iomem **pcc_doorbell_ack_vaddr;
  76. /* Array of doorbell interrupts */
  77. static int *pcc_doorbell_irq;
  78. static struct mbox_controller pcc_mbox_ctrl = {};
  79. /**
  80. * get_pcc_channel - Given a PCC subspace idx, get
  81. * the respective mbox_channel.
  82. * @id: PCC subspace index.
  83. *
  84. * Return: ERR_PTR(errno) if error, else pointer
  85. * to mbox channel.
  86. */
  87. static struct mbox_chan *get_pcc_channel(int id)
  88. {
  89. if (id < 0 || id > pcc_mbox_ctrl.num_chans)
  90. return ERR_PTR(-ENOENT);
  91. return &pcc_mbox_channels[id];
  92. }
  93. /*
  94. * PCC can be used with perf critical drivers such as CPPC
  95. * So it makes sense to locally cache the virtual address and
  96. * use it to read/write to PCC registers such as doorbell register
  97. *
  98. * The below read_register and write_registers are used to read and
  99. * write from perf critical registers such as PCC doorbell register
  100. */
  101. static int read_register(void __iomem *vaddr, u64 *val, unsigned int bit_width)
  102. {
  103. int ret_val = 0;
  104. switch (bit_width) {
  105. case 8:
  106. *val = readb(vaddr);
  107. break;
  108. case 16:
  109. *val = readw(vaddr);
  110. break;
  111. case 32:
  112. *val = readl(vaddr);
  113. break;
  114. case 64:
  115. *val = readq(vaddr);
  116. break;
  117. default:
  118. pr_debug("Error: Cannot read register of %u bit width",
  119. bit_width);
  120. ret_val = -EFAULT;
  121. break;
  122. }
  123. return ret_val;
  124. }
  125. static int write_register(void __iomem *vaddr, u64 val, unsigned int bit_width)
  126. {
  127. int ret_val = 0;
  128. switch (bit_width) {
  129. case 8:
  130. writeb(val, vaddr);
  131. break;
  132. case 16:
  133. writew(val, vaddr);
  134. break;
  135. case 32:
  136. writel(val, vaddr);
  137. break;
  138. case 64:
  139. writeq(val, vaddr);
  140. break;
  141. default:
  142. pr_debug("Error: Cannot write register of %u bit width",
  143. bit_width);
  144. ret_val = -EFAULT;
  145. break;
  146. }
  147. return ret_val;
  148. }
  149. /**
  150. * pcc_map_interrupt - Map a PCC subspace GSI to a linux IRQ number
  151. * @interrupt: GSI number.
  152. * @flags: interrupt flags
  153. *
  154. * Returns: a valid linux IRQ number on success
  155. * 0 or -EINVAL on failure
  156. */
  157. static int pcc_map_interrupt(u32 interrupt, u32 flags)
  158. {
  159. int trigger, polarity;
  160. if (!interrupt)
  161. return 0;
  162. trigger = (flags & ACPI_PCCT_INTERRUPT_MODE) ? ACPI_EDGE_SENSITIVE
  163. : ACPI_LEVEL_SENSITIVE;
  164. polarity = (flags & ACPI_PCCT_INTERRUPT_POLARITY) ? ACPI_ACTIVE_LOW
  165. : ACPI_ACTIVE_HIGH;
  166. return acpi_register_gsi(NULL, interrupt, trigger, polarity);
  167. }
  168. /**
  169. * pcc_mbox_irq - PCC mailbox interrupt handler
  170. */
  171. static irqreturn_t pcc_mbox_irq(int irq, void *p)
  172. {
  173. struct acpi_generic_address *doorbell_ack;
  174. struct acpi_pcct_hw_reduced *pcct_ss;
  175. struct mbox_chan *chan = p;
  176. u64 doorbell_ack_preserve;
  177. u64 doorbell_ack_write;
  178. u64 doorbell_ack_val;
  179. int ret;
  180. pcct_ss = chan->con_priv;
  181. mbox_chan_received_data(chan, NULL);
  182. if (pcct_ss->header.type == ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2) {
  183. struct acpi_pcct_hw_reduced_type2 *pcct2_ss = chan->con_priv;
  184. u32 id = chan - pcc_mbox_channels;
  185. doorbell_ack = &pcct2_ss->doorbell_ack_register;
  186. doorbell_ack_preserve = pcct2_ss->ack_preserve_mask;
  187. doorbell_ack_write = pcct2_ss->ack_write_mask;
  188. ret = read_register(pcc_doorbell_ack_vaddr[id],
  189. &doorbell_ack_val,
  190. doorbell_ack->bit_width);
  191. if (ret)
  192. return IRQ_NONE;
  193. ret = write_register(pcc_doorbell_ack_vaddr[id],
  194. (doorbell_ack_val & doorbell_ack_preserve)
  195. | doorbell_ack_write,
  196. doorbell_ack->bit_width);
  197. if (ret)
  198. return IRQ_NONE;
  199. }
  200. return IRQ_HANDLED;
  201. }
  202. /**
  203. * pcc_mbox_request_channel - PCC clients call this function to
  204. * request a pointer to their PCC subspace, from which they
  205. * can get the details of communicating with the remote.
  206. * @cl: Pointer to Mailbox client, so we know where to bind the
  207. * Channel.
  208. * @subspace_id: The PCC Subspace index as parsed in the PCC client
  209. * ACPI package. This is used to lookup the array of PCC
  210. * subspaces as parsed by the PCC Mailbox controller.
  211. *
  212. * Return: Pointer to the Mailbox Channel if successful or
  213. * ERR_PTR.
  214. */
  215. struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
  216. int subspace_id)
  217. {
  218. struct device *dev = pcc_mbox_ctrl.dev;
  219. struct mbox_chan *chan;
  220. unsigned long flags;
  221. /*
  222. * Each PCC Subspace is a Mailbox Channel.
  223. * The PCC Clients get their PCC Subspace ID
  224. * from their own tables and pass it here.
  225. * This returns a pointer to the PCC subspace
  226. * for the Client to operate on.
  227. */
  228. chan = get_pcc_channel(subspace_id);
  229. if (IS_ERR(chan) || chan->cl) {
  230. dev_err(dev, "Channel not found for idx: %d\n", subspace_id);
  231. return ERR_PTR(-EBUSY);
  232. }
  233. spin_lock_irqsave(&chan->lock, flags);
  234. chan->msg_free = 0;
  235. chan->msg_count = 0;
  236. chan->active_req = NULL;
  237. chan->cl = cl;
  238. init_completion(&chan->tx_complete);
  239. if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
  240. chan->txdone_method |= TXDONE_BY_ACK;
  241. spin_unlock_irqrestore(&chan->lock, flags);
  242. if (pcc_doorbell_irq[subspace_id] > 0) {
  243. int rc;
  244. rc = devm_request_irq(dev, pcc_doorbell_irq[subspace_id],
  245. pcc_mbox_irq, 0, MBOX_IRQ_NAME, chan);
  246. if (unlikely(rc)) {
  247. dev_err(dev, "failed to register PCC interrupt %d\n",
  248. pcc_doorbell_irq[subspace_id]);
  249. pcc_mbox_free_channel(chan);
  250. chan = ERR_PTR(rc);
  251. }
  252. }
  253. return chan;
  254. }
  255. EXPORT_SYMBOL_GPL(pcc_mbox_request_channel);
  256. /**
  257. * pcc_mbox_free_channel - Clients call this to free their Channel.
  258. *
  259. * @chan: Pointer to the mailbox channel as returned by
  260. * pcc_mbox_request_channel()
  261. */
  262. void pcc_mbox_free_channel(struct mbox_chan *chan)
  263. {
  264. u32 id = chan - pcc_mbox_channels;
  265. unsigned long flags;
  266. if (!chan || !chan->cl)
  267. return;
  268. if (id >= pcc_mbox_ctrl.num_chans) {
  269. pr_debug("pcc_mbox_free_channel: Invalid mbox_chan passed\n");
  270. return;
  271. }
  272. if (pcc_doorbell_irq[id] > 0)
  273. devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan);
  274. spin_lock_irqsave(&chan->lock, flags);
  275. chan->cl = NULL;
  276. chan->active_req = NULL;
  277. if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK))
  278. chan->txdone_method = TXDONE_BY_POLL;
  279. spin_unlock_irqrestore(&chan->lock, flags);
  280. }
  281. EXPORT_SYMBOL_GPL(pcc_mbox_free_channel);
  282. /**
  283. * pcc_send_data - Called from Mailbox Controller code. Used
  284. * here only to ring the channel doorbell. The PCC client
  285. * specific read/write is done in the client driver in
  286. * order to maintain atomicity over PCC channel once
  287. * OS has control over it. See above for flow of operations.
  288. * @chan: Pointer to Mailbox channel over which to send data.
  289. * @data: Client specific data written over channel. Used here
  290. * only for debug after PCC transaction completes.
  291. *
  292. * Return: Err if something failed else 0 for success.
  293. */
  294. static int pcc_send_data(struct mbox_chan *chan, void *data)
  295. {
  296. struct acpi_pcct_hw_reduced *pcct_ss = chan->con_priv;
  297. struct acpi_generic_address *doorbell;
  298. u64 doorbell_preserve;
  299. u64 doorbell_val;
  300. u64 doorbell_write;
  301. u32 id = chan - pcc_mbox_channels;
  302. int ret = 0;
  303. if (id >= pcc_mbox_ctrl.num_chans) {
  304. pr_debug("pcc_send_data: Invalid mbox_chan passed\n");
  305. return -ENOENT;
  306. }
  307. doorbell = &pcct_ss->doorbell_register;
  308. doorbell_preserve = pcct_ss->preserve_mask;
  309. doorbell_write = pcct_ss->write_mask;
  310. /* Sync notification from OS to Platform. */
  311. if (pcc_doorbell_vaddr[id]) {
  312. ret = read_register(pcc_doorbell_vaddr[id], &doorbell_val,
  313. doorbell->bit_width);
  314. if (ret)
  315. return ret;
  316. ret = write_register(pcc_doorbell_vaddr[id],
  317. (doorbell_val & doorbell_preserve) | doorbell_write,
  318. doorbell->bit_width);
  319. } else {
  320. ret = acpi_read(&doorbell_val, doorbell);
  321. if (ret)
  322. return ret;
  323. ret = acpi_write((doorbell_val & doorbell_preserve) | doorbell_write,
  324. doorbell);
  325. }
  326. return ret;
  327. }
  328. static const struct mbox_chan_ops pcc_chan_ops = {
  329. .send_data = pcc_send_data,
  330. };
  331. /**
  332. * parse_pcc_subspace - Parse the PCC table and verify PCC subspace
  333. * entries. There should be one entry per PCC client.
  334. * @header: Pointer to the ACPI subtable header under the PCCT.
  335. * @end: End of subtable entry.
  336. *
  337. * Return: 0 for Success, else errno.
  338. *
  339. * This gets called for each entry in the PCC table.
  340. */
  341. static int parse_pcc_subspace(struct acpi_subtable_header *header,
  342. const unsigned long end)
  343. {
  344. struct acpi_pcct_hw_reduced *pcct_ss;
  345. if (pcc_mbox_ctrl.num_chans <= MAX_PCC_SUBSPACES) {
  346. pcct_ss = (struct acpi_pcct_hw_reduced *) header;
  347. if ((pcct_ss->header.type !=
  348. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE)
  349. && (pcct_ss->header.type !=
  350. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2)) {
  351. pr_err("Incorrect PCC Subspace type detected\n");
  352. return -EINVAL;
  353. }
  354. }
  355. return 0;
  356. }
  357. /**
  358. * pcc_parse_subspace_irq - Parse the PCC IRQ and PCC ACK register
  359. * There should be one entry per PCC client.
  360. * @id: PCC subspace index.
  361. * @pcct_ss: Pointer to the ACPI subtable header under the PCCT.
  362. *
  363. * Return: 0 for Success, else errno.
  364. *
  365. * This gets called for each entry in the PCC table.
  366. */
  367. static int pcc_parse_subspace_irq(int id,
  368. struct acpi_pcct_hw_reduced *pcct_ss)
  369. {
  370. pcc_doorbell_irq[id] = pcc_map_interrupt(pcct_ss->doorbell_interrupt,
  371. (u32)pcct_ss->flags);
  372. if (pcc_doorbell_irq[id] <= 0) {
  373. pr_err("PCC GSI %d not registered\n",
  374. pcct_ss->doorbell_interrupt);
  375. return -EINVAL;
  376. }
  377. if (pcct_ss->header.type
  378. == ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2) {
  379. struct acpi_pcct_hw_reduced_type2 *pcct2_ss = (void *)pcct_ss;
  380. pcc_doorbell_ack_vaddr[id] = acpi_os_ioremap(
  381. pcct2_ss->doorbell_ack_register.address,
  382. pcct2_ss->doorbell_ack_register.bit_width / 8);
  383. if (!pcc_doorbell_ack_vaddr[id]) {
  384. pr_err("Failed to ioremap PCC ACK register\n");
  385. return -ENOMEM;
  386. }
  387. }
  388. return 0;
  389. }
  390. /**
  391. * acpi_pcc_probe - Parse the ACPI tree for the PCCT.
  392. *
  393. * Return: 0 for Success, else errno.
  394. */
  395. static int __init acpi_pcc_probe(void)
  396. {
  397. acpi_size pcct_tbl_header_size;
  398. struct acpi_table_header *pcct_tbl;
  399. struct acpi_subtable_header *pcct_entry;
  400. struct acpi_table_pcct *acpi_pcct_tbl;
  401. int count, i, rc;
  402. int sum = 0;
  403. acpi_status status = AE_OK;
  404. /* Search for PCCT */
  405. status = acpi_get_table_with_size(ACPI_SIG_PCCT, 0,
  406. &pcct_tbl,
  407. &pcct_tbl_header_size);
  408. if (ACPI_FAILURE(status) || !pcct_tbl) {
  409. pr_warn("PCCT header not found.\n");
  410. return -ENODEV;
  411. }
  412. count = acpi_table_parse_entries(ACPI_SIG_PCCT,
  413. sizeof(struct acpi_table_pcct),
  414. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE,
  415. parse_pcc_subspace, MAX_PCC_SUBSPACES);
  416. sum += (count > 0) ? count : 0;
  417. count = acpi_table_parse_entries(ACPI_SIG_PCCT,
  418. sizeof(struct acpi_table_pcct),
  419. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2,
  420. parse_pcc_subspace, MAX_PCC_SUBSPACES);
  421. sum += (count > 0) ? count : 0;
  422. if (sum == 0 || sum >= MAX_PCC_SUBSPACES) {
  423. pr_err("Error parsing PCC subspaces from PCCT\n");
  424. return -EINVAL;
  425. }
  426. pcc_mbox_channels = kzalloc(sizeof(struct mbox_chan) *
  427. sum, GFP_KERNEL);
  428. if (!pcc_mbox_channels) {
  429. pr_err("Could not allocate space for PCC mbox channels\n");
  430. return -ENOMEM;
  431. }
  432. pcc_doorbell_vaddr = kcalloc(sum, sizeof(void *), GFP_KERNEL);
  433. if (!pcc_doorbell_vaddr) {
  434. rc = -ENOMEM;
  435. goto err_free_mbox;
  436. }
  437. pcc_doorbell_ack_vaddr = kcalloc(sum, sizeof(void *), GFP_KERNEL);
  438. if (!pcc_doorbell_ack_vaddr) {
  439. rc = -ENOMEM;
  440. goto err_free_db_vaddr;
  441. }
  442. pcc_doorbell_irq = kcalloc(sum, sizeof(int), GFP_KERNEL);
  443. if (!pcc_doorbell_irq) {
  444. rc = -ENOMEM;
  445. goto err_free_db_ack_vaddr;
  446. }
  447. /* Point to the first PCC subspace entry */
  448. pcct_entry = (struct acpi_subtable_header *) (
  449. (unsigned long) pcct_tbl + sizeof(struct acpi_table_pcct));
  450. acpi_pcct_tbl = (struct acpi_table_pcct *) pcct_tbl;
  451. if (acpi_pcct_tbl->flags & ACPI_PCCT_DOORBELL)
  452. pcc_mbox_ctrl.txdone_irq = true;
  453. for (i = 0; i < sum; i++) {
  454. struct acpi_generic_address *db_reg;
  455. struct acpi_pcct_hw_reduced *pcct_ss;
  456. pcc_mbox_channels[i].con_priv = pcct_entry;
  457. pcct_ss = (struct acpi_pcct_hw_reduced *) pcct_entry;
  458. if (pcc_mbox_ctrl.txdone_irq) {
  459. rc = pcc_parse_subspace_irq(i, pcct_ss);
  460. if (rc < 0)
  461. goto err;
  462. }
  463. /* If doorbell is in system memory cache the virt address */
  464. db_reg = &pcct_ss->doorbell_register;
  465. if (db_reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
  466. pcc_doorbell_vaddr[i] = acpi_os_ioremap(db_reg->address,
  467. db_reg->bit_width/8);
  468. pcct_entry = (struct acpi_subtable_header *)
  469. ((unsigned long) pcct_entry + pcct_entry->length);
  470. }
  471. pcc_mbox_ctrl.num_chans = sum;
  472. pr_info("Detected %d PCC Subspaces\n", pcc_mbox_ctrl.num_chans);
  473. return 0;
  474. err:
  475. kfree(pcc_doorbell_irq);
  476. err_free_db_ack_vaddr:
  477. kfree(pcc_doorbell_ack_vaddr);
  478. err_free_db_vaddr:
  479. kfree(pcc_doorbell_vaddr);
  480. err_free_mbox:
  481. kfree(pcc_mbox_channels);
  482. return rc;
  483. }
  484. /**
  485. * pcc_mbox_probe - Called when we find a match for the
  486. * PCCT platform device. This is purely used to represent
  487. * the PCCT as a virtual device for registering with the
  488. * generic Mailbox framework.
  489. *
  490. * @pdev: Pointer to platform device returned when a match
  491. * is found.
  492. *
  493. * Return: 0 for Success, else errno.
  494. */
  495. static int pcc_mbox_probe(struct platform_device *pdev)
  496. {
  497. int ret = 0;
  498. pcc_mbox_ctrl.chans = pcc_mbox_channels;
  499. pcc_mbox_ctrl.ops = &pcc_chan_ops;
  500. pcc_mbox_ctrl.dev = &pdev->dev;
  501. pr_info("Registering PCC driver as Mailbox controller\n");
  502. ret = mbox_controller_register(&pcc_mbox_ctrl);
  503. if (ret) {
  504. pr_err("Err registering PCC as Mailbox controller: %d\n", ret);
  505. ret = -ENODEV;
  506. }
  507. return ret;
  508. }
  509. struct platform_driver pcc_mbox_driver = {
  510. .probe = pcc_mbox_probe,
  511. .driver = {
  512. .name = "PCCT",
  513. .owner = THIS_MODULE,
  514. },
  515. };
  516. static int __init pcc_init(void)
  517. {
  518. int ret;
  519. struct platform_device *pcc_pdev;
  520. if (acpi_disabled)
  521. return -ENODEV;
  522. /* Check if PCC support is available. */
  523. ret = acpi_pcc_probe();
  524. if (ret) {
  525. pr_debug("ACPI PCC probe failed.\n");
  526. return -ENODEV;
  527. }
  528. pcc_pdev = platform_create_bundle(&pcc_mbox_driver,
  529. pcc_mbox_probe, NULL, 0, NULL, 0);
  530. if (IS_ERR(pcc_pdev)) {
  531. pr_debug("Err creating PCC platform bundle\n");
  532. return PTR_ERR(pcc_pdev);
  533. }
  534. return 0;
  535. }
  536. /*
  537. * Make PCC init postcore so that users of this mailbox
  538. * such as the ACPI Processor driver have it available
  539. * at their init.
  540. */
  541. postcore_initcall(pcc_init);