From 4f69d815e6bd9cd3fa829f8ec4e0c027923cc695 Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Mon, 25 Mar 2024 06:59:36 +0200 Subject: [PATCH] drm/tegra: ofa: Only enable safety RAM if specified Fix OFA boot sequence to only enable safety RAM if the configuration specifies doing so. Signed-off-by: Mikko Perttunen Change-Id: Id427dee5cfcda036b3f71b89e5d11a4a842964f1 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3103404 Reviewed-by: Santosh BS GVS: Gerrit_Virtual_Submit Tested-by: Bitan Biswas --- drivers/gpu/drm/tegra/ofa.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tegra/ofa.c b/drivers/gpu/drm/tegra/ofa.c index 2ce0d141..575ef462 100644 --- a/drivers/gpu/drm/tegra/ofa.c +++ b/drivers/gpu/drm/tegra/ofa.c @@ -75,11 +75,14 @@ static int ofa_boot(struct ofa *ofa) int err; u32 val; - ofa_writel(ofa, 0x1, OFA_SAFETY_RAM_INIT_REQ); - err = readl_poll_timeout(ofa->regs + OFA_SAFETY_RAM_INIT_DONE, val, (val == 1), 100000, 10); - if (err < 0) { - dev_err(ofa->dev, "timeout while initializing safety RAM\n"); - return err; + if (ofa->config->has_safety_ram) { + ofa_writel(ofa, 0x1, OFA_SAFETY_RAM_INIT_REQ); + err = readl_poll_timeout(ofa->regs + OFA_SAFETY_RAM_INIT_DONE, val, (val == 1), + 100000, 10); + if (err < 0) { + dev_err(ofa->dev, "timeout while initializing safety RAM\n"); + return err; + } } tegra_drm_program_iommu_regs(ofa->dev, ofa->regs, OFA_TFBIF_TRANSCFG);