Skip to contentSkip to conversation

sunxi: broken sun4i_emacs, all boards?

U-Boot Artturi Alm 2 participants 5 messages Oct 22, 2017 – Nov 6, 2017

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

Hi,

this has been 'blocking' my attempts to revive the A10-boards i have since early june, or so.

now i found this commit abc3e4df59f54cf3dda42a35a75d617fe861f5fe, which left the drivers/net/Makefile untouched, essentially breaking sunxi_emac.

the diff below didn't fix it however, i can see how it does arp who-has, and the remote replying, but u-boot does act as if nothing is received back?

-Artturi

U-Boot SPL 2017.11-rc2-00002-g24b253e-dirty (Oct 22 2017 - 22:07:19)
DRAM: 1024 MiB

CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2

Trying to boot from MMC1

U-Boot 2017.11-rc2-00002-g24b253e-dirty (Oct 22 2017 - 22:07:19 +0300) Allwinner Technology

CPU:   Allwinner A10 (SUN4I)
Model: Cubietech Cubieboard
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
SCSI:  SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net:   eth0: ethernet at 01c0b000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0

scanning bus 0 for devices... 1 USB Device(s) found scanning bus 2 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
=> env set ipaddr 192.168.2.10
=> ping 192.168.2.2
resetting device
ENET Speed is 100 Mbps - FULL duplex connection
Using ethernet at 01c0b000 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.2.2 is not alive
=>

drivers/net/Kconfig +1 -0
index d67927c..2e35563 100644
@@ -219,6 +219,7 @@ config SUN7I_GMAC
 config SUN4I_EMAC
 	bool "Allwinner Sun4i Ethernet MAC support"
 	depends on DM_ETH
+        select PHYLIB
 	help
 	  This driver supports the Allwinner based SUN4I Ethernet MAC.
 
drivers/net/Makefile +1 -1
index 94a4fd8..ac5443c 100644
@@ -21,7 +21,7 @@ obj-$(CONFIG_DNET) += dnet.o
 obj-$(CONFIG_E1000) += e1000.o
 obj-$(CONFIG_E1000_SPI) += e1000_spi.o
 obj-$(CONFIG_EEPRO100) += eepro100.o
-obj-$(CONFIG_SUNXI_EMAC) += sunxi_emac.o
+obj-$(CONFIG_SUN4I_EMAC) += sunxi_emac.o
 obj-$(CONFIG_SUN8I_EMAC) += sun8i_emac.o
 obj-$(CONFIG_ENC28J60) += enc28j60.o
 obj-$(CONFIG_EP93XX) += ep93xx_eth.o
include/configs/sunxi-common.h +1 -1
index 9175117..b12f7e1 100644
@@ -291,7 +291,7 @@ extern int soft_i2c_gpio_scl;
 #endif /* CONFIG_VIDEO */
 
 /* Ethernet support */
-#ifdef CONFIG_SUNXI_EMAC
+#ifdef CONFIG_SUN4I_EMAC
 #define CONFIG_PHY_ADDR		1
 #define CONFIG_MII			/* MII PHY management		*/
 #endif
scripts/config_whitelist.txt +0 -1
index 3037d61..82b927c 100644
@@ -2272,7 +2272,6 @@ CONFIG_STV0991_HZ
 CONFIG_STV0991_HZ_CLOCK
 CONFIG_ST_SMI
 CONFIG_SUNXI_AHCI
-CONFIG_SUNXI_EMAC
 CONFIG_SUNXI_GPIO
 CONFIG_SUNXI_MAX_FB_SIZE
 CONFIG_SUNXI_USB_PHYS
#1 lore raw
Quoted 5 lines · Artturi Alm

Hi,

this has been 'blocking' my attempts to revive the A10-boards i have since early june, or so.

Quoted 8 lines

now i found this commit abc3e4df59f54cf3dda42a35a75d617fe861f5fe, which left the drivers/net/Makefile untouched, essentially breaking sunxi_emac.

the diff below didn't fix it however, i can see how it does arp who-has, and the remote replying, but u-boot does act as if nothing is received back?

-Artturi

ping? apparently i forgot to cc anyone at first try.

-Artturi

Quoted 96 lines

U-Boot SPL 2017.11-rc2-00002-g24b253e-dirty (Oct 22 2017 - 22:07:19)
DRAM: 1024 MiB

CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2

Trying to boot from MMC1

U-Boot 2017.11-rc2-00002-g24b253e-dirty (Oct 22 2017 - 22:07:19 +0300) Allwinner Technology

CPU:   Allwinner A10 (SUN4I)
Model: Cubietech Cubieboard
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
SCSI:  SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net:   eth0: ethernet at 01c0b000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0

scanning bus 0 for devices... 1 USB Device(s) found scanning bus 2 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
=> env set ipaddr 192.168.2.10
=> ping 192.168.2.2
resetting device
ENET Speed is 100 Mbps - FULL duplex connection
Using ethernet at 01c0b000 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.2.2 is not alive
=>

drivers/net/Kconfig +1 -0
index d67927c..2e35563 100644
@@ -219,6 +219,7 @@ config SUN7I_GMAC
 config SUN4I_EMAC
 	bool "Allwinner Sun4i Ethernet MAC support"
 	depends on DM_ETH
+        select PHYLIB
 	help
 	  This driver supports the Allwinner based SUN4I Ethernet MAC.
 
drivers/net/Makefile +1 -1
index 94a4fd8..ac5443c 100644
@@ -21,7 +21,7 @@ obj-$(CONFIG_DNET) += dnet.o
 obj-$(CONFIG_E1000) += e1000.o
 obj-$(CONFIG_E1000_SPI) += e1000_spi.o
 obj-$(CONFIG_EEPRO100) += eepro100.o
-obj-$(CONFIG_SUNXI_EMAC) += sunxi_emac.o
+obj-$(CONFIG_SUN4I_EMAC) += sunxi_emac.o
 obj-$(CONFIG_SUN8I_EMAC) += sun8i_emac.o
 obj-$(CONFIG_ENC28J60) += enc28j60.o
 obj-$(CONFIG_EP93XX) += ep93xx_eth.o
include/configs/sunxi-common.h +1 -1
index 9175117..b12f7e1 100644
@@ -291,7 +291,7 @@ extern int soft_i2c_gpio_scl;
 #endif /* CONFIG_VIDEO */
 
 /* Ethernet support */
-#ifdef CONFIG_SUNXI_EMAC
+#ifdef CONFIG_SUN4I_EMAC
 #define CONFIG_PHY_ADDR		1
 #define CONFIG_MII			/* MII PHY management		*/
 #endif
scripts/config_whitelist.txt +0 -1
index 3037d61..82b927c 100644
@@ -2272,7 +2272,6 @@ CONFIG_STV0991_HZ
 CONFIG_STV0991_HZ_CLOCK
 CONFIG_ST_SMI
 CONFIG_SUNXI_AHCI
-CONFIG_SUNXI_EMAC
 CONFIG_SUNXI_GPIO
 CONFIG_SUNXI_MAX_FB_SIZE
 CONFIG_SUNXI_USB_PHYS
#2 lore raw

Hi Artturi,

Quoted 9 lines · Artturi Alm
Quoted 8 lines · Artturi Alm

Hi,

this has been 'blocking' my attempts to revive the A10-boards i have since early june, or so.

now i found this commit abc3e4df59f54cf3dda42a35a75d617fe861f5fe, which left the drivers/net/Makefile untouched, essentially breaking sunxi_emac.

Quoted 7 lines
Quoted 5 lines

the diff below didn't fix it however, i can see how it does arp who-has, and the remote replying, but u-boot does act as if nothing is received back?

-Artturi

ping? apparently i forgot to cc anyone at first try.

The patch sounds about right, can you send it please?

I guess the select PHYLIB should be properly indented, and split into a separate commit.

Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171103/c5208abc/attachment.sig>
#3 lore raw
Quoted 15 lines · Maxime Ripard

Hi Artturi,

Quoted 12 lines · Artturi Alm
Quoted 11 lines · Artturi Alm

Hi,

this has been 'blocking' my attempts to revive the A10-boards i have since early june, or so.

now i found this commit abc3e4df59f54cf3dda42a35a75d617fe861f5fe, which left the drivers/net/Makefile untouched, essentially breaking sunxi_emac.

the diff below didn't fix it however, i can see how it does arp who-has, and the remote replying, but u-boot does act as if nothing is received back?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

-Artturi

ping? apparently i forgot to cc anyone at first try.

The patch sounds about right, can you send it please?

Not sure what you mean, but if you mean proper [PATCH] w/signed-off etc., then no - i'm sorry but i don't even know how, and kind of wish i could get by w/o learning how.

Quoted 3 lines

I guess the select PHYLIB should be properly indented, and split into a separate commit.

Yep, the whitespace error got copypasted from config SUN8I_EMAC, which is pretty broken w/regards spaces vs tab. left untouched in diff below w/o copypasting spaces, which you're of course free to split in as many commits you want. :)

-Artturi

Quoted 7 lines

Thanks!
Maxime

Signature · 3 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

sunxi: sun4i emac fixes.

fixes CONFIG_SUNXI_EMAC references from drivers/net/Makefile and include/configs/sunxi-common.h forgotten(?) in commit:

	sunxi: Convert SUNXI_EMAC to Kconfig
	abc3e4df59f54cf3dda42a35a75d617fe861f5fe

i have only three different kinds of A10 boards, but they all have realtek phy, so i chose to combine the #ifdef in sunxi-common.h with CONFIG_SUN7I_GMAC. admittedly it felt horrible place to default on such, but if sun7i_gmac can, why sun4i_emac could not?

because of misnaming above, i think the need for "select PHYLIB" under config SUN4I_EMAC was missed in commit:

	Move PHYLIB to Kconfig
	3146f0c017df2231d03dff09cee31f7bd63db3e5
drivers/net/Kconfig +1 -0
index c1ce54ecbb..52555da4b3 100644
@@ -247,6 +247,7 @@ config SUN7I_GMAC
 config SUN4I_EMAC
 	bool "Allwinner Sun4i Ethernet MAC support"
 	depends on DM_ETH
+	select PHYLIB
 	help
 	  This driver supports the Allwinner based SUN4I Ethernet MAC.
 
drivers/net/Makefile +1 -1
index 94a4fd8701..ac5443c752 100644
@@ -21,7 +21,7 @@ obj-$(CONFIG_DNET) += dnet.o
 obj-$(CONFIG_E1000) += e1000.o
 obj-$(CONFIG_E1000_SPI) += e1000_spi.o
 obj-$(CONFIG_EEPRO100) += eepro100.o
-obj-$(CONFIG_SUNXI_EMAC) += sunxi_emac.o
+obj-$(CONFIG_SUN4I_EMAC) += sunxi_emac.o
 obj-$(CONFIG_SUN8I_EMAC) += sun8i_emac.o
 obj-$(CONFIG_ENC28J60) += enc28j60.o
 obj-$(CONFIG_EP93XX) += ep93xx_eth.o
include/configs/sunxi-common.h +1 -6
index 4207398eb9..1354f15947 100644
@@ -286,12 +286,7 @@ extern int soft_i2c_gpio_scl;
 #endif /* CONFIG_VIDEO_SUNXI */
 
 /* Ethernet support */
-#ifdef CONFIG_SUNXI_EMAC
-#define CONFIG_PHY_ADDR		1
-#define CONFIG_MII			/* MII PHY management		*/
-#endif
-
-#ifdef CONFIG_SUN7I_GMAC
+#if defined CONFIG_SUN4I_EMAC || defined CONFIG_SUN7I_GMAC
 #define CONFIG_PHY_ADDR		1
 #define CONFIG_MII			/* MII PHY management		*/
 #define CONFIG_PHY_REALTEK
#4 lore raw

Hi,

Quoted 19 lines · Artturi Alm
Quoted 18 lines · Maxime Ripard

Hi Artturi,

Quoted 15 lines · Artturi Alm
Quoted 13 lines · Artturi Alm

Hi,

this has been 'blocking' my attempts to revive the A10-boards i have since early june, or so.

now i found this commit abc3e4df59f54cf3dda42a35a75d617fe861f5fe, which left the drivers/net/Makefile untouched, essentially breaking sunxi_emac.

the diff below didn't fix it however, i can see how it does arp who-has, and the remote replying, but u-boot does act as if nothing is received back?

-Artturi

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

ping? apparently i forgot to cc anyone at first try.

The patch sounds about right, can you send it please?

Not sure what you mean, but if you mean proper [PATCH] w/signed-off etc., then no - i'm sorry but i don't even know how, and kind of wish i could get by w/o learning how.

https://www.denx.de/wiki/U-Boot/Patches

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171106/d945c774/attachment.sig>