Hi,
The issue: u-boot can find, load and transfer control to ubldr, but ubldr instantly fails with return code 0x1badab1.
Details: These instructions were followed to build and install FreeBSD. U-boot was downloaded and installed using instructions on that same web page. Booting that build from an SD card works just fine. Transferring that image to an M.2 SATA SSD and using dd to install the u-boot for SATA results in an installation that doesn't work so well. With appropriate choice of u-boot commands, ubldr can be found and loaded, but that results in failure of ubldr:
I suppose that return code comes from ubldr, but I can't locate it anywhere in the ubldr source code.
The strange thing (for me anyway) is that if those ubldr bits are written to the appropriate place on the SD card, there are no problems with booting from that storage medium:
Is there something in the source code that ties proper functioning of ubldr to the SD card? Is there some way the build can be configured so that ubldr works well with the SATA interface?
Edit: I believe I've found the source code that generates the 0x1badab1: freebsd-master/stand/uboot/common/main.c. Apparently the error occurs because ubldr can't find the API magic signature. Now I get to figure out what that means and how to fix it. It's still a mystery why the error occurs for ubldr on the SATA drive and not for the same bits on the SD card.
The issue: u-boot can find, load and transfer control to ubldr, but ubldr instantly fails with return code 0x1badab1.
Details: These instructions were followed to build and install FreeBSD. U-boot was downloaded and installed using instructions on that same web page. Booting that build from an SD card works just fine. Transferring that image to an M.2 SATA SSD and using dd to install the u-boot for SATA results in an installation that doesn't work so well. With appropriate choice of u-boot commands, ubldr can be found and loaded, but that results in failure of ubldr:
Code:
U-Boot SPL 2018.01-02337-gdc4398fdb8 (May 14 2018 - 18:46:33)
High speed PHY - Version: 2.0
Detected Device ID 6828
board SerDes lanes topology details:
| Lane # | Speed | Type |
--------------------------------
| 0 | 3 | SATA0 |
| 1 | 0 | SGMII1 |
| 2 | 5 | PCIe1 |
| 3 | 5 | USB3 HOST1 |
| 4 | 5 | USB3 HOST0 |
| 5 | 0 | SGMII2 |
--------------------------------
PCIe, Idx 1: detected no link
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.29.0
DDR3 Training Sequence - Switching XBAR Window to FastPath Window
DDR3 Training Sequence - Ended Successfully
Trying to boot from SATA
AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
Found 1 device(s).
U-Boot 2018.01-02337-gdc4398fdb8 (May 14 2018 - 18:46:33 +0200), Build: jenkins-u-boot-clearfog-model=base,variant=sata-10
SoC: MV88F6828-A0 at 1600 MHz
DRAM: 1 GiB (800 MHz, 32-bit, ECC not enabled)
MMC: mv_sdh: 0
AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
Found 1 device(s).
Model: SolidRun Clearfog
Board: SolidRun ClearFog Base
SCSI: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
Net: eth1: ethernet@70000, eth2: ethernet@30000, eth3: ethernet@34000
Hit any key to stop autoboot: 0
=> scsi scan
scanning bus for devices...
Device 0: (0:0) Vendor: ATA Prod.: TS64GMTS400 Rev: O091
Type: Hard Disk
Capacity: 61057.3 MB = 59.6 GB (125045424 x 512)
Found 1 device(s).
=> load scsi 0:1 0x1000000 ubldr
reading ubldr
296569 bytes read in 11 ms (25.7 MiB/s)
=> bootelf 0x1000000
CACHE: Misaligned operation at range [01000098, 01030128]
CACHE: Misaligned operation at range [01030128, 01030c2b]
CACHE: Misaligned operation at range [01030c2c, 01032634]
CACHE: Misaligned operation at range [01032634, 01034eaf]
CACHE: Misaligned operation at range [01034eb0, 010365c0]
CACHE: Misaligned operation at range [010365c0, 0103661c]
CACHE: Misaligned operation at range [0103661c, 01036694]
CACHE: Misaligned operation at range [01036694, 01036764]
CACHE: Misaligned operation at range [01036764, 01036770]
## Starting application at 0x01000098 ...
## Application terminated, rc = 0x1badab1
I suppose that return code comes from ubldr, but I can't locate it anywhere in the ubldr source code.
The strange thing (for me anyway) is that if those ubldr bits are written to the appropriate place on the SD card, there are no problems with booting from that storage medium:
Code:
U-Boot SPL 2018.01-02337-gdc4398fdb8 (May 14 2018 - 18:46:33)
High speed PHY - Version: 2.0
Detected Device ID 6828
board SerDes lanes topology details:
| Lane # | Speed | Type |
--------------------------------
| 0 | 3 | SATA0 |
| 1 | 0 | SGMII1 |
| 2 | 5 | PCIe1 |
| 3 | 5 | USB3 HOST1 |
| 4 | 5 | PCIe2 |
| 5 | 0 | SGMII2 |
--------------------------------
PCIe, Idx 1: detected no link
PCIe, Idx 2: detected no link
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.29.0
DDR3 Training Sequence - Switching XBAR Window to FastPath Window
DDR3 Training Sequence - Ended Successfully
Trying to boot from MMC1
U-Boot 2017.07-05756-gc166d3d160 (Jul 10 2017 - 21:15:35 +0200)
SoC: MV88F6828-A0 at 1600 MHz
I2C: ready
DRAM: 1 GiB (800 MHz, ECC not enabled)
MMC: mv_sdh: 0
Model: SolidRun Clearfog A1
Board: SolidRun ClearFog
Net:
Error: ethernet@30000 address not set.
No ethernet found.
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
reading /boot.scr
205 bytes read in 10 ms (19.5 KiB/s)
## Executing script at 00200000
reading ubldr
1103491 bytes read in 65 ms (16.2 MiB/s)
CACHE: Misaligned operation at range [01000098, 01038ed8]
CACHE: Misaligned operation at range [01038ed8, 0103909c]
CACHE: Misaligned operation at range [0103909c, 010390a8]
CACHE: Misaligned operation at range [010390b0, 0103c2eb]
CACHE: Misaligned operation at range [0103c2ec, 0103e0dc]
CACHE: Misaligned operation at range [0103e0dc, 01042905]
CACHE: Misaligned operation at range [01042910, 010443e4]
CACHE: Misaligned operation at range [010443e4, 01044440]
CACHE: Misaligned operation at range [01044440, 01044a3c]
CACHE: Misaligned operation at range [01044a40, 010487b0]
## Starting application at 0x01000098 ...
Consoles: U-Boot console
Compatible U-Boot API signature found @0x3fbcf898
FreeBSD/armv6 U-Boot loader, Revision 1.2
(Sat Jul 28 11:05:33 PDT 2018 root@ghrBSD)
DRAM: 1024MB
Number of U-Boot devices: 1
U-Boot env: loaderdev not set, will probe all devices.
Found U-Boot device: disk
Probing all disk devices...
Checking unit=0 slice=<auto> partition=<auto>... good.
Booting from disk0s2a:
/boot/kernel/kernel data=0x781d80+0x52280 syms=[0x4+0xa7b00+0x4+0xa5c1a]
Hit [Enter] to boot immediately, or any other key for command prompt.
Type '?' for a list of commands, 'help' for more detailed help.
loader>
Is there something in the source code that ties proper functioning of ubldr to the SD card? Is there some way the build can be configured so that ubldr works well with the SATA interface?
Edit: I believe I've found the source code that generates the 0x1badab1: freebsd-master/stand/uboot/common/main.c. Apparently the error occurs because ubldr can't find the API magic signature. Now I get to figure out what that means and how to fix it. It's still a mystery why the error occurs for ubldr on the SATA drive and not for the same bits on the SD card.
Last edited: