1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27#include <common.h>
28#include <netdev.h>
29#include <asm/arch/ep93xx.h>
30#include <asm/io.h>
31
32DECLARE_GLOBAL_DATA_PTR;
33
34#define MAX_BANK_SIZE 0x04000000
35
36static ulong const bank_addr[CONFIG_NR_DRAM_BANKS] = {
37 PHYS_SDRAM_1,
38#ifdef PHYS_SDRAM_2
39 PHYS_SDRAM_2,
40#endif
41#ifdef PHYS_SDRAM_3
42 PHYS_SDRAM_3,
43#endif
44#ifdef PHYS_SDRAM_4
45 PHYS_SDRAM_4
46#endif
47};
48
49int board_init(void)
50{
51 struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
52
53 icache_enable();
54
55#ifdef USE_920T_MMU
56 dcache_enable();
57#endif
58
59
60
61
62
63 uint32_t value = readl(&syscon->pwrcnt);
64 value |= SYSCON_PWRCNT_UART_BAUD;
65 writel(value, &syscon->pwrcnt);
66
67
68 value = readl(&syscon->devicecfg);
69 value |= 1<<18 ;
70 writel(0xAA, &syscon->sysswlock);
71 writel(value, &syscon->devicecfg);
72
73
74 gd->bd->bi_arch_number = CONFIG_MACH_TYPE;
75
76
77 gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
78
79
80 gd->have_console = 1;
81
82 return 0;
83}
84
85int board_eth_init(bd_t *bd)
86{
87 return ep93xx_eth_initialize(0, MAC_BASE);
88}
89
90int dram_init(void)
91{
92 unsigned int *src, *dst;
93 int i;
94
95 for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
96 const ulong bank_size = get_ram_size((long *)bank_addr[i],
97 MAX_BANK_SIZE);
98 if (bank_size) {
99 gd->bd->bi_dram[i].start = bank_addr[i];
100 gd->bd->bi_dram[i].size = bank_size;
101 }
102 }
103
104
105 src = (unsigned int *)_armboot_start;
106 dst = (unsigned int *)PHYS_SDRAM_1;
107 memcpy(dst, src, 16 * sizeof(unsigned int));
108
109 return 0;
110}
111