
I'll try without the switch using a crossover cable to link the board and the host running wireshark directly and let you know.
On Tue, Nov 6, 2018 at 10:19 AM Paul Nader paul.nader@gmail.com wrote:
On Tue, Nov 6, 2018 at 9:45 AM Chris Packham judge.packham@gmail.com wrote:
On Tue, 6 Nov 2018, 6:09 AM Paul Nader <paul.nader@gmail.com wrote:
Hi,
I'm trying to get an olinuxino-a64 board to boot using bootp but it failed to send any DHCP packets so I reduced the problem to trying to get it to ping another host but that fails as well.
I tried it both with 2018.09 and then the head of master given there were some recent commits to the net area to fix handling asynchronous responses.
I'm testing this by having the board ethernet connected to a switch and another port of the switch to a host running wireshark snooping packets in promiscuous mode.
Could the switch be dropping the packets? Are the ports in the same vlan? Is your monitoring host the same host you're trying to ping? (if not you'll need to configure your switch for mirroring)
The switch is a unmanaged TP-Link SG105 https://www.tp-link.com/uk/products/details/cat-42_TL-SG105.html which as far as I can tell has no configuration.
The host I am pinging is the same host that is running wireshark.
In: serial Out: serial Err: serial Net: phy interface7 eth0: ethernet@1c30000 starting USB... No controllers found Hit any key to stop autoboot: 0 => setenv ipaddr 192.168.0.2 => log level 10 => setenv netmask 255.255.255.0
What do you end up with for a mac address? I'm not familiar with the olinuxino hardware does it have an eeprom for the mac or does it just come from the environment.
I tried overwriting the mac address using setenv but it wouldn't allow it so I think it is coming from an eeprom. I didn't set it up in the u-boot environment.
Also, just to reiterate, this all works fine once the kernel has booted. I can configure the interface within linux and ping the host without any problems.

Hi,
I tried with x-over cable and the results were practically the same - no pings.
I increased the tx-delay-ps to 700ps and then I started getting the occasional arp being responded to. Below that I wouldn't see any. Here is the relevant potion of my DT (attached):
&emac { pinctrl-names = "default"; pinctrl-0 = <&rgmii_pins>; phy-mode = "rgmii"; phy-handle = <&ext_rgmii_phy>; phy-supply = <®_dcdc1>; allwinner,tx-delay-ps = <700>; status = "okay"; };
&mdio { ext_rgmii_phy: ethernet-phy@1 { compatible = "ethernet-phy-ieee802.3-c22"; reg = <1>; }; };
Below is a the trace for a ping (I've added some more code trace statements myself). Here the first ARP request times out, but the second one is responded to. I see the requests and responses in wireshark on the development host (attached to email). The host doing the ping is 192.168.0.2 (02:ba:7b:d5:c6:6f), the one suposed to respond is 192.168.0.1 (94:de:80:7e:84:9c)
DEBUG.none,net/net.c:412-net_loop() --- net_loop Entry DEBUG.none,net/eth-uclass.c:272-eth_init() Trying ethernet@1c30000 DEBUG.none,include/net.h:655-net_set_state() --- NetState set to 0 DEBUG.none,net/net.c:438-net_loop() --- net_loop Init Using ethernet@1c30000 device DEBUG.none,net/net.c:795-net_set_timeout_handler() --- net_loop timeout handler set (000000007dfa4ea8) DEBUG.none,net/ping.c:44-ping_send() sending ARP for 192.168.0.1 DEBUG.none,net/arp.c:58-arp_raw_request() ARP broadcast 1 DEBUG.none,net/eth-uclass.c:332-eth_send() uclass_emac_eth_send DEBUG.none,drivers/net/sun8i_emac.c:572-_sun8i_emac_eth_send() _sun8i_emac_eth_send DEBUG.none,net/arp.c:109-arp_timeout_check() ARP Timeout expired: 669957 5000 DEBUG.none,net/arp.c:58-arp_raw_request() ARP broadcast 2 DEBUG.none,net/eth-uclass.c:332-eth_send() uclass_emac_eth_send DEBUG.none,drivers/net/sun8i_emac.c:572-_sun8i_emac_eth_send() _sun8i_emac_eth_send DEBUG.none,net/net.c:1087-net_process_received_packet() packet received DEBUG.none,net/net.c:1159-net_process_received_packet() Receive from protocol 0x806 DEBUG.none,net/arp.c:140-arp_receive() Got ARP DEBUG.none,net/arp.c:196-arp_receive() Got ARP REPLY DEBUG.none,net/arp.c:212-arp_receive() Got ARP REPLY, set eth addr (94:de:80:7e:84:9c) DEBUG.none,net/arp.c:226-arp_receive() Sending tx_packet DEBUG.none,net/eth-uclass.c:332-eth_send() uclass_emac_eth_send DEBUG.none,drivers/net/sun8i_emac.c:572-_sun8i_emac_eth_send() _sun8i_emac_eth_send DEBUG.none,net/net.c:622-net_loop() --- net_loop timeout DEBUG.none,include/net.h:655-net_set_state() --- NetState set to 3 DEBUG.none,include/net.h:655-net_set_state() --- NetState set to 3 DEBUG.none,net/net.c:759-net_set_udp_handler() --- net_loop UDP handler set (0000000000000000) DEBUG.none,net/net.c:773-net_set_arp_handler() --- net_loop ARP handler set (0000000000000000) DEBUG.none,net/net.c:791-net_set_timeout_handler() --- net_loop timeout handler cancelled DEBUG.none,net/net.c:659-net_loop() --- net_loop Fail! DEBUG.none,include/net.h:655-net_set_state() --- NetState set to 0 ping failed; host 192.168.0.1 is not alive DEBUG.none,common/command.c:501-cmd_call() Command failed, result=1 DEBUG.none,net/net.c:412-net_loop() --- net_loop Entry DEBUG.none,net/eth-uclass.c:272-eth_init() Trying ethernet@1c30000 DEBUG.none,include/net.h:655-net_set_state() --- NetState set to 0 DEBUG.none,net/net.c:438-net_loop() --- net_loop Init Using ethernet@1c30000 device DEBUG.none,net/net.c:795-net_set_timeout_handler() --- net_loop timeout handler set (000000007dfa4ea8) DEBUG.none,net/ping.c:44-ping_send() sending ARP for 192.168.0.1 DEBUG.none,net/arp.c:58-arp_raw_request() ARP broadcast 1 DEBUG.none,net/eth-uclass.c:332-eth_send() uclass_emac_eth_send DEBUG.none,drivers/net/sun8i_emac.c:572-_sun8i_emac_eth_send() _sun8i_emac_eth_send DEBUG.none,net/net.c:759-net_set_udp_handler() --- net_loop UDP handler set (0000000000000000) DEBUG.none,net/net.c:773-net_set_arp_handler() --- net_loop ARP handler set (0000000000000000) DEBUG.none,net/net.c:791-net_set_timeout_handler() --- net_loop timeout handler cancelled
Even though _sun8i_emac_eth_send() is called to send the ICMP ping packet I never see it arrive at the host. After that net loop times out at net/net.c:622
Any suggestions on how to proceed next?
Paul
On Tue, Nov 6, 2018 at 10:54 AM Paul Nader paul.nader@gmail.com wrote:
I'll try without the switch using a crossover cable to link the board and the host running wireshark directly and let you know.
On Tue, Nov 6, 2018 at 10:19 AM Paul Nader paul.nader@gmail.com wrote:
On Tue, Nov 6, 2018 at 9:45 AM Chris Packham judge.packham@gmail.com wrote:
On Tue, 6 Nov 2018, 6:09 AM Paul Nader <paul.nader@gmail.com wrote:
Hi,
I'm trying to get an olinuxino-a64 board to boot using bootp but it failed to send any DHCP packets so I reduced the problem to trying to get it to ping another host but that fails as well.
I tried it both with 2018.09 and then the head of master given there were some recent commits to the net area to fix handling asynchronous responses.
I'm testing this by having the board ethernet connected to a switch and another port of the switch to a host running wireshark snooping packets in promiscuous mode.
Could the switch be dropping the packets? Are the ports in the same vlan? Is your monitoring host the same host you're trying to ping? (if not you'll need to configure your switch for mirroring)
The switch is a unmanaged TP-Link SG105 https://www.tp-link.com/uk/products/details/cat-42_TL-SG105.html which as far as I can tell has no configuration.
The host I am pinging is the same host that is running wireshark.
In: serial Out: serial Err: serial Net: phy interface7 eth0: ethernet@1c30000 starting USB... No controllers found Hit any key to stop autoboot: 0 => setenv ipaddr 192.168.0.2 => log level 10 => setenv netmask 255.255.255.0
What do you end up with for a mac address? I'm not familiar with the olinuxino hardware does it have an eeprom for the mac or does it just come from the environment.
I tried overwriting the mac address using setenv but it wouldn't allow it so I think it is coming from an eeprom. I didn't set it up in the u-boot environment.
Also, just to reiterate, this all works fine once the kernel has booted. I can configure the interface within linux and ping the host without any problems.

Hi Paul, hi everyone,
we had the same problem with our olinuxino-a64, but we were able to solve it by using an old patch series proposed by Icenowy Zheng.
We extended the *.dts with content of the current torvalds/Linux master branch to contain an emac configuration, which basically results in the same changes you did. [0] Additionally We adapted the patch series from [1] for the current v2018.11-rc3 branch of denx/U-Boot. [2] When not applying the patch series, the 'tx-delay-ps' option seems to have no effect on the driver - at least we didn't find reference for this in the code.
After this we are able to use DHCP and boot our board via TFTP.
The patch series is in the state 'Changes Requested' and it seems there was no activity for quite some time. Nonetheless this seems to fix the problem for us. As a side note - this patch series seems also to be necessary for the BananaPi-M3, which uses the same Ethernet driver but a different PHY (Realtek instead of Micrel).
Best regards
Alexander Weidinger
[0]: https://github.com/argos-research/u-boot/commit/546105fe859a5199b9533fbc0137... [1]: https://patchwork.ozlabs.org/project/uboot/list/?series=&submitter=71295... [2]: https://github.com/argos-research/u-boot/commit/f2a8eda9432c2d785ae446509f10...

On 11/15/2018 08:47 PM, Alexander Weidinger wrote:
Hi Paul, hi everyone,
we had the same problem with our olinuxino-a64, but we were able to solve it by using an old patch series proposed by Icenowy Zheng.
We extended the *.dts with content of the current torvalds/Linux master branch to contain an emac configuration, which basically results in the same changes you did. [0] Additionally We adapted the patch series from [1] for the current v2018.11-rc3 branch of denx/U-Boot. [2] When not applying the patch series, the 'tx-delay-ps' option seems to have no effect on the driver - at least we didn't find reference for this in the code.
After this we are able to use DHCP and boot our board via TFTP.
The patch series is in the state 'Changes Requested' and it seems there was no activity for quite some time. Nonetheless this seems to fix the problem for us. As a side note - this patch series seems also to be necessary for the BananaPi-M3, which uses the same Ethernet driver but a different PHY (Realtek instead of Micrel).
Can you repost the series ?
Best regards
Alexander Weidinger
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
participants (3)
-
Alexander Weidinger
-
Marek Vasut
-
Paul Nader