blob: 62938741ddd618fa636572e2d66b79c7cc3beea9 [file] [log] [blame]
Sandeep Sheriker Mallikarjun641b3352019-09-27 13:08:52 +00001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries
4 *
5 * Author: Sandeep Sheriker M <sandeep.sheriker@microchip.com>
6 */
7
8#include <common.h>
9#include <asm/io.h>
10#include <asm/arch/at91_common.h>
11#include <asm/arch/at91_rstc.h>
12#include <asm/arch/clk.h>
13#include <asm/arch/gpio.h>
14#include <debug_uart.h>
15#include <asm/mach-types.h>
16
17DECLARE_GLOBAL_DATA_PTR;
18
19void at91_prepare_cpu_var(void);
20
21#ifdef CONFIG_BOARD_LATE_INIT
22int board_late_init(void)
23{
24 at91_prepare_cpu_var();
25 return 0;
26}
27#endif
28
29#ifdef CONFIG_DEBUG_UART_BOARD_INIT
30void board_debug_uart_init(void)
31{
32 at91_seriald_hw_init();
33}
34#endif
35
36#ifdef CONFIG_BOARD_EARLY_INIT_F
37int board_early_init_f(void)
38{
39#ifdef CONFIG_DEBUG_UART
40 debug_uart_init();
41#endif
42 return 0;
43}
44#endif
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 return 0;
59}