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#include <common.h>
28#include <netdev.h>
29#include <asm/arch/cpu.h>
30#include <asm/arch/kirkwood.h>
31#include <asm/arch/mpp.h>
32#include "mv88f6281gtw_ge.h"
33
34DECLARE_GLOBAL_DATA_PTR;
35
36int board_early_init_f(void)
37{
38
39
40
41
42
43 kw_config_gpio(MV88F6281GTW_GE_OE_VAL_LOW,
44 MV88F6281GTW_GE_OE_VAL_HIGH,
45 MV88F6281GTW_GE_OE_LOW, MV88F6281GTW_GE_OE_HIGH);
46
47
48 u32 kwmpp_config[] = {
49 MPP0_SPI_SCn,
50 MPP1_SPI_MOSI,
51 MPP2_SPI_SCK,
52 MPP3_SPI_MISO,
53 MPP4_GPIO,
54 MPP5_GPO,
55 MPP6_SYSRST_OUTn,
56 MPP7_SPI_SCn,
57 MPP8_TW_SDA,
58 MPP9_TW_SCK,
59 MPP10_UART0_TXD,
60 MPP11_UART0_RXD,
61 MPP12_GPO,
62 MPP13_GPIO,
63 MPP14_GPIO,
64 MPP15_GPIO,
65 MPP16_GPIO,
66 MPP17_GPIO,
67 MPP18_GPO,
68 MPP19_GPO,
69 MPP20_GPIO,
70 MPP21_GPIO,
71 MPP22_GPIO,
72 MPP23_GPIO,
73 MPP24_GPIO,
74 MPP25_GPIO,
75 MPP26_GPIO,
76 MPP27_GPIO,
77 MPP28_GPIO,
78 MPP29_GPIO,
79 MPP30_GPIO,
80 MPP31_GPIO,
81 MPP32_GPIO,
82 MPP33_GPIO,
83 MPP34_GPIO,
84 MPP35_GPIO,
85 MPP36_GPIO,
86 MPP37_GPIO,
87 MPP38_GPIO,
88 MPP39_GPIO,
89 MPP40_GPIO,
90 MPP41_GPIO,
91 MPP42_GPIO,
92 MPP43_GPIO,
93 MPP44_GPIO,
94 MPP45_GPIO,
95 MPP46_GPIO,
96 MPP47_GPIO,
97 MPP48_GPIO,
98 MPP49_GPIO,
99 0
100 };
101 kirkwood_mpp_conf(kwmpp_config);
102 return 0;
103}
104
105int board_init(void)
106{
107
108
109
110 gd->bd->bi_arch_number = MACH_TYPE_MV88F6281GTW_GE;
111
112
113 gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
114
115 return 0;
116}
117
118#ifdef CONFIG_MV88E61XX_SWITCH
119void reset_phy(void)
120{
121
122 struct mv88e61xx_config swcfg = {
123 .name = "egiga0",
124 .vlancfg = MV88E61XX_VLANCFG_ROUTER,
125 .rgmii_delay = MV88E61XX_RGMII_DELAY_EN,
126 .led_init = MV88E61XX_LED_INIT_EN,
127 .mdip = MV88E61XX_MDIP_REVERSE,
128 .portstate = MV88E61XX_PORTSTT_FORWARDING,
129 .cpuport = (1 << 5),
130 .ports_enabled = 0x3f
131 };
132
133 mv88e61xx_switch_initialize(&swcfg);
134}
135#endif
136