Adding support for the Rockpi-S

I recently procured some of the excellent Rockpi-S boards, which come with full size usb and ethernet, onboard audio out, optional nand flash, optional wifi / BT (over SDIO), as well as optional POE all in a small relatively inexpensive package running on the RK3308.

My personal use-case is to build a device that can do shairport-sync (airplay) to some speakers, and probably a print server, but I can imagine a lot of other uses for them as well.

This thread is to document my attempts to get the board working, but also as I am somewhat new to Freebsd, to ask for help along the way.

My plan of action is as follows:

- Build u-boot for this board
- Bring up the board using the process in /usr/src/release/release.sh process, and ideally upstream that change.
- Document what works and what doesn't
- Investigate using nanobsd for this type of board.

If anyone has already done any of these steps (especially the u-boot work), I would love to collaborate. Also if there is a better place to communicate this please let me know.

I would like any advice on whether I should persue crochet over the /usr/src/release/release.sh process. I don't currently fully understand how I would choose between them. Also the release.sh processes seem to take an unreasonably large amount of time in order to build. Is there anything that I can do to have repeat builds at least be faster?
 
Also if there is a better place to communicate this please let me know.
A better place would be freebsd-arm@ mailing list. All the ARM developers are there to find.


Also the release.sh processes seem to take an unreasonably large amount of time in order to build. Is there anything that I can do to have repeat builds at least be faster?
Try


To make kernel module filemon persist reboots, set in /etc/rc.conf kld_list="filemon" .
 
Thanks for the suggestions!

Progress so far is slim. I have been working on getting u-boot up and running, and mostly just learning about what exactly it does, how it's installed, and how it differs between linux and FreeBSD. I'm probably missing some information on these things, but so far here is what I understand.

u-boot is roughly equivalent to the bios or EFI on an x86 device. It is responsible for bringing up DRAM and possibly other necessary aspects of the system that need to be working before a kernel can be run. It is also responsible for finding and booting into a kernel. To accomplish this job, has drivers for lots of things like disk drives, keyboards, serial ports, ethernet, among others. These allow logging, user-interaction, and ultimately finding a kernel image to boot from.

Also unlike a bios or efi, where the image is burned onto the board, u-boot is typically installed on the same sd-card or nand-flash that the device will eventually boot from. This means we have to provide a u-boot that works with both our kernel and our board and install it to the correct location of the SD card where it will be loaded.

This high level understanding of u-boot applies for both Linux and FreeBSD. I am still trying to understand the specific things FreeBSD needs from u-boot in order to boot on it.

So far I have started with the bsp provided by the manufacturer to try to build u-boot (following this guide). I did investigate creating a port of u-boot for the rock pi s under freebsd, but so far the specific chipset RK3308 does not seem to be supported in freebsd's u-boot or the upstream repo, and I don't really know all what has been customized to get it to work. So instead I am hoping to try to patch whatever FreeBSD needs into the manufacturer supplied u-boot source code in order to get it running, but the first step is just to get a working u-boot shell for the rock-pi-s so I can at least poke around.

Following the guide above, I have built idbloader.img, uboot.img and trust.img and coppied them to the correct offsets on the sd card. That does show text on the uart, but it crashloops. one cycle of the text is below:
Code:
INFO:    Preloader serial: 0
NOTICE:  BL31: v1.3(release):3a579d3
NOTICE:  BL31: Built : 09:09:17, Jan 29 2019
INFO:    Lastlog: last=0x100000, realtime=0x102000, size=0x2000
INFO:    ARM GICv2 driver initialized
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 1
INFO:    plat_rockchip_pmu_init: pd status 0xe
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x600000
INFO:    SPSR = 0x3c9
No serial driver found
WARN: PSCI sysreset is disabled

DDR Version V1.26
REGFB: 0x00000032, 0x00000032
In
589MHz
DDR3
 Col=10 Bank=8 Row=15 Size=512MB
msch:1
Returning to boot ROM...

I think I need to understand why this fails, and maybe try to boot a custom build linux kernel before I will be able to get FreeBSD running.
 
Had a small breakthrough today. I got lucky and discovered a working prebuilt u-boot intended for use with openBSD (gist). Importantly this copy of uboot has the bootefi command, which appears to be required for FreeBSD. Using these files, and the latest mini-memstick image for aarch64, I was able to put together a bootable sd card for the rock pi s. The image booted into the u-boot shell, and I was able to load the device tree and Freebsd kernel.

Code:
fatload mmc 0:1 ${fdt_addr_r} rk3308-rock-pi-s.dtb
fatload mmc 0:1 ${kernel_addr_r} efi/boot/bootaa64.efi
bootefi ${kernel_addr_r} ${fdt_addr_r}

This did boot the freebsd kernel, but resulted in a boot loop. I am including one cycle of the logs form that bootloop here.

Code:
INFO:    PSCI Power Domain Map:
INFO:      Domain Node : Level 2, parent_node -1, State ON (0x0)
INFO:      Domain Node : Level 1, parent_node 0, State ON (0x0)
INFO:      Domain Node : Level 0, parent_node 0, State ON (0x0)
INFO:      Domain Node : Level 0, parent_node 0, State ON (0x0)
INFO:      CPU Node : MPID 0x0, parent_node 1, State ON (0x0)
INFO:      CPU Node : MPID 0xffffffffffffffff, parent_node 1, State OFF (0x2)
INFO:      CPU Node : MPID 0xffffffffffffffff, parent_node 1, State OFF (0x2)
INFO:      CPU Node : MPID 0xffffffffffffffff, parent_node 1, State OFF (0x2)

DDR Version V1.26
REGFB: 0x00000032, 0x00000031
In
589MHz
DDR3
 Col=10 Bank=8 Row=15 Size=512MB
msch:1
Returning to boot ROM...
INFO:    Preloader serial: 0
NOTICE:  BL31: v1.3(release):3a579d3
NOTICE:  BL31: Built : 09:09:17, Jan 29 2019
INFO:    Lastlog: last=0x100000, realtime=0x102000, size=0x2000
INFO:    ARM GICv2 driver initialized
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 1
INFO:    plat_rockchip_pmu_init: pd status 0xe
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x600000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-02378-g2dce0717fc-dirty (Nov 26 2019 - 21:44:56 +1000)

Model: Radxa ROCK Pi S
PreSerial: 0
DRAM:  510 MiB
Relocation Offset is: 1f916000
vdd_core 1044000 uV
vdd-core init 1044000 uV
MMC:   dwmmc@ff480000: 0, dwmmc@ff490000: 1
Using default environment

In:    serial@ff0c0000
Consoles: EFI console
    Reading loader env vars from /efi/freebsd/loader.env
FreeBSD/arm64 EFI loader, Revision 1.1
(Thu Jul  1 05:57:02 UTC 2021 root@releng1.nyi.freebsd.org)
PartType: EFI
   Command line arguments: loader.efi
   Image base: 0x280000ial#" variable, errno=1
   EFI version: 2.051
   EFI Firmware: Das U-boot (rev 0.00)
   Console: comconsole (0)
   Load Path: \efi\boot\bootaa64.efi
   Load Device: dwmmc@ff480000.blk
"Synchronous Abort" handler, esr 0x96000010
* Relocate offset = 000000001f916000
* ELR(PC)    =   fffffffffeb12654
* LR         =   fffffffffeafbd3c
* SP         =   000000001e4f5610
aclk_peri 185714 KHz
* ESR_EL2    =   0000000096000010
pclk_perEC[31:26] == 100101, Exception from a Data abort, from current exception level
hclk_audIL[25] == 1, 32-bit instruction trapped
pclk_audio 98303 KHz
* DAIF       =   00000000000003c0
Hit key D[9] == 1, DBG maskedL+C'):  0
android_A[8] == 1, ABORT maskeduld not find misc partition
ANDROID:I[7] == 1, IRQ maskede)"
android_F[6] == 1, FIQ maskedCould not found bootable partition boot
Android boot failed, error -1.
* SPSR_EL2   =hi 0000000020000349
boot_rocD[9] == 1, DBG masked boot part info error
Card didA[8] == 1, ABORT masked select!
mmc_initI[7] == 0, IRQ not masked
switch tF[6] == 1, FIQ masked
mmc0 is M[4] == 0, Exception taken from AArch64
ScanningM[3:0] == 1001, EL2h
Found EFI removable media binary efi/boot/bootaa64.efi
* SCTLR_EL2  =ot 0000000030c51835
1266140 I[12] == 1, Icaches enablediB/s)
## StartC[2] == 1, Dcache enabled280000 ...
Adding bM[0] == 1, MMU enabled000000 (size: 0x1fe00000)
Scanning disk dwmmc@ff480000.blk...
* HCR_EL2    =   000000000800003aelect!
* VBAR_EL2   =   000000001ff16800
* TTBR0_EL2  =   000000001fff0000..
Scanning disk nandc@ff4b0000.blk...
x0 : 0000000000000000 x1 : 0000000000000000
x2 : 0000000000000000 x3 : 000000001e4d4749
x4 : 0000000000000073 x5 : 0000000000000050
x6 : 000000001e42625c x7 : 000000001e4d43c2
x8 : 0000000000000000 x9 : 0000000000000000
x10: fefefefefefefeff x11: 0000000000000006
x12: 0000000000000000 x13: 0000000000000000
x14: 0000000000000000 x15: 0000000000000000
x16: 0000000000000000 x17: 0000000000000000
x18: 000000001f50ddb8 x19: 000000001e4f5878
x20: 000000001e4d2d64 x21: 0000000000000000
x22: 0000000000000000 x23: 0000000000000000
x24: 000000001e4f7a88 x25: 000000001e4e0000
x26: 0000000000000000 x27: 000000001e4f77d8
x28: 000000001e4e6000 x29: 000000001e4f5800

SP:
1e4f5610:  00000000 00000000 00000000 00000000
1e4f5620:  00000000 00000000 1ff942ca 00000000
1e4f5630:  00000000 00000000 00000000 00000000
1e4f5640:  1ff94311 00000000 1ff94337 00000000
1e4f5650:  1ff94384 00000000 1ff943d1 00000000
1e4f5660:  1ff94411 00000000 1ff94451 00000000
1e4f5670:  1ff9448e 00000000 00000000 00000000
1e4f5680:  00000000 00000000 1ff944cb 00000000
1e4f5690:  1e4f5800 00000000 1ff16a0c 00000000
1e4f56a0:  1e4f5878 00000000 1e4d2d64 00000000
1e4f56b0:  1fff0000 00000000 0800003a 00000000
1e4f56c0:  30c51835 00000000 1e4f5610 00000000
1e4f56d0:  20000349 00000000 1ff16800 00000000
1e4f56e0:  000003c0 00000000 96000010 00000000
1e4f56f0:  1e428654 00000000 00000000 00000000
1e4f5700:  00000000 00000000 00000000 00000000

Resetting CPU ...

I don't really know how to figure out what went wrong in this log. but it looks like the following lines are important:

"Synchronous Abort" handler, esr 0x96000010
and
android_A[8] == 1, ABORT maskeduld not find misc partition ANDROID:I[7] == 1, IRQ maskede)" android_F[6] == 1, FIQ maskedCould not found bootable partition boot

Which seems to have multiple strings on top of one another. I can't really tell if it's
Could not find misc partition Found bootable partition boot

or
Could not find misc partition Could not found bootable partition
 
I don't really know how to figure out what went wrong in this log.
If you are asking for help you really should subscribe to the freebsd-arm@ mailing list. All the ARM developers are active there. It's more likely to find on that list a helping hand than here in Forums. FreeBSD developers are rarely on Forums, if at all.

It could take longer to figure out a solution alone here than to collaborate with members of the freebsd-arm@ list. You can expect there members with substantial understanding of the problem and the one or other might pointing in the right direction or maybe there is already a same/similar work in progress.
 
Thanks T-Daemon, I have already done so and have gotten some response there. I was planning to still log my progress here, since it's easier to format code and text on this forum than in an email.
 
started to play with it, seems needs some kernel drivers to work
after looking at the boot log looks like it needs
rk3308_cru (clock) and most likely some ethernet patches

13.2 or 14 behaves the same
u-boot is leeched from the openbsd gist above
will try to hack a clock driver
Code:
U-Boot 2017.09-02378-g2dce0717fc-dirty (Nov 26 2019 - 21:44:56 +1000)

Model: Radxa ROCK Pi S
PreSerial: 0
DRAM:  510 MiB
Relocation Offset is: 1f916000
vdd_core 1044000 uV
vdd-core init 1044000 uV
MMC:   dwmmc@ff480000: 0, dwmmc@ff490000: 1
Using default environment

In:    serial@ff0c0000
Out:   serial@ff0c0000
Err:   serial@ff0c0000
Model: Radxa ROCK Pi S
Bootdev(atags): mmc 0
PartType: EFI
## Error: Can't overwrite "serial#"
## Error inserting "serial#" variable, errno=1
get part misc fail -1
boot mode: normal
CLK:
apll 816000 KHz
dpll 1300000 KHz
vpll0 1179647 KHz
vpll1 903167 KHz
aclk_bus 185714 KHz
hclk_bus 100000 KHz
pclk_bus 100000 KHz
aclk_peri 185714 KHz
hclk_peri 100000 KHz
pclk_peri 100000 KHz
hclk_audio 98303 KHz
pclk_audio 98303 KHz
Net:   No ethernet found.
Hit key to stop autoboot('CTRL+C'):  0
android_bootloader_boot_flow Could not find misc partition
ANDROID: reboot reason: "(none)"
android_bootloader_boot_flow Could not found bootable partition boot
Android boot failed, error -1.
=Booting Rockchip format image=
boot_rockchip_image kernel or boot part info error
console comconsole failed to initialize
Consoles: EFI console
    Reading loader env vars from /efi/freebsd/loader.env
FreeBSD/arm64 EFI loader, Revision 1.1
Scanning mmc 0:1...
   Command line arguments: loader.efiboot/bootaa64.efi
   Image base: 0x28000064.efi
   EFI version: 2.05n 54 ms (20.9 MiB/s)
   EFI Firmware: Das U-boot (rev 0.00)MAGIC
   Console: efi,comconsole (0) 00280000 ...
   Load Path: \efi\boot\bootaa64.efi (size: 0x1fe00000)
   Load Device: dwmmc@ff480000.blk.
ERROR: cannot open /boot/lua/loader.lua: invalid argument.
mmc_init: -95, time 9
Scanning disk dwmmc@ff490000.blk...
Type '?' for a list of commands, 'help' for more detailed help.
OK set currdev="disk0p2:"
OK load kernel
/boot/kernel/kernel text=0x2a8 text=0x8d5250 text=0x212d5c data=0x1ae510 data=0x0+0x2a9000 0x8+0x1295d0+0x8+0x14e631/
OK load -t dtb /boot/dtb/rockchip/r.dtb..
/boot/dtb/rockchip/r.dtb size=0xaf5a
OK boot
Using DTB from loaded file '/boot/dtb/rockchip/r.dtb'.
EFI framebuffer information:
addr, size     0x0, 0x0000.spinor.blk...
dimensions     0 x 0
stride         0
masks          0x00000000, 0x00000000, 0x00000000, 0x00000000
---<<BOOT>>---
WARNING: Cannot find freebsd,dts-version property, cannot check DTB compliance
Copyright (c) 1992-2021 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.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC arm64
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
VT: init without driver.
module firmware already present!
real memory  = 534769664 (509 MB)
avail memory = 499859456 (476 MB)
Starting CPU 1 (1)
Starting CPU 2 (2)
Starting CPU 3 (3)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
arc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled.
random: entropy device external interface
MAP 1e3e5000 mode 2 pages 1
MAP 1ffa5000 mode 2 pages 1
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
clk_fixed0: <Fixed clock> on ofwbus0
clk_fixed1: <Fixed clock> on ofwbus0
regfix0: <Fixed Regulator> on ofwbus0
regfix1: <Fixed Regulator> on ofwbus0
regfix2: <Fixed Regulator> on ofwbus0
regfix3: <Fixed Regulator> on ofwbus0
regfix4: <Fixed Regulator> on ofwbus0
regfix5: <Fixed Regulator> on ofwbus0
regfix6: <Fixed Regulator> on ofwbus0
regfix7: <Fixed Regulator> on ofwbus0
regfix8: <Fixed Regulator> on ofwbus0
regfix9: <Fixed Regulator> on ofwbus0
simple_mfd0: <Simple MFD (Multi-Functions Device)> mem 0xff000000-0xff00ffff on ofwbus0
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
gpioregulator0: <GPIO controlled regulator> on ofwbus0
gpioregulator0: cannot get pin 0
gpioregulator0: cannot parse parameters
device_attach: gpioregulator0 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00c000-0xff00cfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff008000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
gpioregulator0: <GPIO controlled regulator> on ofwbus0
gpioregulator0: cannot get pin 0
gpioregulator0: cannot parse parameters
device_attach: gpioregulator0 attach returned 6
generic_timer0: <ARMv8 Generic Timer> irq 5,6,7,8 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 24000000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 24000000 Hz quality 1000
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00c000-0xff00cfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff008000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
gpioregulator0: <GPIO controlled regulator> on ofwbus0
gpioregulator0: cannot get pin 0
gpioregulator0: cannot parse parameters
device_attach: gpioregulator0 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00c000-0xff00cfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff008000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
gpioregulator0: <GPIO controlled regulator> on ofwbus0
gpioregulator0: cannot get pin 0
gpioregulator0: cannot parse parameters
device_attach: gpioregulator0 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00c000-0xff00cfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff008000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
gpioregulator0: <GPIO controlled regulator> on ofwbus0
gpioregulator0: cannot get pin 0
gpioregulator0: cannot parse parameters
device_attach: gpioregulator0 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00c000-0xff00cfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
mmc_pwrseq0: <MMC Simple Power sequence> on ofwbus0
mmc_pwrseq0: Cannot get the reset-gpios
device_attach: mmc_pwrseq0 attach returned 6
gpioregulator0: <GPIO controlled regulator> on ofwbus0
gpioregulator0: cannot get pin 0
gpioregulator0: cannot parse parameters
device_attach: gpioregulator0 attach returned 6
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
cpufreq_dt0: <Generic cpufreq driver> on cpu0
cpufreq_dt0: no regulator for cpu@0
device_attach: cpufreq_dt0 attach returned 6
cpu1: <Open Firmware CPU> on cpulist0
cpu2: <Open Firmware CPU> on cpulist0
cpu3: <Open Firmware CPU> on cpulist0
pmu0: <Performance Monitoring Unit> irq 0,1,2,3 on ofwbus0
syscon_generic_dev0: Cannot allocate memory resource
device_attach: syscon_generic_dev0 attach returned 6
syscon_generic_dev0: Cannot allocate memory resource
device_attach: syscon_generic_dev0 attach returned 6
syscon_generic_dev0: Cannot allocate memory resource
device_attach: syscon_generic_dev0 attach returned 6
uart0: <16750 or compatible> mem 0xff0a0000-0xff0a00ff irq 14 on ofwbus0
uart0: console (-1,n,8,1)
uart1: <16750 or compatible> mem 0xff0e0000-0xff0e00ff irq 18 on ofwbus0
dwcotg0: <DWC OTG 2.0 integrated USB controller> mem 0xff400000-0xff43ffff irq 36 on ofwbus0
usbus1 on dwcotg0
ehci0: <Generic EHCI Controller> mem 0xff440000-0xff44ffff irq 37 on ofwbus0
usbus2: EHCI version 1.0
usbus2 on ehci0
ohci0: <Generic OHCI Controller> mem 0xff450000-0xff45ffff irq 38 on ofwbus0
usbus3 on ohci0
rockchip_dwmmc0: <Synopsys DesignWare Mobile Storage Host Controller (RockChip)> mem 0xff480000-0xff483fff irq 39 on ofwbus0
rockchip_dwmmc0: num-slots property is deprecated
rockchip_dwmmc0: No bus speed provided
rockchip_dwmmc0: Can't get FDT property.
device_attach: rockchip_dwmmc0 attach returned 6
rockchip_dwmmc0: <Synopsys DesignWare Mobile Storage Host Controller (RockChip)> mem 0xff490000-0xff493fff irq 40 on ofwbus0
rockchip_dwmmc0: num-slots property is deprecated
rockchip_dwmmc0: No bus speed provided
rockchip_dwmmc0: Can't get FDT property.
device_attach: rockchip_dwmmc0 attach returned 6
rockchip_dwmmc0: <Synopsys DesignWare Mobile Storage Host Controller (RockChip)> mem 0xff4a0000-0xff4a3fff irq 41 on ofwbus0
rockchip_dwmmc0: No bus speed provided
rockchip_dwmmc0: Can't get FDT property.
device_attach: rockchip_dwmmc0 attach returned 6
mmc_pwrseq0: <MMC Simple Power sequence> on ofwbus0
mmc_pwrseq0: Cannot get the reset-gpios
device_attach: mmc_pwrseq0 attach returned 6
gpioregulator0: <GPIO controlled regulator> on ofwbus0
gpioregulator0: cannot get pin 0
gpioregulator0: cannot parse parameters
device_attach: gpioregulator0 attach returned 6
gpioled0: <GPIO LEDs> on ofwbus0
gpioled0: <rockpis:green:power> failed to map pin
gpioled0: <rockpis:blue:user> failed to map pin
armv8crypto0: <AES-CBC,AES-XTS,AES-GCM>
Timecounters tick every 1.000 msec
CPU  0: ARM Cortex-A35 r0p2 affinity:  0
                   Cache Type = <64 byte D-cacheline,64 byte I-cacheline,VIPT ICache,64 byte ERG,64 byte CWG>
 Instruction Set Attributes 0 = <CRC32,SHA2,SHA1,AES+PMULL>
 Instruction Set Attributes 1 = <>
 Instruction Set Attributes 2 = <>
         Processor Features 0 = <AdvSIMD,FP,EL3 32,EL2 32,EL1 32,EL0 32>
         Processor Features 1 = <>
      Memory Model Features 0 = <TGran4,TGran64,TGran16,SNSMem,BigEnd,16bit ASID,1TB PA>
      Memory Model Features 1 = <8bit VMID>
      Memory Model Features 2 = <32bit CCIDX,48bit VA>
             Debug Features 0 = <DoubleLock,2 CTX BKPTs,4 Watchpoints,6 Breakpoints,PMUv3,Debugv8>
             Debug Features 1 = <>
         Auxiliary Features 0 = <>
         Auxiliary Features 1 = <>
AArch32 Instruction Set Attributes 5 = <CRC32,SHA2,SHA1,AES+VMULL,SEVL>
AArch32 Media and VFP Features 0 = <FPRound,FPSqrt,FPDivide,DP VFPv3+v4,SP VFPv3+v4,AdvSIMD>
AArch32 Media and VFP Features 1 = <SIMDFMAC,FPHP DP Conv,SIMDHP SP Conv,SIMDSP,SIMDInt,SIMDLS,FPDNaN,FPFtZ>
CPU  1: ARM Cortex-A35 r0p2 affinity:  1
CPU  2: ARM Cortex-A35 r0p2 affinity:  2
CPU  3: ARM Cortex-A35 r0p2 affinity:  3
Release APs...done
usbus1: 480Mbps High Speed USB v2.0
usbus2: 480Mbps High Speed USB v2.0
usbus3: 12Mbps Full Speed USB v1.0
Trying to mount root from ufs:/dev/ufs/FreeBSD_Install [ro,noatime]...
ugen1.1: <DWCOTG OTG Root HUB> at usbus1
ugen3.1: <Generic OHCI root HUB> at usbus3
uhub0 on usbus1
uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
uhub1 on usbus3
uhub1: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
ugen2.1: <Generic EHCI root HUB> at usbus2
uhub2 on usbus2
uhub2: <Generic EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
uhub1: 1 port with 1 removable, self powered
uhub0: 1 port with 1 removable, self powered
uhub2: 1 port with 1 removable, self powered
mountroot: waiting for device /dev/ufs/FreeBSD_Install...
Mounting from ufs:/dev/ufs/FreeBSD_Install failed with error 19.

Loader variables:
  vfs.root.mountfrom=ufs:/dev/ufs/FreeBSD_Install
  vfs.root.mountfrom.options=ro,noatime

Manual root filesystem specification:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

    eg. ufs:/dev/da0s1a
        zfs:zroot/ROOT/default
        cd9660:/dev/cd0 ro
          (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /)

  ?               List valid disk boot devices
  .               Yield 1 second (for background tasks)
  <empty line>    Abort manual input

mountroot>
 
u-boot is leeched from the openbsd gist above
I just "ported' the FriendlyElec NanoPC-T4 with new u-boot port for my personal usage.
Basically I just cloned another RK board port with same CPU. (RockPi4 u-boot) and adjusted the defconfig for the NanoPC-T4 in the Makefile and that was it. Compiled my port and it created u-boot and dtb for the board.
I like the master port approach. Remember to backup those port patches!!

I putzed around with NetBSD and OpenBSD u-boot for my board before I decided to build my own port.

The problems I see is mainline u-boot seems barebones on some platforms.
Plus mailine is slow to bring new stuff in.

My next challenge is out-of tree u-boot.
Tinkerboard2 has their own tree and I need to figure out how to compile u-boot by hand.

I captured this from a port compilation.
gmake ARCH=arm DESTDIR=/usr/ports/sysutils/u-boot-rock-pi-4/work/stage rock-pi-4-rk3399_defconfig

Might need the long form I dunno.
cd /usr/ports/sysutils/u-boot-rock-pi-4/work/u-boot-2023.01; /usr/bin/env MAKE=gmake PYTHON="/usr/local/bin/python3.9" PKG_CONFIG=pkgconf XDG_DATA_HOME=/usr/ports/sysutils/u-boot-rock-pi-4/work XDG_CONFIG_HOME=/usr/ports/sysutils/u-boot-rock-pi-4/work XDG_CACHE_HOME=/usr/ports/sysutils/u-boot-rock-pi-4/work/.cache HOME=/usr/ports/sysutils/u-boot-rock-pi-4/work PATH=/usr/ports/sysutils/u-boot-rock-pi-4/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin PKG_CONFIG_LIBDIR=/usr/ports/sysutils/u-boot-rock-pi-4/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig SHELL=/bin/sh CONFIG_SHELL=/bin/sh V=1 CROSS_COMPILE=aarch64-none-elf- PYTHON=/usr/local/bin/python3.9 CC=clang BL31=/usr/local/share/atf-rk3399/bl31.elf XDG_DATA_HOME=/usr/ports/sysutils/u-boot-rock-pi-4/work XDG_CONFIG_HOME=/usr/ports/sysutils/u-boot-rock-pi-4/work XDG_CACHE_HOME=/usr/ports/sysutils/u-boot-rock-pi-4/work/.cache HOME=/usr/ports/sysutils/u-boot-rock-pi-4/work PATH=/usr/ports/sysutils/u-boot-rock-pi-4/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin PKG_CONFIG_LIBDIR=/usr/ports/sysutils/u-boot-rock-pi-4/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local LOCALBASE=/usr/local CC="cc" CFLAGS="-O2 -pipe -fno-strict-aliasing " CPP="cpp" CPPFLAGS="" LDFLAGS=" " LIBS="" CXX="c++" CXXFLAGS="-O2 -pipe -fno-strict-aliasing " MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 0644" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" gmake ARCH=arm DESTDIR=/usr/ports/sysutils/u-boot-rock-pi-4/work/stage rock-pi-4-rk3399_defconfig
 
I was wondering why you are using a 6 year old u-boot.
I see why. There is no defconfig in mainline u-boot for the board.
That seems to make my point about mainline being slow to add boards.

And why I need to build my own Raxda u-boot tree.

I hate trusted.img and everything about the concept.
rkdeveloper and blobs. It stinks. I do like my NVMe on arm64.
 
there is a rk3308_evb_defconfig or something and i tried a quick hack of the rockpi64 u-boot port and it failed to build
i resorted the easy way just used prebuilt blobs cause i wondered if it boots at all
if i succeed in hacking a clock driver then ill try build a proper u-boot (now i have to specify currdev and load the dtb everytime which is annoying)
soc specific clock driver code is really short but the initialization of some tables structure is fscking ugly
https://github.com/freebsd/freebsd-src/blob/main/sys/arm64/rockchip/clk/rk3568_cru.c (model)
https://raw.githubusercontent.com/torvalds/linux/master/drivers/clk/rockchip/clk-rk3308.c (source)
 
Last edited:
i have it booting multiuser but still not very useful
ethernet does not work, usb seems dead
my "clock driver" has lots of warnings
at least the sd card works and i have a root file system
 
ok I have pinctrl and gpio
also usb seems to work
ethernet still no go
1686640673540.png
 
got new u-boot and ethernet working
Code:
INFO:    PSCI Power Domain Map:
INFO:      Domain Node : Level 2, parent_node -1, State ON (0x0)
INFO:      Domain Node : Level 1, parent_node 0, State ON (0x0)
INFO:      Domain Node : Level 0, parent_node 0, State ON (0x0)
INFO:      Domain Node : Level 0, parent_node 0, State ON (0x0)
INFO:      CPU Node : MPID 0x0, parent_node 1, State ON (0x0)
INFO:      CPU Node : MPID 0x1, parent_node 1, State ON (0x0)
INFO:      CPU Node : MPID 0x2, parent_node 1, State ON (0x0)
INFO:      CPU Node : MPID 0x3, parent_node 1, State ON (0x0)
DDR Version V2.06 20211109
CHIP ID = 0x00003308
REG2C: 0x00000034, 0x00000034
In
589MHz
DDR3
Col=10 Bank=3 Row=15 Size=512MB
OUT: sdram_init finish.
Boot1 Release Time: Mar 24 2022 08:28:57, version: 1.36
ROM VER:0x56323030, 19
chip_id:330800,0
ChipType = 0x13, 511
DPLL = 1300 MHz
...nandc_flash_init enter...
No.1 FLASH ID:ff ff ff ff ff ff
DPLL = 1300 MHz
sfc nor id: ff ff ff
DPLL = 1300 MHz
sfc_nand id: ff ff ff
NeedKHz=200KHz,clock=12000KHz
NeedKHz=200KHz,clock=12000KHz
NeedKHz=200KHz,clock=12000KHz
mmc2:cmd8,20
mmc2:cmd5,20
mmc2:cmd55,20
mmc2:cmd1,20
NeedKHz=200KHz,clock=12000KHz
emmc reinit
NeedKHz=200KHz,clock=12000KHz
mmc2:cmd8,20
mmc2:cmd5,20
mmc2:cmd55,20
mmc2:cmd1,20
NeedKHz=200KHz,clock=12000KHz
emmc reinit
NeedKHz=200KHz,clock=12000KHz
mmc2:cmd8,20
mmc2:cmd5,20
mmc2:cmd55,20
mmc2:cmd1,20
NeedKHz=200KHz,clock=12000KHz
SdmmcInit=2 1
NeedKHz=200KHz,clock=12000KHz
NeedKHz=200KHz,clock=12000KHz
NeedKHz=200KHz,clock=12000KHz
mmc0:cmd5,20
DPLL = 1300 MHz
NeedKHz=24000KHz,clock=650000KHz
DPLL = 1300 MHz
NeedKHz=40000KHz,clock=650000KHz
SdmmcInit=0 0
BootCapSize=0
UserCapSize=14832MB
FwPartOffset=2000 , 0
StorageInit ok = 26883
SecureMode = 0
Secure read PBA: 0x4
Secure read PBA: 0x404
Secure read PBA: 0x804
Secure read PBA: 0xc04
Secure read PBA: 0x1004
SecureInit ret = 0, SecureMode = 0
atags_set_bootdev: ret:(0)
GPT part:  0, name:                 , start:0x9000, size:0x741b
GPT part:  1, name:                 , start:0x1041b, size:0xa8980
no find partition:uboot.
LoadTrust Addr:0x4000
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 2000
Load OK, addr=0x600000, size=0xaadd0
RunBL31 0x40000 @ 111779 us
INFO:    Preloader serial: 0
NOTICE:  BL31: v1.3(release):30f1405
NOTICE:  BL31: Built : 17:08:28, Sep 23 2019
INFO:    Lastlog: last=0x100000, realtime=0x102000, size=0x2000
INFO:    ARM GICv2 driver initialized
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 1
INFO:    plat_rockchip_pmu_init: pd status 0xe b
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x600000
INFO:    SPSR = 0x3c9


U-Boot 2023.07-rc4-dirty (Jun 14 2023 - 18:30:48 +0300)

Model: Radxa ROCK Pi S
DRAM:  512 MiB (effective 510 MiB)
Core:  285 devices, 21 uclasses, devicetree: separate
MMC:   dwmmc@ff480000: 1, dwmmc@ff490000: 0, dwmmc@ff4a0000: 2
Loading Environment from nowhere... OK
rockchip_dnl_key_pressed read board id failed
Net:
Error: ethernet@ff4e0000 address not set.
No ethernet found.

Hit any key to stop autoboot:  0
** Booting bootflow 'dwmmc@ff480000.bootdev.part_1' with efi
Card did not respond to voltage select! : -110
Booting /efi\boot\bootaa64.efi
console comconsole failed to initialize
Consoles: EFI console
    Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk0p1:
FreeBSD/arm64 EFI loader, Revision 1.1

   Command line arguments: loader.efi
   Image base: 0x1cdd3000
   EFI version: 2.100
   EFI Firmware: Das U-Boot (rev 8227.1792)
   Console: efi,comconsole (0)
   Load Path: /efi\boot\bootaa64.efi
   Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(1)/SD(0)/HD(1,GPT,755e6d34-0a73-11ee-9b89-008cfad5d643,0x9000,0x741b)
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(1)/SD(0)/HD(1,GPT,755e6d34-0a73-11ee-9b89-008cfad5d643,0x9000,0x741b)
Setting currdev to disk0p1:
Loading /boot/defaults/loader.conf
Loading /boot/defaults/loader.conf
Loading /boot/device.hints
Loading /boot/loader.conf
Loading /boot/loader.conf.local
/
c\
|  ______               ____   _____ _____
  |  ____|             |  _ \ / ____|  __ \
  | |___ _ __ ___  ___ | |_) | (___ | |  | |
  |  ___| '__/ _ \/ _ \|  _ < \___ \| |  | |
  | |   | | |  __/  __/| |_) |____) | |__| |
  | |   | | |    |    ||     |      |      |
  |_|   |_|  \___|\___||____/|_____/|_____/      ```                        `
                                                s` `.....---.......--.```   -/
 +---------- Welcome to FreeBSD -----------+    +o   .--`         /y:`      +.
 |                                         |     yo`:.            :o      `+-
 |  1. Boot Multi user [Enter]             |      y/               -/`   -o/
 |  2. Boot Single user                    |     .-                  ::/sy+:.
 |  3. Escape to loader prompt             |     /                     `--  /
 |  4. Reboot                              |    `:                          :`
 |  5. Cons: Video                         |    `:                          :`
 |                                         |     /                          /
 |  Options:                               |     .-                        -.
 |  6. Kernel: default/kernel (1 of 1)     |      --                      -.
 |  7. Boot Options                        |       `:`                  `:`
 |                                         |         .--             `--.
 |                                         |            .---.....----.
 +-----------------------------------------+
   Autoboot in 0 seconds. [Space] to pause

Loading kernel...
/boot/kernel/kernel text=0x2a8 text=0x8d59a0 text=0x215114 data=0x1bbf10 data=0x0+0x2a9000 0x8+0x12de30+0x8+0x1500db\
Loading configured modules...
rockpi-s.dtb.../boot/dtb/rockpi-s.dtb size=0xd651
/etc/hostid...can't find '/etc/hostid'
failed!
/boot/entropy...can't find '/boot/entropy'
failed!
Using DTB from loaded file '/boot/dtb/rockpi-s.dtb'.
EFI framebuffer information:
addr, size     0x0, 0x0
dimensions     0 x 0
stride         0
masks          0x00000000, 0x00000000, 0x00000000, 0x00000000
---<<BOOT>>---
WARNING: Cannot find freebsd,dts-version property, cannot check DTB compliance
Copyright (c) 1992-2021 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.2-RELEASE GENERIC arm64
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
VT: init without driver.
module firmware already present!
real memory  = 534773760 (510 MB)
avail memory = 499376128 (476 MB)
Starting CPU 1 (1)
Starting CPU 2 (2)
Starting CPU 3 (3)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
arc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled.
random: entropy device external interface
MAP 1cf04000 mode 2 pages 2
MAP 1cf07000 mode 2 pages 6
MAP 1ff40000 mode 2 pages 16
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
clk_fixed0: <Fixed clock> on ofwbus0
clk_fixed1: <Fixed clock> on ofwbus0
rk_grf0: <RockChip General Register Files> mem 0xff000000-0xff007fff on ofwbus0
rk3308_cru0: <Rockchip RK3308 Clock & Reset Unit> mem 0xff500000-0xff500fff on ofwbus0
regfix0: <Fixed Regulator> on ofwbus0
regfix1: <Fixed Regulator> on ofwbus0
regfix2: <Fixed Regulator> on ofwbus0
regfix3: <Fixed Regulator> on ofwbus0
regfix4: <Fixed Regulator> on ofwbus0
regfix5: <Fixed Regulator> on ofwbus0
regfix6: <Fixed Regulator> on ofwbus0
simple_mfd0: <Simple MFD (Multi-Functions Device)> mem 0xff008000-0xff00bfff on ofwbus0
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd1: Cannot allocate memory resource
device_attach: simple_mfd1 attach returned 6
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0xff00c000-0xff00cfff on ofwbus0
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
gic0: <ARM Generic Interrupt Controller> mem 0xff581000-0xff581fff,0xff582000-0xff583fff,0xff584000-0xff585fff,0xff586000-0xff587fff irq 47 on ofwbus0
gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 160
rk_pinctrl0: <RockChip Pinctrl controller> on ofwbus0
gpio0: <RockChip GPIO Bank controller> mem 0xff220000-0xff2200ff irq 48 on rk_pinctrl0
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <RockChip GPIO Bank controller> mem 0xff230000-0xff2300ff irq 49 on rk_pinctrl0
gpiobus1: <OFW GPIO bus> on gpio1
gpio2: <RockChip GPIO Bank controller> mem 0xff240000-0xff2400ff irq 50 on rk_pinctrl0
gpiobus2: <OFW GPIO bus> on gpio2
gpio3: <RockChip GPIO Bank controller> mem 0xff250000-0xff2500ff irq 51 on rk_pinctrl0
gpiobus3: <OFW GPIO bus> on gpio3
gpio4: <RockChip GPIO Bank controller> mem 0xff260000-0xff2600ff irq 52 on rk_pinctrl0
gpiobus4: <OFW GPIO bus> on gpio4
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
rk_i2c0: <RockChip I2C> mem 0xff050000-0xff050fff irq 9 on ofwbus0
iicbus0: <OFW I2C bus> on rk_i2c0
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
generic_timer0: <ARMv8 Generic Timer> 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
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
mmc_pwrseq0: <MMC Simple Power sequence> on ofwbus0
rk_usb2phy0: <Rockchip USB2PHY> mem 0-0xff007fff,0-0x3fff on simple_mfd0
simple_mfd2: <Simple MFD (Multi-Functions Device)> mem 0xff00b000-0xff00bfff on ofwbus0
simple_mfd2: Cannot allocate memory resource
device_attach: simple_mfd2 attach returned 6
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
cpufreq_dt0: <Generic cpufreq driver> on cpu0
cpufreq_dt0: no regulator for cpu@0
device_attach: cpufreq_dt0 attach returned 6
cpu1: <Open Firmware CPU> on cpulist0
cpu2: <Open Firmware CPU> on cpulist0
cpu3: <Open Firmware CPU> on cpulist0
syscon_generic_dev0: Cannot allocate memory resource
device_attach: syscon_generic_dev0 attach returned 6
iic0: <I2C generic I/O> on iicbus0
uart0: <16750 or compatible> mem 0xff0a0000-0xff0a00ff irq 13 on ofwbus0
uart0: console (1500000,n,8,1)
uart1: <16750 or compatible> mem 0xff0c0000-0xff0c00ff irq 15 on ofwbus0
uart2: <16750 or compatible> mem 0xff0e0000-0xff0e00ff irq 17 on ofwbus0
pwm0: <Rockchip PWM> mem 0xff180000-0xff18000f on ofwbus0
pwmbus0: <OFW PWM bus> on pwm0
pwmc0: <PWM Control> channel 0 on pwmbus0
dwcotg0: <DWC OTG 2.0 integrated USB controller> mem 0xff400000-0xff43ffff irq 36 on ofwbus0
usbus1 on dwcotg0
ehci0: <Generic EHCI Controller> mem 0xff440000-0xff44ffff irq 37 on ofwbus0
usbus2: EHCI version 1.0
usbus2 on ehci0
ohci0: <Generic OHCI Controller> mem 0xff450000-0xff45ffff irq 38 on ofwbus0
usbus3 on ohci0
rockchip_dwmmc0: <Synopsys DesignWare Mobile Storage Host Controller (RockChip)> mem 0xff480000-0xff483fff irq 39 on ofwbus0
Cannot set frequency for clk: clk_sdmmc, error: 34
rockchip_dwmmc0: cannot set ciu clock to 150000000
rockchip_dwmmc0: Hardware version ID is 270a
mmc0: <MMC/SD bus> on rockchip_dwmmc0
rockchip_dwmmc1: <Synopsys DesignWare Mobile Storage Host Controller (RockChip)> mem 0xff490000-0xff493fff irq 40 on ofwbus0
Cannot set frequency for clk: clk_emmc, error: 34
rockchip_dwmmc1: cannot set ciu clock to 150000000
rockchip_dwmmc1: Hardware version ID is 270a
mmc1: <MMC/SD bus> on rockchip_dwmmc1
rockchip_dwmmc2: <Synopsys DesignWare Mobile Storage Host Controller (RockChip)> mem 0xff4a0000-0xff4a3fff irq 41 on ofwbus0
Cannot set frequency for clk: clk_sdio, error: 34
rockchip_dwmmc2: cannot set ciu clock to 150000000
rockchip_dwmmc2: Hardware version ID is 270a
mmc2: <MMC/SD bus> on rockchip_dwmmc2
dwc0: <Rockchip Gigabit Ethernet Controller> mem 0xff4e0000-0xff4effff irq 43 on ofwbus0
ETH BLAH 22
miibus0: <MII bus> on dwc0
ukphy0: <Generic IEEE 802.3u media interface> PHY 0 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
dwc0: Ethernet address: 62:73:64:68:8c:4f
gpioc0: <GPIO controller> on gpio0
gpioc1: <GPIO controller> on gpio1
gpioc2: <GPIO controller> on gpio2
gpioc3: <GPIO controller> on gpio3
gpioc4: <GPIO controller> on gpio4
gpioled0: <GPIO LEDs> on ofwbus0
armv8crypto0: <AES-CBC,AES-XTS,AES-GCM>
Timecounters tick every 1.000 msec
Cannot set frequency for clk: clk_sdmmc, error: 34
rockchip_dwmmc0: failed to set frequency to 400000 Hz: 34
usbus1: 480Mbps High Speed USB v2.0
usbus2: 480Mbps High Speed USB v2.0
usbus3: 12Mbps Full Speed USB v1.0
ugen3.1: <Generic OHCI root HUB> at usbus3
uhub0 on usbus3
uhub0: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
ugen2.1: <Generic EHCI root HUB> at usbus2
uhub1 on usbus2
uhub1: <Generic EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
ugen1.1: <DWCOTG OTG Root HUB> at usbus1
uhub2 on usbus1
uhub2: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
mmcsd0: 16GB <SDHC SA16G 3.1 SN 2990F16F MFG 07/2019 by 2 TM> at mmc0 50.0MHz/4bit/1016-block
mmc1: No compatible cards found on bus
Cannot set frequency for clk: clk_sdio, error: 34
rockchip_dwmmc2: failed to set frequency to 400000 Hz: 34
mmc2: No compatible cards found on bus
CPU  0: ARM Cortex-A35 r0p2 affinity:  0
                   Cache Type = <64 byte D-cacheline,64 byte I-cacheline,VIPT ICache,64 byte ERG,64 byte CWG>
 Instruction Set Attributes 0 = <CRC32,SHA2,SHA1,AES+PMULL>
 Instruction Set Attributes 1 = <>
 Instruction Set Attributes 2 = <>
         Processor Features 0 = <AdvSIMD,FP,EL3 32,EL2 32,EL1 32,EL0 32>
         Processor Features 1 = <>
      Memory Model Features 0 = <TGran4,TGran64,TGran16,SNSMem,BigEnd,16bit ASID,1TB PA>
      Memory Model Features 1 = <8bit VMID>
      Memory Model Features 2 = <32bit CCIDX,48bit VA>
             Debug Features 0 = <DoubleLock,2 CTX BKPTs,4 Watchpoints,6 Breakpoints,PMUv3,Debugv8>
             Debug Features 1 = <>
         Auxiliary Features 0 = <>
         Auxiliary Features 1 = <>
AArch32 Instruction Set Attributes 5 = <CRC32,SHA2,SHA1,AES+VMULL,SEVL>
AArch32 Media and VFP Features 0 = <FPRound,FPSqrt,FPDivide,DP VFPv3+v4,SP VFPv3+v4,AdvSIMD>
AArch32 Media and VFP Features 1 = <SIMDFMAC,FPHP DP Conv,SIMDHP SP Conv,SIMDSP,SIMDInt,SIMDLS,FPDNaN,FPFtZ>
CPU  1: ARM Cortex-A35 r0p2 affinity:  1
CPU  2: ARM Cortex-A35 r0p2 affinity:  2
CPU  3: ARM Cortex-A35 r0p2 affinity:  3
Release APs...done
Unresolved linked clock found: clk_rtc_32k
Unresolved linked clock found: clk_ddrphy1x_out
Trying to mount root from ufs:/dev/ufs/FreeBSD_Install [ro,noatime]...
Unresolved linked clock found: clk_pvtm_32k
Unresolved linked clock found: xin32k
Unresolved linked clock found: mclk_i2s0_8ch_in
Unresolved linked clock found: mclk_i2s1_8ch_in
Unresolved linked clock found: mclk_i2s2_8ch_in
Unresolved linked clock found: mclk_i2s3_8ch_in
Unresolved linked clock found: mclk_i2s0_2ch_in
Unresolved linked clock found: mclk_i2s1_2ch_in
Unresolved linked clock found: dummy
Warning: no time-of-day clock registered, system time will not be set accurately
uhub0: 1 port with 1 removable, self powered
uhub2: 1 port with 1 removable, self powered
Starting file system checks:
uhub1: 1 port with 1 removable, self powered
/dev/ufs/FreeBSD_Install: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ufs/FreeBSD_Install: clean, 8236 free (44 frags, 1024 blocks, 0.1% fragmentation)
Mounting local filesystems:.
random: randomdev_wait_until_seeded unblock wait
random: unblocking device.
mkdir: /tmp/.diskless.1e7b86d94e21d6d9be4be127fde33db397c412e53d2d1135568a39c170b4ed67: Read-only file system
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Building /boot/kernel/linker.hints
kldxref: can't create /boot/lhint.hqhibe: Read-only file system
/etc/rc: WARNING: $hostname is not set -- see rc.conf(5).
Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: dd: /entropy: Read-only file system
dd: /boot/entropy: Read-only file system
.
devmatch: Can't read linker hints file.
lo0: link state changed to UP
Starting Network: lo0 dwc0.
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 0x2
    inet 127.0.0.1 netmask 0xff000000
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
dwc0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
    ether 62:73:64:68:8c:4f
    media: Ethernet autoselect (none)
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
devmatch: Can't read linker hints file.
Starting Network: dwc0.
dwc0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
    ether 62:73:64:68:8c:4f
    media: Ethernet autoselect (none)
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
devmatch: Can't read linker hints file.
devmatch: Can't read linker hints file.
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Creating and/or trimming log files.
Updating /var/run/os-release done.
Updating motd:.
Clearing /tmp (X related).
Starting syslogd.
Starting local daemons:
Welcome to FreeBSD!

Please choose the appropriate terminal type for your system.
Common console types are:
   ansi     Standard ANSI terminal
   vt100    VT100 or compatible terminal
   xterm    xterm terminal emulator (or compatible)
   cons25w  cons25w terminal

Console type [vt100]:
 
created a rockpi-s image out of FreeBSD-13.2-RELEASE-arm64-aarch64-ROCK64.img
seems ok
would be nice to have pwm-regulator driver
 
No MMC on your Rock Pi-S ??
They are dirt cheap but I can't find the MMC version on ebay

That would be ideal for me.

512MB without BT/ WIFI with 4GB NAND
Sure like the sound of POE too.
 
dtb has a 32khz rtc external clock but im not sure if it works or not

anyway it is probably the cheapest 64 bit arm board
performance is not great about the same as the nanopi neo (h3)
rk3308 is cortex a35 which i understand is a kind of low power a53
 
added
rk_tsadc0: <RockChip temperature sensors> mem 0xff1f0000-0xff1f00ff irq 24 on ofwbus0
[user@rockpis ~]$ sysctl hw.temperature
hw.temperature.CPU: 45.0C
 
hacked support for pwm-regulator
now i have frequency control
Code:
[root@rockpis ~]# sysctl  dev.cpu.0.freq=408
dev.cpu.0.freq: 1008 -> 408
[root@rockpis ~]# openssl speed md5
Doing md5 for 3s on 16 size blocks: 1154557 md5's in 3.00s
Doing md5 for 3s on 64 size blocks: ^C
[root@rockpis ~]# sysctl  dev.cpu.0.freq=1008
dev.cpu.0.freq: 408 -> 1008
[root@rockpis ~]# openssl speed md5
Doing md5 for 3s on 16 size blocks: 2893221 md5's in 3.00s
 
probing/attaching drivers in a specific order is painful
i need clock => pwm => regulator for the cpufreq_dt to work
 
Back
Top