arm: zynqmp: Initialize some registers at boot
Subsystems (3)
cover arm: zynqmp: Initialize some registers at boot
These patches are independent in intent, but they modify adjacent lines so I have sent them as a series.
Sean Anderson (2):
zynqmp: Disable secure access for boot devices
arm: zynqmp: Enable non-invasive CCI-400 PMU debug
arch/arm/mach-zynqmp/include/mach/hardware.h | 5 +++++ board/xilinx/zynqmp/zynqmp.c | 8 ++++++++ 2 files changed, 13 insertions(+)
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH 1/2 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
---
arch/arm/mach-zynqmp/include/mach/hardware.h | 2 ++ board/xilinx/zynqmp/zynqmp.c | 4 ++++ 2 files changed, 6 insertions(+)
arch/arm/mach-zynqmp/include/mach/hardware.h +2 -0
@@ -63,6 +63,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
board/xilinx/zynqmp/zynqmp.c +4 -0
@@ -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 (0x04920492 ,ZYNQMP_IOU_SECURE_SLCR +4 ); +/* Delay is required for clocks to be propagated */ udelay (1000000 );
Signature · 1 line
2.35.1.1320.gc452695387.dirty
Michal Simek
maintainerRe: [PATCH 1/2] zynqmp: Disable secure access for boot devices
Quoted 32 lines · Sean Anderson
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 <[email protected]>---
arch/arm/mach-zynqmp/include/mach/hardware.h | 2 ++ board/xilinx/zynqmp/zynqmp.c | 4 ++++ 2 files changed, 6 insertions(+)arch/arm/mach-zynqmp/include/mach/hardware.h +2
-0@@ -63,6 +63,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 0x2board/xilinx/zynqmp/zynqmp.c +0
-0
board/xilinx/zynqmp/zynqmp.c int __maybe_unused psu_uboot_init(void) · line 77
Quoted 6 lines
board/xilinx/zynqmp/zynqmp.c +3
-0@@ -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 (0x04920492 ,ZYNQMP_IOU_SECURE_SLCR +4 );
there is no definition for bits 27:25 that's why that upper 4 shouldn't be there.
Thanks,
Michal
Re: [PATCH 1/2] zynqmp: Disable secure access for boot devices
Quoted 38 lines · Michal Simek
Quoted 35 lines · Sean Anderson
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 <[email protected]>---
arch/arm/mach-zynqmp/include/mach/hardware.h| 2 ++ board/xilinx/zynqmp/zynqmp.c | 4 ++++2 files changed, 6 insertions(+)arch/arm/mach-zynqmp/include/mach/hardware.h +2
-0@@ -63,6 +63,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 0x2board/xilinx/zynqmp/zynqmp.c +0
-0@@ -72,6 +72,10 @@ int __maybe_unused psu_uboot_init(void) writel(ZYNQMP_PS_SYSMON_ANALOG_BUS_VAL, ZYNQMP_AMS_PS_SYSMON_ANALOG_BUS);
Quoted 8 lines
board/xilinx/zynqmp/zynqmp.c int __maybe_unused psu_uboot_init(void) · line 77
Quoted 3 lines
board/xilinx/zynqmp/zynqmp.c +3
-0+ /* Disable secure access for boot devices */ + writel(0x04920492, ZYNQMP_IOU_SECURE_SLCR); + writel(0x04920492, ZYNQMP_IOU_SECURE_SLCR + 4);there is no definition for bits 27:25 that's why that upper 4 shouldn't be there.
OK. Will fix for v2.
--Sean
PATCH 2/2 arm: zynqmp: Enable non-invasive CCI-400 PMU debug
In reply to Sean AndersonSet NIDEN, enabling non-invasive debug for the CCI-400 PMU. Otherwise, the PMU is effectively disabled.
---
arch/arm/mach-zynqmp/include/mach/hardware.h | 3 +++ board/xilinx/zynqmp/zynqmp.c | 4 ++++ 2 files changed, 7 insertions(+)
arch/arm/mach-zynqmp/include/mach/hardware.h +3 -0
@@ -128,6 +128,9 @@ struct crfapb_regs {#define crfapb_base ((struct crfapb_regs *)ZYNQMP_CRF_APB_BASEADDR) +#define ZYNQMP_CCI_REG_CCI_MISC_CTRL 0xFD5E0040 +#define ZYNQMP_CCI_REG_CCI_MISC_CTRL_NIDEN BIT(1) +#define ZYNQMP_APU_BASEADDR 0xFD5C0000struct apu_regs {
board/xilinx/zynqmp/zynqmp.c +4 -0
@@ -76,6 +76,10 @@ int __maybe_unused psu_uboot_init(void)writel (0x04920492 ,ZYNQMP_IOU_SECURE_SLCR );writel (0x04920492 ,ZYNQMP_IOU_SECURE_SLCR +4 ); +/* Enable CCI PMU events */ +writel (ZYNQMP_CCI_REG_CCI_MISC_CTRL_NIDEN , +ZYNQMP_CCI_REG_CCI_MISC_CTRL ); +/* Delay is required for clocks to be propagated */ udelay (1000000 );
Signature · 1 line
2.35.1.1320.gc452695387.dirty
Re: [PATCH 2/2] arm: zynqmp: Enable non-invasive CCI-400 PMU debug
Quoted 16 lines · Sean Anderson
Set NIDEN, enabling non-invasive debug for the CCI-400 PMU. Otherwise, the PMU is effectively disabled.
Signed-off-by Sean Anderson <[email protected]>---
arch/arm/mach-zynqmp/include/mach/hardware.h | 3 +++ board/xilinx/zynqmp/zynqmp.c | 4 ++++ 2 files changed, 7 insertions(+)arch/arm/mach-zynqmp/include/mach/hardware.h +0
-0
arch/arm/mach-zynqmp/include/mach/hardware.h struct crfapb_regs { · line 131
Quoted 4 lines
arch/arm/mach-zynqmp/include/mach/hardware.h +1
-0@@ -128,6 +128,9 @@ struct crfapb_regs {#define crfapb_base ((struct crfapb_regs *)ZYNQMP_CRF_APB_BASEADDR) +#define ZYNQMP_CCI_REG_CCI_MISC_CTRL 0xFD5E0040
Normally this should be described via structure but some time ago also macro can be used that's why I am fine with it.
Quoted 21 lines
arch/arm/mach-zynqmp/include/mach/hardware.h +2
-0+#define ZYNQMP_CCI_REG_CCI_MISC_CTRL_NIDEN BIT(1) +#define ZYNQMP_APU_BASEADDR 0xFD5C0000struct apu_regs {board/xilinx/zynqmp/zynqmp.c +4
-1@@ -76,6 +76,10 @@ int __maybe_unused psu_uboot_init(void)writel (0x04920492 ,ZYNQMP_IOU_SECURE_SLCR );writel (0x04920492 ,ZYNQMP_IOU_SECURE_SLCR +4 ); +/* Enable CCI PMU events */ +writel (ZYNQMP_CCI_REG_CCI_MISC_CTRL_NIDEN , +ZYNQMP_CCI_REG_CCI_MISC_CTRL ); +/* Delay is required for clocks to be propagated */ udelay (1000000 ); --
Quoted 2 lines
2.35.1.1320.gc452695387.dirty
Thanks,
Michal