blob: c6eb11e93263f977370512c39fe9279d42ecfc03 [file] [log] [blame]
Stefan Roesedadede52019-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 Glass5e6201b2019-08-01 09:46:51 -06009#include <env.h>
Simon Glassa7b51302019-11-14 12:57:46 -070010#include <init.h>
Stefan Roesedadede52019-04-02 10:57:27 +020011#include <led.h>
12#include <asm/arch/at91_common.h>
13#include <asm/arch/clk.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060014#include <asm/global_data.h>
Stefan Roesedadede52019-04-02 10:57:27 +020015
16DECLARE_GLOBAL_DATA_PTR;
17
18static void at91_prepare_cpu_var(void)
19{
20 env_set("cpu", get_cpu_name());
21}
22
23int board_late_init(void)
24{
25 at91_prepare_cpu_var();
26
Stefan Roesedadede52019-04-02 10:57:27 +020027 return 0;
28}
29
30#ifdef CONFIG_DEBUG_UART_BOARD_INIT
31void board_debug_uart_init(void)
32{
33 at91_seriald_hw_init();
34}
35#endif
36
37int board_early_init_f(void)
38{
39#ifdef CONFIG_DEBUG_UART
40 debug_uart_init();
41#endif
42 return 0;
43}
44
45int board_init(void)
46{
47 /* Address of boot parameters */
48 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
49
50 return 0;
51}
52
53int dram_init(void)
54{
55 gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
56 CONFIG_SYS_SDRAM_SIZE);
57
58 return 0;
59}