Received: by 10.223.176.46 with SMTP id f43csp749355wra; Fri, 19 Jan 2018 01:06:00 -0800 (PST) X-Google-Smtp-Source: ACJfBovgOHaoAu8twcrEEHRMz03lHj5p2rOhUov23leylSP4A0DI3v0DbHs2qMfD5Tkf/X2Zk55Q X-Received: by 10.98.212.26 with SMTP id a26mr31238338pfh.38.1516352760669; Fri, 19 Jan 2018 01:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516352760; cv=none; d=google.com; s=arc-20160816; b=RFe4wsFnqJvh8xCpGdWbLtbCbBhKrYELsqQaIUuJ/4tzm8LzN4qBgkj5ZlT0PsLF2A DeakQK8zqeR7UsUGFj/SOMNl/6z0xaFggROQU5SMYyhvZgRUjnFWfp5836N2O0NTopbz brMQlFVDrPNBAzSJpwXPgFkbhTUhl0A8yaYdEyYolmMS8qj9xp5BTwfoDV4taHywDwwa pyI00COFRm+tU1na20MRVXwimmAMlZEBqxUHBxs9+mBsonQlN4xdALJQ0WrBIRPqUAwZ 79Gt7XoxAuUi1Bi3Q6kYwpX2o/ZpHoDsUi6ZRDyEOC8CN2PT/8eK4zGvBTK+yoBddgAx JJYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=+E1ru9LEw4BHT26dyvZ4tn806vFMTSbggVDzh0dgdV0=; b=fj+F1saRTa4gRtzAMKFZWQfr2M4p7dG3Mvs1O40t3Jj2pncj3m0vJdQ2N4wOpvsjfv ZA8NVOfypgL3EVg/bhC3cARZ8xdI3FgvrMad+tvKYgVSeqqOfej5C8+oKMnJeVYDAByC OTo1yKhJl95PO3sNxL1dHVKLmAS+e6GlaSsWpbjz6uIr6CI/Y/qhMYk/+jx3DF6+BmOU +LFZTT/Ce738yVdhZeuX16DYHw6XVwGpNwJY7wIzug92u+KhF4PMAYePAe3k0XhSRIa9 BH+TzrnmDrTuVBRQX3OceBAVe7xOeq5DuTcHyHcIRz83P+k0eiu0PAudiA/nYOyOt4vk zNhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si7856822pgn.171.2018.01.19.01.05.47; Fri, 19 Jan 2018 01:06:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755268AbeASJEx (ORCPT + 99 others); Fri, 19 Jan 2018 04:04:53 -0500 Received: from mga06.intel.com ([134.134.136.31]:52689 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755529AbeASJEG (ORCPT ); Fri, 19 Jan 2018 04:04:06 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jan 2018 01:03:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,381,1511856000"; d="scan'208";a="197007743" Received: from raj-desk2.iind.intel.com ([10.223.107.30]) by fmsmga006.fm.intel.com with ESMTP; 19 Jan 2018 01:03:57 -0800 From: Rajneesh Bhardwaj To: platform-driver-x86@vger.kernel.org Cc: dvhart@infradead.org, andy@infradead.org, linux-kernel@vger.kernel.org, vishwanath.somayaji@intel.com, srinivas.pandruvada@linux.intel.com, Rajneesh Bhardwaj Subject: [Patch v1 4/8] platform/x86: intel_pmc_core: Read base address from LPIT Date: Fri, 19 Jan 2018 14:28:23 +0530 Message-Id: <1516352307-20123-5-git-send-email-rajneesh.bhardwaj@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516352307-20123-1-git-send-email-rajneesh.bhardwaj@intel.com> References: <1516352307-20123-1-git-send-email-rajneesh.bhardwaj@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Pandruvada Read SLP_S0 address from ACPI LPIT table when present and use PMC specific SLP_S0 offset to get the base address of PMC MMIO. Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Srinivas Pandruvada --- drivers/platform/x86/intel_pmc_core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index f7616600e8ab..549ee5852d4f 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -20,6 +20,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -455,6 +456,7 @@ static int __init pmc_core_probe(void) { const struct x86_cpu_id *cpu_id; struct pmc_dev *pmcdev = &pmc; + u64 slp_s0_addr; int err; cpu_id = x86_match_cpu(intel_pmc_core_ids); @@ -462,7 +464,12 @@ static int __init pmc_core_probe(void) return -ENODEV; pmcdev->map = (struct pmc_reg_map *)cpu_id->driver_data; - pmcdev->base_addr = PMC_BASE_ADDR_DEFAULT; + + if (lpit_read_residency_count_address(&slp_s0_addr)) + pmcdev->base_addr = PMC_BASE_ADDR_DEFAULT; + else + pmcdev->base_addr = slp_s0_addr - pmcdev->map->slp_s0_offset; + pmcdev->regbase = ioremap(pmcdev->base_addr, pmcdev->map->regmap_length); if (!pmcdev->regbase) -- 2.7.4