Hummingboard 2 Edge

I compiled u-boot for cubox-hummingboard from ports and added support for SATA in config.
Finally just flashed the firmware to sd card and it gets along well. It is trying to pxeboot.
This is encouraging. I need to throw the jumpers for mSATA to see if it will boot that.

Code:
U-Boot SPL 2021.07 (Dec 29 2021 - 03:40:30 -0500)
WDT:   Not found!
Trying to boot from MMC1


U-Boot 2021.07 (Dec 29 2021 - 03:40:30 -0500)

CPU:   Freescale i.MX6Q rev1.3 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 28C
Reset cause: POR
Board: MX6 HummingBoard2
DRAM:  2 GiB
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   
Warning: ethernet@2188000 (eth0) using random MAC address - fa:dc:39:e1:59:d0
eth0: ethernet@2188000
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk usdhc@2194000.blk...
** Unrecognized filesystem type **
Scanning disk usdhc@2198000.blk...
** Unrecognized filesystem type **
Found 4 disks
No EFI system partition
No panel detected: default to HDMI
Display: HDMI (1024x768)
ERROR: invalid device tree
switch to partitions #0, OK
mmc2(part 0) is current device
** No partition table - mmc 2 **
Couldn't find partition mmc 2:1
AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part
SATA Device Info:
S/N: G884850166
Product model number: TS512GMTS430S
Firmware version: R0427GN1
Capacity: 1000215216 sectors

Device 0: Model: TS512GMTS430S Firm: R0427GN1 Ser#: G884850166
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 488386.3 MB = 476.9 GB (1000215216 x 512)
... is now current device
** No partition table - sata 0 **
Couldn't find partition sata 0:1
starting USB...
Bus usb@2184000: usb dr_mode not found
USB EHCI 1.00
Bus usb@2184200: USB EHCI 1.00
scanning bus usb@2184000 for devices... 1 USB Device(s) found
scanning bus usb@2184200 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
DHCP client bound to address 192.168.1.121 (6966 ms)
*** Warning: no boot file name; using 'C0A80179.img'
Using ethernet@2188000 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.121
Filename 'C0A80179.img'.
Load address: 0x12000000
Loading: T T T T T T T T T T
Retry count exceeded; starting again
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C0A80179
Using ethernet@2188000 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.121
Filename 'pxelinux.cfg/C0A80179'.
Load address: 0x12000000
Loading: T T T T T T T T T T
Retry count exceeded; starting again
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C0A8017
Using ethernet@2188000 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.121
Filename 'pxelinux.cfg/C0A8017'.
Load address: 0x12000000
Loading: T T
 
I must start it at a special spot to not overwrite u.boot.imx right?
OK I have mastered this process.

So all the Generic images I tried and fail did so because I did not flash the uboot.imx uboot to disk.
That is what is needed. iMX6 requires u-boot raw mode. Wrote to first 1K of disk.
dd if=u-boot.imx of=/dev/da0 bs=1k oseek=1 conv=sync
Write the FreeBSD Generic Arm image to a SD disk then flash the uboot-imx to SDCard.
Even though it overwrites the first 1K this does not affect the MBR scheme it seems.

Could I use a freebsd-boot partition type instead and flash to that?
 
OK I have mastered this process.

So all the Generic images I tried and fail did so because I did not flash the uboot.imx uboot to disk.
That is what is needed. iMX6 requires u-boot raw mode. Wrote to first 1K of disk.
dd if=u-boot.imx of=/dev/da0 bs=1k oseek=1 conv=sync
Write the FreeBSD Generic Arm image to a SD disk then flash the uboot-imx to SDCard.
Even though it overwrites the first 1K this does not affect the MBR scheme it seems.

Could I use a freebsd-boot partition type instead and flash to that?
it skips the first kilo of the disk so it does not overwrite the boot record (oseek=1)
 
I have it booting off sd card with only ubldr.bin, /EFI/ and /dtb directories.
Kernel and rest on mSATA.

With the proper Hummingboard2 DTB from U-Boot I now have emmc working and I need to investigate.
Some special partitions already exist.
mmcsd1
mmcsd1boot0
mmcsd1boot1

Code:
mmcsd0: 4GB <SDHC SD04G 3.0 SN 6D542913 MFG 12/2013 by 39 PH> at mmc0 50.0MHz/4bit/65535-block
mmcsd1: 8GB <MMCHC 8GTF4R 0.6 SN 2950F48F MFG 01/2018 by 21 0x0000> at mmc1 50.0MHz/8bit/65535-block
mmcsd1boot0: 4MB partition 1 at mmcsd1
mmcsd1boot1: 4MB partition 2 at mmcsd1
mmcsd1rpmb: 524kB partition 3 at mmcsd1

The rpmb partition looks interesting:
 
With the DTB's now working well the boot messages have increased.
Code:
U-Boot SPL 2021.07 (Dec 29 2021 - 03:40:30 -0500)
WDT:   Not found!
Trying to boot from MMC1


U-Boot 2021.07 (Dec 29 2021 - 03:40:30 -0500)

CPU:   Freescale i.MX6Q rev1.3 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 47C
Reset cause: WDOG
Board: MX6 HummingBoard2
DRAM:  2 GiB
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   
Warning: ethernet@2188000 (eth0) using random MAC address - d2:a7:fd:f7:ea:d0
eth0: ethernet@2188000
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1 is current device
** Unrecognized filesystem type **
switch to partitions #0, OK
mmc2(part 0) is current device
** Invalid partition 1 **
Couldn't find partition mmc 2:1
AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part
SATA Device Info:
S/N: 153303400094
Product model number: SanDisk SSD U110 16GB
Firmware version: U21B001
Capacity: 31277232 sectors

Device 0: Model: SanDisk SSD U110 16GB Firm: U21B001 Ser#: 153303400094
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 15272.0 MB = 14.9 GB (31277232 x 512)
... is now current device
Scanning sata 0:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk usdhc@2194000.blk...
** Unrecognized filesystem type **
Scanning disk usdhc@2198000.blk...
Scanning disk sata@2200000.blk...
** Unrecognized filesystem type **
Found 6 disks
No EFI system partition
No panel detected: default to HDMI
Display: HDMI (1024x768)
ERROR: invalid device tree
Found EFI removable media binary efi/boot/bootarm.efi
1403700 bytes read in 19 ms (70.5 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Booting /efi\boot\bootarm.efi
FreeBSD Booting:
Code:
Consoles: EFI console 
    Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk2p1:
FreeBSD/arm EFI loader, Revision 1.1

   Command line arguments: l
   Image base: 0x8d417000
   EFI version: 2.80
   EFI Firmware: Das U-Boot (rev 8225.1792)
   Console: comconsole (0)
   Load Path: /efi\boot\bootarm.efi
   Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Sata(0x0,0xffff,0x0)/HD(1,0x01,0,0x81f,0x18fa8)
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Sata(0x0,0xffff,0x0)/HD(1,0x01,0,0x81f,0x18fa8)
Setting currdev to disk2p1:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Sata(0x0,0xffff,0x0)/HD(2,0x01,0,0x197c7,0x1dba8e9)
Setting currdev to disk2p2:
Loading /boot/defaults/loader.conf
Loading /boot/defaults/loader.conf
Loading /boot/device.hints
Loading /boot/loader.conf
Loading /boot/loader.conf.local
Loading kernel...
/boot/kernel/kernel text=0x1b4 text=0x6f2fe4 text=0x1831dc data=0xb00b0 data=0x0+0x1e8000 syms=[0x4+0x9e880+0x4+0x1100f4]
Loading configured modules...
/etc/hostid size=0x25
/boot/kernel/umodem.ko text=0x1540 text=0xf20 data=0x234+0x4 syms=[0x4+0xe70+0x4+0xa74]
loading required module 'ucom'
/boot/kernel/ucom.ko text=0x1714 text=0x2c7c data=0x484+0x838 syms=[0x4+0x13e0+0x4+0xbac]
/boot/entropy size=0x1000

Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/boot/kernel/kernel]...               
Using DTB provided by EFI at 0x17f00000.
Kernel entry at 0x87600200...
Kernel args: (null)
WARNING: Cannot find freebsd,dts-version property, cannot check DTB compliance
---<<BOOT>>---
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.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 06:33:09 UTC 2021
    root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm.armv7/sys/GENERIC arm
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
VT: init without driver.
No PSCI/SMCCC call function found
CPU: ARM Cortex-A9 r2p10 (ECO: 0x00000000)
CPU Features:
  Multiprocessing, Thumb2, Security, VMSAv7, Coherent Walk
Optional instructions:
  UMULL, SMULL, SIMD(ext)
LoUU:2 LoC:2 LoUIS:2
Cache level 1:
 32KB/32B 4-way data cache WB Read-Alloc Write-Alloc
 32KB/32B 4-way instruction cache Read-Alloc
real memory  = 2130145280 (2031 MB)
avail memory = 2071646208 (1975 MB)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
random: unblocking device.
random: entropy device external interface
WARNING: Device "kbd" is Giant locked and may be deleted before FreeBSD 14.0.
kbd0 at kbdmux0
WARNING: Device "openfirm" is Giant locked and may be deleted before FreeBSD 14.0.
ofwbus0: <Open Firmware Device Tree>
ofw_clkbus0: <OFW clocks bus> on ofwbus0
clk_fixed0: <Fixed clock> on ofw_clkbus0
clk_fixed1: <Fixed clock> on ofw_clkbus0
clk_fixed2: <Fixed clock> on ofw_clkbus0
simplebus0: <Flattened device tree simple bus> on ofwbus0
simplebus1: <Flattened device tree simple bus> mem 0x2000000-0x20fffff on simplebus0
simplebus2: <Flattened device tree simple bus> mem 0x2000000-0x203ffff on simplebus1
imx6_anatop0: <Freescale i.MX6 Analog PLLs and Power> mem 0x20c8000-0x20c8fff irq 47,48,49 on simplebus1
simplebus3: <Flattened device tree simple bus> mem 0x2100000-0x21fffff on simplebus0
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 0x20cc000-0x20cffff on simplebus1
ocotp0: <Freescale On-Chip One-Time-Programmable Memory> mem 0x21bc000-0x21bffff on simplebus3
ccm0: <Freescale i.MX6 Clock Control Module> mem 0x20c4000-0x20c7fff irq 45,46 on simplebus1
l2cache0: <PL310 L2 cache controller> mem 0xa02000-0xa02fff irq 11 on simplebus0
l2cache0: cannot allocate IRQ, not using interrupt
l2cache0: Part number: 0x3, release: 0x7
l2cache0: L2 Cache enabled: 1024KB/32B 16 ways
imx_iomux0: <Freescale i.MX pin configuration> mem 0x20e0000-0x20e3fff on simplebus1
gic0: <ARM Generic Interrupt Controller> mem 0xa01000-0xa01fff,0xa00100-0xa001ff on simplebus0
gic0: pn 0x39, arch 0x1, rev 0x2, implementer 0x43b irqs 160
gpio0: <Freescale i.MX GPIO Controller> mem 0x209c000-0x209ffff irq 28,29 on simplebus1
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <Freescale i.MX GPIO Controller> mem 0x20a0000-0x20a3fff irq 30,31 on simplebus1
gpiobus1: <OFW GPIO bus> on gpio1
gpio2: <Freescale i.MX GPIO Controller> mem 0x20a4000-0x20a7fff irq 32,33 on simplebus1
gpiobus2: <OFW GPIO bus> on gpio2
gpio3: <Freescale i.MX GPIO Controller> mem 0x20a8000-0x20abfff irq 34,35 on simplebus1
gpiobus3: <OFW GPIO bus> on gpio3
gpio4: <Freescale i.MX GPIO Controller> mem 0x20ac000-0x20affff irq 36,37 on simplebus1
gpiobus4: <OFW GPIO bus> on gpio4
gpio5: <Freescale i.MX GPIO Controller> mem 0x20b0000-0x20b3fff irq 38,39 on simplebus1
gpiobus5: <OFW GPIO bus> on gpio5
gpio6: <Freescale i.MX GPIO Controller> mem 0x20b4000-0x20b7fff irq 40,41 on simplebus1
gpiobus6: <OFW GPIO bus> on gpio6
sdma0: <i.MX6 Smart Direct Memory Access Controller> mem 0x20ec000-0x20effff irq 60 on simplebus1
imx_wdog0: <Freescale i.MX Watchdog> mem 0x20bc000-0x20bffff irq 43 on simplebus1
imx_epit0: <i.MX EPIT timer> mem 0x20d0000-0x20d3fff irq 52 on simplebus1
Timecounter "EPIT" frequency 66000000 Hz quality 1000
mp_tmr0: <ARM MPCore Timers> mem 0xa00600-0xa0061f irq 10 on simplebus0
Event timer "MPCore" frequency 492000000 Hz quality 1000
usbphy0: <Freescale i.MX6 USB PHY> mem 0x20c9000-0x20c9fff irq 50 on simplebus1
usbphy1: <Freescale i.MX6 USB PHY> mem 0x20ca000-0x20cafff irq 51 on simplebus1
imx_usbmisc0: <i.MX USB Misc Control> mem 0x2184800-0x21849ff on simplebus3
pmu0: <Performance Monitoring Unit> irq 1 on ofwbus0
hdmi0: <Freescale i.MX6 HDMI core> mem 0x120000-0x128fff irq 7 on simplebus0
uart0: <Freescale i.MX UART> mem 0x2020000-0x2023fff irq 66 on simplebus2
uart0: console (115200,n,8,1)
pcm0: <i.MX6 Synchronous Serial Interface (SSI)> mem 0x2028000-0x202bfff irq 68 on simplebus2
pcm0: ssimixer_set() 75 75
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
gpioc5: <GPIO controller> on gpio5
gpioc6: <GPIO controller> on gpio6
snvs0: <i.MX6 SNVS RTC> mem 0x20cc000-0x20cffff irq 99,100 on simple_mfd0
snvs0: registered as a time-of-day clock, resolution 0.000030s
src0: <Freescale i.MX6 System Reset Controller> mem 0x20d8000-0x20dbfff irq 54,55 on simplebus1
ehci0: <Freescale i.MX integrated USB controller> mem 0x2184000-0x21841ff irq 73 on simplebus3
usbus0: EHCI version 1.0
usbus0: stop timeout
usbus0 on ehci0
ehci1: <Freescale i.MX integrated USB controller> mem 0x2184200-0x21843ff irq 74 on simplebus3
usbus1: EHCI version 1.0
usbus1 on ehci1
ffec0: <Freescale Gigabit Ethernet Controller> mem 0x2188000-0x218bfff irq 77,78 on simplebus3
miibus0: <MII bus> on ffec0
atphy0: <Atheros F1 10/100/1000 PHY> PHY 0 on miibus0
atphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseSX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
ffec0: Ethernet address: d2:a7:fd:f7:ea:d0
sdhci_fsl0: <Freescale uSDHC controller> mem 0x2194000-0x2197fff irq 83 on simplebus3
mmc0: <MMC/SD bus> on sdhci_fsl0
sdhci_fsl1: <Freescale uSDHC controller> mem 0x2198000-0x219bfff irq 84 on simplebus3
mmc1: <MMC/SD bus> on sdhci_fsl1
imx_i2c0: <Freescale i.MX I2C> mem 0x21a0000-0x21a3fff irq 86 on simplebus3
imx_i2c1: <Freescale i.MX I2C> mem 0x21a4000-0x21a7fff irq 87 on simplebus3
imx_i2c2: <Freescale i.MX I2C> mem 0x21a8000-0x21abfff irq 88 on simplebus3
audmux0: <i.MX6 Digital Audio Multiplexer> mem 0x21d8000-0x21dbfff on simplebus3
uart1: <Freescale i.MX UART> mem 0x21ec000-0x21effff irq 96 on simplebus3
uart2: <Freescale i.MX UART> mem 0x21f0000-0x21f3fff irq 97 on simplebus3
fb0: <Freescale IPU> mem 0x2400000-0x27fffff irq 13,14 on simplebus0
ahci0: <i.MX6 Integrated AHCI controller> mem 0x2200000-0x2203fff irq 15 on simplebus0
ahci0: AHCI v1.30 with 1 3Gbps ports, Port Multiplier supported
ahcich0: <AHCI channel> at channel 0 on ahci0
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
cryptosoft0: <software crypto>
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
usbus1: 480Mbps High Speed USB v2.0
ugen0.1: <Freescale EHCI root HUB> at usbus0
uhub0 on usbus0
uhub0: <Freescale EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
ugen1.1: <Freescale EHCI root HUB> at usbus1
uhub1 on usbus1
uhub1: <Freescale EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
mmcsd0: 4GB <SDHC SD04G 3.0 SN 6D542913 MFG 12/2013 by 39 PH> at mmc0 50.0MHz/4bit/65535-block
mmcsd1: 8GB <MMCHC 8GTF4R 0.6 SN 2950F48F MFG 01/2018 by 21 0x0000> at mmc1 50.0MHz/8bit/65535-block
mmcsd1boot0: 4MB partition 1 at mmcsd1
mmcsd1boot1: 4MB partition 2 at mmcsd1
mmcsd1rpmb: 524kB partition 3 at mmcsd1
iicbus0: <OFW I2C bus> on imx_i2c0
iic0: <I2C generic I/O> on iicbus0
nxprtc0: <NXP PCF8523 RTC> at addr 0xd0 on iicbus0
iicbus0: <unknown card> at addr 0x14
iicbus1: <OFW I2C bus> on imx_i2c1
iic1: <I2C generic I/O> on iicbus1
hdmi0: HDMI controller 13:0a:a0:c1
iicbus2: <OFW I2C bus> on imx_i2c2
iic2: <I2C generic I/O> on iicbus2
nxprtc0: WARNING: RTC battery failed; time is invalid
nxprtc0: registered as a time-of-day clock, resolution 0.015625s
Release APs
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <SanDisk SSD U110 16GB U21B001> ACS-2 ATA SATA 3.x device
ada0: Serial Number 153303400094
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 512bytes)
ada0: Command Queueing enabled
ada0: 15272MB (31277232 512 byte sectors)
Trying to mount root from ufs:/dev/ufs/rootfs [rw]...
mmcsd0: Error indicated: 1 Timeout
mmcsd0: Error indicated: 3 Fifo
mmcsd0: Error indicated: 3 Fifo
mmcsd0: Error indicated: 3 Fifo
mmcsd0: Error indicated: 3 Fifo
nxprtc0: RTC clock not running
Warning: bad time from time-of-day clock, system time will not be set accurately
Starting file system checks:
/dev/ufs/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ufs/rootfs: clean, 3271740 free (196 frags, 408943 blocks, 0.0% fragmentation)
uhub0: 1 port with 1 removable, self powered
uhub1: 1 port with 1 removable, self powered
Setting hostuuid: f9eb306c-9901-11eb-bc5e-db838861316e.
Setting hostid: 0xdd134f92.
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
Soft Float compatibility ldconfig path:
Setting hostname: generic.
Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: ugen1.2: <vendor 0x0424 product 0x2514> at usbus1
uhub2 on uhub1
uhub2: <vendor 0x0424 product 0x2514, class 9/0, rev 2.00/b.b3, addr 2> on usbus1
uhub2: MTT enabled
.
pcm0: ssimixer_set() 75 75
Autoloading module: imx_spi.ko
imx_spi0: <i.MX ECSPI Master> mem 0x200c000-0x200ffff irq 63 on simplebus2
spibus0: <OFW SPI bus> on imx_spi0
lo0: link state changed to UP
uhub2: 4 ports with 3 removable, self powered
ffec0: link state changed to DOWN
Starting Network: lo0 ffec0.
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>
ffec0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80008<VLAN_MTU,LINKSTATE>
        ether d2:a7:fd:f7:ea:d0
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
ffec0: link state changed to UP
Autoloading module: imx_spi.ko
 
Well In the end the best I can manage is u-boot.imx flashed to the onboard 8GB eMMC emmcsd1 .
Once I flash the eMMC I switch jumpers from SD Card boot to eMMC boot.

With that it jumps to EFI partition and root filesystem on mSATA.
So no SD card needed and all solid state drives. Granted eMMC2 speed is only 25Megabytes /sec.
But for a bootloader it should be fine.
What U-Boot is doing with a 1Kb bootloader is pretty amazing.
Code:
U-Boot SPL 2021.07 (Jan 11 2022 - 18:49:08 -0500)
WDT:   Not found!
Trying to boot from MMC2


U-Boot 2021.07 (Jan 11 2022 - 18:49:08 -0500)

CPU:   Freescale i.MX6Q rev1.3 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 44C
Reset cause: WDOG
Board: MX6 HummingBoard2
DRAM:  2 GiB
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:
Warning: ethernet@2188000 (eth0) using random MAC address - 72:37:bf:8f:f8:0b
eth0: ethernet@2188000
Hit any key to stop autoboot:  0
MMC: no card present
switch to partitions #0, OK
mmc2(part 0) is current device
** No partition table - mmc 2 **
Couldn't find partition mmc 2:1
AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part
SATA Device Info:
S/N: G884850166
Product model number: TS512GMTS430S
Firmware version: R0427GN1
Capacity: 1000215216 sectors

Device 0: Model: TS512GMTS430S Firm: R0427GN1 Ser#: G884850166
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 488386.3 MB = 476.9 GB (1000215216 x 512)
... is now current device
Scanning sata 0:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
MMC: no card present
Scanning disk usdhc@2194000.blk...
Disk usdhc@2194000.blk not ready
Scanning disk usdhc@2198000.blk...
** Unrecognized filesystem type **
Scanning disk sata@2200000.blk...
** Unrecognized filesystem type **
Found 4 disks
No EFI system partition
No panel detected: default to HDMI
Display: HDMI (1024x768)
ERROR: invalid device tree
Found EFI removable media binary efi/boot/bootarm.efi
1403700 bytes read in 19 ms (70.5 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Booting /efi\boot\bootarm.efi


Consoles: EFI console  
    Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk1p1:
FreeBSD/arm EFI loader, Revision 1.1

   Command line arguments: l
   Image base: 0x8d41b000
   EFI version: 2.80
   EFI Firmware: Das U-Boot (rev 8225.1792)
   Console: comconsole (0)
   Load Path: /efi\boot\bootarm.efi
   Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Sata(0x0,0xffff,0x0)/HD(1,0x01,0,0x81f,0x18fa8)
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Sata(0x0,0xffff,0x0)/HD(1,0x01,0,0x81f,0x18fa8)
Setting currdev to disk1p1:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Sata(0x0,0xffff,0x0)/HD(2,0x01,0,0x197c7,0x5e6821)
Setting currdev to disk1p2:
Loading /boot/defaults/loader.conf
Loading /boot/defaults/loader.conf
Loading /boot/device.hints
Loading /boot/loader.conf
Loading /boot/loader.conf.local
 
What U-Boot is doing with a 1Kb bootloader is pretty amazing.
I was greatly off here. U-Boot boot image size is 53Kb
Code:
Image Type:   Freescale IMX Boot Image
Image Ver:    2 (i.MX53/6/7 compatible)
Mode:         DCD
Data Size:    53248 Bytes = 52.00 KiB = 0.05 MiB
Load Address: 00907420
Entry Point:  00908000

The raw image size of u-boot.imx is 623k
 
I just got a used Hummingboard2 CBI.
This board drops HDMI and audio jacks and adds CAN Bus and RS485.

The CPU module is the older uSOM rev 1.3. This has no eMMC.
It is also IMX6 Dual-Lite. That means no SATA!!
I also have another Hummingboard with IMX6 Solo on the way. No SATA on the IMX6 Solo either.

I have swapped the uSOM around. The Quad Core with 8GB eMMC works fine on the Hummingboard2 CBI model.
That eSOM is rev 1.5 and most of those have 8GB eMMC on eSOM.
Some earlier carrier boards had the eMMC mounted on it. The Solo board I have coming has eMMC on the carrier.
 
I looked around at another board to invest in and I really can't find any compatibles.
Hummingboard2 has swappable CPU/Mem/eMMC and slotted standard storage with M.2 mSATA and a mPCIe slot.

Beat that.

Quartz and RockPro have PCIe x4 slot. But custom eMMC module needed with several sizes out of stock.
That comes close. But PCIe slot for embedded? Why not several M.2 slots.
 
I was looking at the inner working of the u-boot mx6cuboxi board files and I am amazed that they are using GPIO Pin states to identify the various Hummingboards and uSOM modules.
Code:
static enum board_type board_type(void)
{
    int val1, val2, val3;

    SETUP_IOMUX_PADS(board_detect);

    /*
     * Machine selection -
     * Machine      val1, val2, val3
     * ----------------------------
     * HB2            x     x    0
     * HB rev 3.x     x     0    x
     * CBi            0     1    x
     * HB             1     1    x
     */

    gpio_direction_input(IMX_GPIO_NR(2, 8));
    val3 = gpio_get_value(IMX_GPIO_NR(2, 8));

    if (val3 == 0)
        return HUMMINGBOARD2;

    gpio_direction_input(IMX_GPIO_NR(3, 4));
    val2 = gpio_get_value(IMX_GPIO_NR(3, 4));

    if (val2 == 0)
        return HUMMINGBOARD;

    gpio_direction_input(IMX_GPIO_NR(4, 9));
    val1 = gpio_get_value(IMX_GPIO_NR(4, 9));

    if (val1 == 0) {
        return CUBOXI;
    } else {
        return HUMMINGBOARD;
    }
}

static bool is_rev_15_som(void)
{
    int val1, val2;
    SETUP_IOMUX_PADS(som_rev_detect);

    val1 = gpio_get_value(IMX_GPIO_NR(6, 0));
    val2 = gpio_get_value(IMX_GPIO_NR(6, 4));

    if (val1 == 1 && val2 == 0)
        return true;

    return false;
}

static bool has_emmc(void)
{
    struct mmc *mmc;
    mmc = find_mmc_device(2);
    if (!mmc)
        return 0;
    return (mmc_get_op_cond(mmc) < 0) ? 0 : 1;
}
 
I have decoded the Hummingboard2 GPIO Pin Assignments from imx6qdl-hummingboard2.dtsi
This uses a 36 Pin GPIO Header(Slight Gap/Shift In Middle) 4 Pins wide x 9 rows.
The top part of this is right from the dtsi file. I did add ROW-s to make it easier to decode.

Code:
             * 36 pin headers GPIO description. The pins
                 * numbering as following -
                 *
    ROW-A         *    3.2v  5v    74    75
    ROW-B         *    73    72    71    70
    ROW-C         *    69    68    67    66
                 *
    ROW-D         *    77    78    79    76
    ROW-E         *    65    64    61    60
    ROW-F         *    53    52    51    50
    ROW-G         *    49    48   166    132
    ROW-H         *    95    94    90    91
    ROW-I         *    GND   54    24    204
                 *
                 * The GPIO numbers can be extracted using
                 * signal name from below.
                 * i.e. The mapping of GPIO(X,Y) to Linux gpio
                 * number is : gpio number = (X-1) * 32 + Y
--------------------------------------------------------------------------------------------------------

  Here is what to use for FreeBSD gpioctl: (ie. gpioctl -f /dev/gpioc4 -c 4 OUT)

ROW-A=        3.2v             5v               GPIOC2-10            GPIOC2-11
ROW-B=        GPIOC2-09        GPIOC2-08        GPIOC2-07            GPIOC2-06
ROW-C=        GPIOC2-05        GPIOC2-04        GPIOC2-03            GPIOC2-02


ROW-D=        GPIOC2-13        GPIOC2-14        GPIOC2-15            GPIO12-12
ROW-E=        GPIOC2-01        GPIOC2-00        GPIOC1-29            GPIOC1-28
ROW-F=        GPOIC1-21        GPIOC1-20        GPIOC1-19            GPIOC1-18
ROW-G=        GPOIC1-17        GPIOC1-16        GPIOC5-06            GPIOC5-04
ROW-H=        GPOIC2-31        GPIOC2-30        GPIOC2-26            GPIOC2-27
ROW-I=        NEGATIVE         GPOIC1-22        GPIOC0-24            GPIOC6-12
-----------------------------------------------------------------------------------------------------------
 

Attachments

  • gpio.png
    gpio.png
    12.8 KB · Views: 80
Back
Top