diff mbox series

[1/2] Fix Espressobin build for configs where ENV is not in SPI

Message ID 1644362821-9002-2-git-send-email-rogier@unrailed.org
State Accepted
Commit a37b68820c432ff9b0b3dab597d94f7bbfa5d1e2
Delegated to: Stefan Roese
Headers show
Series U-Boot ENV in EXT4 support for Expressobin (revised) | expand

Commit Message

Rogier Stam Feb. 8, 2022, 11:27 p.m. UTC
When storing the UBoot Environment in for example EXT4,
the U-Boot build is broken for several reasons:
1. armada-385-turris-omnia-u-boot.dtsi will not allow
   CONFIG_ENV_OFFSET and CONFIG_ENV_SIZE to be undefined
2. armada-37xx/board.c ft_board_setup function does not
   exist if CONFIG_ENV_IS_IN_SPI_FLASH is not defined

This commit changes these files so that selecting a
different location for the environment is possible.

Signed-off-by: Rogier Stam <rogier@unrailed.org>
---
 arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi | 2 ++
 board/Marvell/mvebu_armada-37xx/board.c          | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Pali Rohár Feb. 28, 2022, 7:10 a.m. UTC | #1
+ Marek, Stefan

On Wednesday 09 February 2022 00:27:00 Rogier Stam wrote:
> When storing the UBoot Environment in for example EXT4,
> the U-Boot build is broken for several reasons:
> 1. armada-385-turris-omnia-u-boot.dtsi will not allow
>    CONFIG_ENV_OFFSET and CONFIG_ENV_SIZE to be undefined
> 2. armada-37xx/board.c ft_board_setup function does not
>    exist if CONFIG_ENV_IS_IN_SPI_FLASH is not defined
> 
> This commit changes these files so that selecting a
> different location for the environment is possible.
> 
> Signed-off-by: Rogier Stam <rogier@unrailed.org>

Reviewed-by: Pali Rohár <pali@kernel.org>

> ---
>  arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi | 2 ++
>  board/Marvell/mvebu_armada-37xx/board.c          | 4 +++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi b/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi
> index 3ff76c9..008787e 100644
> --- a/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi
> +++ b/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi
> @@ -38,6 +38,7 @@
>  	};
>  };
>  
> +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
>  &spi0 {
>  	u-boot,dm-pre-reloc;
>  
> @@ -56,6 +57,7 @@
>  		};
>  	};
>  };
> +#endif
>  
>  &uart0 {
>  	u-boot,dm-pre-reloc;
> diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c
> index d7b6eca..5bace0c 100644
> --- a/board/Marvell/mvebu_armada-37xx/board.c
> +++ b/board/Marvell/mvebu_armada-37xx/board.c
> @@ -328,9 +328,10 @@ int board_network_enable(struct mii_dev *bus)
>  	return 0;
>  }
>  
> -#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_ENV_IS_IN_SPI_FLASH)
> +#ifdef CONFIG_OF_BOARD_SETUP
>  int ft_board_setup(void *blob, struct bd_info *bd)
>  {
> +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
>  	int ret;
>  	int spi_off;
>  	int parts_off;
> @@ -424,6 +425,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
>  		return 0;
>  	}
>  
> +#endif
>  	return 0;
>  }
>  #endif
> -- 
> 2.7.4
>
Stefan Roese April 21, 2022, 1:55 p.m. UTC | #2
On 2/28/22 08:10, Pali Rohár wrote:
> + Marek, Stefan
> 
> On Wednesday 09 February 2022 00:27:00 Rogier Stam wrote:
>> When storing the UBoot Environment in for example EXT4,
>> the U-Boot build is broken for several reasons:
>> 1. armada-385-turris-omnia-u-boot.dtsi will not allow
>>     CONFIG_ENV_OFFSET and CONFIG_ENV_SIZE to be undefined
>> 2. armada-37xx/board.c ft_board_setup function does not
>>     exist if CONFIG_ENV_IS_IN_SPI_FLASH is not defined
>>
>> This commit changes these files so that selecting a
>> different location for the environment is possible.
>>
>> Signed-off-by: Rogier Stam <rogier@unrailed.org>
> 
> Reviewed-by: Pali Rohár <pali@kernel.org>

Applied to u-boot-marvell/master

Thanks,
Stefan

>> ---
>>   arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi | 2 ++
>>   board/Marvell/mvebu_armada-37xx/board.c          | 4 +++-
>>   2 files changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi b/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi
>> index 3ff76c9..008787e 100644
>> --- a/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi
>> +++ b/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi
>> @@ -38,6 +38,7 @@
>>   	};
>>   };
>>   
>> +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
>>   &spi0 {
>>   	u-boot,dm-pre-reloc;
>>   
>> @@ -56,6 +57,7 @@
>>   		};
>>   	};
>>   };
>> +#endif
>>   
>>   &uart0 {
>>   	u-boot,dm-pre-reloc;
>> diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c
>> index d7b6eca..5bace0c 100644
>> --- a/board/Marvell/mvebu_armada-37xx/board.c
>> +++ b/board/Marvell/mvebu_armada-37xx/board.c
>> @@ -328,9 +328,10 @@ int board_network_enable(struct mii_dev *bus)
>>   	return 0;
>>   }
>>   
>> -#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_ENV_IS_IN_SPI_FLASH)
>> +#ifdef CONFIG_OF_BOARD_SETUP
>>   int ft_board_setup(void *blob, struct bd_info *bd)
>>   {
>> +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
>>   	int ret;
>>   	int spi_off;
>>   	int parts_off;
>> @@ -424,6 +425,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
>>   		return 0;
>>   	}
>>   
>> +#endif
>>   	return 0;
>>   }
>>   #endif
>> -- 
>> 2.7.4
>>

Viele Grüße,
Stefan Roese
diff mbox series

Patch

diff --git a/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi b/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi
index 3ff76c9..008787e 100644
--- a/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi
+++ b/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi
@@ -38,6 +38,7 @@ 
 	};
 };
 
+#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
 &spi0 {
 	u-boot,dm-pre-reloc;
 
@@ -56,6 +57,7 @@ 
 		};
 	};
 };
+#endif
 
 &uart0 {
 	u-boot,dm-pre-reloc;
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c
index d7b6eca..5bace0c 100644
--- a/board/Marvell/mvebu_armada-37xx/board.c
+++ b/board/Marvell/mvebu_armada-37xx/board.c
@@ -328,9 +328,10 @@  int board_network_enable(struct mii_dev *bus)
 	return 0;
 }
 
-#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_ENV_IS_IN_SPI_FLASH)
+#ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
+#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
 	int ret;
 	int spi_off;
 	int parts_off;
@@ -424,6 +425,7 @@  int ft_board_setup(void *blob, struct bd_info *bd)
 		return 0;
 	}
 
+#endif
 	return 0;
 }
 #endif