rk3368-board-spl.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
  4. */
  5. #include <common.h>
  6. #include <debug_uart.h>
  7. #include <dm.h>
  8. #include <ram.h>
  9. #include <spl.h>
  10. #include <asm/io.h>
  11. #include <asm/arch-rockchip/cru_rk3368.h>
  12. #include <asm/arch-rockchip/grf_rk3368.h>
  13. #include <asm/arch-rockchip/hardware.h>
  14. #include <asm/arch-rockchip/periph.h>
  15. #include <asm/arch-rockchip/timer.h>
  16. #include <dm/pinctrl.h>
  17. void board_debug_uart_init(void)
  18. {
  19. }
  20. void board_init_f(ulong dummy)
  21. {
  22. struct udevice *pinctrl;
  23. struct udevice *dev;
  24. int ret;
  25. ret = spl_early_init();
  26. if (ret) {
  27. debug("spl_early_init() failed: %d\n", ret);
  28. hang();
  29. }
  30. /* Set up our preloader console */
  31. ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
  32. if (ret) {
  33. pr_err("%s: pinctrl init failed: %d\n", __func__, ret);
  34. hang();
  35. }
  36. ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART0);
  37. if (ret) {
  38. pr_err("%s: failed to set up console UART\n", __func__);
  39. hang();
  40. }
  41. preloader_console_init();
  42. ret = uclass_get_device(UCLASS_RAM, 0, &dev);
  43. if (ret) {
  44. debug("DRAM init failed: %d\n", ret);
  45. return;
  46. }
  47. }
  48. u32 spl_boot_device(void)
  49. {
  50. return BOOT_DEVICE_MMC1;
  51. }
  52. #ifdef CONFIG_SPL_LOAD_FIT
  53. int board_fit_config_name_match(const char *name)
  54. {
  55. /* Just empty function now - can't decide what to choose */
  56. debug("%s: %s\n", __func__, name);
  57. return 0;
  58. }
  59. #endif