Skip to content

Align ADSP SC5XX DTS and drivers with Linux - #110

Open
jiez wants to merge 18 commits into
adi-u-boot-2025.10.yfrom
adsp-sc5xx-of-upstream
Open

Align ADSP SC5XX DTS and drivers with Linux#110
jiez wants to merge 18 commits into
adi-u-boot-2025.10.yfrom
adsp-sc5xx-of-upstream

Conversation

@jiez

@jiez jiez commented Jun 24, 2026

Copy link
Copy Markdown

Most of the commits in this pull request are small changes, except the last 4 commits.

  • arm: dts: sc5xx: remove dead bootph-pre-ram annotations

removes unnecessary bootph-pre-ram annotations

  • configs: remove unused drivers from SPL and fix Makefile phase guards

removes unused drivers

  • pinctrl: sc5xx: adopt Linux pinmux binding

adopts Linux pinmux binding

  • arm: dts: sc5xx: migrate to CONFIG_OF_UPSTREAM

with all the prepared works done in other PRs and this PR, we finally can do the migration to use Linux DTS.

jiez added 17 commits June 23, 2026 22:16
The SC5xx on-chip bus is the System Crossbar (SCB), matching the
hardware manual and the Linux kernel SC5xx DTS files. Also drop
the unused device_type = "soc" property from sc5xx.dtsi which is
not used in U-Boot for SC5xx.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Rename sharc1/sharc2 labels to sharc0/sharc1 to match Linux, where
labels are 0-based (sharc0 = core-id 1, sharc1 = core-id 2). The
coreid values themselves are unchanged.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Align with Linux which uses core-id. Update the driver accordingly.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Change from adi,sc5xx-rproc to adi,remoteproc to align with the Linux
kernel driver compatible string. Update the driver accordingly.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Assign the dedicated CDU SDIO clock (CLK09) to the ciu clock and
SCLK0 to the biu clock, matching Linux and the Synopsys DW MCI
binding. Previously biu was a dummy clock and ciu used SCLK0.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
bus-width, max-frequency and pinctrl selection are board-level
properties; move them from the sc57x/sc58x SoC dtsi into each board
dts that enables MMC (sc573-ezlite, sc589-ezkit, sc589-mini),
matching Linux convention.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Replace the synthetic emmcclk fixed-clock node with the real
ADSP_SC598_CLK_EMMC clock from the CDU, matching Linux sc59x-64.dtsi.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Change the MUSB compatible string from "adi,sc5xx-musb" to "adi,musb"
in sc57x.dtsi, sc58x.dtsi, and the sc5xx glue driver to align with the
Linux kernel DTS convention.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Replace the non-standard "reset" property with the binding-compliant
"reset-gpios", remove redundant pinctrl from the PHY node (pinctrl
belongs on the controller, not the PHY), and correct the polarity to
GPIO_ACTIVE_LOW to match the Linux sc598-som.dtsi reference.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Replace the generic snps,arc-dwmac-3.70a compatible string with the
ADI-specific adi,dwmac, matching the Linux kernel DTS binding. Add
adi,dwmac to the designware driver match table so the driver continues
to bind correctly.

This aligns U-Boot with the Linux DTS and prepares for future
CONFIG_OF_UPSTREAM adoption.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Register the dummy placeholder clock via clk_register_fixed_rate,
aligning with how the Linux ADI clock drivers handle it. This removes
the dummy fixed-clock DT node and its phandle from the clock driver
binding, bringing the DTS closer to the Linux binding for future
CONFIG_OF_UPSTREAM adoption.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
DTS convention requires the most specific compatible first with the
generic fallback last, and vendor-prefixed strings for specific parts.
Fix the order and add issi, prefix to ISSI flash parts and mxicy,
prefix to the Macronix mx66lm1g45g.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Rename mcp23017@21/22 to gpio@21/22 to follow the DT convention of
using functional class names rather than part numbers, aligning with
the Linux sc573-ezlite.dts node naming.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Linux CCF registers fixed-clocks under their clock-output-names value,
so parent_name strings in CCF drivers match that name. U-Boot CCF looks
up parents by DM device name, which comes from the DT node name (e.g.
"oscillator@1"), not clock-output-names (e.g. "sys_clkin0").

After clk_get_by_name() resolves the input clocks via the clocks/
clock-names phandle pair, use clk.dev->name (the actual DM device name)
as the parent_name string passed to clk_register_*(). This allows the
ADI CCF drivers to work with upstream device trees that follow the Linux
clock-output-names convention without any changes to the core clk.c.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
All sc5xx boards use BOOT_DEVICE_BOOTROM — SPL always returns to the
Boot ROM to load U-Boot proper. The Boot ROM handles all flash (SPI,
OSPI, eMMC) access using its own drivers, so SPL never needs SPI/OSPI/
MMC drivers or GPIO expander hogs for flash enables.

Additionally, MCP23017/MCP23018 GPIO expander drivers require
CONFIG_SPL_MCP230XX_GPIO to be compiled into SPL, which is never set
for any sc5xx board. All bootph-pre-ram annotations on those expander
nodes and their children are therefore unreachable.

Remove bootph-pre-ram from:
- spi2 controller node (sc5xx.dtsi) — Boot ROM handles SPI
- ospi controller node (sc59x.dtsi) — Boot ROM handles OSPI
- All SPI/OSPI flash child nodes across all boards
- mmc0 node and mmc pinctrl (sc598-som.dtsi, sc58x.dtsi)
- spi2_default and ospi_default pinctrl nodes
- All MCP23017/MCP23018 GPIO expander device nodes and children
- ADP5588 carrier board expander nodes and children (non-boot hogs)
- uart0-flow-en hogs (flow control not needed in SPL)
- Pushbutton input hogs in sc59x.dtsi (inputs, not needed in SPL)

Retain bootph-pre-ram on:
- ADP5587 (adp5587@34) device node and uart0-en hog on sc598-som-revE
  (ADP5588 driver is compiled into SPL without PHASE_ guard, and
  uart0-en enables the UART console before preloader_console_init)
- uart0-en SoC GPIO hog on sc598-htol
- soc_defaults pinctrl (referenced by pinctrl0 at init time)
- All core SPL peripherals: clk, pinctrl, uart, timer, watchdog,
  SoC GPIO banks

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Several drivers were compiled into sc5xx SPL despite having no uclass
or no user, wasting binary space. Fix this by adding PHASE_ guards so
each driver only enters SPL when its corresponding SPL config is set.

Changes:
- spi/Makefile: move adi_spi3 inside ifdef DM_SPI so it follows the
  same phase gate as the rest of the SPI stack. Remove CONFIG_SPL_DM_SPI
  and CONFIG_SPL_DM_SPI_FLASH from all sc594/sc598 SPL defconfigs; SPL
  delegates flash loading to the Boot ROM via BOOT_DEVICE_BOOTROM and
  never reads from SPI itself.

- mmc/Makefile: add PHASE_ to MMC_SDHCI_ADI. No sc5xx board sets
  CONFIG_SPL_DM_MMC so the MMC uclass is absent from SPL; the driver
  had no uclass to register with.

- remoteproc/Makefile: add PHASE_ to REMOTEPROC_ADI_SC5XX. The
  remoteproc uclass uses PHASE_ and no board sets SPL_REMOTEPROC.

- dma/Makefile: add PHASE_ to dma-uclass and adi_dma. ADI_DMA Kconfig
  has no SPL selects; its only user was cadence_qspi which is now also
  excluded from SPL.

- watchdog/Makefile: WDT_ADI Kconfig already has 'select SPL_WDT if
  SPL', so the WDT uclass is intentionally present in SPL. Keep
  obj-$(CONFIG_WDT_ADI) without PHASE_ so driver and uclass match.

- clk/adi/Kconfig: add 'select SPL_DM/SPL_CLK/SPL_CLK_CCF/
  SPL_OF_CONTROL if SPL' to COMMON_CLK_ADI_SC57X and SC58X, matching
  what SC594 and SC598 already had. Remove the now-redundant explicit
  CONFIG_SPL_CLK and CONFIG_SPL_CLK_CCF lines from sc573/sc584/sc589
  defconfigs.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Replace the U-Boot-specific adi,pins property (pairs of pin-index and
function) with the Linux-compatible pins/pinmux binding used in the
upstream kernel DTS. Each pinctrl group now contains a pins{} child
node with a pinmux property of ADI_ADSP_PINMUX() values that encode
port, pin, and function in a single u32.

Update the adi-adsp.h header to match the Linux encoding: PINFUNC values
are now 1-based (ADI_ADSP_PINFUNC_ALT0=1) and the ADI_ADSP_PINMUX()
macro packs pin index and function into one cell. The driver subtracts 1
before writing to the hardware MUX register to recover the 0-based
hardware value. ADI_ADSP_PINFUNC_GPIO=0 is reserved and skipped.

pins{} child nodes that sit under a bootph-pre-ram group are also marked
bootph-pre-ram so that fdtgrep retains them in the SPL DTB; without this
the child node is stripped and no pins are configured before relocation.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
@jiez
jiez requested review from a team June 24, 2026 18:33
@jiez jiez self-assigned this Jun 24, 2026
@jiez jiez added this to ADSP Jun 24, 2026
Replace U-Boot-specific arch/arm/dts/sc5xx*.dts[i] files with upstream
Linux DTS from dts/upstream/src/arm[64]/adi/ and per-board *-u-boot.dtsi
overlays in arch/arm/dts/.

The sc5xx-u-boot.dtsi common overlay adds bootph-pre-ram to all nodes
needed before relocation (clocks, timer, UART, watchdog, GPIO banks,
pinctrl, I2C), sets stdout-path, and augments rcu/sec with the syscon
compatible required by the U-Boot watchdog driver. Per-board overlays
extend this with SoC-specific GPIO banks, additional I2C buses, and
board-specific SPL requirements (e.g. ADP5587 gpio-expander on
sc598-som-ezkit for UART0 transceiver enable).

sc598 overlays additionally override the ethernet compatible to
"adi,sc59x-dwmac-eqos" and supply the four-entry reg-names ("cgu0",
"cgu1", "cdu", "pll3") required by the sc598 clock driver. sc57x/sc58x/
sc594 overlays supply three-entry reg-names ("cgu0", "cgu1", "cdu").
pinctrl0 base and size are overridden per SoC family to match the U-Boot
pinctrl driver's expected register layout.

The upstream sc59x-64.dtsi uses "snps,dwcmshc-sdhci" for the eMMC
controller, but the U-Boot ADI MMC driver only matches "adi,dwc-sdhci".
Override the compatible in sc598-som-ezkit and sc598-htol overlays so
the driver binds correctly.

Set CONFIG_OF_UPSTREAM=y and CONFIG_DEFAULT_DEVICE_TREE="adi/<board>"
in all sc5xx defconfigs. Add include/dt-bindings/pinctrl/adi-adsp-sru.h
copied from Linux to satisfy upstream DTS includes.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
@jiez
jiez force-pushed the adsp-sc5xx-of-upstream branch from 40210a4 to b6867e8 Compare June 24, 2026 19:21
@pamolloy pamolloy moved this to In Development in ADSP Jun 26, 2026
Comment on lines +250 to +266
//&emac1 {
// phy-handle = <&dp83848>;
// phy-mode = "rmii";
// pinctrl-names = "default";
// pinctrl-0 = <&eth1_default>;
// status = "disabled";//

// mdio1 {
// compatible = "snps,dwmac-mdio";
// #address-cells = <1>;
// #size-cells = <0>;
// dp83848: ethernet-phy@1 {
// reg = <1>;
// };
// };//

//};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be dropped?


const char *clkin0_name = clkin0.dev->name;
const char *clkin1_name = clkin1.dev->name;
const char * const cgu1_in_sels[] = {clkin0_name, clkin1_name};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it safe for cgu1_in_sels to be stack local here? Unlike Linux, it looks like u-boot’s clk_register_mux() appears to store parent_names directly in mux->parent_names and may use it later, so this array may need persistent storage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Development

Development

Successfully merging this pull request may close these issues.

3 participants