wolfBoot/tools
Daniele Lacamera c47135746a F-11032: bound the ACMD41 OCR readiness poll in SD card init
sdcard_card_full_init() polled ACMD41 in an unbounded do/while until
the card set OCR ready, so a card that answers every ACMD41 without
ever setting the bit held the bootloader in the loop forever. F-7984
bounded the separate DATA0/CMD13 waits in sdhci_wait_busy(); this is
the OCR readiness path, which still had no limit.

Bound the poll with the same shape as sdhci_wait_busy(): a
30000 ms budget (SDCARD_ACMD41_TIMEOUT_MS, #ifndef-able) measured
against hal_get_timer_us(), the watchdog serviced inside the loop,
and -1 returned to fail the SD boot path. A healthy card reports
ready in milliseconds, so the budget is far above any real
initialization time.

unit-sdhci-acmd41-timeout compiles the real driver (generated
sdhci_host.c, as in the wait-busy test) against a scripted
controller: commands complete without error, SRS12 is modeled
write-1-to-clear, and the card model sets OCR ready after a
configurable number of ACMD41 polls. A never-ready card must return
-1 inside the shipped budget (and service the watchdog); a card
ready after 5 polls must exit the loop promptly and proceed to the
end of the init path. A command-write cap turns the pre-fix infinite
loop into an abort instead of a hung build.

Verification:
- Built: gcc (host) unit-sdhci-acmd41-timeout with -DDISK_SDCARD:
  clean.
- Tested: unit-sdhci-acmd41-timeout 2/2; pre-fix the never-ready case
  aborted at the 50001st command (the loop never terminates); post-fix
  it runs 3001 polls, reaches the 30 s budget, pets the watchdog
  every iteration and returns -1.
- Pitfalls: the timeout returns -1 from the SD path, the same
  contract as a failed CMD0/CMD8; the budget is per init call, not
  shared with sdhci_wait_busy, and a card that becomes ready before
  the deadline is unaffected.
- Style: cstyle-check.sh FMT diff on src/sdhci.c byte-identical to
  the pre-change file; the new test is flag-free.
- Unverified: no SD card hardware execution.
- Message: F-11032: prefix, no co-author trailers.
2026-08-26 17:41:22 +02:00
..
armclang Remove obvious/redundant comments 2026-07-31 16:00:14 +02:00
bin-assemble renesas-rx: fix build for GCC RX 8.3/14.2 2026-07-30 15:32:31 +02:00
check_config
ci PolarFire SoC: LPDDR4 DDR init for MPFS250T Video Kit (M-Mode) 2026-08-03 12:27:22 +02:00
delta tools/delta: check pwrite result in bmpatch 2026-07-02 17:01:28 +02:00
efi efi: sign the x86_64_efi reference kernel with an authenticated HDR_CMDLINE 2026-08-10 21:03:50 +02:00
elf-parser
fdt-parser Add wolfBoot FIT support for loading bitstream 2026-06-09 15:30:27 +02:00
keytools F-6762: compare the TLV field budget in a 32-bit domain 2026-08-21 08:52:59 +02:00
lms
openocd Support for MAX32666 2026-07-31 14:33:56 +02:00
renode
sbom sbom: re-vendor wolfGlass at b44ae8d 2026-08-20 15:22:16 +02:00
scripts c2000: add wolfBoot TI C28x (TMS320F28P550SJ) secure-boot XIP port 2026-08-25 00:01:33 +02:00
squashelf add O_BINARY flag for msys2/windows builds 2026-08-11 08:35:12 -06:00
test-expect-version
test-update-server
tpm Address Copilot review comments 2026-06-09 15:52:07 +02:00
uart-flash-server F-5675: fix signed-overflow UB from uint8_t<<24 in serve_update version assembly 2026-06-11 18:53:49 +02:00
unit-tests F-11032: bound the ACMD41 OCR readiness poll in SD card init 2026-08-26 17:41:22 +02:00
xmss
config.mk Add support for auxillary algorithms and cert chain/TPM usage 2026-07-22 11:47:16 +02:00
test-delta.mk
test-enc.mk
test-renode.mk
test.mk lib/wolfssl: bump to ti_c25 merge (e71b086fc) for CHAR_BIT!=8 wide-byte support 2026-08-25 00:01:33 +02:00
wolfboot-rpi-devicetree.diff