From cd85e527ec26926a397b00a59f249528e3adb5c5 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Wed, 10 Aug 2022 19:58:45 +0100 Subject: [PATCH] gpu: nvgpu: Add host1x support for Tegra234 Add support for the upstream host1x driver in NVGPU for Tegra234. Bug 3724727 Bug 3752030 Change-Id: I529b731ea3feb3c8c435e7433772af82004ea208 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2759207 (cherry picked from commit 34f478fca6735347593c8ed9eceebb139d814d90) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2768288 Reviewed-by: svcacv Reviewed-by: Sagar Kamble Reviewed-by: Bibek Basu GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/nvhost_host1x.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/nvgpu/os/linux/nvhost_host1x.c b/drivers/gpu/nvgpu/os/linux/nvhost_host1x.c index 4fb71738d..29881ecad 100644 --- a/drivers/gpu/nvgpu/os/linux/nvhost_host1x.c +++ b/drivers/gpu/nvgpu/os/linux/nvhost_host1x.c @@ -32,10 +32,14 @@ #define TEGRA194_SYNCPT_PAGE_SIZE 0x1000 #define TEGRA194_SYNCPT_SHIM_BASE 0x60000000 #define TEGRA194_SYNCPT_SHIM_SIZE 0x00400000 +#define TEGRA234_SYNCPT_PAGE_SIZE 0x10000 +#define TEGRA234_SYNCPT_SHIM_BASE 0x60000000 +#define TEGRA234_SYNCPT_SHIM_SIZE 0x04000000 static const struct of_device_id host1x_match[] = { { .compatible = "nvidia,tegra186-host1x", }, { .compatible = "nvidia,tegra194-host1x", }, + { .compatible = "nvidia,tegra234-host1x", }, {}, }; @@ -308,6 +312,12 @@ int nvgpu_nvhost_get_syncpt_aperture(struct nvgpu_nvhost_dev *nvhost_dev, return 0; } + if (of_device_is_compatible(np, "nvidia,tegra234-host1x")) { + *base = TEGRA234_SYNCPT_SHIM_BASE; + *size = TEGRA234_SYNCPT_SHIM_SIZE; + return 0; + } + return -ENOTSUPP; } @@ -320,6 +330,9 @@ u32 nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(struct gk20a *g, if (of_device_is_compatible(np, "nvidia,tegra194-host1x")) return syncpt_id * TEGRA194_SYNCPT_PAGE_SIZE; + if (of_device_is_compatible(np, "nvidia,tegra234-host1x")) + return syncpt_id * TEGRA234_SYNCPT_PAGE_SIZE; + return 0; }