Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4790534iob; Mon, 9 May 2022 01:30:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnSsRujcaw9pWCI93DEV+9Igsu58EI4vsT2yG5u12xVmlw/SfueHESCWUuenoTs9ooMzFP X-Received: by 2002:a05:6a00:10cc:b0:4fe:3f1c:2d1 with SMTP id d12-20020a056a0010cc00b004fe3f1c02d1mr15324635pfu.0.1652085051263; Mon, 09 May 2022 01:30:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652085051; cv=pass; d=google.com; s=arc-20160816; b=cz32GLovB+Iq9n1R67yyDB8TPf7CqyHWlN+NCpykrm3ZhDVCNabcLMintipGk5ZjSb St3ApQ3jfiXwjO+yWsP1hP4GuceAUno+pnBb+m2C2lA6BmxF/zqsI9Rp4NgRRihTjLud IpHQ5EMkK1ognc+Yao0fFZuVo+9Rd2qvZCf3suIlemN6JyAjhR5aIM6F8ehee7f64y0z Ug2dKdYV1GocjI5fmDefTPRBFJaWbezO9osllXmC9ELeHeslAJ7bO/+ZkNxsY6j3iUX+ xPUp+P2pIO9H61V2fnKbVYI6ARgc25KBK2bwvIRRAxioX2NItDxp+fx6doA30ylkqqr8 st7Q== 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=cxwQx15yfYaHq4bDjHNhn9lRY8pLFCupMyO3VFKQLEQ=; b=NlYhItqoWAhctnmlSh17gs/Lv4tqck78befEXL34hnDwPCALpUEH8lIw3vlC6+VFZ2 ATAGcEXa7fpRGCYOzHopbUKDiIPEOGCQwbDSsZnQ9JAHzPXmFCegpQxeJcrMm5On2kcn OSL4FKBo425y44YEzXKxN+5JWF1Vz8VpBVDdBW7WjN/FbL4nngw5mvZ/vuVDX4x2lJ0D P5nJBjlm3GcpQiY8k5hJg3KYn5IySRyIi3NIBPYA8Ey5/HxvOLtzmr209bPxiIRq3oH+ FpSQ3t+YuPViPPhgRFKP9u+ulKVb+iaU7t66VRu8YjgSvY4mVLZ2plTQTfZRaUoy3Fvc 2y1A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=DaDo1sxC; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a22-20020aa794b6000000b004fa3a8e0053si11568515pfl.266.2022.05.09.01.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 01:30:51 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=DaDo1sxC; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 965541C1957; Mon, 9 May 2022 01:16:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235175AbiEFLQZ (ORCPT + 99 others); Fri, 6 May 2022 07:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352587AbiEFLQV (ORCPT ); Fri, 6 May 2022 07:16:21 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2075.outbound.protection.outlook.com [40.107.223.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E92F5562F7; Fri, 6 May 2022 04:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XiambIxHqASkxIUdpkCzeNGNAS2IXv+l9VDZL31DZPBY5S0Au9n1NpO7yVCwJ3x5ePhS2/KqD0+aVNvzbqyzm7ecEQH2cMwnKZM3OVbv86ZrMFSrJBbfFVr+kfH9RKFvtxtcpi83iFQacXMdt2f5Lb2vV/y7TLFK9FBFxk/2X9bJcGWlQ22XbijQyh7TPy+Wd3+5RRL39ogEG8GZgtgvyL+cBPNoEjFB/URqa3kvYkPRGP8wiX+qsoVJD2Qgw/LSNdfbItDqyMtpci4Qtu3PLptccstpl71RTC+Ph2kH1cZW2gqZAMk0u61Rvadj48QmZuI+IaqmqoGvhsxoJc2RIA== 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=cxwQx15yfYaHq4bDjHNhn9lRY8pLFCupMyO3VFKQLEQ=; b=azYoepj2HB61B3gdbYxq3rXd0/oUu4iA2hFAu6c58WFhWIa/vTVDNdPuAyToQP/hgchUv+qjaLOg1d/LogAdkyB3iX4Y8zZWa30Gb0K8b156Giyiu6LLL9JgKGTzExjVY63xZ42blH290hswuU2Z1dCNJCr8ei5EiP20UrGnVew/oWqjyQTF1P5jS0Piraph8gcd+zp3xRBYl/JWulQ7UgRAw8NfNwXLPBYoUvj2yoWj03jU7HxP21ej3E5NC+wZEkVk/k4qg7wXhT9S7jlObV8Hv37SSDktAXiSlPbb4NClqvb36LDHxJFnMBcJMFsYlbB4hEUPcwTD8FgniqGLuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) 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=cxwQx15yfYaHq4bDjHNhn9lRY8pLFCupMyO3VFKQLEQ=; b=DaDo1sxC+oU8tgxOSpelZwb9R9R0zHmCCnkTb4+fB2wy4wVpCx62zggpCOiiD8AT2+BSIyKX5bIhAfq1cZAxMoMvFg4oPHa0qdoSehKu7toVO4kDv1dsffVFk0uZEU/87q2HamUZG3fQP3vuGEXhnEsbka1V59vOV4Iz6xdFEZh8+oLUQ1VARXfdR7IuLEhBKgykxiA4dTd8kfgZdqj/phIyEXhCz7il2qBDdK9ERErDgcT7sVMkNvP9+8eyxrPHs+hZahaZ9pA60Ee+qNZJpepzVxHVvczMArRV2OIFotvqsiq6QRrcesecr3EbQcQBOLoho8aGv0XDmH20HtiIsw== Received: from DS7PR03CA0149.namprd03.prod.outlook.com (2603:10b6:5:3b4::34) by DM5PR12MB1354.namprd12.prod.outlook.com (2603:10b6:3:7a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Fri, 6 May 2022 11:12:36 +0000 Received: from DM6NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b4:cafe::1d) by DS7PR03CA0149.outlook.office365.com (2603:10b6:5:3b4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Fri, 6 May 2022 11:12:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.235) by DM6NAM11FT037.mail.protection.outlook.com (10.13.172.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5227.15 via Frontend Transport; Fri, 6 May 2022 11:12:36 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 6 May 2022 11:12:32 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 6 May 2022 04:12:31 -0700 Received: from sumitg-l4t.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Fri, 6 May 2022 04:12:28 -0700 From: Sumit Gupta To: , , , , , , CC: , , , Subject: [Patch v5 1/9] soc: tegra: set ERD bit to mask inband errors Date: Fri, 6 May 2022 16:42:09 +0530 Message-ID: <20220506111217.8833-2-sumitg@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506111217.8833-1-sumitg@nvidia.com> References: <20220506111217.8833-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: e98f8a77-a5ab-4872-a644-08da2f515347 X-MS-TrafficTypeDiagnostic: DM5PR12MB1354: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: pu88w0L+Q8Au66bzRFx5oQz+A/ynoEev7XkZRSovlX7zwGY8VKyhDe1cBL6lb4wFWy88OqEFkbVH6N0pkkAlbibnh3bOhWORkxkilTpBvzAZ/993Y7sJMoH7Gl6yjNpwpQsryPeT7gx22ErZnyzTV0S1cL3R20mCZWv8m4/wA/jExraoJjswsaHVGy8NCwQEp5Xm5UIaThO/fL/DJhzbUqqW8+JwJyo8bq8waznqA6gfXvQRn7qHTowKUvF9dmq2tNFghNNukP1O9lulfVtAEjH82vsw3gLmuxP5b5vlEbOO87YrIBiAvcT7eXEN01NWBs8MxvvXCUllwj8cC/EQQmjssrPUXc0Gmwag0y63AuD+ec/j8YTuDx+kOLh9M7Vk+JUIvg7mDkcnx+50TrlP4qH0ajBX9/6iJ0Yj2sd0io5bt0RkOpiJnJBapbv9Jl8oPn1cv0LS6s6fYpc5Y9bZafuoHCGTb+MCBI5F/drvQKinUw45fSYGEXBnI7kBcwQXRAPTfO0G7vqWpcKuOw8J3zFvHj+sRy9hHGcgbYzUCgdVJv5jtXNeH6zWbbhOzy5lhSMLGmiCjmwvQ2g2enO2QAHiJGDRwVKZCfyPvN7IzZfUh8kRsgn87JSPAL0VzwrwcCnRKoolrz3ieI0dXVA9AJNd8UrPJN2XpJW3f/O0jvTr+jUVqgU8emCG8Q1dWoEbGDuiIMJgHPZzYV62ylb+ZQ== X-Forefront-Antispam-Report: CIP:12.22.5.235;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(70586007)(4326008)(8936002)(70206006)(356005)(6666004)(7696005)(2906002)(8676002)(36860700001)(81166007)(5660300002)(508600001)(2616005)(83380400001)(107886003)(36756003)(47076005)(426003)(186003)(336012)(82310400005)(1076003)(54906003)(110136005)(40460700003)(86362001)(26005)(316002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2022 11:12:36.1001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e98f8a77-a5ab-4872-a644-08da2f515347 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.235];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1354 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Add function to set Error Response Disable bit in MISCREG_CCROC_ERR_CONFIG register from the Control Backbone(CBB) error handler driver. ERD bit allows masking of SError due to inband errors which are caused by illegal register accesses through CBB. When the bit is set, interrupt is used for reporting errors and magic code '0xdead2003' is returned. This change is only required for Tegra194 SOC as the config is moved to CBB register space for future SOC's. Also, remove unmapping the apbmisc_base as it's required to get the base address for accessing the misc register. Signed-off-by: Sumit Gupta --- drivers/soc/tegra/fuse/tegra-apbmisc.c | 29 ++++++++++++++++++++++++-- include/soc/tegra/fuse.h | 6 ++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c index 590c862538d0..de833f8d2408 100644 --- a/drivers/soc/tegra/fuse/tegra-apbmisc.c +++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c @@ -16,12 +16,16 @@ #define FUSE_SKU_INFO 0x10 +#define ERD_ERR_CONFIG 0x120c +#define ERD_MASK_INBAND_ERR 0x1 + #define PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT 4 #define PMC_STRAPPING_OPT_A_RAM_CODE_MASK_LONG \ (0xf << PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT) #define PMC_STRAPPING_OPT_A_RAM_CODE_MASK_SHORT \ (0x3 << PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT) +static void __iomem *apbmisc_base; static bool long_ram_code; static u32 strapping; static u32 chipid; @@ -93,6 +97,28 @@ u32 tegra_read_ram_code(void) } EXPORT_SYMBOL_GPL(tegra_read_ram_code); +/* + * The function sets ERD(Error Response Disable) bit. + * This allows to mask inband errors and always send an + * OKAY response from CBB to the master which caused error. + */ +int tegra194_miscreg_mask_serror(void) +{ + if (!apbmisc_base) + return -EPROBE_DEFER; + + if (!of_machine_is_compatible("nvidia,tegra194")) { + WARN(1, "Only supported for Tegra194 devices!\n"); + return -EOPNOTSUPP; + } + + writel_relaxed(ERD_MASK_INBAND_ERR, + apbmisc_base + ERD_ERR_CONFIG); + + return 0; +} +EXPORT_SYMBOL(tegra194_miscreg_mask_serror); + static const struct of_device_id apbmisc_match[] __initconst = { { .compatible = "nvidia,tegra20-apbmisc", }, { .compatible = "nvidia,tegra186-misc", }, @@ -134,7 +160,7 @@ void __init tegra_init_revision(void) void __init tegra_init_apbmisc(void) { - void __iomem *apbmisc_base, *strapping_base; + void __iomem *strapping_base; struct resource apbmisc, straps; struct device_node *np; @@ -196,7 +222,6 @@ void __init tegra_init_apbmisc(void) pr_err("failed to map APBMISC registers\n"); } else { chipid = readl_relaxed(apbmisc_base + 4); - iounmap(apbmisc_base); } strapping_base = ioremap(straps.start, resource_size(&straps)); diff --git a/include/soc/tegra/fuse.h b/include/soc/tegra/fuse.h index 67d2bc856fbc..977c334136e9 100644 --- a/include/soc/tegra/fuse.h +++ b/include/soc/tegra/fuse.h @@ -58,6 +58,7 @@ u32 tegra_read_chipid(void); u8 tegra_get_chip_id(void); u8 tegra_get_platform(void); bool tegra_is_silicon(void); +int tegra194_miscreg_mask_serror(void); #else static struct tegra_sku_info tegra_sku_info __maybe_unused; @@ -95,6 +96,11 @@ static inline bool tegra_is_silicon(void) { return false; } + +static inline int tegra194_miscreg_mask_serror(void) +{ + return false; +} #endif struct device *tegra_soc_device_register(void); -- 2.17.1