mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
To: platform-driver-x86@vger.kernel.org
Cc: dvhart@infradead.org, andriy.shevchenko@linux.intel.com,
	linux-kernel@vger.kernel.org,
	Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Subject: [PATCH v1 1/6] intel_pmc_core: Fix PWRMBASE mask and mmio reg len
Date: Fri,  7 Oct 2016 16:01:12 +0530	[thread overview]
Message-ID: <1475836277-4788-2-git-send-email-rajneesh.bhardwaj@intel.com> (raw)
In-Reply-To: <1475836277-4788-1-git-send-email-rajneesh.bhardwaj@intel.com>

On Sunrise Point PCH, the Power Management Controller provides 4K bytes of
memory space for various power management and debug registers. This fix is
needed to access power management & debug registers that are mapped at a
higher offset.

Also, this provides a fix for correctly masking the PWRMBASE as the initial
bits (0-11) are reserved.

Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
---
 drivers/platform/x86/intel_pmc_core.c | 1 +
 drivers/platform/x86/intel_pmc_core.h | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c
index 520b58a..fcb0643 100644
--- a/drivers/platform/x86/intel_pmc_core.c
+++ b/drivers/platform/x86/intel_pmc_core.c
@@ -149,6 +149,7 @@ static int pmc_core_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		dev_dbg(&dev->dev, "PMC Core: failed to read PCI config space.\n");
 		return err;
 	}
+	pmcdev->base_addr &= PMC_BASE_ADDR_MASK;
 	dev_dbg(&dev->dev, "PMC Core: PWRMBASE is %#x\n", pmcdev->base_addr);
 
 	pmcdev->regbase = devm_ioremap_nocache(ptr_dev,
diff --git a/drivers/platform/x86/intel_pmc_core.h b/drivers/platform/x86/intel_pmc_core.h
index e3f671f..cde31ec 100644
--- a/drivers/platform/x86/intel_pmc_core.h
+++ b/drivers/platform/x86/intel_pmc_core.h
@@ -26,8 +26,9 @@
 
 #define SPT_PMC_BASE_ADDR_OFFSET		0x48
 #define SPT_PMC_SLP_S0_RES_COUNTER_OFFSET	0x13c
-#define SPT_PMC_MMIO_REG_LEN			0x100
+#define SPT_PMC_MMIO_REG_LEN			0x1000
 #define SPT_PMC_SLP_S0_RES_COUNTER_STEP		0x64
+#define PMC_BASE_ADDR_MASK			~(SPT_PMC_MMIO_REG_LEN - 1)
 
 /**
  * struct pmc_dev - pmc device structure
-- 
1.9.1

  reply	other threads:[~2016-10-07 10:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-07 10:31 [PATCH v1 0/6] PMC Core driver new features Rajneesh Bhardwaj
2016-10-07 10:31 ` Rajneesh Bhardwaj [this message]
2016-10-07 10:31 ` [PATCH v1 2/6] intel_pmc_core: Add PCH IP Power Gating Status Rajneesh Bhardwaj
2016-10-07 10:31 ` [PATCH v1 3/6] intel_pmc_core: ModPhy core lanes pg status Rajneesh Bhardwaj
2016-10-07 10:31 ` [PATCH v1 4/6] intel_pmc_core: Add MPHY PLL clock gating status Rajneesh Bhardwaj
2016-10-07 10:31 ` [PATCH v1 5/6] intel_pmc_core: Add LTR IGNORE debug feature Rajneesh Bhardwaj
2016-10-23 15:15   ` Darren Hart
2016-10-07 10:31 ` [PATCH v1 6/6] intel_pmc_core: Add KBL CPUID support Rajneesh Bhardwaj
2016-10-23 15:20 ` [PATCH v1 0/6] PMC Core driver new features Darren Hart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1475836277-4788-2-git-send-email-rajneesh.bhardwaj@intel.com \
    --to=rajneesh.bhardwaj@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®