blob: d8f32c93b555633bcc8540e45a8b077cf6e43ef8 [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{
Durai Manickam KR2e7bc612022-04-04 11:23:18 +053042 return 0;
43}
44
45#define MAC24AA_MAC_OFFSET 0xfa
46
47#ifdef CONFIG_MISC_INIT_R
48int misc_init_r(void)
49{
50#ifdef CONFIG_I2C_EEPROM
51 at91_set_ethaddr(MAC24AA_MAC_OFFSET);
52#endif
53 return 0;
54}
55#endif
56
57int board_init(void)
58{
59 /* address of boot parameters */
60 gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
61 return 0;
62}
63
64int dram_init_banksize(void)
65{
66 return fdtdec_setup_memory_banksize();
67}
68
69int dram_init(void)
70{
71 return fdtdec_setup_mem_size_base();
72}