1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#include <common.h>
24#include <netdev.h>
25#include <twl4030.h>
26#include <asm/io.h>
27#include <asm/gpio.h>
28#include <asm/arch/mem.h>
29#include <asm/arch/mmc_host_def.h>
30#include <asm/arch/mux.h>
31#include <asm/arch/sys_proto.h>
32#include <asm/arch/omap_gpmc.h>
33#include <asm/mach-types.h>
34#include "igep0020.h"
35
36DECLARE_GLOBAL_DATA_PTR;
37
38
39static const u32 gpmc_lan_config[] = {
40 NET_LAN9221_GPMC_CONFIG1,
41 NET_LAN9221_GPMC_CONFIG2,
42 NET_LAN9221_GPMC_CONFIG3,
43 NET_LAN9221_GPMC_CONFIG4,
44 NET_LAN9221_GPMC_CONFIG5,
45 NET_LAN9221_GPMC_CONFIG6,
46};
47
48
49
50
51
52int board_init(void)
53{
54 gpmc_init();
55
56 gd->bd->bi_arch_number = MACH_TYPE_IGEP0020;
57
58 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
59
60 return 0;
61}
62
63
64
65
66
67
68#if defined(CONFIG_CMD_NET)
69static void setup_net_chip(void)
70{
71 struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
72
73 enable_gpmc_cs_config(gpmc_lan_config, &gpmc_cfg->cs[5], 0x2C000000,
74 GPMC_SIZE_16M);
75
76
77 writew(readw(&ctrl_base->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
78
79 writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
80
81 writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
82 &ctrl_base->gpmc_nadv_ale);
83
84
85 if (!gpio_request(64, "")) {
86 gpio_direction_output(64, 0);
87 gpio_set_value(64, 1);
88 udelay(1);
89 gpio_set_value(64, 0);
90 udelay(1);
91 gpio_set_value(64, 1);
92 }
93}
94#endif
95
96#ifdef CONFIG_GENERIC_MMC
97int board_mmc_init(bd_t *bis)
98{
99 omap_mmc_init(0);
100 return 0;
101}
102#endif
103
104
105
106
107
108int misc_init_r(void)
109{
110 twl4030_power_init();
111
112#if defined(CONFIG_CMD_NET)
113 setup_net_chip();
114#endif
115
116 dieid_num_r();
117
118 return 0;
119}
120
121
122
123
124
125
126
127void set_muxconf_regs(void)
128{
129 MUX_DEFAULT();
130}
131
132int board_eth_init(bd_t *bis)
133{
134 int rc = 0;
135#ifdef CONFIG_SMC911X
136 rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
137#endif
138 return rc;
139}
140