blob: 00de27781252c399adea9eadabc6e7faf69990b2 [file] [log] [blame]
Durai Manickam KR2e7bc612022-04-04 11:23:18 +05301// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries
4 *
5 * Author: Durai Manickam KR <durai.manickamkr@microchip.com>
6 */
7
8#include <common.h>
9#include <debug_uart.h>
10#include <fdtdec.h>
11#include <init.h>
12#include <asm/arch/at91_common.h>
13#include <asm/arch/at91_rstc.h>
14#include <asm/arch/at91_sfr.h>
15#include <asm/arch/at91sam9_smc.h>
16#include <asm/arch/clk.h>
17#include <asm/arch/gpio.h>
18#include <asm/global_data.h>
19#include <asm/io.h>
20#include <asm/mach-types.h>
21
22DECLARE_GLOBAL_DATA_PTR;
23
24void at91_prepare_cpu_var(void);
25
26int board_late_init(void)
27{
28 at91_prepare_cpu_var();
29
30 return 0;
31}
32
33#ifdef CONFIG_DEBUG_UART_BOARD_INIT
34void board_debug_uart_init(void)
35{
36 at91_seriald_hw_init();
37}
38#endif
39
40int board_early_init_f(void)
41{
42#ifdef CONFIG_DEBUG_UART
43 debug_uart_init();
44#endif
45 return 0;
46}
47
48#define MAC24AA_MAC_OFFSET 0xfa
49
50#ifdef CONFIG_MISC_INIT_R
51int misc_init_r(void)
52{
53#ifdef CONFIG_I2C_EEPROM
54 at91_set_ethaddr(MAC24AA_MAC_OFFSET);
55#endif
56 return 0;
57}
58#endif
59
60int board_init(void)
61{
62 /* address of boot parameters */
63 gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
64 return 0;
65}
66
67int dram_init_banksize(void)
68{
69 return fdtdec_setup_memory_banksize();
70}
71
72int dram_init(void)
73{
74 return fdtdec_setup_mem_size_base();
75}