From patchwork Sun Feb 11 17:17:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petlozu Pravareshwar X-Patchwork-Id: 199486 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2022883dyd; Sun, 11 Feb 2024 09:18:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVONOiYViUcYMEtk2Z+CiRPzNmFwPyauLw+M3j5oVTep+kjm98RY9mzv+XGr9Tb0nZ0JO3bGXMivLzATqUJsntFkmeFPA== X-Google-Smtp-Source: AGHT+IFSnC3FFUIcsKvZGaTQXjvGovkdK1AhpXeGDzwTDOp4FTsFFssP+ruxTvcy/tsjFXylbBkI X-Received: by 2002:a17:90b:205:b0:296:dc60:16cb with SMTP id fy5-20020a17090b020500b00296dc6016cbmr7717971pjb.24.1707671895390; Sun, 11 Feb 2024 09:18:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVGLts1tDh6I8O40O6QWfPVs+DFtIx+YEFr/PLgn9zWvq+1n5OYNJmVqkf0yNyOZT202HyIG4YG4tEkQAn/+78bzwNnhg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id om18-20020a17090b3a9200b0029707ee4cf7si5001154pjb.21.2024.02.11.09.18.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 09:18:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60877-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=IFTrqQjW; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-60877-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60877-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 453FAB2198E for ; Sun, 11 Feb 2024 17:18:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F9015CDF0; Sun, 11 Feb 2024 17:17:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="IFTrqQjW" Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2040.outbound.protection.outlook.com [40.107.92.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C6695C8E8; Sun, 11 Feb 2024 17:17:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707671874; cv=fail; b=OQ4a9hfxwqL/cjB8dOBGRtwgDyEWYfme96UhX4jzCfXzCATKfBTYB/CXEVClwMcsH/9wHLk9pUZCF0jHTXU0odm9DhBg9acTIqlq421tniUdtr2j+QWaeZG9qcPaVwoNu91TJjJqAimtqhsVPNyxALaOGYgFwwlobDKVC6p1OJg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707671874; c=relaxed/simple; bh=v/6kfZzCWHiNm5vC7FPHnuwBAam/D9ClaoYnW0ufOG0=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=VtdNehnLvhEGHMuwIopNO0EijSPlQCi5DaGB0olrv1VyPdyirHer6bsCLrzXu40O6bLHX8dxk9m94gZVaNW+rj75shpSewle9cAEs7ylvI9zbj2DNaam7rVIqhLEJIm0VX7qpEVc/P4NQc//iEIEjtW1IEdThZP6WSp0kr3ij7s= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=IFTrqQjW; arc=fail smtp.client-ip=40.107.92.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LcFgulJ3O4SH1Oq4GhFJEOfnDCSTQPusyj2xMfFu31ZgPL3dPj+rm7wzP9ufxUVDNyQ0RWoH95cJOkZWw/8srTuAcrm6bH0cwWjkJowPyu9ypwDRocSP/rFST65UAtHhc2PsrHfUeLaNTswZR2N8hMyTvHfnPeh37GxGKjND5qyhfQe4d1F3/f5blYzAGbq+sLbCX1eiPwMgn5pt1neDpIHKZbOhD33UX6L1fhfTav3zciVNBGzuVhmbkTZoSsCNducldstQLC+H/WLtRC+Xr3RDN0Xp0A4+V2jdTSh/quqmgewyLYY4m5RgizVeUcShGQJSQHdGVpZXN4tRW1fJ2g== 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=c4+f2+6GQvj5eZZnVGAaqcl7ZqQEdPgStIAodniK5Y0=; b=h7WDaqsLPWUQjQYRIfmPcmupvyOIhV03mcSJ5FwPdan7MGEpc6NQdclB4Af30Y6vLwZCm14YvFbI8yswgFl7KXTwjlx4cy3zn+H0t/tARKms3Q7zCopm9bu6rvt4rELDSMyWQwVsS38Iw7uMYjcjOsHOzPaYNyBLQbUFND7V2bdqw2q8q9/F171Sv4VDsamjyIG3AHve6KoH+tSU++fL7gmkA+alckAZatCaPDiY/zfiyfqZzJeRtrRb8jAGPhWgbCX+NfBZPZSJCW4s1L2JFS8jdKy+fbwyXo5aUFSU4RMj+u4LXon0WIIlD1GrPY8LGJVaJHUhkEPc8AlBHnPW2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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 (0) 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=c4+f2+6GQvj5eZZnVGAaqcl7ZqQEdPgStIAodniK5Y0=; b=IFTrqQjWv19kGCofs8b738Q1jAizyw+lyyEJEzo7SuxyfEqFQvBSPJTLPXF/j+zQqzObnrV+3cKoD/rB5bIfUmAA3WhR35cJ3W3bURKhSSt15O1d7gtXgH4YcFfpkYOJlzc5rZ6vfhoSIhdqNFen9mGccUXZtE87ayTcubjY+5MLJYV0Jfz+FWYcDWOPNWpgcfN4SwTV3SeEl4uDQDFUTb2KeKUZaulxsCdCTIK4tNxR4u6tzHDcwvAq5tumBR5x83xxOzdWpNZ9Lmk5/qn4yU3is3FObBhuq2csxPKlIhQBpwPulroxxJ2t7kPgUSbpEPXGpLAiJ9W1plw739ahjw== Received: from CH0P221CA0044.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11d::27) by IA1PR12MB6065.namprd12.prod.outlook.com (2603:10b6:208:3ef::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.10; Sun, 11 Feb 2024 17:17:47 +0000 Received: from CH2PEPF0000009C.namprd02.prod.outlook.com (2603:10b6:610:11d:cafe::5f) by CH0P221CA0044.outlook.office365.com (2603:10b6:610:11d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.38 via Frontend Transport; Sun, 11 Feb 2024 17:17:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CH2PEPF0000009C.mail.protection.outlook.com (10.167.244.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.19 via Frontend Transport; Sun, 11 Feb 2024 17:17:47 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sun, 11 Feb 2024 09:17:45 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) 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.1258.12; Sun, 11 Feb 2024 09:17:45 -0800 Received: from build-petlozup-20240117T042503953.internal (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Sun, 11 Feb 2024 09:17:45 -0800 From: Petlozu Pravareshwar To: , , , , , , , , , , , , , CC: Subject: [PATCH V3 1/3] soc/tegra: pmc: Update address mapping sequence for PMC apertures Date: Sun, 11 Feb 2024 17:17:25 +0000 Message-ID: <20240211171727.914595-1-petlozup@nvidia.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000009C:EE_|IA1PR12MB6065:EE_ X-MS-Office365-Filtering-Correlation-Id: df629d97-6bea-4984-2c2d-08dc2b255e13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ik9caQ3qry0GksR2slkqZfDpGH24I/q6Apx/4I0pzt0wjj/CpT3UvaMw1u+ivIPu8BICcKK6vc1PmhkRWzCDoopuL5z+fAjcrHJRkyZC3qxokIqFX5dML5cw6l3YXOiV/GoTY7y5lCpwj6HuwZVdxX6+VA2x6z7oO6LZLvZbmI4D68jSEVETkR/HSNoihUMm+wgxI5dJeJ5OmH9dnaRkuRUwpLBOv+XWoGsE1YgN6/vlS5aogdGvTlvpzTOI9QlzsbeKZkce+8IZg6GNt0PGIGJ/IXuXwINvXcr2JsS5523vDxcSiJXsbMQ7v49HCCfY8FHL1JouT6QtVspqRTqCMD6OCCaejgAcBfGfgMaseXuQPzY3XTKLkrDyt3j7JKACTAa/pstdu1gUNK9weSRC77UOj+XGc6y7bJAOk6+MTvLr/pTZnAdQZYwcuaFPhemBjmMKYORRPleyhiZgstYvS3KesH0e+PxJ6o/VsyFnUmPb6KzG2oQIpavFm7iy+XxlNEoNUakq9agP+Vc4pbspoqNRmJv5hCM0mzLdNg9JFSXKp9ulNQLomCV0dSRwpt84b6g3pxHeTmNWzOqUw/CCwnv3w6j5Yk+ObttpqOEdPpEjpTAUFm2bPBNHYZYRMJkhOOc3Wsg+u2KJX2zCUGw8zg== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(136003)(346002)(376002)(396003)(230922051799003)(1800799012)(82310400011)(64100799003)(186009)(451199024)(36840700001)(46966006)(40470700004)(70586007)(82740400003)(7636003)(356005)(921011)(83380400001)(41300700001)(6666004)(478600001)(4326008)(8676002)(426003)(316002)(8936002)(70206006)(26005)(107886003)(110136005)(2616005)(1076003)(336012)(86362001)(36756003)(5660300002)(2906002)(7416002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2024 17:17:47.0304 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df629d97-6bea-4984-2c2d-08dc2b255e13 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000009C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6065 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790623765312769742 X-GMAIL-MSGID: 1790623765312769742 On Tegra SoCs prior to Tegra186, PMC has single address range only. Starting from and after Tegra186, PMC has additional address ranges apart from base address range. Currently in PMC driver, we try to map these additional address ranges on all SoCs and if we fail then we assume that the range is not valid for an SoC. This change makes it more explicit on which address ranges are expected to be present on which SoCs and maps the additional address ranges only on SoCs from and after Tegra186. Signed-off-by: Petlozu Pravareshwar --- drivers/soc/tegra/pmc.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 6dfcc7f50ece..0bc983f6b088 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -384,6 +384,7 @@ struct tegra_pmc_soc { bool has_blink_output; bool has_usb_sleepwalk; bool supports_core_domain; + bool has_single_mmio_aperture; }; /** @@ -2885,31 +2886,28 @@ static int tegra_pmc_probe(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wake"); - if (res) { + if (pmc->soc->has_single_mmio_aperture) { + pmc->wake = base; + pmc->aotag = base; + pmc->scratch = base; + } else { + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, + "wake"); pmc->wake = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(pmc->wake)) return PTR_ERR(pmc->wake); - } else { - pmc->wake = base; - } - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "aotag"); - if (res) { + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, + "aotag"); pmc->aotag = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(pmc->aotag)) return PTR_ERR(pmc->aotag); - } else { - pmc->aotag = base; - } - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "scratch"); - if (res) { + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, + "scratch"); pmc->scratch = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(pmc->scratch)) return PTR_ERR(pmc->scratch); - } else { - pmc->scratch = base; } pmc->clk = devm_clk_get_optional(&pdev->dev, "pclk"); @@ -3300,6 +3298,7 @@ static const struct tegra_pmc_soc tegra20_pmc_soc = { .num_pmc_clks = 0, .has_blink_output = true, .has_usb_sleepwalk = true, + .has_single_mmio_aperture = true, }; static const char * const tegra30_powergates[] = { @@ -3361,6 +3360,7 @@ static const struct tegra_pmc_soc tegra30_pmc_soc = { .num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data), .has_blink_output = true, .has_usb_sleepwalk = true, + .has_single_mmio_aperture = true, }; static const char * const tegra114_powergates[] = { @@ -3418,6 +3418,7 @@ static const struct tegra_pmc_soc tegra114_pmc_soc = { .num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data), .has_blink_output = true, .has_usb_sleepwalk = true, + .has_single_mmio_aperture = true, }; static const char * const tegra124_powergates[] = { @@ -3562,6 +3563,7 @@ static const struct tegra_pmc_soc tegra124_pmc_soc = { .num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data), .has_blink_output = true, .has_usb_sleepwalk = true, + .has_single_mmio_aperture = true, }; static const char * const tegra210_powergates[] = { @@ -3725,6 +3727,7 @@ static const struct tegra_pmc_soc tegra210_pmc_soc = { .num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data), .has_blink_output = true, .has_usb_sleepwalk = true, + .has_single_mmio_aperture = true, }; static const struct tegra_io_pad_soc tegra186_io_pads[] = { @@ -3922,6 +3925,7 @@ static const struct tegra_pmc_soc tegra186_pmc_soc = { .num_pmc_clks = 0, .has_blink_output = false, .has_usb_sleepwalk = false, + .has_single_mmio_aperture = false, }; static const struct tegra_io_pad_soc tegra194_io_pads[] = { @@ -4107,6 +4111,7 @@ static const struct tegra_pmc_soc tegra194_pmc_soc = { .num_pmc_clks = 0, .has_blink_output = false, .has_usb_sleepwalk = false, + .has_single_mmio_aperture = false, }; static const struct tegra_io_pad_soc tegra234_io_pads[] = { @@ -4235,6 +4240,7 @@ static const struct tegra_pmc_soc tegra234_pmc_soc = { .pmc_clks_data = NULL, .num_pmc_clks = 0, .has_blink_output = false, + .has_single_mmio_aperture = false, }; static const struct of_device_id tegra_pmc_match[] = { From patchwork Sun Feb 11 17:17:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petlozu Pravareshwar X-Patchwork-Id: 199487 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2023041dyd; Sun, 11 Feb 2024 09:18:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEo6wwJ5PISDjXJYbzJuendMkoDl2TyplAfQYoZPNcuNSj4sD1g8eDqdMucI95BMDCnKAdW X-Received: by 2002:a92:ca91:0:b0:363:d9eb:c2e0 with SMTP id t17-20020a92ca91000000b00363d9ebc2e0mr5650411ilo.28.1707671918429; Sun, 11 Feb 2024 09:18:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVcGrroDvItWVV2NZJU78UYj7PrSHE8dRMyWP5az419yHN7klHwmaX/t6zKTyVY96qAooq7NQq+3wHrMkXLthK2IOuPMA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id w20-20020a639354000000b005cf58862d6asi5195945pgm.223.2024.02.11.09.18.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 09:18:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60878-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=byyTNWLT; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-60878-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60878-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 170A0B21B14 for ; Sun, 11 Feb 2024 17:18:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1C445D464; Sun, 11 Feb 2024 17:18:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="byyTNWLT" Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2051.outbound.protection.outlook.com [40.107.237.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55B8C5CDC5; Sun, 11 Feb 2024 17:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707671895; cv=fail; b=gbcU7okV1kBLnKcXEsgnFkv0n6WYu1LmCeZJQigdZxKP8zJJTk1DeNYQfAkDEG+53zMS8w1zlW4uAUEx8IUAhE9tQE92FK72IkL782EYqJyWEn+d/8El3tsHncRPFCgKqcq744VpBykT7IhBLlBhQi3kxc6M05MucG9Frs60Ko8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707671895; c=relaxed/simple; bh=e7CpKIh4/20cmmqME0DTDHDJsRkqkutj25vzZ8BYcCQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PNziYikxtJajS0iR3p1WG2FtRnEY6yKv15AuxzL3soSx6yfsKeX9ZYnYawlAQl1UqoM3PMAdLXvm60pAei3jqy9TNtOIVlYPfaqYb908zwxpVIq8aahn/U4/fUM3nqx1iroIkvsXlARU9pVU2a8QjY83/bpYiXbQ6UEbYo9lixM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=byyTNWLT; arc=fail smtp.client-ip=40.107.237.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DLyjSx7FUEkLIcUuVBQGltcoeK7BtIinPnMpElfAhXPqyl13oXe2uFmMD3LuQhwqsNl8E+fOJcmMydGDJXDoQZEOooqksfoSGU0SWJCPcV9QK1Bmb6fIkc5oNnal0nGmRs+KpVVRIvBzXAPQf/nUuEgGg3DVeMSFbO1FyyD81NRqQozKn1qrfbGIkX+oJASRfmTTeI+pY7h5oKfl10o/jyLYY0bRuWrePazic27oufb9u7ZRKOdApBUSMtHnQrrXl0hr1OaqI7I3omfJ8g189m1XBdEkRmiYPl/1M9TAI4EaM+ZelO+YDqlqcR+2klj+6jHbogfYzNdQQFqyuZvLiA== 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=I4TsF0HFPxh1xo635dSyHIYGNtze6/P5ziInIApNOGI=; b=DApNFYgstSecQ6+9Y9zs/1YDE4gcmYT7tzvJrhRutTmbhn/wCbPHovDa66fvOYkunf2xLgfHxdhrLmXo7J9xybtoY9JHcVgX/4le+50SkRPIexbdBOjS7dLgyxG8l9CVHrQrGrI596jx22Lff5wL/R96nmohPdKrpo2BXud5DCXMxVeJTMH0zWeHO4q6J32lw01YdjqD3bbLaL6ikVcT8SwzC93Xt3EzmPDPB6hqa2MqKSSLV56QrT3zoR0ud0XbhTOfstjglwTHglhl+4LktuHSa9Z9nxM2rDfFAWnQI1qazZgzKydJbO6dDWE2m99qpxmHrsIJHEcIN0pFHpV/Dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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 (0) 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=I4TsF0HFPxh1xo635dSyHIYGNtze6/P5ziInIApNOGI=; b=byyTNWLTkVp6xioaWxzhJh59h7pWXOWU+hJndy5j7qpq25Cs952x6/aJU5O/dtFwn5uORifzaZ7cB495JCkJRDZb62IaaXbyoKj/wUT7qGrWcCx4s1U151j/8WhYfYSyn6bXMwSPJKeldvANmPUgMVBSX+nW1qyYCn3aTHOYvRUAA4mUqWSB3/qaMIeqZc/TgkCEpri4qaqpj/HihPyfxZBssoQHomXTPKodKauYVgB2tgB/JYyNEgMeetFFGEfZ8x+JebzVcECE9HaxSQmJFLb0TpwNxe45iqub7+5DaUu/+8yo5cY2O/ELvRNOOl2onkqp4voCpO3AIPqjSJjgjQ== Received: from CH0PR03CA0073.namprd03.prod.outlook.com (2603:10b6:610:cc::18) by SJ2PR12MB8160.namprd12.prod.outlook.com (2603:10b6:a03:4af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.11; Sun, 11 Feb 2024 17:18:09 +0000 Received: from CH2PEPF0000009B.namprd02.prod.outlook.com (2603:10b6:610:cc:cafe::69) by CH0PR03CA0073.outlook.office365.com (2603:10b6:610:cc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.32 via Frontend Transport; Sun, 11 Feb 2024 17:18:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CH2PEPF0000009B.mail.protection.outlook.com (10.167.244.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.19 via Frontend Transport; Sun, 11 Feb 2024 17:18:09 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sun, 11 Feb 2024 09:18:04 -0800 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.1258.12; Sun, 11 Feb 2024 09:18:04 -0800 Received: from build-petlozup-20240117T042503953.internal (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Sun, 11 Feb 2024 09:18:04 -0800 From: Petlozu Pravareshwar To: , , , , , , , , , , , , , CC: Subject: [PATCH V3 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture Date: Sun, 11 Feb 2024 17:17:26 +0000 Message-ID: <20240211171727.914595-2-petlozup@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240211171727.914595-1-petlozup@nvidia.com> References: <20240211171727.914595-1-petlozup@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000009B:EE_|SJ2PR12MB8160:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ff5e484-0041-4cd3-f0c0-08dc2b256b55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZC3uJxlcqNA2n+8ARqiGVYZI2kfS6K6l1lqPtKa46yYH89KpOr1bWO8W6IG11Apg9tU8VnUiTDr0tHAKlinDsuZQrrsJ0pGWJHCXlkLZHgLgdnr5tH1lyg7W2m5GdOMossGIaDcbXLTPHR8hg1zy1cZFz9fDHFWGDHrvuAgFsdstMhveiI6Ncydks5eSelLR3poABgL9w30ICDM3rgvKz4XPS1uL1HQ5efCqP4bY+ILCTYn3z7KOwtHWXmb+StMJHsxnccnRgOrEKkNsSvqDrGDB4nWQJtPIudfgz0wqb4gm7QtFvaC+02XA73f+kVX/ZgW2vreF/a7iFLPjckNNLTF7DK+5VUjNOYDwvK3da97hyFvtZmffTi1j0DXQ15enppkosYA/Efvfdj05ffoZiRxKCZChvVZq3yZYrrbAQSpiEPns4TrGiVgl/elVZ2jYGCmysl5Pdcdqa5JY5ou3S7f/XXUwIIxoQz62Lcc7ZICWP4AjsQKAnP4kSxWm43m8GLgkvEjST7nOWkH9qr46ES2ogxnSh1VRYsVj2x29GM09ujfp5zFkHuyJn4LiXMn/USZDqLxc8urHscVNXsJO0yywNj0G1RCcAkwNSu+U3PkXLbWe39qzuInpd2RY8a/QlbifUImAYXSoQcp+gO9D9Q== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(136003)(39860400002)(376002)(396003)(230922051799003)(64100799003)(451199024)(1800799012)(82310400011)(186009)(40470700004)(36840700001)(46966006)(86362001)(36756003)(478600001)(6666004)(41300700001)(356005)(7636003)(82740400003)(2906002)(4326008)(7416002)(5660300002)(8676002)(8936002)(110136005)(70206006)(83380400001)(316002)(70586007)(26005)(921011)(107886003)(336012)(2616005)(426003)(15650500001)(1076003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2024 17:18:09.2783 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ff5e484-0041-4cd3-f0c0-08dc2b256b55 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000009B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8160 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790623789337563214 X-GMAIL-MSGID: 1790623789337563214 Scratch address space register is used to store reboot reason. For some Tegra234 systems, the scratch space is not available to store the reboot reason. This is because scratch region on these systems is not accessible by the kernel as restricted by the Hypervisor. Such systems would delist scratch aperture from PMC DT node. Accordingly, this change makes "scratch" as an optional aperture for Tegra234 in PMC dt-binding document. Signed-off-by: Petlozu Pravareshwar Reviewed-by: Krzysztof Kozlowski --- Changes in v3: - Update 'reg-names' property items as per the review comments. .../arm/tegra/nvidia,tegra186-pmc.yaml | 58 ++++++++++++------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml index 0faa403f68c8..ea4fbf655220 100644 --- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml +++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml @@ -27,7 +27,7 @@ properties: - const: pmc - const: wake - const: aotag - - const: scratch + - enum: [ scratch, misc ] - const: misc interrupt-controller: true @@ -41,25 +41,43 @@ properties: description: If present, inverts the PMU interrupt signal. $ref: /schemas/types.yaml#/definitions/flag -if: - properties: - compatible: - contains: - const: nvidia,tegra186-pmc -then: - properties: - reg: - maxItems: 4 - - reg-names: - maxItems: 4 -else: - properties: - reg: - minItems: 5 - - reg-names: - minItems: 5 +allOf: + - if: + properties: + compatible: + contains: + const: nvidia,tegra186-pmc + then: + properties: + reg: + maxItems: 4 + reg-names: + maxItems: 4 + contains: + const: scratch + + - if: + properties: + compatible: + contains: + const: nvidia,tegra194-pmc + then: + properties: + reg: + minItems: 5 + reg-names: + minItems: 5 + + - if: + properties: + compatible: + contains: + const: nvidia,tegra234-pmc + then: + properties: + reg-names: + contains: + const: misc patternProperties: "^[a-z0-9]+-[a-z0-9]+$": From patchwork Sun Feb 11 17:17:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petlozu Pravareshwar X-Patchwork-Id: 199488 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2023214dyd; Sun, 11 Feb 2024 09:19:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsHc4i6Xeh3k0HuaL76bckTVKRNQBYhIatKeKAq7dHfWecj4mGjS98iNtmwR/eft8PHM15 X-Received: by 2002:a2e:b8ca:0:b0:2d0:ce3c:5848 with SMTP id s10-20020a2eb8ca000000b002d0ce3c5848mr3171903ljp.51.1707671941597; Sun, 11 Feb 2024 09:19:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV7ZHq5zP3NKVxmTrmO4ER0SxH2orEjZvp8f2pdiyhvPosEhQpKc3zo/FrO3x/Ec9FQZi0FpDsMWoootjucoX4+gNATcw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id eh13-20020a0564020f8d00b00560b32e32f8si1906718edb.285.2024.02.11.09.19.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 09:19:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60879-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=q8GVHTWg; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-60879-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60879-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0DF7D1F2259F for ; Sun, 11 Feb 2024 17:19:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AEF15CDF2; Sun, 11 Feb 2024 17:18:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="q8GVHTWg" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2084.outbound.protection.outlook.com [40.107.223.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 198335C5FE; Sun, 11 Feb 2024 17:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707671920; cv=fail; b=KbrsCERFhnNrfkhJ2/uMwpSB+VsdmYPqf9OQdToOYk4XVCGLxqDelwGVeQoKsVGKuort+X/p67vSKfiz7pNjgM8jpV/nN4L+qXswC/zNzHhrAQHFTkS6wfcLUCK8eQyzlFyc56XAT83YznOlgdGUkvT6LgqSNBFh2avhzBqZI/0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707671920; c=relaxed/simple; bh=30YSgSNNoNq+yMHs0WYAIXa5CLC43HFXJJ3q/ku6Icc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rIDg01Cwtj3dCnML5UiI6kd89jyvfmXyj8xNAHd+mhAvwk411cl4K0Lhqc1je0n8CtqrsNhXmmRttRaf0kDamloBTa29InRlmbRijtaMr7iqQ4N9tdXBDKELYQrKF71CBBBmbuGNVmNKxpEuABXaTh7tHGUb3wFws8yyiPCDNH8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=q8GVHTWg; arc=fail smtp.client-ip=40.107.223.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lqV2iQfHSZv2IrtJA5Zxy2VqSokctm+xWmmL7Y6cW95NiffaE4wLbzc5EjBbLFhE27DyLnAZLGdTllvSi2G5lzwiGU9Z8/dz5tfhQ5Ax3Tjpp4HaIARXBuS56Sn7mDYT5HNtLoM4KneFgK3j5ByM+PdAxuce6GlAtwWp6MxnQPstHyt1kirOdWYyHyyEj9q8ZJsKCXPFExECfTuWl9gNn1SHi00l/fobb/N0oEyxr3kKpmT+kEdMbCTkc/rIhm+o7xJHqT3TUw8a4A5YtB3lDDfDdROClvAfBbo08fJxbGZLpA+sFoGmr/KC5Oc3npczHEO5YrlvGUeJWwt/JDF8/g== 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=T25CKw4yoNxJRPj4qH1FP6xAkXLE8KmGIjCHeZ1zeNw=; b=S1TgwLrdSb2JTIqzKTETLL5ocMfbLtH3YuXZcUxI5uzHknIQ1eQmZHqrgW9JnZ4Kb9diI3Xd8p3hae7OxbCIm2ss8ClmMA+S4NiLt7vJp72MspZTNV3dUy+i71cpseI25lKKNqlLtxQRLKcF2CeHHJ6wZjpLLz8hLJQ199bfKSkMwmgKmToO8tZfCXHxbu9eWupq8Owj4asnwiYPt1R+59ZXOoefkLlDdw9GW3lt8p/YHcVxD++dWYPwo93hz6NavJg95bmBkShcXJUDGCTx9b1uLEBI+tbo+vRUIV3kkX1RfgU3bcLNZMRvWx3roEjJeijxDY/3uJhrsj+Dh1cyeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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 (0) 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=T25CKw4yoNxJRPj4qH1FP6xAkXLE8KmGIjCHeZ1zeNw=; b=q8GVHTWga28WPg7WdYej/C/m13xlSFtOx7r1hZPfAMDPrIWGY3I2kUxn8ltCehbFvvbHVPqiP3zXrpoqYSzOffOc9mWwBlxWRL5NscR1nE82pvTIX7y8bcd10iN6ON6XCQZL2bdqDPvl41dR2ZZ2F4qkWMjj+0t8+DtEq8w0EH5Iq1/1Tqm+yI8nOSz+rtXis2oK2O8Oodb+JwPecplu3gjTi4pvFEtZJdXiL5IBO9Rf9z2AYn0BE223+rEeflVFXbQpSLK2Bmlq2gwtASK3ZckmZNIltAsKGM8QVODpQbcBGXU5iNhUpE6dwOKNPd8TvyLnTa97Jz88csdTYjwmSA== Received: from CH0PR04CA0100.namprd04.prod.outlook.com (2603:10b6:610:75::15) by SJ2PR12MB8649.namprd12.prod.outlook.com (2603:10b6:a03:53c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.23; Sun, 11 Feb 2024 17:18:32 +0000 Received: from CH2PEPF0000009F.namprd02.prod.outlook.com (2603:10b6:610:75:cafe::ef) by CH0PR04CA0100.outlook.office365.com (2603:10b6:610:75::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.37 via Frontend Transport; Sun, 11 Feb 2024 17:18:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CH2PEPF0000009F.mail.protection.outlook.com (10.167.244.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.19 via Frontend Transport; Sun, 11 Feb 2024 17:18:32 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sun, 11 Feb 2024 09:18:22 -0800 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.1258.12; Sun, 11 Feb 2024 09:18:22 -0800 Received: from build-petlozup-20240117T042503953.internal (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Sun, 11 Feb 2024 09:18:22 -0800 From: Petlozu Pravareshwar To: , , , , , , , , , , , , , CC: Subject: [PATCH V3 3/3] soc/tegra: pmc: Update scratch as an optional aperture Date: Sun, 11 Feb 2024 17:17:27 +0000 Message-ID: <20240211171727.914595-3-petlozup@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240211171727.914595-1-petlozup@nvidia.com> References: <20240211171727.914595-1-petlozup@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000009F:EE_|SJ2PR12MB8649:EE_ X-MS-Office365-Filtering-Correlation-Id: 371d86cc-3484-4a6e-9e42-08dc2b257913 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2bKquhvJala/6kyPuMSla65bd6v4A9sR27NC+m5C6uJMJp26IhlZ4MK0Nhm03qtaow+tJMer+bpF4gABfgSU0yyjX4xQ7QCNsfj/giP7AItmUuTlrfXLYy4xJMX+ee+MeuHIwbqReHsu7QBafO3bX2xMhzEHnTPgNI6pWLAPSXigcElK9e4edl3NVgNMlDSwJpsCAoaCOtWBSD+2tYRRZtSimCwUjnG4BfoxSb64la45YtplkPMFspYl+aDL0HBFhF04KSVa3OtvEhfUC/eYAimxvQIqvpBL19JWNotKt9whRhISQGLW6uAgRjDHE9JKluIJFqM4mIoo2WCX8boX8xP1udJTT1RIMfsGfJO77HMjrDsbbEqVnmuBLwgousZidYa0zcfQZaFYK+RdcOJ/6WZqu89MnQDMb0ho4uDq2jUYoj7uX4CatWcODIorhPS/TQoEIzUXpHLCYWuhA6iFR+lnTBP1aYz2+EQCq3084v9FuXAKGSBxIfpi3IN0EGd1cl5deQVT3y0fL9xG6I6HsK1z9sefSmeeNjH6T+gyVYhMn6i8UhUnQ4QZZtzfJ0ar9xYyQXTwCgslRM/KuX4G3ITUDgSIZJ+3ihwOX44WzSzjj9fib/VVGbzKnwFbeFHH753QOcxI5GJHOCwKAcIXxg== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(136003)(39860400002)(396003)(346002)(230922051799003)(64100799003)(451199024)(186009)(82310400011)(1800799012)(40470700004)(36840700001)(46966006)(2906002)(426003)(336012)(2616005)(41300700001)(1076003)(107886003)(478600001)(26005)(7416002)(4326008)(5660300002)(8936002)(8676002)(70586007)(70206006)(83380400001)(921011)(36756003)(110136005)(86362001)(316002)(7636003)(356005)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2024 17:18:32.3474 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 371d86cc-3484-4a6e-9e42-08dc2b257913 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000009F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8649 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790623813421623713 X-GMAIL-MSGID: 1790623813421623713 Scratch address space register is used to store reboot reason. For some Tegra234 systems, the scratch space is not available to store the reboot reason. This is because scratch region on these systems is not accessible by the kernel as restricted by the Hypervisor. Such systems would delist scratch aperture from PMC DT node. Hence this change makes scratch as optional aperture and also avoids registering reboot notifier if scratch address space isn't mapped. Signed-off-by: Petlozu Pravareshwar --- drivers/soc/tegra/pmc.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 0bc983f6b088..6948f78c7a4a 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -2903,11 +2903,16 @@ static int tegra_pmc_probe(struct platform_device *pdev) if (IS_ERR(pmc->aotag)) return PTR_ERR(pmc->aotag); + /* "scratch" is an optional aperture */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "scratch"); - pmc->scratch = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(pmc->scratch)) - return PTR_ERR(pmc->scratch); + if (res) { + pmc->scratch = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(pmc->scratch)) + return PTR_ERR(pmc->scratch); + } else { + pmc->scratch = NULL; + } } pmc->clk = devm_clk_get_optional(&pdev->dev, "pclk"); @@ -2919,12 +2924,15 @@ static int tegra_pmc_probe(struct platform_device *pdev) * PMC should be last resort for restarting since it soft-resets * CPU without resetting everything else. */ - err = devm_register_reboot_notifier(&pdev->dev, - &tegra_pmc_reboot_notifier); - if (err) { - dev_err(&pdev->dev, "unable to register reboot notifier, %d\n", - err); - return err; + if (pmc->scratch) { + err = devm_register_reboot_notifier(&pdev->dev, + &tegra_pmc_reboot_notifier); + if (err) { + dev_err(&pdev->dev, + "unable to register reboot notifier, %d\n", + err); + return err; + } } err = devm_register_sys_off_handler(&pdev->dev,