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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
Index: u-boot-1.3.2/drivers/net/tsec.c
===================================================================
--- u-boot-1.3.2.orig/drivers/net/tsec.c 2008-03-09 16:20:02.000000000 +0100
+++ u-boot-1.3.2/drivers/net/tsec.c 2009-01-07 15:09:40.000000000 +0100
@@ -179,6 +179,12 @@
priv->regs->maccfg1 |= MACCFG1_SOFT_RESET;
priv->regs->maccfg1 &= ~(MACCFG1_SOFT_RESET);
+ /* Init MACCFG2 */
+ priv->regs->maccfg2 = MACCFG2_INIT_SETTINGS;
+
+ /* Init ECNTRL */
+ priv->regs->ecntrl = ECNTRL_INIT_SETTINGS;
+
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
&& !defined(BITBANGMII)
miiphy_register(dev->name, tsec_miiphy_read, tsec_miiphy_write);
@@ -204,7 +210,7 @@
/* Make sure the controller is stopped */
tsec_halt(dev);
- /* Init MACCFG2. Defaults to GMII */
+ /* Init MACCFG2 */
regs->maccfg2 = MACCFG2_INIT_SETTINGS;
/* Init ECNTRL */
@@ -868,7 +874,11 @@
if(priv->phyinfo)
phy_run_commands(priv, priv->phyinfo->startup);
+#ifdef CONFIG_TSEC_NON_MANAGEABLE_PHY
+ priv->link = 1;
+#else
adjust_link(dev);
+#endif
/* Enable Transmit and Receive */
regs->maccfg1 |= (MACCFG1_RX_EN | MACCFG1_TX_EN);
@@ -1318,6 +1328,21 @@
}
};
+/* a non-manageable PHY interface */
+struct phy_info phy_info_null = {
+ 0,
+ "Non-manageable PHY",
+ 0,
+ (struct phy_cmd[]) { /* config */
+ {miim_end,}
+ },
+ (struct phy_cmd[]) { /* startup */
+ {miim_end,}
+ },
+ (struct phy_cmd[]) { /* shutdown */
+ {miim_end,}
+ }
+};
uint mii_parse_lxt971_sr2(uint mii_reg, struct tsec_private *priv)
{
@@ -1473,6 +1498,10 @@
*/
struct phy_info *get_phy_info(struct eth_device *dev)
{
+#ifdef CONFIG_TSEC_NON_MANAGEABLE_PHY
+ debug("%s: Using non-manageable PHY interface\n", dev->name);
+ return &phy_info_null;
+#else
struct tsec_private *priv = (struct tsec_private *)dev->priv;
uint phy_reg, phy_ID;
int i;
@@ -1503,6 +1532,7 @@
}
return theInfo;
+#endif // CONFIG_TSEC_NON_MANAGEABLE_PHY
}
/* Execute the given series of commands on the given device's
Index: u-boot-1.3.2/drivers/net/tsec.h
===================================================================
--- u-boot-1.3.2.orig/drivers/net/tsec.h 2008-03-09 16:20:02.000000000 +0100
+++ u-boot-1.3.2/drivers/net/tsec.h 2009-01-07 15:09:40.000000000 +0100
@@ -56,11 +56,11 @@
#define MACCFG1_SYNCD_TX_EN 0x00000002
#define MACCFG1_TX_EN 0x00000001
-#define MACCFG2_INIT_SETTINGS 0x00007205
#define MACCFG2_FULL_DUPLEX 0x00000001
#define MACCFG2_IF 0x00000300
#define MACCFG2_GMII 0x00000200
#define MACCFG2_MII 0x00000100
+#define MACCFG2_INIT_SETTINGS (0x00007005 | MACCFG2_MII)
#define ECNTRL_INIT_SETTINGS 0x00001000
#define ECNTRL_TBI_MODE 0x00000020
Index: u-boot-1.3.2/include/configs/MPC8313ERDB.h
===================================================================
--- u-boot-1.3.2.orig/include/configs/MPC8313ERDB.h 2009-01-07 15:09:39.000000000 +0100
+++ u-boot-1.3.2/include/configs/MPC8313ERDB.h 2009-01-07 15:11:17.000000000 +0100
@@ -246,8 +246,8 @@
#define CFG_BAUDRATE_TABLE \
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
-#define CFG_NS16550_COM1 (CFG_IMMR+0x4500)
-#define CFG_NS16550_COM2 (CFG_IMMR+0x4600)
+#define CFG_NS16550_COM1 (CFG_IMMR+0x4600)
+#define CFG_NS16550_COM2 (CFG_IMMR+0x4500)
/* Use the HUSH parser */
#define CFG_HUSH_PARSER
@@ -302,6 +302,7 @@
* TSEC configuration
*/
#define CONFIG_TSEC_ENET /* TSEC ethernet support */
+#define CONFIG_TSEC_NON_MANAGEABLE_PHY /* Non-manageable PHY interface */
#ifndef CONFIG_NET_MULTI
#define CONFIG_NET_MULTI 1
@@ -313,12 +314,12 @@
#define CONFIG_TSEC1_NAME "TSEC0"
#define CONFIG_TSEC2 1
#define CONFIG_TSEC2_NAME "TSEC1"
-#define TSEC1_PHY_ADDR 0x1c
-#define TSEC2_PHY_ADDR 4
-#define TSEC1_FLAGS TSEC_GIGABIT
-#define TSEC2_FLAGS TSEC_GIGABIT
+#define TSEC1_PHY_ADDR 0 //0x1c
+#define TSEC2_PHY_ADDR 0 //4
+#define TSEC1_FLAGS TSEC_REDUCED //TSEC_GIGABIT
+#define TSEC2_FLAGS TSEC_REDUCED //TSEC_GIGABIT
#define TSEC1_PHYIDX 0
-#define TSEC2_PHYIDX 0
+#define TSEC2_PHYIDX 1 //0
/* Options are: TSEC[0-1] */
#define CONFIG_ETHPRIME "TSEC1"
@@ -472,8 +473,8 @@
HRCWH_SW_WATCHDOG_DISABLE |\
HRCWH_ROM_LOC_LOCAL_16BIT |\
HRCWH_RL_EXT_LEGACY |\
- HRCWH_TSEC1M_IN_RGMII |\
- HRCWH_TSEC2M_IN_RGMII |\
+ HRCWH_TSEC1M_IN_MII |\
+ HRCWH_TSEC2M_IN_MII |\
HRCWH_BIG_ENDIAN |\
HRCWH_LALE_NORMAL)
@@ -482,7 +483,7 @@
#define CFG_WATCHDOG_VALUE 0xFFFF
/* System IO Config */
-#define CFG_SICRH (SICRH_TSOBI1 | SICRH_TSOBI2) /* RGMII */
+#define CFG_SICRH 0 //(SICRH_TSOBI1 | SICRH_TSOBI2) /* RGMII */
#define CFG_SICRL (SICRL_USBDR |SICRL_LBC) /* Enable Internal USB Phy */
#define CFG_HID0_INIT 0x000000000
|