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
28
29
30
31
32
33#include <common.h>
34#include <netdev.h>
35#include <command.h>
36
37DECLARE_GLOBAL_DATA_PTR;
38
39
40
41
42
43int board_init (void)
44{
45
46
47
48
49 gd->bd->bi_arch_number = MACH_TYPE_PXA_IDP;
50
51
52 gd->bd->bi_boot_params = 0xa0000100;
53
54
55 *(volatile unsigned int *)(PXA_CS5_PHYS + 0x03C0002c) = 0x13;
56
57
58
59 CKEN |= CKEN0_PWM0;
60 PWM_CTRL0 = 0x3f;
61 PWM_PERVAL0 = 0x3ff;
62 PWM_PWDUTY0 = 792;
63
64
65 CKEN |= CKEN2_AC97;
66 GCR = GCR_COLD_RST;
67
68
69
70
71
72
73
74 return 0;
75}
76
77int board_late_init(void)
78{
79 setenv("stdout", "serial");
80 setenv("stderr", "serial");
81 return 0;
82}
83
84
85int dram_init (void)
86{
87 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
88 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
89 gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
90 gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
91 gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
92 gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
93 gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
94 gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
95
96 return 0;
97}
98
99
100#ifdef DEBUG_BLINKC_ENABLE
101
102void delay_c(void)
103{
104
105 OSCR = 0;
106 while(OSCR > 0x10000)
107 ;
108
109 while(OSCR < 0xd4000)
110 ;
111}
112
113void blink_c(void)
114{
115 int led_bit = (1<<10);
116
117 GPDR0 = led_bit;
118 GPCR0 = led_bit;
119 delay_c();
120 GPSR0 = led_bit;
121 delay_c();
122 GPCR0 = led_bit;
123}
124
125int do_idpcmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
126{
127 printf("IDPCMD started\n");
128 return 0;
129}
130
131U_BOOT_CMD(idpcmd, CONFIG_SYS_MAXARGS, 0, do_idpcmd,
132 "custom IDP command",
133 "no args at this time"
134);
135
136#endif
137
138#ifdef CONFIG_CMD_NET
139int board_eth_init(bd_t *bis)
140{
141 int rc = 0;
142#ifdef CONFIG_SMC91111
143 rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
144#endif
145 return rc;
146}
147#endif
148