Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5871973rwb; Mon, 14 Nov 2022 10:36:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf4pG48OJ6Z6hLgwnbbI/GKS0gqKL/mPPx+IXoIKfdar2TwNWFRW6qqfXQQlyX9/ZNeP/QDr X-Received: by 2002:a05:6402:1495:b0:461:b506:6b8a with SMTP id e21-20020a056402149500b00461b5066b8amr12139044edv.208.1668450982748; Mon, 14 Nov 2022 10:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668450982; cv=none; d=google.com; s=arc-20160816; b=GvNOziZf+mDBdI2K6hlybTd3T1kgl/xXhqtz2UP49csExy438kEBoVBVR7vYPQeDQE vwBwsJqI/ybLfOZvCVjo1KGyFfhr/yqQwnI4i7y/5/f/RESFbxlVN5JVjwct0Hd1f7R8 GG/REwY88uZRbuw8S7D/z1UGb1ZecbMNC5MPJUCfaXqg4g+bsHc32wwTo/qDc66vhESg NGrzWc6gSbsxoE1evDG/0JLIjhmGhpbR3dTzm9zOrHYsNxV9vS96jSASg3xBfnAbLnwe wwHB6/IGtjK6qLBnk4cqkxQKoldIOLbmPfSnT0mVujlp21nYEjDX6xI0eVMybkzrDorG ohEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zWAfxuTgMbwEfaDJsNm7ayi5jDU4RpoD+dgG+mwPJWQ=; b=oKYJa7MQphb/o9LyYP+5IRIa2t4SZLJ21CfsuTXGwjtapLm66JQjzpdN0uUpssM24H qc4O38Oz0lUOstY1U8o61DaOwQKP3N3B7FMCWmA+Fz9le2FAgfKWE0b4cQ/m/4JshncE LD2IXSqqNDz3i2ksHtEw/RuLZh8XyynX1kR/JGmxSOm/iEkwQCcAF/EnunldFNZcTPSw RUcOKtm/qsvgYljZTbrltZdZUysAapGB1fwI9yp36+DYnUlFN+TK9hSGWTnWZC4yluwK E1n2DtzPaqyYU9UJfXSj75ueTdUlYEPplKGI0JurzoJXDQ3JZJm/dPlwGGYI4TvMTfPs 3Aew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hb9Hg72k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa37-20020a17090786a500b00782ece08669si8431165ejc.13.2022.11.14.10.36.00; Mon, 14 Nov 2022 10:36:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hb9Hg72k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238368AbiKNSNf (ORCPT + 88 others); Mon, 14 Nov 2022 13:13:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238263AbiKNSNI (ORCPT ); Mon, 14 Nov 2022 13:13:08 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A880E27FCF; Mon, 14 Nov 2022 10:13:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668449586; x=1699985586; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=eKMJ7LyFPJ5X6+VzY2jfBd5iMgbFHvueZsgtG6paIVk=; b=hb9Hg72kI/uxJq4C9gwVjA1TNMJVa/3xqTI0U08mzcKRMt+Jf3sPmTNR y5rphe+GCabcfOOSF32gGX9mEcj6EopMNHzPVIhztgcNXgL+1l+Ki2Bv2 uUfow8wpZiJ883nat4AXEaIZOvF0LG699i+C/nxiEhsX4EginAkGuMQfq siZruOSnY8vRSIWPNgXnKxE4xeIWY6Z0p5Psl7LAcwCGSMfXbYu4FVbn7 lnBl+biscpaDYLbktKqA57Cb13mT+78XwByhzXHtsvnBGsivUOlvWnleR fCzJpUYhEdzssrGcLxsW56Sw1zYdnvXzIkrn0P8IbtYvAStnnRIIm7PxF w==; X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="292440597" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="292440597" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2022 10:13:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="727626771" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="727626771" Received: from linux.intel.com ([10.54.29.200]) by FMSMGA003.fm.intel.com with ESMTP; 14 Nov 2022 10:13:00 -0800 Received: from otcpl-manager.jf.intel.com (otcpl-manager.jf.intel.com [10.54.77.21]) by linux.intel.com (Postfix) with ESMTP id 0136358097C; Mon, 14 Nov 2022 10:13:00 -0800 (PST) From: Gayatri Kammela To: hdegoede@redhat.com Cc: irenic.rajneesh@gmail.com, markgross@kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, sukumar.ghorai@intel.com, xi.pardee@intel.com, rajvi.jingar@intel.com, David E Box Subject: [PATCH v3 5/8] platform/x86: intel/pmc: Relocate Ice Lake PCH support Date: Mon, 14 Nov 2022 10:12:04 -0800 Message-Id: <20221114181207.2062901-6-gayatri.kammela@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xi Pardee Create icl.c for Ice Lake PCH specific structures and init(). This file supports Ice Lake, Ice Lake NNPI and Jasper Lake platforms. There are no functional changes involved. Cc: David E Box Reviewed-by: "David E. Box" Signed-off-by: Xi Pardee Signed-off-by: "David E. Box" --- drivers/platform/x86/intel/pmc/Makefile | 2 +- drivers/platform/x86/intel/pmc/core.c | 45 -------------------- drivers/platform/x86/intel/pmc/core.h | 3 ++ drivers/platform/x86/intel/pmc/icl.c | 56 +++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 46 deletions(-) create mode 100644 drivers/platform/x86/intel/pmc/icl.c diff --git a/drivers/platform/x86/intel/pmc/Makefile b/drivers/platform/x86/intel/pmc/Makefile index 2b6d4a8dd2bb..6d153e368da1 100644 --- a/drivers/platform/x86/intel/pmc/Makefile +++ b/drivers/platform/x86/intel/pmc/Makefile @@ -3,7 +3,7 @@ # Intel x86 Platform-Specific Drivers # -intel_pmc_core-y := core.o spt.o cnp.o +intel_pmc_core-y := core.o spt.o cnp.o icl.o obj-$(CONFIG_INTEL_PMC_CORE) += intel_pmc_core.o intel_pmc_core_pltdrv-y := pltdrv.o obj-$(CONFIG_INTEL_PMC_CORE) += intel_pmc_core_pltdrv.o diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c index 1cce586035f9..d75e8cbaf40c 100644 --- a/drivers/platform/x86/intel/pmc/core.c +++ b/drivers/platform/x86/intel/pmc/core.c @@ -60,28 +60,6 @@ const struct pmc_bit_map msr_map[] = { {} }; -static const struct pmc_bit_map icl_pfear_map[] = { - {"RES_65", BIT(0)}, - {"RES_66", BIT(1)}, - {"RES_67", BIT(2)}, - {"TAM", BIT(3)}, - {"GBETSN", BIT(4)}, - {"TBTLSX", BIT(5)}, - {"RES_71", BIT(6)}, - {"RES_72", BIT(7)}, - {} -}; - -static const struct pmc_bit_map *ext_icl_pfear_map[] = { - /* - * Check intel_pmc_core_ids[] users of icl_reg_map for - * a list of core SoCs using this. - */ - cnp_pfear_map, - icl_pfear_map, - NULL -}; - static const struct pmc_bit_map tgl_pfear_map[] = { {"PSF9", BIT(0)}, {"RES_66", BIT(1)}, @@ -103,24 +81,6 @@ static const struct pmc_bit_map *ext_tgl_pfear_map[] = { NULL }; -static const struct pmc_reg_map icl_reg_map = { - .pfear_sts = ext_icl_pfear_map, - .slp_s0_offset = CNP_PMC_SLP_S0_RES_COUNTER_OFFSET, - .slp_s0_res_counter_step = ICL_PMC_SLP_S0_RES_COUNTER_STEP, - .slps0_dbg_maps = cnp_slps0_dbg_maps, - .ltr_show_sts = cnp_ltr_show_map, - .msr_sts = msr_map, - .slps0_dbg_offset = CNP_PMC_SLPS0_DBG_OFFSET, - .ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET, - .regmap_length = CNP_PMC_MMIO_REG_LEN, - .ppfear0_offset = CNP_PMC_HOST_PPFEAR0A, - .ppfear_buckets = ICL_PPFEAR_NUM_ENTRIES, - .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET, - .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT, - .ltr_ignore_max = ICL_NUM_IP_IGN_ALLOWED, - .etr3_offset = ETR3_OFFSET, -}; - static const struct pmc_bit_map tgl_clocksource_status_map[] = { {"USB2PLL_OFF_STS", BIT(18)}, {"PCIe/USB3.1_Gen2PLL_OFF_STS", BIT(19)}, @@ -1589,11 +1549,6 @@ static void pmc_core_dbgfs_register(struct pmc_dev *pmcdev) } } -void icl_core_init(struct pmc_dev *pmcdev) -{ - pmcdev->map = &icl_reg_map; -} - void tgl_core_configure(struct pmc_dev *pmcdev) { pmc_core_get_tgl_lpm_reqs(pmcdev->pdev); diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h index 2b7d681588cb..2ca564878341 100644 --- a/drivers/platform/x86/intel/pmc/core.h +++ b/drivers/platform/x86/intel/pmc/core.h @@ -351,6 +351,9 @@ extern const struct pmc_bit_map cnp_slps0_dbg2_map[]; extern const struct pmc_bit_map *cnp_slps0_dbg_maps[]; extern const struct pmc_bit_map cnp_ltr_show_map[]; extern const struct pmc_reg_map cnp_reg_map; +extern const struct pmc_bit_map icl_pfear_map[]; +extern const struct pmc_bit_map *ext_icl_pfear_map[]; +extern const struct pmc_reg_map icl_reg_map; void spt_core_init(struct pmc_dev *pmcdev); void cnp_core_init(struct pmc_dev *pmcdev); diff --git a/drivers/platform/x86/intel/pmc/icl.c b/drivers/platform/x86/intel/pmc/icl.c new file mode 100644 index 000000000000..2f11b1a6daeb --- /dev/null +++ b/drivers/platform/x86/intel/pmc/icl.c @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * This file contains platform specific structure definitions + * and init function used by Ice Lake PCH. + * + * Copyright (c) 2022, Intel Corporation. + * All Rights Reserved. + * + */ + +#include "core.h" + +const struct pmc_bit_map icl_pfear_map[] = { + {"RES_65", BIT(0)}, + {"RES_66", BIT(1)}, + {"RES_67", BIT(2)}, + {"TAM", BIT(3)}, + {"GBETSN", BIT(4)}, + {"TBTLSX", BIT(5)}, + {"RES_71", BIT(6)}, + {"RES_72", BIT(7)}, + {} +}; + +const struct pmc_bit_map *ext_icl_pfear_map[] = { + /* + * Check intel_pmc_core_ids[] users of icl_reg_map for + * a list of core SoCs using this. + */ + cnp_pfear_map, + icl_pfear_map, + NULL +}; + +const struct pmc_reg_map icl_reg_map = { + .pfear_sts = ext_icl_pfear_map, + .slp_s0_offset = CNP_PMC_SLP_S0_RES_COUNTER_OFFSET, + .slp_s0_res_counter_step = ICL_PMC_SLP_S0_RES_COUNTER_STEP, + .slps0_dbg_maps = cnp_slps0_dbg_maps, + .ltr_show_sts = cnp_ltr_show_map, + .msr_sts = msr_map, + .slps0_dbg_offset = CNP_PMC_SLPS0_DBG_OFFSET, + .ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET, + .regmap_length = CNP_PMC_MMIO_REG_LEN, + .ppfear0_offset = CNP_PMC_HOST_PPFEAR0A, + .ppfear_buckets = ICL_PPFEAR_NUM_ENTRIES, + .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET, + .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT, + .ltr_ignore_max = ICL_NUM_IP_IGN_ALLOWED, + .etr3_offset = ETR3_OFFSET, +}; + +void icl_core_init(struct pmc_dev *pmcdev) +{ + pmcdev->map = &icl_reg_map; +} -- 2.25.1