From owner-freebsd-arm@freebsd.org Fri Jun 19 17:42:32 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2642633436D for ; Fri, 19 Jun 2020 17:42:32 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pR2t4g2vz4YHN for ; Fri, 19 Jun 2020 17:42:29 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1592588542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X6Slijf4jmarYVnoqWuakbiJlUWN1H+1vsiQ8clNfRM=; b=RLO/CImZ5sVzO1jFprwwnRW+y9fTr0BeCBrW38YeP1BUjKbfIdxu72LCzKlnBVAnPP62+A Q9/skoEbzvBhRn2zeDvoSFQtF78L16moZDqFXX2w+j4vM/Yfocn9k2v3IZWzb0ZzYy6Eyk 1RKPe2CfL5TQDNgM5ZblHKvjxpZAGXg= Received: from skull.home.blih.net (lfbn-idf2-1-900-181.w86-238.abo.wanadoo.fr [86.238.131.181]) by mx.blih.net (OpenSMTPD) with ESMTPSA id d84a6993 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 19 Jun 2020 17:42:22 +0000 (UTC) Date: Fri, 19 Jun 2020 19:42:22 +0200 From: Emmanuel Vadot To: =?ISO-8859-1?Q?S=F8ren?= Schmidt Cc: charlesr@scd-systems.net, freebsd-arm@freebsd.org Subject: Re: Rock64 dwc interface issues Message-Id: <20200619194222.73bc7dd705f6d80e63757796@bidouilliste.com> In-Reply-To: <7B4746AD-A8B7-43F0-B5EC-F3812A91F344@gmail.com> References: <877d6e2d-6cd8-30f3-08c3-60a2bacb5873@scd-systems.net> <7B4746AD-A8B7-43F0-B5EC-F3812A91F344@gmail.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49pR2t4g2vz4YHN X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=RLO/CImZ; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.34 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.01)[-1.010]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.86)[-0.863]; NEURAL_HAM_MEDIUM(-0.96)[-0.963]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 17:42:32 -0000 Hello S=F8ren, Charles, On Fri, 19 Jun 2020 15:48:36 +0200 S=F8ren Schmidt wrote: > You might not be alone :) I got my shiny new rockpro64 (yeah a little dif= ferent) and it probes the dwc device just fine (todays -current) >=20 > dwc0: mem 0xfe300000-0xfe30ffff ir= q 9 on ofwbus0 > miibus0: on dwc0 > rgephy0: PHY 0 on miibus0 > rgephy0: OUI 0x00e04c, model 0x0011, rev. 6 > rgephy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT= -FDX, 1000baseT-FDX-master, auto > rgephy1: PHY 1 on miibus0 > rgephy1: OUI 0x00e04c, model 0x0011, rev. 6 > rgephy1: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT= -FDX, 1000baseT-FDX-master, auto > dwc0: bpf attached > dwc0: Ethernet address: X:X:X:X:X:X >=20 > It does not work however, no error msgs or anything, but no traffic enter= or leaves at all. >=20 > I had a similar issue with the dwc compat chip on the Allwinner R40 (Bana= napi M2 Berry) and got that working, so I?ll se if similar hacks works here? >=20 > -S=F8ren >=20 > > On 22 May 2020, at 11.12, Charles wrote: > >=20 > > Hi, > >=20 > >=20 > > I am currently trying to setup my Rock64 V2.0 SoC with FreeBSD (Image: = http://ftp.freebsd.org/pub/FreeBSD/snapshots/arm64/aarch64/ISO-IMAGES/13.0/= FreeBSD-13.0-CURRENT-arm64-aarch64-ROCK64-20200514-r361019.img.xz) > >=20 > > The spi from the rock64 board is not flashed and the sd-card is booting= successful FreeBSD. > >=20 > > But the dwc0 network interface makes trouble. > >=20 > > At first I tried to reach the soc by ssh without success, the connectio= n ends into a timeout. Next i tried to reach the board by icmp requests fro= m other machines and i only got approx. every 3-4 packets answered back fro= m the rock. > > The arp table from the rock64 machine is fine, same on the other side. > >=20 > > icmp outout: > >=20 > > # ping 192.168.178.79 > > PING 192.168.178.79 (192.168.178.79): 56 data bytes > > 64 bytes from 192.168.178.79: icmp_seq=3D3 ttl=3D64 time=3D0.422 ms > > 64 bytes from 192.168.178.79: icmp_seq=3D7 ttl=3D64 time=3D0.295 ms > > 64 bytes from 192.168.178.79: icmp_seq=3D8 ttl=3D64 time=3D0.284 ms > > 64 bytes from 192.168.178.79: icmp_seq=3D11 ttl=3D64 time=3D0.289 ms > > 64 bytes from 192.168.178.79: icmp_seq=3D12 ttl=3D64 time=3D0.282 ms > >=20 > > tcpdump dump from the rock: > >=20 > > # tcpdump -i dwc0 -n icmp > > tcpdump: verbose output suppressed, use -v or -vv for full protocol dec= ode > > listening on dwc0, link-type EN10MB (Ethernet), capture size 262144 byt= es > > 01:24:30.275479 IP 192.168.178.21 > 192.168.178.79: ICMP echo request, = id 20996, seq 0, length 64 > > 01:24:31.286399 IP truncated-ip - 16384 bytes missing! 192.168.178.21 >= 192.168.242.79: ICMP echo request, id 20996, seq 4097, length 16448 > > 01:24:33.400434 IP 192.168.178.21 > 192.168.178.79: ICMP echo request, = id 20996, seq 3, length 64 > > 01:24:33.400533 IP 192.168.178.79 > 192.168.178.21: ICMP echo reply, id= 20996, seq 3, length 64 > > 01:24:34.460477 IP truncated-ip - 16384 bytes missing! 192.168.242.21 >= 192.168.178.79: ICMP echo request, id 20996, seq 4, length 16448 > > 01:24:35.512486 IP 192.168.178.21 > 192.168.186.79: ICMP echo request, = id 20996, seq 5, length 64 > > 01:24:36.572512 IP truncated-ip - 16384 bytes missing! 192.168.178.21 >= 192.168.178.79: ICMP echo request, id 20996, seq 6, length 16448 > > 01:24:37.632534 IP 192.168.178.21 > 192.168.178.79: ICMP echo request, = id 20996, seq 7, length 64 > > 01:24:37.632631 IP 192.168.178.79 > 192.168.178.21: ICMP echo reply, id= 20996, seq 7, length 64 > > 01:24:38.688549 IP 192.168.178.21 > 192.168.178.79: ICMP echo request, = id 20996, seq 8, length 64 > > 01:24:38.688640 IP 192.168.178.79 > 192.168.178.21: ICMP echo reply, id= 20996, seq 8, length 64 > > 01:24:39.709363 IP 192.168.178.21 > 192.168.178.79: ICMP echo request, = id 20996, seq 9, length 64 > > 01:24:40.711011 IP truncated-ip - 16384 bytes missing! 192.168.178.21 >= 192.168.178.79: ICMP echo request, id 20996, seq 10, length 16448 > > 01:24:41.712351 IP 192.168.178.21 > 192.168.178.79: ICMP echo request, = id 20996, seq 11, length 64 > > 01:24:41.712449 IP 192.168.178.79 > 192.168.178.21: ICMP echo reply, id= 20996, seq 11, length 64 > > 01:24:42.775589 IP 192.168.178.21 > 192.168.178.79: ICMP echo request, = id 20996, seq 12, length 64 > > 01:24:42.775677 IP 192.168.178.79 > 192.168.178.21: ICMP echo reply, id= 20996, seq 12, length 64 > >=20 > >=20 > > Output ifconfig: > >=20 > > dwc0: flags=3D8843 metric 0 mtu= 1500 > > options=3D80008 > > ether 3a:6f:36:64:e6:9c > > inet 192.168.178.79 netmask 0xffffff00 broadcast 192.168.178.255 > > media: Ethernet autoselect (1000baseT ) > > status: active > > nd6 options=3D29 > >=20 > > dmesg: > >=20 > > ---<>--- > > KDB: debugger backends: ddb > > KDB: current backend: ddb > > Copyright (c) 1992-2020 The FreeBSD Project. > > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > > The Regents of the University of California. All rights reserved. > > FreeBSD is a registered trademark of The FreeBSD Foundation. > > FreeBSD 13.0-CURRENT #0 r361019: Thu May 14 09:26:15 UTC 2020 > > root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC= arm64 > > FreeBSD clang version 10.0.0 (git@github.com:llvm/llvm-project.git llvm= org-10.0.0-0-gd32170dbd5b) > > WARNING: WITNESS option enabled, expect reduced performance. > > VT: init without driver. > > module firmware already present! > > KLD file umodem.ko is missing dependencies > > Starting CPU 1 (1) > > Starting CPU 2 (2) > > Starting CPU 3 (3) > > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > > random: unblocking device. > > random: entropy device external interface > > MAP fbf1b000 mode 2 pages 1 > > MAP fbf24000 mode 2 pages 1 > > MAP fbf27000 mode 2 pages 1 > > MAP fef30000 mode 2 pages 16 > > WARNING: Device "kbd" is Giant locked and may bware Device Tree> > > simplebus0: on ofwbus0 > > clk_fixed0: on ofwbus0 > > rk_grf0: mem 0xff100000-0xff100fff on= ofwbus0 > > rk3328_cru0: mem 0xff440000-0xff= 440fff on ofwbus0 > > rk3328_cru0: cannot get parent at idx 6 > > Cannot set frequency for clk: aclk_bus_pre, error: 34 > > rk3328_cru0: Failed to set aclk_bus_pre to a frequency of 15000000 > > Cannot set frequency for clk: aclk_peri_pre, error: 34 > > rk3328_cru0: Failed to set aclk_peri_pre to a frequency of 15000000 > > clk_fixed1: on ofwbus0 > > regfix0: on ofwbus0 > > regfix1: on ofwbus0 > > regfix2: on ofwbus0 > > regfix3: on ofwbus0 > > simple_mfd0: mem 0xff450000-0xff4= 5ffff on ofwbus0 > > psci0: on ofwbus0 > > gic0: mem 0xff811000-0xff811fff,0xff= 812000-0xff813fff,0xff8140s 160 > > rk_pinctrl0: on ofwbus0 > > gpio0: mem 0xff210000-0xff2100ff irq 52= on rk_pinctrl0 > > gpiobus0: on gpio0 > > gpio1: mem 0xff220000-0xff2200ff irq 53= on rk_pinctrl0 > > gpiobus1: on gpio1 > > gpio2: mem 0xff230000-0xff2300ff irq 54= on rk_pinctrl0 > > gpiobus2: on gpio2 > > gpio3: mem 0xff240000-0xff2400ff irq 55= on rk_pinctrl0 > > gpiobus3: on gpio3 > > rk_i2c0: mem 0xff160000-0xff160fff irq 16 on ofwbus0 > > iicbus0: on rk_i2c0 > > rk805_pmu0: at addr 0x30 irq 56 on iicbus0 > > generic_timer0: irq 4,5,6,7 on ofwbus0 > > Timecounter "ARM MPCore Timecounter" frequency 24000000 Hz quality 1000 > > Event timer "ARM MPCore Eventtimer" frequency 24000000 Hz quality 1000 > > rk_tsadc0: mem 0xff250000-0xff2500ff irq= 22 on ofwbus0 > > cpuliseq_dt1: on cpu1 > > cpu2: on cpulist0 > > cpufreq_dt2: on cpu2 > > cpu3: on cpulist0 > > cpufreq_dt3: on cpu3 > > uart0: <16750 or compatible> mem 0xff130000-0xff1300ff irq 14 on ofwbus0 > > uart0: console (-1,n,8,1) > > iic0: on iicbus0 > > rockchip_dwmmc0: mem 0xff500000-0xff503fff irq 41 on ofwbus0 > > rockchip_dwmmc0: Hardware version ID is 270a > > mmc0: on rockchip_dwmmc0 > > rockchip_dwmmc1: mem 0xff520000-0xff523fff irq 43 on ofwbus0 > > rockchip_dwmmc1: Hardware version ID is 270a > > mmc1: on rockchip_dwmmc1 > > dwc0: mem 0xff540000-0xff54ffff = irq 44 on ofwbus0 > > miibus0: on dwc0 > > rgephy0: PHY 0 on miib= us0 > > rgephy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseT0baseTX-FDX, 1= 000baseT-FDX, 1000baseT-FDX-master, auto > > dwc0: Ethernet address: 3a:6f:36:64:e6:9c > > dwcotg0: mem 0xff580000-0xff5bf= fff irq 46 on ofwbus0 > > usbus0 on dwcotg0 > > ehci0: mem 0xff5c0000-0xff5cffff irq 47 on of= wbus0 > > usbus1: EHCI version 1.0 > > usbus1 on ehci0 > > ohci0: mem 0xff5d0000-0xff5dffff irq 48 on of= wbus0 > > usbus2 on ohci0 > > gpioc0: on gpio0 > > gpioc1: on gpio1 > > gpioc2: on gpio2 > > gpioc3: on gpio3 > > gpioled0: on ofwbus0 > > gpioled0: failed to map pin > > gpioled0: failed to map pin > > cryptosoft0: > > Timecounters tick every 1.000 msec > > usbus0: 480Mbps High Speed USB v2.0 > > usbus1: 480Mbps High Speed USB v2.0 > > usbus2: 12Mbps Full Speed USB v1.0 > > Obsolete code will be removed soon: random(9) is the obsolete Park-Mill= er LCG from 1988 > > ugen1.1: at usbus1 > > uhub0 on usbus1 > > uhub0: on usbus0 > > ugen2.1: at usbus2 > > uhub2 on usbus2 > > uhub2: on usb= us2 > > mmcsd0: 32GB at mmc0 5= 0.0MHz/4bit/2048-block > > mmc1: No compatible cards found on bus > > Release APs...done > > CPU 0: ARM Cortex-A53 r0p4 affinity: 0 > > Cache Type =3D <64 byte D-cacheline,64 byte I-cacheli= ne,VIPT ICache,64 byte ERG,64 byte CWG> > > Instruction Set Attributes 0 =3D > > Instruction Set Attributes 1 =3D <> > > Processor Features 0 =3D > > Processor Features 1 =3D <> > > Memory Model Features 0 =3D > > Memory Model Features 1 =3D <8bit VMID> > > Memory Model Features 2 =3D <32bit CCIDX,48bit VA> > > Trying to mount root from ufs:/dev/ufs/rootfs [rw]... > > Debug Features 0 =3D <2 CTX BKPTs,4 Watchpoints,6 Breakpoin= ts,PMUv3,Debugv8> > > Debug FeatureCortex-A53 r0p4 affinity: 3 > > WARNING: WITNESS option enabled, expect reduced performance. > > Warning: no time-of-day clock registered, system time will not be set a= ccurately > > uhub2: 1 port with 1 removable, self powered > > uhub1: 1 port with 1 removable, self powered > > uhub0: 1 port with 1 removable, self powered > > lo0: link state changed to UP > > dwc0: link state changed to DOWN > > dwc0: link state changed to UP > >=20 > >=20 > > Does anyone know this issue ? > >=20 > >=20 > > Best, > >=20 > > Charles > > _______________________________________________ > > freebsd-arm@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" I've just took the last image for rock64 and rockpro64 to test on my boards (I usually netboot but testing the image give a common reference between everyone). As a reference the image I've burned on the sd are : FreeBSD-13.0-CURRENT-arm64-aarch64-ROCK64-20200618-r362292.img.xz FreeBSD-13.0-CURRENT-arm64-aarch64-ROCKPRO64-20200618-r362292.img.xz On Rock64 v2.0 (2017-0713) I see no issues, I got an IP from my dhcp server and could install packages properly. Using iperf3 I have ~275Mbits/sec which isn't great but we're aware of the bad perf of the dwc(4) driver. On RockPro64 v2.1 I also see no issues, iperf3 give the same speed result for tx but rx is worse (~100Mbits/sec). S=F8ren, what are your hack for R40 (which do not have support for in term of clock so I'm not surprise that you need "something" for it).=20 Charles, could you test the same image as me and see if that makes a difference (but I doubt since not much changed recently that could affect that). Cheers, --=20 Emmanuel Vadot