[PATCH 01/13] arm: nanopi2: Remove unused code

Stefan Bosch stefan_b at posteo.net
Sat Apr 10 19:14:31 CEST 2021


Hi Tom,

CONFIG_REVISION_TAG has originally been defined in s5p4418_nanopi2.h. 
But this gets lost sometime in the past. Below my proposal for a patch 
which uses CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG instead.

Regards
Stefan


Signed-off-by: Stefan Bosch <stefan_b at posteo.net>
---

  board/friendlyarm/nanopi2/board.c | 4 ++--
  configs/s5p4418_nanopi2_defconfig | 1 +
  2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/board/friendlyarm/nanopi2/board.c 
b/board/friendlyarm/nanopi2/board.c
index c0fe2d546f..9e724e1095 100644
--- a/board/friendlyarm/nanopi2/board.c
+++ b/board/friendlyarm/nanopi2/board.c
@@ -295,7 +295,7 @@ static void set_ether_addr(void)
  	env_set("ethaddr", ethaddr);
  }

-#ifdef CONFIG_REVISION_TAG
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  static void set_board_rev(void)
  {
  	char info[64] = {0, };
@@ -436,7 +436,7 @@ int board_late_init(void)
  {
  	bd_update_env();

-#ifdef CONFIG_REVISION_TAG
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  	set_board_rev();
  #endif
  	set_dtb_name();
diff --git a/configs/s5p4418_nanopi2_defconfig 
b/configs/s5p4418_nanopi2_defconfig
index c5537bac34..82b057751d 100644
--- a/configs/s5p4418_nanopi2_defconfig
+++ b/configs/s5p4418_nanopi2_defconfig
@@ -57,3 +57,4 @@ CONFIG_SPLASH_SCREEN_ALIGN=y
  CONFIG_SPLASH_SOURCE=y
  CONFIG_BMP_24BPP=y
  CONFIG_ERRNO_STR=y
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
-- 
2.17.1



On 04.02.21 03:24, Tom Rini wrote:
> This platform did not ever enable CONFIG_REVISION_TAG, so the code to
> set the board_rev environment variable was never enabled.  This
> particular symbol is also only for use with the REVISION ATAG and this
> platform is new enough to have never supported an ATAG-based Linux
> Kernel.
> 
> Cc: Stefan Bosch <stefan_b at posteo.net>
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
> I'd be happy to see this patch replaced by one that enables what I think
> you meant to be doing and by default.  Thanks!
> ---
>   board/friendlyarm/nanopi2/board.c | 13 -------------
>   1 file changed, 13 deletions(-)
> 
> diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c
> index 68980536abe9..6e546853b863 100644
> --- a/board/friendlyarm/nanopi2/board.c
> +++ b/board/friendlyarm/nanopi2/board.c
> @@ -294,16 +294,6 @@ static void set_ether_addr(void)
>   	env_set("ethaddr", ethaddr);
>   }
>   
> -#ifdef CONFIG_REVISION_TAG
> -static void set_board_rev(void)
> -{
> -	char info[64] = {0, };
> -
> -	snprintf(info, ARRAY_SIZE(info), "%02x", get_board_rev());
> -	env_set("board_rev", info);
> -}
> -#endif
> -
>   static void set_dtb_name(void)
>   {
>   	char info[64] = {0, };
> @@ -435,9 +425,6 @@ int board_late_init(void)
>   {
>   	bd_update_env();
>   
> -#ifdef CONFIG_REVISION_TAG
> -	set_board_rev();
> -#endif
>   	set_dtb_name();
>   
>   	set_ether_addr();
> 


More information about the U-Boot mailing list