Jump to content

[info] Ebin boot on SATA


ManoftheSea

Recommended Posts

I was able to boot from a SATA disk that was manually setup with a GPT-formatted table and a debootstrap'ed debian arm64 kernel.  The GPT partitions included:

1. BIOS from sector 34-2047, no filesystem

2. ESP from 2048-409599 (which u-boot calls bootable even if the flag isn't set), vfat filesystem

3. XBOOTLDR from 409600-819199 with bootable flag set (0x4), ext4 FS without journal

4. linux swap

5. ARM64 root (gdisk type 8305) with bit 60 set (read-only), ext4 without journal

6. linux /var (gdisk type 8310), ext4, with /srv/ and /home/ bind-mounted from /var/local/

 

The bootscripts/extlinux configuration live in /boot, onto which is mounted partition 3 (XBOOTLDR) next to the actual kernel/initramdisk.  It is necessary to mark this partition bootable in gdisk to have the u-boot distro-boot search it for extlinux/boot.scr.

 

While the espressobin doesn't require u-boot flashed on the boot media, this disk partition scheme would allow rockchip64 systems to boot if the BIOS partition is extended to somewhere around sector 32767 (as rockchip needs code at sector 64 and maybe 16384 and 24576).

Link to comment
Share on other sites

I am trying to get yrzr opnsense image to boot on my Espressobinv7 with a sata ssd plugged in, I am having trouble with it.  Been able to boot the image off an mmc sd card without any issues. But when trying to boot off the ssd it appears to boot halfway but then stop when trying to boot the GEOM managed disk which doesn't show up.  I've found out that my issue may be related that i am booting off u-boot Armbian 2022.04 and that appears to only have 'scsi' option but not 'sata' ? is this correct?  Is there a way i can get existing current u-boot Armbian 2022.04 image to function with 'sata' ? Or is there any way i can force the ssd to be detected when trying to boot via 'scsi'? Am I doing this all wrong? any insight will be much appreciated. Output is below.

 


TIM-1.0
mv_ddr-devel-g251bc63 DDR4 16b 1GB 1CS
WTMI-devel-18.12.1-1d97715
WTMI: system early-init
SVC REV: 5, CPU VDD voltage: 1.108V
Setting clocks: CPU 1000 MHz, DDR 800 MHz
CZ.NIC's Armada 3720 Secure Firmware 0b68a33-dirty (May 16 2022 17:51:06)
Running on ESPRESSObin
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v2.6(release):a921da5e
NOTICE:  BL1: Built : 17:54:27, May 16 2022
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v2.6(release):a921da5e
NOTICE:  BL2: Built : 17:54:27, May 16 2022
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v2.6(release):a921da5e
NOTICE:  BL31: Built : 17:54:27, May 16 2022


U-Boot 2022.04-armbian (May 16 2022 - 17:50:52 +0000)

DRAM:  1 GiB
Core:  38 devices, 20 uclasses, devicetree: fit
WDT:   Not starting watchdog@8300
Comphy chip #0:
Comphy-0: USB3_HOST0    5 Gbps
Comphy-1: PEX0          5 Gbps
Comphy-2: SATA0         6 Gbps
Target spinup took 0 ms.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIe: Link down
MMC:   sdhci@d0000: 0, sdhci@d8000: 1
Loading Environment from SPIFlash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK
Model: Globalscale Marvell ESPRESSOBin Board
Net:   eth0: ethernet@30000
Hit any key to stop autoboot:  0
scanning bus for devices...
  Device 0: (0:0) Vendor: ATA Prod.: SanDisk SD6SB1M1 Rev: X231
            Type: Hard Disk
            Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)

Device 0: (0:0) Vendor: ATA Prod.: SanDisk SD6SB1M1 Rev: X231
            Type: Hard Disk
            Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
... is now current device
1256188 bytes read in 27 ms (44.4 MiB/s)
16032 bytes read in 5 ms (3.1 MiB/s)
MMC: no card present
Scanning disk sdhci@d0000.blk...
Disk sdhci@d0000.blk not ready
Scanning disk ahci_scsi.id0lun0...
Found 3 disks
No EFI system partition
Booting /EFI\BOOT\bootaa64.efi
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: root=PARTUUID=00000000-02 rw rootwait
   Image base: 0x3e98c000
   EFI version: 2.90
   EFI Firmware: Das U-Boot (rev 8226.1024)
   Console: efi (0x1000)
   Load Path: /EFI\BOOT\bootaa64.efi
   Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)/HD(1,MBR,0x8e6515d4,0x800,0x19000)
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)/HD(1,MBR,0x8e6515d4,0x800,0x19000)
Setting currdev to disk0p1:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)/HD(2,MBR,0x8e6515d4,0x19800,0x5e6800)
Setting currdev to disk0p2:
Loading /boot/defaults/loader.conf
Loading /boot/defaults/loader.conf
Loading /boot/device.hints
Loading /boot/loader.conf
console vidconsole is invalid!
Available consoles:
    efi
    comconsole
Loading /boot/loader.conf.local
|
c-
console vidconsole is invalid!
no valid co  ______  _____  _____
Available c /  __  |/ ___ |/ __  |
    efi     | |  | | |__/ | |  | |___  ___ _ __  ___  ___
    comcons | |  | |  ___/| |  | / __|/ _ \ '_ \/ __|/ _ \
|           | |__| | |    | |  | \__ \  __/ | | \__ \  __/
            |_____/|_|    |_| /__|___/\___|_| |_|___/\___|console vidconsole is invalid!
Available consoles:
 +-------------------console vidconsole is invalid!@@@@@@@@@@@@@@@@@@@@@@@@@@
Available consoles:                        |   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    1. Boot Multi user [Enter]             |   @@@@@                    @@@@@
    2. Boot Single user                    |       @@@@@            @@@@@
A|ai3. Escape to loader prompt             |    @@@@@@@@@@@       @@@@@@@@@@@
 |  4. Reboot                              |         \\\\\         /////
 |  5. Cons: Dual (Serial primary)         |   ))))))))))))       (((((((((((
 |                                         |         /////         \\\\\
 |  Options:                               |    @@@@@@@@@@@       @@@@@@@@@@@
 |  6. Kernel: default/kernel (1 of 1)     |       @@@@@            @@@@@
 |  7. Boot Options                        |   @@@@@                    @@@@@
 |                                         |   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 |                                         |   @@@@@@@@@@@@@@@@@@@@@@@@@@@@
 +-----------------------------------------+
   Autoboot in 0 seconds. [Space] to pause     23.1 ``Quintessential Quail'' console vidconsole is invalid!
Available consoles:
Loading kernel...
/boot/kernel/kernel text=0x2a8 text=0x928b30 text=0x21cf64 data=0x1b25d0 data=0x0+0x38a000 syms=[0x8+0x131940+0x8+0x156d2b]
Loading configured modules...!
/boot/kernel/pfsync.ko text=0x2f63 text=0x7f1c data=0xb38+0x8 syms=[0x8+0x1830+0x8+0x1192]
loading required module 'pf'
/boot/kernel/pf.ko text=0xe41c text=0x3e7d4 data=0x59f0+0x3bc syms=[0x8+0x5958+0x8+0x4727]
/boot/kernel/if_bridge.ko text=0x36a3 text=0x710c data=0xd38+0x8 syms=[0x8+0x1bd8+0x8+0x15d7]
loading required module 'bridgestp'
/boot/kernel/bridgestp.ko text=0x12e4 text=0x4acc data=0x2c8+0x28 syms=[0x8+0xb88+0x8+0x6e9]
/boot/kernel/if_enc.ko text=0x15ca text=0x934 data=0x750 syms=[0x8+0xca8+0x8+0xb71]
/boot/entropy size=0x1000
/boot/kernel/pflog.ko text=0xf78 text=0x898 data=0x430 syms=[0x8+0x9f0+0x8+0x712]
/boot/kernel/if_gre.ko text=0x2736 text=0x4938 data=0x8c8+0x40 syms=[0x8+0x16f8+0x8+0xfaf]
/boot/kernel/if_lagg.ko text=0x3d27 text=0xa628 data=0xd18+0x8 syms=[0x8+0x1cb0+0x8+0x15bd]
loading required module 'if_infiniband'
/boot/kernel/if_infiniband.ko text=0x1102 text=0x10fc data=0x300+0x8 syms=[0x8+0x8d0+0x8+0x59a]
/boot/kernel/carp.ko text=0x33ec text=0x6e54 data=0xc60+0x48 syms=[0x8+0x1980+0x8+0x1225]
/etc/hostid size=0x25
Using DTB provided by EFI at 0x7f00000.
EFI framebuffer information:
addr, size     0x0, 0x0
dimensions     0 x 0
stride         0
masks          0x00000000, 0x00000000, 0x00000000, 0x00000000
---<<BOOT>>---
KDB: debugger backends: ddb
KDB: current backend: ddb
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.1-RELEASE-p8 stable/23.1-n250461-cf0d42d1ca7 SMP arm64
FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
VT: init without driver.
module firmware already present!
real memory  = 1071546368 (1021 MB)
avail memory = 1019772928 (972 MB)
Starting CPU 1 (1)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
random: unblocking device.
random: entropy device external interface
MAP 3eac4000 mode 2 pages 1
MAP 3eac8000 mode 2 pages 3
MAP 3eacc000 mode 2 pages 4
MAP 3fef0000 mode 2 pages 16
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
simplebus1: <Flattened device tree simple bus> on simplebus0
simple_mfd0: <Simple MFD (Multi-Functions Device)> mem 0x13800-0x138ff,0x13c00-0x13c1f on simplebus1
simple_mfd1: <Simple MFD (Multi-Functions Device)> mem 0x18800-0x188ff,0x18c00-0x18c1f on simplebus1
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
gic0: <ARM Generic Interrupt Controller v3.0> mem 0x1d00000-0x1d0ffff,0x1d40000-0x1d7ffff,0x1d80000-0x1d81fff,0x1d90000-0x1d91fff,0x1da0000-0x1dbffff irq 28 on simplebus1
gpio0: <Armada 37x0 North Bridge GPIO Controller> mem 0x13800-0x138ff,0x13c00-0x13c1f irq 29,30,31,32,33,34,35,36,37,38,39,40 on simple_mfd0
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <Armada 37x0 South Bridge GPIO Controller> mem 0x18800-0x188ff,0x18c00-0x18c1f irq 41,42,43,44,45 on simple_mfd1
gpiobus1: <OFW GPIO bus> on gpio1
gpioregulator0: <GPIO controlled regulator> on ofwbus0
generic_timer0: <ARMv8 Generic Timer> irq 0,1,2,3 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 12500000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 12500000 Hz quality 1000
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
cpu1: <Open Firmware CPU> on cpulist0
pmu0: <Performance Monitoring Unit> irq 4 on ofwbus0
spi0: <Armada 37x0 SPI controller> mem 0x10600-0x10fff irq 6 on simplebus1
uart0: <Marvell Armada 3700 UART> mem 0x12000-0x121ff irq 9,10,11 on simplebus1
uart0: console (115200,n,8,1)
gpioc0: <GPIO controller> on gpio0
gpioc1: <GPIO controller> on gpio1
mvneta0: <NETA controller> mem 0x30000-0x33fff irq 14 on simplebus1
mvneta0: version is 10
mvneta0: Ethernet address: 00:51:82:11:22:00
mdio0: <MDIO> on mvneta0
mdioproxy0: <MII/MDIO proxy, MDIO side> on mdio0
e6000sw0: <Marvell 88E6341> on mdio0
e6000sw0: multi-chip addressing mode (0x1)
e6000sw0: CPU port at 0
e6000sw0: fixed port at 0
e6000sw0: PHY at port 1
miibus0: <MII bus> on e6000sw0
e1000phy0: <Marvell 88E1000 Gigabit PHY> PHY 17 on miibus0
e1000phy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
e6000sw0: PHY at port 2
miibus1: <MII bus> on e6000sw0
e1000phy1: <Marvell 88E1000 Gigabit PHY> PHY 18 on miibus1
e1000phy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
e6000sw0: PHY at port 3
miibus2: <MII bus> on e6000sw0
e1000phy2: <Marvell 88E1000 Gigabit PHY> PHY 19 on miibus2
e1000phy2:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
e6000sw0: switch is ready.
etherswitch0: <Switch controller> on e6000sw0
xhci0: <Generic USB 3.0 controller> mem 0x58000-0x5bfff irq 16 on simplebus1
xhci0: 32 bytes context size, 32-bit DMA
usbus0 on xhci0
ehci0: <Marvell Integrated USB 2.0 controller> mem 0x5e000-0x5efff irq 17 on simplebus1
usbus1: EHCI version 1.0
usbus1 on ehci0
safexcel0: <SafeXcel EIP-97 crypto accelerator> mem 0x90000-0xaffff irq 18,19,20,21,22,23 on simplebus1
sdhci_xenon0: <Armada Xenon SDHCI controller> mem 0xd0000-0xd02ff,0x1e808-0x1e80b irq 25 on simplebus1
ahci0: <AHCI SATA controller> mem 0xe0000-0xe0177 irq 27 on simplebus1
ahci0: AHCI v1.30 with 1 6Gbps ports, Port Multiplier supported with FBS
ahcich0: <AHCI channel> at channel 0 on ahci0
device_attach: ahcich0 attach returned 6
armv8crypto0: <AES-CBC,AES-XTS,AES-GCM>
Timecounters tick every 1.000 msec
mvneta0: link state changed to UP
e6000sw0port1: link state changed to DOWN
e6000sw0port2: link state changed to DOWN
e6000sw0port3: link state changed to DOWN
usbus0: 5.0Gbps Super Speed USB v3.0
usbus1: 480Mbps High Speed USB v2.0
spibus0: <OFW SPI bus> on spi0
spibus0: <unknown card> at cs 0 mode 0
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 = <>
         Processor Features 0 = <GIC,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
Release APs...done
ugen1.1: <Marvell EHCI root HUB> at usbus1
ugen0.1: <Generic XHCI root HUB> at usbus0
uhub0 on usbus1
uhub1 on usbus0
uhub0: <Marvell EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
uhub1: <Generic XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
Trying to mount root from ufs:/dev/ufs/OPNsense [rw]...
uhub1: 2 ports with 2 removable, self powered
uhub0: 1 port with 1 removable, self powered
Root mount waiting for: CAM
Root mount waiting for: CAM
Root mount waiting for: CAM
Root mount waiting for: CAM
Root mount waiting for: CAM
Root mount waiting for: CAM
Root mount waiting for: CAM
Root mount waiting for: CAM
mountroot: waiting for device /dev/ufs/OPNsense...
Mounting from ufs:/dev/ufs/OPNsense failed with error 19.

Loader variables:
  vfs.root.mountfrom=ufs:/dev/ufs/OPNsense
  vfs.root.mountfrom.options=rw

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> ?

List of GEOM managed disk devices:


mountroot>
 

Link to comment
Share on other sites

As far as I can tell, you've booted.  OPNsense is running and unable to find the disk.  I don't know anything about BSDs, or what driver you might need to find the SATA device on the espressobin.

ahci0: <AHCI SATA controller> mem 0xe0000-0xe0177 irq 27 on simplebus1

This looks like it detected the controller.  So yeah, I don't know why it didn't find the disk, but the problem appears to me to be the domain of freebsd, not of the bootloader firmware.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines