summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Anderson <sean.anderson@linux.dev>2024-09-05 13:18:32 -0400
committerMichal Simek <michal.simek@amd.com>2024-09-20 08:31:57 +0200
commit35142be560fc105437ed1078cf879cfde37f84a8 (patch)
tree206234e71d519d4833f53d23b9473faea3f9271a
parent8ef2deefc5a9f128f761208d2922a653639bf4bc (diff)
zynqmp: Disable secure access for boot devices
Boot devices (QSPI, MMC, NAND, and Ethernet) use secure access for DMA by default. As this causes problems when using the SMMU [1], configure them for normal access instead. [1] https://support.xilinx.com/s/article/72164 Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Link: https://lore.kernel.org/r/20240905171833.325548-2-sean.anderson@linux.dev Signed-off-by: Michal Simek <michal.simek@amd.com>
-rw-r--r--arch/arm/mach-zynqmp/include/mach/hardware.h2
-rw-r--r--board/xilinx/zynqmp/zynqmp.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-zynqmp/include/mach/hardware.h b/arch/arm/mach-zynqmp/include/mach/hardware.h
index 9228fa3c802..eb8fffaf192 100644
--- a/arch/arm/mach-zynqmp/include/mach/hardware.h
+++ b/arch/arm/mach-zynqmp/include/mach/hardware.h
@@ -67,6 +67,8 @@ struct crlapb_regs {
#define crlapb_base ((struct crlapb_regs *)ZYNQMP_CRL_APB_BASEADDR)
+#define ZYNQMP_IOU_SECURE_SLCR 0xFF240000
+
#define ZYNQMP_IOU_SCNTR_SECURE 0xFF260000
#define ZYNQMP_IOU_SCNTR_COUNTER_CONTROL_REGISTER_EN 0x1
#define ZYNQMP_IOU_SCNTR_COUNTER_CONTROL_REGISTER_HDBG 0x2
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index e6331c0e4d8..56e3b36ca99 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -72,6 +72,10 @@ int __maybe_unused psu_uboot_init(void)
writel(ZYNQMP_PS_SYSMON_ANALOG_BUS_VAL,
ZYNQMP_AMS_PS_SYSMON_ANALOG_BUS);
+ /* Disable secure access for boot devices */
+ writel(0x04920492, ZYNQMP_IOU_SECURE_SLCR);
+ writel(0x00920492, ZYNQMP_IOU_SECURE_SLCR + 4);
+
/* Delay is required for clocks to be propagated */
udelay(1000000);