board.c 941 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 <init.h>
  10. #include <led.h>
  11. #include <asm/arch/at91_common.h>
  12. #include <asm/arch/clk.h>
  13. #include <asm/global_data.h>
  14. DECLARE_GLOBAL_DATA_PTR;
  15. static void at91_prepare_cpu_var(void)
  16. {
  17. env_set("cpu", get_cpu_name());
  18. }
  19. int board_late_init(void)
  20. {
  21. at91_prepare_cpu_var();
  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 = CFG_SYS_SDRAM_BASE + 0x100;
  41. return 0;
  42. }
  43. int dram_init(void)
  44. {
  45. gd->ram_size = get_ram_size((void *)CFG_SYS_SDRAM_BASE,
  46. CFG_SYS_SDRAM_SIZE);
  47. return 0;
  48. }