diff mbox series

[v3,04/10] arm: mvebu: clearfog: Use Pro DT by default

Message ID 20200121173224.20895-5-mrjoel@lixil.net
State New
Headers show
Series ClearFog Base static variant support | expand

Commit Message

Joel Johnson Jan. 21, 2020, 5:32 p.m. UTC
Switch to explicitly using the Pro variant DT, which has been
available since Linux 4.11. Also unify the location of DT selection
in board_late_init instead of split between detection and static
configuration paths.

---

v2 changes
  - newly added in V2 series based on run-time rebasing
v2 changes
  - none

Signed-off-by: Joel Johnson <mrjoel at lixil.net>
---
 board/solidrun/clearfog/clearfog.c | 6 ++++--
 include/configs/clearfog.h         | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Baruch Siach Jan. 23, 2020, 6:52 a.m. UTC | #1
Hi Joel,

On Tue, Jan 21, 2020 at 10:32:18AM -0700, Joel Johnson wrote:
> Switch to explicitly using the Pro variant DT, which has been
> available since Linux 4.11. Also unify the location of DT selection
> in board_late_init instead of split between detection and static
> configuration paths.
> 
> ---
> 
> v2 changes
>   - newly added in V2 series based on run-time rebasing
> v2 changes
>   - none
> 
> Signed-off-by: Joel Johnson <mrjoel at lixil.net>
> ---
>  board/solidrun/clearfog/clearfog.c | 6 ++++--
>  include/configs/clearfog.h         | 1 -
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
> index e77b9465d4..086912e400 100644
> --- a/board/solidrun/clearfog/clearfog.c
> +++ b/board/solidrun/clearfog/clearfog.c
> @@ -177,7 +177,7 @@ int checkboard(void)
>  #if defined (CONFIG_TARGET_CLEARFOG_BASE)
>  	char *board = "ClearFog Base";
>  #else
> -	char *board = "ClearFog";
> +	char *board = "ClearFog Pro";
>  #endif
>  
>  	cf_read_tlv_data();
> @@ -208,9 +208,11 @@ int board_late_init(void)
>  		env_set("fdtfile", "armada-385-clearfog-gtr-s4.dtb");
>  	else if (sr_product_is(&cf_tlv_data, "Clearfog GTR L8"))
>  		env_set("fdtfile", "armada-385-clearfog-gtr-l8.dtb");
> -#if defined (CONFIG_TARGET_CLEARFOG_BASE)
>  	else
> +#if defined (CONFIG_TARGET_CLEARFOG_BASE)
>  		 env_set("fdtfile", "armada-388-clearfog-base.dtb");
> +#else
> +		 env_set("fdtfile", "armada-388-clearfog-pro.dtb");

I'd prefer to keep the default here for backwards compatibility. The kernel 
also keeps armada-388-clearfog.dtb. The -pro variant only updates the 'model' 
and 'compatible' properties.

Unrelated to that here is another reason to avoid #ifdef. Syntax aware text 
editor automatic indentation might fail to see that the second env_set() is in 
the 'else' block. We can workaround that by adding braces around the block, 
but it's not nice.

baruch

>  #endif
>  
>  	return 0;
> diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
> index 633187d86f..6ca0474461 100644
> --- a/include/configs/clearfog.h
> +++ b/include/configs/clearfog.h
> @@ -134,7 +134,6 @@
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	RELOCATION_LIMITS_ENV_SETTINGS \
>  	LOAD_ADDRESS_ENV_SETTINGS \
> -	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
>  	"console=ttyS0,115200\0" \
>  	BOOTENV
diff mbox series

Patch

diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
index e77b9465d4..086912e400 100644
--- a/board/solidrun/clearfog/clearfog.c
+++ b/board/solidrun/clearfog/clearfog.c
@@ -177,7 +177,7 @@  int checkboard(void)
 #if defined (CONFIG_TARGET_CLEARFOG_BASE)
 	char *board = "ClearFog Base";
 #else
-	char *board = "ClearFog";
+	char *board = "ClearFog Pro";
 #endif
 
 	cf_read_tlv_data();
@@ -208,9 +208,11 @@  int board_late_init(void)
 		env_set("fdtfile", "armada-385-clearfog-gtr-s4.dtb");
 	else if (sr_product_is(&cf_tlv_data, "Clearfog GTR L8"))
 		env_set("fdtfile", "armada-385-clearfog-gtr-l8.dtb");
-#if defined (CONFIG_TARGET_CLEARFOG_BASE)
 	else
+#if defined (CONFIG_TARGET_CLEARFOG_BASE)
 		 env_set("fdtfile", "armada-388-clearfog-base.dtb");
+#else
+		 env_set("fdtfile", "armada-388-clearfog-pro.dtb");
 #endif
 
 	return 0;
diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
index 633187d86f..6ca0474461 100644
--- a/include/configs/clearfog.h
+++ b/include/configs/clearfog.h
@@ -134,7 +134,6 @@ 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	RELOCATION_LIMITS_ENV_SETTINGS \
 	LOAD_ADDRESS_ENV_SETTINGS \
-	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
 	"console=ttyS0,115200\0" \
 	BOOTENV