From nobody Sun Aug 20 18:08:45 2023 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RTNsR2z5Rz4qX0r for ; Sun, 20 Aug 2023 18:08:59 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RTNsQ3pN8z4frQ for ; Sun, 20 Aug 2023 18:08:58 +0000 (UTC) (envelope-from guyyur@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2b962535808so42341081fa.0 for ; Sun, 20 Aug 2023 11:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692554937; x=1693159737; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=e7aGoAf/KLpeMczMI6H/f7YzeBbvxZVK2ZYTnTDrs7s=; b=O3p9oYnqjB99nSiBxtohNur5IHMiPxZ3AYiuCtPRdm6BQv2+g7uxkKtpx8+Ph8htBO +OnmsscDgYRfvD9sxE5aO2aqU+eU7+EkPOiw5c0HvHPr15yANlWYKA/WhXb+H3ZyoEk3 e2NeBhjUCcofKIewW/y05pKraV8ZfVEkBTkx5Ct6N1SLoDTvvDbdAg8VgLf7olukDYtp Sv8EF+vGh6u5f9PaXg3Gm0sSDTW0gLAt7FsNKqVsdVesbKQhxPH05KxH+oCGLDqU2RCg lnmkLiV2ApTP2jJj9qOYr6WT5qsahBzytHAxA5borStHKcYDiNSb2+NTrsVVN6laD7jW nAWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692554937; x=1693159737; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e7aGoAf/KLpeMczMI6H/f7YzeBbvxZVK2ZYTnTDrs7s=; b=AK8Eaayt9zrzUeUHGSflJ4d6+da2NDbF8isQOohyc4MlYSo+maiz9IZRWlxS1RVoKp O5Pw+8neBdj6dlZ20Gk0V3PK1jfcytWht9I/xZ2IG9mIBzY83W1aOx4KAPW2KXXkxnHG u1YqmGjqSvYcmM4/SZaDXvnbN+fnia8RIMAxI1Kh1jg/+CpOlMMWbTd6hV1NPi8AuybT h5gkGS/unDbiJ19x6nCbEF9Tkhc3ZxL4UoW/JyjfOekkB+gahX33xqz78/qimz28+YWS j1JOwxaCp08O2h/cRSjK9w8g/RP3+/fSCOoOtSp6nTFLa9aYFK3wTrM4/BD9gZyxzFVL K0uQ== X-Gm-Message-State: AOJu0Yw6MaXdF9HFBFBcTOvfm6JJPuNLZopThZny//91b1yHh/KqEmOZ 34Hym++QUuphb2kuC29zwu1MkVlccB6s9VNoguegxGCH+gw= X-Google-Smtp-Source: AGHT+IGtlRecyB9aU0UJmHy0N4jLg3iw71p2b9cStUZUxDfyt73+5suGo3NX2Nx2lBmnP87AR5LAdfHZxoYYOOtwg+E= X-Received: by 2002:a05:651c:21b:b0:2b6:eefc:3e4f with SMTP id y27-20020a05651c021b00b002b6eefc3e4fmr3502430ljn.21.1692554936358; Sun, 20 Aug 2023 11:08:56 -0700 (PDT) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Guy Yur Date: Sun, 20 Aug 2023 21:08:45 +0300 Message-ID: Subject: Re: Rock64 vs. USB3 for 14.0-ALPHA2 's Rock64 snapshot vs. device tree update(?) To: Mark Millard Cc: freebsd-arm Content-Type: multipart/alternative; boundary="000000000000be9d8106035ea7dd" X-Rspamd-Queue-Id: 4RTNsQ3pN8z4frQ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --000000000000be9d8106035ea7dd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Sun, Aug 20, 2023 at 6:15=E2=80=AFPM Mark Millard wr= ote: > On Aug 20, 2023, at 06:50, Guy Yur wrote: > > > > On Sun, Aug 20, 2023 at 9:57=E2=80=AFAM Mark Millard wrote: > > If I interpret my experiments correctly, 14.0-ALPHA2 no longer > > supports the Rock64 USB3 port. This might be a side effect of > > importing more modern device tree source files from Linux. (At > > least one past import had such an issue for the Rock64, if I > > remember correctly.) > > > > Hi, > > > > Does u-boot see the XHCI controller? > > U-Boot has never seen the XHCI controller in all the years that > I've used it. The FreeBSD kernel was the first stage that saw the > XHCI controller. Relative to booting the Rock64, the stages > that I've used are: > > A) microsd card with U-Boot. > > B) an e.MMC with 2 file systems: > > B0) an msdosfs with a FreeBSD dtb/ copy and > EFI/BOOT/bootaa64.efi . > > I boot from sdcard with msdosfs partition with EFI/BOOT/bootaa64.efi and the dtb in rockchip/ dir in the partition. I tested renaming the rockchip dir so the dtb won't be found and there was still a device tree provided. seen in devinfo and ofwdump. B1) a UFS with a (recursive) copy of /boot > and an /etc/hostid . The /boot/loader.conf > has: vfs.root.mountfrom=3D"ufs:/dev/gpt/Rock64root" > (I avoid copying /boot/entropy to the e.MMC .) > > C) /dev/gpt/Rock64root has the UFS file system for the > world (with the kernel materials too) and is on > the USB3 media that I use. > > (I have the media set up to also boot aarch64 RPi* .) > > 14.0-ALPHA2 loads and starts the kernel from the e.MMC > just fine. But that kernel does not see what is in the > USB3 port. It does see the same when instead in the > other USB ports. Previously used to see the USB3 media > in the USB3 port just fine and boot world from the USB3 > media. > > > I had to backport u-boot changes to sysutils/u-boot-rock64 > > (sysutils/u-boot-master) 2023.07.02 to get it working in > > u-boot and 14.0-ALPHA1 for Rock64 and Orange Pi R1 Plus. > > I've never gone the route of changing U-Boot to handle > the USB3 port. > > > I took the following (I don't know if all are needed): > > > https://source.denx.de/u-boot/u-boot/-/commit/caaeac88466f4152bd126e23427= 65a4b740955ae > > > https://source.denx.de/u-boot/u-boot/-/commit/b71f74eab42782199757e146483= 126aee5e3c271 > > > https://source.denx.de/u-boot/u-boot/-/commit/559911ff2ed09812fc0a8751318= 3a44d9ee100cf > > > https://source.denx.de/u-boot/u-boot/-/commit/185571b6ec301cd228cb059326e= 51fb51e76e816 > > > https://source.denx.de/u-boot/u-boot/-/commit/5d334b70cce1d8299202d247011= b609faeb8e583 > > > https://source.denx.de/u-boot/u-boot/-/commit/9aa93d84038bb47bcd4e9ac4287= ef63e1b022971 > > > https://source.denx.de/u-boot/u-boot/-/commit/c0165258582078c206faca352b0= f63ccdf535ce7 > > > https://source.denx.de/u-boot/u-boot/-/commit/b6fd3c63f4c5ba8cad518fa34e6= a3289a6976f2e > > Intersting. Thanks. > I did some more testing. It seems that rock64 u-boot 2023.07.02 uses an embedded device tree and passes it to the kernel. The device-tree in the EFI partition is ignored. The device tree is a merge of rk3328-rock64.dts and rk3328-rock64-u-boot.dtsi and since both rk3328-u-boot.dtsi and rk3328.dtsi have usb@ff600000, the u-boot.dtsi version with compatible of "rockchip,rk3328-xhci" is used instead of "rockchip,rk3328-dwc3" which the FreeBSD kernel knows. b71f74eab42782199757e146483126aee5e3c271 may be enough for FreeBSD to see the controller. > > > For Orange Pi R1 Plus I also needed the patch adding it: > > > https://source.denx.de/u-boot/u-boot/-/commit/69e16c7b1cdd03907b86bb31abe= e24f5d4836400 > > > > Unfortunately, there is some issue with the XHCI controller, at list wi= th > > Realtek RTL8153 USB nic (built in on R1 Plus and tested external card > > plugged into Rock64) so it might have issues for other USB devices too. > > The nic doesn't work until the USB bus is reset and can get stuck again= . > > It didn't work on 13.x either. > > I've not historically had Rock64 Ethernet problems. > > The problem I have is when connecting a USB ethernet card to Rock64 USB 3.0 port. The internal ethernet works fine. > > =3D=3D=3D > Mark Millard > marklmi at yahoo.com > > =3D=3D=3D Guy Yur --000000000000be9d8106035ea7dd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Sun, Aug 20, 2023 at 6:15=E2=80=AFPM Mark Milla= rd <marklmi@yahoo.com> wrote= :
On Aug 20, 202= 3, at 06:50, Guy Yur <guyyur@gmail.com> wrote:


> On Sun, Aug 20, 2023 at 9:57=E2=80=AFAM Mark Millard <marklmi@yahoo.com> wrote:<= br> > If I interpret my experiments correctly, 14.0-ALPHA2 no longer
> supports the Rock64 USB3 port. This might be a side effect of
> importing more modern device tree source files from Linux. (At
> least one past import had such an issue for the Rock64, if I
> remember correctly.)
>
> Hi,
>
> Does u-boot see the XHCI controller?

U-Boot has never seen the XHCI controller in all the years that
I've used it. The FreeBSD kernel was the first stage that saw the
XHCI controller. Relative to booting the Rock64, the stages
that I've used are:

A) microsd card with U-Boot.

B) an e.MMC with 2 file systems:

B0) an msdosfs with a FreeBSD dtb/ copy and
=C2=A0 =C2=A0 =C2=A0EFI/BOOT/bootaa64.efi .


I boot from sdcard=C2=A0with msdosfs p= artition with EFI/BOOT/bootaa64.efi and the dtb in rockchip/ dir in the par= tition.
I tested renaming the rockchip dir so the dtb won't b= e found and there was still a device tree provided.
seen in devin= fo and ofwdump.

B1) a UFS with a (recursive) copy of /boot
=C2=A0 =C2=A0 =C2=A0and an /etc/hostid . The /boot/loader.conf
=C2=A0 =C2=A0 =C2=A0has: vfs.root.mountfrom=3D"ufs:/dev/gpt/Rock64root= "
=C2=A0 =C2=A0 =C2=A0(I avoid copying /boot/entropy to the e.MMC .)

C) /dev/gpt/Rock64root has the UFS file system for the
=C2=A0 =C2=A0 world (with the kernel materials too) and is on
=C2=A0 =C2=A0 the USB3 media that I use.

(I have the media set up to also boot aarch64 RPi* .)

14.0-ALPHA2 loads and starts the kernel from the e.MMC
just fine. But that kernel does not see what is in the
USB3 port. It does see the same when instead in the
other USB ports. Previously used to see the USB3 media
in the USB3 port just fine and boot world from the USB3
media.

> I had to backport u-boot changes to sysutils/u-boot-rock64
> (sysutils/u-boot-master) 2023.07.02 to get it working in
> u-boot and 14.0-ALPHA1 for Rock64 and Orange Pi R1 Plus.

I've never gone the route of changing U-Boot to handle
the USB3 port.

> I took the following (I don't know if all are needed):
> https://s= ource.denx.de/u-boot/u-boot/-/commit/caaeac88466f4152bd126e2342765a4b740955= ae
> https://s= ource.denx.de/u-boot/u-boot/-/commit/b71f74eab42782199757e146483126aee5e3c2= 71
> https://s= ource.denx.de/u-boot/u-boot/-/commit/559911ff2ed09812fc0a87513183a44d9ee100= cf
> https://s= ource.denx.de/u-boot/u-boot/-/commit/185571b6ec301cd228cb059326e51fb51e76e8= 16
> https://s= ource.denx.de/u-boot/u-boot/-/commit/5d334b70cce1d8299202d247011b609faeb8e5= 83
> https://s= ource.denx.de/u-boot/u-boot/-/commit/9aa93d84038bb47bcd4e9ac4287ef63e1b0229= 71
> https://s= ource.denx.de/u-boot/u-boot/-/commit/c0165258582078c206faca352b0f63ccdf535c= e7
> https://s= ource.denx.de/u-boot/u-boot/-/commit/b6fd3c63f4c5ba8cad518fa34e6a3289a6976f= 2e

Intersting. Thanks.

I did some more tes= ting.
It seems that rock64 u-boot 2023.07.02 uses an embedded dev= ice tree and passes it to the kernel.
The=C2=A0device-tree in the= EFI partition is ignored.

The device tree is a me= rge of=C2=A0rk3328-rock64.dts and=C2=A0rk3328-rock64-u-boot.dtsi
= and since both rk3328-u-boot.dtsi and=C2=A0rk3328.dtsi have usb@ff600000,
the u-boot.dtsi version with compatible of "rockchip,rk3328-x= hci" is used instead
of=C2=A0"rockchip,rk3328-dwc3"= ; which the FreeBSD kernel knows.

b71f74eab42782199757e146483126= aee5e3c271=C2=A0may be enough for FreeBSD to see the controller.
=C2=A0

> For Orange Pi R1 Plus I also needed the patch adding it:
> https://s= ource.denx.de/u-boot/u-boot/-/commit/69e16c7b1cdd03907b86bb31abee24f5d48364= 00
>
> Unfortunately, there is some issue with the XHCI controller, at list w= ith
> Realtek RTL8153 USB nic (built in on R1 Plus and tested external card<= br> > plugged into Rock64) so it might have issues for other USB devices too= .
> The nic doesn't work until the USB bus is reset and can get stuck = again.
> It didn't work on 13.x either.

I've not historically had Rock64 Ethernet problems.

=C2=A0
The problem I have is when connectin= g a USB ethernet card to Rock64 USB 3.0 port.
The internal ethern= et works fine.
=C2=A0

=3D=3D=3D
Mark Millard
marklmi at yahoo.com


=3D=3D=3D
Guy Yur=C2=A0
--000000000000be9d8106035ea7dd--