diff mbox series

board: ti: am335x: eth_cpsw should depend on CONFIG_NET

Message ID 20220614084407.1991748-1-clabbe@baylibre.com
State Accepted
Commit 2f51f946e3e97d3d9463e0f199d055dbcb4eef02
Delegated to: Tom Rini
Headers show
Series board: ti: am335x: eth_cpsw should depend on CONFIG_NET | expand

Commit Message

Corentin LABBE June 14, 2022, 8:44 a.m. UTC
The origin of this patch is the breaking of am335x-hs boot
due to commit e41651fffda7 ("dm: Support parent devices with of-platdata")
HS boards have less SRAM for SPL and so this commit increased memory usage beyond am335x limit.
This commit added 10 driver binding pass and am335x boot only if one pass is done.
SPL try to do more than one pass due to eth_cpsw failing.
Since HS SPL does not need network (and NET is already disabled in config),
the easiest fix is to "remove" eth_cpsw from SPL by testing if NET is enabled.

Signed-off-by: Corentin LABBE <clabbe@baylibre.com>
---
 board/ti/am335x/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini June 14, 2022, 12:42 p.m. UTC | #1
On Tue, Jun 14, 2022 at 08:44:07AM +0000, Corentin LABBE wrote:

> The origin of this patch is the breaking of am335x-hs boot
> due to commit e41651fffda7 ("dm: Support parent devices with of-platdata")
> HS boards have less SRAM for SPL and so this commit increased memory usage beyond am335x limit.
> This commit added 10 driver binding pass and am335x boot only if one pass is done.
> SPL try to do more than one pass due to eth_cpsw failing.
> Since HS SPL does not need network (and NET is already disabled in config),
> the easiest fix is to "remove" eth_cpsw from SPL by testing if NET is enabled.
> 
> Signed-off-by: Corentin LABBE <clabbe@baylibre.com>

Fixes: e41651fffda7 ("dm: Support parent devices with of-platdata")
Reviewed-by: Tom Rini <trini@konsulko.com>
Andrew Davis June 14, 2022, 2:07 p.m. UTC | #2
On 6/14/22 3:44 AM, Corentin LABBE wrote:
> The origin of this patch is the breaking of am335x-hs boot
> due to commit e41651fffda7 ("dm: Support parent devices with of-platdata")
> HS boards have less SRAM for SPL and so this commit increased memory usage beyond am335x limit.
> This commit added 10 driver binding pass and am335x boot only if one pass is done.
> SPL try to do more than one pass due to eth_cpsw failing.
> Since HS SPL does not need network (and NET is already disabled in config),
> the easiest fix is to "remove" eth_cpsw from SPL by testing if NET is enabled.
> 
> Signed-off-by: Corentin LABBE <clabbe@baylibre.com>
> ---


If no one was using this data I wonder if the compiler could have removed
it with LTO enabled.. Something to think on.

Acked-by: Andrew Davis <afd@ti.com>


>   board/ti/am335x/board.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
> index 7c0545892c..2cb5b1cb3f 100644
> --- a/board/ti/am335x/board.c
> +++ b/board/ti/am335x/board.c
> @@ -902,7 +902,7 @@ int board_late_init(void)
>   #endif
>   
>   /* CPSW plat */
> -#if !CONFIG_IS_ENABLED(OF_CONTROL)
> +#if CONFIG_IS_ENABLED(NET) && !CONFIG_IS_ENABLED(OF_CONTROL)
>   struct cpsw_slave_data slave_data[] = {
>   	{
>   		.slave_reg_ofs  = CPSW_SLAVE0_OFFSET,
Tom Rini June 17, 2022, 1:17 p.m. UTC | #3
On Tue, Jun 14, 2022 at 08:44:07AM +0000, Corentin LABBE wrote:

> The origin of this patch is the breaking of am335x-hs boot
> due to commit e41651fffda7 ("dm: Support parent devices with of-platdata")
> HS boards have less SRAM for SPL and so this commit increased memory usage beyond am335x limit.
> This commit added 10 driver binding pass and am335x boot only if one pass is done.
> SPL try to do more than one pass due to eth_cpsw failing.
> Since HS SPL does not need network (and NET is already disabled in config),
> the easiest fix is to "remove" eth_cpsw from SPL by testing if NET is enabled.
> 
> Signed-off-by: Corentin LABBE <clabbe@baylibre.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> Acked-by: Andrew Davis <afd@ti.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 7c0545892c..2cb5b1cb3f 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -902,7 +902,7 @@  int board_late_init(void)
 #endif
 
 /* CPSW plat */
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
+#if CONFIG_IS_ENABLED(NET) && !CONFIG_IS_ENABLED(OF_CONTROL)
 struct cpsw_slave_data slave_data[] = {
 	{
 		.slave_reg_ofs  = CPSW_SLAVE0_OFFSET,