Received: by 10.223.176.46 with SMTP id f43csp752042wra; Fri, 19 Jan 2018 01:08:55 -0800 (PST) X-Google-Smtp-Source: ACJfBovmq8HEIDxAUygOq2PdSHjL+sOJQ1LDIfKDvZBY32gXqcnqS5pHLjB3q8V8sIgrarkdkt71 X-Received: by 10.101.100.144 with SMTP id e16mr38899580pgv.26.1516352935213; Fri, 19 Jan 2018 01:08:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516352935; cv=none; d=google.com; s=arc-20160816; b=xjExqLLtpuaB2RyWRjZ9rJLEZIMkQ0y82LDIb+ze2PhIf4uzEiFj6OR63D29w4aBuB QicuXN38HskIOKaTm/2otMfFvtk7oLyVCfQLO1HmqkFw5vqVPdlWUHn2uRB4TKq0cgBc OYo4fmDMU+KlWQzKtN+jERLVRjSk0VbM3gpFjst03YLDvLrEO+2fUvyS7kJAsfEPsfUL GM/0cxNg2Bf0SDqFKqssnYryET7XjXPCwyJqmLwMZ9aNaotaV7rTbwljMslaH7ZbV8o8 rhHV0DX1RXExB0JZPFPt9ZjTCSk0ePtR8UWgl29wDeI0gE/ojFvkWTaPWuZ0SshfERZe AyEw== 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=iSRBhzJziXiRP94bCHsqKZxShDzcQl9X5xc5LdCyUHI=; b=GxsrCfSq8fVzwSylkepUMuvo5BbD6iBBP5Vdad4WwVECx6b86zkdPd21VF8RSYE2AH I2TKWqc9VhfA70uY+2HMCEpdqJHPwxnVwYm99ov00BSyZp1ti81sZlbzcB3i1eOmVh9H AhGbCTs3ntygtZEcyVDyLFpWtlqhBFstgsHpJhPGbdNXT9RGmN2Wq1yKX1dWl8SCiq+4 px5Duo8eTMHP/VlJvtxlxmu+6Kz14kJtA+DSbJxJqoX92ncr6UwiSrxpcAD8peP1r2PB GBAN3p9vEeEFqSQfZKpOVtgDOHAxWhRD8M8NG9AziRjG0H1AJuQlxYAO+qst+9It8lf+ elMg== 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 x141si8062160pgx.601.2018.01.19.01.08.41; Fri, 19 Jan 2018 01:08:55 -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 S1755339AbeASJGt (ORCPT + 99 others); Fri, 19 Jan 2018 04:06:49 -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 S1755188AbeASJET (ORCPT ); Fri, 19 Jan 2018 04:04:19 -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:04:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,381,1511856000"; d="scan'208";a="197007776" Received: from raj-desk2.iind.intel.com ([10.223.107.30]) by fmsmga006.fm.intel.com with ESMTP; 19 Jan 2018 01:04:05 -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 7/8] platform/x86: intel_pmc_core: Add CannonLake PCH support Date: Fri, 19 Jan 2018 14:28:26 +0530 Message-Id: <1516352307-20123-8-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 This adds support for Cannonlake PCH which is used by Cannonlake and Coffeelake SoCs. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rajneesh Bhardwaj --- drivers/platform/x86/intel_pmc_core.c | 85 +++++++++++++++++++++++++++++++++++ drivers/platform/x86/intel_pmc_core.h | 11 +++++ 2 files changed, 96 insertions(+) diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index da9326740647..f0d067a33a56 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -123,6 +123,90 @@ static const struct pmc_reg_map spt_reg_map = { .pm_read_disable_bit = SPT_PMC_READ_DISABLE_BIT, }; +/* Cannonlake: PGD PFET Enable Ack Status Register(s) bitmap */ +static const struct pmc_bit_map cnp_pfear_map[] = { + {"PMC", BIT(0)}, + {"OPI-DMI", BIT(1)}, + {"SPI/eSPI", BIT(2)}, + {"XHCI", BIT(3)}, + {"SPA", BIT(4)}, + {"SPB", BIT(5)}, + {"SPC", BIT(6)}, + {"GBE", BIT(7)}, + + {"SATA", BIT(0)}, + {"HDA_PGD0", BIT(1)}, + {"HDA_PGD1", BIT(2)}, + {"HDA_PGD2", BIT(3)}, + {"HDA_PGD3", BIT(4)}, + {"SPD", BIT(5)}, + {"LPSS", BIT(6)}, + {"LPC", BIT(7)}, + + {"SMB", BIT(0)}, + {"ISH", BIT(1)}, + {"P2SB", BIT(2)}, + {"NPK_VNN", BIT(3)}, + {"SDX", BIT(4)}, + {"SPE", BIT(5)}, + {"Fuse", BIT(6)}, + {"Res_23", BIT(7)}, + + {"CSME_FSC", BIT(0)}, + {"USB3_OTG", BIT(1)}, + {"EXI", BIT(2)}, + {"CSE", BIT(3)}, + {"csme_kvm", BIT(4)}, + {"csme_pmt", BIT(5)}, + {"csme_clink", BIT(6)}, + {"csme_ptio", BIT(7)}, + + {"csme_usbr", BIT(0)}, + {"csme_susram", BIT(1)}, + {"csme_smt1", BIT(2)}, + {"CSME_SMT4", BIT(3)}, + {"csme_sms2", BIT(4)}, + {"csme_sms1", BIT(5)}, + {"csme_rtc", BIT(6)}, + {"csme_psf", BIT(7)}, + + {"SBR0", BIT(0)}, + {"SBR1", BIT(1)}, + {"SBR2", BIT(2)}, + {"SBR3", BIT(3)}, + {"SBR4", BIT(4)}, + {"SBR5", BIT(5)}, + {"CSME_PECI", BIT(6)}, + {"PSF1", BIT(7)}, + + {"PSF2", BIT(0)}, + {"PSF3", BIT(1)}, + {"PSF4", BIT(2)}, + {"CNVI", BIT(3)}, + {"UFS0", BIT(4)}, + {"EMMC", BIT(5)}, + {"Res_6", BIT(6)}, + {"SBR6", BIT(7)}, + + {"SBR7", BIT(0)}, + {"NPK_AON", BIT(1)}, + {"HDA_PGD4", BIT(2)}, + {"HDA_PGD5", BIT(3)}, + {"HDA_PGD6", BIT(4)}, + {} +}; + +static const struct pmc_reg_map cnp_reg_map = { + .pfear_sts = cnp_pfear_map, + .slp_s0_offset = CNP_PMC_SLP_S0_RES_COUNTER_OFFSET, + .ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET, + .regmap_length = CNP_PMC_MMIO_REG_LEN, + .ppfear0_offset = CNP_PMC_HOST_PPFEAR0A, + .ppfear_buckets = CNP_PPFEAR_NUM_ENTRIES, + .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET, + .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT, +}; + static inline u8 pmc_core_reg_read_byte(struct pmc_dev *pmcdev, int offset) { return readb(pmcdev->regbase + offset); @@ -446,6 +530,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = { ICPU(INTEL_FAM6_SKYLAKE_DESKTOP, &spt_reg_map), ICPU(INTEL_FAM6_KABYLAKE_MOBILE, &spt_reg_map), ICPU(INTEL_FAM6_KABYLAKE_DESKTOP, &spt_reg_map), + ICPU(INTEL_FAM6_CANNONLAKE_MOBILE, &cnp_reg_map), {} }; diff --git a/drivers/platform/x86/intel_pmc_core.h b/drivers/platform/x86/intel_pmc_core.h index 9df4a60a179f..8b7731e6dea2 100644 --- a/drivers/platform/x86/intel_pmc_core.h +++ b/drivers/platform/x86/intel_pmc_core.h @@ -121,6 +121,17 @@ enum ppfear_regs { #define SPT_PMC_BIT_MPHY_CMN_LANE2 BIT(2) #define SPT_PMC_BIT_MPHY_CMN_LANE3 BIT(3) +/* Cannonlake Power Management Controller register offsets */ +#define CNP_PMC_SLP_S0_RES_COUNTER_OFFSET 0x193C +#define CNP_PMC_LTR_IGNORE_OFFSET 0x1B0C +#define CNP_PMC_PM_CFG_OFFSET 0x1818 +/* Cannonlake: PGD PFET Enable Ack Status Register(s) start */ +#define CNP_PMC_HOST_PPFEAR0A 0x1D90 + +#define CNP_PMC_MMIO_REG_LEN 0x2000 +#define CNP_PPFEAR_NUM_ENTRIES 8 +#define CNP_PMC_READ_DISABLE_BIT 22 + struct pmc_bit_map { const char *name; u32 bit_mask; -- 2.7.4