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
34
35#include <common.h>
36#include <twl4030.h>
37#include <asm/io.h>
38#include <asm/arch/mmc_host_def.h>
39#include <asm/arch/mux.h>
40#include <asm/arch/sys_proto.h>
41#include <asm/arch/mem.h>
42#include <asm/mach-types.h>
43#include "devkit8000.h"
44#ifdef CONFIG_DRIVER_DM9000
45#include <net.h>
46#include <netdev.h>
47#endif
48
49DECLARE_GLOBAL_DATA_PTR;
50
51
52
53
54
55int board_init(void)
56{
57 gpmc_init();
58
59 gd->bd->bi_arch_number = MACH_TYPE_DEVKIT8000;
60
61 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
62
63 return 0;
64}
65
66
67
68
69
70int misc_init_r(void)
71{
72 struct ctrl_id *id_base = (struct ctrl_id *)OMAP34XX_ID_L4_IO_BASE;
73#ifdef CONFIG_DRIVER_DM9000
74 uchar enetaddr[6];
75 u32 die_id_0;
76#endif
77
78 twl4030_power_init();
79#ifdef CONFIG_TWL4030_LED
80 twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
81#endif
82
83#ifdef CONFIG_DRIVER_DM9000
84
85 writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[6].config1);
86 writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[6].config2);
87 writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[6].config3);
88 writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[6].config4);
89 writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[6].config5);
90 writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[6].config6);
91 writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[6].config7);
92
93
94 if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
95 printf("ethaddr not set, using Die ID\n");
96 die_id_0 = readl(&id_base->die_id_0);
97 enetaddr[0] = 0x02;
98 enetaddr[1] = readl(&id_base->die_id_1) & 0xff;
99 enetaddr[2] = (die_id_0 & 0xff000000) >> 24;
100 enetaddr[3] = (die_id_0 & 0x00ff0000) >> 16;
101 enetaddr[4] = (die_id_0 & 0x0000ff00) >> 8;
102 enetaddr[5] = (die_id_0 & 0x000000ff);
103 eth_setenv_enetaddr("ethaddr", enetaddr);
104 }
105#endif
106
107 dieid_num_r();
108
109 return 0;
110}
111
112
113
114
115
116
117
118void set_muxconf_regs(void)
119{
120 MUX_DEVKIT8000();
121}
122
123#ifdef CONFIG_GENERIC_MMC
124int board_mmc_init(bd_t *bis)
125{
126 omap_mmc_init(0);
127 return 0;
128}
129#endif
130
131#ifdef CONFIG_DRIVER_DM9000
132
133
134
135
136int board_eth_init(bd_t *bis)
137{
138 return dm9000_initialize(bis);
139}
140#endif
141