aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/platform/intel-mid
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2016-09-08 06:32:32 -0400
committerIngo Molnar <mingo@kernel.org>2016-09-08 08:07:54 -0400
commitf43ea76cf310c3be95cb75ae1350cbe76a8f2380 (patch)
treebdbcd48111e43862d78eb47dd20e43dded71c86b /arch/x86/platform/intel-mid
parent8e522e1d321b12829960c9b26668c92f14c68d7f (diff)
x86/platform/intel-mid: Keep SRAM powered on at boot
On Penwell SRAM has to be powered on, otherwise it prevents booting. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: ca22312dc840 ("x86/platform/intel-mid: Extend PWRMU to support Penwell") Link: http://lkml.kernel.org/r/20160908103232.137587-2-andriy.shevchenko@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/platform/intel-mid')
-rw-r--r--arch/x86/platform/intel-mid/pwr.c45
1 files changed, 36 insertions, 9 deletions
diff --git a/arch/x86/platform/intel-mid/pwr.c b/arch/x86/platform/intel-mid/pwr.c
index 146ed54e92e5..5d3b45ad1c03 100644
--- a/arch/x86/platform/intel-mid/pwr.c
+++ b/arch/x86/platform/intel-mid/pwr.c
@@ -380,7 +380,7 @@ static int mid_pwr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
380 return 0; 380 return 0;
381} 381}
382 382
383static int mid_set_initial_state(struct mid_pwr *pwr) 383static int mid_set_initial_state(struct mid_pwr *pwr, const u32 *states)
384{ 384{
385 unsigned int i, j; 385 unsigned int i, j;
386 int ret; 386 int ret;
@@ -405,10 +405,10 @@ static int mid_set_initial_state(struct mid_pwr *pwr)
405 * NOTE: The actual device mapping is provided by a platform at run 405 * NOTE: The actual device mapping is provided by a platform at run
406 * time using vendor capability of PCI configuration space. 406 * time using vendor capability of PCI configuration space.
407 */ 407 */
408 mid_pwr_set_state(pwr, 0, 0xffffffff); 408 mid_pwr_set_state(pwr, 0, states[0]);
409 mid_pwr_set_state(pwr, 1, 0xffffffff); 409 mid_pwr_set_state(pwr, 1, states[1]);
410 mid_pwr_set_state(pwr, 2, 0xffffffff); 410 mid_pwr_set_state(pwr, 2, states[2]);
411 mid_pwr_set_state(pwr, 3, 0xffffffff); 411 mid_pwr_set_state(pwr, 3, states[3]);
412 412
413 /* Send command to SCU */ 413 /* Send command to SCU */
414 ret = mid_pwr_wait_for_cmd(pwr, CMD_SET_CFG); 414 ret = mid_pwr_wait_for_cmd(pwr, CMD_SET_CFG);
@@ -423,14 +423,41 @@ static int mid_set_initial_state(struct mid_pwr *pwr)
423 return 0; 423 return 0;
424} 424}
425 425
426static const struct mid_pwr_device_info mid_info = { 426static int pnw_set_initial_state(struct mid_pwr *pwr)
427 .set_initial_state = mid_set_initial_state, 427{
428 /* On Penwell SRAM must stay powered on */
429 const u32 states[] = {
430 0xf00fffff, /* PM_SSC(0) */
431 0xffffffff, /* PM_SSC(1) */
432 0xffffffff, /* PM_SSC(2) */
433 0xffffffff, /* PM_SSC(3) */
434 };
435 return mid_set_initial_state(pwr, states);
436}
437
438static int tng_set_initial_state(struct mid_pwr *pwr)
439{
440 const u32 states[] = {
441 0xffffffff, /* PM_SSC(0) */
442 0xffffffff, /* PM_SSC(1) */
443 0xffffffff, /* PM_SSC(2) */
444 0xffffffff, /* PM_SSC(3) */
445 };
446 return mid_set_initial_state(pwr, states);
447}
448
449static const struct mid_pwr_device_info pnw_info = {
450 .set_initial_state = pnw_set_initial_state,
451};
452
453static const struct mid_pwr_device_info tng_info = {
454 .set_initial_state = tng_set_initial_state,
428}; 455};
429 456
430/* This table should be in sync with the one in drivers/pci/pci-mid.c */ 457/* This table should be in sync with the one in drivers/pci/pci-mid.c */
431static const struct pci_device_id mid_pwr_pci_ids[] = { 458static const struct pci_device_id mid_pwr_pci_ids[] = {
432 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PENWELL), (kernel_ulong_t)&mid_info }, 459 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PENWELL), (kernel_ulong_t)&pnw_info },
433 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&mid_info }, 460 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&tng_info },
434 {} 461 {}
435}; 462};
436 463