fdt.c 868 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * (C) Copyright 2011, Missing Link Electronics
  3. * Joachim Foerster <joachim@missinglinkelectronics.com>
  4. *
  5. * Taken from arch/powerpc/cpu/ppc4xx/fdt.c:
  6. *
  7. * (C) Copyright 2007-2008
  8. * Stefan Roese, DENX Software Engineering, sr@denx.de.
  9. *
  10. * SPDX-License-Identifier: GPL-2.0+
  11. */
  12. #include <common.h>
  13. #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
  14. #include <libfdt.h>
  15. #include <fdt_support.h>
  16. DECLARE_GLOBAL_DATA_PTR;
  17. int __ft_board_setup(void *blob, bd_t *bd)
  18. {
  19. ft_cpu_setup(blob, bd);
  20. return 0;
  21. }
  22. int ft_board_setup(void *blob, bd_t *bd)
  23. __attribute__((weak, alias("__ft_board_setup")));
  24. void ft_cpu_setup(void *blob, bd_t *bd)
  25. {
  26. /*
  27. * Fixup all ethernet nodes
  28. * Note: aliases in the dts are required for this
  29. */
  30. fdt_fixup_ethernet(blob);
  31. return 0;
  32. }
  33. #endif /* CONFIG_OF_LIBFDT && CONFIG_OF_BOARD_SETUP */