Skip to content

Keep EEPROM chunks within the requested data range - #312

Open
lionelZhaowy wants to merge 1 commit into
pulp-platform:mainfrom
lionelZhaowy:fix/eeprom-chunk-progress
Open

lionelZhaowy wants to merge 1 commit into
pulp-platform:mainfrom
lionelZhaowy:fix/eeprom-chunk-progress

Conversation

@lionelZhaowy

Copy link
Copy Markdown

The EEPROM HAL can process more bytes than the caller requests. An initial unaligned chunk ignores the remaining length. The write helper also sends a later final byte, then advances its recursive buffer/address by the full length instead of the transmitted half.

Return immediately for zero length. Bound each read/write chunk by the remaining request and its FIFO-aligned boundary. Advance by the actual transmitted length. Send contiguous write data in half-FIFO chunks without the recursive skip.

Keep control-byte encoding, STOP flags, and completion waits unchanged. Those issues are independent contributions.

Validation used official Cheshire 6c6dd5e834347f72c7be31cd6c41021ec293c5b9 and its locked actual I2C DIF cd3153de2783abd3d03d0595e6c4b32413c62f14. The same host test compiled and executed the real HAL and DIF with their instrumented MMIO boundary.

  • 100 cases: read/write, addresses 0/1/31/63/127, and lengths 0/1/31/32/33/63/64/65/128/129.
  • Original: 2108 request/data/guard errors.
  • Patch: zero errors.
  • Checks: complete payload and guards, exact write length, contiguous segment addresses, zero-length MMIO inactivity, FIFO capacity, and 128-byte write-page boundaries.
  • GCC -std=gnu11 -O2 -Wall -Wextra -Werror: no warnings.

Public commands and test adapters are in sw/tests/host/EEPROM_CHUNKS.md. The test supplies scripted FIFO responses and a CLINT callback. It checks software progress only. It does not claim EEPROM/controller RTL, STOP completion, or physical timing verification. No EEPROM model is included.

AI assistance: OpenAI Codex assisted implementation, test, and validation. A separate AI review checked the actual changes and results. This was not a human review.

AI assistance: OpenAI Codex assisted implementation and validation.

This branch has not been deployed

No deployments
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