From nobody Fri May 05 05:23:15 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 4QCJxZ1DVyz49cZR for ; Fri, 5 May 2023 05:23:30 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (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 4QCJxY5DZvz3xTX for ; Fri, 5 May 2023 05:23:29 +0000 (UTC) (envelope-from ganbold@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-3315ccc1ce0so9979235ab.3 for ; Thu, 04 May 2023 22:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683264208; x=1685856208; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rcxGseopz4Kqr3iOYzk9XaOUDTjx+nyvEU5SlDi8EKA=; b=WuWSprnAl+BO2NDXeOD9u2HYLSVDYqFmUQbQYfRJPYLV6BimeG0TeAynnnw1Snb6lc Td2k2R/1sgP6TAsPnBc2tCBV13rJYjocg9hU8Pz3iE0XA3CUjKSGVY6Gq5CyY0N6VuBf 3x7Gb1mTNfQw66JrL0ysdp/PE3VXuQhBWntRbJ9K6az7Qwk03dM/TYO66QePiWvxRSZs L/gjhS9idGGQ7h7CQzXSQDBX3Bkt/kIW59ommIFkB5Mse33/7Q2A+Leq5nkxD7y5HRPQ 32uRCcQoB5TaXnV48TekA8L6+aq1w814PgZ9lvMr9Ahe0l0EbbHHHo3SSs1ixN8qPy1u Q4mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683264208; x=1685856208; 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=rcxGseopz4Kqr3iOYzk9XaOUDTjx+nyvEU5SlDi8EKA=; b=L2S1jVLNuHjvEDt3X/dxGwnRqTQX8XNmOKemi074EnuDiB684323Hk5odzWesqaAQw c9pclrTt+n+VjOSRlxeO12brBMuzGespw2tXDa8bKieicOjnddG26uuCxw1Gbug8tqEV 2kMIOBYKn7CN2hobHoUrlwAzopGOZqOgT8BdedbkspXAkz/oqL/bUeX7buZH+r7e0tph wPg+AHCl49Vw1W/6X2FuFElo1cHOO0c05pBy4fomUesuOTWUkaMBjqvVPh/ksK7NWePU yuX7FaQOgCPhNgGbgNqX73+xSjeq9FazHVHrVwzfLVdUcltWe1uhZQar9hG0OzEQCDEV VUbw== X-Gm-Message-State: AC+VfDzd16q0W5RlKhyNgMwy2bXfNZhoR2yKi4+FHmdDM5KNgQpCuHT9 +U+trmmmPdxGc1igS+BtS0kFcEFa7Jujh0cN2/i92+7y0csvTw== X-Google-Smtp-Source: ACHHUZ4cuos4uwGJx/wUDNtJQUgF8YwHtsKuhwdZ4Eq3jin75b5IUFmLRInkiUK1JTmRUQkhEPGjlzcIUj6EmSBTh/A= X-Received: by 2002:a92:90c:0:b0:329:bba2:781a with SMTP id y12-20020a92090c000000b00329bba2781amr204829ilg.0.1683264207919; Thu, 04 May 2023 22:23:27 -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: Ganbold Tsagaankhuu Date: Fri, 5 May 2023 13:23:15 +0800 Message-ID: Subject: Re: Nanopi R5S support and build guide To: Matheus Cc: freebsd-arm@freebsd.org Content-Type: multipart/alternative; boundary="0000000000002d21cd05faeb7d17" X-Rspamd-Queue-Id: 4QCJxY5DZvz3xTX X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --0000000000002d21cd05faeb7d17 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 4, 2023 at 10:05=E2=80=AFPM Matheus wrote: > > On Tue, May 2, 2023 at 6:50=C3=A2=E2=82=AC=C2=AFPM Matheus wrote: > > > >> > >> > >> On May 1, 2023 1:47:12 PM GMT-03:00, "S=C3=83=C2=B8ren Schmidt" < > >> soren.schmidt@gmail.com> wrote: > >> >> On 30 Apr 2023, at 23.44, Matheus wrote: > >> >> > >> >> Hi, > >> >> > >> >> I am trying to have FreeBSD 14 running on this SBC. I could not fin= d > >> >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 ove= r > >> >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=C3=83=C2=B8ren, > >> > >> 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 rememb= er > >> 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-Na= noPi-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=3D8803 metric 0 mtu 1500 options=3D201b 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=3D29 re1: flags=3D8843 metric 0 mtu 1500 options=3D201b ether 62:73:64:9a:5e:55 inet 192.168.2.2 netmask 0xffffff00 broadcast 192.168.2.255 media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 eq0: flags=3D8843 metric 0 mtu 1500 options=3D80008 ether 22:07:01:bb:41:76 inet 192.168.1.202 netmask 0xffffff00 broadcast 192.168.1.255 media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 lo0: flags=3D8049 metric 0 mtu 16384 options=3D680003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4 inet 127.0.0.1 netmask 0xff000000 groups: lo nd6 options=3D21 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/arm= 64.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 > > 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 US= B > >> 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 d= id > >> 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 (a= nd > >> >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= =C3=AF > =C2=BF=C2=BC > >> >NANOPI-R5S_EFI > >> >File =C3=82=C2=B7 1,7 MB > >> > > >> >does hand over the =C3=A2=E2=82=AC=C5=93right=C3=A2=E2=82=AC DTB file= if you want to experiment. > >> > > >> >If you need the used DTS file and build guidance let me know in priva= te > >> >mail... > >> > > >> >-- > >> >S=C3=83=C2=B8ren 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." --0000000000002d21cd05faeb7d17 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, May 4, 2023 at 10:05=E2=80=AF= PM Matheus <lojas@arroway.org&g= t; wrote:
> O= n Tue, May 2, 2023 at 6:50=C3=A2=E2=82=AC=C2=AFPM Matheus <lojas@arroway.org> wrote:<= br>>
>>
>>
>> On May 1, 2023 1:47:12 PM GMT-0= 3:00, "S=C3=83=C2=B8ren Schmidt" <
>> soren.schmidt@gmail.com&g= t; 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 c= ould not find
>> >any guides in how to build images for it. I f= ound the
>> >people.freebsd.org/~sos/ site that has some images, and one= for it, but
>> >that seldom boots my board, and when it did, t= here was no console over
>> >serial or vga.
>> >>= ;
>> >> If anyone can give any hints. Unfortunately my dev s= kills are not
>> >good. But I can test and help build once I fi= gure 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 b= oot 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=C3=83=C2=B8ren,
>>
>> I had rea= lly issues on sd carda. I got it to boot once, but I was
>> printi= ng
>> characters on screen at one per second. So I rebooted and do= n'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?
>
>
> Y= es. Did you try
> https://personalbsd.org/download/Business/FreeBSD-aarch64-14.0-CURRENT-Na= noPi-R5S-20230402.img.xz
> ?
> This image should have suppo= rt for pcie and all ethernet should work IIRC.
>
> Ganbold
<= br>Hi Ganbold,

I tried it and other 2 images and no success, includi= ng the image pointed
by Soren. Unfortunately I just got to boot one imag= e 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, a= nd I got it installed
fine (using an EFI image from personalbsd from Mar= ch 23).

Will wait for the next round of images for 14.

Above image works for me:

r= oot@NanoPi-R5S:~ # ifconfig
re0: flags=3D8803<UP,BROADCAST,SIMPLEX,MU= LTICAST> metric 0 mtu 1500
=C2=A0 =C2=A0 =C2=A0 =C2=A0 options=3D201b= <RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,WOL_MAGIC>
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 ether 62:73:64:e2:d4:87
=C2=A0 =C2=A0 =C2=A0 =C2=A0 inet 1= 92.168.111.2 netmask 0xffffff00 broadcast 192.168.111.255
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 media: Ethernet autoselect
=C2=A0 =C2=A0 =C2=A0 =C2=A0 sta= tus: no carrier
=C2=A0 =C2=A0 =C2=A0 =C2=A0 nd6 options=3D29<PERFORMN= UD,IFDISABLED,AUTO_LINKLOCAL>
re1: flags=3D8843<UP,BROADCAST,RUNNI= NG,SIMPLEX,MULTICAST> metric 0 mtu 1500
=C2=A0 =C2=A0 =C2=A0 =C2=A0 o= ptions=3D201b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,WOL_MAGIC>
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 ether 62:73:64:9a:5e:55
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 inet 192.168.2.2 netmask 0xffffff00 broadcast 192.168.2.255
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 media: Ethernet autoselect (1000baseT <full-dup= lex>)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 status: active
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
= eq0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mt= u 1500
=C2=A0 =C2=A0 =C2=A0 =C2=A0 options=3D80008<VLAN_MTU,LINKSTATE= >
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ether 22:07:01:bb:41:76
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 inet 192.168.1.202 netmask 0xffffff00 broadcast 192.168.1= .255
=C2=A0 =C2=A0 =C2=A0 =C2=A0 media: Ethernet autoselect (1000baseT &= lt;full-duplex>)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 status: active
=C2=A0= =C2=A0 =C2=A0 =C2=A0 nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLO= CAL>
lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 = mtu 16384
=C2=A0 =C2=A0 =C2=A0 =C2=A0 options=3D680003<RXCSUM,TXCSUM,= LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 inet6 = ::1 prefixlen 128
=C2=A0 =C2=A0 =C2=A0 =C2=A0 inet6 fe80::1%lo0 prefixle= n 64 scopeid 0x4
=C2=A0 =C2=A0 =C2=A0 =C2=A0 inet 127.0.0.1 netmask 0xff= 000000
=C2=A0 =C2=A0 =C2=A0 =C2=A0 groups: lo
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
root@NanoPi-R5S= :~ # uname -an
FreeBSD NanoPi-R5S 14.0-CURRENT FreeBSD 14.0-CURRENT #0 m= ain-n261950-4aeb939ecf8b-dirty: Sun Apr =C2=A02 17:42:01 MSK 2023 =C2=A0 = =C2=A0 root@honeycomb.local:/usr/crochet/work/obj/usr/crochet/src-current-1= 4.0/arm64.aarch64/sys/EXPERT arm64
root@NanoPi-R5S:~ # kldstat
Id Ref= s Address =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Size Name<= br>=C2=A01 =C2=A0 =C2=A08 0xffff000000000000 =C2=A010cb350 kernel
=C2=A0= 2 =C2=A0 =C2=A01 0xffff0000010cd000 =C2=A0 =C2=A0a9508 if_re.ko
=C2=A03 = =C2=A0 =C2=A01 0xffff0000c9e00000 =C2=A0 =C2=A024000 fdescfs.ko
=C2=A04 = =C2=A0 =C2=A01 0xffff0000c9e24000 =C2=A0 =C2=A022000 mac_ntpd.ko
root@Na= noPi-R5S:~ #

Ganbold

= =C2=A0

Thanks,
matheus

>>
>> I have little understanding of th= e arch, so my progress is much slow.
>> I got some dmesg from Open= BSD people where the nics show in ifconfig.
>> But
>> I c= ouldn'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 li= st you pointed.
>> Another thing, I got the feeling that when I dd= 'ed the image using the
>> SD
>> card slot on the not= ebook it worked and when was through usb adapter did
>> not. Does = it make sense? Using Linux mint as host for this.
>> Thanks so muc= h for the answer and help,
>>
>> Matheus
>>
&= gt;>
>> >You can build a stock ARM64 generic kernel and most= things will be
>> >usable, however as Ganbold wrote the DTS fi= les is not in there yet (and
>> >not even in linux where our DT= S files are fetched from).
>> >However the EDK2 boot loader pro= vided (and used in above image) on
>> >
>> >https://people.freebsd.org/~sos/ARM64/EDK2-RK356X/NANOPI-R5S_EFI.itb= =C3=AF=C2=BF=C2=BC
>> >NANOPI-R5S_EFI
>> >File = =C3=82=C2=B7 1,7 MB
>> >
>> >does hand over the =C3= =A2=E2=82=AC=C5=93right=C3=A2=E2=82=AC DTB file if you want to experiment.=
>> >
>> >If you need the used DTS file and build g= uidance let me know in private
>> >mail...
>> >
= >> >--
>> >S=C3=83=C2=B8ren Schmidt
>> >sos@deepcore.dk / sos@freebsd.org
&= gt;> >"So much code to hack, so little time"
>>>> ---
>> "We will call you Cygnus,
>> the Go= d of balance you shall be."
>>
>>
>

--
"We will call you Cygnus,
the God of balance you shall be.&= quot;
"We will call you Cygnus,
the God of balance you shall be.= "
--0000000000002d21cd05faeb7d17--