From patchwork Wed Nov 9 06:17:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kartik Rajput X-Patchwork-Id: 17352 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp171387wru; Tue, 8 Nov 2022 22:19:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf5O5i9OiBt5xvZa0Ksx8EFcdB+JiybrBg3mbwtM0ReWCWnsTVYWdJJ6Ei9SuzDJtHwB88WA X-Received: by 2002:a17:906:730c:b0:7ae:63fe:97e3 with SMTP id di12-20020a170906730c00b007ae63fe97e3mr14648255ejc.71.1667974796593; Tue, 08 Nov 2022 22:19:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1667974796; cv=pass; d=google.com; s=arc-20160816; b=i/Mnvx9cZBb2RC6Ra0EEGE1onDSmXPZKfhhcSf5L9A7MzFcLouA8L/DDZwM6Iaj6vZ xyDfX5dSkyRu+IxtkUJbgio2+BAl7/Ak+J9Gwk/JAiwuGjK3t+aUtncZKs5p8EMQUbdU u46qxWQU+yi1S7AJW3pHEkZ3FnT3RQiU2JktM2RxhvCVUS80Io8Evu9w4EqjliniKkZz L12cipW7Ip58MGaZF9ff6pMeXdP2EQoEFoA7VSSPSLzW/QElHVxmNaHTMBBjnT3M5CWo FvUoPRGKyJnuqy6lHblqt6e7TF8Q1tdVT95RW9L/B3CjdWnqiXWix4Ki346vABa/4PVa QC/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from :dkim-signature; bh=HxwfGjTDzhc6uLTkzDcKivfIX5jmLCO9vHrFSfST8GM=; b=kGC7/RZCxOfAPvIGjgJUirXQ+DgGrlasEE+A5yVRMC0oOOSZTSQhGcwCV23uAs+U28 7isa2T4RoMg+Ie46bhEwnUHdmX+QvLz5y9wVvuYRNHoeXXNF4Yyc2/cwfHnDk/+9LBve o3gX/n3TFev5Ian17GrT0kVxCqjCD8pw7vVUDgcdRdVsruzqWAhDMt8CbbxYgvIAOhgt k2LzUUvTEsdgx4CGrEKrnpP9z05oZUwp9UNH3Nl0fUXiBQJCFLUXQeQzRZuJPc8HGDqr azR6hxx1whJtGS4/SDpxNpeYK40bV2OnGuv+yLnzszilZYV1i3+R9DcadfT4nVmhJ/Yu hjIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=usRtWKsT; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a056402038700b00462847f2128si12567078edv.107.2022.11.08.22.19.32; Tue, 08 Nov 2022 22:19:56 -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=@Nvidia.com header.s=selector2 header.b=usRtWKsT; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229553AbiKIGRx (ORCPT + 99 others); Wed, 9 Nov 2022 01:17:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiKIGRv (ORCPT ); Wed, 9 Nov 2022 01:17:51 -0500 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2056.outbound.protection.outlook.com [40.107.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DF7A315; Tue, 8 Nov 2022 22:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hEH7On1+i77WMiD7yLLec0bzmM0n9DxaeGLyy0OVc5OXmTjO2owlmusrFHA15Lnv59LxiPzPG0ZsgRM7CbYBjtaaGCdJIW39OvaUKJjws6NRG7GB8aUwAoJZXmUe2H+LemdbOEbX5ToagiQlUaMWXnvXwBu1w+weZWcbdYHvaL0G28+TcvTzqSdTtj9S5gy7F7zmJLJlTx7eIYEDbxthssedVnXbHkWvKTdL7p+PKI8M1JSnwwGpGBOMWEF61WK4W18lphmI7xdWe6K+RVCo39OQzckPajFa5QcFAACqzobuPThsWXGgOndJKtJsakWcVza7giOH7UsnjpHmjLYOHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HxwfGjTDzhc6uLTkzDcKivfIX5jmLCO9vHrFSfST8GM=; b=TcFoaQbYWGQIwThdSKIheYTqBYTpR/4L8/2wUKisns74BW4dIUwzFhmcYN0FFr5tgP29y1n7mU2I1FsPS+0nUhsqbTjjCcgGRPyhUaprZ3TUoxfO4Etuq4ceF8i0rNa6QoE7rLVUXzT9YAso4nn0t8I7qK9leOgl4Ioy+SUVeqE8s3g51Oxupvvqq22SpCnrTS3hk47PrWsZQn/eGWm68c0TvhqYCMAbu7e+4pGQG6gjC2XMJKx9dkkXsmQClzEtHA1T8zIpv8WjgVOcWnFuvJwypvDbrYZ9JLxFuiMjOsOukcyGcvysZNi86JnnUOiopaSO657Er+crX3tRsnYIBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HxwfGjTDzhc6uLTkzDcKivfIX5jmLCO9vHrFSfST8GM=; b=usRtWKsTep2UMJJ8BxF/4mMErLclS3HQUhm4AGdcp6hMhIEKCE68+6bdncKk7Ls+UqxRCRvh13+jaQeKZpYNafdJnNz4Bl89R5H/gLfK/N34w9zQHTHVvNYknGTgrvi8osqQ8C8O/JAViW5yIgZG8KMVaHn+ywKyUgx3Cq9rtQcKk1RvAu4RH6OaULSaJMSfYJwwcbT5eB3oKAmpmvbjs7LIY24/yq94SGQZugl+5MPwMSNblor9kv+RRNZcxhIHHvA+5RsGQq8L/cbvE/gjPP/MvD5nB7Kw/RazVKlb3uxNJfvQjImeU0HIO0+EiwuDzCNLYN9EORF8H+3sshrWaw== Received: from MW2PR16CA0023.namprd16.prod.outlook.com (2603:10b6:907::36) by DM4PR12MB6398.namprd12.prod.outlook.com (2603:10b6:8:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.27; Wed, 9 Nov 2022 06:17:48 +0000 Received: from CO1NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:907:0:cafe::79) by MW2PR16CA0023.outlook.office365.com (2603:10b6:907::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.24 via Frontend Transport; Wed, 9 Nov 2022 06:17:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT033.mail.protection.outlook.com (10.13.174.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.12 via Frontend Transport; Wed, 9 Nov 2022 06:17:48 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 8 Nov 2022 22:17:38 -0800 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 8 Nov 2022 22:17:38 -0800 Received: from kkartik-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Tue, 8 Nov 2022 22:17:33 -0800 From: Kartik To: , , , , , , , , , , , Subject: [PATCH] soc/tegra: fuse: use platform info with soc revision Date: Wed, 9 Nov 2022 11:47:31 +0530 Message-ID: <1667974651-10893-1-git-send-email-kkartik@nvidia.com> X-Mailer: git-send-email 2.7.4 X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT033:EE_|DM4PR12MB6398:EE_ X-MS-Office365-Filtering-Correlation-Id: 6357ba5d-b77e-43cc-5d3c-08dac21a1fa1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EirPi1bdh64xMGcrPwXRpHLX/CNmSfp97XzYgjgb8FT9zChXFVbJ2Dr630Ni8Jtw2aBxLtHi+ekU08Ipyaq84TMObm0Y1pmLo84QUFUaGbfZlfA2PUZu8/v600p/G5miluTx/tPbua7vuAQooofE+v5ogQur4DYr1CulcwrYuTmqxfxdUvictcY0E2vNDbyvP8GtLW8ZnWdJK4+3MJ90Gu5lutGtHORKzijcz2Lvevil0oIvska4sgrZQqSwjhHudEcb5a5YUWm2sjJTmKluavlQqbw1d9bWOmtBR2v2WazJ5fMKyYew3xY1yl9Wy/fV9RWRHP6dBrF+So/v/QJgG8kZPEKdbWr3suTWfDbTNspyswJUeR213dJNv/2RgB8JbbX58IvaP/ZssEDuhzDA8xlT45TNeexwPHMkJyw7QUNXFhkd0hy1mBXHwUPhJP1w027oEfIQhUwzW4xW9J7hfhTM4j0WbXhsC6iFi4iHf4Jqw9eYcCGUJF4bTdi5xpEZmLgVNMFMFNETjuWAnPQJwct2Ee0EM+b6VpapxjAH2xK0HHe2Y9gzkB6Og+Zrd8l1+lfy0FY76IsA3flLOBN8PQiUl8+SaJ5sHLXVdcQXtWX9sNsULYX3US6PMmGM67NGhvRpQu2mJi5qxPUd/1V+xh0UPPlYmW8rnFFgwGo6/D25BNHc5p8AoTHds1THTeZdRlOYOdDlKB8AYJt7uW1YrBrCvtutCYPSZqhEpNXpcLXSiKCaZXBStTiLkdJT7SGu7YPdUh2h6iDMoK4sp29olFVhq7iFXPALbeZAfIyr3nY= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(346002)(136003)(376002)(396003)(451199015)(36840700001)(46966006)(40470700004)(82310400005)(478600001)(7636003)(110136005)(921005)(356005)(316002)(7696005)(47076005)(2906002)(40480700001)(26005)(8676002)(70586007)(70206006)(82740400003)(86362001)(2616005)(36756003)(8936002)(41300700001)(5660300002)(186003)(83380400001)(426003)(40460700003)(336012)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2022 06:17:48.0859 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6357ba5d-b77e-43cc-5d3c-08dac21a1fa1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6398 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748998340407601128?= X-GMAIL-MSGID: =?utf-8?q?1748998340407601128?= Tegra pre-silicon platforms does not have chip revisions. This makes "revision" soc attribute obsolete on these platforms. Populate "revision" soc attribute with "platform name + chip revision" for Silicon. For pre-silicon platforms populate it with "platform name" instead. Signed-off-by: Kartik Reviewed-by: Arnd Bergmann --- drivers/soc/tegra/fuse/fuse-tegra.c | 23 +++++++++++++++++++++-- drivers/soc/tegra/fuse/tegra-apbmisc.c | 1 + include/soc/tegra/fuse.h | 15 +++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c index ea25a1dcafc2..a20c9e0105dc 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra.c +++ b/drivers/soc/tegra/fuse/fuse-tegra.c @@ -35,6 +35,19 @@ static const char *tegra_revision_name[TEGRA_REVISION_MAX] = { [TEGRA_REVISION_A04] = "A04", }; +static const char *tegra_platform_name[TEGRA_PLATFORM_MAX] = { + [TEGRA_PLATFORM_SILICON] = "Silicon", + [TEGRA_PLATFORM_QT] = "QT", + [TEGRA_PLATFORM_SYSTEM_FPGA] = "System FPGA", + [TEGRA_PLATFORM_UNIT_FPGA] = "Unit FPGA", + [TEGRA_PLATFORM_ASIM_QT] = "Asim QT", + [TEGRA_PLATFORM_ASIM_LINSIM] = "Asim Linsim", + [TEGRA_PLATFORM_DSIM_ASIM_LINSIM] = "Dsim Asim Linsim", + [TEGRA_PLATFORM_VERIFICATION_SIMULATION] = "Verification Simulation", + [TEGRA_PLATFORM_VDK] = "VDK", + [TEGRA_PLATFORM_VSP] = "VSP", +}; + static const struct of_device_id car_match[] __initconst = { { .compatible = "nvidia,tegra20-car", }, { .compatible = "nvidia,tegra30-car", }, @@ -370,8 +383,14 @@ struct device * __init tegra_soc_device_register(void) return NULL; attr->family = kasprintf(GFP_KERNEL, "Tegra"); - attr->revision = kasprintf(GFP_KERNEL, "%s", - tegra_revision_name[tegra_sku_info.revision]); + if (tegra_is_silicon()) { + attr->revision = kasprintf(GFP_KERNEL, "%s %s", + tegra_platform_name[tegra_sku_info.platform], + tegra_revision_name[tegra_sku_info.revision]); + } else { + attr->revision = kasprintf(GFP_KERNEL, "%s", + tegra_platform_name[tegra_sku_info.platform]); + } attr->soc_id = kasprintf(GFP_KERNEL, "%u", tegra_get_chip_id()); attr->custom_attr_group = fuse->soc->soc_attr_group; diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c index 3351bd872ab2..4591c5bcb690 100644 --- a/drivers/soc/tegra/fuse/tegra-apbmisc.c +++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c @@ -156,6 +156,7 @@ void __init tegra_init_revision(void) } tegra_sku_info.sku_id = tegra_fuse_read_early(FUSE_SKU_INFO); + tegra_sku_info.platform = tegra_get_platform(); } void __init tegra_init_apbmisc(void) diff --git a/include/soc/tegra/fuse.h b/include/soc/tegra/fuse.h index 977c334136e9..a63de5da8124 100644 --- a/include/soc/tegra/fuse.h +++ b/include/soc/tegra/fuse.h @@ -34,6 +34,20 @@ enum tegra_revision { TEGRA_REVISION_MAX, }; +enum tegra_platform { + TEGRA_PLATFORM_SILICON = 0, + TEGRA_PLATFORM_QT, + TEGRA_PLATFORM_SYSTEM_FPGA, + TEGRA_PLATFORM_UNIT_FPGA, + TEGRA_PLATFORM_ASIM_QT, + TEGRA_PLATFORM_ASIM_LINSIM, + TEGRA_PLATFORM_DSIM_ASIM_LINSIM, + TEGRA_PLATFORM_VERIFICATION_SIMULATION, + TEGRA_PLATFORM_VDK, + TEGRA_PLATFORM_VSP, + TEGRA_PLATFORM_MAX, +}; + struct tegra_sku_info { int sku_id; int cpu_process_id; @@ -47,6 +61,7 @@ struct tegra_sku_info { int gpu_speedo_id; int gpu_speedo_value; enum tegra_revision revision; + enum tegra_platform platform; }; #ifdef CONFIG_ARCH_TEGRA