1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <common.h>
25#include <asm/processor.h>
26
27extern void board_pll_init_f(void);
28
29static void acadia_gpio_init(void)
30{
31
32
33
34 out32(GPIO0_OSRL, CONFIG_SYS_GPIO0_OSRL);
35 out32(GPIO0_OSRH, CONFIG_SYS_GPIO0_OSRH);
36 out32(GPIO0_ISR1L, CONFIG_SYS_GPIO0_ISR1L);
37 out32(GPIO0_ISR1H, CONFIG_SYS_GPIO0_ISR1H);
38 out32(GPIO0_TSRL, CONFIG_SYS_GPIO0_TSRL);
39 out32(GPIO0_TSRH, CONFIG_SYS_GPIO0_TSRH);
40 out32(GPIO0_TCR, CONFIG_SYS_GPIO0_TCR);
41
42
43
44
45 out32(GPIO1_OSRH, CONFIG_SYS_GPIO1_OSRH);
46 out32(GPIO1_OSRL, CONFIG_SYS_GPIO1_OSRL);
47 out32(GPIO1_ISR1H, CONFIG_SYS_GPIO1_ISR1H);
48 out32(GPIO1_ISR1L, CONFIG_SYS_GPIO1_ISR1L);
49 out32(GPIO1_TSRH, CONFIG_SYS_GPIO1_TSRH);
50 out32(GPIO1_TSRL, CONFIG_SYS_GPIO1_TSRL);
51 out32(GPIO1_TCR, CONFIG_SYS_GPIO1_TCR);
52}
53
54int board_early_init_f(void)
55{
56 unsigned int reg;
57
58#if !defined(CONFIG_NAND_U_BOOT)
59
60 mfsdr(SDR0_PINSTP, reg);
61 if (reg != 0xf0000000)
62 board_pll_init_f();
63#endif
64
65 acadia_gpio_init();
66
67
68 mtsdr(SDR0_NAND0, SDR_NAND0_NDEN | SDR_NAND0_NDAREN | SDR_NAND0_NDRBEN);
69 mfsdr(SDR0_ULTRA0, reg);
70 reg &= ~SDR_ULTRA0_CSN_MASK;
71 reg |= (SDR_ULTRA0_CSNSEL0 >> CONFIG_SYS_NAND_CS) |
72 SDR_ULTRA0_NDGPIOBP |
73 SDR_ULTRA0_EBCRDYEN |
74 SDR_ULTRA0_NFSRSTEN;
75 mtsdr(SDR0_ULTRA0, reg);
76
77
78 mfsdr(SDR0_ULTRA1, reg);
79 mtsdr(SDR0_ULTRA1, reg | SDR_ULTRA1_LEDNENABLE);
80
81 mtdcr(UIC0SR, 0xFFFFFFFF);
82 mtdcr(UIC0ER, 0x00000000);
83 mtdcr(UIC0CR, 0x00000010);
84 mtdcr(UIC0PR, 0xFE7FFFF0);
85 mtdcr(UIC0TR, 0x00000010);
86 mtdcr(UIC0SR, 0xFFFFFFFF);
87
88 return 0;
89}
90
91int misc_init_f(void)
92{
93
94 out8(CONFIG_SYS_CPLD_BASE + 0x05, 0x00);
95 udelay(100000);
96
97 return 0;
98}
99
100
101
102
103int checkboard(void)
104{
105 char *s = getenv("serial#");
106 u8 rev;
107
108 rev = in8(CONFIG_SYS_CPLD_BASE + 0);
109 printf("Board: Acadia - AMCC PPC405EZ Evaluation Board, Rev. %X", rev);
110
111 if (s != NULL) {
112 puts(", serial# ");
113 puts(s);
114 }
115 putc('\n');
116
117 return (0);
118}
119