blob: 3e2da0d6f8e01f35bd2873a4ee33a249d0d00ed4 [file] [log] [blame]
Stefan Roesea71e2f92019-04-02 10:57:27 +02001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2012 Atmel Corporation
4 * Copyright (C) 2019 Stefan Roese <sr@denx.de>
5 */
6
7#include <common.h>
8#include <debug_uart.h>
Simon Glass9fb625c2019-08-01 09:46:51 -06009#include <env.h>
Stefan Roesea71e2f92019-04-02 10:57:27 +020010#include <led.h>
11#include <asm/arch/at91_common.h>
12#include <asm/arch/clk.h>
13
14DECLARE_GLOBAL_DATA_PTR;
15
16static void at91_prepare_cpu_var(void)
17{
18 env_set("cpu", get_cpu_name());
19}
20
21int board_late_init(void)
22{
23 at91_prepare_cpu_var();
24
25 if (IS_ENABLED(CONFIG_LED))
26 led_default_state();
27
28 return 0;
29}
30
31#ifdef CONFIG_DEBUG_UART_BOARD_INIT
32void board_debug_uart_init(void)
33{
34 at91_seriald_hw_init();
35}
36#endif
37
38int board_early_init_f(void)
39{
40#ifdef CONFIG_DEBUG_UART
41 debug_uart_init();
42#endif
43 return 0;
44}
45
46int board_init(void)
47{
48 /* Address of boot parameters */
49 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
50
51 return 0;
52}
53
54int dram_init(void)
55{
56 gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
57 CONFIG_SYS_SDRAM_SIZE);
58
59 return 0;
60}