Realtek switch SoC docs

mango register: SPI_CTRL0

Details

Name
SPI_CTRL0
Offset
103c
Feature
INTERFACE

Description

SPI Controller register (0) default: 0x0006_8024

Fields

Name LSB Bits Description
RESERVED 26 6
DATA_WIDTH 17 9

SPI Command read/write data width

Note, val + 1, e.g. 0x000 = 1 byte, max is 512 bytes.

ADDR_WIDTH 14 3

External SPI slave address width

  • 0x0: 1 byte
  • 0x1: 2 byte
  • 0x2: 3 byte
  • 0x3: 4 byte
  • 0x4: None
  • 0x5 - 0xf: reserved
SPI_CLK_SEL 11 3

SPI Clock divider

clock = 250 MHz / div

  • 0x0: /4
  • 0x1: /6
  • 0x2: /8
  • 0x3: /16
  • 0x4: /125
  • 0x5: /160
  • 0x6: /200
  • 0x7: /250
GPIO_SPI_SEL 10 1

GPIO SPI Select

  • 0x0: GPIO08, GPIO09, GPIO10 are GPIO
  • 0x1: GPIO08 = SCK, GPIO09 = MISO, GPIO10 = MOSI
GPIO12_CSB1_SEL 9 1

GPIO12 Chip select choice

  • 0x0: GPIO
  • 0x1: CS#1
GPIO11_CSB0_SEL 8 1

GPIO11 Chip select choice

  • 0x0: GPIO
  • 0x1: CS#0
SPI_CPHA 7 1

Clock phase control

  • 0b0: rising clock edge
  • 0b1: falling clock edge
SPI_CPOL 6 1

Clock polarity control

  • 0b0: active high
  • 0b1: active low
SPI_TSLCH 3 3

SPI chip select setup time delay

(n + 1) * (250 MHz / 4)

SPI_TCHSH 0 3

SPI chip select active hold time

(n + 1) * (250 MHz / 4)