sunxi: board: Move USB ethernet initialization to board_late_init()
Subsystems (2)
PATCH 1/1 sunxi: board: Move USB ethernet initialization to board_late_init()
For the sake of consistency (*) and order of initialization, i.e. after we have got the ethernet address, interrupt and timer initialized, try to initialize USB ethernet gadget.
*) for example, zynqmp uses same order.
--- arch/arm/Kconfig | 1 + board/sunxi/board.c | 5 +++++ 2 files changed, 6 insertions(+)
arch/arm/Kconfig +1 -0
@@ -1045,6 +1045,7 @@ config ARCH_SUNXI select SPL_USE_TINY_PRINTF select USE_PREBOOT select SYS_RELOC_GD_ENV_ADDR + imply BOARD_LATE_INIT imply CMD_DM imply CMD_GPT imply CMD_UBI if MTD_RAW_NAND
board/sunxi/board.c +5 -0
@@ -890,6 +890,11 @@ int misc_init_r(void)setup_environment (gd->fdt_blob); +return 0 ; +} + +int board_late_init (void ) +{#ifdef CONFIG_USB_ETHER usb_ether_init ();#endif
Signature · 1 line
2.29.2
PATCH 1/1 sunxi: board: Move USB ethernet initialization to board_late_init()
Quoted 5 lines · Andy Shevchenko
For the sake of consistency (*) and order of initialization, i.e. after we have got the ethernet address, interrupt and timer initialized, try to initialize USB ethernet gadget.
*) for example, zynqmp uses same order.
Looks alright, but we need some testing, to check for possible side effects. (It's those seemingly innocent changes that tend to break things). Will get back to you later.
Cheers,
Andre
Quoted 36 lines
Signed-off-by Andy Shevchenko <[email protected]>--- arch/arm/Kconfig | 1 + board/sunxi/board.c | 5 +++++ 2 files changed, 6 insertions(+)arch/arm/Kconfig +1
-0@@ -1045,6 +1045,7 @@ config ARCH_SUNXI select SPL_USE_TINY_PRINTF select USE_PREBOOT select SYS_RELOC_GD_ENV_ADDR + imply BOARD_LATE_INIT imply CMD_DM imply CMD_GPT imply CMD_UBI if MTD_RAW_NANDboard/sunxi/board.c +5
-0@@ -890,6 +890,11 @@ int misc_init_r(void)setup_environment (gd->fdt_blob); +return 0 ; +} + +int board_late_init (void ) +{#ifdef CONFIG_USB_ETHER usb_ether_init ();#endif
PATCH 1/1 sunxi: board: Move USB ethernet initialization to board_late_init()
Quoted 9 lines · Andr? Przywara
Quoted 5 lines · Andy Shevchenko
For the sake of consistency (*) and order of initialization, i.e. after we have got the ethernet address, interrupt and timer initialized, try to initialize USB ethernet gadget.
*) for example, zynqmp uses same order.
Looks alright, but we need some testing, to check for possible side effects. (It's those seemingly innocent changes that tend to break things).
Right. I made a patch purely based on reading the U-Boot initialization code.
Quoted 1 line
Will get back to you later.
Take your time and thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 1/1 sunxi: board: Move USB ethernet initialization to board_late_init()
In reply to Andy ShevchenkoOn 08/12/2020 15:45, Andy Shevchenko wrote:
Hi,
Quoted 7 lines
For the sake of consistency (*) and order of initialization, i.e. after we have got the ethernet address, interrupt and timer initialized, try to initialize USB ethernet gadget.
*) for example, zynqmp uses same order.
Signed-off-by Andy Shevchenko <[email protected]>
I tried on: Pine64-LTS, Pine H64, OrangePi Zero, Banana Pi M1. Could do TFTP correctly. Also compared the MAC addresses before and after.
I will queue this for the merge window, to get some more exposure.
Cheers,
Andre
Quoted 34 lines
--- arch/arm/Kconfig | 1 + board/sunxi/board.c | 5 +++++ 2 files changed, 6 insertions(+)arch/arm/Kconfig +1
-0@@ -1045,6 +1045,7 @@ config ARCH_SUNXI select SPL_USE_TINY_PRINTF select USE_PREBOOT select SYS_RELOC_GD_ENV_ADDR + imply BOARD_LATE_INIT imply CMD_DM imply CMD_GPT imply CMD_UBI if MTD_RAW_NANDboard/sunxi/board.c +5
-0@@ -890,6 +890,11 @@ int misc_init_r(void)setup_environment (gd->fdt_blob); +return 0 ; +} + +int board_late_init (void ) +{#ifdef CONFIG_USB_ETHER usb_ether_init ();#endif