From owner-freebsd-net@FreeBSD.ORG Fri Mar 6 12:45:25 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 128B1160 for ; Fri, 6 Mar 2015 12:45:25 +0000 (UTC) Received: from mail-la0-x22c.google.com (mail-la0-x22c.google.com [IPv6:2a00:1450:4010:c03::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6268325 for ; Fri, 6 Mar 2015 12:45:24 +0000 (UTC) Received: by labgq15 with SMTP id gq15so3354948lab.13 for ; Fri, 06 Mar 2015 04:45:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=3R7GfL19Wjqn8n7kl2XZYHWNnlTRLfMyBk+gJf0XgwQ=; b=gMpYYUv9X2B4EqpFgL4wpUzesqj1Xes2qEW5HFRORqryzxZEZWO2SFeBxBh82oG2VV yAo2rXAIWSBl7ivVEuI/LOE1MOPwbAzZ48PMxEupn/wS7G1OKQgu/ackcnkvoYF3FXhF dUzj6BX6izzZx5NCF/wrALFrUeoVPhPjufZfULSe8FJqsLQ74fpHyEnHOS6SSTH49rNG VuhTNrPobX9kYDqvvJRZtcFaqlQiYXY96VktpuU2Wn/HUl4Jo1k2pD6T1p7NidmOAOME VQ0JANVhDdZSEiYMA7JmDc/jp8Vr/eaFWRbuh/mFU/MY55bAEUlbfMDzkF9S5wtmKA8p Tvwg== MIME-Version: 1.0 X-Received: by 10.112.235.10 with SMTP id ui10mr12820389lbc.77.1425645922172; Fri, 06 Mar 2015 04:45:22 -0800 (PST) Received: by 10.112.42.194 with HTTP; Fri, 6 Mar 2015 04:45:22 -0800 (PST) Date: Fri, 6 Mar 2015 12:45:22 +0000 Message-ID: Subject: cpsw/atphy network drivers From: Matt Dooner To: freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: matt@doonerconsulting.com X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 12:45:25 -0000 Hello, I am having some trouble configurating the network driver on a TI T335x-based CoM system (http://www.compulab.co.il/products/computer-on-modules/cm-t335/). It uses the "the AM335x integrated Ethernet MAC coupled with the AR8033 RGMII Ethernet PHY from Atheros". U-Boot is able to find the device as expected: CM-T335w # mii device MII devices: 'cpsw' Current device: 'cpsw' CM-T335w # mdio list cpsw: 0 - AR8031/AR8033 <--> cpsw CM-T335w # dhcp link up on port 0, speed 100, half duplex BOOTP broadcast 1 DHCP client bound to address 10.1.192.67 CM-T335w # ping 8.8.8.8 link up on port 0, speed 100, half duplex Using cpsw device host 8.8.8.8 is alive And devinfo(8) reports the correct modules being loaded: root@beaglebone:~ # devinfo nexus0 ofwbus0 simplebus0 aintc0 ti_scm0 am335x_prcm0 am335x_dmtimer0 ti_adc0 gpio0 gpioc0 gpiobus0 uart0 ti_edma30 sdhci_ti0 mmc0 mmcsd0 cpsw0 miibus0 atphy0 ... The interface does not appear to be sending or receiving any traffic over the physical interface, and does not report receiving any packets at all. I have enabled debug mode on the cpsw driver: root@beaglebone:~ # ifconfig cpsw0 debug root@beaglebone:~ # ifconfig cpsw0 up 09:54:45 cpsw_ioctl SIOCSIFFLAGS: UP but not RUNNING; starting up 09:54:45 cpsw_init_locked root@beaglebone:~ # dhclient cpsw0 09:54:56 cpsw_ifmedia_sts 09:54:56 cpsw_ioctl SIOCSIFFLAGS: UP & RUNNING (changed=0x0) 09:54:56 cpsw_init 09:54:56 cpsw_init_locked DHCPDISCOVER on cpsw0 to 255.255.255.255 port 67 interval 5 09:54:56 cpsw_tx_enqueue Queueing TX packet: 1 segments + 0 pad bytes 09:54:57 cpsw_tx_dequeue TX removing completed packet ... A DHCP address is never negotiated. root@beaglebone:~ # ifconfig cpsw0: flags=8847 metric 0 mtu 1500 options=8000b ether 1c:ba:8c:ed:40:99 inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 09:58:57 cpsw_ifmedia_sts 09:58:57 cpsw_ifmedia_sts 09:58:57 cpsw_ifmedia_sts media: Ethernet autoselect (100baseTX ) status: active nd6 options=29 lo0: flags=8049 metric 0 mtu 16384 options=600003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 inet 127.0.0.1 netmask 0xff000000 nd6 options=21 When connected to another computer running Wireshark no frames are recorded as having been transmitted over the interface. The cpsw driver never reports receiving any packets, even when I use a tool like Ostinato to craft frames addressed to the MAC of the NIC on the board. The network interface works perfectly in Debian Linux: root@cm-debian:~# ethtool eth2 Settings for eth2: Supported ports: [ TP AUI BNC MII FIBRE ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Speed: 100Mb/s Duplex: Half Port: MII PHYAD: 0 Transceiver: external Auto-negotiation: on Current message level: 0x00000000 (0) Link detected: yes root@cm-debian:~# ethtool -i eth2 driver: TI CPSW Driver v1.0 version: 1.0 firmware-version: bus-info: cpsw supports-statistics: no supports-test: no supports-eeprom-access: no supports-register-dump: no supports-priv-flags: no Can anyone reccomend some next steps for debugging this network interface in FreeBSD? I seem to have exhausted the options I've found in the handbook, man pages, and google searches. It is more relevant for freebsd-embedded, but if anyone is curious my freebsd-crochet board config is forked at https://github.com/MattDooner/crochet-freebsd/ and u-boot changes against 2014.04 at https://github.com/MattDooner/u-boot Cheers, Matt