Skip to contentSkip to conversation

drivers: Driver support for ADI SC5xx SoCs

PATCH In review Greg Malysa 4 participants 16 messages Feb 26, 2025 – Mar 13, 2025

Subsystems (11)
lore
Share & tools
lore
#0 lore raw

v3 cover drivers: Driver support for ADI SC5xx SoCs

This series adds all of the supported peripheral drivers for the sc5xx series of SoCs from Analog Devices and other drivers that are used by the evaluation kits, such as a GPIO expander used by the EZLITE carrier boards. This series passes gitlab CI tests.

Changes in v3:
- Add check if PORT peripheral base address was mapped successfully
- replace read*/write* with ioread* and iowrite* and friends across all drivers
- update for compatibility with changes to dwc qos driver between 2024.04 and 2025.01
- (spi) Primarily addressed issues identified in earlier feedback:
- Removed unused pins and memory_map priv members
- Added __iomem to device mmio pointers
- Replaced readl/writel calls with iowrite32/ioread32 and friends
- Added map_sysmem() call to prepare device mmio pointer
- (sdhci) Removed struct adi_sdhc and replaced with the struct that was its only member

Changes in v2:
- Clean up some whitespace errors
- Modify Kconfigs to reflect changes to mach-sc5xx/Kconfig

Greg Malysa (5):
pinctrl: Add support for ADI SC5XX-family pinctrl
doc: Add dt-bindings and descriptions for ADI SC5xx-family pinctrl
gpio: Add support for SC5XX-family processor GPIO driver
net: Add support for ADI SC5xx SoCs with DWC QoS ethernet
dma: Add driver for ADI SC5xx-family SoC MDMA functionality

Nathan Barrett-Morrison (7):
gpio: Add support for ADI ADP5588 GPIO expander chips
usb: musb-new: Add support for Analog Devices SC5xx SoCs
i2c: Add support for ADI SC5XX-family I2C peripheral
watchdog: Add support for ADI SC5XX-family watchdog peripheral
remoteproc: Add in SHARC loading for ADI SC5XX-family processors
spi: Add support for ADI SC5XX-family processor SPI peripherals
mmc: Add support for ADI SC5XX-family processor SDHCI peripherals

 MAINTAINERS                                   |  13 +
 .../pinctrl/adi,adsp-pinctrl.yaml             |  73 ++
 drivers/dma/Kconfig                           |   7 +
 drivers/dma/Makefile                          |   1 +
 drivers/dma/adi_dma.c                         | 253 +++++++
 drivers/gpio/Kconfig                          |  17 +
 drivers/gpio/Makefile                         |   2 +
 drivers/gpio/adp5588_gpio.c                   | 208 ++++++
 drivers/gpio/gpio-adi-adsp.c                  | 179 +++++
 drivers/i2c/Kconfig                           |   7 +
 drivers/i2c/Makefile                          |   1 +
 drivers/i2c/adi_i2c.c                         | 386 ++++++++++
 drivers/mmc/Kconfig                           |   9 +
 drivers/mmc/Makefile                          |   1 +
 drivers/mmc/adi_sdhci.c                       | 148 ++++
 drivers/net/Kconfig                           |   7 +
 drivers/net/Makefile                          |   1 +
 drivers/net/dwc_eth_qos.c                     |   6 +
 drivers/net/dwc_eth_qos.h                     |   2 +
 drivers/net/dwc_eth_qos_adi.c                 | 103 +++
 drivers/pinctrl/Kconfig                       |   8 +
 drivers/pinctrl/Makefile                      |   1 +
 drivers/pinctrl/pinctrl-adi-adsp.c            | 161 +++++
 drivers/remoteproc/Kconfig                    |  11 +
 drivers/remoteproc/Makefile                   |   1 +
 drivers/remoteproc/adi_sc5xx_rproc.c          | 277 +++++++
 drivers/spi/Kconfig                           |   7 +
 drivers/spi/Makefile                          |   1 +
 drivers/spi/adi_spi3.c                        | 679 ++++++++++++++++++
 drivers/usb/musb-new/Kconfig                  |   7 +
 drivers/usb/musb-new/Makefile                 |   1 +
 drivers/usb/musb-new/sc5xx.c                  | 202 ++++++
 drivers/watchdog/Kconfig                      |   9 +
 drivers/watchdog/Makefile                     |   1 +
 drivers/watchdog/adi_wdt.c                    | 143 ++++
 include/dt-bindings/pinctrl/adi-adsp.h        |  21 +
 36 files changed, 2954 insertions(+)
 create mode 100644 doc/device-tree-bindings/pinctrl/adi,adsp-pinctrl.yaml
 create mode 100644 drivers/dma/adi_dma.c
 create mode 100644 drivers/gpio/adp5588_gpio.c
 create mode 100644 drivers/gpio/gpio-adi-adsp.c
 create mode 100644 drivers/i2c/adi_i2c.c
 create mode 100644 drivers/mmc/adi_sdhci.c
 create mode 100644 drivers/net/dwc_eth_qos_adi.c
 create mode 100644 drivers/pinctrl/pinctrl-adi-adsp.c
 create mode 100644 drivers/remoteproc/adi_sc5xx_rproc.c
 create mode 100644 drivers/spi/adi_spi3.c
 create mode 100644 drivers/usb/musb-new/sc5xx.c
 create mode 100644 drivers/watchdog/adi_wdt.c
 create mode 100644 include/dt-bindings/pinctrl/adi-adsp.h
Signature · 1 line
2.45.2
#1 lore raw

PATCH v3 1/12 pinctrl: Add support for ADI SC5XX-family pinctrl

This adds support for pin configuration on the Analog Devices SC5XX SoC family. This commit is largely a port of the Linux driver, which has not yet been submitted upstream.

---

Changes in v3:
- Add check if PORT peripheral base address was mapped successfully

Changes in v2:
- Clean up some whitespace errors
- Modify Kconfigs to reflect changes to mach-sc5xx/Kconfig

---
 MAINTAINERS                        |   1 +
 drivers/pinctrl/Kconfig            |   8 ++
 drivers/pinctrl/Makefile           |   1 +
 drivers/pinctrl/pinctrl-adi-adsp.c | 161 +++++++++++++++++++++++++++++
 4 files changed, 171 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-adi-adsp.c
MAINTAINERS +1 -0
index c1851280e6e..af8d0b7d5e9 100644
@@ -631,6 +631,7 @@ F:	doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml
 F:	doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml
 F:	doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml
 F:	drivers/clk/adi/
+F:	drivers/pinctrl/pinctrl-adi-adsp.c
 F:	drivers/serial/serial_adi_uart4.c
 F:	drivers/timer/adi_sc5xx_timer.c
 F:	include/configs/sc5*
drivers/pinctrl/Kconfig +8 -0
index 6ee7dc1cce8..687fb339ea0 100644
@@ -178,6 +178,14 @@ config PINCTRL_APPLE
 	  both the GPIO definitions and pin control functions for each
 	  available multiplex function.
 
+config PINCTRL_ADI
+	bool "ADI pinctrl driver"
+	depends on DM && ARCH_SC5XX
+	help
+	  This driver enables pinctrl support on SC5xx processors. This
+	  driver covers only the pin configuration functionality, and
+	  GPIO functionality is contained in the separate GPIO driver.
+
 config PINCTRL_AR933X
 	bool "QCA/Athores ar933x pin control driver"
 	depends on DM && SOC_AR933X
drivers/pinctrl/Makefile +1 -0
index 634047a91f4..e3a82b12c78 100644
@@ -3,6 +3,7 @@
 obj-y					+= pinctrl-uclass.o
 obj-$(CONFIG_$(XPL_)PINCTRL_GENERIC)	+= pinctrl-generic.o
 
+obj-$(CONFIG_PINCTRL_ADI)		+= pinctrl-adi-adsp.o
 obj-$(CONFIG_PINCTRL_APPLE)		+= pinctrl-apple.o
 obj-$(CONFIG_PINCTRL_AT91)		+= pinctrl-at91.o
 obj-$(CONFIG_PINCTRL_AT91PIO4)		+= pinctrl-at91-pio4.o
drivers/pinctrl/pinctrl-adi-adsp.c new file +161 -0

161 lines not on this page · raw message

Signature · 1 line
2.45.2
#2 lore raw

PATCH v3 2/12 doc: Add dt-bindings and descriptions for ADI SC5xx-family pinctrl

In reply to Greg Malysa

This adds the necessary dt-bindings and documentation to use the ADI SC5xx pinctrl driver in a device tree. It is not yet available upstream in the Linux kernel. Eventually, it will be moved there.

---

(no changes since v1)

 MAINTAINERS                                   |  2 +
 .../pinctrl/adi,adsp-pinctrl.yaml             | 73 +++++++++++++++++++
 include/dt-bindings/pinctrl/adi-adsp.h        | 21 ++++++
 3 files changed, 96 insertions(+)
 create mode 100644 doc/device-tree-bindings/pinctrl/adi,adsp-pinctrl.yaml
 create mode 100644 include/dt-bindings/pinctrl/adi-adsp.h
MAINTAINERS +2 -0
index af8d0b7d5e9..abdb418b599 100644
@@ -629,12 +629,14 @@ F:	arch/arm/mach-sc5xx/
 F:	board/adi/
 F:	doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml
 F:	doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml
+F:	doc/device-tree-bindings/pinctrl/adi,adsp-pinctrl.yaml
 F:	doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml
 F:	drivers/clk/adi/
 F:	drivers/pinctrl/pinctrl-adi-adsp.c
 F:	drivers/serial/serial_adi_uart4.c
 F:	drivers/timer/adi_sc5xx_timer.c
 F:	include/configs/sc5*
+F:	include/dt-bindings/pinctrl/adi-adsp.h
 F:	include/env/adi/
 
 ARM SNAPDRAGON
doc/device-tree-bindings/pinctrl/adi,adsp-pinctrl.yaml new file +73 -0

73 lines not on this page · raw message

include/dt-bindings/pinctrl/adi-adsp.h new file +21 -0
new file mode 100644
index 00000000000..7dc8a1ef5c4
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * (C) Copyright 2022 - Analog Devices, Inc.
+ *
+ * Written and/or maintained by Timesys Corporation
+ *
+ * Contact: Nathan Barrett-Morrison <[email protected]>
+ * Contact: Greg Malysa <[email protected]>
+ *
+ */
+
+#ifndef DT_BINDINGS_PINCTRL_ADI_ADSP
+#define DT_BINDINGS_PINCTRL_ADI_ADSP
+
+#define ADI_ADSP_PIN(port, pin) (16 * ((port) - 'A') + (pin))
+#define ADI_ADSP_PINFUNC_ALT0 0
+#define ADI_ADSP_PINFUNC_ALT1 1
+#define ADI_ADSP_PINFUNC_ALT2 2
+#define ADI_ADSP_PINFUNC_ALT3 3
+
+#endif
Signature · 1 line
2.45.2
#3 lore raw

PATCH v3 3/12 gpio: Add support for SC5XX-family processor GPIO driver

In reply to Greg Malysa

This adds support for using the GPIO pins on the SC5XX family of SoCs from Analog Devices.

---

(no changes since v1)

 MAINTAINERS                  |   1 +
 drivers/gpio/Kconfig         |   9 ++
 drivers/gpio/Makefile        |   1 +
 drivers/gpio/gpio-adi-adsp.c | 179 +++++++++++++++++++++++++++++++++++
 4 files changed, 190 insertions(+)
 create mode 100644 drivers/gpio/gpio-adi-adsp.c
MAINTAINERS +1 -0
index abdb418b599..5c16c8f6646 100644
@@ -632,6 +632,7 @@ F:	doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml
 F:	doc/device-tree-bindings/pinctrl/adi,adsp-pinctrl.yaml
 F:	doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml
 F:	drivers/clk/adi/
+F:	drivers/gpio/gpio-adi-adsp.c
 F:	drivers/pinctrl/pinctrl-adi-adsp.c
 F:	drivers/serial/serial_adi_uart4.c
 F:	drivers/timer/adi_sc5xx_timer.c
drivers/gpio/Kconfig +9 -0
index f4a453e1cdd..00b01f5f09e 100644
@@ -97,6 +97,15 @@ config SPL_DM_GPIO_LOOKUP_LABEL
 	  different gpios on different hardware versions
 	  for the same functionality in board code.
 
+config ADI_GPIO
+	bool "ADI GPIO driver"
+	depends on DM_GPIO && ARCH_SC5XX
+	help
+	  This driver supports GPIO banks on SC5xx processors. It
+	  supports inputs and outputs but does not support pin
+	  interrupt functionality (PINT) or other features in the
+	  Linux version of the driver.
+
 config ALTERA_PIO
 	bool "Altera PIO driver"
 	depends on DM_GPIO
drivers/gpio/Makefile +1 -0
index 3f882c065d8..e25ede1813c 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_$(PHASE_)DM_GPIO) += gpio-uclass.o
 
 obj-$(CONFIG_$(XPL_)DM_PCA953X)	+= pca953x_gpio.o
 
+obj-$(CONFIG_ADI_GPIO)		+= gpio-adi-adsp.o
 obj-$(CONFIG_ASPEED_GPIO)	+= gpio-aspeed.o
 obj-$(CONFIG_ASPEED_G7_GPIO)	+= gpio-aspeed-g7.o
 obj-$(CONFIG_ASPEED_SGPIO)	+= gpio-aspeed-sgpio.o
drivers/gpio/gpio-adi-adsp.c new file +179 -0

179 lines not on this page · raw message

Signature · 1 line
2.45.2
#4 lore raw

PATCH v3 4/12 gpio: Add support for ADI ADP5588 GPIO expander chips

In reply to Greg Malysa

From: Nathan Barrett-Morrison <[email protected]>

This adds support for the ADP588 GPIO expander from Analog Devices. It is accessed over I2C and provides up to 18 pins. It is largely a port of the Linux driver developed by Michael Hennerich <[email protected]>

---

(no changes since v1)

 MAINTAINERS                 |   1 +
 drivers/gpio/Kconfig        |   8 ++
 drivers/gpio/Makefile       |   1 +
 drivers/gpio/adp5588_gpio.c | 208 ++++++++++++++++++++++++++++++++++++
 4 files changed, 218 insertions(+)
 create mode 100644 drivers/gpio/adp5588_gpio.c
MAINTAINERS +1 -0
index 5c16c8f6646..bfb81bb9891 100644
@@ -632,6 +632,7 @@ F:	doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml
 F:	doc/device-tree-bindings/pinctrl/adi,adsp-pinctrl.yaml
 F:	doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml
 F:	drivers/clk/adi/
+F:	drivers/gpio/adp5588_gpio.c
 F:	drivers/gpio/gpio-adi-adsp.c
 F:	drivers/pinctrl/pinctrl-adi-adsp.c
 F:	drivers/serial/serial_adi_uart4.c
drivers/gpio/Kconfig +8 -0
index 00b01f5f09e..8d7a990b04f 100644
@@ -554,6 +554,14 @@ config DM_PCA953X
 	  Now, max 24 bits chips and PCA953X compatible chips are
 	  supported
 
+config ADP5588_GPIO
+	bool "ADP5588 GPIO expander driver"
+	depends on DM_GPIO && DM_I2C
+	help
+	  Say yes here to support GPIO functionality of ADI ADP5588 chips.
+
+	  The ADP5588 is an 18-port I2C GPIO expander and keypad controller.
+
 config SPL_DM_PCA953X
 	bool "PCA95[357]x, PCA9698, TCA64xx, and MAX7310 I/O ports in SPL"
 	depends on SPL_DM_GPIO
drivers/gpio/Makefile +1 -0
index e25ede1813c..d426d3a2d7b 100644
@@ -75,6 +75,7 @@ obj-$(CONFIG_NOMADIK_GPIO)	+= nmk_gpio.o
 obj-$(CONFIG_MAX7320_GPIO)	+= max7320_gpio.o
 obj-$(CONFIG_$(XPL_)MAX77663_GPIO)	+= max77663_gpio.o
 obj-$(CONFIG_SL28CPLD_GPIO)	+= sl28cpld-gpio.o
+obj-$(CONFIG_ADP5588_GPIO)	+= adp5588_gpio.o
 obj-$(CONFIG_ZYNQMP_GPIO_MODEPIN)	+= zynqmp_gpio_modepin.o
 obj-$(CONFIG_SLG7XL45106_I2C_GPO)	+= gpio_slg7xl45106.o
 obj-$(CONFIG_FTGPIO010)		+= ftgpio010.o
drivers/gpio/adp5588_gpio.c new file +208 -0

208 lines not on this page · raw message

Signature · 1 line
2.45.2
#5 lore raw

PATCH v3 5/12 usb: musb-new: Add support for Analog Devices SC5xx SoCs

In reply to Greg Malysa

From: Nathan Barrett-Morrison <[email protected]>

This adds support for the MUSB-based USB controller found in the Analog Devices SC57x and SC58x SoCs.

---

(no changes since v1)

 MAINTAINERS                   |   1 +
 drivers/usb/musb-new/Kconfig  |   7 ++
 drivers/usb/musb-new/Makefile |   1 +
 drivers/usb/musb-new/sc5xx.c  | 202 ++++++++++++++++++++++++++++++++++
 4 files changed, 211 insertions(+)
 create mode 100644 drivers/usb/musb-new/sc5xx.c
MAINTAINERS +1 -0
index bfb81bb9891..b57e2119679 100644
@@ -637,6 +637,7 @@ F:	drivers/gpio/gpio-adi-adsp.c
 F:	drivers/pinctrl/pinctrl-adi-adsp.c
 F:	drivers/serial/serial_adi_uart4.c
 F:	drivers/timer/adi_sc5xx_timer.c
+F:	drivers/usb/musb-new/sc5xx.c
 F:	include/configs/sc5*
 F:	include/dt-bindings/pinctrl/adi-adsp.h
 F:	include/env/adi/
drivers/usb/musb-new/Kconfig +7 -0
index c52afd41a75..ad9072a5327 100644
@@ -22,6 +22,13 @@ config USB_MUSB_GADGET
 	  Enables the MUSB USB dual-role controller in gadget mode.
 
 if USB_MUSB_HOST || USB_MUSB_GADGET
+config USB_MUSB_SC5XX
+        bool "Analog Devices MUSB support"
+        depends on (SC57X || SC58X)
+	help
+	 Say y here to enable support for the USB controller on
+	 ADI SC57X/SC58X processors.
+
 config USB_MUSB_DA8XX
 	bool "Enable DA8xx MUSB Controller"
 	depends on ARCH_DAVINCI
drivers/usb/musb-new/Makefile +1 -0
index 396ff02654b..6638772daca 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_USB_MUSB_PIC32) += pic32.o
 obj-$(CONFIG_USB_MUSB_SUNXI) += sunxi.o
 obj-$(CONFIG_USB_MUSB_TI) += ti-musb.o
 obj-$(CONFIG_USB_MUSB_UX500) += ux500.o
+obj-$(CONFIG_USB_MUSB_SC5XX) += sc5xx.o
 
 ccflags-y := $(call cc-option,-Wno-unused-variable) \
 		$(call cc-option,-Wno-unused-but-set-variable) \
drivers/usb/musb-new/sc5xx.c new file +202 -0

202 lines not on this page · raw message

Signature · 1 line
2.45.2
#6 lore raw

PATCH v3 6/12 i2c: Add support for ADI SC5XX-family I2C peripheral

In reply to Greg Malysa

From: Nathan Barrett-Morrison <[email protected]>

---

Changes in v3:
- replace readw/writew with ioread16 and iowrite16 and friends

 MAINTAINERS           |   1 +
 drivers/i2c/Kconfig   |   7 +
 drivers/i2c/Makefile  |   1 +
 drivers/i2c/adi_i2c.c | 386 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 395 insertions(+)
 create mode 100644 drivers/i2c/adi_i2c.c
MAINTAINERS +1 -0
index b57e2119679..f2638becc32 100644
@@ -634,6 +634,7 @@ F:	doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml
 F:	drivers/clk/adi/
 F:	drivers/gpio/adp5588_gpio.c
 F:	drivers/gpio/gpio-adi-adsp.c
+F:	drivers/i2c/adi_i2c.c
 F:	drivers/pinctrl/pinctrl-adi-adsp.c
 F:	drivers/serial/serial_adi_uart4.c
 F:	drivers/timer/adi_sc5xx_timer.c
drivers/i2c/Kconfig +7 -0
index cdae6825736..46e76385961 100644
@@ -154,6 +154,13 @@ config SPL_DM_I2C_GPIO
 	  bindings are supported.
 	  Binding info: doc/device-tree-bindings/i2c/i2c-gpio.txt
 
+config SYS_I2C_ADI
+	bool "ADI I2C driver"
+	depends on DM_I2C && ARCH_SC5XX
+	help
+	  Add support for the ADI (Analog Devices) I2C driver as used
+	  in SC57X, SC58X, SC59X, SC59X_64.
+
 config SYS_I2C_AT91
 	bool "Atmel I2C driver"
 	depends on DM_I2C && ARCH_AT91
drivers/i2c/Makefile +1 -0
index bebd728e7da..2713289f7db 100644
@@ -11,6 +11,7 @@ obj-$(CONFIG_$(XPL_)I2C_CROS_EC_TUNNEL) += cros_ec_tunnel.o
 obj-$(CONFIG_$(XPL_)I2C_CROS_EC_LDO) += cros_ec_ldo.o
 
 obj-$(CONFIG_$(XPL_)SYS_I2C_LEGACY) += i2c_core.o
+obj-$(CONFIG_SYS_I2C_ADI) += adi_i2c.o
 obj-$(CONFIG_SYS_I2C_ASPEED) += ast_i2c.o
 obj-$(CONFIG_SYS_I2C_AST2600) += ast2600_i2c.o
 obj-$(CONFIG_SYS_I2C_AT91) += at91_i2c.o
drivers/i2c/adi_i2c.c new file +386 -0

386 lines not on this page · raw message

Signature · 1 line
2.45.2
Reviewed-by on v3 6/12
#7 lore raw

Re: [PATCH v3 06/12] i2c: Add support for ADI SC5XX-family I2C peripheral

Hello Greg,

Quoted 19 lines · Greg Malysa

From: Nathan Barrett-Morrison <[email protected]>

---

Changes in v3:
- replace readw/writew with ioread16 and iowrite16 and friends

Quoted 6 lines
  MAINTAINERS           |   1 +
  drivers/i2c/Kconfig   |   7 +
  drivers/i2c/Makefile  |   1 +
  drivers/i2c/adi_i2c.c | 386 ++++++++++++++++++++++++++++++++++++++++++
  4 files changed, 395 insertions(+)

create mode 100644 drivers/i2c/adi_i2c.c

I am unsure if I not already sended a Reviewed by in an earlier version, so:

Thanks!

bye,
HEiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: [email protected]
#8 lore raw

PATCH v3 7/12 net: Add support for ADI SC5xx SoCs with DWC QoS ethernet

In reply to Greg Malysa

The ADI SC598 includes a Designware QoS 5.20a IP block. This commit adds support for using the existing ethernet QoS driver with the SC598 SoC.

---

Changes in v3:
- replace readl/writel with ioread32 and iowrite32 and friends
- update for compatibility with changes to dwc qos driver between 2024.04 and 2025.01

 MAINTAINERS                   |   1 +
 drivers/net/Kconfig           |   7 +++
 drivers/net/Makefile          |   1 +
 drivers/net/dwc_eth_qos.c     |   6 ++
 drivers/net/dwc_eth_qos.h     |   2 +
 drivers/net/dwc_eth_qos_adi.c | 103 ++++++++++++++++++++++++++++++++++
 6 files changed, 120 insertions(+)
 create mode 100644 drivers/net/dwc_eth_qos_adi.c
MAINTAINERS +1 -0
index f2638becc32..2c4dc8b14c1 100644
@@ -635,6 +635,7 @@ F:	drivers/clk/adi/
 F:	drivers/gpio/adp5588_gpio.c
 F:	drivers/gpio/gpio-adi-adsp.c
 F:	drivers/i2c/adi_i2c.c
+F:	drivers/net/dwc_eth_qos_adi.c
 F:	drivers/pinctrl/pinctrl-adi-adsp.c
 F:	drivers/serial/serial_adi_uart4.c
 F:	drivers/timer/adi_sc5xx_timer.c
drivers/net/Kconfig +7 -0
index 1563404ca17..8dc5f4810e9 100644
@@ -237,6 +237,13 @@ config DWC_ETH_QOS
 	  Of Service) IP block. The IP supports many options for bus type,
 	  clocking/reset structure, and feature list.
 
+config DWC_ETH_QOS_ADI
+	bool "Synopsys DWC Ethernet QOS device support for ADI SC59x-64 parts"
+	depends on DWC_ETH_QOS
+	help
+		The Synopsis Designware Ethernet QoS IP block with the specific
+		configuration used in the ADI ADSP-SC59X 64 bit SoCs
+
 config DWC_ETH_QOS_IMX
 	bool "Synopsys DWC Ethernet QOS device support for IMX"
 	depends on DWC_ETH_QOS
drivers/net/Makefile +1 -0
index 80d70212971..d919d437c08 100644
@@ -19,6 +19,7 @@ obj-$(CONFIG_DM_ETH_PHY) += eth-phy-uclass.o
 obj-$(CONFIG_DRIVER_DM9000) += dm9000x.o
 obj-$(CONFIG_DSA_SANDBOX) += dsa_sandbox.o
 obj-$(CONFIG_DWC_ETH_QOS) += dwc_eth_qos.o
+obj-$(CONFIG_DWC_ETH_QOS_ADI) += dwc_eth_qos_adi.o
 obj-$(CONFIG_DWC_ETH_QOS_IMX) += dwc_eth_qos_imx.o
 obj-$(CONFIG_DWC_ETH_QOS_INTEL) += dwc_eth_qos_intel.o
 obj-$(CONFIG_DWC_ETH_QOS_ROCKCHIP) += dwc_eth_qos_rockchip.o
drivers/net/dwc_eth_qos.c +6 -0
index 2279481d935..b4ec3614696 100644
@@ -1631,6 +1631,12 @@ static const struct udevice_id eqos_ids[] = {
 		.compatible = "starfive,jh7110-dwmac",
 		.data = (ulong)&eqos_jh7110_config
 	},
+#endif
+#if IS_ENABLED(CONFIG_DWC_ETH_QOS_ADI)
+	{
+		.compatible = "adi,sc59x-dwmac-eqos",
+		.data = (ulong)&eqos_adi_config
+	},
 #endif
 	{ }
 };
drivers/net/dwc_eth_qos.h +2 -0
index 123f98d5d53..403e8203974 100644
@@ -87,6 +87,7 @@ struct eqos_mac_regs {
 #define EQOS_MAC_MDIO_ADDRESS_CR_MASK			GENMASK(11, 8)
 #define EQOS_MAC_MDIO_ADDRESS_CR_100_150		1
 #define EQOS_MAC_MDIO_ADDRESS_CR_20_35			2
+#define EQOS_MAC_MDIO_ADDRESS_CR_150_250		4
 #define EQOS_MAC_MDIO_ADDRESS_CR_250_300		5
 #define EQOS_MAC_MDIO_ADDRESS_SKAP			BIT(4)
 #define EQOS_MAC_MDIO_ADDRESS_GOC_MASK			GENMASK(3, 2)
@@ -301,3 +302,4 @@ extern struct eqos_config eqos_qcom_config;
 extern struct eqos_config eqos_stm32mp13_config;
 extern struct eqos_config eqos_stm32mp15_config;
 extern struct eqos_config eqos_jh7110_config;
+extern struct eqos_config eqos_adi_config;
drivers/net/dwc_eth_qos_adi.c new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
2.45.2
#9 lore raw

PATCH v3 8/12 watchdog: Add support for ADI SC5XX-family watchdog peripheral

In reply to Greg Malysa

From: Nathan Barrett-Morrison <[email protected]>

---

Changes in v3:
- replace readl/writel with ioread32 and iowrite32 and friends

 MAINTAINERS                |   1 +
 drivers/watchdog/Kconfig   |   9 +++
 drivers/watchdog/Makefile  |   1 +
 drivers/watchdog/adi_wdt.c | 143 +++++++++++++++++++++++++++++++++++++
 4 files changed, 154 insertions(+)
 create mode 100644 drivers/watchdog/adi_wdt.c
MAINTAINERS +1 -0
index 2c4dc8b14c1..0cefd888885 100644
@@ -640,6 +640,7 @@ F:	drivers/pinctrl/pinctrl-adi-adsp.c
 F:	drivers/serial/serial_adi_uart4.c
 F:	drivers/timer/adi_sc5xx_timer.c
 F:	drivers/usb/musb-new/sc5xx.c
+F:	drivers/watchdog/adi_wdt.c
 F:	include/configs/sc5*
 F:	include/dt-bindings/pinctrl/adi-adsp.h
 F:	include/env/adi/
drivers/watchdog/Kconfig +9 -0
index b39b2546e5c..1bb67f50352 100644
@@ -95,6 +95,15 @@ config WDT_APPLE
 	  The watchdog will perform a full SoC reset resulting in a
 	  reboot of the entire system.
 
+config WDT_ADI
+	bool "Analog Devices watchdog timer support"
+	select WDT
+	select SPL_WDT if SPL
+	depends on ARCH_SC5XX
+	help
+	  Enable this to support Watchdog Timer on ADI SC57X, SC58X, SC59X,
+	  and SC59X_64 processors
+
 config WDT_ARMADA_37XX
 	bool "Marvell Armada 37xx watchdog timer support"
 	depends on WDT && ARMADA_3700
drivers/watchdog/Makefile +1 -0
index 9b6b1a8e8ad..e6bd4c587af 100644
@@ -53,3 +53,4 @@ obj-$(CONFIG_WDT_STM32MP) += stm32mp_wdt.o
 obj-$(CONFIG_WDT_SUNXI) += sunxi_wdt.o
 obj-$(CONFIG_WDT_TANGIER) += tangier_wdt.o
 obj-$(CONFIG_WDT_XILINX) += xilinx_wwdt.o
+obj-$(CONFIG_WDT_ADI) += adi_wdt.o
drivers/watchdog/adi_wdt.c new file +143 -0

143 lines not on this page · raw message

Signature · 1 line
2.45.2
Reviewed-by on v3 8/12
#10 lore raw

Re: [PATCH v3 08/12] watchdog: Add support for ADI SC5XX-family watchdog peripheral

Quoted 12 lines · Greg Malysa

From: Nathan Barrett-Morrison <[email protected]>

Quoted 4 lines

---

Changes in v3:
- replace readl/writel with ioread32 and iowrite32 and friends

BTW: I already added my RB tag on v1, please include it in later versions, if not bigger changes occur.

Thanks,
Stefan

Quoted 187 lines
  MAINTAINERS                |   1 +
  drivers/watchdog/Kconfig   |   9 +++
  drivers/watchdog/Makefile  |   1 +
  drivers/watchdog/adi_wdt.c | 143 +++++++++++++++++++++++++++++++++++++
  4 files changed, 154 insertions(+)

create mode 100644 drivers/watchdog/adi_wdt.c

MAINTAINERS +1 -0
index 2c4dc8b14c1..0cefd888885 100644
@@ -640,6 +640,7 @@ F:	drivers/pinctrl/pinctrl-adi-adsp.c
  F:	drivers/serial/serial_adi_uart4.c
  F:	drivers/timer/adi_sc5xx_timer.c
  F:	drivers/usb/musb-new/sc5xx.c
+F:	drivers/watchdog/adi_wdt.c
  F:	include/configs/sc5*
  F:	include/dt-bindings/pinctrl/adi-adsp.h
  F:	include/env/adi/
drivers/watchdog/Kconfig +9 -0
index b39b2546e5c..1bb67f50352 100644
@@ -95,6 +95,15 @@ config WDT_APPLE
  	  The watchdog will perform a full SoC reset resulting in a
  	  reboot of the entire system.
 
+config WDT_ADI
+	bool "Analog Devices watchdog timer support"
+	select WDT
+	select SPL_WDT if SPL
+	depends on ARCH_SC5XX
+	help
+	  Enable this to support Watchdog Timer on ADI SC57X, SC58X, SC59X,
+	  and SC59X_64 processors
+
  config WDT_ARMADA_37XX
  	bool "Marvell Armada 37xx watchdog timer support"
  	depends on WDT && ARMADA_3700
drivers/watchdog/Makefile +1 -0
index 9b6b1a8e8ad..e6bd4c587af 100644
@@ -53,3 +53,4 @@ obj-$(CONFIG_WDT_STM32MP) += stm32mp_wdt.o
  obj-$(CONFIG_WDT_SUNXI) += sunxi_wdt.o
  obj-$(CONFIG_WDT_TANGIER) += tangier_wdt.o
  obj-$(CONFIG_WDT_XILINX) += xilinx_wwdt.o
+obj-$(CONFIG_WDT_ADI) += adi_wdt.o
drivers/watchdog/adi_wdt.c new file +133 -0
new file mode 100644
index 00000000000..6f5b3d5d042
@@ -0,0 +1,143 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * (C) Copyright 2022 - Analog Devices, Inc.
+ *
+ * Written and/or maintained by Timesys Corporation
+ *
+ * Converted to driver model by Nathan Barrett-Morrison
+ *
+ * Contact: Nathan Barrett-Morrison <[email protected]>
+ * Contact: Greg Malysa <[email protected]>
+ *
+ * adi_wtd.c - driver for ADI on-chip watchdog
+ *
+ */
+
+#include <clk.h>
+#include <dm.h>
+#include <wdt.h>
+#include <linux/delay.h>
+#include <linux/ioport.h>
+#include <linux/io.h>
+
+#define WDOG_CTL  0x0
+#define WDOG_CNT  0x4
+#define WDOG_STAT 0x8
+
+#define RCU_CTL   0x0
+#define RCU_STAT  0x4
+
+#define SEC_GCTL  0x0
+#define SEC_FCTL  0x10
+#define SEC_SCTL0 0x800
+
+#define WDEN      0x0010
+#define WDDIS     0x0AD0
+
+struct adi_wdt_priv {
+	void __iomem *rcu_base;
+	void __iomem *sec_base;
+	void __iomem *wdt_base;
+	struct clk clock;
+};
+
+static int adi_wdt_reset(struct udevice *dev)
+{
+	struct adi_wdt_priv *priv = dev_get_priv(dev);
+
+	iowrite32(0, priv->wdt_base + WDOG_STAT);
+
+	return 0;
+}
+
+static int adi_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
+{
+	struct adi_wdt_priv *priv = dev_get_priv(dev);
+
+	/* Disable SYSCD_RESETb input and clear the RCU0 reset status */
+	iowrite32(0xf, priv->rcu_base + RCU_STAT);
+	iowrite32(0x0, priv->rcu_base + RCU_CTL);
+
+	/* reset the SEC controller */
+	iowrite32(0x2, priv->sec_base + SEC_GCTL);
+	iowrite32(0x2, priv->sec_base + SEC_FCTL);
+
+	udelay(50);
+
+	/* enable SEC fault event */
+	iowrite32(0x1, priv->sec_base + SEC_GCTL);
+
+	/* ANOMALY 36100004 Spurious External Fault event occurs when FCTL
+	 * is re-programmed when currently active fault is not cleared
+	 */
+	iowrite32(0xc0, priv->sec_base + SEC_FCTL);
+	iowrite32(0xc1, priv->sec_base + SEC_FCTL);
+
+	/* enable SEC fault source for watchdog0 */
+	setbits_32(priv->sec_base + SEC_SCTL0 + (3*8), 0x6);
+
+	/* Enable SYSCD_RESETb input */
+	iowrite32(0x100, priv->rcu_base + RCU_CTL);
+
+	/* enable watchdog0 */
+	iowrite32(WDDIS, priv->wdt_base + WDOG_CTL);
+
+	iowrite32(timeout_ms / 1000 *
+	       (clk_get_rate(&priv->clock) / (IS_ENABLED(CONFIG_SC58X) ? 2 : 1)),
+	       priv->wdt_base + WDOG_CNT);
+
+	iowrite32(0, priv->wdt_base + WDOG_STAT);
+	iowrite32(WDEN, priv->wdt_base + WDOG_CTL);
+
+	return 0;
+}
+
+static int adi_wdt_probe(struct udevice *dev)
+{
+	struct adi_wdt_priv *priv = dev_get_priv(dev);
+	int ret;
+	struct resource res;
+
+	ret = dev_read_resource_byname(dev, "rcu", &res);
+	if (ret)
+		return ret;
+	priv->rcu_base = devm_ioremap(dev, res.start, resource_size(&res));
+
+	ret = dev_read_resource_byname(dev, "sec", &res);
+	if (ret)
+		return ret;
+	priv->sec_base = devm_ioremap(dev, res.start, resource_size(&res));
+
+	ret = dev_read_resource_byname(dev, "wdt", &res);
+	if (ret)
+		return ret;
+	priv->wdt_base = devm_ioremap(dev, res.start, resource_size(&res));
+
+	ret = clk_get_by_name(dev, "sclk0", &priv->clock);
+	if (ret < 0) {
+		printf("Can't get WDT clk: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+static const struct wdt_ops adi_wdt_ops = {
+	.start		= adi_wdt_start,
+	.reset		= adi_wdt_reset,
+};
+
+static const struct udevice_id adi_wdt_ids[] = {
+	{ .compatible = "adi,wdt" },
+	{}
+};

drivers/watchdog/adi_wdt.c line 143

Quoted 10 lines
drivers/watchdog/adi_wdt.c new file +10 -0
+
+U_BOOT_DRIVER(adi_wdt) = {
+	.name		= "adi_wdt",
+	.id		= UCLASS_WDT,
+	.of_match	= adi_wdt_ids,
+	.probe		= adi_wdt_probe,
+	.ops		= &adi_wdt_ops,
+	.priv_auto = sizeof(struct adi_wdt_priv),
+	.flags		= DM_FLAG_PRE_RELOC,
+};

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#11 lore raw

PATCH v3 9/12 dma: Add driver for ADI SC5xx-family SoC MDMA functionality

In reply to Greg Malysa

Add a rudimentary MDMA driver for the Analog Devices SC5xx SoCs, primarily intended for use with and tested against the QSPI/OSPI IP included in the SoC.

---

Changes in v3:
- replace readl/writel with ioread32 and iowrite32 and friends

 MAINTAINERS           |   1 +
 drivers/dma/Kconfig   |   7 ++
 drivers/dma/Makefile  |   1 +
 drivers/dma/adi_dma.c | 253 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 262 insertions(+)
 create mode 100644 drivers/dma/adi_dma.c
MAINTAINERS +1 -0
index 0cefd888885..a9d05356763 100644
@@ -632,6 +632,7 @@ F:	doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml
 F:	doc/device-tree-bindings/pinctrl/adi,adsp-pinctrl.yaml
 F:	doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml
 F:	drivers/clk/adi/
+F:	drivers/dma/adi_dma.c
 F:	drivers/gpio/adp5588_gpio.c
 F:	drivers/gpio/gpio-adi-adsp.c
 F:	drivers/i2c/adi_i2c.c
drivers/dma/Kconfig +7 -0
index 3c64e894646..4b47be6b016 100644
@@ -76,6 +76,13 @@ config XILINX_DPDMA
 	  this file is used as placeholder for driver. The main reason is
 	  to record compatible string and calling power domain driver.
 
+config ADI_DMA
+	bool "ADI DMA driver"
+	depends on DMA && DMA_CHANNELS
+	help
+	  Enable DMA support for Analog Devices SOCs, such as the SC5xx.
+	  Currently this is a minimalistic driver tested against OSPI use only.
+
 if APBH_DMA
 config APBH_DMA_BURST
 	bool "Enable DMA BURST"
drivers/dma/Makefile +1 -0
index 48811eaaeb3..00d765864cd 100644
@@ -13,5 +13,6 @@ obj-$(CONFIG_TI_KSNAV) += keystone_nav.o keystone_nav_cfg.o
 obj-$(CONFIG_TI_EDMA3) += ti-edma3.o
 obj-$(CONFIG_DMA_LPC32XX) += lpc32xx_dma.o
 obj-$(CONFIG_XILINX_DPDMA) += xilinx_dpdma.o
+obj-$(CONFIG_ADI_DMA) += adi_dma.o
 
 obj-y += ti/
drivers/dma/adi_dma.c new file +253 -0

253 lines not on this page · raw message

Signature · 1 line
2.45.2
#12 lore raw

PATCH v3 10/12 remoteproc: Add in SHARC loading for ADI SC5XX-family processors

In reply to Greg Malysa

From: Nathan Barrett-Morrison <[email protected]>

This adds the ability to load ldr-formatted files to the SHARC coprocessors using the rproc interface. Only a minimal subset of rproc functionality is supported: loading and starting the remote core.

Secure boot and signed ldr verification are not available at this time through the U-Boot interface.

---

Changes in v3:
- replace readl/writel with ioread32 and iowrite32 and friends

 MAINTAINERS                          |   1 +
 drivers/remoteproc/Kconfig           |  11 ++
 drivers/remoteproc/Makefile          |   1 +
 drivers/remoteproc/adi_sc5xx_rproc.c | 277 +++++++++++++++++++++++++++
 4 files changed, 290 insertions(+)
 create mode 100644 drivers/remoteproc/adi_sc5xx_rproc.c
MAINTAINERS +1 -0
index a9d05356763..42ee02bf391 100644
@@ -638,6 +638,7 @@ F:	drivers/gpio/gpio-adi-adsp.c
 F:	drivers/i2c/adi_i2c.c
 F:	drivers/net/dwc_eth_qos_adi.c
 F:	drivers/pinctrl/pinctrl-adi-adsp.c
+F:	drivers/remoteproc/adi_sc5xx_rproc.c
 F:	drivers/serial/serial_adi_uart4.c
 F:	drivers/timer/adi_sc5xx_timer.c
 F:	drivers/usb/musb-new/sc5xx.c
drivers/remoteproc/Kconfig +11 -0
index 2790b168b19..8cb2fd006f5 100644
@@ -13,6 +13,7 @@ config REMOTEPROC
 	depends on DM
 
 # Please keep the configuration alphabetically sorted.
+
 config K3_SYSTEM_CONTROLLER
 	bool "Support for TI' K3 System Controller"
 	select REMOTEPROC
@@ -22,6 +23,16 @@ config K3_SYSTEM_CONTROLLER
 	help
 	  Say 'y' here to add support for TI' K3 System Controller.
 
+config REMOTEPROC_ADI_SC5XX
+	bool "Support for ADI SC5xx SHARC cores"
+	select REMOTEPROC
+	depends on DM
+	depends on ARCH_SC5XX
+	depends on SYSCON
+	help
+	  Say 'y' here to add support for loading code onto SHARC cores in
+	  an ADSP-SC5xx SoC from Analog Devices
+
 config REMOTEPROC_RENESAS_APMU
 	bool "Support for Renesas R-Car Gen4 APMU start of CR52 processor"
 	select REMOTEPROC
drivers/remoteproc/Makefile +1 -0
index 3a092b7660e..65ba3ebfe4e 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_$(XPL_)REMOTEPROC) += rproc-uclass.o rproc-elf-loader.o
 
 # Remote proc drivers - Please keep this list alphabetically sorted.
 obj-$(CONFIG_K3_SYSTEM_CONTROLLER) += k3_system_controller.o
+obj-$(CONFIG_REMOTEPROC_ADI_SC5XX) += adi_sc5xx_rproc.o
 obj-$(CONFIG_REMOTEPROC_RENESAS_APMU) += renesas_apmu.o
 obj-$(CONFIG_REMOTEPROC_SANDBOX) += sandbox_testproc.o
 obj-$(CONFIG_REMOTEPROC_STM32_COPRO) += stm32_copro.o
drivers/remoteproc/adi_sc5xx_rproc.c new file +277 -0

277 lines not on this page · raw message

Signature · 1 line
2.45.2
#13 lore raw

PATCH v3 11/12 spi: Add support for ADI SC5XX-family processor SPI peripherals

In reply to Greg Malysa

From: Nathan Barrett-Morrison <[email protected]>

This adds support for the ADI-specific SPI driver present in the ADI SC5xx line of SoCs. This IP block is distinct from the QSPI/OSPI block that uses the Cadence driver. Both may be used at once with appropriate pin muxing configuration.

---

Changes in v3:
- Primarily addressed issues identified in earlier feedback:
- Removed unused pins and memory_map priv members
- Added __iomem to device mmio pointers
- Replaced readl/writel calls with iowrite32/ioread32 and friends
- Added map_sysmem() call to prepare device mmio pointer

 MAINTAINERS            |   1 +
 drivers/spi/Kconfig    |   7 +
 drivers/spi/Makefile   |   1 +
 drivers/spi/adi_spi3.c | 679 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 688 insertions(+)
 create mode 100644 drivers/spi/adi_spi3.c
MAINTAINERS +1 -0
index 42ee02bf391..889695c1edd 100644
@@ -640,6 +640,7 @@ F:	drivers/net/dwc_eth_qos_adi.c
 F:	drivers/pinctrl/pinctrl-adi-adsp.c
 F:	drivers/remoteproc/adi_sc5xx_rproc.c
 F:	drivers/serial/serial_adi_uart4.c
+F:	drivers/spi/adi_spi3.c
 F:	drivers/timer/adi_sc5xx_timer.c
 F:	drivers/usb/musb-new/sc5xx.c
 F:	drivers/watchdog/adi_wdt.c
drivers/spi/Kconfig +7 -0
index 96ea033082b..846a93a4e57 100644
@@ -52,6 +52,13 @@ config SPI_DIRMAP
 
 if DM_SPI
 
+config ADI_SPI3
+	bool "Enable ADI SPI Driver"
+	depends on ARCH_SC5XX
+	help
+	  Enable the ADI (Analog Devices) SPI controller driver. This
+	  driver enables the support for SC5XX spi controller.
+
 config ALTERA_SPI
 	bool "Altera SPI driver"
 	help
drivers/spi/Makefile +1 -0
index 7051e2a00c6..21895d46429 100644
@@ -19,6 +19,7 @@ obj-y += spi.o
 obj-$(CONFIG_SPI_MEM) += spi-mem-nodm.o
 endif
 
+obj-$(CONFIG_ADI_SPI3) += adi_spi3.o
 obj-$(CONFIG_ALTERA_SPI) += altera_spi.o
 obj-$(CONFIG_APPLE_SPI) += apple_spi.o
 obj-$(CONFIG_ATH79_SPI) += ath79_spi.o
drivers/spi/adi_spi3.c new file +679 -0

679 lines not on this page · raw message

Signature · 1 line
2.45.2
#14 lore raw

PATCH v3 12/12 mmc: Add support for ADI SC5XX-family processor SDHCI peripherals

In reply to Greg Malysa

From: Nathan Barrett-Morrison <[email protected]>

---

Changes in v3:
- Removed struct adi_sdhc and replaced with the struct that was its only member

 MAINTAINERS             |   1 +
 drivers/mmc/Kconfig     |   9 +++
 drivers/mmc/Makefile    |   1 +
 drivers/mmc/adi_sdhci.c | 148 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 159 insertions(+)
 create mode 100644 drivers/mmc/adi_sdhci.c
MAINTAINERS +1 -0
index 889695c1edd..31adefd9f9c 100644
@@ -636,6 +636,7 @@ F:	drivers/dma/adi_dma.c
 F:	drivers/gpio/adp5588_gpio.c
 F:	drivers/gpio/gpio-adi-adsp.c
 F:	drivers/i2c/adi_i2c.c
+F:	drivers/mmc/adi_sdhci.c
 F:	drivers/net/dwc_eth_qos_adi.c
 F:	drivers/pinctrl/pinctrl-adi-adsp.c
 F:	drivers/remoteproc/adi_sc5xx_rproc.c
drivers/mmc/Kconfig +9 -0
index 4827834b4aa..ab56bd3939f 100644
@@ -292,6 +292,15 @@ config MMC_DW_ROCKCHIP
 	  SD 3.0, SDIO 3.0 and MMC 4.5 and supports common eMMC chips as well
 	  as removeable SD and micro-SD cards.
 
+config MMC_SDHCI_ADI
+	bool "ADI SD/MMC controller support"
+	depends on ARCH_SC5XX
+	depends on DM_MMC && OF_CONTROL
+	depends on MMC_SDHCI && MMC_SDHCI_ADMA
+	help
+	  This enables support for the SD/MMC controller included in some Analog
+	  Devices SC5XX Socs.
+
 config MMC_DW_SOCFPGA
 	bool "SOCFPGA specific extensions for Synopsys DW Memory Card Interface"
 	depends on ARCH_SOCFPGA
drivers/mmc/Makefile +1 -0
index 90e76f90769..94ed28ead71 100644
@@ -70,6 +70,7 @@ obj-$(CONFIG_MMC_SDHCI_MV)		+= mv_sdhci.o
 obj-$(CONFIG_MMC_SDHCI_NPCM)            += npcm_sdhci.o
 obj-$(CONFIG_MMC_SDHCI_PIC32)		+= pic32_sdhci.o
 obj-$(CONFIG_MMC_SDHCI_ROCKCHIP)	+= rockchip_sdhci.o
+obj-$(CONFIG_MMC_SDHCI_ADI)		+= adi_sdhci.o
 obj-$(CONFIG_MMC_SDHCI_S5P)		+= s5p_sdhci.o
 obj-$(CONFIG_MMC_SDHCI_SNPS)		+= snps_sdhci.o
 obj-$(CONFIG_MMC_SDHCI_STI)		+= sti_sdhci.o
drivers/mmc/adi_sdhci.c new file +148 -0

148 lines not on this page · raw message

Signature · 1 line
2.45.2
#15 lore raw
In reply to Greg Malysa
Quoted 19 lines · Greg Malysa

This series adds all of the supported peripheral drivers for the sc5xx series of SoCs from Analog Devices and other drivers that are used by the evaluation kits, such as a GPIO expander used by the EZLITE carrier boards. This series passes gitlab CI tests.

Changes in v3:
- Add check if PORT peripheral base address was mapped successfully
- replace read*/write* with ioread* and iowrite* and friends across all drivers
- update for compatibility with changes to dwc qos driver between 2024.04 and 2025.01
- (spi) Primarily addressed issues identified in earlier feedback:
- Removed unused pins and memory_map priv members
- Added __iomem to device mmio pointers
- Replaced readl/writel calls with iowrite32/ioread32 and friends
- Added map_sysmem() call to prepare device mmio pointer
- (sdhci) Removed struct adi_sdhc and replaced with the struct that was its only member

Quoted 1 line

[...]

Applied to u-boot/next, thanks!

[01/12] pinctrl: Add support for ADI SC5XX-family pinctrl

        commit: 79ccd6c7dc7055d5bbe375fddef925d7986c204d
[02/12] doc: Add dt-bindings and descriptions for ADI SC5xx-family pinctrl
        commit: a0ffd8d7cd8efb8b348c07fa18a610a4534f9bea
[03/12] gpio: Add support for SC5XX-family processor GPIO driver
        commit: 1e87f0ed79100d915540658eda76e4e125713323
[04/12] gpio: Add support for ADI ADP5588 GPIO expander chips
        commit: 446179627fcac2e99aaa329a1d6cf49805482c6b
[05/12] usb: musb-new: Add support for Analog Devices SC5xx SoCs
        commit: 2f6a86a6125645ef818dd0d4c0bfc1f77c73e31f
[06/12] i2c: Add support for ADI SC5XX-family I2C peripheral
        commit: 7f99650bb8f592827fc687022f4238ffdd4fde3e
[07/12] net: Add support for ADI SC5xx SoCs with DWC QoS ethernet
        commit: df831ebf6114c5f534f774c8b5b6998d328d0101
[08/12] watchdog: Add support for ADI SC5XX-family watchdog peripheral
        commit: cbc0dfd424caabaa9f2a1fee911940c7f65666e2
[09/12] dma: Add driver for ADI SC5xx-family SoC MDMA functionality
        commit: 072320d9215641dd30c5697a6b479ad46f05f2f9
[10/12] remoteproc: Add in SHARC loading for ADI SC5XX-family processors
        commit: d3bfe577880d20a19f155cf2bd33c5545c72cf6f
[11/12] spi: Add support for ADI SC5XX-family processor SPI peripherals
        commit: 7535a9280be1fc81b280517c7c44b5f1c2efc0ba
[12/12] mmc: Add support for ADI SC5XX-family processor SDHCI peripherals
        commit: 036118ebd81e6b2c593d5ea6dc0056b34931c870
Signature · 1 line
Tom