From patchwork Fri Apr 29 11:34:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashish Mhetre X-Patchwork-Id: 1624200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=ddfPicAX; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4KqVlc29Y0z9sBB for ; Fri, 29 Apr 2022 21:35:08 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358536AbiD2LiW (ORCPT ); Fri, 29 Apr 2022 07:38:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358560AbiD2LiU (ORCPT ); Fri, 29 Apr 2022 07:38:20 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2062.outbound.protection.outlook.com [40.107.95.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3751DBF52E; Fri, 29 Apr 2022 04:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lcu1T6z0SxMmt+JiH81AQ2yw1BQ5myMZvYKNMRR+vVdBFcvj9WqyxkgAc5OF3szDCeNpAeIeCCZ9siZpVOMhiXogeTKY85XjAckzySFU+eCOGplYM931EaNvpwynAA8hLakb7W6Im7lLF30D1ssB4VRT+1BPCDoHGxybI26UhmhIhKzmFDlaFtG+jdNWhYPiuPLHZy3dv3WYekjc1YYoxuEVUX72ss1g5asCre373y51dzAjfNcjuH5hzRZtXmBt7FlcTz5Jju4VkV6lXAnoNJ2NuZtSmk1nyC4t2kmDymcDdIalrMWIrCBJsTtr6Cb+q7H8DmUMq2vg9aAXJhBJ8A== 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=XkTSpj8sk7U5I1jwmlzm2tluwv9J9oIwOQjyZTXC1To=; b=Oup660UJZ4oTCb4IlkzvZUhuwG2yiM2aSxQQukPbdxydwLd2Lp40BaThzozjrkzLc4Ya+OupcgxoyFmSblOzDklwkWtabKevgd25s3jCdUvm7z0jlgl6v0l/RyS763UOIIWLVfmDTljJjf9wVGQX/jvQeollfYjEauGpNwTmJSPBcv+mBVa7WLwqKXrx4EclsZ/Bpk60awrjlF2DzOSU5W3r2DtSJDiUHKZMfPnwaRFtDUVQwi9O4LeAn2GO18v2Mw2J3gfVKgVCKLphXqkshvHo3xqb9DqSSmBD5Wk5G77SpVGGOwPByRTGo4m+myTd8UCQdgF3w8EKjbcKJ3ac/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=vger.kernel.org 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=XkTSpj8sk7U5I1jwmlzm2tluwv9J9oIwOQjyZTXC1To=; b=ddfPicAX8d/o01nw8BBz3ym85HelY+Kieo+ccq8c7JdbrdTYxIOfPpRd5B0Csvh3kyaDnlsKM7gHocpXlku/Ln1P9n5MrmnjeK4CvDKwJJwTdav17jpGa5Vs7fuzk+pN+1yNt0Ln7MUUWul5TACxLZ+WzqmVLOchtXmRhTUTTYRwn/QajS5HgSC+sAqQ/D3OmI1+6/H2JKSxj5Ea1ihmvgPruhHR14/BhYfHzgL8nWVJStK1lkwiam0D0aONo92bJ1TWj3XpezFtzR50zgobA4jEkyq8MaiFdo4oSo7S5xHlle7EAFs0POatrBvFkw0hOjVL8ujcA5Jrp7jpTDn5Dw== Received: from DS7PR07CA0017.namprd07.prod.outlook.com (2603:10b6:5:3af::14) by LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.20; Fri, 29 Apr 2022 11:34:54 +0000 Received: from DM6NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::35) by DS7PR07CA0017.outlook.office365.com (2603:10b6:5:3af::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13 via Frontend Transport; Fri, 29 Apr 2022 11:34:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT033.mail.protection.outlook.com (10.13.172.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5206.12 via Frontend Transport; Fri, 29 Apr 2022 11:34:54 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 29 Apr 2022 11:34:53 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 29 Apr 2022 04:34:52 -0700 Received: from amhetre.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Fri, 29 Apr 2022 04:34:48 -0700 From: Ashish Mhetre To: , , , , , , , , , CC: , , Ashish Mhetre Subject: [Patch v10 1/4] memory: tegra: Add memory controller channels support Date: Fri, 29 Apr 2022 17:04:35 +0530 Message-ID: <20220429113438.13988-2-amhetre@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220429113438.13988-1-amhetre@nvidia.com> References: <20220429113438.13988-1-amhetre@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1dda27c2-420f-43c3-1a79-08da29d4480f X-MS-TrafficTypeDiagnostic: LV2PR12MB5990: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: eWlS3rBl46gL0ZsAKQ9Df+tdMTXU2VZWmr9VYpM6ZMygJwZdJQsapnEfPOBKfvjYjXGuBil5SsZBhnoifoaKnmO+LUkhtOasM1AQiERnN5RQFV0yoAOL+C6vazUmx1+9fzuA8GIcMOTm1H/ReHmlwV/J7//aYWGx/00z+0tkgLZOhM03PI3aax79CRJ9zKVO2GlwMBGmVtS5wIjFPuvYe2JMY8e2bRtU4lxhkIOEFMH3XEyyUEIO87wqzLCxA7CYKDzEOMgffk/H2cHHmMHXoi82GYYNz8NEu0telgzSGwuN58NmwMgf8aJXfcLCvrEGI4QuZ8cKDAMJlUJveHYEDTCLIzI7dlcscfwwyQQRo/AoxwFBVD7pIhj6pgzXtr4OA8Mu5SE5IGFzpmn2HL5V74QzITDe4PYGOjFbyzDtBAX+3gIDJ3lgHEf3A8JcuFFUn0gNIEw7TR1kGAJZ5e2MVKFvoquvMC6V0xWhRFGIf2Q3Q6DTAItPGA9MeXP2bOw8zF5sXMMdeU4rJXUntRqCvscQ8FO87JQcC5T3cDmw4RJX3bKBqzWQ65wCR185rVObbabUTmDvoOHKlZH8rccD9qfEeibd9PmD6cyxw/IYpY98JZjv+e+Jo+Ga9VNDtj1ETQuqKq6iQHudDeHhBAEemnALC9gugFJNDSjWoiM0/wDBn2lWwNemppAtxkNfhaz5kupMzncmtxzN1hUK4D0y024wg+tlh5MRsHZ3ItpGJKs= X-Forefront-Antispam-Report: CIP:12.22.5.238;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(7696005)(26005)(70586007)(70206006)(8676002)(82310400005)(54906003)(4326008)(2616005)(316002)(6666004)(107886003)(40460700003)(36860700001)(86362001)(110136005)(426003)(47076005)(336012)(1076003)(186003)(508600001)(81166007)(356005)(921005)(83380400001)(36756003)(2906002)(8936002)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2022 11:34:54.4007 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1dda27c2-420f-43c3-1a79-08da29d4480f 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.238];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5990 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 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-tegra@vger.kernel.org From tegra186 onwards, memory controller support multiple channels. Add support for mapping address spaces of these channels. Add number of channels supported by tegra186, tegra194 and tegra234. In case of old bindings, channels won't be present. If channels are not present then print warning and continue so that backward compatibility will be preserved in driver. During error interrupts from memory controller, appropriate registers from these channels need to be accessed for logging error info. Signed-off-by: Ashish Mhetre Reviewed-by: Dmitry Osipenko --- drivers/memory/tegra/tegra186.c | 28 ++++++++++++++++++++++++++++ drivers/memory/tegra/tegra194.c | 1 + drivers/memory/tegra/tegra234.c | 1 + include/soc/tegra/mc.h | 3 +++ 4 files changed, 33 insertions(+) diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c index 3d153881abc1..cd7f9079312f 100644 --- a/drivers/memory/tegra/tegra186.c +++ b/drivers/memory/tegra/tegra186.c @@ -48,8 +48,35 @@ static void tegra186_mc_program_sid(struct tegra_mc *mc) static int tegra186_mc_probe(struct tegra_mc *mc) { + struct platform_device *pdev = to_platform_device(mc->dev); + unsigned int i; int err; + mc->bcast_ch_regs = devm_platform_ioremap_resource_byname(pdev, "broadcast"); + if (IS_ERR(mc->bcast_ch_regs)) { + if (PTR_ERR(mc->bcast_ch_regs) == -EINVAL) { + dev_warn(&pdev->dev, "Broadcast channel is missing, please update your device-tree\n"); + mc->bcast_ch_regs = NULL; + goto skip_map_regs; + } + return PTR_ERR(mc->bcast_ch_regs); + } + + mc->ch_regs = devm_kcalloc(mc->dev, mc->soc->num_channels, + sizeof(*mc->ch_regs), GFP_KERNEL); + if (!mc->ch_regs) + return -ENOMEM; + + for (i = 0; i < mc->soc->num_channels; i++) { + char name[5]; + + snprintf(name, sizeof(name), "ch%u", i); + mc->ch_regs[i] = devm_platform_ioremap_resource_byname(pdev, name); + if (IS_ERR(mc->ch_regs[i])) + return PTR_ERR(mc->ch_regs[i]); + } + +skip_map_regs: err = of_platform_populate(mc->dev->of_node, NULL, NULL, mc->dev); if (err < 0) return err; @@ -875,6 +902,7 @@ const struct tegra_mc_soc tegra186_mc_soc = { .num_clients = ARRAY_SIZE(tegra186_mc_clients), .clients = tegra186_mc_clients, .num_address_bits = 40, + .num_channels = 4, .ops = &tegra186_mc_ops, }; #endif diff --git a/drivers/memory/tegra/tegra194.c b/drivers/memory/tegra/tegra194.c index cab998b8bd5c..94001174deaf 100644 --- a/drivers/memory/tegra/tegra194.c +++ b/drivers/memory/tegra/tegra194.c @@ -1347,5 +1347,6 @@ const struct tegra_mc_soc tegra194_mc_soc = { .num_clients = ARRAY_SIZE(tegra194_mc_clients), .clients = tegra194_mc_clients, .num_address_bits = 40, + .num_channels = 16, .ops = &tegra186_mc_ops, }; diff --git a/drivers/memory/tegra/tegra234.c b/drivers/memory/tegra/tegra234.c index e22824a79f45..6335a132be2d 100644 --- a/drivers/memory/tegra/tegra234.c +++ b/drivers/memory/tegra/tegra234.c @@ -97,5 +97,6 @@ const struct tegra_mc_soc tegra234_mc_soc = { .num_clients = ARRAY_SIZE(tegra234_mc_clients), .clients = tegra234_mc_clients, .num_address_bits = 40, + .num_channels = 16, .ops = &tegra186_mc_ops, }; diff --git a/include/soc/tegra/mc.h b/include/soc/tegra/mc.h index 1066b1194a5a..40f1d02a1358 100644 --- a/include/soc/tegra/mc.h +++ b/include/soc/tegra/mc.h @@ -194,6 +194,7 @@ struct tegra_mc_soc { unsigned int atom_size; u8 client_id_mask; + u8 num_channels; const struct tegra_smmu_soc *smmu; @@ -212,6 +213,8 @@ struct tegra_mc { struct tegra_smmu *smmu; struct gart_device *gart; void __iomem *regs; + void __iomem *bcast_ch_regs; + void __iomem **ch_regs; struct clk *clk; int irq; From patchwork Fri Apr 29 11:34:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashish Mhetre X-Patchwork-Id: 1624201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=OSkLOc4n; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4KqVlv2XjJz9s0r for ; Fri, 29 Apr 2022 21:35:23 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358542AbiD2Lih (ORCPT ); Fri, 29 Apr 2022 07:38:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358539AbiD2Li0 (ORCPT ); Fri, 29 Apr 2022 07:38:26 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2053.outbound.protection.outlook.com [40.107.243.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 426B2C6671; Fri, 29 Apr 2022 04:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KKf7WGNhTSTVoL9BZbQ8OI6UNWrWnqvKrer7bK5aY7bnn4eW0UpdJ/iKBRAo2yBn7MxK/CJKJVTCnlcTu297t0qpXhLUbFvLFe+DwHVAQSyXSkl3fVPv5W/UwSvHY2MeW9WE6dSlcO3T+zG+c4VxMslgmjgE0LiSwGMjzIIPEygMYnrSjCeHHGhKXoqtSeMZCeswCsv7XxCmz+KKO3beTDckQkahlbH/UJfxY6F1iY1Fb/SZEO3668YnRCPMyH6affGCzoRP1RV0EL5XWdcKxbSphhOdAs5ppNVWY3miwg8CjVlFq4M69CqWpXBNSrk2/IemxpqiUfpi4GvPg8UjlA== 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=dS17vuFxD7r8auKrzCPU+ukn1xYBrROvLasdUlWT6lw=; b=jryrmsDU1sxE3YnUdk1Fex+N4t4hRxkb2vbC9W+B5kq2xFOa4vVxs+aLpuWT3WNczBWNXkIDA2e3R2Um+EgTBcm0ZFf0L4yuYvmJsYfRRvXeDvox+uJ9C9Mz7KyLyMv5L8EaDKLOVpZiUWsnMe4592h28lEw0MlYoyMKjXxgObnUGqUR3aP/kKAiJDXMTKkK/pyxomIQ7Ygdq2Gz2rRtweSA0FAJX6bViEkMBxKyK4dNmu1qAQtJXajnqQLS8qs5gmD5yIDs/k3+MG+1KJG3YYhgdqL4Y3nKKkAMNN3jlFgmc4xGEBfWnKyZpHFFTYGpLgF+0lu3p4KBYH4X8TeoUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=vger.kernel.org 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=dS17vuFxD7r8auKrzCPU+ukn1xYBrROvLasdUlWT6lw=; b=OSkLOc4nD2Hx9+8Y95BVHGMIFAs6XiI5ewlHiuh0uXVzrilQkO1QcoPpIFCQaxJ1X1zlbJuwbneCHnwORbC5vkjf2AYCsOe3WoU+yHlPSZK4ILcVsIDwH0cX7w6bcXV4lrrhLlBp/SkpiAH4JpRuHVmHF2D2+4PvJKcprYF0IGB39iTinRJ9Vtstr8LJjS73NG0DoIfOPS4nCzTGIMBDehSyiWmvVfhtR0X3XUAXY9GvFhw5Rh2ysDeCnx061qolgs9TvJMl06WDZQOJYNHi8eD2p3YzsiO/cPRSl+HXyjLWovBD7g+3L9kMGwxCJtDm8OAl9Ks2JfkgUGtHmvlSrg== Received: from MW4PR04CA0250.namprd04.prod.outlook.com (2603:10b6:303:88::15) by BN6PR1201MB0132.namprd12.prod.outlook.com (2603:10b6:405:4d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.17; Fri, 29 Apr 2022 11:34:59 +0000 Received: from CO1NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:303:88:cafe::16) by MW4PR04CA0250.outlook.office365.com (2603:10b6:303:88::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.14 via Frontend Transport; Fri, 29 Apr 2022 11:34:59 +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 CO1NAM11FT067.mail.protection.outlook.com (10.13.174.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5206.12 via Frontend Transport; Fri, 29 Apr 2022 11:34:58 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 29 Apr 2022 11:34:58 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 29 Apr 2022 04:34:57 -0700 Received: from amhetre.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Fri, 29 Apr 2022 04:34:53 -0700 From: Ashish Mhetre To: , , , , , , , , , CC: , , Ashish Mhetre Subject: [Patch v10 2/4] memory: tegra: Add MC error logging on tegra186 onward Date: Fri, 29 Apr 2022 17:04:36 +0530 Message-ID: <20220429113438.13988-3-amhetre@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220429113438.13988-1-amhetre@nvidia.com> References: <20220429113438.13988-1-amhetre@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 78a281f0-784c-4d53-57dc-08da29d44ab7 X-MS-TrafficTypeDiagnostic: BN6PR1201MB0132: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: slQVPkFs32U0ncoCX49aIVceQ3MzWZFBgBJ/dghH2NiCdhZJOVJzJo3y4t4LxOMMa/Ln171HJ9cOIX0AZ/s5OC2bcCUwi9Zqds2cj49mjoZIAEw5lAVFCmYzzAW6p/wmp+T7fwXbtheU4MNr0ve8P1pcvfuVP8ygS/lQMGNW0pyQ35IBeU4MYcjZPHrhGFOb7sXhXYJk5ZnP5uDKHf+EJxY8poZoiWAvxtbAo0GMTmPWbi4SsCIB8ZzDpy9xU0QJ760i9VDFqJ/MSavvkmHrd5OjWR1/PVmIeVw6g5wH4FSulDxSz5MEFSOqoe9FBoRkx9XuIsYcNWK2lFfMwWwPIH1IrWBH8JRygEtAQ3H1jtKy2aU45omwXbjMFWUu4JwWRHde1uNMJLzt+uxwRm4CLZNCZFN6aiTw6BXsqoPzBP6ZFSsena9jgOCu1Do1Ok1sllM2+vkhQLzSuxM0KIw9kWAyckoS22fWtCvqJsE9lsCeztam/df3FxKdI59+lVqKccWjhjml8OkcHRpHJt6cTJlrbvNitsvJFrZNEkbXxB2i4xE0UcuITmqtBh0zuUk1/0F7V5khflHayBGhF6tQTAZuC9y3QBlbD747NUnCQv1PWyikO0rzn/exQQLAHKIvUWY02j9Gq1ETNcRRPZ/Bb0SBjStVBesLpTEXcomtEcvawsMfkpRWDVEG+A+1jlxuE0dqzRqQopSaN7Ud7cRWSw32uoXjA3UaivCU8rA19kM= 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)(36840700001)(46966006)(40470700004)(8676002)(26005)(86362001)(2906002)(6666004)(7696005)(70206006)(70586007)(316002)(5660300002)(54906003)(81166007)(82310400005)(4326008)(36860700001)(921005)(356005)(110136005)(36756003)(47076005)(186003)(83380400001)(1076003)(2616005)(40460700003)(107886003)(336012)(30864003)(508600001)(426003)(8936002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2022 11:34:58.8275 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78a281f0-784c-4d53-57dc-08da29d44ab7 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: CO1NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0132 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 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-tegra@vger.kernel.org Add support for logging memory controller errors on tegra186, tegra194 and tegra234. On these SoCs, interrupts can occur on multiple channels. Add support required to read the status of interrupts across multiple channels, log and clear them. Also add new interrupts supported on these SoCs. Reviewed-by: Dmitry Osipenko Signed-off-by: Ashish Mhetre --- drivers/memory/tegra/mc.c | 134 ++++++++++++++++++++++++++++---- drivers/memory/tegra/mc.h | 43 +++++++++- drivers/memory/tegra/tegra186.c | 9 +++ drivers/memory/tegra/tegra194.c | 8 ++ drivers/memory/tegra/tegra234.c | 8 ++ include/soc/tegra/mc.h | 5 +- 6 files changed, 189 insertions(+), 18 deletions(-) diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c index 580e0987e5cd..2f7a58a9df1a 100644 --- a/drivers/memory/tegra/mc.c +++ b/drivers/memory/tegra/mc.c @@ -508,14 +508,54 @@ int tegra30_mc_probe(struct tegra_mc *mc) return 0; } -static irqreturn_t tegra30_mc_handle_irq(int irq, void *data) +const struct tegra_mc_ops tegra30_mc_ops = { + .probe = tegra30_mc_probe, + .handle_irq = tegra30_mc_handle_irq, +}; +#endif + +static int mc_global_intstatus_to_channel(const struct tegra_mc *mc, u32 status, + unsigned int *mc_channel) +{ + if ((status & mc->soc->ch_intmask) == 0) + return -EINVAL; + + *mc_channel = __ffs((status & mc->soc->ch_intmask) >> + mc->soc->global_intstatus_channel_shift); + + return 0; +} + +static u32 mc_channel_to_global_intstatus(const struct tegra_mc *mc, + unsigned int channel) +{ + return BIT(channel) << mc->soc->global_intstatus_channel_shift; +} + +irqreturn_t tegra30_mc_handle_irq(int irq, void *data) { struct tegra_mc *mc = data; + unsigned int bit, channel; unsigned long status; - unsigned int bit; - /* mask all interrupts to avoid flooding */ - status = mc_readl(mc, MC_INTSTATUS) & mc->soc->intmask; + if (mc->soc->num_channels) { + u32 global_status; + int err; + + global_status = mc_ch_readl(mc, MC_BROADCAST_CHANNEL, MC_GLOBAL_INTSTATUS); + err = mc_global_intstatus_to_channel(mc, global_status, &channel); + if (err < 0) { + dev_err_ratelimited(mc->dev, "unknown interrupt channel 0x%08x\n", + global_status); + return IRQ_NONE; + } + + /* mask all interrupts to avoid flooding */ + status = mc_ch_readl(mc, channel, MC_INTSTATUS) & mc->soc->intmask; + } else { + status = mc_readl(mc, MC_INTSTATUS) & mc->soc->intmask; + } + if (!status) return IRQ_NONE; @@ -523,18 +563,70 @@ static irqreturn_t tegra30_mc_handle_irq(int irq, void *data) const char *error = tegra_mc_status_names[bit] ?: "unknown"; const char *client = "unknown", *desc; const char *direction, *secure; + u32 status_reg, addr_reg; + u32 intmask = BIT(bit); phys_addr_t addr = 0; +#ifdef CONFIG_PHYS_ADDR_T_64BIT + u32 addr_hi_reg = 0; +#endif unsigned int i; char perm[7]; u8 id, type; u32 value; - value = mc_readl(mc, MC_ERR_STATUS); + switch (intmask) { + case MC_INT_DECERR_VPR: + status_reg = MC_ERR_VPR_STATUS; + addr_reg = MC_ERR_VPR_ADR; + break; + + case MC_INT_SECERR_SEC: + status_reg = MC_ERR_SEC_STATUS; + addr_reg = MC_ERR_SEC_ADR; + break; + + case MC_INT_DECERR_MTS: + status_reg = MC_ERR_MTS_STATUS; + addr_reg = MC_ERR_MTS_ADR; + break; + + case MC_INT_DECERR_GENERALIZED_CARVEOUT: + status_reg = MC_ERR_GENERALIZED_CARVEOUT_STATUS; + addr_reg = MC_ERR_GENERALIZED_CARVEOUT_ADR; + break; + + case MC_INT_DECERR_ROUTE_SANITY: + status_reg = MC_ERR_ROUTE_SANITY_STATUS; + addr_reg = MC_ERR_ROUTE_SANITY_ADR; + break; + + default: + status_reg = MC_ERR_STATUS; + addr_reg = MC_ERR_ADR; + +#ifdef CONFIG_PHYS_ADDR_T_64BIT + if (mc->soc->has_addr_hi_reg) + addr_hi_reg = MC_ERR_ADR_HI; +#endif + break; + } + + if (mc->soc->num_channels) + value = mc_ch_readl(mc, channel, status_reg); + else + value = mc_readl(mc, status_reg); #ifdef CONFIG_PHYS_ADDR_T_64BIT if (mc->soc->num_address_bits > 32) { - addr = ((value >> MC_ERR_STATUS_ADR_HI_SHIFT) & - MC_ERR_STATUS_ADR_HI_MASK); + if (addr_hi_reg) { + if (mc->soc->num_channels) + addr = mc_ch_readl(mc, channel, addr_hi_reg); + else + addr = mc_readl(mc, addr_hi_reg); + } else { + addr = ((value >> MC_ERR_STATUS_ADR_HI_SHIFT) & + MC_ERR_STATUS_ADR_HI_MASK); + } addr <<= 32; } #endif @@ -591,7 +683,10 @@ static irqreturn_t tegra30_mc_handle_irq(int irq, void *data) break; } - value = mc_readl(mc, MC_ERR_ADR); + if (mc->soc->num_channels) + value = mc_ch_readl(mc, channel, addr_reg); + else + value = mc_readl(mc, addr_reg); addr |= value; dev_err_ratelimited(mc->dev, "%s: %s%s @%pa: %s (%s%s)\n", @@ -600,17 +695,18 @@ static irqreturn_t tegra30_mc_handle_irq(int irq, void *data) } /* clear interrupts */ - mc_writel(mc, status, MC_INTSTATUS); + if (mc->soc->num_channels) { + mc_ch_writel(mc, channel, status, MC_INTSTATUS); + mc_ch_writel(mc, MC_BROADCAST_CHANNEL, + mc_channel_to_global_intstatus(mc, channel), + MC_GLOBAL_INTSTATUS); + } else { + mc_writel(mc, status, MC_INTSTATUS); + } return IRQ_HANDLED; } -const struct tegra_mc_ops tegra30_mc_ops = { - .probe = tegra30_mc_probe, - .handle_irq = tegra30_mc_handle_irq, -}; -#endif - const char *const tegra_mc_status_names[32] = { [ 1] = "External interrupt", [ 6] = "EMEM address decode error", @@ -622,6 +718,8 @@ const char *const tegra_mc_status_names[32] = { [12] = "VPR violation", [13] = "Secure carveout violation", [16] = "MTS carveout violation", + [17] = "Generalized carveout violation", + [20] = "Route Sanity error", }; const char *const tegra_mc_error_names[8] = { @@ -762,7 +860,11 @@ static int tegra_mc_probe(struct platform_device *pdev) WARN(!mc->soc->client_id_mask, "missing client ID mask for this SoC\n"); - mc_writel(mc, mc->soc->intmask, MC_INTMASK); + if (mc->soc->num_channels) + mc_ch_writel(mc, MC_BROADCAST_CHANNEL, mc->soc->intmask, + MC_INTMASK); + else + mc_writel(mc, mc->soc->intmask, MC_INTMASK); err = devm_request_irq(&pdev->dev, mc->irq, mc->soc->ops->handle_irq, 0, dev_name(&pdev->dev), mc); diff --git a/drivers/memory/tegra/mc.h b/drivers/memory/tegra/mc.h index 062886e94c04..bc01586b6560 100644 --- a/drivers/memory/tegra/mc.h +++ b/drivers/memory/tegra/mc.h @@ -43,7 +43,21 @@ #define MC_EMEM_ARB_OVERRIDE 0xe8 #define MC_TIMING_CONTROL_DBG 0xf8 #define MC_TIMING_CONTROL 0xfc - +#define MC_ERR_VPR_STATUS 0x654 +#define MC_ERR_VPR_ADR 0x658 +#define MC_ERR_SEC_STATUS 0x67c +#define MC_ERR_SEC_ADR 0x680 +#define MC_ERR_MTS_STATUS 0x9b0 +#define MC_ERR_MTS_ADR 0x9b4 +#define MC_ERR_ROUTE_SANITY_STATUS 0x9c0 +#define MC_ERR_ROUTE_SANITY_ADR 0x9c4 +#define MC_ERR_GENERALIZED_CARVEOUT_STATUS 0xc00 +#define MC_ERR_GENERALIZED_CARVEOUT_ADR 0xc04 +#define MC_GLOBAL_INTSTATUS 0xf24 +#define MC_ERR_ADR_HI 0x11fc + +#define MC_INT_DECERR_ROUTE_SANITY BIT(20) +#define MC_INT_DECERR_GENERALIZED_CARVEOUT BIT(17) #define MC_INT_DECERR_MTS BIT(16) #define MC_INT_SECERR_SEC BIT(13) #define MC_INT_DECERR_VPR BIT(12) @@ -78,6 +92,8 @@ #define MC_TIMING_UPDATE BIT(0) +#define MC_BROADCAST_CHANNEL ~0 + static inline u32 tegra_mc_scale_percents(u64 val, unsigned int percents) { val = val * percents; @@ -92,6 +108,30 @@ icc_provider_to_tegra_mc(struct icc_provider *provider) return container_of(provider, struct tegra_mc, provider); } +static inline u32 mc_ch_readl(const struct tegra_mc *mc, int ch, + unsigned long offset) +{ + if (!mc->bcast_ch_regs) + return 0; + + if (ch == MC_BROADCAST_CHANNEL) + return readl_relaxed(mc->bcast_ch_regs + offset); + + return readl_relaxed(mc->ch_regs[ch] + offset); +} + +static inline void mc_ch_writel(const struct tegra_mc *mc, int ch, + u32 value, unsigned long offset) +{ + if (!mc->bcast_ch_regs) + return; + + if (ch == MC_BROADCAST_CHANNEL) + writel_relaxed(value, mc->bcast_ch_regs + offset); + else + writel_relaxed(value, mc->ch_regs[ch] + offset); +} + static inline u32 mc_readl(const struct tegra_mc *mc, unsigned long offset) { return readl_relaxed(mc->regs + offset); @@ -156,6 +196,7 @@ extern const struct tegra_mc_ops tegra30_mc_ops; extern const struct tegra_mc_ops tegra186_mc_ops; #endif +irqreturn_t tegra30_mc_handle_irq(int irq, void *data); extern const char * const tegra_mc_status_names[32]; extern const char * const tegra_mc_error_names[8]; diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c index cd7f9079312f..949cb5ae95e3 100644 --- a/drivers/memory/tegra/tegra186.c +++ b/drivers/memory/tegra/tegra186.c @@ -16,6 +16,8 @@ #include #endif +#include "mc.h" + #define MC_SID_STREAMID_OVERRIDE_MASK GENMASK(7, 0) #define MC_SID_STREAMID_SECURITY_WRITE_ACCESS_DISABLED BIT(16) #define MC_SID_STREAMID_SECURITY_OVERRIDE BIT(8) @@ -171,6 +173,7 @@ const struct tegra_mc_ops tegra186_mc_ops = { .remove = tegra186_mc_remove, .resume = tegra186_mc_resume, .probe_device = tegra186_mc_probe_device, + .handle_irq = tegra30_mc_handle_irq, }; #if defined(CONFIG_ARCH_TEGRA_186_SOC) @@ -903,6 +906,12 @@ const struct tegra_mc_soc tegra186_mc_soc = { .clients = tegra186_mc_clients, .num_address_bits = 40, .num_channels = 4, + .client_id_mask = 0xff, + .intmask = MC_INT_DECERR_GENERALIZED_CARVEOUT | MC_INT_DECERR_MTS | + MC_INT_SECERR_SEC | MC_INT_DECERR_VPR | + MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM, .ops = &tegra186_mc_ops, + .ch_intmask = 0x0000000f, + .global_intstatus_channel_shift = 0, }; #endif diff --git a/drivers/memory/tegra/tegra194.c b/drivers/memory/tegra/tegra194.c index 94001174deaf..b2416ee3ac26 100644 --- a/drivers/memory/tegra/tegra194.c +++ b/drivers/memory/tegra/tegra194.c @@ -1348,5 +1348,13 @@ const struct tegra_mc_soc tegra194_mc_soc = { .clients = tegra194_mc_clients, .num_address_bits = 40, .num_channels = 16, + .client_id_mask = 0xff, + .intmask = MC_INT_DECERR_ROUTE_SANITY | + MC_INT_DECERR_GENERALIZED_CARVEOUT | MC_INT_DECERR_MTS | + MC_INT_SECERR_SEC | MC_INT_DECERR_VPR | + MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM, + .has_addr_hi_reg = true, .ops = &tegra186_mc_ops, + .ch_intmask = 0x00000f00, + .global_intstatus_channel_shift = 8, }; diff --git a/drivers/memory/tegra/tegra234.c b/drivers/memory/tegra/tegra234.c index 6335a132be2d..e23ebd421f17 100644 --- a/drivers/memory/tegra/tegra234.c +++ b/drivers/memory/tegra/tegra234.c @@ -98,5 +98,13 @@ const struct tegra_mc_soc tegra234_mc_soc = { .clients = tegra234_mc_clients, .num_address_bits = 40, .num_channels = 16, + .client_id_mask = 0x1ff, + .intmask = MC_INT_DECERR_ROUTE_SANITY | + MC_INT_DECERR_GENERALIZED_CARVEOUT | MC_INT_DECERR_MTS | + MC_INT_SECERR_SEC | MC_INT_DECERR_VPR | + MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM, + .has_addr_hi_reg = true, .ops = &tegra186_mc_ops, + .ch_intmask = 0x0000ff00, + .global_intstatus_channel_shift = 8, }; diff --git a/include/soc/tegra/mc.h b/include/soc/tegra/mc.h index 40f1d02a1358..47ce6d434427 100644 --- a/include/soc/tegra/mc.h +++ b/include/soc/tegra/mc.h @@ -193,12 +193,15 @@ struct tegra_mc_soc { unsigned int num_address_bits; unsigned int atom_size; - u8 client_id_mask; + u16 client_id_mask; u8 num_channels; const struct tegra_smmu_soc *smmu; u32 intmask; + u32 ch_intmask; + u32 global_intstatus_channel_shift; + bool has_addr_hi_reg; const struct tegra_mc_reset_ops *reset_ops; const struct tegra_mc_reset *resets; From patchwork Fri Apr 29 11:34:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashish Mhetre X-Patchwork-Id: 1624203 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=SuQ3f5rM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4KqVn40ZxLz9s0r for ; Fri, 29 Apr 2022 21:36:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239282AbiD2Lji (ORCPT ); Fri, 29 Apr 2022 07:39:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358588AbiD2Lii (ORCPT ); Fri, 29 Apr 2022 07:38:38 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2080.outbound.protection.outlook.com [40.107.223.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3C85C52; Fri, 29 Apr 2022 04:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hgAMyv4tOVoqWXljf6qEHWWtWVpIiW9wUeg3uyMOYXmlqsKCZTEhYhHcgrUsQ2Nm8SZiy3iz9mAkvw9De0HK3ikwMVQViqxFirsuTnaV+lKSSLAiSM9OvPVdF+oBQgV+Ywa0zjo7l/6qCrCW/DBBMb/c3VdA75JMUjgk2SFmKdb0T3KEnwhBPDzmy0vHt61ODZCCvkY6qq2CVLgERgHdZFLeFhjxXoZm6MrQMrlPyAeZKUcWyJP+2QBSs8/3VQAfh1xujqtkao6YpWg592zFgXJ6tjsiVjBH4NTF2T0/eSXqzkzJqqDufpdnfEpNrDTqXIN7ZKg0vQ8Aciw8vwISSw== 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=9j6AHf/6v3YOnTiAnNG7RrJ9xs4nUzKOlEFDhQxkt/c=; b=UI+GyzM94ttC3/NZN2cvtn/b4yjx/oFm/KqogDcOeMWfBjfYJaIs3h/XKF9WTytTjbWP7vmx+Jvv5NEpf5uD3/+piLckQAvQXbA0xoGZwCuXZvfW0cIuOL4rxRs2JJ9e5Hs6QXjjUTxHaSKFoIQ8+AgSpEj0bbIHqkqwViCKrb1Wgtt7sYPOtDNt+ncBV1YzfTVqHeP3shFMptyzuOTSPXfuDICQ1qSE4cec/jjfcmKAgP8g+XKsC7A0pLwUznbs6VlrvpZ0P8q4t1kaqhWFqZ9TL+/8tPy0u0UY8R1crfAUSN8jq0hDCXv30kURlbW4oVNz55Re+gNFra1oXwmd+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=vger.kernel.org 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=9j6AHf/6v3YOnTiAnNG7RrJ9xs4nUzKOlEFDhQxkt/c=; b=SuQ3f5rMsQ0CwwSZCl7MtzDyA79UIM0kodHwNxP8zGsNDKIQIXfrrBisJ1CTEfpVKOnmJWwcLrknH9BvEQnXYmCaagu3QU+heUL3+zImTh6wgmHOjYqKj+TD2eg1IrxwQeR/vKYkG/SdtoOqfex67UnJStqM5j9MuUVsmSJLzTboo+FhEGZpuu8YZpsAa4g9ppXHQELDfgK3NkmxJXEsJzaV0uSLvthcy6jWxisKdX0CvFbVAmfqNzuV+wsTl3uQ0VH5/hov86rrZDTfa/rX8oexiv41YqLdFzzBtpB5rcQu1TUiEGMq74XPjPTOSnceLNAIwvrjnL01tp93/bOJ4Q== Received: from BN0PR04CA0078.namprd04.prod.outlook.com (2603:10b6:408:ea::23) by MWHPR12MB1280.namprd12.prod.outlook.com (2603:10b6:300:12::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Fri, 29 Apr 2022 11:35:05 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ea:cafe::7) by BN0PR04CA0078.outlook.office365.com (2603:10b6:408:ea::23) 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, 29 Apr 2022 11:35:04 +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 BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5206.12 via Frontend Transport; Fri, 29 Apr 2022 11:35:04 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 29 Apr 2022 11:35:03 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 29 Apr 2022 04:35:02 -0700 Received: from amhetre.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Fri, 29 Apr 2022 04:34:57 -0700 From: Ashish Mhetre To: , , , , , , , , , CC: , , Ashish Mhetre Subject: [Patch v10 3/4] dt-bindings: memory: tegra: Update validation for reg and reg-names Date: Fri, 29 Apr 2022 17:04:37 +0530 Message-ID: <20220429113438.13988-4-amhetre@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220429113438.13988-1-amhetre@nvidia.com> References: <20220429113438.13988-1-amhetre@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0318f71f-72c3-41a3-70f7-08da29d44e2b X-MS-TrafficTypeDiagnostic: MWHPR12MB1280: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: GlOVTtsbYimHJdFiB/6OWqGCu6os/EFoqmy42L/fwRUatZgcO/DlZjcTcs3KGyN+Dtf0/wDKyr3vK0Rqp9f94fS0UIsGnmC3u7w5FOgFmabSCqvTcJgAy1E1UuTHS9oNODAURJZzejBPAoC8j9LRXyvLvY9YiyElTPCbdkcmiNC5WY7G9qZEOJgidKPa6lTCj5Lv4d5Emx0hXzjRRLdR6Bej5mg1cUKt2iDfVzKXbRLxxkSfJjwylk5uUC+yaXW7z9falxAYlAwdfB1BgJE22xXmMZlqNckXDz4v0N5uyVr12F7hArrGcBvPIk+GtheQTxqVrLJ4vn2R1USr6zQza8ixTMfLQxBh6suWQSjPec5eXAIuD84xZ0tzRiMgY51J0hG4V4xfv3/1blFotuwnScUFKqtSzI0mQXYvs4QEgbkC5wRYBfp4AyYhiD921h6gGhzOqbSJF7T4yPq504Y+Oag2ff0orSwLdWg+T/KwZl62wGAdCYtMMdfUXzGw3YmFq1NsTkcC6f5UX0YrtO9Yf7GJHUlpRUi4XM5ROq4yt7KeLAsLWIuwrqWC4v1bPMUJ1glJy+FlTO46mhql953Su52yO+R7slzVvzse3SkpSCV98mu4QjVz+LUuyUKsRyoh5eDApIzmXw/ZdpXFrr3swkbjz74TBlE2CYeTEJt2URfdrSTTW/11d/ZBcTBHHibiybFZb69tV5GEIAjHnrZK5cpUx+VKLF/eLi32FyeYOi8= 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)(40470700004)(46966006)(36840700001)(5660300002)(81166007)(82310400005)(107886003)(316002)(8936002)(426003)(2616005)(47076005)(36860700001)(26005)(70586007)(70206006)(83380400001)(508600001)(336012)(110136005)(36756003)(1076003)(15650500001)(4326008)(8676002)(6666004)(40460700003)(186003)(921005)(356005)(86362001)(7696005)(2906002)(54906003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2022 11:35:04.6059 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0318f71f-72c3-41a3-70f7-08da29d44e2b 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1280 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 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-tegra@vger.kernel.org From tegra186 onwards, memory controller support multiple channels. Reg items are updated with address and size of these channels. Tegra186 has overall 5 memory controller channels. Tegra194 and tegra234 have overall 17 memory controller channels each. There is 1 reg item for memory controller stream-id registers. So update the reg minItems and maxItems accordingly in tegra186 devicetree documentation. Also update validation for reg-names added for these corresponding reg items. ABI change due to new bindings is intended but backward compatibility is preserved in driver. Reviewed-by: Rob Herring Signed-off-by: Ashish Mhetre --- .../nvidia,tegra186-mc.yaml | 80 +++++++++++++++++-- 1 file changed, 74 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml index 13c4c82fd0d3..c7cfa6c2cd81 100644 --- a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml @@ -34,8 +34,12 @@ properties: - nvidia,tegra234-mc reg: - minItems: 1 - maxItems: 3 + minItems: 6 + maxItems: 18 + + reg-names: + minItems: 6 + maxItems: 18 interrupts: items: @@ -142,7 +146,18 @@ allOf: then: properties: reg: - maxItems: 1 + maxItems: 6 + description: 5 memory controller channels and 1 for stream-id registers + + reg-names: + maxItems: 6 + items: + - const: sid + - const: broadcast + - const: ch0 + - const: ch1 + - const: ch2 + - const: ch3 - if: properties: @@ -151,7 +166,30 @@ allOf: then: properties: reg: - minItems: 3 + minItems: 18 + description: 17 memory controller channels and 1 for stream-id registers + + reg-names: + minItems: 18 + items: + - const: sid + - const: broadcast + - const: ch0 + - const: ch1 + - const: ch2 + - const: ch3 + - const: ch4 + - const: ch5 + - const: ch6 + - const: ch7 + - const: ch8 + - const: ch9 + - const: ch10 + - const: ch11 + - const: ch12 + - const: ch13 + - const: ch14 + - const: ch15 - if: properties: @@ -160,13 +198,37 @@ allOf: then: properties: reg: - minItems: 3 + minItems: 18 + description: 17 memory controller channels and 1 for stream-id registers + + reg-names: + minItems: 18 + items: + - const: sid + - const: broadcast + - const: ch0 + - const: ch1 + - const: ch2 + - const: ch3 + - const: ch4 + - const: ch5 + - const: ch6 + - const: ch7 + - const: ch8 + - const: ch9 + - const: ch10 + - const: ch11 + - const: ch12 + - const: ch13 + - const: ch14 + - const: ch15 additionalProperties: false required: - compatible - reg + - reg-names - interrupts - "#address-cells" - "#size-cells" @@ -182,7 +244,13 @@ examples: memory-controller@2c00000 { compatible = "nvidia,tegra186-mc"; - reg = <0x0 0x02c00000 0x0 0xb0000>; + reg = <0x0 0x02c00000 0x0 0x10000>, /* MC-SID */ + <0x0 0x02c10000 0x0 0x10000>, /* Broadcast channel */ + <0x0 0x02c20000 0x0 0x10000>, /* MC0 */ + <0x0 0x02c30000 0x0 0x10000>, /* MC1 */ + <0x0 0x02c40000 0x0 0x10000>, /* MC2 */ + <0x0 0x02c50000 0x0 0x10000>; /* MC3 */ + reg-names = "sid", "broadcast", "ch0", "ch1", "ch2", "ch3"; interrupts = ; #address-cells = <2>; From patchwork Fri Apr 29 11:34:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashish Mhetre X-Patchwork-Id: 1624202 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=DWo26xkm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4KqVmS6sprz9s0r for ; Fri, 29 Apr 2022 21:35:52 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358560AbiD2LjI (ORCPT ); Fri, 29 Apr 2022 07:39:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358587AbiD2Lii (ORCPT ); Fri, 29 Apr 2022 07:38:38 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2086.outbound.protection.outlook.com [40.107.220.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 126325A098; Fri, 29 Apr 2022 04:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QENsONl9vL/J/ZVy4L5F8yrIFK5PJTj++h9wWXDPNte0CxSHcnsMjyjRdFgbjegxs2x2jpt4UO4K2OkEaslQQEAAvE9iydR7L8keigyoabeCssDmvSUS1ariKbDRQwqFgLHl3B2iKeXoeyHffScRzji70VI/fA/Kt0xcGmqOJJHTnGLMIcJTGBat3wpWbQ/S+Lxz5u9v4Pg18elfkggwzjZaM829DKiSeFSQu+5Cr3SH5FhAaXdSIkTqdB42Y1Qs/soES9dFrES8DUTp3gOPW6K7U5gxw98MsPMNHmQLo9QZOJXdVgaqa6oR28uaxi2ozySaCmg0jLNwOG7ZSRkQsA== 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=X+q/QsjJoAzSBSFFP5lgJZgrw9zQYt6YPu7xh1+ndPk=; b=RK3bvMAZHlfaZySv2XYO5hjSqEPAf2NFtBifNFC4h55an+3KsRTtcniNQxIvrVtbuRkNlBwOgeGeT8lNlf96AClNPbcP4n3MrqwMCcU8FlbYgRa/mcglCIVjgGF1bgS42yGbfXkFbNprZtbyxCJUKHw5wQUdnPCm8J9ooEoLD1GrBhK1KIO91rlTOsx+uyQLiO+DSjpqZFeccmCQrQM6h9q8ytiw9GCcMU81MiKVyktgsvLSwDC3OMNCxndqW5J/DzhR+4ZVWxL2XGZQXO+gUSS8hRsqaWFJuwprVjC35haOoibO9FV6X2x1x5oufdtK1b7bOox5jk0PudEM8V/QLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=vger.kernel.org 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=X+q/QsjJoAzSBSFFP5lgJZgrw9zQYt6YPu7xh1+ndPk=; b=DWo26xkmNjNH52G20VQQiWA82kKyo3LEf63ePMG2Z6R/aL4SY7c4OrgNUurdIq2Rcut1zjrMLJKFQjmTKmo7lHSEdHhgiqXrGzcIX416WMCGq75WxQ+rF5VqQ1Ay5s849L5S2ZclZlLrnjo+ysUc/bieVfA75IGV31Hxp3Z1sjHpFLMJ4raUK/vBe5pVc7sZdFH8wpAape++ccV3jx67hhbpk1DKi77+qEZQS6iFsrvF0aOg+/Ca3s6VcXwjuP382CkDMX/qnob2+/JwwHflRxko1KpDlMCo3FCTkziGo9JHrccRO2R2eboyhStO0s4DpHB8FCYOovmBkbOA5b+rAw== Received: from DM6PR13CA0019.namprd13.prod.outlook.com (2603:10b6:5:bc::32) by BL1PR12MB5729.namprd12.prod.outlook.com (2603:10b6:208:384::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Fri, 29 Apr 2022 11:35:09 +0000 Received: from DM6NAM11FT027.eop-nam11.prod.protection.outlook.com (2603:10b6:5:bc:cafe::8) by DM6PR13CA0019.outlook.office365.com (2603:10b6:5:bc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.6 via Frontend Transport; Fri, 29 Apr 2022 11:35:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by DM6NAM11FT027.mail.protection.outlook.com (10.13.172.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5206.12 via Frontend Transport; Fri, 29 Apr 2022 11:35:09 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 29 Apr 2022 11:35:08 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 29 Apr 2022 04:35:07 -0700 Received: from amhetre.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Fri, 29 Apr 2022 04:35:02 -0700 From: Ashish Mhetre To: , , , , , , , , , CC: , , Ashish Mhetre Subject: [Patch v10 4/4] arm64: tegra: Add memory controller channels Date: Fri, 29 Apr 2022 17:04:38 +0530 Message-ID: <20220429113438.13988-5-amhetre@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220429113438.13988-1-amhetre@nvidia.com> References: <20220429113438.13988-1-amhetre@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67f8fd5d-7060-48fe-265c-08da29d4511c X-MS-TrafficTypeDiagnostic: BL1PR12MB5729: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: bHvso1OeheVpd5xPBKwsSc2SOeKMg3J3GAfDdWMh8hf8yfNgeGbciydxiSbubCpcTvjTiATMpNPWOEHY9H7Y0hEQpQJcabqugqLPEFyuW4l+5E2Go7eTc4sVUznvTwdgQ9SGhZYCkLrPgtVD0PyhdtL52QN5WP+IUmudDvKgL7kmktcMEy3N8IRch+7jCciuZAKPG8GJBCnBbKQ/uMT8QQ1qYsh+mYsRcA9v7TuNy7dxlocJLpp65fpY1sE24k0M0mmEZQMTfzVLJDAgoAXIP6Syh+vzCz/+Znd4iSNgWfZcDGc8Vx8gJlgQOMaoQ1dAPZ5iZMr0KPNG6OhO+ytiPsOpN3H5jzvDcTzWI3DMLLeNbld0ce1huP/KZ2ig/ikVjC8Use4GATo+brHRW4rPsui8wvbHnHLlj2Av1OphssM1g8jknT+pTsPEBgSyzlfx5VDq61bPGid4zZStcckaN5d1IolyedZfts00Ceey3yfZ/DPM9213xgH2iW3oWNBzzjNZ6JTwFeX6Yz/lDAI1E0YmXnqtcwgN3gAyq0/NdwM7Ix1WEjk9bc1g3ks53Vbrgn3exqAUhM06JiFhBYuqNDcrmbW6z9QPL5Dmwk3K0HUgNieXFaXP3oFBy7pwrBleetvUHow+/dcIYNNkXjyo8hx5kchSYc2E6vtLd/bZam7lfXpwNXwW4EjZNxOh8Rn6lFUQxZf3rxVkwa9bkipXXISba25jZJ9mA4huliDUI/w= X-Forefront-Antispam-Report: CIP:12.22.5.234;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(86362001)(81166007)(508600001)(8676002)(54906003)(82310400005)(110136005)(7696005)(36860700001)(316002)(36756003)(70586007)(4326008)(70206006)(2906002)(26005)(186003)(5660300002)(1076003)(6666004)(40460700003)(426003)(47076005)(336012)(921005)(356005)(8936002)(83380400001)(2616005)(107886003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2022 11:35:09.5857 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67f8fd5d-7060-48fe-265c-08da29d4511c 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.234];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT027.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5729 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 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-tegra@vger.kernel.org From tegra186 onwards, memory controller support multiple channels. During the error interrupts from memory controller, corresponding channels need to be accessed for logging error info and clearing the interrupt. So add address and size of these channels in device tree node of tegra186, tegra194 and tegra234 memory controller. Also add reg-names for each of these reg items which are used by driver for mapping. Signed-off-by: Ashish Mhetre --- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 8 +++++++- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 24 +++++++++++++++++++++--- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 24 +++++++++++++++++++++--- 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi index 2e7faa1e0b9c..0e9afc3e2f26 100644 --- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi @@ -528,7 +528,13 @@ mc: memory-controller@2c00000 { compatible = "nvidia,tegra186-mc"; - reg = <0x0 0x02c00000 0x0 0xb0000>; + reg = <0x0 0x02c00000 0x0 0x10000>, /* MC-SID */ + <0x0 0x02c10000 0x0 0x10000>, /* Broadcast channel */ + <0x0 0x02c20000 0x0 0x10000>, /* MC0 */ + <0x0 0x02c30000 0x0 0x10000>, /* MC1 */ + <0x0 0x02c40000 0x0 0x10000>, /* MC2 */ + <0x0 0x02c50000 0x0 0x10000>; /* MC3 */ + reg-names = "sid", "broadcast", "ch0", "ch1", "ch2", "ch3"; interrupts = ; status = "disabled"; diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi index f9d343b24597..d1f8248c00f4 100644 --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi @@ -612,9 +612,27 @@ mc: memory-controller@2c00000 { compatible = "nvidia,tegra194-mc"; - reg = <0x02c00000 0x100000>, - <0x02b80000 0x040000>, - <0x01700000 0x100000>; + reg = <0x02c00000 0x10000>, /* MC-SID */ + <0x02c10000 0x10000>, /* MC Broadcast*/ + <0x02c20000 0x10000>, /* MC0 */ + <0x02c30000 0x10000>, /* MC1 */ + <0x02c40000 0x10000>, /* MC2 */ + <0x02c50000 0x10000>, /* MC3 */ + <0x02b80000 0x10000>, /* MC4 */ + <0x02b90000 0x10000>, /* MC5 */ + <0x02ba0000 0x10000>, /* MC6 */ + <0x02bb0000 0x10000>, /* MC7 */ + <0x01700000 0x10000>, /* MC8 */ + <0x01710000 0x10000>, /* MC9 */ + <0x01720000 0x10000>, /* MC10 */ + <0x01730000 0x10000>, /* MC11 */ + <0x01740000 0x10000>, /* MC12 */ + <0x01750000 0x10000>, /* MC13 */ + <0x01760000 0x10000>, /* MC14 */ + <0x01770000 0x10000>; /* MC15 */ + reg-names = "sid", "broadcast", "ch0", "ch1", "ch2", "ch3", + "ch4", "ch5", "ch6", "ch7", "ch8", "ch9", "ch10", + "ch11", "ch12", "ch13", "ch14", "ch15"; interrupts = ; #interconnect-cells = <1>; status = "disabled"; diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi index 71c21d7d0551..cb3af539e477 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi @@ -515,9 +515,27 @@ mc: memory-controller@2c00000 { compatible = "nvidia,tegra234-mc"; - reg = <0x02c00000 0x100000>, - <0x02b80000 0x040000>, - <0x01700000 0x100000>; + reg = <0x02c00000 0x10000>, /* MC-SID */ + <0x02c10000 0x10000>, /* MC Broadcast*/ + <0x02c20000 0x10000>, /* MC0 */ + <0x02c30000 0x10000>, /* MC1 */ + <0x02c40000 0x10000>, /* MC2 */ + <0x02c50000 0x10000>, /* MC3 */ + <0x02b80000 0x10000>, /* MC4 */ + <0x02b90000 0x10000>, /* MC5 */ + <0x02ba0000 0x10000>, /* MC6 */ + <0x02bb0000 0x10000>, /* MC7 */ + <0x01700000 0x10000>, /* MC8 */ + <0x01710000 0x10000>, /* MC9 */ + <0x01720000 0x10000>, /* MC10 */ + <0x01730000 0x10000>, /* MC11 */ + <0x01740000 0x10000>, /* MC12 */ + <0x01750000 0x10000>, /* MC13 */ + <0x01760000 0x10000>, /* MC14 */ + <0x01770000 0x10000>; /* MC15 */ + reg-names = "sid", "broadcast", "ch0", "ch1", "ch2", "ch3", + "ch4", "ch5", "ch6", "ch7", "ch8", "ch9", "ch10", + "ch11", "ch12", "ch13", "ch14", "ch15"; interrupts = ; #interconnect-cells = <1>; status = "okay";