Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp406358rwd; Wed, 7 Jun 2023 01:21:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7oaWzXwPhWp6TaN88bfT8/CzGwJUmLV9nQk/VJWr6AO/EzqVJ6xA3pOxz2yb3vkZh1LMmg X-Received: by 2002:a05:6830:2083:b0:6a7:c078:333c with SMTP id y3-20020a056830208300b006a7c078333cmr4514302otq.8.1686126080696; Wed, 07 Jun 2023 01:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686126080; cv=none; d=google.com; s=arc-20160816; b=aThy1OQNqllcNauW+6g1GJDYGGU2cZ5v6tn8x7WrfMeEEinKFdlwKexQo7bUXuD1oj 9SQE56zDVOf+Ei7KxbvxGhTbTa2BD6U+KHTjrUaRwMOS3QGxCjjzxxVeD5Giz0k4w90z 7rIeoHqcEwana5qQjaIBxjpzkEBCJumALGgW+bVp2WkWjmd+GX0poLJDV+hNQhWDjgW+ AOIr7vH4+gBqpUgwxfSFsi1odnUp2BjfFqtBVz+phPvVuucS8EYP3g7WNHM5f5rB0oRx iSl50TvUM/MHBVKXo3ysDcPII8/a1PAcTJa7Ednq4t/cr5FCXXNXkac5c8UlGgRxNmGD TxnQ== 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=A00q30xZ6HxHF1sxUDPOi9+MwcNiyab3Fnizzyh8reE=; b=1EMOQ1+LpnDotvu0kVDg21rt1dA0om6ZoEOuEjyg7TFnCie4RroKgAd71L6zy8rxI0 HahFe/BIlQk37sGdc//d11VH07FjZSBlAaaOtu7U/2TTqSH9Z/u+1nXjwqGJ5nOWKbYf SFEsO+9F9WvWwLf5Rv9Rj9UYj2VwGioBgrEfT8X/vawLd45Ta1JjnfApyQRPmgcxjeV3 7aCsUJJQwj0Q8qHe4pm6z5eMI6FZXHX1txtVeNMA6jLEHwqrn+AUwUerNV1TKWn7n7ve lrCZnhIj2/zpmoNa7VBRDkJyAFuNKjUeb9GcL8xLqlIsiR4vqK5CVZkM6In9bGne0rLe noAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=W18vT77M; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a056a00000300b0065d87744215si3784514pfk.198.2023.06.07.01.21.06; Wed, 07 Jun 2023 01:21:20 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=W18vT77M; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234828AbjFGIET (ORCPT + 99 others); Wed, 7 Jun 2023 04:04:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238796AbjFGIEQ (ORCPT ); Wed, 7 Jun 2023 04:04:16 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B63B10FB for ; Wed, 7 Jun 2023 01:04:15 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 35783x0N078793; Wed, 7 Jun 2023 03:03:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1686125039; bh=A00q30xZ6HxHF1sxUDPOi9+MwcNiyab3Fnizzyh8reE=; h=From:To:CC:Subject:Date; b=W18vT77MvoGdDbLeL/y1t9YxhYNDr6FpiX31QbbN3VBr7HJP8ZhZFlC1mYy31eFT0 zx8rwmF4LmHSfBDuNX0bJYK+kny3RiJ0yDmJj675dqwnciDKIS6jRwCy5PLgR4NVcJ KkHylAnnDPdA1o5o8pQSwQNyd8OffHJIU7oNfCtU= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 35783xpv025013 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 7 Jun 2023 03:03:59 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 7 Jun 2023 03:03:59 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE107.ent.ti.com (157.170.170.37) 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, 7 Jun 2023 03:03:59 -0500 Received: from ul0491018.dal.design.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 35783t49002214; Wed, 7 Jun 2023 03:03:56 -0500 From: Thejasvi Konduru To: , CC: Nishanth Menon , Santosh Shilimkar , "Tero Kristo" , Grygorii Strashko , Lokesh Vutla , Apurva Nandan , "Udit Kumar" , Thejasvi Konduru Subject: [PATCH] soc: ti: k3-socinfo: Fix the silicon revision misprint Date: Wed, 7 Jun 2023 13:33:49 +0530 Message-ID: <20230607080349.26671-1-t-konduru@ti.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 For J721E PG1.1 the silicon revision is reported as 2.0 instead of 1.1. This is because the k3-socinfo.c code assumes the silicon revisions are 1.0, 2.0 for every platform. Fixed this by creating a separate list of silicon revisions for J721E. Fixes: 907a2b7e2fc7 ("soc: ti: add k3 platforms chipid module driver") Signed-off-by: Thejasvi Konduru --- drivers/soc/ti/k3-socinfo.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index d15764e19d96..365bc37793a1 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -46,6 +46,8 @@ static const struct k3_soc_id { { 0xBB8D, "AM62AX" }, }; +static char *soc_revision_j721e[] = {"1.0", "1.1"}; + static int k3_chipinfo_partno_to_names(unsigned int partno, struct soc_device_attribute *soc_dev_attr) @@ -61,6 +63,21 @@ k3_chipinfo_partno_to_names(unsigned int partno, return -EINVAL; } +void +k3_chipinfo_silicon_rev(unsigned int variant, + struct soc_device_attribute *soc_dev_attr) +{ + const char *family_name = soc_dev_attr->family; + int j721e_lookup_arr_size = ARRAY_SIZE(soc_revision_j721e); + + if (!strcmp(family_name, "J721E") && variant < j721e_lookup_arr_size) { + soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%s", soc_revision_j721e[variant]); + } else { + variant++; + soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%x.0", variant); + } +} + static int k3_chipinfo_probe(struct platform_device *pdev) { struct device_node *node = pdev->dev.of_node; @@ -92,7 +109,6 @@ static int k3_chipinfo_probe(struct platform_device *pdev) variant = (jtag_id & CTRLMMR_WKUP_JTAGID_VARIANT_MASK) >> CTRLMMR_WKUP_JTAGID_VARIANT_SHIFT; - variant++; partno_id = (jtag_id & CTRLMMR_WKUP_JTAGID_PARTNO_MASK) >> CTRLMMR_WKUP_JTAGID_PARTNO_SHIFT; @@ -101,17 +117,18 @@ static int k3_chipinfo_probe(struct platform_device *pdev) if (!soc_dev_attr) return -ENOMEM; - soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%x.0", variant); - if (!soc_dev_attr->revision) { - ret = -ENOMEM; - goto err; - } - ret = k3_chipinfo_partno_to_names(partno_id, soc_dev_attr); if (ret) { dev_err(dev, "Unknown SoC JTAGID[0x%08X]\n", jtag_id); ret = -ENODEV; - goto err_free_rev; + goto err; + } + + k3_chipinfo_silicon_rev(variant, soc_dev_attr); + + if (!soc_dev_attr->revision) { + ret = -ENOMEM; + goto err; } node = of_find_node_by_path("/"); -- 2.40.1