Skip to content

earlgrey: Add SPI Device driver and SFDP support - #411

Open
anthonychen1251 wants to merge 4 commits into
OpenPRoT:earlgrey-hwefrom
anthonychen1251:support-spi-device
Open

earlgrey: Add SPI Device driver and SFDP support#411
anthonychen1251 wants to merge 4 commits into
OpenPRoT:earlgrey-hwefrom
anthonychen1251:support-spi-device

Conversation

@anthonychen1251

Copy link
Copy Markdown

This PR adds the OpenTitan SPI Device (spi_device) driver into OpenPRoT, adds JESD216 SFDP table generation support, integrates the spidev service process into the Earlgrey HWE firmware, and adds an end-to-end (E2E) integration test on FPGA using opentitanlib.

- Implements the SpiDev driver using ureg RegisterBlock representation.
- Provides configure_cmd_info for hardware opcode intercept slots (SFDP,
  JEDEC ID, Read, Program, Erase).
- Configures intercept_en, jedec_cc, jedec_id, addr_mode, and SRAM
  egress buffer.
- Provides set_sfdp, write_to_mbx, poll, retire_cmd, and read_addr_swap.
- Adds single-process driver smoke test validating register and SRAM
  egress state.

Signed-off-by: Anthony Chen <antchen@google.com>
…ation

- Adds create_default_sfdp_table in util/sfdp generating standard
  JESD216 compliant SFDP headers and basic flash parameters table.
- Re-exports SFDP generation in earlgrey_spi_device driver.
- Adds unit test validating default SFDP table parsing with
  SfdpReader.

Signed-off-by: Anthony Chen <antchen@google.com>
- Implements the spidev process in HWE firmware.
- Configures SpiDev in Flash mode with Google JEDEC ID and standard
  JESD216 SFDP table in SRAM egress buffer.
- Hooks up spidev process and logger_spidev IPC channel in system.json5
  and logmgr.rs.
- Adds spidev process to multi_process_app in BUILD.bazel.

Signed-off-by: Anthony Chen <antchen@google.com>
- Adds host_spidev_check host harness using opentitanlib to query the
  SPI device over the SPI interface (BOOTSTRAP):
  - Validates Opcode 0x9F (Read JEDEC ID) returning 8x continuation
    codes 0x7F, Google Manf ID 0x26, and Device ID 0x1731.
  - Validates Opcode 0x5A (Read SFDP) returning JESD216 signature 'SFDP'
    and basic flash parameter tables.
- Adds spidev_hyper340_test executing on CW340 targeting hwe_firmware.

Signed-off-by: Anthony Chen <antchen@google.com>
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