Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1247045iob; Thu, 12 May 2022 14:48:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynw/XHMRZ20tBYvsA3c9DhIYLoe4MsTe1Wi6OEmCDNfJt5A09fSy2qS8tpkAw70DRKB4y+ X-Received: by 2002:a50:ab57:0:b0:428:9f9b:d8e3 with SMTP id t23-20020a50ab57000000b004289f9bd8e3mr24136700edc.305.1652392121640; Thu, 12 May 2022 14:48:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652392121; cv=pass; d=google.com; s=arc-20160816; b=cLFDwZszysyRas2jCZtYT01S6OjYS/yDGiuHgRupPviUz+sRDmS+5OBSvW1Or45xp2 6awA8RzfAX7xf/u+LwtzweKwIMXhLdNFTXgYKmFRSJcVvELgbfiMrENaRKZHZP12ogR/ hA84jNfEabejKiYWorE5PjUTa0PgCgzqBHrkHQbnYPNDEqVf19vAn/2hIf9KTOZlPKRR hUlNI2tKmCo6v77u02uhqVinvf/wQJfTuy6jenDdW6dCfgfr3jujZSlnSixJxVuKkEnO iEyMCWrdQJFLzDV9lPomGBlp+vfCCr1ZEcfwBeHBrezklk/7cBNa0Kkl6xs1zvbfP+88 j4jg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Zzu8HI5FQ8zGLuLByU/of5KZ8czz03N+s304rd9nLuI=; b=V+K7+ZYpfkMqCmLGPzp9/6uu59Q/4Xr65CXXgUXu8ATgk3Mh1uLlPgI5lAYDNQLMBK UNkemgXGuI5TWki4yK0kLxYi+TflUT2+PMzfJszMlmn5nk4lJlXiJAjkldF5RLzWxAzj DPakuhYghVQHdXQGbXeijBr2a3jhjcCRknktHkoktqxLR5763OXziL6IV1B6S3x/SpDA S/jNThllGIzoeui4eoH3rfX7/euHTHCEDZAab1urln2YHx8BEn/KW7aS1Mlao+UQcE2R +V2TeKDUQ5RYp6T8ofv+OZ3rj0hXMZb1QQMGAXbeRoyQdC8E+yjl/OvQYD6IXdeTLeDS 7fLw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=eIdBIHLe; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g19-20020a056402425300b00427d23cac59si371066edb.280.2022.05.12.14.48.15; Thu, 12 May 2022 14:48:41 -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=@Nvidia.com header.s=selector2 header.b=eIdBIHLe; 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 S1347745AbiEKUTd (ORCPT + 99 others); Wed, 11 May 2022 16:19:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343929AbiEKUTW (ORCPT ); Wed, 11 May 2022 16:19:22 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2082.outbound.protection.outlook.com [40.107.236.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BBBA236767; Wed, 11 May 2022 13:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XnOXBG45NXFAVl1He6i4Eyz1XQi2S1ld82wuq3xB49K2Giyz2MhqruuYuFShMEeOUpPaj/vMFkKkbLWc5lSNv1EC6okbtG3TOWONG62yGQIbXZx2ojoSStJoSW5Hs0eWEuRNq6H53o4ulnzSYLCWtzLILkNKxKVIXd9iZhDBhfpwPID8VxAZjM++LW9A9oyrT49ZUOmig/ww7pBVQu6ncMRY0946HkMKhGwthwYWbyCSXVXsxGQTikIfAw7CuTSFG5xDgtIKW9xiaQdKu5uEOiFqa+clZczxW+OJGtjHRhfMnIurL7e7NRwpi/72F4XtoZXTXim8U9v1shJposg6Lg== 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=Zzu8HI5FQ8zGLuLByU/of5KZ8czz03N+s304rd9nLuI=; b=CMXAe5hXJuyYKuXXn0Fv+oFLt3k0PD0EMJHjsNti9FK0g2Pto5ibPfW1BjqLJB+w8RDi2wD7xp8OIE1CUxFQSVBThwn3F8hAEGalN+dbFLjsVewHjk1/r79LkL+XyzE1B+bHYCGInt5G0GSCcHb8Qn1LF5Sm7uYaf33ZA74tDTjcS+71Y6lBHg1fwDNLwdcOsVHl/5xapLrps6at7M2X8t5teGfoxBik/yBwCEd5Ez31BUzYTMNwBqHP+/DBHA9xxKLY3Fx9kbiJD5vlW+Sard3Mzgq4EP9WTymZg8N8SMUEv7LF08UWFmRXmADWp0ejRsXKcxJ4SPo2Xu5T9t7OdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) 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=Zzu8HI5FQ8zGLuLByU/of5KZ8czz03N+s304rd9nLuI=; b=eIdBIHLeSvFhVLh2nPS/0rhr8CXAOEmirl8RHqMndu977eIe6bbib5Tcl5PDwXSIg5DRXfT7pMDzuSI2HVzIPssmBtn+A7cnYyXPkDKMq8jRdFZroGOteRxL2BGtq9bGWlDCXADL0kGf732cWmeuhNPJp2tErIq6v4REuRa/fLaTalSvYwWgeBLxZnfcxE9i2C+a1yIOMJT5yEJDXf/1XbOxpM1qdyYOUqN37adEAN4A5fuKb8ZmRmAFu0Fej+gYloAx/60BtqZnhv+8DUP0gmqOq9oyq0oCvg3XHF7p4l22ajqBUNM4X3rbRig5vtSmV1X6/iHyXvgySjLQ7g7yjg== Received: from DM6PR02CA0132.namprd02.prod.outlook.com (2603:10b6:5:1b4::34) by DM4PR12MB5772.namprd12.prod.outlook.com (2603:10b6:8:63::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.21; Wed, 11 May 2022 20:19:17 +0000 Received: from DM6NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b4:cafe::3f) by DM6PR02CA0132.outlook.office365.com (2603:10b6:5:1b4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23 via Frontend Transport; Wed, 11 May 2022 20:19:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT012.mail.protection.outlook.com (10.13.173.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5250.13 via Frontend Transport; Wed, 11 May 2022 20:19:17 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 11 May 2022 20:19:16 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:19:16 -0700 Received: from sumitg-l4t.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Wed, 11 May 2022 13:19:13 -0700 From: Sumit Gupta To: , , , , , , CC: , , , Subject: [Patch v6 9/9] soc: tegra: cbb: Add support for tegra-grace SOC Date: Thu, 12 May 2022 01:46:51 +0530 Message-ID: <20220511201651.30695-11-sumitg@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220511201651.30695-1-sumitg@nvidia.com> References: <20220511201651.30695-1-sumitg@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fbc7d0a5-e588-4790-45a8-08da338b865e X-MS-TrafficTypeDiagnostic: DM4PR12MB5772:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9djFBkO6BD8kwA4cp/F5Vn7yDKm9gzdxd4bq5xTT6DFqUYZ4p1OYPJhbihcAHO0KPDOAOiN/v/6Rs/6ovNscJeVWr4KewAsTaORKwu2b6awYrN8sLKOiWLTbBum8384wcVEf9mfBJ6bHr2buSE73YREvoJrbrCA17E64cqutYvGQJH2oq2NyRJJVNnbt/21aovSIvPvGl3Gm0N4LpqwJi6OPZ8Nj3zyCZaIhmJFb0OyLdTJrfoPZ3X0x1uxuV8IYZHv+p7xNffpVKNsK2JoAaQQVeEIsG8O3VjxUTCDfqobLSfhywKbmYj9iUJFIdFYtB70hHhNIgqcNZVa66OHf7AGok9i5cfsW+9id4x7EB08U77NEgqfkpNckYy1chTdP11Wc54hxgngSvASglxsumi6/dlo+VP94l40N6NzxjhtubOsIJzONOt5JkGWSlxUXLS70WBnjppBzX9mMkMsYTR5/v3GutYH/KYMzgUwgb7DAaq+vBQxYeY7uXLkWWdRJpyGxtl87Cc7+UQ6zWkUu9CtwR5enpgWZ/qoyN/JCDjVrSi8Od6gZrFb6FDppPD0T5c+p4BQYKtwYldkCfjmJ3sniL0+vH8LX71BYYB4T6SVd5WKveodYmr48F91lkGAyGPZ5LMrmlr+td2gVWrp3FhY8HNsdgRYzC73TGHYAZPpOG+hlDESRhkpwpMBwEvukcn0tiKXsbYY2aAdReBoK3g== X-Forefront-Antispam-Report: CIP:12.22.5.236;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(83380400001)(36756003)(82310400005)(356005)(81166007)(8936002)(2616005)(110136005)(70586007)(8676002)(70206006)(4326008)(54906003)(30864003)(107886003)(26005)(426003)(47076005)(336012)(40460700003)(36860700001)(508600001)(2906002)(5660300002)(6666004)(186003)(1076003)(86362001)(7696005)(316002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2022 20:19:17.2580 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fbc7d0a5-e588-4790-45a8-08da338b865e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.236];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5772 X-Spam-Status: No, score=-1.7 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, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Adding support for Tegra Grace SOC which uses CBB2.0 architecture based fabrics. Also, adding ACPI support required for Grace. Fabrics reporting errors in Grace are "CBB Fabric" and "BPMP Fabric". "CBB Fabric" connects various other CBB2.0 based fabrics and also services the Initiators and Targets which are connected to itself. "BPMP Fabric" is present in BPMP cluster. Signed-off-by: Sumit Gupta --- drivers/soc/tegra/cbb/tegra234-cbb.c | 92 ++++++++++- include/soc/tegra/tegra-grace-cbb.h | 219 +++++++++++++++++++++++++++ 2 files changed, 310 insertions(+), 1 deletion(-) create mode 100644 include/soc/tegra/tegra-grace-cbb.h diff --git a/drivers/soc/tegra/cbb/tegra234-cbb.c b/drivers/soc/tegra/cbb/tegra234-cbb.c index 1f6c0f05b5e4..edd0c331ea12 100644 --- a/drivers/soc/tegra/cbb/tegra234-cbb.c +++ b/drivers/soc/tegra/cbb/tegra234-cbb.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -27,6 +28,7 @@ #include #include #include +#include static LIST_HEAD(cbb_errmon_list); static DEFINE_SPINLOCK(cbb_errmon_lock); @@ -258,14 +260,32 @@ static void print_errlog_err(struct seq_file *file, struct tegra_cbb_errmon_reco u8 cache_type = 0, prot_type = 0, burst_length = 0; u8 mstr_id = 0, grpsec = 0, vqc = 0, falconsec = 0; u8 beat_size = 0, access_type = 0, access_id = 0; + u8 requester_socket_id = 0, local_socket_id = 0; u8 slave_id = 0, fab_id = 0, burst_type = 0; char fabric_name[20]; + bool is_numa = 0; + + if (num_possible_nodes() > 1) + is_numa = true; mstr_id = FIELD_GET(FAB_EM_EL_MSTRID, errmon->mn_user_bits); vqc = FIELD_GET(FAB_EM_EL_VQC, errmon->mn_user_bits); grpsec = FIELD_GET(FAB_EM_EL_GRPSEC, errmon->mn_user_bits); falconsec = FIELD_GET(FAB_EM_EL_FALCONSEC, errmon->mn_user_bits); + /* + * For SOC with multiple NUMA nodes, print cross socket access + * errors only if initiator/master_id is CCPLEX, CPMU or GPU. + */ + if (is_numa) { + local_socket_id = numa_node_id(); + requester_socket_id = FIELD_GET(REQ_SOCKET_ID, errmon->mn_attr2); + + if (requester_socket_id != local_socket_id) { + if ((mstr_id != 0x1) && (mstr_id != 0x2) && (mstr_id != 0xB)) + return; + } + } fab_id = FIELD_GET(FAB_EM_EL_FABID, errmon->mn_attr2); slave_id = FIELD_GET(FAB_EM_EL_SLAVEID, errmon->mn_attr2); @@ -298,6 +318,15 @@ static void print_errlog_err(struct seq_file *file, struct tegra_cbb_errmon_reco else strcpy(fabric_name, errmon->name); + if (is_numa) { + tegra_cbb_print_err(file, "\t Requester_Socket_Id\t: 0x%x\n", + requester_socket_id); + tegra_cbb_print_err(file, "\t Local_Socket_Id\t: 0x%x\n", + local_socket_id); + tegra_cbb_print_err(file, "\t No. of NUMA_NODES\t: 0x%x\n", + num_possible_nodes()); + } + tegra_cbb_print_err(file, "\t Fabric\t\t: %s\n", fabric_name); tegra_cbb_print_err(file, "\t Slave_Id\t\t: 0x%x\n", slave_id); tegra_cbb_print_err(file, "\t Burst_length\t\t: 0x%x\n", burst_length); @@ -585,6 +614,23 @@ static struct tegra_cbb_fabric_data tegra234_sce_fab_data = { .err_notifier_base = 0x19000 }; +static struct tegra_cbb_fabric_data tegra_grace_cbb_fab_data = { + .name = "cbb-fabric", + .tegra_cbb_master_id = tegra_grace_master_id, + .sn_addr_map = tegra_grace_cbb_sn_lookup, + .noc_errors = tegra_grace_errmon_errors, + .err_notifier_base = 0x60000, + .off_mask_erd = 0x40004 +}; + +static struct tegra_cbb_fabric_data tegra_grace_bpmp_fab_data = { + .name = "bpmp-fabric", + .tegra_cbb_master_id = tegra_grace_master_id, + .sn_addr_map = tegra_grace_bpmp_sn_lookup, + .noc_errors = tegra_grace_errmon_errors, + .err_notifier_base = 0x19000 +}; + static const struct of_device_id tegra234_cbb_dt_ids[] = { {.compatible = "nvidia,tegra234-cbb-fabric", .data = &tegra234_cbb_fab_data}, @@ -602,6 +648,38 @@ static const struct of_device_id tegra234_cbb_dt_ids[] = { }; MODULE_DEVICE_TABLE(of, tegra234_cbb_dt_ids); +struct cbb_acpi_uid_noc { + const char *hid; + const char *uid; + const struct tegra_cbb_fabric_data *fab; +}; + +static const struct cbb_acpi_uid_noc cbb_acpi_uids[] = { + { "NVDA1070", "1", &tegra_grace_cbb_fab_data }, + { "NVDA1070", "2", &tegra_grace_bpmp_fab_data }, + { }, +}; + +static const struct +tegra_cbb_fabric_data *cbb_acpi_get_fab_data(struct acpi_device *adev) +{ + const struct cbb_acpi_uid_noc *u; + + for (u = cbb_acpi_uids; u->hid; u++) { + if (acpi_dev_hid_uid_match(adev, u->hid, u->uid)) + return u->fab; + } + return NULL; +} + +#ifdef CONFIG_ACPI +static const struct acpi_device_id tegra_grace_cbb_acpi_ids[] = { + { "NVDA1070" }, + { }, +}; +MODULE_DEVICE_TABLE(acpi, tegra_grace_cbb_acpi_ids); +#endif + static int tegra234_cbb_errmon_init(const struct tegra_cbb_fabric_data *pdata, struct tegra_cbb *cbb, struct resource *res_base) @@ -646,10 +724,19 @@ static int tegra234_cbb_probe(struct platform_device *pdev) struct tegra_cbb_errmon_record *errmon = NULL; const struct tegra_cbb_fabric_data *pdata = NULL; struct resource *res_base = NULL; + struct acpi_device *device; struct tegra_cbb *cbb; int err = 0; - pdata = of_device_get_match_data(&pdev->dev); + if (of_machine_is_compatible("nvidia,tegra23x") || + of_machine_is_compatible("nvidia,tegra234")) { + pdata = of_device_get_match_data(&pdev->dev); + } else { + device = ACPI_COMPANION(&pdev->dev); + if (!device) + return -ENODEV; + pdata = cbb_acpi_get_fab_data(device); + } if (!pdata) { dev_err(&pdev->dev, "No device match found\n"); return -EINVAL; @@ -720,6 +807,9 @@ static struct platform_driver tegra234_cbb_driver = { .owner = THIS_MODULE, .name = "tegra234-cbb", .of_match_table = of_match_ptr(tegra234_cbb_dt_ids), +#ifdef CONFIG_ACPI + .acpi_match_table = ACPI_PTR(tegra_grace_cbb_acpi_ids), +#endif #ifdef CONFIG_PM_SLEEP .pm = &tegra234_cbb_pm, #endif diff --git a/include/soc/tegra/tegra-grace-cbb.h b/include/soc/tegra/tegra-grace-cbb.h new file mode 100644 index 000000000000..91cde80e773a --- /dev/null +++ b/include/soc/tegra/tegra-grace-cbb.h @@ -0,0 +1,219 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved + */ + +static char *tegra_grace_master_id[] = { + "TZ", /* 0x0 */ + "CCPLEX", /* 0x1 */ + "CCPMU", /* 0x2 */ + "BPMP_FW", /* 0x3 */ + "PSC_FW_USER", /* 0x4 */ + "PSC_FW_SUPERVISOR", /* 0x5 */ + "PSC_FW_MACHINE", /* 0x6 */ + "PSC_BOOT", /* 0x7 */ + "BPMP_BOOT", /* 0x8 */ + "JTAGM_DFT", /* 0x9 */ + "CORESIGHT", /* 0xA */ + "GPU", /* 0xB */ + "PEATRANS", /* 0xC */ + "RSVD" /* 0x3F */ +}; + +/* + * Possible causes for Slave and Timeout errors. + * SLAVE_ERR: + * Slave being accessed responded with an error. Slave could return + * an error for various cases : + * Unsupported access, clamp setting when power gated, register + * level firewall(SCR), address hole within the slave, etc + * + * TIMEOUT_ERR: + * No response returned by slave. Can be due to slave being clock + * gated, under reset, powered down or slave inability to respond + * for an internal slave issue + */ + +static struct tegra_noc_errors tegra_grace_errmon_errors[] = { + {.errcode = "SLAVE_ERR", + .type = "Slave being accessed responded with an error." + }, + {.errcode = "DECODE_ERR", + .type = "Attempt to access an address hole or Reserved region of memory." + }, + {.errcode = "FIREWALL_ERR", + .type = "Attempt to access a region which is firewalled." + }, + {.errcode = "TIMEOUT_ERR", + .type = "No response returned by slave." + }, + {.errcode = "PWRDOWN_ERR", + .type = "Attempt to access a portion of the fabric that is powered down." + }, + {.errcode = "UNSUPPORTED_ERR", + .type = "Attempt to access a slave through an unsupported access." + }, + {.errcode = "POISON_ERR", + .type = "Slave responds with poison error to indicate error in data." + }, + {.errcode = "RSVD"}, + {.errcode = "RSVD"}, + {.errcode = "RSVD"}, + {.errcode = "RSVD"}, + {.errcode = "RSVD"}, + {.errcode = "RSVD"}, + {.errcode = "RSVD"}, + {.errcode = "RSVD"}, + {.errcode = "RSVD"}, + {.errcode = "NO_SUCH_ADDRESS_ERR", + .type = "The address belongs to the pri_target range but there is no register implemented at the address." + }, + {.errcode = "TASK_ERR", + .type = "Attempt to update a PRI task when the current task has still not completed." + }, + {.errcode = "EXTERNAL_ERR", + .type = "Indicates that an external PRI register access met with an error due to any issue in the unit." + }, + {.errcode = "INDEX_ERR", + .type = "Applicable to PRI index aperture pair, when the programmed index is outside the range defined in the manual." + }, + {.errcode = "RESET_ERR", + .type = "Target in Reset Error: Attempt to access a SubPri or external PRI register but they are in reset." + }, + {.errcode = "REGISTER_RST_ERR", + .type = "Attempt to access a PRI register but the register is partial or completely in reset." + }, + {.errcode = "POWER_GATED_ERR", + .type = "Returned by external PRI client when the external access goes to a power gated domain." + }, + {.errcode = "SUBPRI_FS_ERR", + .type = "Subpri is floorswept: Attempt to access a subpri through the main pri target but subPri logic is floorswept." + }, + {.errcode = "SUBPRI_CLK_OFF_ERR", + .type = "Subpri clock is off: Attempt to access a subpri through the main pri target but subPris clock is gated/off." + } +}; + +#define REQ_SOCKET_ID GENMASK(27, 24) + +#define BPMP_SN_AXI2APB_1_BASE 0x00000 +#define BPMP_SN_CBB_T_BASE 0x15000 +#define BPMP_SN_CPU_T_BASE 0x16000 +#define BPMP_SN_DBB0_T_BASE 0x17000 +#define BPMP_SN_DBB1_T_BASE 0x18000 + +#define CBB_SN_CCPLEX_SLAVE_BASE 0x50000 +#define CBB_SN_PCIE_C8_BASE 0x51000 +#define CBB_SN_PCIE_C9_BASE 0x52000 +#define CBB_SN_PCIE_C4_BASE 0x53000 +#define CBB_SN_PCIE_C5_BASE 0x54000 +#define CBB_SN_PCIE_C6_BASE 0x55000 +#define CBB_SN_PCIE_C7_BASE 0x56000 +#define CBB_SN_PCIE_C2_BASE 0x57000 +#define CBB_SN_PCIE_C3_BASE 0x58000 +#define CBB_SN_PCIE_C0_BASE 0x59000 +#define CBB_SN_PCIE_C1_BASE 0x5A000 +#define CBB_SN_AON_SLAVE_BASE 0x5B000 +#define CBB_SN_BPMP_SLAVE_BASE 0x5C000 +#define CBB_SN_PSC_SLAVE_BASE 0x5D000 +#define CBB_SN_STM_BASE 0x5E000 +#define CBB_SN_AXI2APB_1_BASE 0x70000 +#define CBB_SN_AXI2APB_10_BASE 0x71000 +#define CBB_SN_AXI2APB_11_BASE 0x72000 +#define CBB_SN_AXI2APB_12_BASE 0x73000 +#define CBB_SN_AXI2APB_13_BASE 0x74000 +#define CBB_SN_AXI2APB_14_BASE 0x75000 +#define CBB_SN_AXI2APB_15_BASE 0x76000 +#define CBB_SN_AXI2APB_16_BASE 0x77000 +#define CBB_SN_AXI2APB_17_BASE 0x78000 +#define CBB_SN_AXI2APB_18_BASE 0x79000 +#define CBB_SN_AXI2APB_19_BASE 0x7A000 +#define CBB_SN_AXI2APB_2_BASE 0x7B000 +#define CBB_SN_AXI2APB_20_BASE 0x7C000 +#define CBB_SN_AXI2APB_21_BASE 0x7D000 +#define CBB_SN_AXI2APB_22_BASE 0x7E000 +#define CBB_SN_AXI2APB_23_BASE 0x7F000 +#define CBB_SN_AXI2APB_24_BASE 0x80000 +#define CBB_SN_AXI2APB_25_BASE 0x81000 +#define CBB_SN_AXI2APB_26_BASE 0x82000 +#define CBB_SN_AXI2APB_27_BASE 0x83000 +#define CBB_SN_AXI2APB_28_BASE 0x84000 +#define CBB_SN_AXI2APB_29_BASE 0x85000 +#define CBB_SN_AXI2APB_30_BASE 0x86000 +#define CBB_SN_AXI2APB_4_BASE 0x87000 +#define CBB_SN_AXI2APB_5_BASE 0x88000 +#define CBB_SN_AXI2APB_6_BASE 0x89000 +#define CBB_SN_AXI2APB_7_BASE 0x8A000 +#define CBB_SN_AXI2APB_8_BASE 0x8B000 +#define CBB_SN_AXI2APB_9_BASE 0x8C000 +#define CBB_SN_AXI2APB_3_BASE 0x8D000 + +#define SLAVE_LOOKUP(sn) #sn, sn + +static struct tegra_sn_addr_map tegra_grace_bpmp_sn_lookup[] = { + { "RSVD", 0 }, + { "RSVD", 0 }, + { SLAVE_LOOKUP(BPMP_SN_CBB_T_BASE) }, + { SLAVE_LOOKUP(BPMP_SN_CPU_T_BASE) }, + { SLAVE_LOOKUP(BPMP_SN_AXI2APB_1_BASE) }, + { SLAVE_LOOKUP(BPMP_SN_DBB0_T_BASE) }, + { SLAVE_LOOKUP(BPMP_SN_DBB1_T_BASE) } +}; + +static struct tegra_sn_addr_map tegra_grace_cbb_sn_lookup[] = { + { SLAVE_LOOKUP(CBB_SN_PCIE_C8_BASE) }, + { SLAVE_LOOKUP(CBB_SN_PCIE_C9_BASE) }, + { "RSVD", 0 }, + { "RSVD", 0 }, + { "RSVD", 0 }, + { "RSVD", 0 }, + { "RSVD", 0 }, + { "RSVD", 0 }, + { "RSVD", 0 }, + { "RSVD", 0 }, + { SLAVE_LOOKUP(CBB_SN_AON_SLAVE_BASE) }, + { SLAVE_LOOKUP(CBB_SN_BPMP_SLAVE_BASE) }, + { "RSVD", 0 }, + { "RSVD", 0 }, + { SLAVE_LOOKUP(CBB_SN_PSC_SLAVE_BASE) }, + { SLAVE_LOOKUP(CBB_SN_STM_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_1_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_10_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_11_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_12_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_13_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_14_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_15_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_16_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_17_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_18_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_19_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_2_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_20_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_4_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_5_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_6_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_7_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_8_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_9_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_3_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_21_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_22_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_23_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_24_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_25_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_26_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_27_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_28_BASE) }, + { SLAVE_LOOKUP(CBB_SN_PCIE_C4_BASE) }, + { SLAVE_LOOKUP(CBB_SN_PCIE_C5_BASE) }, + { SLAVE_LOOKUP(CBB_SN_PCIE_C6_BASE) }, + { SLAVE_LOOKUP(CBB_SN_PCIE_C7_BASE) }, + { SLAVE_LOOKUP(CBB_SN_PCIE_C2_BASE) }, + { SLAVE_LOOKUP(CBB_SN_PCIE_C3_BASE) }, + { SLAVE_LOOKUP(CBB_SN_PCIE_C0_BASE) }, + { SLAVE_LOOKUP(CBB_SN_PCIE_C1_BASE) }, + { SLAVE_LOOKUP(CBB_SN_CCPLEX_SLAVE_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_29_BASE) }, + { SLAVE_LOOKUP(CBB_SN_AXI2APB_30_BASE) } +}; -- 2.17.1