1
2
3
4
5
6
7
8#include <common.h>
9#include <command.h>
10#include <malloc.h>
11#include <asm/immap.h>
12
13int checkboard (void) {
14 ulong val;
15 uchar val8;
16
17 puts ("Board: ");
18 puts("Freescale M5249EVB");
19 val8 = ((uchar)~((uchar)mbar2_readLong(MCFSIM_GPIO1_READ) >> 4)) & 0xf;
20 printf(" (Switch=%1X)\n", val8);
21
22
23
24
25 val = mbar2_readLong(MCFSIM_GPIO1_OUT) & ~CONFIG_SYS_GPIO1_LED;
26 mbar2_writeLong(MCFSIM_GPIO1_OUT, val);
27
28 return 0;
29};
30
31
32phys_size_t initdram (int board_type) {
33 unsigned long junk = 0xa5a59696;
34
35
36
37
38
39
40#ifdef CONFIG_SYS_FAST_CLK
41
42
43
44
45 mbar_writeShort(MCFSIM_DCR, 0x8239);
46#elif CONFIG_SYS_PLL_BYPASS
47
48
49
50
51 mbar_writeShort(MCFSIM_DCR, 0x8202);
52#else
53
54
55
56
57 mbar_writeShort(MCFSIM_DCR, 0x8222);
58#endif
59
60
61
62
63
64
65
66 mbar_writeLong(MCFSIM_DACR0, 0x00003324);
67
68
69 mbar_writeLong(MCFSIM_DMR0, 0x01fc0001);
70
71
72 mbar_writeLong(MCFSIM_DACR0, 0x0000332c);
73 *((volatile unsigned long *) 0x00) = junk;
74 udelay(0x10);
75
76
77 mbar_writeLong(MCFSIM_DACR0, 0x0000b324);
78 udelay(0x7d0);
79
80
81 mbar_writeLong(MCFSIM_DACR0, 0x0000b364);
82 *((volatile unsigned long *) 0x800) = junk;
83
84 return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
85};
86
87
88int testdram (void) {
89
90 printf ("DRAM test not implemented!\n");
91
92 return (0);
93}
94