Orange PI3 lts and FreeBSD

Hello.
I wonder if there is some that tested FreeBSD on OrangePI 3 LTS.
So, I do like to know, which version of FreeBSD (aarch64) that can be compatible with it (a tutorial on how to install & run FreeBSD is welcome).
Here are a technical characteristics
CPU• Allwinner H6
• Quad-core 64-bit 1.8GHz high-performance Cortex-A53 processor
GPU• High-performance multi-core GPU Mali T720
• OpenGL ES3.1/3.0/2.0/1.1
• Microsoft DirectX 11 FL9_3
• ASTC(Adaptive Scalable Texture Compression)
• Floating point operation greater than 70 GFLOPS
Power management chip• AXP805
RAM• 2GB LPDDR3 (shared with GPU)
Onboard Storage• Micro SD card slot
• 8GB EMMC Flash
Onboard Network• YT8531C Chip
• Support 10/100M/1000M Ethernet
Onboard WiFi+Bluetooth• 859 Chip
• Support IEEE 802.11 a/b/g/n/ac
• Support BT5.0
Video Output• HDMI 2.0a
• TV CVBS Output
Audio output• HDMI Output
• 3.5mm Audio Port
Power Source5V3A Type-C
USB• 1* USB 3.0 HOST、2* USB 2.0 HOST
Low-level peripherals• 26pin connector with1* I2C, 1*SPI, 1*UART &Multiple GPIO Ports
Debug serial port• UART-TX、UART-RX & GND
IR Receiver• Support IR Remote Control

Thank you for help.
 
Well according to arch(7) aarch64 is supported since FreeBSD 11. FreeBSD/ARM Project web says that SoC Allwinner is supported so without having further information and lack of actual HW I'd say it's supported. Cortex-A53 is type arm8 architecture.
 
I would start with the generic installer - aarch64/bootonly to see what it does. If it works install it from scratch.

If you think that copying raw image is better you could try this image and copy it 1:1 to the card (dd if=/path/to/img of=/dev/daX bs=64k where daX is the card connected to your FreeBSD you're copying the image to).
*side note: the size of the raw image (unpacked) should be divisible by the bs parameter I specified to avoid issues. If it's not lower the size (4k, or don't use any parameter if in doubt).
 
Feedback.
Hello, I have a Freebsd amd x64 installed in VM, downloaded "FreeBSD-13.2-RELEASE-arm64-aarch64-ROCK64.img.xz" inside VM and decompressed it.
I did
dd if=FreeBSD-13.2-RELEASE-arm64-aarch64-ROCK64.img of=/dev/da0 bs=1M conv=notrunc
and did
dd if=/usr/local/share/u-boot/u-boot-orangepi-pc/u-boot-sunxi-with-spl.bin of=/dev/da0 bs=1k seek=8 conv=sync
My SDcard is detected as da0.

the process of dd is done well.
I mounted the partition /dev/da0p2 in a folder and modified
/etc/rc.conf
/boot/loader.conf "to load driver : wlan_amrr="YES""
/etc/wpa_supplicant.conf to give the right ssid and password.

unmount after and put on OrangePI 3 lts.

It do not work.
So if you have any idea, help needed.

I even repeated process for
dd if=/usr/local/share/u-boot/u-boot-orangepi-pc2/u-boot-sunxi-with-spl.bin of=/dev/da0 bs=1k seek=8 conv=sync

Thanks you.
 
You are using the wrong u-boot.
/usr/local/share/u-boot/u-boot-orangepi-pc2/

/usr/local/share/u-boot/u-boot-orangepi-pc2/ is not correct.
Should be:
/usr/local/share/u-boot/u-boot-pine-h64/

pkg install u-boot-pine-h64
cat /usr/local/share/u-boot/u-boot-pine-h64/README

The u-boot you attempted to use is for H5 processors.

You have H6 and need pine-h64 uboot.
 
/boot/loader.conf "to load driver : wlan_amrr="YES""
All this wireless config is confusing me. Are you trying to use the built in Wifi?
You see we have no support for most Arm board wifi. They use an SDIO interface.
You can use an USB wifi interface.
Regardless get it booting first then worry about interfaces.

Also I would not automatically expect the HDMI output to work.
You might need to use a serial console to get it going.
 
Hi,
Second feedback.
So, doing as Phishfry says.
dd if=FreeBSD-13.2-RELEASE-arm64-aarch64-ROCK64.img of=/dev/da0 bs=1M conv=notrunc #( the image to SD card.)
dd if=/usr/local/share/u-boot/u-boot-pine-h64/u-boot-sunxi-with-spl.bin of=/dev/da0 bs=1k seek=8 conv=sync #( the u-boot for h6)
the process of dd is done well.
I mounted the partition /dev/da0p2 in a folder and modified

/etc/rc.conf
/boot/loader.conf "to load driver : wlan_amrr="YES""
/etc/wpa_supplicant.conf to give the right ssid and password.
Activate all what needs to be activated.
PS:
Form this modification of the image FreeBSD-13.2-RELEASE-arm64-aarch64-ROCK64.img was done using QEMU before burning into the SD Card.
( This is what I did for the Raspberry image which works well ).

Put SDCard in OrangePI3Lts, my wifi key into the USB 2 port of the orange pi.

Then trying to boot.
Result: Nothing happend ( I think )
I use the same procedure for the Raspberrypi 3B+ and it boots , gets Wifi Ip adress, which permit me ti SSH it.

Anyone have an idea ??
 
Hi,

Block size and seek options for the bootloader installation are wrong. This should be :

Code:
dd if=/usr/local/share/u-boot/u-boot-pine64/u-boot-sunxi-with-spl.bin of=/path/to/sdcarddevice bs=128k seek=1 conv=sync

Code:
bs=128k seek=1
Regards
 
Indeed it is what I done, just copied what is in quote above

dd if=/usr/local/share/u-boot/u-boot-pine64/u-boot-sunxi-with-spl.bin of=/path/to/sdcarddevice bs=128k seek=1 conv=sync
 

Attachments

  • Sans titre 1.jpg
    Sans titre 1.jpg
    10 KB · Views: 83
/path/to/sdcarddevice bs=128k seek=1 conv=sync
You need to adjust this path.
dd if=/usr/local/share/u-boot/u-boot-pine-h64/u-boot-sunxi-with-spl.bin of=/dev/da0 bs=128k seek=1 conv=sync

SSH'ing in on a new platform could be rough going....

I like to tear a problem down into its simplest terms.
 
Well this the point where I would be hooking up a serial console and seeing if u-boot is loading or if the OS is giving you troubles.
Depending on SSH here is not very useful for debugging a new Arm installation.

dd wipe the card then burn an aarch64 image to it. Then flash with u-boot.
The wiki has the correct steps I would use.
I would say try the aarch64 GenericSD image but if you are doing this over SSH you might as well give up.
Pi is one thing. 4 boards to support.
Generic arm64 board is another. Use the proper tool for the job. A USB Serial TTL cable.
I know that SSH should work but you are dealing with a very peculiar device.
 
1st Feedback.
Hello,
Finally, I've got the USB TTL ( USB TTL ).
While booting the OrangePI3 LTS, I found that it boots with the preinstalled OS in the MMC ( Linux ).
I'll try to boot with the Image that you advised me
FreeBSD-13.2-RELEASE-arm64-aarch64-ROCK64.img
# with u-boot from
/usr/local/share/u-boot/u-boot-pine-h64/u-boot-sunxi-with-spl.bin

And I'll informe you.
 
Hello.
Finally I'm enable to boot FreeBSD OS into OrangePI3lts
Here is the dmsg


root@uc-opi:~ # dmesg
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 = 2147483648 (2048 MB)
avail memory = 2071592960 (1975 MB)
Starting CPU 1 (1)
Starting CPU 2 (2)
Starting CPU 3 (3)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
random: unblocking device.
random: entropy device external interface
MAP baee5000 mode 2 pages 1
MAP baee9000 mode 2 pages 1
MAP baeeb000 mode 2 pages 2
MAP baeee000 mode 2 pages 4
MAP bff40000 mode 2 pages 16
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
clk_fixed0: <Fixed clock> on ofwbus0
simplebus0: <Flattened device tree simple bus> on ofwbus0
clk_fixed1: <Fixed clock> on ofwbus0
regfix0: <Fixed Regulator> on ofwbus0
regfix1: <Fixed Regulator> on ofwbus0
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
rtc0: <Allwinner RTC> mem 0x7000000-0x70003ff irq 44,45 on simplebus0
rtc0: registered as a time-of-day clock, resolution 1.000000s
ccu_h6ng0: <Allwinner H6 Clock Control Unit NG> mem 0x3001000-0x3001fff on simplebus0
ccu_sun50i_h6_r0: <Allwinner SUN50I_H6_R Clock Control Unit NG> mem 0x7010000-0x70103ff on simplebus0
gic0: <ARM Generic Interrupt Controller> mem 0x3021000-0x3021fff,0x3022000-0x3023fff,0x3024000-0x3025fff,0x3026000-0x3027fff irq 20 on simplebus0
gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 192
aw_r_intc_gicp0: <Allwinner R INTC> mem 0x7021000-0x70213ff irq 47 on simplebus0
gpio0: <Allwinner GPIO/Pinmux controller> mem 0x300b000-0x300b3ff irq 16,17,18,19 on simplebus0
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <Allwinner GPIO/Pinmux controller> mem 0x7022000-0x70223ff irq 48,49 on simplebus0
gpiobus1: <OFW GPIO bus> on gpio1
iichb0: <Allwinner Integrated I2C Bus Controller> mem 0x7081400-0x70817ff irq 51 on simplebus0
iicbus0: <OFW I2C bus> on iichb0
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
aw_syscon0: <Allwinner syscon> mem 0x3000000-0x3000fff on simplebus0
awusbphy0: <Allwinner USB PHY> mem 0x5100400-0x5100423,0x5101800-0x5101803,0x5311800-0x5311803 on simplebus0
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
gpioc0: <GPIO controller> on gpio0
aw_mmc0: <Allwinner Integrated MMC/SD controller> mem 0x4020000-0x4020fff irq 22 on simplebus0
aw_mmc1: <Allwinner Integrated MMC/SD controller> mem 0x4022000-0x4022fff irq 24 on simplebus0
uart0: <Non-standard ns8250 class UART with FIFOs> mem 0x5000000-0x50003ff irq 25 on simplebus0
uart0: console (-1,n,8,1)
awg0: <Allwinner Gigabit Ethernet> mem 0x5020000-0x502ffff irq 34 on simplebus0
miibus0: <MII bus> on awg0
ukphy0: <Generic IEEE 802.3u media interface> PHY 0 on miibus0
ukphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy1: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
awg0: Ethernet address: 02:07:85:06:6c:95
musbotg0: <Allwinner USB DRD> mem 0x5100000-0x51003ff irq 36 on simplebus0
musbotg0: setting phy mode 1
usbus0: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM
usbus0 on musbotg0
ehci0: <Generic EHCI Controller> mem 0x5101000-0x51010ff irq 37 on simplebus0
usbus1: EHCI version 1.0
usbus1 on ehci0
ohci0: <Generic OHCI Controller> mem 0x5101400-0x51014ff irq 38 on simplebus0
usbus2 on ohci0
ehci1: <Generic EHCI Controller> mem 0x5311000-0x53110ff irq 40 on simplebus0
usbus3: EHCI version 1.0
usbus3 on ehci1
ohci1: <Generic OHCI Controller> mem 0x5311400-0x53114ff irq 41 on simplebus0
usbus4 on ohci1
aw_wdog0: <Allwinner A31 Watchdog> mem 0x7020400-0x702041f irq 46 on simplebus0
gpioc1: <GPIO controller> on gpio1
aw_ir0: <Allwinner CIR controller> mem 0x7040000-0x70403ff irq 50 on simplebus0
aw_ir0: Cannot get IR clock
device_attach: aw_ir0 attach returned 6
iicbus0: <unknown card> at addr 0x6c
nxprtc0: <NXP PCF8563 RTC> at addr 0xa2 irq 54 on iicbus0
iic0: <I2C generic I/O> on iicbus0
gpioled0: <GPIO LEDs> on ofwbus0
armv8crypto0: <AES-CBC,AES-XTS,AES-GCM>
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
usbus1: 480Mbps High Speed USB v2.0
usbus2: 12Mbps Full Speed USB v1.0
usbus3: 480Mbps High Speed USB v2.0
usbus4: 12Mbps Full Speed USB v1.0
ugen0.1: <Mentor Graphics OTG Root HUB> at usbus0
uhub0 on usbus0
uhub0: <Mentor Graphics OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
ugen2.1: <Generic OHCI root HUB> at usbus2
uhub1 on usbus2
uhub1: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
ugen1.1: <Generic EHCI root HUB> at usbus1
uhub2 on usbus1
uhub2: <Generic EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
ugen3.1: <Generic EHCI root HUB> at usbus3
uhub3 on usbus3
uhub3: <Generic EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3
ugen4.1: <Generic OHCI root HUB> at usbus4
uhub4 on usbus4
uhub4: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus4
nxprtc0: cannot read RTC control regs
CPU 0: ARM Cortex-A53 r0p4 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,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-A53 r0p4 affinity: 1
CPU 2: ARM Cortex-A53 r0p4 affinity: 2
CPU 3: ARM Cortex-A53 r0p4 affinity: 3
Release APs...Trying to mount root from ufs:/dev/ufs/rootfs [rw]...
done
uhub1: 1 port with 1 removable, self powered
uhub4: 1 port with 1 removable, self powered
uhub0: 1 port with 1 removable, self powered
mmc0: <MMC/SD bus> on aw_mmc1
mmc0: Failed to set VCCQ for card at relative address 2
mmcsd0: 8GB <MMCHC 8GTF4R 0.6 SN 53F1CE0A MFG 09/2022 by 21 0x0000> at mmc0 52.0MHz/8bit/4096-block
GEOM: mmcsd0: the secondary GPT table is corrupt or invalid.
mmcsd0boot0: 4MB partition 1 at mmcsd0
GEOM: mmcsd0: using the primary only -- recovery suggested.
mmcsd0boot1: 4MB partition 2 at mmcsd0
mmcsd0rpmb: 524kB partition 3 at mmcsd0
mmc1: <MMC/SD bus> on aw_mmc0
uhub2: 1 port with 1 removable, self powered
uhub3: 1 port with 1 removable, self powered
mmcsd1: 32GB <SDHC 00000 0.0 SN 0000081F MFG 10/2022 by 159 TI> at mmc1 50.0MHz/4bit/32768-block
GEOM: diskid/DISK-53F1CE0A: the secondary GPT table is corrupt or invalid.
GEOM: diskid/DISK-53F1CE0A: using the primary only -- recovery suggested.
mmc1: Failed to set VCCQ for card at relative address 1
Dual Console: Serial Primary, Video Secondary
lo0: link state changed to UP
awg0: link state changed to DOWN


Stay some questions :
1. GEOM: diskid/DISK-53F1CE0A: the secondary GPT table is corrupt or invalid.
GEOM: diskid/DISK-53F1CE0A: using the primary only -- recovery suggested.
? What it means ?
2. How can I Copy my FreeBSD OS into the internal mmcsd0 in order to not use SDCArd.

Thanks you.

PS: I used :

FreeBSD-13.2-RELEASE-arm64-aarch64-ROCK64.img
# with u-boot from
/usr/local/share/u-boot/u-boot-pine-h64/u-boot-sunxi-with-spl.bin
 
While trying to destroy geom on mmcsd0 it gives errors

root@uc-opi:~ # ls /dev/mmc*
/dev/mmcsd0 /dev/mmcsd0p12 /dev/mmcsd0p3 /dev/mmcsd0p9
/dev/mmcsd0boot0 /dev/mmcsd0p13 /dev/mmcsd0p4 /dev/mmcsd0rpmb
/dev/mmcsd0boot1 /dev/mmcsd0p14 /dev/mmcsd0p5 /dev/mmcsd1
/dev/mmcsd0p1 /dev/mmcsd0p15 /dev/mmcsd0p6 /dev/mmcsd1p1
/dev/mmcsd0p10 /dev/mmcsd0p16 /dev/mmcsd0p7 /dev/mmcsd1p2
/dev/mmcsd0p11 /dev/mmcsd0p2 /dev/mmcsd0p8
root@uc-opi:~ # gpart delete -i 0 /dev/mmcsd
gpart: arg0 'mmcsd': Invalid argument
root@uc-opi:~ # gpart delete -i 0 /dev/mmcsd0
gpart: table 'mmcsd0' is corrupt: Operation not permitted
root@uc-opi:~ # gpart delete -i 0 /dev/mmcsd0


 
Done thanks,
I will try to do [dd] FreeBSD Image from external USB stick to internal MMC & install u-boot loader as I did for SDCard & tell you.
 
My method is use the aarch64 installer memstick and microSD card with u-boot flashed.
That way my installer memstick doesn't need a particular u-boot on it. Most boards need microSD u-boot anyway.
(On buildbox must expand memstick to full size of usb stick with gpart resize and copy flashing image over to it)
I use Live mode of the memstick installer and dd flash the image over to eMMC.
 
My method is use the aarch64 installer memstick and microSD card with u-boot flashed.
That way my installer memstick doesn't need a particular u-boot on it. Most boards need microSD u-boot anyway.
(On buildbox must expand memstick to full size of usb stick with gpart resize and copy flashing image over to it)
I use Live mode of the memstick installer and dd flash the image over to eMMC.
If I understand your methode, I shall do :
  1. Burn Installer image ((FreeBSD) .img) on SDCard & install u-boot loader ( in SDCard )
  2. Boot from SDCard & proceed installation on internal eMMC.
  3. Install U-Boot into the internal eMMC.
  4. Reboot (without SDCard ??).
Do I understand your answer ?
 
Yes that method should work fine.
My way is different but both work.
Make sure your aarch64 installer stick has serial console enabled in loader.conf.
Same with your FreeBSD install. Make sure you enable serial console.
 
Hello.
I have succeffully installed FreeBSD on OrangePI3 lts in eMMC card ( Now it work without needing External SDCard).
PS: I have eliminated all loggins ( httpd, syslogd, dmesg .... ). Just a nginx/php + OpenVPN runing.

Thank you
 
Back
Top