Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Aug 2023 12:08:02 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Guy Yur <guyyur@gmail.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Rock64 vs. USB3 for 14.0-ALPHA2 's Rock64 snapshot vs. device tree update(?)
Message-ID:  <C072DEA1-3CC7-494F-8306-7A8A6CB81C0B@yahoo.com>
In-Reply-To: <CAC67Hz9C1JTEyDN=WEU6jvdx_GQ6=xKV4BHnZvytuesEkHNS2w@mail.gmail.com>
References:  <D6FF636E-EF88-4D74-89B6-01CF37882CD9.ref@yahoo.com> <D6FF636E-EF88-4D74-89B6-01CF37882CD9@yahoo.com> <CAC67Hz-HwHoWX1685CyCfM5uE%2BFqMzQ29hMMC9wDHDn8qHeHQg@mail.gmail.com> <E68DED8A-17E2-4AC3-A564-5F9C331231F6@yahoo.com> <CAC67Hz9C1JTEyDN=WEU6jvdx_GQ6=xKV4BHnZvytuesEkHNS2w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 20, 2023, at 11:08, Guy Yur <guyyur@gmail.com> wrote:

> Hi,

Hello.

>> On Sun, Aug 20, 2023 at 6:15=E2=80=AFPM Mark Millard =
<marklmi@yahoo.com> wrote:
>> On Aug 20, 2023, at 06:50, Guy Yur <guyyur@gmail.com> wrote:
>>=20
>>=20
>> > On Sun, Aug 20, 2023 at 9:57=E2=80=AFAM Mark Millard =
<marklmi@yahoo.com> 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.)
>> >=20
>> > Hi,
>> >=20
>> > Does u-boot see the XHCI controller?
>>=20
>> 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:
>>=20
>> A) microsd card with U-Boot.
>>=20
>> B) an e.MMC with 2 file systems:
>>=20
>> B0) an msdosfs with a FreeBSD dtb/ copy and
>>      EFI/BOOT/bootaa64.efi .
>>=20
>=20
> 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.

Back when I established my structure (long ago) this provided
U-Boot's translation of its *.dtb --which did not work for
FreeBSD purposes at the time. FreeBSD's Rock64 related updates
have been based on tracking upstream linux at some point.
Doing what I did got the FreeBSD *.dtb that FreeBSD expected
(at the time. anyway).

>> 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 .)
>>=20
>> 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.
>>=20
>> (I have the media set up to also boot aarch64 RPi* .)
>>=20
>> 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.
>>=20
>> > 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.
>>=20
>> I've never gone the route of changing U-Boot to handle
>> the USB3 port.
>>=20
>> > I took the following (I don't know if all are needed):
>> > =
https://source.denx.de/u-boot/u-boot/-/commit/caaeac88466f4152bd126e234276=
5a4b740955ae
>> > =
https://source.denx.de/u-boot/u-boot/-/commit/b71f74eab42782199757e1464831=
26aee5e3c271
>> > =
https://source.denx.de/u-boot/u-boot/-/commit/559911ff2ed09812fc0a87513183=
a44d9ee100cf
>> > =
https://source.denx.de/u-boot/u-boot/-/commit/185571b6ec301cd228cb059326e5=
1fb51e76e816
>> > =
https://source.denx.de/u-boot/u-boot/-/commit/5d334b70cce1d8299202d247011b=
609faeb8e583
>> > =
https://source.denx.de/u-boot/u-boot/-/commit/9aa93d84038bb47bcd4e9ac4287e=
f63e1b022971
>> > =
https://source.denx.de/u-boot/u-boot/-/commit/c0165258582078c206faca352b0f=
63ccdf535ce7
>> > =
https://source.denx.de/u-boot/u-boot/-/commit/b6fd3c63f4c5ba8cad518fa34e6a=
3289a6976f2e
>>=20
>> Intersting. Thanks.
>=20
> 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.
>=20
> 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.
>=20
> b71f74eab42782199757e146483126aee5e3c271 may be enough for FreeBSD to =
see the controller.

I do not know if the Rock64 related support will continue to
be updated to track the linux upstream updates or not. (If not,
then likely snapshots and releases for Rock64 would stop.)

As stands I do not plan on going down a path that might not
be what FreeBSD ends up with for Rock64 related support if
it is updated. For now, I've just put the Rock64 to the side.
But I'm keeping copies of your notes.

>> > For Orange Pi R1 Plus I also needed the patch adding it:
>> > =
https://source.denx.de/u-boot/u-boot/-/commit/69e16c7b1cdd03907b86bb31abee=
24f5d4836400
>> >=20
>> > Unfortunately, there is some issue with the XHCI controller, at =
list with
>> > 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.
>>=20
>> I've not historically had Rock64 Ethernet problems.
>=20
>  The problem I have is when connecting a USB ethernet card to Rock64 =
USB 3.0 port.
> The internal ethernet works fine.

As I had world on the USB3, having an EtherNet dongle there
is not something that I've tried.

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C072DEA1-3CC7-494F-8306-7A8A6CB81C0B>