board.c 956 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2012 Atmel Corporation
  4. * Copyright (C) 2019 Stefan Roese <sr@denx.de>
  5. */
  6. #include <common.h>
  7. #include <debug_uart.h>
  8. #include <env.h>
  9. #include <led.h>
  10. #include <asm/arch/at91_common.h>
  11. #include <asm/arch/clk.h>
  12. DECLARE_GLOBAL_DATA_PTR;
  13. static void at91_prepare_cpu_var(void)
  14. {
  15. env_set("cpu", get_cpu_name());
  16. }
  17. int board_late_init(void)
  18. {
  19. at91_prepare_cpu_var();
  20. if (IS_ENABLED(CONFIG_LED))
  21. led_default_state();
  22. return 0;
  23. }
  24. #ifdef CONFIG_DEBUG_UART_BOARD_INIT
  25. void board_debug_uart_init(void)
  26. {
  27. at91_seriald_hw_init();
  28. }
  29. #endif
  30. int board_early_init_f(void)
  31. {
  32. #ifdef CONFIG_DEBUG_UART
  33. debug_uart_init();
  34. #endif
  35. return 0;
  36. }
  37. int board_init(void)
  38. {
  39. /* Address of boot parameters */
  40. gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
  41. return 0;
  42. }
  43. int dram_init(void)
  44. {
  45. gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
  46. CONFIG_SYS_SDRAM_SIZE);
  47. return 0;
  48. }