memory: tegra: mc-t26x: Fix ioremap on MCB aperture

MCB aperture is already ioremapped in MC driver using
devm_ioremap_resource(). This doesn't allow other driver to ioremap
this aperture using devm_ioremap* calls.
mc-t26x driver need to access MCB aperture to get carveout info.
So, fix this by using just ioremap on aperture without using devm*
APIs.
Also, fix the carveout apertures.

Bug 4707077

Change-Id: Ie7426ad3519306dd4dffdf54e4c58e81f3c8fb34
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3158697
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Ashish Mhetre
2024-06-18 05:10:58 +00:00
committed by Jon Hunter
parent a76cf2b65e
commit 45eab8b2ae

View File

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2023 NVIDIA CORPORATION. All rights reserved. // Copyright (C) 2023-2024 NVIDIA CORPORATION. All rights reserved.
#define pr_fmt(fmt) "mc: " fmt #define pr_fmt(fmt) "mc: " fmt
#include <linux/module.h> #include <linux/module.h>
@@ -8,9 +8,9 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <soc/tegra/mc-t26x.h> #include <soc/tegra/mc-t26x.h>
#define MC_SECURITY_CARVEOUT_BASE 0x9404 #define MC_SECURITY_CARVEOUT_BASE 0xa004
#define MC_CARVEOUT_NEXT 0xa0 #define MC_CARVEOUT_NEXT 0xa0
#define MC_SECURITY_CARVEOUT_LITE_BASE 0xa804 #define MC_SECURITY_CARVEOUT_LITE_BASE 0xb404
#define MC_CARVEOUT_LITE_NEXT 0x60 #define MC_CARVEOUT_LITE_NEXT 0x60
#define MC_CARVEOUT_BASE_HI 0x4 #define MC_CARVEOUT_BASE_HI 0x4
#define MC_SECURITY_CARVEOUT_SIZE_128KB 0x8 #define MC_SECURITY_CARVEOUT_SIZE_128KB 0x8
@@ -50,7 +50,13 @@ MODULE_DEVICE_TABLE(of, tegra_mc_of_ids);
static int tegra_mc_probe(struct platform_device *pdev) static int tegra_mc_probe(struct platform_device *pdev)
{ {
mcb_base = devm_platform_ioremap_resource(pdev, 0); struct resource *r;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r)
return PTR_ERR(r);
mcb_base = ioremap(r->start, resource_size(r));
if (IS_ERR_OR_NULL(mcb_base)) if (IS_ERR_OR_NULL(mcb_base))
return PTR_ERR(mcb_base); return PTR_ERR(mcb_base);
return 0; return 0;
@@ -58,6 +64,7 @@ static int tegra_mc_probe(struct platform_device *pdev)
static int tegra_mc_remove(struct platform_device *pdev) static int tegra_mc_remove(struct platform_device *pdev)
{ {
iounmap(mcb_base);
return 0; return 0;
} }