Skip to content

gk710x: SD recovery, boot-image swap in the flash driver, eFuse table as on cameras - #45

Merged
dimerr merged 8 commits into
openipc-gk710xfrom
gk710x/c-ephy
Oct 20, 2026
Merged

dimerr merged 8 commits into
openipc-gk710xfrom
gk710x/c-ephy

Conversation

@dimerr

@dimerr dimerr commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator
  • gk_sflash: the chip-order boot image is swapped in the driver, on write and read, for every caller (cmd/sf.c is mainline again). sf read of U-Boot gives the release file byte for byte, so SD recovery's already-on-flash check matches U-Boot too.
  • net: designware: no PHY means no network, not a data abort and reset loop. Seen on a GK7102C camera without Ethernet.
  • openipc: eFuse lines of the GK7101/GK7102 ROM table as three field GK7102 dumps have them: no write to 0x6000B100, and a wait for 0x6000B104 == 3. A GK7102 (rb ov9712, GD25Q128) did not start with the SDK's lines. The GK7102 header is now word for word that camera's. qemu doesn't model the eFuse block, so silicon has to confirm.
  • openipc: common/openipc.c as on openipc-hisilicon, with the generic recovery (the openipc-hisilicon PR from recovery/wrapper-payload).
  • gk710x: SD card: SDHCI on GK7101/GK7102, and the vendor-layout controller on GK710xS through a register table from the S HAL. Also SD pins, MMC/FAT, and LTO to stay within 256 KiB.

Tested in qemu-hisilicon gk7102 and gk7102s (on a GK7102C dump), with the qemu-hisilicon SD model PR: two boots with the card left in. U-Boot, kernel and rootfs were written, then found already on the flash; bad images were skipped; both boots reached login.

The boot ROM reads the boot image as raw chip bytes, while the
controller packs every word MSB first: whatever goes through it comes
back as it went in, but lands on the chip byte-swapped. The release
image is in chip order, and cmd/sf.c swapped it back before sf write
or sf update. Any other writer (SD recovery, spi_flash_write() from
anywhere) put it on the flash swapped twice, and every reader saw the
boot image in the controller's order rather than as the file.

Move it into gk_sflash.c, for every caller, both ways: from offset 0 to
the end of the boot image (its header table plus the U-Boot length the
header gives) data is swapped on write and on read. The window is the
image found at offset 0 at probe; a write at 0 that starts with the
swapped magic opens it as long as that image, however the caller
splits the rest, and any other write at 0 closes it. The table is
walked entry by entry, as a register value of 0 is not its end.
cmd/sf.c is mainline's again.

Under qemu-hisilicon gk7102 and gk7102s: the image written by SD
recovery at 0 is byte-for-byte the release file on the flash and
boots; sf read of it gives the file's CRC32; on the next boot the
"already on the flash" check matches it.
On a GK7102C camera with no Ethernet, designware_initialize() finds no
PHY ("Could not get PHY for dwmac.9000e000") and leaves phydev NULL.
The first network command (the fwupd/recovery flow) then dereferenced it
in designware_eth_init() and _dw_eth_halt(): a data abort and a reset
loop.

Fail eth init with -ENODEV and skip phy_shutdown() when there is no PHY.

The qemu-hisilicon machines always have the PHY, so this ran only in
the boots where it does nothing (gk7102 and gk7102s to login).
A GK7102 camera (rb ov9712, GD25Q128) did not start with our U-Boot.
Its own boot header, and those of two more GK7102 flash dumps (vendor
U-Boots of 2016 and 2017), differ from the SDK prebuilts' in the eFuse
lines only: they never write 0xFF39C119 to 0x6000B100, and after
starting the eFuse load (0x6000B104 = 1) they wait for it to finish
(0x6000B104 == 3). Do the same in both tables.

The GK7102 header is now word for word that camera's: header words
and all 62 table entries. qemu-hisilicon does not model the eFuse
block, so silicon has to confirm it. GK7101 follows the same SDK
change; no GK7101 field dump is at hand.
…ecovery

The file is meant to be the same on every branch; this one had drifted
from openipc-hisilicon's. Take that one, together with the recovery
change proposed there (OpenIPC/u-boot recovery/wrapper-payload), so the
two are byte for byte the same:

- script.txt on the card or stick still runs first;
- otherwise every *.img in its root, in directory order, that is a
  valid uImage (magic, header CRC, data CRC) whose load address and
  size fit the flash, on an erase boundary, gets its payload written
  there -- never the wrapper header. That covers U-Boot at 0 as well;
- an image already on the flash is skipped, and the boot goes on;
- the split firmware.bin path and the per-name lookups are gone; the
  NAND path is as it was.

It builds here only with CONFIG_MMC, which the next commit enables.
A GK7102C camera has no Ethernet, so TFTP recovery cannot bring it
back; the SD card can (common/openipc.c).

- arch/arm/mach-gk710x/sdhci.c: GK7101/GK7102 have a standard SDHCI at
  0x60002000. The GK710xS has it at 0x90000000 in the vendor halfword
  layout, with registers moved and bits swapped; the accessors map
  every SDHCI register through a table taken from the S HAL. The
  version reads SDHCI_SPEC_200, and the base clock comes from the RCT
  SD PLL and scaler.
- gpio_map.c: also set the map's SD pins and SD power pin.
- openipc_config: MMC, SDHCI, DOS partitions, FAT; LTO and a few unused
  commands off to stay in the 256 KiB boot partition (gk7101/gk7102
  231892, gk7101s 222548, gk7102s 222808 bytes).

Under qemu-hisilicon gk7102 and gk7102s (the latter on a GK7102C flash
dump), from an MBR + FAT32 card, two boots with the card left in: the
U-Boot, kernel and rootfs images are written at their load addresses
and boot to login; a bad data CRC, a non-uImage, an image past the
flash end and one off an erase boundary are skipped; on the second
boot all three are already on the flash and the saved environment
loads.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Enable GK710x SD recovery and correct boot-image flash handling

✨ Enhancement 🐞 Bug fix ⚙️ Configuration changes 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Enable SD-card recovery across GK710x variants, including pin setup and validated flash images.
• Make boot-image reads and writes byte-consistent for every flash caller.
• Prevent PHY-less crashes and align eFuse initialization with camera dumps.
Diagram

graph TD
  card["SD card"] --> pins["SD pins"] --> sdhci["SDHCI adapter"] --> recovery["Recovery validation"] --> flash["Flash byte order"] --> nor[("SPI NOR")]
  nor --> rom["Boot ROM"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Dedicated GK710xS MMC driver
  • ➕ Could express vendor-register semantics directly without a translation table.
  • ➖ Duplicates SDHCI command and transfer handling and creates a second path to maintain.
2. Swap boot images in recovery and sf callers
  • ➕ Avoids changing the flash driver's read and write contract.
  • ➖ Misses other flash callers and leaves reads inconsistent with release images.

Recommendation: Keep the SDHCI-accessor translation and driver-level byte-order handling: both reuse existing interfaces while covering all callers. Review the vendor register mappings and boot-image window against physical hardware before relying on recovery in the field.

Files changed (13) +841 / -139

Enhancement (4) +693 / -94
gk710x.hDefine die-specific SD register addresses +6/-2

Define die-specific SD register addresses

• Adds SD controller, PLL, and scaler addresses for both die layouts. Removes the obsolete flash-order helper declaration after moving that behavior into the driver.

arch/arm/mach-gk710x/include/mach/gk710x.h

sdhci.cAdd standard and vendor-layout SDHCI support +296/-0

Add standard and vendor-layout SDHCI support

• Registers an MMC host using the SD PLL clock. GK710xS uses mapped register and bit accessors to run the shared SDHCI driver against its vendor layout.

arch/arm/mach-gk710x/sdhci.c

gpio_map.cConfigure mapped SD and power pins +30/-6

Configure mapped SD and power pins

• Applies SD functions and the selected map's SD power pin during U-Boot initialization while leaving unrelated pins in their boot-ROM state.

board/goke/gk710x/gpio_map.c

openipc.cGeneralize and validate NOR recovery +361/-86

Generalize and validate NOR recovery

• Searches FAT media for wrapped recovery images, validates headers, bounds and CRCs, and skips payloads already on flash. Also restores the filesystem selection between calls and improves firmware scanning and split-layout environment handling.

common/openipc.c

Bug fix (4) +105 / -31
gk_sflash.cNormalize boot-image byte order inside the flash driver +85/-24

Normalize boot-image byte order inside the flash driver

• Detects the boot-image span at probe or on a write at offset zero, then swaps its words on both reads and writes. This makes flash reads match chip-order release files without changing other flash contents.

drivers/mtd/spi/gk_sflash.c

designware.cHandle DesignWare devices without a PHY +6/-1

Handle DesignWare devices without a PHY

• Returns a no-device error during Ethernet initialization when no PHY exists and avoids shutting down a null PHY during halt.

drivers/net/designware.c

gk7101.rvsAlign GK7101 eFuse setup with camera tables +7/-3

Align GK7101 eFuse setup with camera tables

• Removes the SDK's eFuse register write and waits for the load-complete value after starting the eFuse load.

openipc/gk7101.rvs

gk7102.rvsAlign GK7102 eFuse setup with camera tables +7/-3

Align GK7102 eFuse setup with camera tables

• Removes the SDK's eFuse register write and adds the completion poll observed in field-camera boot headers.

openipc/gk7102.rvs

Refactor (1) +0 / -9
sf.cRemove sf-command-specific boot-image swapping +0/-9

Remove sf-command-specific boot-image swapping

• Returns the SPI flash command to its generic behavior now that the Goke flash driver handles byte order for every caller.

cmd/sf.c

Documentation (1) +19 / -4
CLAUDE.mdDocument SD recovery and boot-image behavior +19/-4

Document SD recovery and boot-image behavior

• Describes SD support on both controller layouts, the flash driver's read-side byte swap, and the camera-derived eFuse sequence.

CLAUDE.md

Other (3) +24 / -1
KconfigSelect SDHCI I/O accessors for GK710xS +1/-0

Select SDHCI I/O accessors for GK710xS

• Enables custom SDHCI register accessors when MMC SDHCI is configured on the vendor-layout die.

arch/arm/mach-gk710x/Kconfig

MakefileBuild the GK710x SD controller support +1/-0

Build the GK710x SD controller support

• Includes the new controller integration when MMC SDHCI is enabled.

arch/arm/mach-gk710x/Makefile

openipc_configEnable SD recovery within the boot partition +22/-1

Enable SD recovery within the boot partition

• Enables MMC, SDHCI, FAT and partition support. Adds LTO and disables unused commands to accommodate recovery in the 256 KiB boot partition.

openipc/openipc_config

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. A large recovery script corrupts U-Boot ✓ Resolved
Description
recovery_run_script passes the card-controlled script.txt size to rfs_read at
CONFIG_SYS_LOAD_ADDR without checking the available RAM. Enabling MMC recovery makes this read run
during GK710x startup, where a sufficiently large file can overwrite live U-Boot memory before the
script is executed.
Code

openipc/openipc_config[R83-88]

+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+# CONFIG_MMC_HW_PARTITIONING is not set
+CONFIG_CMD_MMC=y
+CONFIG_DOS_PARTITION=y
+CONFIG_FS_FAT=y
Evidence
MMC and FAT are newly enabled; the board's late initialization calls openipc_helper, which invokes
recovery and reads script.txt first. The FAT read receives the entire file size without a
destination bound, whereas the new NOR image path explicitly checks against the stack.

openipc/openipc_config[83-89]
board/goke/gk710x/gk710x.c[27-32]
common/openipc.c[533-551]
common/openipc.c[580-600]
common/openipc.c[449-455]
common/openipc.c[973-980]
fs/fs.c[578-612]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SD recovery now reaches an unbounded `script.txt` read at boot, allowing an oversized file to overwrite live U-Boot memory.
## Fix Focus Areas
- common/openipc.c[533-539]
- common/openipc.c[449-455]
- openipc/openipc_config[83-88]
## Recommended Fix
Before reading the script, reject sizes exceeding the free RAM above `CONFIG_SYS_LOAD_ADDR`, using the same stack-aware bound as the NOR image recovery path.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Existing FIT recovery cards are skipped 🐞 Bug ≡ Correctness
Description
recovery_write_img now requires every .img file to have a valid uImage header and skips a raw
FIT image. Cards carrying the previously supported fitImage..img format therefore no longer
recover the kernel, although the ordinary uk update command still accepts FIT images.
Code

common/openipc.c[R426-430]

+  if (size <= (loff_t)sizeof(hdr) ||
+      rfs_read(name, (ulong)&hdr, 0, sizeof(hdr), &actread) ||
+      actread != sizeof(hdr) || !image_check_magic(&hdr) ||
+      !image_check_hcrc(&hdr)) {
+    printf("Recovery: %s is not a uImage, skipped\n", name);
Evidence
The removed recovery branch explicitly accepted an FDT/FIT header for kernel recovery and searched
for fitImage..img if the uImage was absent. The replacement iterates .img files but returns
before writing any whose first bytes are not a uImage header; the standard update command continues
to offer FIT.

common/openipc.c[426-444]
common/openipc.c[489-519]
include/configs/openipc-common.h[87-92]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new wrapper-only image check drops support for raw FIT recovery cards accepted by the previous recovery flow.
## Fix Focus Areas
- common/openipc.c[426-444]
- common/openipc.c[489-519]
## Recommended Fix
Recognize the legacy FIT recovery filename and validate its FIT header, then write it at the configured kernel address with the same flash and RAM bounds used for wrapped images. Retain the wrapper validation for other `.img` files.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Failed scripts block image recovery 🐞 Bug ≡ Correctness
Description
recovery_run_script records the command result in ret but returns success regardless of whether
execution failed. With SD recovery now enabled, a failing script.txt on the card stops the
subsequent *.img search and is reported as completed recovery.
Code

openipc/openipc_config[R83-88]

+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+# CONFIG_MMC_HW_PARTITIONING is not set
+CONFIG_CMD_MMC=y
+CONFIG_DOS_PARTITION=y
+CONFIG_FS_FAT=y
Evidence
The newly enabled MMC path selects recovery during boot. recovery_run_script assigns ret from
run_command or run_command_list but unconditionally returns 1; recovery_try returns
immediately on that value, before recovery_images can run.

openipc/openipc_config[83-89]
common/openipc.c[524-556]
common/openipc.c[559-575]
common/openipc.c[580-600]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A failed SD recovery script is treated as successful and prevents image recovery.
## Fix Focus Areas
- common/openipc.c[524-556]
- common/openipc.c[559-575]
- openipc/openipc_config[83-88]
## Recommended Fix
Propagate script execution and read failures distinctly from successful execution and an absent script; ensure `recovery_try` does not report a failed script as successful recovery.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Restoring a whole-chip dump now corrupts the firmware ✓ Resolved
Description
gk_sf_write now swaps only the words below sf_swap_end (the boot header table plus U-Boot). The
removed gk_sflash_boot_order() used to swap the whole buffer whenever it started with the swapped
magic. So when a raw camera dump or programmer image of the whole chip goes through sf write/`sf
update` at 0, or through an SD-recovery uImage at load address 0, the boot image lands correctly but
the environment, kernel and rootfs that follow are written swapped twice and no longer read back. In
the same way, sf read of the whole chip now returns a mix: the boot span in chip order and the
rest in controller order, which is neither a dump nor a CPU-order image.
Code

drivers/mtd/spi/gk_sflash.c[R279-281]

+		for (i = 0; i < span && addr + i < sf_swap_end; i += 4)
+			put_unaligned_le32(swab32(get_unaligned_le32(page + i)),
+					   page + i);
Evidence
CLAUDE.md says that only a raw dump or programmer image of the whole chip is swapped, and that every
other region sits in CPU order through the drivers, so a dump holds swab(file) for the kernel and
rootfs. The old code (cmd/sf.c plus gk_sflash_boot_order, both removed in this PR) swapped the
entire len, so such a dump went back onto the chip byte for byte. The new loop at gk_sflash.c:279
stops at sf_swap_end, which sf_boot_len limits to the header plus nwords of U-Boot. Recovery's
recovery_write_img also advertises writing "a whole firmware" at its load address, and that write
goes through the same path.

CLAUDE.md[109-136]
drivers/mtd/spi/gk_sflash.c[182-215]
drivers/mtd/spi/gk_sflash.c[258-292]
common/openipc.c[415-479]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A whole-chip dump in chip order (starting with the swapped boot magic) written at offset 0 now gets only its boot-image span swapped. Everything after it lands swapped twice. Before this PR the whole buffer was swapped, and restoring a dump worked.
## Fix Focus Areas
- drivers/mtd/spi/gk_sflash.c[208-215]
- drivers/mtd/spi/gk_sflash.c[279-281]
- CLAUDE.md[122-133]
## Recommended Fix
In `sf_swap_detect`, when a write at 0 starts with the swapped magic and `len` is larger than the boot image (for example, it covers past `CONFIG_ENV_OFFSET` or the whole chip), set the swap span for this write to the full `len`, as the old code did. Keep the persistent read window at the boot-image length. If that is not wanted, print a clear warning or refuse the write. Document the chosen behaviour in CLAUDE.md.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View review recommended (1)
5. SD pin set-up drives pins on boards whose map is unconfirmed ✓ Resolved
Description
gk_gpio_map_apply now configures every pin in the selected map whose type is an SD function, plus
the map's sd_power pin (driven as output_1). It does this even when gpiomap is unset and the
map is only the default guess ('v2'). On a v1 board those v2 SD pins (39, 41-47) are the v1 PWM
pins, the v1 phy_reset (41) and the external-PHY txd_1 (46), so U-Boot now drives them as SD
lines and powers pin 46 high, which the existing comment says the code deliberately avoided.
Code

board/goke/gk710x/gpio_map.c[R550-553]

+	for (i = 0; i < m->npins; i++)
+		if (gk_gpio_is_sd(m->pins[i].type) ||
+		    m->pins[i].pin == m->sd_power)
+			gk_gpio_config(m->pins[i].pin, m->pins[i].type);
Evidence
The v2 map lists pins 39 and 41-47 as SD functions, with pin 46 as output_1
(SDIO_CARD_POWER_EN). The v1 map uses 41 as phy_reset, 39/40/42/45 as PWM, and 46 as an input or
enet txd_1. gk_map() falls back to 'v2' when gpiomap is unset. The comment above
gk_gpio_map_apply says the map is a guess until gpiomap is set, which is why only pin 48 used to
be touched.

board/goke/gk710x/gpio_map.c[71-79]
board/goke/gk710x/gpio_map.c[170-187]
board/goke/gk710x/gpio_map.c[429-452]
board/goke/gk710x/gpio_map.c[500-509]
board/goke/gk710x/gpio_map.c[512-555]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The SD pins and the SD power pin are configured from the default (guessed) GPIO map even when `gpiomap` is unset. On a v1 board this drives the PHY reset, PWM and PHY data pins.
## Fix Focus Areas
- board/goke/gk710x/gpio_map.c[542-555]
- board/goke/gk710x/gpio_map.c[500-509]
## Recommended Fix
Only apply the SD pins (and the `sd_power` output) when `env_get("gpiomap")` is set, or when the default map is known to be correct for the target (for example the 'c' map on GK7102S). Otherwise apply them lazily just before SD recovery. Update the comment to match.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can open the rule or relationship behind a finding in one click

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread openipc/openipc_config
Comment thread common/openipc.c
Comment thread openipc/openipc_config
Comment on lines +83 to +88
CONFIG_MMC=y
CONFIG_MMC_SDHCI=y
# CONFIG_MMC_HW_PARTITIONING is not set
CONFIG_CMD_MMC=y
CONFIG_DOS_PARTITION=y
CONFIG_FS_FAT=y

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

3. Failed scripts block image recovery 🐞 Bug ≡ Correctness

recovery_run_script records the command result in ret but returns success regardless of whether
execution failed. With SD recovery now enabled, a failing script.txt on the card stops the
subsequent *.img search and is reported as completed recovery.
Agent Prompt
## Issue description
A failed SD recovery script is treated as successful and prevents image recovery.
## Fix Focus Areas
- common/openipc.c[524-556]
- common/openipc.c[559-575]
- openipc/openipc_config[83-88]
## Recommended Fix
Propagate script execution and read failures distinctly from successful execution and an absent script; ensure `recovery_try` does not report a failed script as successful recovery.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partly by design: when script.txt is present, the card author has chosen a script over the images, so a failed script still ends recovery. It is now reported as failed (9e09c42).

Comment thread drivers/mtd/spi/gk_sflash.c Outdated
Comment thread board/goke/gk710x/gpio_map.c Outdated
dimerr added a commit that referenced this pull request Oct 20, 2026
…iled script

- script.txt was read to CONFIG_SYS_LOAD_ADDR whatever its size; one
  larger than the free RAM below the stack would have run over U-Boot.
  It now gets the same bound as the images (recovery_ram_room()).
- a uImage wrapper with a data size of 0 passed every check and was
  then read with length 0, which the FAT read takes as "the rest of the
  file", past the RAM bound. It is skipped now.
- a script that fails is reported as failed. It still ends recovery:
  the card author chose a script over the images.

Under qemu-hisilicon gk7102: a 0-length wrapper in front of 2 MiB is
"has no data, skipped", and the rest of the card recovers as before.

Reported by Qodo on #44, #45 and #46.
…iled script

- script.txt was read to CONFIG_SYS_LOAD_ADDR whatever its size; one
  larger than the free RAM below the stack would have run over U-Boot.
  It now gets the same bound as the images (recovery_ram_room()).
- a uImage wrapper with a data size of 0 passed every check and was
  then read with length 0, which the FAT read takes as "the rest of the
  file", past the RAM bound. It is skipped now.
- a script that fails is reported as failed. It still ends recovery:
  the card author chose a script over the images.

Under qemu-hisilicon gk7102: a 0-length wrapper in front of 2 MiB is
"has no data, skipped", and the rest of the card recovers as before.

Reported by Qodo on #44, #45 and #46.
The window swapped on write is the boot image's span. A programmer's
whole-chip dump written in one go at 0 (sf write, or a recovery image at
0) is in chip order throughout, so everything past U-Boot -- env, kernel,
rootfs -- landed swapped twice. A write at 0 that starts with the
swapped magic is now swapped over its whole length when it is longer
than the boot image, as cmd/sf.c did before. The read window stays the
boot image.

Under qemu-hisilicon gk7102: a recovery image holding a 16 MiB GK7102
camera dump, at 0, leaves the flash byte for byte the dump.

Reported by Qodo on #45.
The SD pins came from the default map even with gpiomap unset. On the
GK7101/GK7102 that default (v2) is a guess, and its SD pins are a v1
board's PHY reset, audio clock and external-PHY data lines -- v1 boards
have no SD. They are now set on the GK710xS, which has one map, and on
the GK7101/GK7102 once gpiomap names the board's. CLAUDE.md: what a
whole-chip dump through sf write, sf update and sf read comes to.

Reported by Qodo on #45.
dimerr added a commit that referenced this pull request Oct 20, 2026
…iled script

- script.txt was read to CONFIG_SYS_LOAD_ADDR whatever its size; one
  larger than the free RAM below the stack would have run over U-Boot.
  It now gets the same bound as the images (recovery_ram_room()).
- a uImage wrapper with a data size of 0 passed every check and was
  then read with length 0, which the FAT read takes as "the rest of the
  file", past the RAM bound. It is skipped now.
- a script that fails is reported as failed. It still ends recovery:
  the card author chose a script over the images.

Under qemu-hisilicon gk7102: a 0-length wrapper in front of 2 MiB is
"has no data, skipped", and the rest of the card recovers as before.

Reported by Qodo on #44, #45 and #46.
@dimerr
dimerr merged commit ee357e8 into openipc-gk710x Oct 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant