rk3036-board-spl.c 1.2 KB

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