diff mbox series

[v9,32/38] ARM: ep93xx: DT for the Cirrus ep93xx SoC platforms

Message ID 20240326-ep93xx-v9-32-156e2ae5dfc8@maquefel.me (mailing list archive)
State New, archived
Headers show
Series [v9,01/38] gpio: ep93xx: split device in multiple | expand

Commit Message

Nikita Shubin via B4 Relay March 26, 2024, 9:18 a.m. UTC
From: Nikita Shubin <nikita.shubin@maquefel.me>

Add compulsory device tree support to the Cirrus ep93xx ARMv4 platform.

- select PINCTRL_EP93xx
- select COMMON_CLK_EP93XX, as clock driver moved out of platform code
- select ARCH_HAS_RESET_CONTROLLER

Select ARM_ATAG_DTB_COMPAT to update device tree with information
about memory passed from bootloader.

We have to leave all MACH options as they are used for board checking
before decomp, to turn off watchdog and ethernet DMA.

Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
 arch/arm/Makefile             |  1 -
 arch/arm/mach-ep93xx/Kconfig  | 20 ++++++++++----------
 arch/arm/mach-ep93xx/Makefile | 11 -----------
 3 files changed, 10 insertions(+), 22 deletions(-)

Comments

Arnd Bergmann March 26, 2024, 9:43 a.m. UTC | #1
On Tue, Mar 26, 2024, at 10:18, Nikita Shubin via B4 Relay wrote:
> From: Nikita Shubin <nikita.shubin@maquefel.me>
>
> Add compulsory device tree support to the Cirrus ep93xx ARMv4 platform.
>
> - select PINCTRL_EP93xx
> - select COMMON_CLK_EP93XX, as clock driver moved out of platform code
> - select ARCH_HAS_RESET_CONTROLLER
>
> Select ARM_ATAG_DTB_COMPAT to update device tree with information
> about memory passed from bootloader.
>
> We have to leave all MACH options as they are used for board checking
> before decomp, to turn off watchdog and ethernet DMA.
>
> Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
> ---
>  	select ARCH_SPARSEMEM_ENABLE
>  	select ARM_AMBA
>  	select ARM_VIC
> +	select ARM_APPENDED_DTB # Old Redboot bootloaders deployed
> +	select ARM_ATAG_DTB_COMPAT # we need this to update dt memory node

I would drop these two 'select' statements: while it is
a reasonable assumption that the boot loaders are never going
to be fixed, this is not something that's up to the kernel.

We have other platforms that are in the same situation, and they
just enable those options through the defconfig, as they are
user-visible.

> +	select COMMON_CLK_EP93XX
> +	select EP93XX_TIMER
>  	select CLKSRC_MMIO
>  	select CPU_ARM920T
>  	select GPIOLIB
> +	select PINCTRL
> +	select PINCTRL_EP93XX

If these options are user visible, I would prefer to leave
these up to the defconfig as well, but that's not as important
and something we do in other platforms as well. In general,
I'd prefer to keep 'select' statements to a minimum though.

> -obj-y			:= core.o clock.o timer-ep93xx.o
> -
> -obj-$(CONFIG_EP93XX_DMA)	+= dma.o
> -
> -obj-$(CONFIG_MACH_EDB93XX)	+= edb93xx.o
> -obj-$(CONFIG_MACH_TS72XX)	+= ts72xx.o
> -obj-$(CONFIG_MACH_VISION_EP9307)+= vision_ep9307.o

The Makefile changes should be grouped together with
whichever patch removes the individual files.

      Arnd
diff mbox series

Patch

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index d82908b1b1bb..5e24e50525d8 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -176,7 +176,6 @@  machine-$(CONFIG_ARCH_CLPS711X)		+= clps711x
 machine-$(CONFIG_ARCH_DAVINCI)		+= davinci
 machine-$(CONFIG_ARCH_DIGICOLOR)	+= digicolor
 machine-$(CONFIG_ARCH_DOVE)		+= dove
-machine-$(CONFIG_ARCH_EP93XX)		+= ep93xx
 machine-$(CONFIG_ARCH_EXYNOS)		+= exynos
 machine-$(CONFIG_ARCH_FOOTBRIDGE)	+= footbridge
 machine-$(CONFIG_ARCH_GEMINI)		+= gemini
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 703f3d232a60..812b71dcf60e 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -3,27 +3,27 @@  menuconfig ARCH_EP93XX
 	bool "EP93xx-based"
 	depends on ATAGS
 	depends on ARCH_MULTI_V4T
+	# CONFIG_ARCH_MULTI_V7 is not set
 	depends on CPU_LITTLE_ENDIAN
+	select ARCH_HAS_RESET_CONTROLLER
 	select ARCH_SPARSEMEM_ENABLE
 	select ARM_AMBA
 	select ARM_VIC
+	select ARM_APPENDED_DTB # Old Redboot bootloaders deployed
+	select ARM_ATAG_DTB_COMPAT # we need this to update dt memory node
+	select COMMON_CLK_EP93XX
+	select EP93XX_TIMER
 	select CLKSRC_MMIO
 	select CPU_ARM920T
 	select GPIOLIB
+	select PINCTRL
+	select PINCTRL_EP93XX
 	help
 	  This enables support for the Cirrus EP93xx series of CPUs.
 
 if ARCH_EP93XX
 
-menu "Cirrus EP93xx Implementation Options"
-
-config EP93XX_SOC_COMMON
-	bool
-	default y
-	select SOC_BUS
-	select LEDS_GPIO_REGISTER
-
-comment "EP93xx Platforms"
+# menu "EP93xx Platforms"
 
 config MACH_BK3
 	bool "Support Liebherr BK3.1"
@@ -103,6 +103,6 @@  config MACH_VISION_EP9307
 	  Say 'Y' here if you want your kernel to support the
 	  Vision Engraving Systems EP9307 SoM.
 
-endmenu
+# endmenu
 
 endif
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
deleted file mode 100644
index 62e37403df14..000000000000
--- a/arch/arm/mach-ep93xx/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@ 
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the linux kernel.
-#
-obj-y			:= core.o clock.o timer-ep93xx.o
-
-obj-$(CONFIG_EP93XX_DMA)	+= dma.o
-
-obj-$(CONFIG_MACH_EDB93XX)	+= edb93xx.o
-obj-$(CONFIG_MACH_TS72XX)	+= ts72xx.o
-obj-$(CONFIG_MACH_VISION_EP9307)+= vision_ep9307.o