Repository navigation
hi3536dv100: flash agent, and the NBD8010S board's own SPL as a variant - #150
Conversation
The Xiongmai NBD8010S-KL-V2 NVR, sold as "Hi3536E", is a Hi3536DV100 die (SCSYSID 0x3536D100). This makes it recoverable through the bootrom and gives it a flash agent. Agent (SOC=hi3536dv100). The memory map comes from vendor arch-hi3536dv100/platform.h: UART0 PL011 at 0x12080000, FMC 0x10000000 with its window at 0x14000000, CRG 0x12040000, FMC clock gate in CRG48 (+0xC0), SP805 WDT 0x12070000, reboot via sysctl+4. The PL011 runs off the fixed 24 MHz XTAL (CONFIG_PL011_CLOCK), so SET_BAUD reaches 921600 with no clock switching. That is unlike hi3520dv200 (#97), whose bootrom leaves the UART on a ~2 MHz reference. This SoC has no SPI pad block at 0x100C0000, and the vendor FMC driver never touches the pads, so SPI_PINS_SKIP leaves them as the bootrom set them. Variant hi3536dv100:nbd8010s. With the OpenIPC SPL, every bootrom stage is ACKed but the jump to 0x81000000 resets the chip: fresh 0x20 markers, then the stock U-Boot boots from flash. That looks like a successful burn. The OpenIPC SPL's DDR/PLL table (222 entries) was built for another board; this board's stock U-Boot has a different one (185 entries). The variant ships the stock SPL, flash bytes 0..0x5840. The SPL code runs right up to the LZMA payload at 0x5840, so FILELEN grows to 0x5840; the boundary scan would otherwise round down to 0x5800 and cut its tail. burn now honours SPL_BLOB. RecoverySession ignored it, so only the agent paths used a variant's SPL. It now passes the blob as spl_override, which lets `burn -c hi3536dv100:nbd8010s` put the OpenIPC U-Boot in RAM on top of the board's own DDR init. Verified on the NBD8010S-KL-V2 (W25Q128, ef4018, 16 MiB) with Tasmota power cycling: defib burn -c hi3536dv100:nbd8010s -p /dev/ttyUSB2 --power-cycle -> "OpenIPC #", U-Boot 2010.06 (May 09 2026) defib agent upload -c hi3536dv100:nbd8010s -p /dev/ttyUSB2 --power-cycle -> Agent ready, RAM 0x80000000, Flash 16384KB agent info: JEDEC ef4018, all capabilities full-chip read in 256 KiB chunks at 921600: 86 KB/s, 0 retries, CRC 0xaedae175, the same as stock U-Boot `sf read` + `crc32` (whole chip and each of the 16 MiB slices) agent scan: 256/256 sectors good write a pattern to blank sector 0xF50000, read back bit-exact, erase back to all-0xFF; neighbours and logo partition unchanged Without the variant, agent upload never gets READY and burn ends in the stock U-Boot. A single 16 MiB read stream at 921600 still drops one COBS frame in ~10k (the known seq-gap failure); 256 KiB chunks are clean.
PR Summary by QodoAdd Hi3536DV100 flash agent and NBD8010S recovery variant
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1.
|
Qodo review on this branch. Now that burn forwards SPL_BLOB, the 0x5000-byte hi3516av300:emmc blob ran into the same sizing the agent paths already had. A blob carries no LZMA/gzip marker, so _detect_spl_size falls back to the inherited FILELEN of 0x6000, and ljust() zero-pads 4 KiB past the SPL into SRAM the bootrom still uses. The SPL size is now capped at the override's length. Boundary detection and the SRAM limit work as before. A full U-Boot passed as the override is always longer than its detected boundary, so it is unaffected. The session test now checks the SPL HEAD length for both variants: 0x5840 for hi3536dv100:nbd8010s and 0x5000 for hi3516av300:emmc. The emmc case fails without this change. Re-verified agent upload -c hi3536dv100:nbd8010s on the NBD8010S-KL-V2 (READY; flash 0..0xF80000 CRC 0xa63bd6ca = backup). hi3516av300:emmc now sends 0x5000 instead of 0x6000. That is the extracted SPL's real size, but it has not been re-run on an eMMC av300 here.
…s the E (#151) The variant (#150) uploaded the Xiongmai NBD8010S-KL-V2's stock SPL because the OpenIPC SPL reset that board mid-upload. The real cause was in the U-Boot, not the board: Xiongmai's "Hi3536E" is a Hi3536DV100 die that reads 0x02000000 at SYSCTRL+0xEE0 and needs its own PLL, DMC timing and PHY settings. Without them, software DDR training fails and calls reset_cpu(). OpenIPC/u-boot-hi3536dv100#1 now applies those settings on that chip ID and is published as u-boot-hi3536dv100-universal.bin in OpenIPC/firmware latest. This removes the variant, the 0x5840-byte vendor SPL blob and the tests that pinned it. burn keeps honouring SPL_BLOB, which hi3516av300:emmc still uses, and the session test still checks that blob's 0x5000 length. Verified on the NBD8010S-KL-V2 with plain -c hi3536dv100 and the published U-Boot (its SPL window is byte-identical to the build tested on hardware before merging): defib agent upload -c hi3536dv100 -p /dev/ttyUSB2 --power-cycle -> Agent ready; flash 0..0xF80000 CRC 0xa63bd6ca = backup defib burn -c hi3536dv100 -p /dev/ttyUSB2 --power-cycle -> "OpenIPC #", U-Boot 2010.06 (Oct 15 2026 - 17:06:41), DDR PLL CRG+0x2c = 0x209b (the E setting)
The Xiongmai NBD8010S-KL-V2 NVR, sold as "Hi3536E", is a Hi3536DV100 die
(SCSYSID 0x3536D100). This makes it recoverable through the bootrom and
gives it a flash agent.
Agent (SOC=hi3536dv100). The memory map comes from vendor
arch-hi3536dv100/platform.h: UART0 PL011 at 0x12080000, FMC 0x10000000
with its window at 0x14000000, CRG 0x12040000, FMC clock gate in CRG48
(+0xC0), SP805 WDT 0x12070000, reboot via sysctl+4. The PL011 runs off
the fixed 24 MHz XTAL (CONFIG_PL011_CLOCK), so SET_BAUD reaches 921600
with no clock switching. That is unlike hi3520dv200 (#97), whose
bootrom leaves the UART on a ~2 MHz reference. This SoC has no SPI pad
block at 0x100C0000, and the vendor FMC driver never touches the pads,
so SPI_PINS_SKIP leaves them as the bootrom set them.
Variant hi3536dv100:nbd8010s. With the OpenIPC SPL, every bootrom stage
is ACKed but the jump to 0x81000000 resets the chip: fresh 0x20 markers,
then the stock U-Boot boots from flash. That looks like a successful
burn. The OpenIPC SPL's DDR/PLL table (222 entries) was built for
another board; this board's stock U-Boot has a different one (185
entries). The variant ships the stock SPL, flash bytes 0..0x5840. The
SPL code runs right up to the LZMA payload at 0x5840, so FILELEN grows
to 0x5840; the boundary scan would otherwise round down to 0x5800 and
cut its tail.
burn now honours SPL_BLOB. RecoverySession ignored it, so only the agent
paths used a variant's SPL. It now passes the blob as spl_override,
which lets
burn -c hi3536dv100:nbd8010sput the OpenIPC U-Boot in RAMon top of the board's own DDR init.
Verified on the NBD8010S-KL-V2 (W25Q128, ef4018, 16 MiB) with Tasmota
power cycling:
defib burn -c hi3536dv100:nbd8010s -p /dev/ttyUSB2 --power-cycle
-> "OpenIPC #", U-Boot 2010.06 (May 09 2026)
defib agent upload -c hi3536dv100:nbd8010s -p /dev/ttyUSB2 --power-cycle
-> Agent ready, RAM 0x80000000, Flash 16384KB
agent info: JEDEC ef4018, all capabilities
full-chip read in 256 KiB chunks at 921600: 86 KB/s, 0 retries,
CRC 0xaedae175, the same as stock U-Boot
sf read+crc32(whole chip and each of the 16 MiB slices)
agent scan: 256/256 sectors good
write a pattern to blank sector 0xF50000, read back bit-exact,
erase back to all-0xFF; neighbours and logo partition unchanged
Without the variant, agent upload never gets READY and burn ends in the
stock U-Boot. A single 16 MiB read stream at 921600 still drops one COBS
frame in ~10k (the known seq-gap failure); 256 KiB chunks are clean.