diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2014-03-18 16:51:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-03 19:20:23 -0400 |
commit | ee7e5afd2c369b64ffcf419d38ce7ad1c709a53e (patch) | |
tree | b61d3eea96f2fee5ab8209c44a41dced1e023a60 /drivers/misc/mei/hw-me.c | |
parent | b16c35716b843acdbe562bc0068580c50db203ff (diff) |
mei: condition PGI support on HW and HBM version
Enable power gating isolation only if hw and fw support it.
This is indicated by ME_PGIC_HRA bit in ME_CSR_HA register
and on HBM protocol version.
The information is exported to MEI layer through
new pg_is_enabled hw op.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/hw-me.c')
-rw-r--r-- | drivers/misc/mei/hw-me.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index fc5d001983b3..7a7e66250dfd 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c | |||
@@ -460,6 +460,41 @@ static void mei_me_pg_exit(struct mei_device *dev) | |||
460 | } | 460 | } |
461 | 461 | ||
462 | /** | 462 | /** |
463 | * mei_me_pg_is_enabled - detect if PG is supported by HW | ||
464 | * | ||
465 | * @dev: the device structure | ||
466 | * | ||
467 | * returns: true is pg supported, false otherwise | ||
468 | */ | ||
469 | static bool mei_me_pg_is_enabled(struct mei_device *dev) | ||
470 | { | ||
471 | struct mei_me_hw *hw = to_me_hw(dev); | ||
472 | u32 reg = mei_me_reg_read(hw, ME_CSR_HA); | ||
473 | |||
474 | if ((reg & ME_PGIC_HRA) == 0) | ||
475 | goto notsupported; | ||
476 | |||
477 | if (dev->version.major_version < HBM_MAJOR_VERSION_PGI) | ||
478 | goto notsupported; | ||
479 | |||
480 | if (dev->version.major_version == HBM_MAJOR_VERSION_PGI && | ||
481 | dev->version.minor_version < HBM_MINOR_VERSION_PGI) | ||
482 | goto notsupported; | ||
483 | |||
484 | return true; | ||
485 | |||
486 | notsupported: | ||
487 | dev_dbg(&dev->pdev->dev, "pg: not supported: HGP = %d hbm version %d.%d ?= %d.%d\n", | ||
488 | !!(reg & ME_PGIC_HRA), | ||
489 | dev->version.major_version, | ||
490 | dev->version.minor_version, | ||
491 | HBM_MAJOR_VERSION_PGI, | ||
492 | HBM_MINOR_VERSION_PGI); | ||
493 | |||
494 | return false; | ||
495 | } | ||
496 | |||
497 | /** | ||
463 | * mei_me_irq_quick_handler - The ISR of the MEI device | 498 | * mei_me_irq_quick_handler - The ISR of the MEI device |
464 | * | 499 | * |
465 | * @irq: The irq number | 500 | * @irq: The irq number |
@@ -573,6 +608,8 @@ static const struct mei_hw_ops mei_me_hw_ops = { | |||
573 | .hw_config = mei_me_hw_config, | 608 | .hw_config = mei_me_hw_config, |
574 | .hw_start = mei_me_hw_start, | 609 | .hw_start = mei_me_hw_start, |
575 | 610 | ||
611 | .pg_is_enabled = mei_me_pg_is_enabled, | ||
612 | |||
576 | .intr_clear = mei_me_intr_clear, | 613 | .intr_clear = mei_me_intr_clear, |
577 | .intr_enable = mei_me_intr_enable, | 614 | .intr_enable = mei_me_intr_enable, |
578 | .intr_disable = mei_me_intr_disable, | 615 | .intr_disable = mei_me_intr_disable, |