Re: Nanopi R5S support and build guide

From: Matheus <lojas_at_arroway.org>
Date: Fri, 05 May 2023 22:03:10 UTC

On May 5, 2023 2:23:15 AM GMT-03:00, Ganbold Tsagaankhuu <ganbold@gmail.com> wrote:
>On Thu, May 4, 2023 at 10:05 PM Matheus <lojas@arroway.org> wrote:
>
>> > On Tue, May 2, 2023 at 6:50 PM Matheus <lojas@arroway.org> wrote:
>> >
>> >>
>> >>
>> >> On May 1, 2023 1:47:12 PM GMT-03:00, "Søren Schmidt" <
>> >> soren.schmidt@gmail.com> wrote:
>> >> >> On 30 Apr 2023, at 23.44, Matheus <lojas@arroway.org> wrote:
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> I am trying to have FreeBSD 14 running on this SBC. I could not
>find
>> >> >any guides in how to build images for it. I found the
>> >> >people.freebsd.org/~sos/ site that has some images, and one for
>it,
>> but
>> >> >that seldom boots my board, and when it did, there was no console
>over
>> >> >serial or vga.
>> >> >>
>> >> >> If anyone can give any hints. Unfortunately my dev skills are
>not
>> >> >good. But I can test and help build once I figure out how :)
>> >> >
>> >> >Hi Matheus
>> >> >
>> >> >The image at
>> >> >
>> >> >
>> >>
>>
>https://people.freebsd.org/~sos/ARM64/current-RK356X-images/nano5-sdcard.img.gz
>> >> >
>> >> >for the Nanopi R5S does indeed boot with both HDMI output and
>serial
>> >> >console (1500000baud).
>> >> >
>> >> >The boot loader (EDK2 in FDT mode) is very picky on SD card
>quality
>> >> >though from experience, I works for me with Sandisk Ultra /
>Extreme
>> >> >cards but not with Samsung and cheap noname SD cards YMMV.
>> >>
>> >> Hi Søren,
>> >>
>> >> I had really issues on sd carda. I got it to boot once, but I was
>> >> printing
>> >> characters on screen at one per second. So I rebooted and don't
>remember
>> >> why rewrote the card. I can't boot anymore. Tried different cards,
>> >> SanDisk
>> >> ultra, no luck.
>> >>
>> >> I can boot an 13.2 image from the guy at personalbsd though. But
>there I
>> >> have just one ethernet.
>> >> On 13.2 I cannot list the ethernets nics using pciconf -lv,
>including
>> >> the
>> >> one that works. Is this expected?
>> >
>> >
>> > Yes. Did you try
>> >
>>
>https://personalbsd.org/download/Business/FreeBSD-aarch64-14.0-CURRENT-NanoPi-R5S-20230402.img.xz
>> > ?
>> > This image should have support for pcie and all ethernet should
>work
>> IIRC.
>> >
>> > Ganbold
>>
>> Hi Ganbold,
>>
>> I tried it and other 2 images and no success, including the image
>pointed
>> by Soren. Unfortunately I just got to boot one image from 14 but I
>> overwritten the sd card and can't remember which sd card and image :(
>>
>> The only image I can make it boot is from 13.2R, and I got it
>installed
>> fine (using an EFI image from personalbsd from March 23).
>>
>> Will wait for the next round of images for 14.
>>
>
>Above image works for me:
>
>root@NanoPi-R5S:~ # ifconfig
>re0: flags=8803<UP,BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>        options=201b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,WOL_MAGIC>
>        ether 62:73:64:e2:d4:87
>        inet 192.168.111.2 netmask 0xffffff00 broadcast 192.168.111.255
>        media: Ethernet autoselect
>        status: no carrier
>        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
>re1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
>1500
>        options=201b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,WOL_MAGIC>
>        ether 62:73:64:9a:5e:55
>        inet 192.168.2.2 netmask 0xffffff00 broadcast 192.168.2.255
>        media: Ethernet autoselect (1000baseT <full-duplex>)
>        status: active
>        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
>eq0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
>1500
>        options=80008<VLAN_MTU,LINKSTATE>
>        ether 22:07:01:bb:41:76
>        inet 192.168.1.202 netmask 0xffffff00 broadcast 192.168.1.255
>        media: Ethernet autoselect (1000baseT <full-duplex>)
>        status: active
>        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
>lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
>        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
>        inet6 ::1 prefixlen 128
>        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
>        inet 127.0.0.1 netmask 0xff000000
>        groups: lo
>        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
>root@NanoPi-R5S:~ # uname -an
>FreeBSD NanoPi-R5S 14.0-CURRENT FreeBSD 14.0-CURRENT #0
>main-n261950-4aeb939ecf8b-dirty: Sun Apr  2 17:42:01 MSK 2023
>root@honeycomb.local:/usr/crochet/work/obj/usr/crochet/src-current-14.0/arm64.aarch64/sys/EXPERT
>arm64
>root@NanoPi-R5S:~ # kldstat
>Id Refs Address                Size Name
> 1    8 0xffff000000000000  10cb350 kernel
> 2    1 0xffff0000010cd000    a9508 if_re.ko
> 3    1 0xffff0000c9e00000    24000 fdescfs.ko
> 4    1 0xffff0000c9e24000    22000 mac_ntpd.ko
>root@NanoPi-R5S:~ #
>
>Ganbold

Hi Ganbold and others, 

I gave another try today and I got to see some stuff on the serial console but the serial terminal itself is not usable. It prints unrecognizable characters, but I could recognize the red beastie logo. 
On the hdmi screen I have no output. Can you confirm the serial speed line? 
It was 115200 when I saw all that, and then tried 1500000 and despite it was printing something that looks like the boot, just weird characters appeared. 

Thanks again, 

Matheus 


>>
>> Thanks,
>>
>> matheus
>>
>> >>
>> >> I have little understanding of the arch, so my progress is much
>slow.
>> >> I got some dmesg from OpenBSD people where the nics show in
>ifconfig.
>> >> But
>> >> I couldn't get mine to behave this way. I can install though,
>using USB
>> >> nic.
>> >> I will try to buy a new sd card from the good list you pointed.
>> >> Another thing, I got the feeling that when I dd'ed the image using
>the
>> >> SD
>> >> card slot on the notebook it worked and when was through usb
>adapter did
>> >> not. Does it make sense? Using Linux mint as host for this.
>> >> Thanks so much for the answer and help,
>> >>
>> >> Matheus
>> >>
>> >>
>> >> >You can build a stock ARM64 generic kernel and most things will
>be
>> >> >usable, however as Ganbold wrote the DTS files is not in there
>yet (and
>> >> >not even in linux where our DTS files are fetched from).
>> >> >However the EDK2 boot loader provided (and used in above image)
>on
>> >> >
>> >>
>>https://people.freebsd.org/~sos/ARM64/EDK2-RK356X/NANOPI-R5S_EFI.itbï
>> ¿¼
>> >> >NANOPI-R5S_EFI
>> >> >File · 1,7 MB
>> >> >
>> >> >does hand over the “right†DTB file if you want to experiment.
>> >> >
>> >> >If you need the used DTS file and build guidance let me know in
>private
>> >> >mail...
>> >> >
>> >> >--
>> >> >Søren Schmidt
>> >> >sos@deepcore.dk / sos@freebsd.org
>> >> >"So much code to hack, so little time"
>> >>
>> >> ---
>> >> "We will call you Cygnus,
>> >> the God of balance you shall be."
>> >>
>> >>
>> >
>>
>>
>> --
>> "We will call you Cygnus,
>> the God of balance you shall be."
>> ------------------------------
>> "We will call you Cygnus,
>> the God of balance you shall be."

---
"We will call you Cygnus,
the God of balance you shall be."