Skip to contentSkip to conversation

net, davinci_emac: add KSZ8864 switch

PATCH New Heiko Schocher 3 participants 5 messages Sep 15, 2011 – Sep 23, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net, davinci_emac: add KSZ8864 switch

Cc Paulraj Sandeep <[email protected]>
Cc Albert ARIBAUD <[email protected]>
---
 arch/arm/cpu/arm926ejs/davinci/Makefile       |    2 +-
 arch/arm/cpu/arm926ejs/davinci/ksz8873.c      |   74 +++++++++++++++++++++++++
 arch/arm/include/asm/arch-davinci/emac_defs.h |    6 ++
 drivers/net/davinci_emac.c                    |    7 ++
 4 files changed, 88 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/ksz8873.c
arch/arm/cpu/arm926ejs/davinci/Makefile +1 -1
index 3183e6a..b38623a 100644
@@ -32,7 +32,7 @@ COBJS-$(CONFIG_SOC_DM355)	+= dm355.o
 COBJS-$(CONFIG_SOC_DM365)	+= dm365.o
 COBJS-$(CONFIG_SOC_DM644X)	+= dm644x.o
 COBJS-$(CONFIG_SOC_DM646X)	+= dm646x.o
-COBJS-$(CONFIG_DRIVER_TI_EMAC)	+= lxt972.o dp83848.o et1011c.o
+COBJS-$(CONFIG_DRIVER_TI_EMAC)	+= lxt972.o dp83848.o et1011c.o ksz8873.o
 
 SOBJS	= reset.o
 
arch/arm/cpu/arm926ejs/davinci/ksz8873.c new file +74 -0

74 lines not on this page · raw message

arch/arm/include/asm/arch-davinci/emac_defs.h +6 -0
index 4a4ee04..294a9a8 100644
@@ -377,6 +377,12 @@ typedef struct
 	int	(*auto_negotiate)(int phy_addr);
 } phy_t;
 
+#define PHY_KSZ8873	(0x00221450)
+int ksz8873_is_phy_connected(int phy_addr);
+int ksz8873_get_link_speed(int phy_addr);
+int ksz8873_init_phy(int phy_addr);
+int ksz8873_auto_negotiate(int phy_addr);
+
 #define PHY_LXT972	(0x001378e2)
 int lxt972_is_phy_connected(int phy_addr);
 int lxt972_get_link_speed(int phy_addr);
drivers/net/davinci_emac.c +7 -0
index 5b8ab2d..d58c28b 100644
@@ -711,6 +711,13 @@ int davinci_emac_initialize(void)
 	phy_id |= tmp & 0x0000ffff;
 
 	switch (phy_id) {
+	case PHY_KSZ8873:
+		sprintf(phy.name, "KSZ8873 @ 0x%02x", active_phy_addr);
+		phy.init = ksz8873_init_phy;
+		phy.is_phy_connected = ksz8873_is_phy_connected;
+		phy.get_link_speed = ksz8873_get_link_speed;
+		phy.auto_negotiate = ksz8873_auto_negotiate;
+		break;
 		case PHY_LXT972:
 			sprintf(phy.name, "LXT972 @ 0x%02x", active_phy_addr);
 			phy.init = lxt972_init_phy;
Signature · 1 line
1.7.6
#1 lore raw

PATCH 1/1 net, davinci_emac: add KSZ8864 switch

arch/arm/cpu/arm926ejs/davinci/ksz8873.c

Quoted 4 lines · On Thursday, September 15, 2011 01:36:09 Heiko Schocher wrote:
arch/arm/cpu/arm926ejs/davinci/ksz8873.c new file +1 -0
 
+#ifdef CONFIG_DRIVER_TI_EMAC

this file is only built when this is defined, so this is useless

Quoted 1 line

+#ifdef CONFIG_CMD_NET

building net drivers but not enabling CMD_NET is a config error. dont bother checking this yourself.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110915/16a384f6/attachment.pgp

#2 lore raw

PATCH 1/1 net, davinci_emac: add KSZ8864 switch

Hello Mike,

Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Thursday, September 15, 2011 01:36:09 Heiko Schocher wrote:
arch/arm/cpu/arm926ejs/davinci/ksz8873.c new file +0 -0
Quoted 8 lines
Quoted 1 line

+#ifdef CONFIG_DRIVER_TI_EMAC

this file is only built when this is defined, so this is useless

Quoted 1 line

+#ifdef CONFIG_CMD_NET

building net drivers but not enabling CMD_NET is a config error. dont bother checking this yourself.

Post this change in a v2, thanks for the review!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

PATCH v2 1/1 net, davinci_emac: add KSZ8864 switch

In reply to Heiko Schocher
Cc Paulraj Sandeep <[email protected]>
Cc Albert ARIBAUD <[email protected]>
Cc Mike Frysinger <[email protected]>

---
- changes for v2:
- add comment from Mike Frysinger
remove check if CONFIG_DRIVER_TI_EMAC and CONFIG_CMD_NET are defined.

 arch/arm/cpu/arm926ejs/davinci/Makefile       |    2 +-
 arch/arm/cpu/arm926ejs/davinci/ksz8873.c      |   68 +++++++++++++++++++++++++
 arch/arm/include/asm/arch-davinci/emac_defs.h |    6 ++
 drivers/net/davinci_emac.c                    |    7 +++
 4 files changed, 82 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/ksz8873.c
arch/arm/cpu/arm926ejs/davinci/Makefile +1 -1
index 3183e6a..b38623a 100644
@@ -32,7 +32,7 @@ COBJS-$(CONFIG_SOC_DM355)	+= dm355.o
 COBJS-$(CONFIG_SOC_DM365)	+= dm365.o
 COBJS-$(CONFIG_SOC_DM644X)	+= dm644x.o
 COBJS-$(CONFIG_SOC_DM646X)	+= dm646x.o
-COBJS-$(CONFIG_DRIVER_TI_EMAC)	+= lxt972.o dp83848.o et1011c.o
+COBJS-$(CONFIG_DRIVER_TI_EMAC)	+= lxt972.o dp83848.o et1011c.o ksz8873.o
 
 SOBJS	= reset.o
 
arch/arm/cpu/arm926ejs/davinci/ksz8873.c new file +68 -0

68 lines not on this page · raw message

arch/arm/include/asm/arch-davinci/emac_defs.h +6 -0
index 4a4ee04..294a9a8 100644
@@ -377,6 +377,12 @@ typedef struct
 	int	(*auto_negotiate)(int phy_addr);
 } phy_t;
 
+#define PHY_KSZ8873	(0x00221450)
+int ksz8873_is_phy_connected(int phy_addr);
+int ksz8873_get_link_speed(int phy_addr);
+int ksz8873_init_phy(int phy_addr);
+int ksz8873_auto_negotiate(int phy_addr);
+
 #define PHY_LXT972	(0x001378e2)
 int lxt972_is_phy_connected(int phy_addr);
 int lxt972_get_link_speed(int phy_addr);
drivers/net/davinci_emac.c +7 -0
index 5b8ab2d..d58c28b 100644
@@ -711,6 +711,13 @@ int davinci_emac_initialize(void)
 	phy_id |= tmp & 0x0000ffff;
 
 	switch (phy_id) {
+	case PHY_KSZ8873:
+		sprintf(phy.name, "KSZ8873 @ 0x%02x", active_phy_addr);
+		phy.init = ksz8873_init_phy;
+		phy.is_phy_connected = ksz8873_is_phy_connected;
+		phy.get_link_speed = ksz8873_get_link_speed;
+		phy.auto_negotiate = ksz8873_auto_negotiate;
+		break;
 		case PHY_LXT972:
 			sprintf(phy.name, "LXT972 @ 0x%02x", active_phy_addr);
 			phy.init = lxt972_init_phy;
Signature · 1 line
1.7.6
#4 lore raw

PATCH v2 1/1 net, davinci_emac: add KSZ8864 switch

Quoted 32 lines
Cc Paulraj Sandeep <[email protected]>
Cc Albert ARIBAUD <[email protected]>
Cc Mike Frysinger <[email protected]>

---
- changes for v2:
- add comment from Mike Frysinger
remove check if CONFIG_DRIVER_TI_EMAC and CONFIG_CMD_NET are defined.

 arch/arm/cpu/arm926ejs/davinci/Makefile       |    2 +-
 arch/arm/cpu/arm926ejs/davinci/ksz8873.c      |   68
+++++++++++++++++++++++++
 arch/arm/include/asm/arch-davinci/emac_defs.h |    6 ++
 drivers/net/davinci_emac.c                    |    7 +++
 4 files changed, 82 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/ksz8873.c
arch/arm/cpu/arm926ejs/davinci/Makefile +1 -1
index 3183e6a..b38623a 100644
@@ -32,7 +32,7 @@ COBJS-$(CONFIG_SOC_DM355)	+= dm355.o
 COBJS-$(CONFIG_SOC_DM365)	+= dm365.o
 COBJS-$(CONFIG_SOC_DM644X)	+= dm644x.o
 COBJS-$(CONFIG_SOC_DM646X)	+= dm646x.o
-COBJS-$(CONFIG_DRIVER_TI_EMAC)	+= lxt972.o dp83848.o et1011c.o
+COBJS-$(CONFIG_DRIVER_TI_EMAC)	+= lxt972.o dp83848.o et1011c.o
Quoted 1 line

ksz8873.o

Pushed to u-boot-ti/next