diff mbox series

arm64: zynqmp: Print multiboot register value in EL3

Message ID a36e4af151c296a661e467672bbce43c9ec4aecb.1581421506.git.michal.simek@xilinx.com
State Accepted
Commit c51430133718d5ac9c0983c0f9dd4714f02c6184
Headers show
Series arm64: zynqmp: Print multiboot register value in EL3 | expand

Commit Message

Michal Simek Feb. 11, 2020, 11:45 a.m. UTC
Multi boot register can be used for using different boot images and design
better boot strategy. Let EL3 SPL or U-Boot to read it and print it.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 arch/arm/mach-zynqmp/include/mach/hardware.h |  4 +++-
 board/xilinx/zynqmp/zynqmp.c                 | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

Comments

Michal Simek April 6, 2020, 10:54 a.m. UTC | #1
?t 11. 2. 2020 v 12:45 odes?latel Michal Simek <michal.simek at xilinx.com> napsal:
>
> Multi boot register can be used for using different boot images and design
> better boot strategy. Let EL3 SPL or U-Boot to read it and print it.
>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
> ---
>
>  arch/arm/mach-zynqmp/include/mach/hardware.h |  4 +++-
>  board/xilinx/zynqmp/zynqmp.c                 | 14 ++++++++++++++
>  2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-zynqmp/include/mach/hardware.h b/arch/arm/mach-zynqmp/include/mach/hardware.h
> index fd361c5ce8a5..a0acfa2ff1ed 100644
> --- a/arch/arm/mach-zynqmp/include/mach/hardware.h
> +++ b/arch/arm/mach-zynqmp/include/mach/hardware.h
> @@ -128,7 +128,9 @@ struct apu_regs {
>  #define ZYNQMP_SILICON_VER_SHIFT       12
>
>  struct csu_regs {
> -       u32 reserved0[17];
> +       u32 reserved0[4];
> +       u32 multi_boot;
> +       u32 reserved1[12];
>         u32 version;
>  };
>
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index 6b0451913db8..8d3613147162 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -329,6 +329,17 @@ int board_early_init_f(void)
>         return ret;
>  }
>
> +static int multi_boot(void)
> +{
> +       u32 multiboot;
> +
> +       multiboot = readl(&csu_base->multi_boot);
> +
> +       printf("Multiboot:\t%x\n", multiboot);
> +
> +       return 0;
> +}
> +
>  int board_init(void)
>  {
>         struct udevice *dev;
> @@ -357,6 +368,9 @@ int board_init(void)
>         }
>  #endif
>
> +       if (current_el() == 3)
> +               multi_boot();
> +
>         return 0;
>  }
>
> --
> 2.25.0
>

Applied.
M
diff mbox series

Patch

diff --git a/arch/arm/mach-zynqmp/include/mach/hardware.h b/arch/arm/mach-zynqmp/include/mach/hardware.h
index fd361c5ce8a5..a0acfa2ff1ed 100644
--- a/arch/arm/mach-zynqmp/include/mach/hardware.h
+++ b/arch/arm/mach-zynqmp/include/mach/hardware.h
@@ -128,7 +128,9 @@  struct apu_regs {
 #define ZYNQMP_SILICON_VER_SHIFT	12
 
 struct csu_regs {
-	u32 reserved0[17];
+	u32 reserved0[4];
+	u32 multi_boot;
+	u32 reserved1[12];
 	u32 version;
 };
 
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 6b0451913db8..8d3613147162 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -329,6 +329,17 @@  int board_early_init_f(void)
 	return ret;
 }
 
+static int multi_boot(void)
+{
+	u32 multiboot;
+
+	multiboot = readl(&csu_base->multi_boot);
+
+	printf("Multiboot:\t%x\n", multiboot);
+
+	return 0;
+}
+
 int board_init(void)
 {
 	struct udevice *dev;
@@ -357,6 +368,9 @@  int board_init(void)
 	}
 #endif
 
+	if (current_el() == 3)
+		multi_boot();
+
 	return 0;
 }