board_info.c 511 B

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