rk3036-board-spl.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2015 Rockchip Electronics Co., Ltd
  4. */
  5. #include <common.h>
  6. #include <debug_uart.h>
  7. #include <asm/io.h>
  8. #include <asm/arch-rockchip/bootrom.h>
  9. #include <asm/arch-rockchip/grf_rk3036.h>
  10. #include <asm/arch-rockchip/hardware.h>
  11. #include <asm/arch-rockchip/sdram_rk3036.h>
  12. #include <asm/arch-rockchip/timer.h>
  13. #include <asm/arch-rockchip/uart.h>
  14. #define GRF_BASE 0x20008000
  15. #define DEBUG_UART_BASE 0x20068000
  16. void board_init_f(ulong dummy)
  17. {
  18. #ifdef EARLY_DEBUG
  19. struct rk3036_grf * const grf = (void *)GRF_BASE;
  20. /*
  21. * NOTE: sd card and debug uart use same iomux in rk3036,
  22. * so if you enable uart,
  23. * you can not boot from sdcard
  24. */
  25. rk_clrsetreg(&grf->gpio1c_iomux,
  26. GPIO1C3_MASK << GPIO1C3_SHIFT |
  27. GPIO1C2_MASK << GPIO1C2_SHIFT,
  28. GPIO1C3_UART2_SOUT << GPIO1C3_SHIFT |
  29. GPIO1C2_UART2_SIN << GPIO1C2_SHIFT);
  30. debug_uart_init();
  31. #endif
  32. rockchip_timer_init();
  33. sdram_init();
  34. /* return to maskrom */
  35. back_to_bootrom(BROM_BOOT_NEXTSTAGE);
  36. }
  37. /* Place Holders */
  38. void board_init_r(gd_t *id, ulong dest_addr)
  39. {
  40. /*
  41. * Function attribute is no-return
  42. * This Function never executes
  43. */
  44. while (1)
  45. ;
  46. }