Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp591222lqp; Wed, 12 Jun 2024 10:08:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJJ411VZFtiMXwFHDndA1Iql0x8idBPELZjiVxEw4YujHTCvz+4sNGr5mAWeYUKeLBGgan8e1J3O8kKCEXpUQdufoKDImfXlkVxClbeA== X-Google-Smtp-Source: AGHT+IGIJN+Zc0yID0PEzRs91xe5IL0485mWuKFlE7OCmN+5h5nCiJIFTJb+qpTg7gVXBqJg6e1p X-Received: by 2002:a05:6358:7215:b0:17f:6b3f:1b0a with SMTP id e5c5f4694b2df-19f69d52f58mr261337055d.15.1718212119200; Wed, 12 Jun 2024 10:08:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718212119; cv=pass; d=google.com; s=arc-20160816; b=F3of5sfawikgzAFkvKmP6dwn5BU6BbPkZiq3H1yZAUIGsBqnWX3qNo2/bJBZyyOgCQ AgNqWYLlLSJA0Q0cnSgYwp+HJrJssFEdo/48YRgxOh2vAU4VNNM3qqGNOznsa2kKr6hV hcuPt/JfbbxUJsyPkB94QDgvI8A5pxh0Psl7mWDFFCeqxeIMdm8Vs3d8QxnIqY5I8QgB bwFeeKSg0lxGlsvwweORuceA2U96C8fd9R/UTP8lloqkIYkKbyOA86P/EkVJ4Td2w/CE 7BYqha7ksg91kitkpRUIY3XJBG9oRDzuWxmr73AuvmwAvNLXJ3hEUB52m/3NbLpfn8U1 nnvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=wHMo0gFYCsj9ZWMq+/FqNrzcoxxWNik6KZfcZeOTevA=; fh=Ji7T+NxypmZgI9ZoZI90kqHC4cHKE4Lp3+jF+LD0vBI=; b=q8Y8w+MSOgBBRyhLfXxtDh7s51IndqrMrWuFNhip/Q4C6U8YQBJEbypHw3dg3vOYgs 9MpukNquqlymcNIIvo8WQpbZ2fqfJAGkJYJbOBhdTqO7Ltokb/3IyJsKYGKMkXZWyyaI a1gNo0/KsSlQjpnuore/XF2wK4o1AYu/ndBNtsOJu68HVvoixHH0D7b0+InFBweoMpeN 672OJvAt64/FNv4vQParTdb4U+lze037sm4vpxeQ4Fp20XBumXjSAdulR1ynRoHkb0+a Y+TB45I10sCzQGNv2IgYrFRtLK6qVthAuvjjbpjr/VbWcXBoNdwbyWVjCy8LpwMmOdnj cMHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JhUTANYH; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-211931-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6f113257cf8si5907191a12.487.2024.06.12.10.08.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 10:08:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211931-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JhUTANYH; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-211931-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E44C5B24020 for ; Wed, 12 Jun 2024 16:43:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFE5C1822E8; Wed, 12 Jun 2024 16:42:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="JhUTANYH" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 328BE181BA8; Wed, 12 Jun 2024 16:42:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718210545; cv=none; b=bY5WgGoTm4QyXkbY8BvZ0dQAh+68jE/XUAPY0Nq2W6Bqw8sGTKgP23I6avI47s4Y1WQ/SyLzNut9+JVoKiPE8Cmfd+XQPPVsBSgTBzRqoSdKH5fLMluifm7dolxxNavGObFAhVz3DrkHdqskzP2bGixwKvMnUt7kQmIBkrmE+8c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718210545; c=relaxed/simple; bh=247OK9zNWZq/7rcJM9RO5Cm+DJpgqUplY1Dpd5HKDN0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=AQRNnaDbMwhVPCCoya5fpp9PX94uhEj+eNH9gUsCWMM2bl2lTZNSSEGj3D+Nm8ODaJhx5D3/XgFrJtLWE0GYOOoqh/VbtMUmAz9RI/zUHd/UylBVD3bHYWESZiDtLqrC4i5ya75pE1drBfQxT6SYRxNg02m2DdWw46jhqtMp5gQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=JhUTANYH; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45CGgBZE039626; Wed, 12 Jun 2024 11:42:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718210531; bh=wHMo0gFYCsj9ZWMq+/FqNrzcoxxWNik6KZfcZeOTevA=; h=From:Date:Subject:References:In-Reply-To:To:CC; b=JhUTANYHf4vi2VMu3OsgtRhTOKvQ8Kx1aaGpr8rip9Afua45E8es6763Bic9yiuDV 9uPsPmu9HfZyohRu+mfeOrP1upoiEdX7xNBfkUnDUYmnAhpCo9sdS8ppTRtXuWXxq8 OE5xEIm7FVzjwm6fKpbwMm+aa5++xfpDuhvKYsIM= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45CGgBQT002742 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Jun 2024 11:42:11 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 12 Jun 2024 11:42:10 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 12 Jun 2024 11:42:10 -0500 Received: from localhost (bb.dhcp.ti.com [128.247.81.12]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45CGgAAY107226; Wed, 12 Jun 2024 11:42:10 -0500 From: Bryan Brattlof Date: Wed, 12 Jun 2024 11:41:50 -0500 Subject: [PATCH 1/5] cpufreq: ti: update OPP table for AM62Ax SoCs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20240612-ti-opp-updates-v1-1-3551c31d9872@ti.com> References: <20240612-ti-opp-updates-v1-0-3551c31d9872@ti.com> In-Reply-To: <20240612-ti-opp-updates-v1-0-3551c31d9872@ti.com> To: "Rafael J. Wysocki" , Viresh Kumar , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nishanth Menon , Vignesh Raghavendra , Tero Kristo CC: Vibhore Vardhan , , , , , Bryan Brattlof X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3295; i=bb@ti.com; h=from:subject:message-id; bh=247OK9zNWZq/7rcJM9RO5Cm+DJpgqUplY1Dpd5HKDN0=; b=owNCWmg5MUFZJlNZKFoA/wAAZ3/////9nu9/DzXf893/8yb/Xjn3/51W78/1R/rf39rf71+wA RsYIekAA00AaAA0NNAAAAGhoDEDQADQANPUA0GgAAaDTQDQ00aaeptQ8kae0og0aAPRAAGgAAAN NNNAAABo9RoMQ0HpAekNNAyA9T1HqAPUaAyG1AeoBkaBoCDR6TTTQyGjQ0NNA0xGQ0MQ0aGgAaN GEMmTRiAANA0NDTRpoAAAaBk0ZDTRoNAAAMgxsHbGwBAbDPSAnOkhccFTVycU7/T4HloMS6A8np dcEmmn3uKmrXFsCLXf72O5M1YR4LbiwOxnxqF6BkZa4XZT7oDqyF+luDEsKwBUdjRG5bYozv73F 1iUdMMV4z6LR5phEGCAXwEYqpfDcVKeD4bvgfJy6Ke5MPv7QOzqLkgmcZdymOP31vb0SohpJSHN diMJglf5bi6xo2nGIHUky5VkSpwiFnr6CnzYOqMGp+i2mtYKFGK//JPqcX6IkdpkmCAU8Cr3LRD ln0hQRaXOKnZQXM15IUMZSiUS1KmI8yDtN4pz/OsU/B5kDFdaVSqWT6RAMgDlW7wcVQ88ejdoBY qjFYH2aTi5gRF/tnVaJGFjBw9rmikoTSIH8MB3KHUwQ4MRmXd+UtGUt65wHAD9Klng2oaAvo25G F5oQhYAlOT/i7kinChIFC0Af4A= X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 As the AM62Ax SoC family matures more speed grades are being defined. These new grades unfortunately no longer align with the AM62x SoC family. Define a new table with new OPP speed grade limits for the AM62Ax Signed-off-by: Bryan Brattlof --- drivers/cpufreq/ti-cpufreq.c | 59 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c index 714ed53753fa5..a80698f3cfe65 100644 --- a/drivers/cpufreq/ti-cpufreq.c +++ b/drivers/cpufreq/ti-cpufreq.c @@ -47,6 +47,28 @@ #define AM625_SUPPORT_S_MPU_OPP BIT(1) #define AM625_SUPPORT_T_MPU_OPP BIT(2) +enum { + AM62A7_EFUSE_M_MPU_OPP = 13, + AM62A7_EFUSE_N_MPU_OPP, + AM62A7_EFUSE_O_MPU_OPP, + AM62A7_EFUSE_P_MPU_OPP, + AM62A7_EFUSE_Q_MPU_OPP, + AM62A7_EFUSE_R_MPU_OPP, + AM62A7_EFUSE_S_MPU_OPP, + /* + * The V, U, and T speed grade numbering is out of order + * to align with the AM625 more uniformly. I promise I know + * my ABCs ;) + */ + AM62A7_EFUSE_V_MPU_OPP, + AM62A7_EFUSE_U_MPU_OPP, + AM62A7_EFUSE_T_MPU_OPP, +}; + +#define AM62A7_SUPPORT_N_MPU_OPP BIT(0) +#define AM62A7_SUPPORT_R_MPU_OPP BIT(1) +#define AM62A7_SUPPORT_V_MPU_OPP BIT(2) + #define VERSION_COUNT 2 struct ti_cpufreq_data; @@ -112,6 +134,32 @@ static unsigned long omap3_efuse_xlate(struct ti_cpufreq_data *opp_data, return BIT(efuse); } +static unsigned long am62a7_efuse_xlate(struct ti_cpufreq_data *opp_data, + unsigned long efuse) +{ + unsigned long calc_efuse = AM62A7_SUPPORT_N_MPU_OPP; + + switch (efuse) { + case AM62A7_EFUSE_V_MPU_OPP: + case AM62A7_EFUSE_U_MPU_OPP: + case AM62A7_EFUSE_T_MPU_OPP: + case AM62A7_EFUSE_S_MPU_OPP: + calc_efuse |= AM62A7_SUPPORT_V_MPU_OPP; + fallthrough; + case AM62A7_EFUSE_R_MPU_OPP: + case AM62A7_EFUSE_Q_MPU_OPP: + case AM62A7_EFUSE_P_MPU_OPP: + case AM62A7_EFUSE_O_MPU_OPP: + calc_efuse |= AM62A7_SUPPORT_R_MPU_OPP; + fallthrough; + case AM62A7_EFUSE_N_MPU_OPP: + case AM62A7_EFUSE_M_MPU_OPP: + calc_efuse |= AM62A7_SUPPORT_N_MPU_OPP; + } + + return calc_efuse; +} + static unsigned long am625_efuse_xlate(struct ti_cpufreq_data *opp_data, unsigned long efuse) { @@ -234,6 +282,15 @@ static struct ti_cpufreq_soc_data am625_soc_data = { .multi_regulator = false, }; +static struct ti_cpufreq_soc_data am62a7_soc_data = { + .efuse_xlate = am62a7_efuse_xlate, + .efuse_offset = 0x0, + .efuse_mask = 0x07c0, + .efuse_shift = 0x6, + .rev_offset = 0x0014, + .multi_regulator = false, +}; + /** * ti_cpufreq_get_efuse() - Parse and return efuse value present on SoC * @opp_data: pointer to ti_cpufreq_data context @@ -337,7 +394,7 @@ static const struct of_device_id ti_cpufreq_of_match[] = { { .compatible = "ti,omap34xx", .data = &omap34xx_soc_data, }, { .compatible = "ti,omap36xx", .data = &omap36xx_soc_data, }, { .compatible = "ti,am625", .data = &am625_soc_data, }, - { .compatible = "ti,am62a7", .data = &am625_soc_data, }, + { .compatible = "ti,am62a7", .data = &am62a7_soc_data, }, { .compatible = "ti,am62p5", .data = &am625_soc_data, }, /* legacy */ { .compatible = "ti,omap3430", .data = &omap34xx_soc_data, }, -- 2.45.2