Skip to content

arm: dts: hisilicon: hi3516dv300: register PL022 SSP controllers#38

Merged
widgetii merged 1 commit intoupstream-patchesfrom
fix/cv500-add-pl022-spi-nodes
May 7, 2026
Merged

arm: dts: hisilicon: hi3516dv300: register PL022 SSP controllers#38
widgetii merged 1 commit intoupstream-patchesfrom
fix/cv500-add-pl022-spi-nodes

Conversation

@widgetii
Copy link
Copy Markdown
Member

@widgetii widgetii commented May 7, 2026

Summary

Add `spi_bus0/1/2` nodes for the three PL022-compatible SSP controllers at `0x120c0000`/`0x120c1000`/`0x120c2000`. `CONFIG_SPI_PL022` is already enabled in the cv500_neo / av300_neo kernel configs, but without DT nodes nothing instantiates the driver, `/sys/class/spi_master/` stays empty, and the vendor `open_sensor_spi.ko` refuses to load:

```
modprobe: can't load module open_sensor_spi: No such device or address
(NULL device *): spi_busnum_to_master() error!
```

Children (sensor SPI, codec SPI, etc.) are bound at runtime by the OSAL stack — only the master nodes are needed here.

Periphid override

HiSilicon's PL022 hardware reports periphid `0x00800022`, which the mainline pl022 driver doesn't recognise (it expects `0x00041022` for the standard ARM variant). We override via `arm,primecell-periphid = <0x00041022>` — the register layout is compatible enough that the driver binds cleanly and the SPI master comes up. Without the override, the AMBA bus reads the hardware ID and no driver matches.

Reads clock IDs from the existing `dt-bindings/clock/hi3516dv300-clock.h` (SPI0_CLK=48, SPI1_CLK=49, SPI2_CLK=54) and SPI shared-peripheral IRQs from the vendor 4.9 DTSI (68/69/70).

Verified on hardware

hi3516av300 + IMX415:

```
$ ls /sys/class/spi_master/
spi0 spi1 spi2

$ dmesg | grep ssp-pl022
ssp-pl022 120c0000.spi: ARM PL022 driver, device ID: 0x00041022
ssp-pl022 120c0000.spi: mapped registers from 0x120c0000 to (ptrval)
ssp-pl022 120c1000.spi: ARM PL022 driver, device ID: 0x00041022
ssp-pl022 120c2000.spi: ARM PL022 driver, device ID: 0x00041022

$ dmesg | grep sensor_spi
load sensor_spi.ko for Hi3516CV500...OK !
```

Affects: hi3516av300, hi3516cv500, hi3516dv300 boards using this DTSI.

Fixes: OpenIPC/firmware#2069

🤖 Generated with Claude Code

Add spi_bus0/1/2 nodes for the three PL022-compatible SSP controllers
at 0x120c0000/0x120c1000/0x120c2000. CONFIG_SPI_PL022 is already
enabled in the cv500_neo / av300_neo kernel configs, but without DT
nodes nothing instantiates the driver, /sys/class/spi_master/ stays
empty, and the vendor open_sensor_spi.ko refuses to load:

  modprobe: can't load module open_sensor_spi: No such device or address
  (NULL device *): spi_busnum_to_master() error!

Children (sensor SPI, codec SPI, etc.) are bound at runtime by the
OSAL stack — we only need the master nodes registered here. Reads
clock IDs from the existing dt-bindings/clock/hi3516dv300-clock.h
(SPI0_CLK=48, SPI1_CLK=49, SPI2_CLK=54) and SPI shared-peripheral
IRQs from the vendor 4.9 DTSI (68/69/70).

Affects: hi3516av300, hi3516cv500, hi3516dv300 boards using this DTSI.

Fixes: OpenIPC/firmware#2069
@widgetii widgetii merged commit c329c5f into upstream-patches May 7, 2026
@widgetii widgetii deleted the fix/cv500-add-pl022-spi-nodes branch May 7, 2026 12:23
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.

2 participants