Explorar el Código

* Patch by John Kerl, 19 Apr 2004:
Use U-boot's miiphy.h for PHY register names, rather than
introducing a new header file.

* Update pci_ids.h from linux-2.4.26

* Patch by Masami Komiya, 19 Apr 2004:
Fix problem cause by VLAN function on little endian architecture
without VLAN environment

wdenk hace 21 años
padre
commit
b9711de102
Se han modificado 5 ficheros con 558 adiciones y 69 borrados
  1. 11 1
      CHANGELOG
  2. 9 13
      common/cmd_mii.c
  3. 9 0
      include/miiphy.h
  4. 527 53
      include/pci_ids.h
  5. 2 2
      net/net.c

+ 11 - 1
CHANGELOG

@@ -2,8 +2,18 @@
 Changes for U-Boot 1.1.1:
 ======================================================================
 
+* Patch by John Kerl, 19 Apr 2004:
+  Use U-boot's miiphy.h for PHY register names, rather than
+  introducing a new header file.
+
+* Update pci_ids.h from linux-2.4.26
+
+* Patch by Masami Komiya, 19 Apr 2004:
+  Fix problem cause by VLAN function on little endian architecture
+  without VLAN environment
+
 * Clean up the TQM8xx_YYMHz configurations; allow to use the same
-  binary image for all clok frequencies. Implement run-time
+  binary image for all clock frequencies. Implement run-time
   optimization of flash access timing based on the actual bus
   frequency.
 

+ 9 - 13
common/cmd_mii.c

@@ -31,8 +31,6 @@
 #if (CONFIG_COMMANDS & CFG_CMD_MII)
 #include <miiphy.h>
 
-#define	CONFIG_TERSE_MII	/* XXX necessary here because "miivals.h" is missing */
-
 #ifdef CONFIG_TERSE_MII
 /*
  * Display values from last command.
@@ -149,8 +147,6 @@ U_BOOT_CMD(
 
 #else /* ! CONFIG_TERSE_MII ================================================= */
 
-#include <miivals.h>
-
 typedef struct _MII_reg_desc_t {
 	ushort regno;
 	char * name;
@@ -343,14 +339,14 @@ static int special_field(
 	ushort regval)
 {
 	if ((regno == 0) && (pdesc->lo == 6)) {
-		ushort speed_bits = regval & MII_CTL_SPEED_MASK;
+		ushort speed_bits = regval & PHY_BMCR_SPEED_MASK;
 		printf("%2u,%2u =   b%u%u    speed selection = %s Mbps",
 			6, 13,
 			(regval >>  6) & 1,
 			(regval >> 13) & 1,
-			speed_bits == MII_CTL_SPEED_1000_MBPS ? "1000" :
-			speed_bits == MII_CTL_SPEED_100_MBPS  ? "100" :
-			speed_bits == MII_CTL_SPEED_10_MBPS   ? "10" :
+			speed_bits == PHY_BMCR_1000_MBPS ? "1000" :
+			speed_bits == PHY_BMCR_100_MBPS  ? "100" :
+			speed_bits == PHY_BMCR_10_MBPS   ? "10" :
 			"???");
 		return 1;
 	}
@@ -367,9 +363,9 @@ static int special_field(
 		ushort sel_bits = (regval >> pdesc->lo) & pdesc->mask;
 		printf("%2u-%2u = %5u    selector = %s",
 			pdesc->hi, pdesc->lo, sel_bits,
-			sel_bits == MII_AN_ADV_IEEE_802_3 ?
+			sel_bits == PHY_ANLPAR_PSB_802_3 ?
 				"IEEE 802.3" :
-			sel_bits == MII_AN_ADV_IEEE_802_9_ISLAN_16T ?
+			sel_bits == PHY_ANLPAR_PSB_802_9 ?
 				"IEEE 802.9 ISLAN-16T" :
 			"???");
 		return 1;
@@ -379,9 +375,9 @@ static int special_field(
 		ushort sel_bits = (regval >> pdesc->lo) & pdesc->mask;
 		printf("%2u-%2u =     %u    selector = %s",
 			pdesc->hi, pdesc->lo, sel_bits,
-			sel_bits == MII_AN_PARTNER_IEEE_802_3 ?
+			sel_bits == PHY_ANLPAR_PSB_802_3 ?
 				"IEEE 802.3" :
-			sel_bits == MII_AN_PARTNER_IEEE_802_9_ISLAN_16T ?
+			sel_bits == PHY_ANLPAR_PSB_802_9 ?
 				"IEEE 802.9 ISLAN-16T" :
 			"???");
 		return 1;
@@ -418,7 +414,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
 	char		op;
 	unsigned char	addrlo, addrhi, reglo, reghi;
-	unsigned char	addr, reg;
+	unsigned char	addr = 0, reg = 0;
 	unsigned short	data;
 	int		rcode = 0;
 

+ 9 - 0
include/miiphy.h

@@ -93,6 +93,11 @@ int  miiphy_link(unsigned char addr);
 #define PHY_BMCR_DPLX		0x0100
 #define PHY_BMCR_COL_TST	0x0080
 
+#define PHY_BMCR_SPEED_MASK     0x2040
+#define PHY_BMCR_1000_MBPS      0x0040
+#define PHY_BMCR_100_MBPS       0x2000
+#define PHY_BMCR_10_MBPS        0x0000
+
 /* phy BMSR */
 #define PHY_BMSR_100T4		0x8000
 #define PHY_BMSR_100TXF		0x4000
@@ -118,6 +123,10 @@ int  miiphy_link(unsigned char addr);
 #define PHY_ANLPAR_10		0x0020
 #define PHY_ANLPAR_100		0x0380	    /* we can run at 100 */
 
+#define PHY_ANLPAR_PSB_MASK     0x001f
+#define PHY_ANLPAR_PSB_802_3    0x0001
+#define PHY_ANLPAR_PSB_802_9    0x0002
+
 /* PHY_1000BTSR */
 #define PHY_1000BTSR_MSCF       0x8000
 #define PHY_1000BTSR_MSCR       0x4000

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 527 - 53
include/pci_ids.h


+ 2 - 2
net/net.c

@@ -1613,14 +1613,14 @@ ushort string_to_VLAN(char *s)
 	ushort id;
 
 	if (s == NULL)
-		return VLAN_NONE;
+		return htons(VLAN_NONE);
 
 	if (*s < '0' || *s > '9')
 		id = VLAN_NONE;
 	else
 		id = (ushort)simple_strtoul(s, NULL, 10);
 
-	return id;
+	return htons(id);
 }
 
 void print_IPaddr (IPaddr_t x)

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio