android tv/multimedia boxes

did anybody try to install freebsd on such a thing ?
they have various arm socks from amlogic/allwinner/rockchip
1-2-4 ram,mmc , sd card , usb ,ethernet and wifi
most if not all have various mali gpus
 
I'm also interested, tried to run some kind of android box with android 2.X or something very old. Now it's really outdated. Even browser don't want to start. The only way is to through this box to the garbage.
 
The major problem here is the bootloader, an android-oriented bootloader isn't even capable of running vanilla linux kernel (unless it gets some sort of contraption). Check if the device is able to run vanilla linux such as postmarketOS and such (I mean pure linux, not some sort of chroot or libhybris), so we'll know the bootloader is capable of loading something else than android.
 
many can run armbian with various degree of support in the mainline kernel and can boot from sdcard / usb / mmc
they are not officially supported but various "community supported" images exist (all linux)
most have uart pins exposed on the pcb so serial console should work
i have my expectations pretty low: serial console access
if any other devices work it's a bonus
 
many can run armbian with various degree of support in the mainline kernel and can boot from sdcard / usb / mmc
That's a contraption, it reboots the device and reload a different kernel in-place, some smartphones can do that, but this doesn't have an use for FreeBSD since it's a feature of linux, so you're only able to run another linux kernel.
most have uart pins exposed on the pcb so serial console should work
That's a good start. Even better if the device supports something like u-boot so you can dump logs and such. It'll be helpful if you're able to report upstream.
 
they use u-boot , dtbs so i can't see why a bsd kernel can't be booted. same SOC's are used in different development boards
 
they use u-boot , dtbs so i can't see why a bsd kernel can't be booted. same SOC's are used in different development boards
Because most android bootloaders have a specific way of loading the kernel (parameters, kernel specifications, etc. some android bootloaders even have a specific kernel version inside the bootloader), even so, most android bootloaders can't boot a vanilla linux kernel for the same reason, you can't just boot a kernel like rEFInd or grub do.
 
this is as vanilla as it gets
an arm development board / sbc is not much different
 
did anybody try to install freebsd on such a thing ?
they have various arm socks from amlogic/allwinner/rockchip
1-2-4 ram,mmc , sd card , usb ,ethernet and wifi
most if not all have various mali gpus
What is you real question?
E.g., RockPro64 is considered by many to a be multimedia box.
People certainly run FreeBSD on it.
 
I am working on a Aopen ChromeBox Commercial. To defang it for FreeBSD is a real pain.
The raw hardware is amd64 but encumbered. There is a tiny screw onboard you must remove to get to debug mode.
 
ok i bought one of these https://www.aliexpress.com/item/32997899537.html
the good part:
it boots other oses directly from the sd card without any custom firmware, or special 'reset' procedure
same boot image style like pine-h64
most of the hardware works (in linux)
the bad part:
u-boot video console does not work
internal storage is not mmc is some 'raw' nand shit and does not work
will buy an usb to uart cable and try freebsd and netbsd
 
Does the nand show on Linux?
I need to build special uboot and dtb for emmc on imx6.

Prolific is what I use these days. Last batch I got long cords.
Code:
ugen1.3: <Prolific Technology Inc. USB-Serial Controller> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
Too many fake FTDI these days. Avoid.
 
Does the nand show on Linux?
no, and it's not present in the DTB i use know.
but i extracted the dtb from the android firmware image and it's described there
there is some nand support in linux kernel but i'm not sure it will work even if i patch the dtb
until i get the serial cable i can't experiment because u-boot has no hdmi output on this board
 
disclaimer -- using such a device in this way will most likely void your warranty

ok, so i've got and android tv box based on allwinner h616 (https://www.geekbuying.com/item/H96-MAX-H616-Allwinner-H616-4GB-32GB-TV-Box-403753.html)
i hooked the serial uart like here
1687805396604.png

i started to hack support for it and i have clocks, gpio, usb, sd and e-mmc kind of working
i will try to add pmic axp805 and maybe ethernet support in the next days

there are 2 problems so far
1) you don't get an exact dtb for this kind of board so you need to merge various things you find on the net
the extracted android dtb does not use linux std notation and is hard to use directly
2) serial console has a mega annoying bug, it does not echo the last character typed it somehow buffers it
so to type ls<enter> you need to type ls<enter><space> for something to happen (then your next like will begin with a <space> or whatever you can't see :\
the bug is not present in u-boot / loader so its probably something in the driver
also my connection is super flimsy shitty, no soldered pins just friction
 
1) you don't get an exact dtb for this kind of board so you need to merge various things you find on the net
the extracted android dtb does not use linux std notation and is hard to use directly
I was looking at cheap used ELO ESY15i1 touch screen with RK3399 as seen in Target retail store barcode reader kiosks.
Same deal. No dts anywhere and only Android supported. Android dtb don't have same structure.

For Example. Toast POS touchscreen:

There are also ESY15i1 units with unsupported cpu. Snapdragon something.
 
Code:
---<<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  = 4294705152 (4095 MB)
avail memory = 4165349376 (3972 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 faefb000 mode 2 pages 2
MAP faefe000 mode 2 pages 2
MAP faf01000 mode 2 pages 4
MAP fff50000 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
regfix0: <Fixed Regulator> on ofwbus0
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
rtc0: <Allwinner RTC> mem 0x7000000-0x70003ff irq 44 on simplebus0
rtc0: registered as a time-of-day clock, resolution 1.000000s
ccu_h616ng0: <Allwinner H616 Clock Control Unit NG> mem 0x3001000-0x3001fff on simplebus0
ccu_sun50i_h616_r0: <Allwinner SUN50I_H616_R Clock Control Unit NG> mem 0x7010000-0x701020f on simplebus0
gic0: <ARM Generic Interrupt Controller> mem 0x3021000-0x3021fff,0x3022000-0x3023fff,0x3024000-0x3025fff,0x3026000-0x3027fff irq 17 on simplebus0
gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 192
gpio0: <Allwinner GPIO/Pinmux controller> mem 0x300b000-0x300b3ff irq 9,10,11,12,13,14,15,16 on simplebus0
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <Allwinner GPIO/Pinmux controller> mem 0x7022000-0x70223ff irq 45 on simplebus0
gpiobus1: <OFW GPIO bus> on gpio1
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-0x5101813,0x5200800-0x5200813,0x5310800-0x5310813,0x5311800-0x5311813 on simplebus0
iichb0: <Allwinner RSB> mem 0x7083000-0x70833ff irq 48 on simplebus0
iicbus0: <OFW I2C bus> on iichb0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
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
aw_wdog0: <Allwinner A31 Watchdog> mem 0x30090a0-0x30090bf irq 8 on simplebus0
gpioc0: <GPIO controller> on gpio0
aw_mmc0: <Allwinner Integrated MMC/SD controller> mem 0x4020000-0x4020fff irq 18 on simplebus0
aw_mmc1: <Allwinner Integrated MMC/SD controller> mem 0x4022000-0x4022fff irq 20 on simplebus0
��]X.��r���standard ns8250 class UART with FIFOs> mem 0x5000000-0x50003ff irq 21 on simplebus0
uart0: console (-1,n,8,1)
musbotg0: <Allwinner USB DRD> mem 0x5100000-0x51003ff irq 35 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 36 on simplebus0
usbus1: EHCI version 1.0
usbus1 on ehci0
ohci0: <Generic OHCI Controller> mem 0x5101400-0x51014ff irq 37 on simplebus0
usbus2 on ohci0
ehci1: <Generic EHCI Controller> mem 0x5310000-0x53100ff irq 40 on simplebus0
usbus3: EHCI version 1.0
usbus3 on ehci1
ohci1: <Generic OHCI Controller> mem 0x5310400-0x53104ff irq 41 on simplebus0
usbus4 on ohci1
gpioc1: <GPIO controller> on gpio1
aw_ir0: <Allwinner CIR controller> mem 0x7040000-0x70403ff irq 46 on simplebus0
iicbus0: <unknown card> at addr 0xe8a
iic0: <I2C generic I/O> on iicbus0
armv8crypto0: <AES-CBC,AES-XTS,AES-GCM>
Timecounters tick every 1.000 msec
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...usbus0: 480Mbps High Speed USB v2.0
done
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
Trying to mount root from ufs:/dev/mmcsd1s2a []...
ugen1.1: <Generic EHCI root HUB> at usbus1
ugen3.1: <Generic EHCI root HUB> at usbus3
uhub0ugen0.1: <Mentor Graphics OTG Root HUB> at usbus0
ugen2.1: <Generic OHCI root HUB> at usbus2
 on usbus1
uhub1 on usbus3
uhub2 on usbus0
uhub1: <Generic EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3
uhub0: <Generic EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
uhub2: <Mentor Graphics OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
uhub3 on usbus2
uhub3: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
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
uhub3: 1 port with 1 removable, self powered
uhub4: 1 port with 1 removable, self powered
uhub2: 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: 31GB <MMCHC 032G96 1.1 SN 11D64F30 MFG 10/2013 by 17 0x0000> at mmc0 52.0MHz/8bit/4096-block
mmcsd0boot0: 4MB partition 1 at mmcsd0
mmcsd0boot1: 4MB partition 2 at mmcsd0
mmcsd0rpmb: 524kB partition 3 at mmcsd0
mmc1: <MMC/SD bus> on aw_mmc0
mmcsd1: 16GB <SDHC 00000 0.0 SN 00017677 MFG 12/2019 by 159 TI> at mmc1 25.0MHz/4bit/32768-block
uhub1: 1 port with 1 removable, self powered
uhub0: 1 port with 1 removable, self powered
mmc1: Failed to set VCCQ for card at relative address 1
Warning: bad time from time-of-day clock, system time will not be set accurately
Dual Console: Serial Primary, Video Secondary
No suitable dump device was found.
Setting hostuuid: d764368e-a9b6-4215-a6ea-9f1c090dcf1c.
Setting hostid: 0x3bd62961.
Starting file system checks:
/dev/mmcsd1s2a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/mmcsd1s2a: clean, 2847093 free (1765 frags, 355666 blocks, 0.0% fragmentation)
Mounting local filesystems:.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg
Setting hostname: sunxi-50i-h616.eatlas.local.
Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: rm: /entropy: Read-only file system
dd: /entropy: Read-only file system
dd: /boot/entropy: Read-only file system
.
ifconfig_b: lo0: ifconfig_media_get_mediareq: Invalid argument
ifconfig_b: lo0: ifconfig_media_get_mediareq: Invalid argument
lo0: link state changed to UP
Starting Network: lo0.
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 0x1
    inet 127.0.0.1 netmask 0xff000000
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
Starting devd.
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
Updating /var/run/os-release done.
Updating motd:.
Clearing /tmp (X related).
Creating and/or trimming log files.
Starting syslogd.
Setting date via ntp.
27 Jun 09:56:02 ntpdate[590]: no servers can be used, exiting
Mounting late filesystems:.
Performing sanity check on sshd configuration.
Starting sshd.
Starting cron.
Starting background file system checks in 60 seconds.

Tue Jun 27 09:56
FreeBSD/arm64 (sunxi-50i-h616.eatlas.local) (ttyu0)

login:
 
really need to do the power regulator so i can change cpu freq / run emmc in high speed and other shit
also hack aw_thermal (unfortunately there is no profile implemented for H616 in "the other os" so i have to dig thru the manual
 
Code:
axp806_pmu0: <X-Powers AXP806 Power Management Unit> at addr 0x6c on iicbus0
--------------------------------------
cpufreq_dt0: <Generic cpufreq driver> on cpu0
have pmic and cpufreq
 
Whats the deal with power regulators? They are controlled by software?
So you create the regulator node with DTS and have to hack a regulator driver together?

I have a buck regulator on my Tinkerboard2 that is not supported well.
Back of shelf for that.

What does code look like to get a regulator working? I2C driver that you create?
 
the pmic axpXXX are IC with several DCDC and LDO regulators inside
some of them have battery charging circuits, and also various monitoring capabilities, alarm and shut down interrupts
this one has only regulators

some fixed, some programmable model depended
there are some external PWM controlled, or fixed regulators
the fixed one cant be controlled by software, nor the voltage can be measured by software, they are just reported as such
besides the one that controls the cpu core voltage i did not see the need to change the voltage for anything else
anyway the default values are just good so your device will function without programming anything
the problem is that if a device in the DTB references a power source and that power source does not have a driver loaded the
power consumer device driver won't probe or have other problems
for example my emmc won't work in high speed mode because it needs vqmmc of 1.8V provided by the regulator that does not have a driver so it fails
ive seen that linux uses "dummy regulators" in some of such cases so the device works even if its dtb described power source is unavailable
 
the os has a "regulator framework" so you create nodes and register them with the framework
the framework has abstract functions for read/set voltage, start / stop regulator which the driver has to implement
the logic of converting voltage to ic register numbers, communication with the ic is the specific driver job and the framework does not know about it
 
ok, the thermal sensors work weird (maybe thats way the linux image i tried bombed)
they work backwards from what the doc says (register values should decrease with temp, they increase)
also the scale of register/degree C is wrong
ethernet is hard to fix, need to implement pwm, pwm-clock and some more things for something that exists only in h6/h616 android boxes and mangopi
 
Back
Top