A dual SPI flash controller ASIC that acts between hosts and flash memory chips, providing address-based routing and runtime configuration for flash redundancy and load balancing.
The Flash RAID Controller sits transparently between SPI hosts and two SPI flash chips, intelligently routing read operations based on programmable address ranges while maintaining complete SPI protocol compatibility.
In SHARE mode, the controller analyzes SPI read commands (0x03, 0x0B) and compares the 24-bit address against two programmable ranges:
Write operations always use the default flash selection to prevent data corruption from misconfigured ranges.
A dedicated SPI slave interface provides runtime configuration through 14 registers (0x00-0x0D):
The management interface uses a 14-register map accessed via SPI commands 0x02 (write) and 0x03 (read):
Address | Register | R/W | Description | Default |
---|---|---|---|---|
0x00 | ADDR0_START_H | R/W | Range 0 Start Address [23:16] | 0x00 |
0x01 | ADDR0_START_M | R/W | Range 0 Start Address [15:8] | 0x00 |
0x02 | ADDR0_START_L | R/W | Range 0 Start Address [7:0] | 0x00 |
0x03 | ADDR0_END_H | R/W | Range 0 End Address [23:16] | 0xFF |
0x04 | ADDR0_END_M | R/W | Range 0 End Address [15:8] | 0xFF |
0x05 | ADDR0_END_L | R/W | Range 0 End Address [7:0] | 0xFF |
0x06 | ADDR1_START_H | R/W | Range 1 Start Address [23:16] | 0x00 |
0x07 | ADDR1_START_M | R/W | Range 1 Start Address [15:8] | 0x00 |
0x08 | ADDR1_START_L | R/W | Range 1 Start Address [7:0] | 0x00 |
0x09 | ADDR1_END_H | R/W | Range 1 End Address [23:16] | 0xFF |
0x0A | ADDR1_END_M | R/W | Range 1 End Address [15:8] | 0xFF |
0x0B | ADDR1_END_L | R/W | Range 1 End Address [7:0] | 0xFF |
0x0C | CONTROL_REG | R/W | Control Register | 0x00 |
0x0D | STATUS_REG | R | Status Register | 0x00 |
00
: MAIN - Only main flash active01
: SECONDARY - Only secondary flash active10
: SHARE - Both flashes active, address-based MISO selection11
: ReservedManagement Setup: Connect SPI master to management interface (pins: mgmt_sclk, mgmt_cs_n, mgmt_mosi, mgmt_miso)
Configure Address Ranges:
# Example: Split 16MB flash - first 8MB to main, second 8MB to secondary
Write 0x00-0x02: 0x00, 0x00, 0x00 (Range0 start: 0x000000)
Write 0x03-0x05: 0x7F, 0xFF, 0xFF (Range0 end: 0x7FFFFF)
Write 0x06-0x08: 0x80, 0x00, 0x00 (Range1 start: 0x800000)
Write 0x09-0x0B: 0xFF, 0xFF, 0xFF (Range1 end: 0xFFFFFF)
Write 0x0C: 0x2E (SHARE mode + both ranges enabled + Range1→secondary)
Test Address Routing:
SPI Flash Chips (2x):
SPI Host Controller:
Management Controller (Optional but recommended):
Main Host Interface: ui[0] (main_host_sclk) → Host SPI Clock ui[1] (main_host_cs_n) → Host SPI Chip Select# ui[2] (main_host_mosi) → Host SPI MOSI (Data Out) uo[0] (main_host_miso) → Host SPI MISO (Data In)
Secondary Host Interface: ui[3] (secondary_host_sclk) → Secondary Host SPI Clock ui[4] (secondary_host_cs_n) → Secondary Host SPI Chip Select# ui[5] (secondary_host_mosi) → Secondary Host SPI MOSI (Data Out) uo[1] (secondary_host_miso) → Secondary Host SPI MISO (Data In)
Management Interface: ui[6] (mgmt_sclk) → Management SPI Clock ui[7] (mgmt_cs_n) → Management SPI Chip Select# uio[0] (mgmt_mosi) → Management SPI MOSI (Data Out) uo[2] (mgmt_miso) → Management SPI MISO (Data In)
Main Flash Connection: uo[3] (main_flash_sclk) → Main Flash SPI Clock uo[4] (main_flash_cs_n) → Main Flash SPI Chip Select# uo[5] (main_flash_mosi) → Main Flash SPI MOSI (Data In) uio[1] (main_flash_miso) → Main Flash SPI MISO (Data Out)
Secondary Flash Connection: uo[6] (secondary_flash_sclk) → Secondary Flash SPI Clock uo[7] (secondary_flash_cs_n) → Secondary Flash SPI Chip Select# uio[3] (secondary_flash_mosi) → Secondary Flash SPI MOSI (Data In) uio[2] (secondary_flash_miso) → Secondary Flash SPI MISO (Data Out) uio[4] (secondary_flash_wp_n) → Secondary Flash Write Protect# (tied high)
A complete test setup might include:
# | Input | Output | Bidirectional |
---|---|---|---|
0 | main_host_sclk | main_host_miso | mgmt_mosi |
1 | main_host_cs_n | secondary_host_miso | main_flash_miso |
2 | main_host_mosi | mgmt_miso | secondary_flash_miso |
3 | secondary_host_sclk | main_flash_sclk | secondary_flash_mosi |
4 | secondary_host_cs_n | main_flash_cs_n | secondary_flash_wp_n |
5 | secondary_host_mosi | main_flash_mosi | |
6 | mgmt_sclk | secondary_flash_sclk | |
7 | mgmt_cs_n | secondary_flash_cs_n |