servalt.c 949 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2018 Microsemi Corporation
  4. */
  5. #include <common.h>
  6. #include <image.h>
  7. #include <init.h>
  8. #include <asm/io.h>
  9. #include <led.h>
  10. enum {
  11. BOARD_TYPE_PCB116 = 0xAABBCE00,
  12. };
  13. int board_early_init_r(void)
  14. {
  15. /* Prepare SPI controller to be used in master mode */
  16. writel(0, BASE_CFG + ICPU_SW_MODE);
  17. /* Address of boot parameters */
  18. gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE;
  19. /* LED setup */
  20. if (IS_ENABLED(CONFIG_LED))
  21. led_default_state();
  22. return 0;
  23. }
  24. static void do_board_detect(void)
  25. {
  26. gd->board_type = BOARD_TYPE_PCB116; /* ServalT */
  27. }
  28. #if defined(CONFIG_MULTI_DTB_FIT)
  29. int board_fit_config_name_match(const char *name)
  30. {
  31. if (gd->board_type == BOARD_TYPE_PCB116 &&
  32. strcmp(name, "servalt_pcb116") == 0)
  33. return 0;
  34. return -1;
  35. }
  36. #endif
  37. #if defined(CONFIG_DTB_RESELECT)
  38. int embedded_dtb_select(void)
  39. {
  40. do_board_detect();
  41. fdtdec_setup();
  42. return 0;
  43. }
  44. #endif