0002-arm-mvebu-Espressobin-move-network-setup-into-a-sepa.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From 3f8c18894a50fd45b81a807f217893f289500bc6 Mon Sep 17 00:00:00 2001
  2. From: Robert Marko <[email protected]>
  3. Date: Thu, 3 Aug 2023 14:24:31 +0200
  4. Subject: [PATCH 2/3] arm: mvebu: Espressobin: move network setup into a
  5. separate function
  6. Currently, Esspresobin switch is being setup directly in last_stage_init()
  7. which makes it hard to add support for any other board to be setup.
  8. So, lets just move the switch setup code to a separate function and call it
  9. if compatible matches, there should be no functional change.
  10. Signed-off-by: Robert Marko <[email protected]>
  11. ---
  12. board/Marvell/mvebu_armada-37xx/board.c | 16 +++++++++++-----
  13. 1 file changed, 11 insertions(+), 5 deletions(-)
  14. --- a/board/Marvell/mvebu_armada-37xx/board.c
  15. +++ b/board/Marvell/mvebu_armada-37xx/board.c
  16. @@ -300,15 +300,11 @@ static int mii_multi_chip_mode_write(str
  17. return 0;
  18. }
  19. -/* Bring-up board-specific network stuff */
  20. -int last_stage_init(void)
  21. +static int espressobin_last_stage_init(void)
  22. {
  23. struct udevice *bus;
  24. ofnode node;
  25. - if (!of_machine_is_compatible("globalscale,espressobin"))
  26. - return 0;
  27. -
  28. node = ofnode_by_compatible(ofnode_null(), "marvell,orion-mdio");
  29. if (!ofnode_valid(node) ||
  30. uclass_get_device_by_ofnode(UCLASS_MDIO, node, &bus) ||
  31. @@ -356,6 +352,16 @@ int last_stage_init(void)
  32. return 0;
  33. }
  34. +
  35. +/* Bring-up board-specific network stuff */
  36. +int last_stage_init(void)
  37. +{
  38. +
  39. + if (of_machine_is_compatible("globalscale,espressobin"))
  40. + return espressobin_last_stage_init();
  41. +
  42. + return 0;
  43. +}
  44. #endif
  45. #ifdef CONFIG_OF_BOARD_SETUP