Skip to content

Commit

Permalink
sunxi: Fix old GMAC pinmux setup
Browse files Browse the repository at this point in the history
Commit 5bc4cd0 ("sunxi: move non-essential code out of s_init()")
moved the call to eth_init_board() from s_init() into board_init_f().
This means it's now only called from the SPL, which makes sense for
most of the other moved low-level functions. However the GMAC pinmux and
clock setup in eth_init_board() was not happy about that, so it broke
the sun7i GMAC.

Since Ethernet is of no use in the SPL anyway, just move the call into
board_init(), which is only run in U-Boot proper.

This fixes Ethernet operation for the A20 SoCs, which broke in
v2022.04-rc1, with the above mentioned commit.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Tested-by: Petr Štetiar <ynezz@true.cz> [a20-olinuxino-lime2]
  • Loading branch information
Andre-ARM committed Mar 26, 2022
1 parent cbc05bb commit e943753
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion arch/arm/mach-sunxi/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ void board_init_f(ulong dummy)
clock_init();
timer_init();
gpio_init();
eth_init_board();

spl_init();
preloader_console_init();
Expand Down
3 changes: 3 additions & 0 deletions board/sunxi/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <asm/arch/prcm.h>
#include <asm/arch/pmic_bus.h>
#include <asm/arch/spl.h>
#include <asm/arch/sys_proto.h>
#include <asm/global_data.h>
#include <linux/delay.h>
#include <u-boot/crc.h>
Expand Down Expand Up @@ -308,6 +309,8 @@ int board_init(void)
#endif
#endif /* CONFIG_DM_MMC */

eth_init_board();

return 0;
}

Expand Down

0 comments on commit e943753

Please sign in to comment.