diff mbox series

xilinx: Add support for ENV_VARS_UBOOT_RUNTIME_CONFIG

Message ID 6d42afd6bafbebd07947f8e613f9da4ff25c5f3a.1596628898.git.michal.simek@xilinx.com
State New
Delegated to: Michal Simek
Headers show
Series xilinx: Add support for ENV_VARS_UBOOT_RUNTIME_CONFIG | expand

Commit Message

Michal Simek Aug. 5, 2020, 12:01 p.m. UTC
Start to use ENV_VARS_UBOOT_RUNTIME_CONFIG to enable/disable updating
variables with run time information.

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

 arch/arm/Kconfig             | 3 +++
 board/xilinx/versal/board.c  | 3 +++
 board/xilinx/zynq/board.c    | 8 ++++++++
 board/xilinx/zynqmp/zynqmp.c | 3 +++
 4 files changed, 17 insertions(+)

Comments

Michal Simek Aug. 20, 2020, 7:57 a.m. UTC | #1
st 5. 8. 2020 v 14:01 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Start to use ENV_VARS_UBOOT_RUNTIME_CONFIG to enable/disable updating
> variables with run time information.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  arch/arm/Kconfig             | 3 +++
>  board/xilinx/versal/board.c  | 3 +++
>  board/xilinx/zynq/board.c    | 8 ++++++++
>  board/xilinx/zynqmp/zynqmp.c | 3 +++
>  4 files changed, 17 insertions(+)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 156698f23d48..7e54288ad789 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1075,6 +1075,7 @@ config ARCH_VERSAL
>         select DM_SERIAL
>         select OF_CONTROL
>         imply BOARD_LATE_INIT
> +       imply ENV_VARS_UBOOT_RUNTIME_CONFIG
>
>  config ARCH_VF610
>         bool "Freescale Vybrid"
> @@ -1110,6 +1111,7 @@ config ARCH_ZYNQ
>         imply CMD_CLK
>         imply CMD_DM
>         imply CMD_SPL
> +       imply ENV_VARS_UBOOT_RUNTIME_CONFIG
>         imply FAT_WRITE
>
>  config ARCH_ZYNQMP_R5
> @@ -1149,6 +1151,7 @@ config ARCH_ZYNQMP
>         select ZYNQMP_IPI
>         imply BOARD_LATE_INIT
>         imply CMD_DM
> +       imply ENV_VARS_UBOOT_RUNTIME_CONFIG
>         imply FAT_WRITE
>         imply MP
>         imply DM_USB_GADGET
> diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c
> index 3dc7044b213e..a5ca4ca87401 100644
> --- a/board/xilinx/versal/board.c
> +++ b/board/xilinx/versal/board.c
> @@ -116,6 +116,9 @@ int board_late_init(void)
>                 return 0;
>         }
>
> +       if (!CONFIG_IS_ENABLED(ENV_VARS_UBOOT_RUNTIME_CONFIG))
> +               return 0;
> +
>         bootmode = versal_get_bootmode();
>
>         puts("Bootmode: ");
> diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
> index 2164eac8d518..f98497eb73d6 100644
> --- a/board/xilinx/zynq/board.c
> +++ b/board/xilinx/zynq/board.c
> @@ -33,6 +33,14 @@ int board_late_init(void)
>         char *new_targets;
>         char *env_targets;
>
> +       if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
> +               debug("Saved variables - Skipping\n");
> +               return 0;
> +       }
> +
> +       if (!CONFIG_IS_ENABLED(ENV_VARS_UBOOT_RUNTIME_CONFIG))
> +               return 0;
> +
>         switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
>         case ZYNQ_BM_QSPI:
>                 mode = "qspi";
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index e8ea3c5a4975..de25f804fcd7 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -521,6 +521,9 @@ int board_late_init(void)
>                 return 0;
>         }
>
> +       if (!CONFIG_IS_ENABLED(ENV_VARS_UBOOT_RUNTIME_CONFIG))
> +               return 0;
> +
>         ret = set_fdtfile();
>         if (ret)
>                 return ret;
> --
> 2.27.0
>

Applied with adding missing log.h to zynq/board.c

Thanks,
Michal
diff mbox series

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 156698f23d48..7e54288ad789 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1075,6 +1075,7 @@  config ARCH_VERSAL
 	select DM_SERIAL
 	select OF_CONTROL
 	imply BOARD_LATE_INIT
+	imply ENV_VARS_UBOOT_RUNTIME_CONFIG
 
 config ARCH_VF610
 	bool "Freescale Vybrid"
@@ -1110,6 +1111,7 @@  config ARCH_ZYNQ
 	imply CMD_CLK
 	imply CMD_DM
 	imply CMD_SPL
+	imply ENV_VARS_UBOOT_RUNTIME_CONFIG
 	imply FAT_WRITE
 
 config ARCH_ZYNQMP_R5
@@ -1149,6 +1151,7 @@  config ARCH_ZYNQMP
 	select ZYNQMP_IPI
 	imply BOARD_LATE_INIT
 	imply CMD_DM
+	imply ENV_VARS_UBOOT_RUNTIME_CONFIG
 	imply FAT_WRITE
 	imply MP
 	imply DM_USB_GADGET
diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c
index 3dc7044b213e..a5ca4ca87401 100644
--- a/board/xilinx/versal/board.c
+++ b/board/xilinx/versal/board.c
@@ -116,6 +116,9 @@  int board_late_init(void)
 		return 0;
 	}
 
+	if (!CONFIG_IS_ENABLED(ENV_VARS_UBOOT_RUNTIME_CONFIG))
+		return 0;
+
 	bootmode = versal_get_bootmode();
 
 	puts("Bootmode: ");
diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index 2164eac8d518..f98497eb73d6 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -33,6 +33,14 @@  int board_late_init(void)
 	char *new_targets;
 	char *env_targets;
 
+	if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
+		debug("Saved variables - Skipping\n");
+		return 0;
+	}
+
+	if (!CONFIG_IS_ENABLED(ENV_VARS_UBOOT_RUNTIME_CONFIG))
+		return 0;
+
 	switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
 	case ZYNQ_BM_QSPI:
 		mode = "qspi";
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index e8ea3c5a4975..de25f804fcd7 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -521,6 +521,9 @@  int board_late_init(void)
 		return 0;
 	}
 
+	if (!CONFIG_IS_ENABLED(ENV_VARS_UBOOT_RUNTIME_CONFIG))
+		return 0;
+
 	ret = set_fdtfile();
 	if (ret)
 		return ret;