board_info.c 540 B

12345678910111213141516171819202122232425262728293031
  1. // SPDX-License-Identifier: GPL-2.0+
  2. #include <common.h>
  3. #include <init.h>
  4. #include <asm/global_data.h>
  5. #include <linux/libfdt.h>
  6. #include <linux/compiler.h>
  7. int __weak checkboard(void)
  8. {
  9. return 0;
  10. }
  11. /*
  12. * If the root node of the DTB has a "model" property, show it.
  13. * Then call checkboard().
  14. */
  15. int __weak show_board_info(void)
  16. {
  17. #ifdef CONFIG_OF_CONTROL
  18. DECLARE_GLOBAL_DATA_PTR;
  19. const char *model;
  20. model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
  21. if (model)
  22. printf("Model: %s\n", model);
  23. #endif
  24. return checkboard();
  25. }