From patchwork Mon Oct 16 10:16:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neha Malcom Francis X-Patchwork-Id: 153299 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3357324vqb; Mon, 16 Oct 2023 03:17:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQPONN9xOStX7Nxf++bDfruz4J/7frfDmYGMweliHx8BsZvlufkjpcaT8X4SmIZu+qJIqs X-Received: by 2002:a05:6830:6685:b0:6b1:9646:2ea0 with SMTP id cq5-20020a056830668500b006b196462ea0mr44954067otb.1.1697451447765; Mon, 16 Oct 2023 03:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697451447; cv=none; d=google.com; s=arc-20160816; b=siKbTvv2FJ2oUji3PnGqt1ctYx3gQfYTl/vE417Kdcd0Po/GJJGfaPHqhBohHApTUR PQSbqf2AXw0LsRsPwA92/V+zbmrvEbI+g6uY3FaUweR//f7cUg922LrJ1u7gRbeN+DCj 4AmwbPJr8cqsCj1lD5e/kE2XCQ3Cwk5fco8XoVvqE8No7FqQwF1kahFGQ2vUPDE/SvYD Iv9bwwaOZDDwDz0uCYeGC+x24NpHQhSzXzCdLZushM+OyX/sFdDVGNGyXMkALnmFZ5Bn LRe4ZqN/gXlBuSusoFMCqEzD7ds5rWUs4/zPdkJOjgQ0flL+SpSXuigKOhFrAXT8b5IP KEAQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UZYjBdWAg9JVKmqxPo56hC7NpJy6uWjMu8LlhaZH4UA=; fh=zXIzpqU6fkcvkKYOWPETYAc8kHdGN5li0oSb9j2GXFE=; b=XhjjwtJB1t9Kdirc4x11FF5yIITKPKeRG/vS6X9qm6gJd2E7E4rebvUiqN/4GCQVtg 7yX4q9a3GFcsuV5OU12vBpyWhbaGOPLQu6oU4vnGVzaWY4BNkW9HhW8I3V04qaVUl2tX lY/kXpRAlyQ25417ktzojJgyES2/t5J+GBv+IZcAdBKS5rgwKlyQOeMj+HIUJrR34hCG PYUe/ia4N/+JHb+RroRlFGFQhPqiv0j8V5Bo66dAF+yaJ0BVeP7h7i6WKUeKP4KLtn/X VOatc3y7zf+Kopl70Zb3HOf08oH2KKF4gYCxdnthcQGGdjQmlr9olRa8KKfbIQFhOP/T j9+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=FUXyJX1C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id z3-20020a6552c3000000b0059ccb99a2eesi10360656pgp.173.2023.10.16.03.17.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 03:17:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=FUXyJX1C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 434A4804C4BE; Mon, 16 Oct 2023 03:17:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233378AbjJPKRM (ORCPT + 18 others); Mon, 16 Oct 2023 06:17:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232974AbjJPKQr (ORCPT ); Mon, 16 Oct 2023 06:16:47 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29FB312B for ; Mon, 16 Oct 2023 03:16:26 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39GAGEF1119464; Mon, 16 Oct 2023 05:16:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1697451374; bh=UZYjBdWAg9JVKmqxPo56hC7NpJy6uWjMu8LlhaZH4UA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=FUXyJX1Cc6omp57163Gzol59Z0EpaRrbZo08VDZ0nKLIvTXb0s+6WOhmGDH5kF8UU euXG/dRwqtZdMZtplsBIj3tMUHetwHhoAx/HMsULVXLEEX0dtsE/HK8LcKO2AjRLwt UikctcxgaqNRQBbmh6Qi2UyjXT8uEmcgJInVoIj4= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39GAGEtd040501 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 16 Oct 2023 05:16:14 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 16 Oct 2023 05:16:14 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE101.ent.ti.com (157.170.170.31) 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; Mon, 16 Oct 2023 05:16:14 -0500 Received: from a0497641-HP-Z2-Tower-G9-Workstation-Desktop-PC.dhcp.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39GAG90g033447; Mon, 16 Oct 2023 05:16:12 -0500 From: Neha Malcom Francis To: , , CC: , , , Subject: [PATCH v3 1/3] soc: ti k3-socinfo: Fix typo Date: Mon, 16 Oct 2023 15:46:06 +0530 Message-ID: <20231016101608.993921-2-n-francis@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016101608.993921-1-n-francis@ti.com> References: <20231016101608.993921-1-n-francis@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 16 Oct 2023 03:17:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779906848937569642 X-GMAIL-MSGID: 1779906848937569642 Fix typo in driver that comments out wrong bit. Signed-off-by: Neha Malcom Francis --- No change since v2 drivers/soc/ti/k3-socinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index 6ea9b8c7d335..d45f5cb955a6 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -20,7 +20,7 @@ * 31-28 VARIANT Device variant * 27-12 PARTNO Part number * 11-1 MFG Indicates TI as manufacturer (0x17) - * 1 Always 1 + * 0 Always 1 */ #define CTRLMMR_WKUP_JTAGID_VARIANT_SHIFT (28) #define CTRLMMR_WKUP_JTAGID_VARIANT_MASK GENMASK(31, 28) From patchwork Mon Oct 16 10:16:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neha Malcom Francis X-Patchwork-Id: 153300 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3357372vqb; Mon, 16 Oct 2023 03:17:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNqaewS2zhxOwdi4mmlB4i12Yp3V/qVPxBXf/WqFb9jhB2JzTljvbbj1T/u+rmr3p7/6/I X-Received: by 2002:a05:6a00:391c:b0:690:d0d4:6fb0 with SMTP id fh28-20020a056a00391c00b00690d0d46fb0mr36840808pfb.3.1697451454816; Mon, 16 Oct 2023 03:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697451454; cv=none; d=google.com; s=arc-20160816; b=oe8dX1DZN4vYCSw8c1AhejEewBLyqI6Tem9lGFXM6vZ7h+L1M+JAW/RL0vKsbTxq6B /KsjiTuh8IecmFJ6s+TBOeiSpJarM5H3B6WQR5rZIO/N/dWoeUWJJNR5UQdPLKSgSXsW VC6aqTHX/CG0BNqpvtkDS1fOBjpC9S+Aq9+XR53MUIwD63oGIo60HUrP2uh80AnbZXsJ XckOHAALlceCu+HYUXdeP+I4MHYs+y2tZBG7t7dA69GF5HUVdYflMvDWThFOkSb+GED/ yG07wG1txfgRJehwosp7pc4KGSPNV8pkEJjaKQoeSGS3862IaG6ga5lqjawBlPW8gnX1 pOqA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=88rE/gvk3TLI1pA0SASlq4XLga9h1ZmVfZYQHMJX+90=; fh=zXIzpqU6fkcvkKYOWPETYAc8kHdGN5li0oSb9j2GXFE=; b=k64U3LZumcKt4gD5hVr0cvRc6F1UQBrJPW6n7eK3mg3ctcAt8HZFVyCDK+ttmmoHRE NHwwBuaU+R4GjiKAEIB4llYEbPrIlBN4+xrKVACKVnqaTYLzFgk+GJUYJ/9TNokFZTFw DjESmip8LLoNFpwUcnPwNNZWwECLw5lb+B9otZyvQQvwiTYh0nnkfBYyRdy39+5g1rsw oSc7RfPPbt2oSfZq62w3wRMzNER9TxUSGXlc0nySLF72nq42orqqYAyNAPlXusKDg1Fj qbDINdr84hmPjfbrtpxOWVPrIsJ6wlCm0s6rgiUGpQJBPuNyDSLYY/O/DYQkcVAp9XRv G2qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hS412G+E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id 36-20020a630a24000000b00578a28df3e2si9640508pgk.816.2023.10.16.03.17.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 03:17:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hS412G+E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6FBA88085FAB; Mon, 16 Oct 2023 03:17:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233252AbjJPKRJ (ORCPT + 18 others); Mon, 16 Oct 2023 06:17:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233082AbjJPKQp (ORCPT ); Mon, 16 Oct 2023 06:16:45 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3806E8 for ; Mon, 16 Oct 2023 03:16:24 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39GAGHs2099117; Mon, 16 Oct 2023 05:16:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1697451377; bh=88rE/gvk3TLI1pA0SASlq4XLga9h1ZmVfZYQHMJX+90=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hS412G+E7j7iNqklPP1RXxtBSwNA0j2NRQK8Wi4Wj1Wl/J/Rc7MTG82wEwXMTkTVF lk+0qxro8gnN5nEctayAAvlD+sPAKX1LFIDSzJnl+Je9wj7xPAOcncQpYMfgiNZJRC SpAy1I9VNh+JaloxVQY+J29zF2PttU/eiv5pSphY= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39GAGHjR029751 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 16 Oct 2023 05:16:17 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 16 Oct 2023 05:16:17 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE107.ent.ti.com (10.64.6.28) 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; Mon, 16 Oct 2023 05:16:17 -0500 Received: from a0497641-HP-Z2-Tower-G9-Workstation-Desktop-PC.dhcp.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39GAG90h033447; Mon, 16 Oct 2023 05:16:15 -0500 From: Neha Malcom Francis To: , , CC: , , , Subject: [PATCH v3 2/3] soc: ti: k3-socinfo: Avoid overriding ret Date: Mon, 16 Oct 2023 15:46:07 +0530 Message-ID: <20231016101608.993921-3-n-francis@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016101608.993921-1-n-francis@ti.com> References: <20231016101608.993921-1-n-francis@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 16 Oct 2023 03:17:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779906856432984347 X-GMAIL-MSGID: 1779906856432984347 Avoid overriding the return value and make sure the right error code is reflected. Here, if the partno is none of the identified partnos present in k3_soc_ids[], return -ENODEV. Signed-off-by: Neha Malcom Francis --- Changes since v2: - new patch drivers/soc/ti/k3-socinfo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index d45f5cb955a6..7fc3548e084c 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -60,7 +60,7 @@ k3_chipinfo_partno_to_names(unsigned int partno, return 0; } - return -EINVAL; + return -ENODEV; } static int k3_chipinfo_probe(struct platform_device *pdev) @@ -111,8 +111,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev) 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; + dev_err(dev, "Unknown SoC JTAGID[0x%08X]: %d\n", jtag_id, ret); goto err_free_rev; } From patchwork Mon Oct 16 10:16:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neha Malcom Francis X-Patchwork-Id: 153301 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3357496vqb; Mon, 16 Oct 2023 03:17:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE53FKmuuXhNQUY5/q2lkLlKHekinlY7NiF/zcqQkkfkGS9YVRpWJeNn+KRgIEV7d9iSMq6 X-Received: by 2002:a92:db4f:0:b0:34e:2a69:883c with SMTP id w15-20020a92db4f000000b0034e2a69883cmr33337342ilq.1.1697451468171; Mon, 16 Oct 2023 03:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697451468; cv=none; d=google.com; s=arc-20160816; b=qZPReokymx16p0pALU0ngmuA7BqA7ej4gu6yxmFYa1TkMlmGCEpGfS87fOoUsg3QL2 +zbDrUbwJBz9iigQ+puuFtCo3vOiVVuCDg/2060f1jB4IfgvQy3kjYLeD/k6yEFtnBQ/ JONiKc5cWBcDZbUvX80HiQQFsTsVtnwFSyTzQXi+J49fECUXAYyluzeMXub0RM4GxWiZ xbT3d0+/cSoZlYXHg0j4QYT4OfyovBRLFM68HtDdtqpfllR33HbjT+rX8VJVxw6qyEmE poBTSHb/pntE7ZEdmM5GvM3bkyABkgyUOp6wWZsr41S/SaXToP75chKpSFZQlNnkwOhL RelA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mUEmS5X5FgjjtcAPHgw5AMBeixQExKA6lT4KW9jhDGw=; fh=zXIzpqU6fkcvkKYOWPETYAc8kHdGN5li0oSb9j2GXFE=; b=O+LyyAp4jvOfclDEkbCQxyqrOZ5pObdZj+HOrO1zIckkxBg/oSrLnkVozN8F1jc30f csNDv9ApTkExh45H4D9Z4XIK1NJb9PSe8m2CCVlZqA4g1lWvzTg0DVphr1lhsd9PvYqp 280uyYrKwaQu/kjJ5tTmTBcxJJOenWevIA9nMNURRQ8GaO6o8f3ltD5nPalw7v9FUrcd NSAserPSSuULl/E9anZTe1Bm3eMkvE08nNw19eMMalEL3gWlhPwzfawiK5GZSwjdrtam 2gshdvWjTZtHzR8We4gL5Dr3JdYslcMVD8Zl0pjehqzQtuUI6v8Gk3jgN+G0pnMdQ1GB 9Y7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mHOQTwW0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id y6-20020a633206000000b0057745b2d018si9944100pgy.390.2023.10.16.03.17.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 03:17:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mHOQTwW0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E8DEC804C224; Mon, 16 Oct 2023 03:17:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233393AbjJPKRP (ORCPT + 18 others); Mon, 16 Oct 2023 06:17:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233244AbjJPKQt (ORCPT ); Mon, 16 Oct 2023 06:16:49 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6D33D49 for ; Mon, 16 Oct 2023 03:16:30 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39GAGJsZ119482; Mon, 16 Oct 2023 05:16:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1697451379; bh=mUEmS5X5FgjjtcAPHgw5AMBeixQExKA6lT4KW9jhDGw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mHOQTwW0HDMKQPfWRDS7Zkq4jjdvExdDqf7w3cy8eLS+l6lixh+XZDV9SSG/0P2ya wjQbj5wRgBp5W+Q06C0wKWNr0D3rlAQHNsfGy6HqBgxgFmSJa+yVZ8Z8MqYKTAx2Zt vqKmIhwCuybhccTxg9n4qzj9X+kt6E05RV9NxbTE= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39GAGJig020318 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 16 Oct 2023 05:16:19 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) 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; Mon, 16 Oct 2023 05:16:19 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE114.ent.ti.com (157.170.170.25) 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; Mon, 16 Oct 2023 05:16:19 -0500 Received: from a0497641-HP-Z2-Tower-G9-Workstation-Desktop-PC.dhcp.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39GAG90i033447; Mon, 16 Oct 2023 05:16:17 -0500 From: Neha Malcom Francis To: , , CC: , , , Subject: [PATCH v3 3/3] soc: ti: k3-socinfo: Revamp driver to accommodate different rev structs Date: Mon, 16 Oct 2023 15:46:08 +0530 Message-ID: <20231016101608.993921-4-n-francis@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016101608.993921-1-n-francis@ti.com> References: <20231016101608.993921-1-n-francis@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 16 Oct 2023 03:17:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779906870461115930 X-GMAIL-MSGID: 1779906870461115930 k3-socinfo.c driver assumes silicon revisions for every platform are incremental and one-to-one, corresponding to JTAG_ID's variant field: 1.0, 2.0 etc. This assumption is wrong for SoCs such as J721E, where the variant field to revision mapping is 1.0, 1.1. Further, there are SoCs such as AM65x where the sub-variant version requires custom decoding of other registers. Address this by using conditional handling per JTAG ID that requires an exception with J721E as the first example. To facilitate this conversion, use macros to identify the JTAG_ID part number and map them to predefined string array. Signed-off-by: Neha Malcom Francis Co-developed-by: Thejasvi Konduru Signed-off-by: Thejasvi Konduru --- Changes since v2: - update commit message - move from double Signed-off-by to Co-developed-by - make j721e_rev_string_map[] a const char - drop k3_rev_string_map[] and continue using old "variant++" logic for the typical cases - appropriate error handling with no overrides distinguishing between ENODEV and ENOMEM drivers/soc/ti/k3-socinfo.c | 71 ++++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index 7fc3548e084c..7517a9c8c8fa 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -33,19 +33,33 @@ #define CTRLMMR_WKUP_JTAGID_MFG_TI 0x17 +#define JTAG_ID_PARTNO_AM65X 0xBB5A +#define JTAG_ID_PARTNO_J721E 0xBB64 +#define JTAG_ID_PARTNO_J7200 0xBB6D +#define JTAG_ID_PARTNO_AM64X 0xBB38 +#define JTAG_ID_PARTNO_J721S2 0xBB75 +#define JTAG_ID_PARTNO_AM62X 0xBB7E +#define JTAG_ID_PARTNO_J784S4 0xBB80 +#define JTAG_ID_PARTNO_AM62AX 0xBB8D +#define JTAG_ID_PARTNO_AM62PX 0xBB9D + static const struct k3_soc_id { unsigned int id; const char *family_name; } k3_soc_ids[] = { - { 0xBB5A, "AM65X" }, - { 0xBB64, "J721E" }, - { 0xBB6D, "J7200" }, - { 0xBB38, "AM64X" }, - { 0xBB75, "J721S2"}, - { 0xBB7E, "AM62X" }, - { 0xBB80, "J784S4" }, - { 0xBB8D, "AM62AX" }, - { 0xBB9D, "AM62PX" }, + { JTAG_ID_PARTNO_AM65X, "AM65X" }, + { JTAG_ID_PARTNO_J721E, "J721E" }, + { JTAG_ID_PARTNO_J7200, "J7200" }, + { JTAG_ID_PARTNO_AM64X, "AM64X" }, + { JTAG_ID_PARTNO_J721S2, "J721S2"}, + { JTAG_ID_PARTNO_AM62X, "AM62X" }, + { JTAG_ID_PARTNO_J784S4, "J784S4" }, + { JTAG_ID_PARTNO_AM62AX, "AM62AX" }, + { JTAG_ID_PARTNO_AM62PX, "AM62PX" }, +}; + +static const char * const j721e_rev_string_map[] = { + "1.0", "1.1", }; static int @@ -63,6 +77,32 @@ k3_chipinfo_partno_to_names(unsigned int partno, return -ENODEV; } +static int +k3_chipinfo_variant_to_sr(unsigned int partno, unsigned int variant, + struct soc_device_attribute *soc_dev_attr) +{ + switch (partno) { + case JTAG_ID_PARTNO_J721E: + if (variant >= ARRAY_SIZE(j721e_rev_string_map)) + goto err_unknown_variant; + soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%s", + j721e_rev_string_map[variant]); + break; + default: + variant++; + soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%x.0", + variant); + } + + if (!soc_dev_attr->revision) + return -ENOMEM; + + return 0; + +err_unknown_variant: + return -ENODEV; +} + static int k3_chipinfo_probe(struct platform_device *pdev) { struct device_node *node = pdev->dev.of_node; @@ -94,7 +134,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; @@ -103,16 +142,16 @@ 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; + ret = k3_chipinfo_partno_to_names(partno_id, soc_dev_attr); + if (ret) { + dev_err(dev, "Unknown SoC JTAGID[0x%08X]: %d\n", jtag_id, ret); goto err; } - ret = k3_chipinfo_partno_to_names(partno_id, soc_dev_attr); + ret = k3_chipinfo_variant_to_sr(partno_id, variant, soc_dev_attr); if (ret) { - dev_err(dev, "Unknown SoC JTAGID[0x%08X]: %d\n", jtag_id, ret); - goto err_free_rev; + dev_err(dev, "Unknown SoC SR[0x%08X]: %d\n", jtag_id, ret); + goto err; } node = of_find_node_by_path("/");