All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/17] Modularizing Versatile Express
@ 2020-04-19 17:07 ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

This series enables building various Versatile Express platform drivers
as modules. The primary target is the Fast Model FVP which is supported
in Android. As Android is moving towards their GKI, or generic kernel,
the hardware support has to be in modules. Currently ARCH_VEXPRESS
enables several built-in only drivers. Some of these are needed, but
some are only needed for older 32-bit VExpress platforms and can just
be disabled. For FVP, the pl111 display driver is needed. The pl111
driver depends on vexpress-osc clocks which had a dependency chain of
vexpress-config --> vexpress-syscfg --> vexpress-sysreg. These
components relied on fixed initcall ordering and didn't support deferred
probe which would have complicated making them modules. All these levels
of abstraction are needlessly complicated, so this series simplifies
things a bit by merging the vexpress-config and vexpress-syscfg
functionality.

There's a couple of other pieces to this which I've sent out separately
as they don't have dependencies with this series. The cross subsystem
dependencies in this series are mainly the ordering of enabling drivers
as modules.

A complete git branch is here[1]. Tested on Fast Model FVP Rev C.

Rob

[1] git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git vexpress-modules-v3

Rob Herring (17):
  ARM: vexpress: Move vexpress_flags_set() into arch code
  arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS
  arm64: vexpress: Don't select CONFIG_VEXPRESS_CONFIG
  power/reset: vexpress: Support building as a module
  clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
  clk: versatile: Only enable SP810 on 32-bit by default
  clk: vexpress-osc: Use the devres clock API variants
  clk: vexpress-osc: Support building as a module
  mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO
  mfd: vexpress-sysreg: Drop unused syscon child devices
  mfd: vexpress-sysreg: Use devres API variants
  mfd: vexpress-sysreg: Support building as a module
  bus: vexpress-config: Merge vexpress-syscfg into vexpress-config
  bus: vexpress-config: simplify config bus probing
  vexpress: Move site master init to vexpress-config bus
  bus: vexpress-config: Support building as module
  ARM: vexpress: Don't select VEXPRESS_CONFIG

 arch/arm/mach-integrator/Kconfig         |   1 -
 arch/arm/mach-realview/Kconfig           |   1 -
 arch/arm/mach-versatile/Kconfig          |   1 -
 arch/arm/mach-vexpress/Kconfig           |   4 -
 arch/arm/mach-vexpress/core.h            |   1 +
 arch/arm/mach-vexpress/dcscb.c           |   1 +
 arch/arm/mach-vexpress/v2m.c             |  23 ++
 arch/arm64/Kconfig.platforms             |   3 -
 drivers/bus/Kconfig                      |   2 +-
 drivers/bus/vexpress-config.c            | 354 ++++++++++++++++++-----
 drivers/clk/Makefile                     |   2 +-
 drivers/clk/versatile/Kconfig            |  15 +-
 drivers/clk/versatile/clk-vexpress-osc.c |  20 +-
 drivers/mfd/Kconfig                      |   5 +-
 drivers/mfd/vexpress-sysreg.c            |  99 +------
 drivers/misc/Kconfig                     |   9 -
 drivers/misc/Makefile                    |   1 -
 drivers/misc/vexpress-syscfg.c           | 280 ------------------
 drivers/power/reset/Kconfig              |   2 +-
 drivers/power/reset/vexpress-poweroff.c  |  10 +-
 include/linux/vexpress.h                 |  30 --
 21 files changed, 338 insertions(+), 526 deletions(-)
 delete mode 100644 drivers/misc/vexpress-syscfg.c

--
2.20.1

^ permalink raw reply	[flat|nested] 136+ messages in thread

* [PATCH 00/17] Modularizing Versatile Express
@ 2020-04-19 17:07 ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

This series enables building various Versatile Express platform drivers
as modules. The primary target is the Fast Model FVP which is supported
in Android. As Android is moving towards their GKI, or generic kernel,
the hardware support has to be in modules. Currently ARCH_VEXPRESS
enables several built-in only drivers. Some of these are needed, but
some are only needed for older 32-bit VExpress platforms and can just
be disabled. For FVP, the pl111 display driver is needed. The pl111
driver depends on vexpress-osc clocks which had a dependency chain of
vexpress-config --> vexpress-syscfg --> vexpress-sysreg. These
components relied on fixed initcall ordering and didn't support deferred
probe which would have complicated making them modules. All these levels
of abstraction are needlessly complicated, so this series simplifies
things a bit by merging the vexpress-config and vexpress-syscfg
functionality.

There's a couple of other pieces to this which I've sent out separately
as they don't have dependencies with this series. The cross subsystem
dependencies in this series are mainly the ordering of enabling drivers
as modules.

A complete git branch is here[1]. Tested on Fast Model FVP Rev C.

Rob

[1] git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git vexpress-modules-v3

Rob Herring (17):
  ARM: vexpress: Move vexpress_flags_set() into arch code
  arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS
  arm64: vexpress: Don't select CONFIG_VEXPRESS_CONFIG
  power/reset: vexpress: Support building as a module
  clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
  clk: versatile: Only enable SP810 on 32-bit by default
  clk: vexpress-osc: Use the devres clock API variants
  clk: vexpress-osc: Support building as a module
  mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO
  mfd: vexpress-sysreg: Drop unused syscon child devices
  mfd: vexpress-sysreg: Use devres API variants
  mfd: vexpress-sysreg: Support building as a module
  bus: vexpress-config: Merge vexpress-syscfg into vexpress-config
  bus: vexpress-config: simplify config bus probing
  vexpress: Move site master init to vexpress-config bus
  bus: vexpress-config: Support building as module
  ARM: vexpress: Don't select VEXPRESS_CONFIG

 arch/arm/mach-integrator/Kconfig         |   1 -
 arch/arm/mach-realview/Kconfig           |   1 -
 arch/arm/mach-versatile/Kconfig          |   1 -
 arch/arm/mach-vexpress/Kconfig           |   4 -
 arch/arm/mach-vexpress/core.h            |   1 +
 arch/arm/mach-vexpress/dcscb.c           |   1 +
 arch/arm/mach-vexpress/v2m.c             |  23 ++
 arch/arm64/Kconfig.platforms             |   3 -
 drivers/bus/Kconfig                      |   2 +-
 drivers/bus/vexpress-config.c            | 354 ++++++++++++++++++-----
 drivers/clk/Makefile                     |   2 +-
 drivers/clk/versatile/Kconfig            |  15 +-
 drivers/clk/versatile/clk-vexpress-osc.c |  20 +-
 drivers/mfd/Kconfig                      |   5 +-
 drivers/mfd/vexpress-sysreg.c            |  99 +------
 drivers/misc/Kconfig                     |   9 -
 drivers/misc/Makefile                    |   1 -
 drivers/misc/vexpress-syscfg.c           | 280 ------------------
 drivers/power/reset/Kconfig              |   2 +-
 drivers/power/reset/vexpress-poweroff.c  |  10 +-
 include/linux/vexpress.h                 |  30 --
 21 files changed, 338 insertions(+), 526 deletions(-)
 delete mode 100644 drivers/misc/vexpress-syscfg.c

--
2.20.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* [PATCH 01/17] ARM: vexpress: Move vexpress_flags_set() into arch code
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:07   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

vexpress_flags_set() is only used by the platform SMP related code and
has nothing to do with the vexpress-sysreg MFD driver other than both
access the same h/w block. It's also only needed for 32-bit systems and
must be built-in for them. Let's move vexpress_flags_set() closer to
where it is being used. This will allow for vexpress-sysreg to be built
as a module.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm/mach-vexpress/Kconfig |  1 -
 arch/arm/mach-vexpress/core.h  |  1 +
 arch/arm/mach-vexpress/dcscb.c |  1 +
 arch/arm/mach-vexpress/v2m.c   | 23 +++++++++++++++++++++++
 drivers/mfd/vexpress-sysreg.c  | 19 -------------------
 include/linux/vexpress.h       |  4 ----
 6 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 726a68085c3b..18951cd20d9d 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -22,7 +22,6 @@ menuconfig ARCH_VEXPRESS
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 	select VEXPRESS_CONFIG
 	select VEXPRESS_SYSCFG
-	select MFD_VEXPRESS_SYSREG
 	help
 	  This option enables support for systems using Cortex processor based
 	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
index f4a7519084f1..bda78675c55d 100644
--- a/arch/arm/mach-vexpress/core.h
+++ b/arch/arm/mach-vexpress/core.h
@@ -1,3 +1,4 @@
 bool vexpress_smp_init_ops(void);
+void vexpress_flags_set(u32 data);
 
 extern const struct smp_operations vexpress_smp_dt_ops;
diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c
index 46a903c88c6a..a0554d7d04f7 100644
--- a/arch/arm/mach-vexpress/dcscb.c
+++ b/arch/arm/mach-vexpress/dcscb.c
@@ -20,6 +20,7 @@
 #include <asm/cputype.h>
 #include <asm/cp15.h>
 
+#include "core.h"
 
 #define RST_HOLD0	0x0
 #define RST_HOLD1	0x4
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 95886b3bb9dd..ffe7c7a85ae9 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -1,8 +1,31 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <linux/of.h>
+#include <linux/of_address.h>
 #include <asm/mach/arch.h>
 
 #include "core.h"
 
+#define SYS_FLAGSSET		0x030
+#define SYS_FLAGSCLR		0x034
+
+void vexpress_flags_set(u32 data)
+{
+	static void __iomem *base;
+
+	if (!base) {
+		struct device_node *node = of_find_compatible_node(NULL, NULL,
+				"arm,vexpress-sysreg");
+
+		base = of_iomap(node, 0);
+	}
+
+	if (WARN_ON(!base))
+		return;
+
+	writel(~0, base + SYS_FLAGSCLR);
+	writel(data, base + SYS_FLAGSSET);
+}
+
 static const char * const v2m_dt_match[] __initconst = {
 	"arm,vexpress",
 	NULL,
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index c68ff56dbdb1..0b9cc67706c7 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -8,7 +8,6 @@
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/mfd/core.h>
-#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/platform_data/syscon.h>
 #include <linux/platform_device.h>
@@ -42,24 +41,6 @@
 
 #define SYS_MISC_MASTERSITE	(1 << 14)
 
-void vexpress_flags_set(u32 data)
-{
-	static void __iomem *base;
-
-	if (!base) {
-		struct device_node *node = of_find_compatible_node(NULL, NULL,
-				"arm,vexpress-sysreg");
-
-		base = of_iomap(node, 0);
-	}
-
-	if (WARN_ON(!base))
-		return;
-
-	writel(~0, base + SYS_FLAGSCLR);
-	writel(data, base + SYS_FLAGSSET);
-}
-
 /* The sysreg block is just a random collection of various functions... */
 
 static struct syscon_platform_data vexpress_sysreg_sys_id_pdata = {
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
index 0e130b5077a5..2ec7992b054c 100644
--- a/include/linux/vexpress.h
+++ b/include/linux/vexpress.h
@@ -40,8 +40,4 @@ struct device *vexpress_config_bridge_register(struct device *parent,
 
 struct regmap *devm_regmap_init_vexpress_config(struct device *dev);
 
-/* Platform control */
-
-void vexpress_flags_set(u32 data);
-
 #endif
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 01/17] ARM: vexpress: Move vexpress_flags_set() into arch code
@ 2020-04-19 17:07   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

vexpress_flags_set() is only used by the platform SMP related code and
has nothing to do with the vexpress-sysreg MFD driver other than both
access the same h/w block. It's also only needed for 32-bit systems and
must be built-in for them. Let's move vexpress_flags_set() closer to
where it is being used. This will allow for vexpress-sysreg to be built
as a module.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm/mach-vexpress/Kconfig |  1 -
 arch/arm/mach-vexpress/core.h  |  1 +
 arch/arm/mach-vexpress/dcscb.c |  1 +
 arch/arm/mach-vexpress/v2m.c   | 23 +++++++++++++++++++++++
 drivers/mfd/vexpress-sysreg.c  | 19 -------------------
 include/linux/vexpress.h       |  4 ----
 6 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 726a68085c3b..18951cd20d9d 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -22,7 +22,6 @@ menuconfig ARCH_VEXPRESS
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 	select VEXPRESS_CONFIG
 	select VEXPRESS_SYSCFG
-	select MFD_VEXPRESS_SYSREG
 	help
 	  This option enables support for systems using Cortex processor based
 	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
index f4a7519084f1..bda78675c55d 100644
--- a/arch/arm/mach-vexpress/core.h
+++ b/arch/arm/mach-vexpress/core.h
@@ -1,3 +1,4 @@
 bool vexpress_smp_init_ops(void);
+void vexpress_flags_set(u32 data);
 
 extern const struct smp_operations vexpress_smp_dt_ops;
diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c
index 46a903c88c6a..a0554d7d04f7 100644
--- a/arch/arm/mach-vexpress/dcscb.c
+++ b/arch/arm/mach-vexpress/dcscb.c
@@ -20,6 +20,7 @@
 #include <asm/cputype.h>
 #include <asm/cp15.h>
 
+#include "core.h"
 
 #define RST_HOLD0	0x0
 #define RST_HOLD1	0x4
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 95886b3bb9dd..ffe7c7a85ae9 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -1,8 +1,31 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <linux/of.h>
+#include <linux/of_address.h>
 #include <asm/mach/arch.h>
 
 #include "core.h"
 
+#define SYS_FLAGSSET		0x030
+#define SYS_FLAGSCLR		0x034
+
+void vexpress_flags_set(u32 data)
+{
+	static void __iomem *base;
+
+	if (!base) {
+		struct device_node *node = of_find_compatible_node(NULL, NULL,
+				"arm,vexpress-sysreg");
+
+		base = of_iomap(node, 0);
+	}
+
+	if (WARN_ON(!base))
+		return;
+
+	writel(~0, base + SYS_FLAGSCLR);
+	writel(data, base + SYS_FLAGSSET);
+}
+
 static const char * const v2m_dt_match[] __initconst = {
 	"arm,vexpress",
 	NULL,
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index c68ff56dbdb1..0b9cc67706c7 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -8,7 +8,6 @@
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/mfd/core.h>
-#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/platform_data/syscon.h>
 #include <linux/platform_device.h>
@@ -42,24 +41,6 @@
 
 #define SYS_MISC_MASTERSITE	(1 << 14)
 
-void vexpress_flags_set(u32 data)
-{
-	static void __iomem *base;
-
-	if (!base) {
-		struct device_node *node = of_find_compatible_node(NULL, NULL,
-				"arm,vexpress-sysreg");
-
-		base = of_iomap(node, 0);
-	}
-
-	if (WARN_ON(!base))
-		return;
-
-	writel(~0, base + SYS_FLAGSCLR);
-	writel(data, base + SYS_FLAGSSET);
-}
-
 /* The sysreg block is just a random collection of various functions... */
 
 static struct syscon_platform_data vexpress_sysreg_sys_id_pdata = {
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
index 0e130b5077a5..2ec7992b054c 100644
--- a/include/linux/vexpress.h
+++ b/include/linux/vexpress.h
@@ -40,8 +40,4 @@ struct device *vexpress_config_bridge_register(struct device *parent,
 
 struct regmap *devm_regmap_init_vexpress_config(struct device *dev);
 
-/* Platform control */
-
-void vexpress_flags_set(u32 data);
-
 #endif
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 02/17] arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:07   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

The VExpress power-off/reset driver is not needed on 64-bit platforms as
PSCI power-off and reset can be used instead. Stop selecting it so it
can be disabled and not always built-in.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm64/Kconfig.platforms | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 55d70cfe0f9e..9c084f995e0f 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -278,7 +278,6 @@ config ARCH_VEXPRESS
 	select GPIOLIB
 	select PM
 	select PM_GENERIC_DOMAINS
-	select POWER_RESET_VEXPRESS
 	select VEXPRESS_CONFIG
 	help
 	  This enables support for the ARMv8 software model (Versatile
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 02/17] arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS
@ 2020-04-19 17:07   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

The VExpress power-off/reset driver is not needed on 64-bit platforms as
PSCI power-off and reset can be used instead. Stop selecting it so it
can be disabled and not always built-in.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm64/Kconfig.platforms | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 55d70cfe0f9e..9c084f995e0f 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -278,7 +278,6 @@ config ARCH_VEXPRESS
 	select GPIOLIB
 	select PM
 	select PM_GENERIC_DOMAINS
-	select POWER_RESET_VEXPRESS
 	select VEXPRESS_CONFIG
 	help
 	  This enables support for the ARMv8 software model (Versatile
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 03/17] arm64: vexpress: Don't select CONFIG_VEXPRESS_CONFIG
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:07   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is
unnecessary. It also prevents setting CONFIG_VEXPRESS_CONFIG to a module.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm64/Kconfig.platforms | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 9c084f995e0f..5c38dc56b808 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -278,7 +278,6 @@ config ARCH_VEXPRESS
 	select GPIOLIB
 	select PM
 	select PM_GENERIC_DOMAINS
-	select VEXPRESS_CONFIG
 	help
 	  This enables support for the ARMv8 software model (Versatile
 	  Express).
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 03/17] arm64: vexpress: Don't select CONFIG_VEXPRESS_CONFIG
@ 2020-04-19 17:07   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is
unnecessary. It also prevents setting CONFIG_VEXPRESS_CONFIG to a module.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm64/Kconfig.platforms | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 9c084f995e0f..5c38dc56b808 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -278,7 +278,6 @@ config ARCH_VEXPRESS
 	select GPIOLIB
 	select PM
 	select PM_GENERIC_DOMAINS
-	select VEXPRESS_CONFIG
 	help
 	  This enables support for the ARMv8 software model (Versatile
 	  Express).
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 04/17] power/reset: vexpress: Support building as a module
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:07   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

Enable building the VExpress power-off/reset driver as a module.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/power/reset/Kconfig             |  2 +-
 drivers/power/reset/vexpress-poweroff.c | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 890380302080..0ba18221ba40 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -182,7 +182,7 @@ config POWER_RESET_VERSATILE
 	  reference boards.
 
 config POWER_RESET_VEXPRESS
-	bool "ARM Versatile Express power-off and reset driver"
+	tristate "ARM Versatile Express power-off and reset driver"
 	depends on ARM || ARM64
 	depends on VEXPRESS_CONFIG
 	help
diff --git a/drivers/power/reset/vexpress-poweroff.c b/drivers/power/reset/vexpress-poweroff.c
index 90cbaa8341e3..8a6d3add894c 100644
--- a/drivers/power/reset/vexpress-poweroff.c
+++ b/drivers/power/reset/vexpress-poweroff.c
@@ -5,6 +5,7 @@
  */
 
 #include <linux/delay.h>
+#include <linux/module.h>
 #include <linux/notifier.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -87,6 +88,7 @@ static const struct of_device_id vexpress_reset_of_match[] = {
 	},
 	{}
 };
+MODULE_DEVICE_TABLE(of, vexpress_reset_of_match);
 
 static int _vexpress_register_restart_handler(struct device *dev)
 {
@@ -145,9 +147,5 @@ static struct platform_driver vexpress_reset_driver = {
 		.of_match_table = vexpress_reset_of_match,
 	},
 };
-
-static int __init vexpress_reset_init(void)
-{
-	return platform_driver_register(&vexpress_reset_driver);
-}
-device_initcall(vexpress_reset_init);
+module_platform_driver(vexpress_reset_driver);
+MODULE_LICENSE("GPL v2");
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 04/17] power/reset: vexpress: Support building as a module
@ 2020-04-19 17:07   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

Enable building the VExpress power-off/reset driver as a module.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/power/reset/Kconfig             |  2 +-
 drivers/power/reset/vexpress-poweroff.c | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 890380302080..0ba18221ba40 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -182,7 +182,7 @@ config POWER_RESET_VERSATILE
 	  reference boards.
 
 config POWER_RESET_VEXPRESS
-	bool "ARM Versatile Express power-off and reset driver"
+	tristate "ARM Versatile Express power-off and reset driver"
 	depends on ARM || ARM64
 	depends on VEXPRESS_CONFIG
 	help
diff --git a/drivers/power/reset/vexpress-poweroff.c b/drivers/power/reset/vexpress-poweroff.c
index 90cbaa8341e3..8a6d3add894c 100644
--- a/drivers/power/reset/vexpress-poweroff.c
+++ b/drivers/power/reset/vexpress-poweroff.c
@@ -5,6 +5,7 @@
  */
 
 #include <linux/delay.h>
+#include <linux/module.h>
 #include <linux/notifier.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -87,6 +88,7 @@ static const struct of_device_id vexpress_reset_of_match[] = {
 	},
 	{}
 };
+MODULE_DEVICE_TABLE(of, vexpress_reset_of_match);
 
 static int _vexpress_register_restart_handler(struct device *dev)
 {
@@ -145,9 +147,5 @@ static struct platform_driver vexpress_reset_driver = {
 		.of_match_table = vexpress_reset_of_match,
 	},
 };
-
-static int __init vexpress_reset_init(void)
-{
-	return platform_driver_register(&vexpress_reset_driver);
-}
-device_initcall(vexpress_reset_init);
+module_platform_driver(vexpress_reset_driver);
+MODULE_LICENSE("GPL v2");
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:07   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

CONFIG_COMMON_CLK_VERSATILE doesn't really do anything other than hiding
Arm Ltd reference platform clock drivers. It is both selected by the
platforms that need it and has a 'depends on' for those platforms. It
selects REGMAP_MMIO, but really CONFIG_ICST should do that. Also,
CONFIG_ICST can't be enabled for COMPILE_TEST unless something else
selected it.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm/mach-integrator/Kconfig |  1 -
 arch/arm/mach-realview/Kconfig   |  1 -
 arch/arm/mach-versatile/Kconfig  |  1 -
 arch/arm/mach-vexpress/Kconfig   |  1 -
 arch/arm64/Kconfig.platforms     |  1 -
 drivers/clk/Makefile             |  2 +-
 drivers/clk/versatile/Kconfig    | 13 ++-----------
 7 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig
index 982eabc36163..d59ba15a6b69 100644
--- a/arch/arm/mach-integrator/Kconfig
+++ b/arch/arm/mach-integrator/Kconfig
@@ -3,7 +3,6 @@ menuconfig ARCH_INTEGRATOR
 	bool "ARM Ltd. Integrator family"
 	depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V6
 	select ARM_AMBA
-	select COMMON_CLK_VERSATILE
 	select HAVE_TCM
 	select ICST
 	select MFD_SYSCON
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index e7633c0aaae7..83ec9eeb3e5f 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -6,7 +6,6 @@ menuconfig ARCH_REALVIEW
 	select ARM_GIC
 	select ARM_TIMER_SP804
 	select CLK_SP810
-	select COMMON_CLK_VERSATILE
 	select GPIO_PL061 if GPIOLIB
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
index f5c275434d6c..d88e7725bf99 100644
--- a/arch/arm/mach-versatile/Kconfig
+++ b/arch/arm/mach-versatile/Kconfig
@@ -6,7 +6,6 @@ config ARCH_VERSATILE
 	select ARM_TIMER_SP804
 	select ARM_VIC
 	select CLKSRC_VERSATILE
-	select COMMON_CLK_VERSATILE
 	select CPU_ARM926T
 	select ICST
 	select MFD_SYSCON
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 18951cd20d9d..2d1fdec4c230 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -7,7 +7,6 @@ menuconfig ARCH_VEXPRESS
 	select ARM_GIC
 	select ARM_GLOBAL_TIMER
 	select ARM_TIMER_SP804
-	select COMMON_CLK_VERSATILE
 	select GPIOLIB
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 5c38dc56b808..25cbb556d863 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -274,7 +274,6 @@ config ARCH_UNIPHIER
 
 config ARCH_VEXPRESS
 	bool "ARMv8 software model (Versatile Express)"
-	select COMMON_CLK_VERSATILE
 	select GPIOLIB
 	select PM
 	select PM_GENERIC_DOMAINS
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index f4169cc2fd31..fb30c16e1596 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -114,7 +114,7 @@ obj-$(CONFIG_ARCH_TEGRA)		+= tegra/
 obj-y					+= ti/
 obj-$(CONFIG_CLK_UNIPHIER)		+= uniphier/
 obj-$(CONFIG_ARCH_U8500)		+= ux500/
-obj-$(CONFIG_COMMON_CLK_VERSATILE)	+= versatile/
+obj-y					+= versatile/
 ifeq ($(CONFIG_COMMON_CLK), y)
 obj-$(CONFIG_X86)			+= x86/
 endif
diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
index c2618f1477a2..3465fb291998 100644
--- a/drivers/clk/versatile/Kconfig
+++ b/drivers/clk/versatile/Kconfig
@@ -1,22 +1,14 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config ICST
-	bool
-
-config COMMON_CLK_VERSATILE
-	bool "Clock driver for ARM Reference designs"
-	depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
-		ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
-		COMPILE_TEST
+	bool "Clock driver for ARM Reference designs ICST" if COMPILE_TEST
 	select REGMAP_MMIO
 	---help---
 	  Supports clocking on ARM Reference designs:
 	  - Integrator/AP and Integrator/CP
 	  - RealView PB1176, EB, PB11MP and PBX
-	  - Versatile Express
 
 config CLK_SP810
 	bool "Clock driver for ARM SP810 System Controller"
-	depends on COMMON_CLK_VERSATILE
 	default y if ARCH_VEXPRESS
 	---help---
 	  Supports clock muxing (REFCLK/TIMCLK to TIMERCLKEN0-3) capabilities
@@ -24,8 +16,7 @@ config CLK_SP810
 
 config CLK_VEXPRESS_OSC
 	bool "Clock driver for Versatile Express OSC clock generators"
-	depends on COMMON_CLK_VERSATILE
-	depends on VEXPRESS_CONFIG
+	depends on VEXPRESS_CONFIG || COMPILE_TEST
 	default y if ARCH_VEXPRESS
 	---help---
 	  Simple regmap-based driver driving clock generators on Versatile
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
@ 2020-04-19 17:07   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

CONFIG_COMMON_CLK_VERSATILE doesn't really do anything other than hiding
Arm Ltd reference platform clock drivers. It is both selected by the
platforms that need it and has a 'depends on' for those platforms. It
selects REGMAP_MMIO, but really CONFIG_ICST should do that. Also,
CONFIG_ICST can't be enabled for COMPILE_TEST unless something else
selected it.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm/mach-integrator/Kconfig |  1 -
 arch/arm/mach-realview/Kconfig   |  1 -
 arch/arm/mach-versatile/Kconfig  |  1 -
 arch/arm/mach-vexpress/Kconfig   |  1 -
 arch/arm64/Kconfig.platforms     |  1 -
 drivers/clk/Makefile             |  2 +-
 drivers/clk/versatile/Kconfig    | 13 ++-----------
 7 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig
index 982eabc36163..d59ba15a6b69 100644
--- a/arch/arm/mach-integrator/Kconfig
+++ b/arch/arm/mach-integrator/Kconfig
@@ -3,7 +3,6 @@ menuconfig ARCH_INTEGRATOR
 	bool "ARM Ltd. Integrator family"
 	depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V6
 	select ARM_AMBA
-	select COMMON_CLK_VERSATILE
 	select HAVE_TCM
 	select ICST
 	select MFD_SYSCON
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index e7633c0aaae7..83ec9eeb3e5f 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -6,7 +6,6 @@ menuconfig ARCH_REALVIEW
 	select ARM_GIC
 	select ARM_TIMER_SP804
 	select CLK_SP810
-	select COMMON_CLK_VERSATILE
 	select GPIO_PL061 if GPIOLIB
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
index f5c275434d6c..d88e7725bf99 100644
--- a/arch/arm/mach-versatile/Kconfig
+++ b/arch/arm/mach-versatile/Kconfig
@@ -6,7 +6,6 @@ config ARCH_VERSATILE
 	select ARM_TIMER_SP804
 	select ARM_VIC
 	select CLKSRC_VERSATILE
-	select COMMON_CLK_VERSATILE
 	select CPU_ARM926T
 	select ICST
 	select MFD_SYSCON
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 18951cd20d9d..2d1fdec4c230 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -7,7 +7,6 @@ menuconfig ARCH_VEXPRESS
 	select ARM_GIC
 	select ARM_GLOBAL_TIMER
 	select ARM_TIMER_SP804
-	select COMMON_CLK_VERSATILE
 	select GPIOLIB
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 5c38dc56b808..25cbb556d863 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -274,7 +274,6 @@ config ARCH_UNIPHIER
 
 config ARCH_VEXPRESS
 	bool "ARMv8 software model (Versatile Express)"
-	select COMMON_CLK_VERSATILE
 	select GPIOLIB
 	select PM
 	select PM_GENERIC_DOMAINS
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index f4169cc2fd31..fb30c16e1596 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -114,7 +114,7 @@ obj-$(CONFIG_ARCH_TEGRA)		+= tegra/
 obj-y					+= ti/
 obj-$(CONFIG_CLK_UNIPHIER)		+= uniphier/
 obj-$(CONFIG_ARCH_U8500)		+= ux500/
-obj-$(CONFIG_COMMON_CLK_VERSATILE)	+= versatile/
+obj-y					+= versatile/
 ifeq ($(CONFIG_COMMON_CLK), y)
 obj-$(CONFIG_X86)			+= x86/
 endif
diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
index c2618f1477a2..3465fb291998 100644
--- a/drivers/clk/versatile/Kconfig
+++ b/drivers/clk/versatile/Kconfig
@@ -1,22 +1,14 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config ICST
-	bool
-
-config COMMON_CLK_VERSATILE
-	bool "Clock driver for ARM Reference designs"
-	depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
-		ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
-		COMPILE_TEST
+	bool "Clock driver for ARM Reference designs ICST" if COMPILE_TEST
 	select REGMAP_MMIO
 	---help---
 	  Supports clocking on ARM Reference designs:
 	  - Integrator/AP and Integrator/CP
 	  - RealView PB1176, EB, PB11MP and PBX
-	  - Versatile Express
 
 config CLK_SP810
 	bool "Clock driver for ARM SP810 System Controller"
-	depends on COMMON_CLK_VERSATILE
 	default y if ARCH_VEXPRESS
 	---help---
 	  Supports clock muxing (REFCLK/TIMCLK to TIMERCLKEN0-3) capabilities
@@ -24,8 +16,7 @@ config CLK_SP810
 
 config CLK_VEXPRESS_OSC
 	bool "Clock driver for Versatile Express OSC clock generators"
-	depends on COMMON_CLK_VERSATILE
-	depends on VEXPRESS_CONFIG
+	depends on VEXPRESS_CONFIG || COMPILE_TEST
 	default y if ARCH_VEXPRESS
 	---help---
 	  Simple regmap-based driver driving clock generators on Versatile
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:07   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

While 64-bit Arm reference platforms have SP810 for clocks for SP804
timers, they are not needed since the arch timers are used instead.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/clk/versatile/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
index 3465fb291998..5bdd5c98990b 100644
--- a/drivers/clk/versatile/Kconfig
+++ b/drivers/clk/versatile/Kconfig
@@ -9,7 +9,7 @@ config ICST
 
 config CLK_SP810
 	bool "Clock driver for ARM SP810 System Controller"
-	default y if ARCH_VEXPRESS
+	default y if (ARCH_VEXPRESS && ARM)
 	---help---
 	  Supports clock muxing (REFCLK/TIMCLK to TIMERCLKEN0-3) capabilities
 	  of the ARM SP810 System Controller cell.
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
@ 2020-04-19 17:07   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:07 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

While 64-bit Arm reference platforms have SP810 for clocks for SP804
timers, they are not needed since the arch timers are used instead.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/clk/versatile/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
index 3465fb291998..5bdd5c98990b 100644
--- a/drivers/clk/versatile/Kconfig
+++ b/drivers/clk/versatile/Kconfig
@@ -9,7 +9,7 @@ config ICST
 
 config CLK_SP810
 	bool "Clock driver for ARM SP810 System Controller"
-	default y if ARCH_VEXPRESS
+	default y if (ARCH_VEXPRESS && ARM)
 	---help---
 	  Supports clock muxing (REFCLK/TIMCLK to TIMERCLKEN0-3) capabilities
 	  of the ARM SP810 System Controller cell.
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

In preparation to enable the vexpress-osc clock driver as a module,
convert the driver to use the managed devres clock API variants. With
this, a driver .remove() hook is not needed.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/clk/versatile/clk-vexpress-osc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
index 7ade146a3ea9..5bb1d5a714d0 100644
--- a/drivers/clk/versatile/clk-vexpress-osc.c
+++ b/drivers/clk/versatile/clk-vexpress-osc.c
@@ -65,8 +65,8 @@ static int vexpress_osc_probe(struct platform_device *pdev)
 {
 	struct clk_init_data init;
 	struct vexpress_osc *osc;
-	struct clk *clk;
 	u32 range[2];
+	int ret;
 
 	osc = devm_kzalloc(&pdev->dev, sizeof(*osc), GFP_KERNEL);
 	if (!osc)
@@ -92,11 +92,11 @@ static int vexpress_osc_probe(struct platform_device *pdev)
 
 	osc->hw.init = &init;
 
-	clk = clk_register(NULL, &osc->hw);
-	if (IS_ERR(clk))
-		return PTR_ERR(clk);
+	ret = devm_clk_hw_register(&pdev->dev, &osc->hw);
+	if (ret < 0)
+		return ret;
 
-	of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, clk);
+	devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, &osc->hw);
 	clk_hw_set_rate_range(&osc->hw, osc->rate_min, osc->rate_max);
 
 	dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

In preparation to enable the vexpress-osc clock driver as a module,
convert the driver to use the managed devres clock API variants. With
this, a driver .remove() hook is not needed.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/clk/versatile/clk-vexpress-osc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
index 7ade146a3ea9..5bb1d5a714d0 100644
--- a/drivers/clk/versatile/clk-vexpress-osc.c
+++ b/drivers/clk/versatile/clk-vexpress-osc.c
@@ -65,8 +65,8 @@ static int vexpress_osc_probe(struct platform_device *pdev)
 {
 	struct clk_init_data init;
 	struct vexpress_osc *osc;
-	struct clk *clk;
 	u32 range[2];
+	int ret;
 
 	osc = devm_kzalloc(&pdev->dev, sizeof(*osc), GFP_KERNEL);
 	if (!osc)
@@ -92,11 +92,11 @@ static int vexpress_osc_probe(struct platform_device *pdev)
 
 	osc->hw.init = &init;
 
-	clk = clk_register(NULL, &osc->hw);
-	if (IS_ERR(clk))
-		return PTR_ERR(clk);
+	ret = devm_clk_hw_register(&pdev->dev, &osc->hw);
+	if (ret < 0)
+		return ret;
 
-	of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, clk);
+	devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, &osc->hw);
 	clk_hw_set_rate_range(&osc->hw, osc->rate_min, osc->rate_max);
 
 	dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name);
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 08/17] clk: vexpress-osc: Support building as a module
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm, Michael Turquette

Enable building the vexpress-osc clock driver as a module.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/clk/versatile/Kconfig            |  4 ++--
 drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
index 5bdd5c98990b..9de2396dcf9b 100644
--- a/drivers/clk/versatile/Kconfig
+++ b/drivers/clk/versatile/Kconfig
@@ -15,8 +15,8 @@ config CLK_SP810
 	  of the ARM SP810 System Controller cell.
 
 config CLK_VEXPRESS_OSC
-	bool "Clock driver for Versatile Express OSC clock generators"
-	depends on VEXPRESS_CONFIG || COMPILE_TEST
+	tristate "Clock driver for Versatile Express OSC clock generators"
+	depends on VEXPRESS_CONFIG
 	default y if ARCH_VEXPRESS
 	---help---
 	  Simple regmap-based driver driving clock generators on Versatile
diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
index 5bb1d5a714d0..b2b32fa2d7c3 100644
--- a/drivers/clk/versatile/clk-vexpress-osc.c
+++ b/drivers/clk/versatile/clk-vexpress-osc.c
@@ -7,6 +7,7 @@
 #include <linux/clkdev.h>
 #include <linux/clk-provider.h>
 #include <linux/err.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
@@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
 	{ .compatible = "arm,vexpress-osc", },
 	{}
 };
+MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
 
 static struct platform_driver vexpress_osc_driver = {
 	.driver	= {
@@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
 	},
 	.probe = vexpress_osc_probe,
 };
-
-static int __init vexpress_osc_init(void)
-{
-	return platform_driver_register(&vexpress_osc_driver);
-}
-core_initcall(vexpress_osc_init);
+module_platform_driver(vexpress_osc_driver);
+MODULE_LICENSE("GPL v2");
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 08/17] clk: vexpress-osc: Support building as a module
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Michael Turquette, Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

Enable building the vexpress-osc clock driver as a module.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/clk/versatile/Kconfig            |  4 ++--
 drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
index 5bdd5c98990b..9de2396dcf9b 100644
--- a/drivers/clk/versatile/Kconfig
+++ b/drivers/clk/versatile/Kconfig
@@ -15,8 +15,8 @@ config CLK_SP810
 	  of the ARM SP810 System Controller cell.
 
 config CLK_VEXPRESS_OSC
-	bool "Clock driver for Versatile Express OSC clock generators"
-	depends on VEXPRESS_CONFIG || COMPILE_TEST
+	tristate "Clock driver for Versatile Express OSC clock generators"
+	depends on VEXPRESS_CONFIG
 	default y if ARCH_VEXPRESS
 	---help---
 	  Simple regmap-based driver driving clock generators on Versatile
diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
index 5bb1d5a714d0..b2b32fa2d7c3 100644
--- a/drivers/clk/versatile/clk-vexpress-osc.c
+++ b/drivers/clk/versatile/clk-vexpress-osc.c
@@ -7,6 +7,7 @@
 #include <linux/clkdev.h>
 #include <linux/clk-provider.h>
 #include <linux/err.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
@@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
 	{ .compatible = "arm,vexpress-osc", },
 	{}
 };
+MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
 
 static struct platform_driver vexpress_osc_driver = {
 	.driver	= {
@@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
 	},
 	.probe = vexpress_osc_probe,
 };
-
-static int __init vexpress_osc_init(void)
-{
-	return platform_driver_register(&vexpress_osc_driver);
-}
-core_initcall(vexpress_osc_init);
+module_platform_driver(vexpress_osc_driver);
+MODULE_LICENSE("GPL v2");
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 09/17] mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

Nothing in the VExpress sysregs nor the MFD child drivers use
CONFIG_CLKSRC_MMIO. There's the 24MHz counter, but that's handled by
drivers/clocksource/timer-versatile.c which doesn't use
CONFIG_CLKSRC_MMIO either. So let's just drop CONFIG_CLKSRC_MMIO.

As the !ARCH_USES_GETTIMEOFFSET dependency was added for
CONFIG_CLKSRC_MMIO, that can be dropped, too.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/mfd/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 0a59249198d3..b1311dea2da1 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -2029,9 +2029,8 @@ endmenu
 
 config MFD_VEXPRESS_SYSREG
 	bool "Versatile Express System Registers"
-	depends on VEXPRESS_CONFIG && GPIOLIB && !ARCH_USES_GETTIMEOFFSET
+	depends on VEXPRESS_CONFIG && GPIOLIB
 	default y
-	select CLKSRC_MMIO
 	select GPIO_GENERIC_PLATFORM
 	select MFD_CORE
 	select MFD_SYSCON
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 09/17] mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

Nothing in the VExpress sysregs nor the MFD child drivers use
CONFIG_CLKSRC_MMIO. There's the 24MHz counter, but that's handled by
drivers/clocksource/timer-versatile.c which doesn't use
CONFIG_CLKSRC_MMIO either. So let's just drop CONFIG_CLKSRC_MMIO.

As the !ARCH_USES_GETTIMEOFFSET dependency was added for
CONFIG_CLKSRC_MMIO, that can be dropped, too.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/mfd/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 0a59249198d3..b1311dea2da1 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -2029,9 +2029,8 @@ endmenu
 
 config MFD_VEXPRESS_SYSREG
 	bool "Versatile Express System Registers"
-	depends on VEXPRESS_CONFIG && GPIOLIB && !ARCH_USES_GETTIMEOFFSET
+	depends on VEXPRESS_CONFIG && GPIOLIB
 	default y
-	select CLKSRC_MMIO
 	select GPIO_GENERIC_PLATFORM
 	select MFD_CORE
 	select MFD_SYSCON
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 10/17] mfd: vexpress-sysreg: Drop unused syscon child devices
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/mfd/vexpress-sysreg.c | 36 -----------------------------------
 1 file changed, 36 deletions(-)

diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index 0b9cc67706c7..90a4eda2ba2b 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -43,10 +43,6 @@
 
 /* The sysreg block is just a random collection of various functions... */
 
-static struct syscon_platform_data vexpress_sysreg_sys_id_pdata = {
-	.label = "sys_id",
-};
-
 static struct bgpio_pdata vexpress_sysreg_sys_led_pdata = {
 	.label = "sys_led",
 	.base = -1,
@@ -65,24 +61,8 @@ static struct bgpio_pdata vexpress_sysreg_sys_flash_pdata = {
 	.ngpio = 1,
 };
 
-static struct syscon_platform_data vexpress_sysreg_sys_misc_pdata = {
-	.label = "sys_misc",
-};
-
-static struct syscon_platform_data vexpress_sysreg_sys_procid_pdata = {
-	.label = "sys_procid",
-};
-
 static struct mfd_cell vexpress_sysreg_cells[] = {
 	{
-		.name = "syscon",
-		.num_resources = 1,
-		.resources = (struct resource []) {
-			DEFINE_RES_MEM(SYS_ID, 0x4),
-		},
-		.platform_data = &vexpress_sysreg_sys_id_pdata,
-		.pdata_size = sizeof(vexpress_sysreg_sys_id_pdata),
-	}, {
 		.name = "basic-mmio-gpio",
 		.of_compatible = "arm,vexpress-sysreg,sys_led",
 		.num_resources = 1,
@@ -109,22 +89,6 @@ static struct mfd_cell vexpress_sysreg_cells[] = {
 		},
 		.platform_data = &vexpress_sysreg_sys_flash_pdata,
 		.pdata_size = sizeof(vexpress_sysreg_sys_flash_pdata),
-	}, {
-		.name = "syscon",
-		.num_resources = 1,
-		.resources = (struct resource []) {
-			DEFINE_RES_MEM(SYS_MISC, 0x4),
-		},
-		.platform_data = &vexpress_sysreg_sys_misc_pdata,
-		.pdata_size = sizeof(vexpress_sysreg_sys_misc_pdata),
-	}, {
-		.name = "syscon",
-		.num_resources = 1,
-		.resources = (struct resource []) {
-			DEFINE_RES_MEM(SYS_PROCID0, 0x8),
-		},
-		.platform_data = &vexpress_sysreg_sys_procid_pdata,
-		.pdata_size = sizeof(vexpress_sysreg_sys_procid_pdata),
 	}, {
 		.name = "vexpress-syscfg",
 		.num_resources = 1,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 10/17] mfd: vexpress-sysreg: Drop unused syscon child devices
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/mfd/vexpress-sysreg.c | 36 -----------------------------------
 1 file changed, 36 deletions(-)

diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index 0b9cc67706c7..90a4eda2ba2b 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -43,10 +43,6 @@
 
 /* The sysreg block is just a random collection of various functions... */
 
-static struct syscon_platform_data vexpress_sysreg_sys_id_pdata = {
-	.label = "sys_id",
-};
-
 static struct bgpio_pdata vexpress_sysreg_sys_led_pdata = {
 	.label = "sys_led",
 	.base = -1,
@@ -65,24 +61,8 @@ static struct bgpio_pdata vexpress_sysreg_sys_flash_pdata = {
 	.ngpio = 1,
 };
 
-static struct syscon_platform_data vexpress_sysreg_sys_misc_pdata = {
-	.label = "sys_misc",
-};
-
-static struct syscon_platform_data vexpress_sysreg_sys_procid_pdata = {
-	.label = "sys_procid",
-};
-
 static struct mfd_cell vexpress_sysreg_cells[] = {
 	{
-		.name = "syscon",
-		.num_resources = 1,
-		.resources = (struct resource []) {
-			DEFINE_RES_MEM(SYS_ID, 0x4),
-		},
-		.platform_data = &vexpress_sysreg_sys_id_pdata,
-		.pdata_size = sizeof(vexpress_sysreg_sys_id_pdata),
-	}, {
 		.name = "basic-mmio-gpio",
 		.of_compatible = "arm,vexpress-sysreg,sys_led",
 		.num_resources = 1,
@@ -109,22 +89,6 @@ static struct mfd_cell vexpress_sysreg_cells[] = {
 		},
 		.platform_data = &vexpress_sysreg_sys_flash_pdata,
 		.pdata_size = sizeof(vexpress_sysreg_sys_flash_pdata),
-	}, {
-		.name = "syscon",
-		.num_resources = 1,
-		.resources = (struct resource []) {
-			DEFINE_RES_MEM(SYS_MISC, 0x4),
-		},
-		.platform_data = &vexpress_sysreg_sys_misc_pdata,
-		.pdata_size = sizeof(vexpress_sysreg_sys_misc_pdata),
-	}, {
-		.name = "syscon",
-		.num_resources = 1,
-		.resources = (struct resource []) {
-			DEFINE_RES_MEM(SYS_PROCID0, 0x8),
-		},
-		.platform_data = &vexpress_sysreg_sys_procid_pdata,
-		.pdata_size = sizeof(vexpress_sysreg_sys_procid_pdata),
 	}, {
 		.name = "vexpress-syscfg",
 		.num_resources = 1,
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 11/17] mfd: vexpress-sysreg: Use devres API variants
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

Use the managed devm_gpiochip_add_data() and devm_mfd_add_devices()
instead of their unmanaged counterparts. With this, no .remove() hook is
needed for driver unbind.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/mfd/vexpress-sysreg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index 90a4eda2ba2b..9fb37fa689e0 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -140,9 +140,9 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
 	bgpio_init(mmc_gpio_chip, &pdev->dev, 0x4, base + SYS_MCI,
 			NULL, NULL, NULL, NULL, 0);
 	mmc_gpio_chip->ngpio = 2;
-	gpiochip_add_data(mmc_gpio_chip, NULL);
+	devm_gpiochip_add_data(&pdev->dev, mmc_gpio_chip, NULL);
 
-	return mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
+	return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
 			vexpress_sysreg_cells,
 			ARRAY_SIZE(vexpress_sysreg_cells), mem, 0, NULL);
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 11/17] mfd: vexpress-sysreg: Use devres API variants
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

Use the managed devm_gpiochip_add_data() and devm_mfd_add_devices()
instead of their unmanaged counterparts. With this, no .remove() hook is
needed for driver unbind.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/mfd/vexpress-sysreg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index 90a4eda2ba2b..9fb37fa689e0 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -140,9 +140,9 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
 	bgpio_init(mmc_gpio_chip, &pdev->dev, 0x4, base + SYS_MCI,
 			NULL, NULL, NULL, NULL, 0);
 	mmc_gpio_chip->ngpio = 2;
-	gpiochip_add_data(mmc_gpio_chip, NULL);
+	devm_gpiochip_add_data(&pdev->dev, mmc_gpio_chip, NULL);
 
-	return mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
+	return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
 			vexpress_sysreg_cells,
 			ARRAY_SIZE(vexpress_sysreg_cells), mem, 0, NULL);
 }
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 12/17] mfd: vexpress-sysreg: Support building as a module
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

Enable building the vexpress-sysreg driver as a module.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/mfd/Kconfig           |  2 +-
 drivers/mfd/vexpress-sysreg.c | 15 ++++-----------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index b1311dea2da1..792766558328 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -2028,7 +2028,7 @@ config MCP_UCB1200_TS
 endmenu
 
 config MFD_VEXPRESS_SYSREG
-	bool "Versatile Express System Registers"
+	tristate "Versatile Express System Registers"
 	depends on VEXPRESS_CONFIG && GPIOLIB
 	default y
 	select GPIO_GENERIC_PLATFORM
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index 9fb37fa689e0..eeeeb1d26d5d 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -8,6 +8,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/mfd/core.h>
+#include <linux/module.h>
 #include <linux/of_platform.h>
 #include <linux/platform_data/syscon.h>
 #include <linux/platform_device.h>
@@ -151,6 +152,7 @@ static const struct of_device_id vexpress_sysreg_match[] = {
 	{ .compatible = "arm,vexpress-sysreg", },
 	{},
 };
+MODULE_DEVICE_TABLE(of, vexpress_sysreg_match);
 
 static struct platform_driver vexpress_sysreg_driver = {
 	.driver = {
@@ -160,14 +162,5 @@ static struct platform_driver vexpress_sysreg_driver = {
 	.probe = vexpress_sysreg_probe,
 };
 
-static int __init vexpress_sysreg_init(void)
-{
-	struct device_node *node;
-
-	/* Need the sysreg early, before any other device... */
-	for_each_matching_node(node, vexpress_sysreg_match)
-		of_platform_device_create(node, NULL, NULL);
-
-	return platform_driver_register(&vexpress_sysreg_driver);
-}
-core_initcall(vexpress_sysreg_init);
+module_platform_driver(vexpress_sysreg_driver);
+MODULE_LICENSE("GPL v2");
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 12/17] mfd: vexpress-sysreg: Support building as a module
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

Enable building the vexpress-sysreg driver as a module.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/mfd/Kconfig           |  2 +-
 drivers/mfd/vexpress-sysreg.c | 15 ++++-----------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index b1311dea2da1..792766558328 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -2028,7 +2028,7 @@ config MCP_UCB1200_TS
 endmenu
 
 config MFD_VEXPRESS_SYSREG
-	bool "Versatile Express System Registers"
+	tristate "Versatile Express System Registers"
 	depends on VEXPRESS_CONFIG && GPIOLIB
 	default y
 	select GPIO_GENERIC_PLATFORM
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index 9fb37fa689e0..eeeeb1d26d5d 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -8,6 +8,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/mfd/core.h>
+#include <linux/module.h>
 #include <linux/of_platform.h>
 #include <linux/platform_data/syscon.h>
 #include <linux/platform_device.h>
@@ -151,6 +152,7 @@ static const struct of_device_id vexpress_sysreg_match[] = {
 	{ .compatible = "arm,vexpress-sysreg", },
 	{},
 };
+MODULE_DEVICE_TABLE(of, vexpress_sysreg_match);
 
 static struct platform_driver vexpress_sysreg_driver = {
 	.driver = {
@@ -160,14 +162,5 @@ static struct platform_driver vexpress_sysreg_driver = {
 	.probe = vexpress_sysreg_probe,
 };
 
-static int __init vexpress_sysreg_init(void)
-{
-	struct device_node *node;
-
-	/* Need the sysreg early, before any other device... */
-	for_each_matching_node(node, vexpress_sysreg_match)
-		of_platform_device_create(node, NULL, NULL);
-
-	return platform_driver_register(&vexpress_sysreg_driver);
-}
-core_initcall(vexpress_sysreg_init);
+module_platform_driver(vexpress_sysreg_driver);
+MODULE_LICENSE("GPL v2");
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 13/17] bus: vexpress-config: Merge vexpress-syscfg into vexpress-config
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

The only thing that vexpress-syscfg does is provide a regmap to
vexpress-config bus child devices. There's little reason to have 2
components for this. The current structure with initcall ordering
requirements makes turning these components into modules more difficult.

So let's start to simplify things and merge vexpress-syscfg into
vexpress-config. There's no functional change in this commit and it's
still separate components until subsequent commits.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm/mach-vexpress/Kconfig |   1 -
 drivers/bus/vexpress-config.c  | 283 +++++++++++++++++++++++++++++++--
 drivers/misc/Kconfig           |   9 --
 drivers/misc/Makefile          |   1 -
 drivers/misc/vexpress-syscfg.c | 280 --------------------------------
 include/linux/vexpress.h       |  17 --
 6 files changed, 274 insertions(+), 317 deletions(-)
 delete mode 100644 drivers/misc/vexpress-syscfg.c

diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 2d1fdec4c230..065e12991663 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -20,7 +20,6 @@ menuconfig ARCH_VEXPRESS
 	select REGULATOR if MMC_ARMMMCI
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 	select VEXPRESS_CONFIG
-	select VEXPRESS_SYSCFG
 	help
 	  This option enables support for systems using Cortex processor based
 	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index ff70575b2db6..43f5beac9811 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -6,10 +6,48 @@
 
 #include <linux/err.h>
 #include <linux/init.h>
+#include <linux/io.h>
 #include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/of_device.h>
+#include <linux/sched/signal.h>
+#include <linux/slab.h>
 #include <linux/vexpress.h>
 
+#define SYS_CFGDATA		0x0
+
+#define SYS_CFGCTRL		0x4
+#define SYS_CFGCTRL_START	(1 << 31)
+#define SYS_CFGCTRL_WRITE	(1 << 30)
+#define SYS_CFGCTRL_DCC(n)	(((n) & 0xf) << 26)
+#define SYS_CFGCTRL_FUNC(n)	(((n) & 0x3f) << 20)
+#define SYS_CFGCTRL_SITE(n)	(((n) & 0x3) << 16)
+#define SYS_CFGCTRL_POSITION(n)	(((n) & 0xf) << 12)
+#define SYS_CFGCTRL_DEVICE(n)	(((n) & 0xfff) << 0)
+
+#define SYS_CFGSTAT		0x8
+#define SYS_CFGSTAT_ERR		(1 << 1)
+#define SYS_CFGSTAT_COMPLETE	(1 << 0)
+
+
+struct vexpress_syscfg {
+	struct device *dev;
+	void __iomem *base;
+	struct list_head funcs;
+};
+
+struct vexpress_syscfg_func {
+	struct list_head list;
+	struct vexpress_syscfg *syscfg;
+	struct regmap *regmap;
+	int num_templates;
+	u32 template[]; /* Keep it last! */
+};
+
+struct vexpress_config_bridge_ops {
+	struct regmap * (*regmap_init)(struct device *dev, void *context);
+	void (*regmap_exit)(struct regmap *regmap, void *context);
+};
 
 struct vexpress_config_bridge {
 	struct vexpress_config_bridge_ops *ops;
@@ -27,17 +65,12 @@ void vexpress_config_set_master(u32 site)
 	vexpress_config_site_master = site;
 }
 
-u32 vexpress_config_get_master(void)
-{
-	return vexpress_config_site_master;
-}
-
-void vexpress_config_lock(void *arg)
+static void vexpress_config_lock(void *arg)
 {
 	mutex_lock(&vexpress_config_mutex);
 }
 
-void vexpress_config_unlock(void *arg)
+static void vexpress_config_unlock(void *arg)
 {
 	mutex_unlock(&vexpress_config_mutex);
 }
@@ -59,7 +92,7 @@ static void vexpress_config_find_prop(struct device_node *node,
 	}
 }
 
-int vexpress_config_get_topo(struct device_node *node, u32 *site,
+static int vexpress_config_get_topo(struct device_node *node, u32 *site,
 		u32 *position, u32 *dcc)
 {
 	vexpress_config_find_prop(node, "arm,vexpress,site", site);
@@ -113,7 +146,7 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
 
-struct device *vexpress_config_bridge_register(struct device *parent,
+static struct device *vexpress_config_bridge_register(struct device *parent,
 		struct vexpress_config_bridge_ops *ops, void *context)
 {
 	struct device *dev;
@@ -201,3 +234,235 @@ static int __init vexpress_config_init(void)
 }
 postcore_initcall(vexpress_config_init);
 
+static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
+		int index, bool write, u32 *data)
+{
+	struct vexpress_syscfg *syscfg = func->syscfg;
+	u32 command, status;
+	int tries;
+	long timeout;
+
+	if (WARN_ON(index >= func->num_templates))
+		return -EINVAL;
+
+	command = readl(syscfg->base + SYS_CFGCTRL);
+	if (WARN_ON(command & SYS_CFGCTRL_START))
+		return -EBUSY;
+
+	command = func->template[index];
+	command |= SYS_CFGCTRL_START;
+	command |= write ? SYS_CFGCTRL_WRITE : 0;
+
+	/* Use a canary for reads */
+	if (!write)
+		*data = 0xdeadbeef;
+
+	dev_dbg(syscfg->dev, "func %p, command %x, data %x\n",
+			func, command, *data);
+	writel(*data, syscfg->base + SYS_CFGDATA);
+	writel(0, syscfg->base + SYS_CFGSTAT);
+	writel(command, syscfg->base + SYS_CFGCTRL);
+	mb();
+
+	/* The operation can take ages... Go to sleep, 100us initially */
+	tries = 100;
+	timeout = 100;
+	do {
+		if (!irqs_disabled()) {
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(usecs_to_jiffies(timeout));
+			if (signal_pending(current))
+				return -EINTR;
+		} else {
+			udelay(timeout);
+		}
+
+		status = readl(syscfg->base + SYS_CFGSTAT);
+		if (status & SYS_CFGSTAT_ERR)
+			return -EFAULT;
+
+		if (timeout > 20)
+			timeout -= 20;
+	} while (--tries && !(status & SYS_CFGSTAT_COMPLETE));
+	if (WARN_ON_ONCE(!tries))
+		return -ETIMEDOUT;
+
+	if (!write) {
+		*data = readl(syscfg->base + SYS_CFGDATA);
+		dev_dbg(syscfg->dev, "func %p, read data %x\n", func, *data);
+	}
+
+	return 0;
+}
+
+static int vexpress_syscfg_read(void *context, unsigned int index,
+		unsigned int *val)
+{
+	struct vexpress_syscfg_func *func = context;
+
+	return vexpress_syscfg_exec(func, index, false, val);
+}
+
+static int vexpress_syscfg_write(void *context, unsigned int index,
+		unsigned int val)
+{
+	struct vexpress_syscfg_func *func = context;
+
+	return vexpress_syscfg_exec(func, index, true, &val);
+}
+
+static struct regmap_config vexpress_syscfg_regmap_config = {
+	.lock = vexpress_config_lock,
+	.unlock = vexpress_config_unlock,
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_read = vexpress_syscfg_read,
+	.reg_write = vexpress_syscfg_write,
+	.reg_format_endian = REGMAP_ENDIAN_LITTLE,
+	.val_format_endian = REGMAP_ENDIAN_LITTLE,
+};
+
+
+static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,
+		void *context)
+{
+	int err;
+	struct vexpress_syscfg *syscfg = context;
+	struct vexpress_syscfg_func *func;
+	struct property *prop;
+	const __be32 *val = NULL;
+	__be32 energy_quirk[4];
+	int num;
+	u32 site, position, dcc;
+	int i;
+
+	err = vexpress_config_get_topo(dev->of_node, &site,
+				&position, &dcc);
+	if (err)
+		return ERR_PTR(err);
+
+	prop = of_find_property(dev->of_node,
+			"arm,vexpress-sysreg,func", NULL);
+	if (!prop)
+		return ERR_PTR(-EINVAL);
+
+	num = prop->length / sizeof(u32) / 2;
+	val = prop->value;
+
+	/*
+	 * "arm,vexpress-energy" function used to be described
+	 * by its first device only, now it requires both
+	 */
+	if (num == 1 && of_device_is_compatible(dev->of_node,
+			"arm,vexpress-energy")) {
+		num = 2;
+		energy_quirk[0] = *val;
+		energy_quirk[2] = *val++;
+		energy_quirk[1] = *val;
+		energy_quirk[3] = cpu_to_be32(be32_to_cpup(val) + 1);
+		val = energy_quirk;
+	}
+
+	func = kzalloc(struct_size(func, template, num), GFP_KERNEL);
+	if (!func)
+		return ERR_PTR(-ENOMEM);
+
+	func->syscfg = syscfg;
+	func->num_templates = num;
+
+	for (i = 0; i < num; i++) {
+		u32 function, device;
+
+		function = be32_to_cpup(val++);
+		device = be32_to_cpup(val++);
+
+		dev_dbg(dev, "func %p: %u/%u/%u/%u/%u\n",
+				func, site, position, dcc,
+				function, device);
+
+		func->template[i] = SYS_CFGCTRL_DCC(dcc);
+		func->template[i] |= SYS_CFGCTRL_SITE(site);
+		func->template[i] |= SYS_CFGCTRL_POSITION(position);
+		func->template[i] |= SYS_CFGCTRL_FUNC(function);
+		func->template[i] |= SYS_CFGCTRL_DEVICE(device);
+	}
+
+	vexpress_syscfg_regmap_config.max_register = num - 1;
+
+	func->regmap = regmap_init(dev, NULL, func,
+			&vexpress_syscfg_regmap_config);
+
+	if (IS_ERR(func->regmap)) {
+		void *err = func->regmap;
+
+		kfree(func);
+		return err;
+	}
+
+	list_add(&func->list, &syscfg->funcs);
+
+	return func->regmap;
+}
+
+static void vexpress_syscfg_regmap_exit(struct regmap *regmap, void *context)
+{
+	struct vexpress_syscfg *syscfg = context;
+	struct vexpress_syscfg_func *func, *tmp;
+
+	regmap_exit(regmap);
+
+	list_for_each_entry_safe(func, tmp, &syscfg->funcs, list) {
+		if (func->regmap == regmap) {
+			list_del(&syscfg->funcs);
+			kfree(func);
+			break;
+		}
+	}
+}
+
+static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = {
+	.regmap_init = vexpress_syscfg_regmap_init,
+	.regmap_exit = vexpress_syscfg_regmap_exit,
+};
+
+
+static int vexpress_syscfg_probe(struct platform_device *pdev)
+{
+	struct vexpress_syscfg *syscfg;
+	struct resource *res;
+	struct device *bridge;
+
+	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
+	if (!syscfg)
+		return -ENOMEM;
+	syscfg->dev = &pdev->dev;
+	INIT_LIST_HEAD(&syscfg->funcs);
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	syscfg->base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(syscfg->base))
+		return PTR_ERR(syscfg->base);
+
+	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
+	bridge = vexpress_config_bridge_register(pdev->dev.parent,
+			&vexpress_syscfg_bridge_ops, syscfg);
+
+	return PTR_ERR_OR_ZERO(bridge);
+}
+
+static const struct platform_device_id vexpress_syscfg_id_table[] = {
+	{ "vexpress-syscfg", },
+	{},
+};
+
+static struct platform_driver vexpress_syscfg_driver = {
+	.driver.name = "vexpress-syscfg",
+	.id_table = vexpress_syscfg_id_table,
+	.probe = vexpress_syscfg_probe,
+};
+
+static int __init vexpress_syscfg_init(void)
+{
+	return platform_driver_register(&vexpress_syscfg_driver);
+}
+core_initcall(vexpress_syscfg_init);
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 99e151475d8f..edd5dd5ebfdc 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -423,15 +423,6 @@ config SRAM
 config SRAM_EXEC
 	bool
 
-config VEXPRESS_SYSCFG
-	bool "Versatile Express System Configuration driver"
-	depends on VEXPRESS_CONFIG
-	default y
-	help
-	  ARM Ltd. Versatile Express uses specialised platform configuration
-	  bus. System Configuration interface is one of the possible means
-	  of generating transactions on this bus.
-
 config PCI_ENDPOINT_TEST
 	depends on PCI
 	select CRC32
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 9abf2923d831..c7bd01ac6291 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -49,7 +49,6 @@ obj-$(CONFIG_SRAM_EXEC)		+= sram-exec.o
 obj-y				+= mic/
 obj-$(CONFIG_GENWQE)		+= genwqe/
 obj-$(CONFIG_ECHO)		+= echo/
-obj-$(CONFIG_VEXPRESS_SYSCFG)	+= vexpress-syscfg.o
 obj-$(CONFIG_CXL_BASE)		+= cxl/
 obj-$(CONFIG_PCI_ENDPOINT_TEST)	+= pci_endpoint_test.o
 obj-$(CONFIG_OCXL)		+= ocxl/
diff --git a/drivers/misc/vexpress-syscfg.c b/drivers/misc/vexpress-syscfg.c
deleted file mode 100644
index a431787c0898..000000000000
--- a/drivers/misc/vexpress-syscfg.c
+++ /dev/null
@@ -1,280 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- *
- * Copyright (C) 2014 ARM Limited
- */
-
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/platform_device.h>
-#include <linux/sched/signal.h>
-#include <linux/slab.h>
-#include <linux/syscore_ops.h>
-#include <linux/vexpress.h>
-
-
-#define SYS_CFGDATA		0x0
-
-#define SYS_CFGCTRL		0x4
-#define SYS_CFGCTRL_START	(1 << 31)
-#define SYS_CFGCTRL_WRITE	(1 << 30)
-#define SYS_CFGCTRL_DCC(n)	(((n) & 0xf) << 26)
-#define SYS_CFGCTRL_FUNC(n)	(((n) & 0x3f) << 20)
-#define SYS_CFGCTRL_SITE(n)	(((n) & 0x3) << 16)
-#define SYS_CFGCTRL_POSITION(n)	(((n) & 0xf) << 12)
-#define SYS_CFGCTRL_DEVICE(n)	(((n) & 0xfff) << 0)
-
-#define SYS_CFGSTAT		0x8
-#define SYS_CFGSTAT_ERR		(1 << 1)
-#define SYS_CFGSTAT_COMPLETE	(1 << 0)
-
-
-struct vexpress_syscfg {
-	struct device *dev;
-	void __iomem *base;
-	struct list_head funcs;
-};
-
-struct vexpress_syscfg_func {
-	struct list_head list;
-	struct vexpress_syscfg *syscfg;
-	struct regmap *regmap;
-	int num_templates;
-	u32 template[]; /* Keep it last! */
-};
-
-
-static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
-		int index, bool write, u32 *data)
-{
-	struct vexpress_syscfg *syscfg = func->syscfg;
-	u32 command, status;
-	int tries;
-	long timeout;
-
-	if (WARN_ON(index >= func->num_templates))
-		return -EINVAL;
-
-	command = readl(syscfg->base + SYS_CFGCTRL);
-	if (WARN_ON(command & SYS_CFGCTRL_START))
-		return -EBUSY;
-
-	command = func->template[index];
-	command |= SYS_CFGCTRL_START;
-	command |= write ? SYS_CFGCTRL_WRITE : 0;
-
-	/* Use a canary for reads */
-	if (!write)
-		*data = 0xdeadbeef;
-
-	dev_dbg(syscfg->dev, "func %p, command %x, data %x\n",
-			func, command, *data);
-	writel(*data, syscfg->base + SYS_CFGDATA);
-	writel(0, syscfg->base + SYS_CFGSTAT);
-	writel(command, syscfg->base + SYS_CFGCTRL);
-	mb();
-
-	/* The operation can take ages... Go to sleep, 100us initially */
-	tries = 100;
-	timeout = 100;
-	do {
-		if (!irqs_disabled()) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(usecs_to_jiffies(timeout));
-			if (signal_pending(current))
-				return -EINTR;
-		} else {
-			udelay(timeout);
-		}
-
-		status = readl(syscfg->base + SYS_CFGSTAT);
-		if (status & SYS_CFGSTAT_ERR)
-			return -EFAULT;
-
-		if (timeout > 20)
-			timeout -= 20;
-	} while (--tries && !(status & SYS_CFGSTAT_COMPLETE));
-	if (WARN_ON_ONCE(!tries))
-		return -ETIMEDOUT;
-
-	if (!write) {
-		*data = readl(syscfg->base + SYS_CFGDATA);
-		dev_dbg(syscfg->dev, "func %p, read data %x\n", func, *data);
-	}
-
-	return 0;
-}
-
-static int vexpress_syscfg_read(void *context, unsigned int index,
-		unsigned int *val)
-{
-	struct vexpress_syscfg_func *func = context;
-
-	return vexpress_syscfg_exec(func, index, false, val);
-}
-
-static int vexpress_syscfg_write(void *context, unsigned int index,
-		unsigned int val)
-{
-	struct vexpress_syscfg_func *func = context;
-
-	return vexpress_syscfg_exec(func, index, true, &val);
-}
-
-static struct regmap_config vexpress_syscfg_regmap_config = {
-	.lock = vexpress_config_lock,
-	.unlock = vexpress_config_unlock,
-	.reg_bits = 32,
-	.val_bits = 32,
-	.reg_read = vexpress_syscfg_read,
-	.reg_write = vexpress_syscfg_write,
-	.reg_format_endian = REGMAP_ENDIAN_LITTLE,
-	.val_format_endian = REGMAP_ENDIAN_LITTLE,
-};
-
-
-static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,
-		void *context)
-{
-	int err;
-	struct vexpress_syscfg *syscfg = context;
-	struct vexpress_syscfg_func *func;
-	struct property *prop;
-	const __be32 *val = NULL;
-	__be32 energy_quirk[4];
-	int num;
-	u32 site, position, dcc;
-	int i;
-
-	err = vexpress_config_get_topo(dev->of_node, &site,
-				&position, &dcc);
-	if (err)
-		return ERR_PTR(err);
-
-	prop = of_find_property(dev->of_node,
-			"arm,vexpress-sysreg,func", NULL);
-	if (!prop)
-		return ERR_PTR(-EINVAL);
-
-	num = prop->length / sizeof(u32) / 2;
-	val = prop->value;
-
-	/*
-	 * "arm,vexpress-energy" function used to be described
-	 * by its first device only, now it requires both
-	 */
-	if (num == 1 && of_device_is_compatible(dev->of_node,
-			"arm,vexpress-energy")) {
-		num = 2;
-		energy_quirk[0] = *val;
-		energy_quirk[2] = *val++;
-		energy_quirk[1] = *val;
-		energy_quirk[3] = cpu_to_be32(be32_to_cpup(val) + 1);
-		val = energy_quirk;
-	}
-
-	func = kzalloc(struct_size(func, template, num), GFP_KERNEL);
-	if (!func)
-		return ERR_PTR(-ENOMEM);
-
-	func->syscfg = syscfg;
-	func->num_templates = num;
-
-	for (i = 0; i < num; i++) {
-		u32 function, device;
-
-		function = be32_to_cpup(val++);
-		device = be32_to_cpup(val++);
-
-		dev_dbg(dev, "func %p: %u/%u/%u/%u/%u\n",
-				func, site, position, dcc,
-				function, device);
-
-		func->template[i] = SYS_CFGCTRL_DCC(dcc);
-		func->template[i] |= SYS_CFGCTRL_SITE(site);
-		func->template[i] |= SYS_CFGCTRL_POSITION(position);
-		func->template[i] |= SYS_CFGCTRL_FUNC(function);
-		func->template[i] |= SYS_CFGCTRL_DEVICE(device);
-	}
-
-	vexpress_syscfg_regmap_config.max_register = num - 1;
-
-	func->regmap = regmap_init(dev, NULL, func,
-			&vexpress_syscfg_regmap_config);
-
-	if (IS_ERR(func->regmap)) {
-		void *err = func->regmap;
-
-		kfree(func);
-		return err;
-	}
-
-	list_add(&func->list, &syscfg->funcs);
-
-	return func->regmap;
-}
-
-static void vexpress_syscfg_regmap_exit(struct regmap *regmap, void *context)
-{
-	struct vexpress_syscfg *syscfg = context;
-	struct vexpress_syscfg_func *func, *tmp;
-
-	regmap_exit(regmap);
-
-	list_for_each_entry_safe(func, tmp, &syscfg->funcs, list) {
-		if (func->regmap == regmap) {
-			list_del(&syscfg->funcs);
-			kfree(func);
-			break;
-		}
-	}
-}
-
-static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = {
-	.regmap_init = vexpress_syscfg_regmap_init,
-	.regmap_exit = vexpress_syscfg_regmap_exit,
-};
-
-
-static int vexpress_syscfg_probe(struct platform_device *pdev)
-{
-	struct vexpress_syscfg *syscfg;
-	struct resource *res;
-	struct device *bridge;
-
-	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
-	if (!syscfg)
-		return -ENOMEM;
-	syscfg->dev = &pdev->dev;
-	INIT_LIST_HEAD(&syscfg->funcs);
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	syscfg->base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(syscfg->base))
-		return PTR_ERR(syscfg->base);
-
-	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
-	bridge = vexpress_config_bridge_register(pdev->dev.parent,
-			&vexpress_syscfg_bridge_ops, syscfg);
-
-	return PTR_ERR_OR_ZERO(bridge);
-}
-
-static const struct platform_device_id vexpress_syscfg_id_table[] = {
-	{ "vexpress-syscfg", },
-	{},
-};
-
-static struct platform_driver vexpress_syscfg_driver = {
-	.driver.name = "vexpress-syscfg",
-	.id_table = vexpress_syscfg_id_table,
-	.probe = vexpress_syscfg_probe,
-};
-
-static int __init vexpress_syscfg_init(void)
-{
-	return platform_driver_register(&vexpress_syscfg_driver);
-}
-core_initcall(vexpress_syscfg_init);
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
index 2ec7992b054c..65096c792d57 100644
--- a/include/linux/vexpress.h
+++ b/include/linux/vexpress.h
@@ -18,23 +18,6 @@
 /* Config infrastructure */
 
 void vexpress_config_set_master(u32 site);
-u32 vexpress_config_get_master(void);
-
-void vexpress_config_lock(void *arg);
-void vexpress_config_unlock(void *arg);
-
-int vexpress_config_get_topo(struct device_node *node, u32 *site,
-		u32 *position, u32 *dcc);
-
-/* Config bridge API */
-
-struct vexpress_config_bridge_ops {
-	struct regmap * (*regmap_init)(struct device *dev, void *context);
-	void (*regmap_exit)(struct regmap *regmap, void *context);
-};
-
-struct device *vexpress_config_bridge_register(struct device *parent,
-		struct vexpress_config_bridge_ops *ops, void *context);
 
 /* Config regmap API */
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 13/17] bus: vexpress-config: Merge vexpress-syscfg into vexpress-config
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

The only thing that vexpress-syscfg does is provide a regmap to
vexpress-config bus child devices. There's little reason to have 2
components for this. The current structure with initcall ordering
requirements makes turning these components into modules more difficult.

So let's start to simplify things and merge vexpress-syscfg into
vexpress-config. There's no functional change in this commit and it's
still separate components until subsequent commits.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm/mach-vexpress/Kconfig |   1 -
 drivers/bus/vexpress-config.c  | 283 +++++++++++++++++++++++++++++++--
 drivers/misc/Kconfig           |   9 --
 drivers/misc/Makefile          |   1 -
 drivers/misc/vexpress-syscfg.c | 280 --------------------------------
 include/linux/vexpress.h       |  17 --
 6 files changed, 274 insertions(+), 317 deletions(-)
 delete mode 100644 drivers/misc/vexpress-syscfg.c

diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 2d1fdec4c230..065e12991663 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -20,7 +20,6 @@ menuconfig ARCH_VEXPRESS
 	select REGULATOR if MMC_ARMMMCI
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 	select VEXPRESS_CONFIG
-	select VEXPRESS_SYSCFG
 	help
 	  This option enables support for systems using Cortex processor based
 	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index ff70575b2db6..43f5beac9811 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -6,10 +6,48 @@
 
 #include <linux/err.h>
 #include <linux/init.h>
+#include <linux/io.h>
 #include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/of_device.h>
+#include <linux/sched/signal.h>
+#include <linux/slab.h>
 #include <linux/vexpress.h>
 
+#define SYS_CFGDATA		0x0
+
+#define SYS_CFGCTRL		0x4
+#define SYS_CFGCTRL_START	(1 << 31)
+#define SYS_CFGCTRL_WRITE	(1 << 30)
+#define SYS_CFGCTRL_DCC(n)	(((n) & 0xf) << 26)
+#define SYS_CFGCTRL_FUNC(n)	(((n) & 0x3f) << 20)
+#define SYS_CFGCTRL_SITE(n)	(((n) & 0x3) << 16)
+#define SYS_CFGCTRL_POSITION(n)	(((n) & 0xf) << 12)
+#define SYS_CFGCTRL_DEVICE(n)	(((n) & 0xfff) << 0)
+
+#define SYS_CFGSTAT		0x8
+#define SYS_CFGSTAT_ERR		(1 << 1)
+#define SYS_CFGSTAT_COMPLETE	(1 << 0)
+
+
+struct vexpress_syscfg {
+	struct device *dev;
+	void __iomem *base;
+	struct list_head funcs;
+};
+
+struct vexpress_syscfg_func {
+	struct list_head list;
+	struct vexpress_syscfg *syscfg;
+	struct regmap *regmap;
+	int num_templates;
+	u32 template[]; /* Keep it last! */
+};
+
+struct vexpress_config_bridge_ops {
+	struct regmap * (*regmap_init)(struct device *dev, void *context);
+	void (*regmap_exit)(struct regmap *regmap, void *context);
+};
 
 struct vexpress_config_bridge {
 	struct vexpress_config_bridge_ops *ops;
@@ -27,17 +65,12 @@ void vexpress_config_set_master(u32 site)
 	vexpress_config_site_master = site;
 }
 
-u32 vexpress_config_get_master(void)
-{
-	return vexpress_config_site_master;
-}
-
-void vexpress_config_lock(void *arg)
+static void vexpress_config_lock(void *arg)
 {
 	mutex_lock(&vexpress_config_mutex);
 }
 
-void vexpress_config_unlock(void *arg)
+static void vexpress_config_unlock(void *arg)
 {
 	mutex_unlock(&vexpress_config_mutex);
 }
@@ -59,7 +92,7 @@ static void vexpress_config_find_prop(struct device_node *node,
 	}
 }
 
-int vexpress_config_get_topo(struct device_node *node, u32 *site,
+static int vexpress_config_get_topo(struct device_node *node, u32 *site,
 		u32 *position, u32 *dcc)
 {
 	vexpress_config_find_prop(node, "arm,vexpress,site", site);
@@ -113,7 +146,7 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
 
-struct device *vexpress_config_bridge_register(struct device *parent,
+static struct device *vexpress_config_bridge_register(struct device *parent,
 		struct vexpress_config_bridge_ops *ops, void *context)
 {
 	struct device *dev;
@@ -201,3 +234,235 @@ static int __init vexpress_config_init(void)
 }
 postcore_initcall(vexpress_config_init);
 
+static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
+		int index, bool write, u32 *data)
+{
+	struct vexpress_syscfg *syscfg = func->syscfg;
+	u32 command, status;
+	int tries;
+	long timeout;
+
+	if (WARN_ON(index >= func->num_templates))
+		return -EINVAL;
+
+	command = readl(syscfg->base + SYS_CFGCTRL);
+	if (WARN_ON(command & SYS_CFGCTRL_START))
+		return -EBUSY;
+
+	command = func->template[index];
+	command |= SYS_CFGCTRL_START;
+	command |= write ? SYS_CFGCTRL_WRITE : 0;
+
+	/* Use a canary for reads */
+	if (!write)
+		*data = 0xdeadbeef;
+
+	dev_dbg(syscfg->dev, "func %p, command %x, data %x\n",
+			func, command, *data);
+	writel(*data, syscfg->base + SYS_CFGDATA);
+	writel(0, syscfg->base + SYS_CFGSTAT);
+	writel(command, syscfg->base + SYS_CFGCTRL);
+	mb();
+
+	/* The operation can take ages... Go to sleep, 100us initially */
+	tries = 100;
+	timeout = 100;
+	do {
+		if (!irqs_disabled()) {
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(usecs_to_jiffies(timeout));
+			if (signal_pending(current))
+				return -EINTR;
+		} else {
+			udelay(timeout);
+		}
+
+		status = readl(syscfg->base + SYS_CFGSTAT);
+		if (status & SYS_CFGSTAT_ERR)
+			return -EFAULT;
+
+		if (timeout > 20)
+			timeout -= 20;
+	} while (--tries && !(status & SYS_CFGSTAT_COMPLETE));
+	if (WARN_ON_ONCE(!tries))
+		return -ETIMEDOUT;
+
+	if (!write) {
+		*data = readl(syscfg->base + SYS_CFGDATA);
+		dev_dbg(syscfg->dev, "func %p, read data %x\n", func, *data);
+	}
+
+	return 0;
+}
+
+static int vexpress_syscfg_read(void *context, unsigned int index,
+		unsigned int *val)
+{
+	struct vexpress_syscfg_func *func = context;
+
+	return vexpress_syscfg_exec(func, index, false, val);
+}
+
+static int vexpress_syscfg_write(void *context, unsigned int index,
+		unsigned int val)
+{
+	struct vexpress_syscfg_func *func = context;
+
+	return vexpress_syscfg_exec(func, index, true, &val);
+}
+
+static struct regmap_config vexpress_syscfg_regmap_config = {
+	.lock = vexpress_config_lock,
+	.unlock = vexpress_config_unlock,
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_read = vexpress_syscfg_read,
+	.reg_write = vexpress_syscfg_write,
+	.reg_format_endian = REGMAP_ENDIAN_LITTLE,
+	.val_format_endian = REGMAP_ENDIAN_LITTLE,
+};
+
+
+static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,
+		void *context)
+{
+	int err;
+	struct vexpress_syscfg *syscfg = context;
+	struct vexpress_syscfg_func *func;
+	struct property *prop;
+	const __be32 *val = NULL;
+	__be32 energy_quirk[4];
+	int num;
+	u32 site, position, dcc;
+	int i;
+
+	err = vexpress_config_get_topo(dev->of_node, &site,
+				&position, &dcc);
+	if (err)
+		return ERR_PTR(err);
+
+	prop = of_find_property(dev->of_node,
+			"arm,vexpress-sysreg,func", NULL);
+	if (!prop)
+		return ERR_PTR(-EINVAL);
+
+	num = prop->length / sizeof(u32) / 2;
+	val = prop->value;
+
+	/*
+	 * "arm,vexpress-energy" function used to be described
+	 * by its first device only, now it requires both
+	 */
+	if (num == 1 && of_device_is_compatible(dev->of_node,
+			"arm,vexpress-energy")) {
+		num = 2;
+		energy_quirk[0] = *val;
+		energy_quirk[2] = *val++;
+		energy_quirk[1] = *val;
+		energy_quirk[3] = cpu_to_be32(be32_to_cpup(val) + 1);
+		val = energy_quirk;
+	}
+
+	func = kzalloc(struct_size(func, template, num), GFP_KERNEL);
+	if (!func)
+		return ERR_PTR(-ENOMEM);
+
+	func->syscfg = syscfg;
+	func->num_templates = num;
+
+	for (i = 0; i < num; i++) {
+		u32 function, device;
+
+		function = be32_to_cpup(val++);
+		device = be32_to_cpup(val++);
+
+		dev_dbg(dev, "func %p: %u/%u/%u/%u/%u\n",
+				func, site, position, dcc,
+				function, device);
+
+		func->template[i] = SYS_CFGCTRL_DCC(dcc);
+		func->template[i] |= SYS_CFGCTRL_SITE(site);
+		func->template[i] |= SYS_CFGCTRL_POSITION(position);
+		func->template[i] |= SYS_CFGCTRL_FUNC(function);
+		func->template[i] |= SYS_CFGCTRL_DEVICE(device);
+	}
+
+	vexpress_syscfg_regmap_config.max_register = num - 1;
+
+	func->regmap = regmap_init(dev, NULL, func,
+			&vexpress_syscfg_regmap_config);
+
+	if (IS_ERR(func->regmap)) {
+		void *err = func->regmap;
+
+		kfree(func);
+		return err;
+	}
+
+	list_add(&func->list, &syscfg->funcs);
+
+	return func->regmap;
+}
+
+static void vexpress_syscfg_regmap_exit(struct regmap *regmap, void *context)
+{
+	struct vexpress_syscfg *syscfg = context;
+	struct vexpress_syscfg_func *func, *tmp;
+
+	regmap_exit(regmap);
+
+	list_for_each_entry_safe(func, tmp, &syscfg->funcs, list) {
+		if (func->regmap == regmap) {
+			list_del(&syscfg->funcs);
+			kfree(func);
+			break;
+		}
+	}
+}
+
+static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = {
+	.regmap_init = vexpress_syscfg_regmap_init,
+	.regmap_exit = vexpress_syscfg_regmap_exit,
+};
+
+
+static int vexpress_syscfg_probe(struct platform_device *pdev)
+{
+	struct vexpress_syscfg *syscfg;
+	struct resource *res;
+	struct device *bridge;
+
+	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
+	if (!syscfg)
+		return -ENOMEM;
+	syscfg->dev = &pdev->dev;
+	INIT_LIST_HEAD(&syscfg->funcs);
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	syscfg->base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(syscfg->base))
+		return PTR_ERR(syscfg->base);
+
+	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
+	bridge = vexpress_config_bridge_register(pdev->dev.parent,
+			&vexpress_syscfg_bridge_ops, syscfg);
+
+	return PTR_ERR_OR_ZERO(bridge);
+}
+
+static const struct platform_device_id vexpress_syscfg_id_table[] = {
+	{ "vexpress-syscfg", },
+	{},
+};
+
+static struct platform_driver vexpress_syscfg_driver = {
+	.driver.name = "vexpress-syscfg",
+	.id_table = vexpress_syscfg_id_table,
+	.probe = vexpress_syscfg_probe,
+};
+
+static int __init vexpress_syscfg_init(void)
+{
+	return platform_driver_register(&vexpress_syscfg_driver);
+}
+core_initcall(vexpress_syscfg_init);
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 99e151475d8f..edd5dd5ebfdc 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -423,15 +423,6 @@ config SRAM
 config SRAM_EXEC
 	bool
 
-config VEXPRESS_SYSCFG
-	bool "Versatile Express System Configuration driver"
-	depends on VEXPRESS_CONFIG
-	default y
-	help
-	  ARM Ltd. Versatile Express uses specialised platform configuration
-	  bus. System Configuration interface is one of the possible means
-	  of generating transactions on this bus.
-
 config PCI_ENDPOINT_TEST
 	depends on PCI
 	select CRC32
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 9abf2923d831..c7bd01ac6291 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -49,7 +49,6 @@ obj-$(CONFIG_SRAM_EXEC)		+= sram-exec.o
 obj-y				+= mic/
 obj-$(CONFIG_GENWQE)		+= genwqe/
 obj-$(CONFIG_ECHO)		+= echo/
-obj-$(CONFIG_VEXPRESS_SYSCFG)	+= vexpress-syscfg.o
 obj-$(CONFIG_CXL_BASE)		+= cxl/
 obj-$(CONFIG_PCI_ENDPOINT_TEST)	+= pci_endpoint_test.o
 obj-$(CONFIG_OCXL)		+= ocxl/
diff --git a/drivers/misc/vexpress-syscfg.c b/drivers/misc/vexpress-syscfg.c
deleted file mode 100644
index a431787c0898..000000000000
--- a/drivers/misc/vexpress-syscfg.c
+++ /dev/null
@@ -1,280 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- *
- * Copyright (C) 2014 ARM Limited
- */
-
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/platform_device.h>
-#include <linux/sched/signal.h>
-#include <linux/slab.h>
-#include <linux/syscore_ops.h>
-#include <linux/vexpress.h>
-
-
-#define SYS_CFGDATA		0x0
-
-#define SYS_CFGCTRL		0x4
-#define SYS_CFGCTRL_START	(1 << 31)
-#define SYS_CFGCTRL_WRITE	(1 << 30)
-#define SYS_CFGCTRL_DCC(n)	(((n) & 0xf) << 26)
-#define SYS_CFGCTRL_FUNC(n)	(((n) & 0x3f) << 20)
-#define SYS_CFGCTRL_SITE(n)	(((n) & 0x3) << 16)
-#define SYS_CFGCTRL_POSITION(n)	(((n) & 0xf) << 12)
-#define SYS_CFGCTRL_DEVICE(n)	(((n) & 0xfff) << 0)
-
-#define SYS_CFGSTAT		0x8
-#define SYS_CFGSTAT_ERR		(1 << 1)
-#define SYS_CFGSTAT_COMPLETE	(1 << 0)
-
-
-struct vexpress_syscfg {
-	struct device *dev;
-	void __iomem *base;
-	struct list_head funcs;
-};
-
-struct vexpress_syscfg_func {
-	struct list_head list;
-	struct vexpress_syscfg *syscfg;
-	struct regmap *regmap;
-	int num_templates;
-	u32 template[]; /* Keep it last! */
-};
-
-
-static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
-		int index, bool write, u32 *data)
-{
-	struct vexpress_syscfg *syscfg = func->syscfg;
-	u32 command, status;
-	int tries;
-	long timeout;
-
-	if (WARN_ON(index >= func->num_templates))
-		return -EINVAL;
-
-	command = readl(syscfg->base + SYS_CFGCTRL);
-	if (WARN_ON(command & SYS_CFGCTRL_START))
-		return -EBUSY;
-
-	command = func->template[index];
-	command |= SYS_CFGCTRL_START;
-	command |= write ? SYS_CFGCTRL_WRITE : 0;
-
-	/* Use a canary for reads */
-	if (!write)
-		*data = 0xdeadbeef;
-
-	dev_dbg(syscfg->dev, "func %p, command %x, data %x\n",
-			func, command, *data);
-	writel(*data, syscfg->base + SYS_CFGDATA);
-	writel(0, syscfg->base + SYS_CFGSTAT);
-	writel(command, syscfg->base + SYS_CFGCTRL);
-	mb();
-
-	/* The operation can take ages... Go to sleep, 100us initially */
-	tries = 100;
-	timeout = 100;
-	do {
-		if (!irqs_disabled()) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(usecs_to_jiffies(timeout));
-			if (signal_pending(current))
-				return -EINTR;
-		} else {
-			udelay(timeout);
-		}
-
-		status = readl(syscfg->base + SYS_CFGSTAT);
-		if (status & SYS_CFGSTAT_ERR)
-			return -EFAULT;
-
-		if (timeout > 20)
-			timeout -= 20;
-	} while (--tries && !(status & SYS_CFGSTAT_COMPLETE));
-	if (WARN_ON_ONCE(!tries))
-		return -ETIMEDOUT;
-
-	if (!write) {
-		*data = readl(syscfg->base + SYS_CFGDATA);
-		dev_dbg(syscfg->dev, "func %p, read data %x\n", func, *data);
-	}
-
-	return 0;
-}
-
-static int vexpress_syscfg_read(void *context, unsigned int index,
-		unsigned int *val)
-{
-	struct vexpress_syscfg_func *func = context;
-
-	return vexpress_syscfg_exec(func, index, false, val);
-}
-
-static int vexpress_syscfg_write(void *context, unsigned int index,
-		unsigned int val)
-{
-	struct vexpress_syscfg_func *func = context;
-
-	return vexpress_syscfg_exec(func, index, true, &val);
-}
-
-static struct regmap_config vexpress_syscfg_regmap_config = {
-	.lock = vexpress_config_lock,
-	.unlock = vexpress_config_unlock,
-	.reg_bits = 32,
-	.val_bits = 32,
-	.reg_read = vexpress_syscfg_read,
-	.reg_write = vexpress_syscfg_write,
-	.reg_format_endian = REGMAP_ENDIAN_LITTLE,
-	.val_format_endian = REGMAP_ENDIAN_LITTLE,
-};
-
-
-static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,
-		void *context)
-{
-	int err;
-	struct vexpress_syscfg *syscfg = context;
-	struct vexpress_syscfg_func *func;
-	struct property *prop;
-	const __be32 *val = NULL;
-	__be32 energy_quirk[4];
-	int num;
-	u32 site, position, dcc;
-	int i;
-
-	err = vexpress_config_get_topo(dev->of_node, &site,
-				&position, &dcc);
-	if (err)
-		return ERR_PTR(err);
-
-	prop = of_find_property(dev->of_node,
-			"arm,vexpress-sysreg,func", NULL);
-	if (!prop)
-		return ERR_PTR(-EINVAL);
-
-	num = prop->length / sizeof(u32) / 2;
-	val = prop->value;
-
-	/*
-	 * "arm,vexpress-energy" function used to be described
-	 * by its first device only, now it requires both
-	 */
-	if (num == 1 && of_device_is_compatible(dev->of_node,
-			"arm,vexpress-energy")) {
-		num = 2;
-		energy_quirk[0] = *val;
-		energy_quirk[2] = *val++;
-		energy_quirk[1] = *val;
-		energy_quirk[3] = cpu_to_be32(be32_to_cpup(val) + 1);
-		val = energy_quirk;
-	}
-
-	func = kzalloc(struct_size(func, template, num), GFP_KERNEL);
-	if (!func)
-		return ERR_PTR(-ENOMEM);
-
-	func->syscfg = syscfg;
-	func->num_templates = num;
-
-	for (i = 0; i < num; i++) {
-		u32 function, device;
-
-		function = be32_to_cpup(val++);
-		device = be32_to_cpup(val++);
-
-		dev_dbg(dev, "func %p: %u/%u/%u/%u/%u\n",
-				func, site, position, dcc,
-				function, device);
-
-		func->template[i] = SYS_CFGCTRL_DCC(dcc);
-		func->template[i] |= SYS_CFGCTRL_SITE(site);
-		func->template[i] |= SYS_CFGCTRL_POSITION(position);
-		func->template[i] |= SYS_CFGCTRL_FUNC(function);
-		func->template[i] |= SYS_CFGCTRL_DEVICE(device);
-	}
-
-	vexpress_syscfg_regmap_config.max_register = num - 1;
-
-	func->regmap = regmap_init(dev, NULL, func,
-			&vexpress_syscfg_regmap_config);
-
-	if (IS_ERR(func->regmap)) {
-		void *err = func->regmap;
-
-		kfree(func);
-		return err;
-	}
-
-	list_add(&func->list, &syscfg->funcs);
-
-	return func->regmap;
-}
-
-static void vexpress_syscfg_regmap_exit(struct regmap *regmap, void *context)
-{
-	struct vexpress_syscfg *syscfg = context;
-	struct vexpress_syscfg_func *func, *tmp;
-
-	regmap_exit(regmap);
-
-	list_for_each_entry_safe(func, tmp, &syscfg->funcs, list) {
-		if (func->regmap == regmap) {
-			list_del(&syscfg->funcs);
-			kfree(func);
-			break;
-		}
-	}
-}
-
-static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = {
-	.regmap_init = vexpress_syscfg_regmap_init,
-	.regmap_exit = vexpress_syscfg_regmap_exit,
-};
-
-
-static int vexpress_syscfg_probe(struct platform_device *pdev)
-{
-	struct vexpress_syscfg *syscfg;
-	struct resource *res;
-	struct device *bridge;
-
-	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
-	if (!syscfg)
-		return -ENOMEM;
-	syscfg->dev = &pdev->dev;
-	INIT_LIST_HEAD(&syscfg->funcs);
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	syscfg->base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(syscfg->base))
-		return PTR_ERR(syscfg->base);
-
-	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
-	bridge = vexpress_config_bridge_register(pdev->dev.parent,
-			&vexpress_syscfg_bridge_ops, syscfg);
-
-	return PTR_ERR_OR_ZERO(bridge);
-}
-
-static const struct platform_device_id vexpress_syscfg_id_table[] = {
-	{ "vexpress-syscfg", },
-	{},
-};
-
-static struct platform_driver vexpress_syscfg_driver = {
-	.driver.name = "vexpress-syscfg",
-	.id_table = vexpress_syscfg_id_table,
-	.probe = vexpress_syscfg_probe,
-};
-
-static int __init vexpress_syscfg_init(void)
-{
-	return platform_driver_register(&vexpress_syscfg_driver);
-}
-core_initcall(vexpress_syscfg_init);
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
index 2ec7992b054c..65096c792d57 100644
--- a/include/linux/vexpress.h
+++ b/include/linux/vexpress.h
@@ -18,23 +18,6 @@
 /* Config infrastructure */
 
 void vexpress_config_set_master(u32 site);
-u32 vexpress_config_get_master(void);
-
-void vexpress_config_lock(void *arg);
-void vexpress_config_unlock(void *arg);
-
-int vexpress_config_get_topo(struct device_node *node, u32 *site,
-		u32 *position, u32 *dcc);
-
-/* Config bridge API */
-
-struct vexpress_config_bridge_ops {
-	struct regmap * (*regmap_init)(struct device *dev, void *context);
-	void (*regmap_exit)(struct regmap *regmap, void *context);
-};
-
-struct device *vexpress_config_bridge_register(struct device *parent,
-		struct vexpress_config_bridge_ops *ops, void *context);
 
 /* Config regmap API */
 
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 14/17] bus: vexpress-config: simplify config bus probing
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

The vexpress-config initialization is dependent on the vexpress-syscfg
driver probing. As vexpress-config was not a driver, deferred probe
could not be used and instead initcall ordering was relied upon. This is
fragile and doesn't work for modules.

Let's move the config bus init into the vexpress-syscfg probe. This
eliminates the initcall ordering requirement and the need to create a
struct device and the "vexpress-config" class.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/bus/vexpress-config.c | 118 ++++++----------------------------
 1 file changed, 21 insertions(+), 97 deletions(-)

diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index 43f5beac9811..43deb4df140b 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -56,7 +56,6 @@ struct vexpress_config_bridge {
 
 
 static DEFINE_MUTEX(vexpress_config_mutex);
-static struct class *vexpress_config_class;
 static u32 vexpress_config_site_master = VEXPRESS_SITE_MASTER;
 
 
@@ -121,9 +120,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
 	struct regmap *regmap;
 	struct regmap **res;
 
-	if (WARN_ON(dev->parent->class != vexpress_config_class))
-		return ERR_PTR(-ENODEV);
-
 	bridge = dev_get_drvdata(dev->parent);
 	if (WARN_ON(!bridge))
 		return ERR_PTR(-EINVAL);
@@ -146,94 +142,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
 
-static struct device *vexpress_config_bridge_register(struct device *parent,
-		struct vexpress_config_bridge_ops *ops, void *context)
-{
-	struct device *dev;
-	struct vexpress_config_bridge *bridge;
-
-	if (!vexpress_config_class) {
-		vexpress_config_class = class_create(THIS_MODULE,
-				"vexpress-config");
-		if (IS_ERR(vexpress_config_class))
-			return (void *)vexpress_config_class;
-	}
-
-	dev = device_create(vexpress_config_class, parent, 0,
-			NULL, "%s.bridge", dev_name(parent));
-
-	if (IS_ERR(dev))
-		return dev;
-
-	bridge = devm_kmalloc(dev, sizeof(*bridge), GFP_KERNEL);
-	if (!bridge) {
-		put_device(dev);
-		device_unregister(dev);
-		return ERR_PTR(-ENOMEM);
-	}
-	bridge->ops = ops;
-	bridge->context = context;
-
-	dev_set_drvdata(dev, bridge);
-
-	dev_dbg(parent, "Registered bridge '%s', parent node %p\n",
-			dev_name(dev), parent->of_node);
-
-	return dev;
-}
-
-
-static int vexpress_config_node_match(struct device *dev, const void *data)
-{
-	const struct device_node *node = data;
-
-	dev_dbg(dev, "Parent node %p, looking for %p\n",
-			dev->parent->of_node, node);
-
-	return dev->parent->of_node == node;
-}
-
-static int vexpress_config_populate(struct device_node *node)
-{
-	struct device_node *bridge;
-	struct device *parent;
-	int ret;
-
-	bridge = of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
-	if (!bridge)
-		return -EINVAL;
-
-	parent = class_find_device(vexpress_config_class, NULL, bridge,
-			vexpress_config_node_match);
-	of_node_put(bridge);
-	if (WARN_ON(!parent))
-		return -ENODEV;
-
-	ret = of_platform_populate(node, NULL, NULL, parent);
-
-	put_device(parent);
-
-	return ret;
-}
-
-static int __init vexpress_config_init(void)
-{
-	int err = 0;
-	struct device_node *node;
-
-	/* Need the config devices early, before the "normal" devices... */
-	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
-		err = vexpress_config_populate(node);
-		if (err) {
-			of_node_put(node);
-			break;
-		}
-	}
-
-	return err;
-}
-postcore_initcall(vexpress_config_init);
-
 static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
 		int index, bool write, u32 *data)
 {
@@ -430,7 +338,8 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
 {
 	struct vexpress_syscfg *syscfg;
 	struct resource *res;
-	struct device *bridge;
+	struct vexpress_config_bridge *bridge;
+	struct device_node *node;
 
 	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
 	if (!syscfg)
@@ -443,11 +352,26 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
 	if (IS_ERR(syscfg->base))
 		return PTR_ERR(syscfg->base);
 
-	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
-	bridge = vexpress_config_bridge_register(pdev->dev.parent,
-			&vexpress_syscfg_bridge_ops, syscfg);
+	bridge = devm_kmalloc(&pdev->dev, sizeof(*bridge), GFP_KERNEL);
+	if (!bridge)
+		return -ENOMEM;
+
+	bridge->ops = &vexpress_syscfg_bridge_ops;
+	bridge->context = syscfg;
+
+	dev_set_drvdata(&pdev->dev, bridge);
 
-	return PTR_ERR_OR_ZERO(bridge);
+	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
+		struct device_node *bridge_np;
+
+		bridge_np = of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
+		if (bridge_np != pdev->dev.parent->of_node)
+			continue;
+
+		of_platform_populate(node, NULL, NULL, &pdev->dev);
+	}
+
+	return 0;
 }
 
 static const struct platform_device_id vexpress_syscfg_id_table[] = {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 14/17] bus: vexpress-config: simplify config bus probing
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

The vexpress-config initialization is dependent on the vexpress-syscfg
driver probing. As vexpress-config was not a driver, deferred probe
could not be used and instead initcall ordering was relied upon. This is
fragile and doesn't work for modules.

Let's move the config bus init into the vexpress-syscfg probe. This
eliminates the initcall ordering requirement and the need to create a
struct device and the "vexpress-config" class.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/bus/vexpress-config.c | 118 ++++++----------------------------
 1 file changed, 21 insertions(+), 97 deletions(-)

diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index 43f5beac9811..43deb4df140b 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -56,7 +56,6 @@ struct vexpress_config_bridge {
 
 
 static DEFINE_MUTEX(vexpress_config_mutex);
-static struct class *vexpress_config_class;
 static u32 vexpress_config_site_master = VEXPRESS_SITE_MASTER;
 
 
@@ -121,9 +120,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
 	struct regmap *regmap;
 	struct regmap **res;
 
-	if (WARN_ON(dev->parent->class != vexpress_config_class))
-		return ERR_PTR(-ENODEV);
-
 	bridge = dev_get_drvdata(dev->parent);
 	if (WARN_ON(!bridge))
 		return ERR_PTR(-EINVAL);
@@ -146,94 +142,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
 
-static struct device *vexpress_config_bridge_register(struct device *parent,
-		struct vexpress_config_bridge_ops *ops, void *context)
-{
-	struct device *dev;
-	struct vexpress_config_bridge *bridge;
-
-	if (!vexpress_config_class) {
-		vexpress_config_class = class_create(THIS_MODULE,
-				"vexpress-config");
-		if (IS_ERR(vexpress_config_class))
-			return (void *)vexpress_config_class;
-	}
-
-	dev = device_create(vexpress_config_class, parent, 0,
-			NULL, "%s.bridge", dev_name(parent));
-
-	if (IS_ERR(dev))
-		return dev;
-
-	bridge = devm_kmalloc(dev, sizeof(*bridge), GFP_KERNEL);
-	if (!bridge) {
-		put_device(dev);
-		device_unregister(dev);
-		return ERR_PTR(-ENOMEM);
-	}
-	bridge->ops = ops;
-	bridge->context = context;
-
-	dev_set_drvdata(dev, bridge);
-
-	dev_dbg(parent, "Registered bridge '%s', parent node %p\n",
-			dev_name(dev), parent->of_node);
-
-	return dev;
-}
-
-
-static int vexpress_config_node_match(struct device *dev, const void *data)
-{
-	const struct device_node *node = data;
-
-	dev_dbg(dev, "Parent node %p, looking for %p\n",
-			dev->parent->of_node, node);
-
-	return dev->parent->of_node == node;
-}
-
-static int vexpress_config_populate(struct device_node *node)
-{
-	struct device_node *bridge;
-	struct device *parent;
-	int ret;
-
-	bridge = of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
-	if (!bridge)
-		return -EINVAL;
-
-	parent = class_find_device(vexpress_config_class, NULL, bridge,
-			vexpress_config_node_match);
-	of_node_put(bridge);
-	if (WARN_ON(!parent))
-		return -ENODEV;
-
-	ret = of_platform_populate(node, NULL, NULL, parent);
-
-	put_device(parent);
-
-	return ret;
-}
-
-static int __init vexpress_config_init(void)
-{
-	int err = 0;
-	struct device_node *node;
-
-	/* Need the config devices early, before the "normal" devices... */
-	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
-		err = vexpress_config_populate(node);
-		if (err) {
-			of_node_put(node);
-			break;
-		}
-	}
-
-	return err;
-}
-postcore_initcall(vexpress_config_init);
-
 static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
 		int index, bool write, u32 *data)
 {
@@ -430,7 +338,8 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
 {
 	struct vexpress_syscfg *syscfg;
 	struct resource *res;
-	struct device *bridge;
+	struct vexpress_config_bridge *bridge;
+	struct device_node *node;
 
 	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
 	if (!syscfg)
@@ -443,11 +352,26 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
 	if (IS_ERR(syscfg->base))
 		return PTR_ERR(syscfg->base);
 
-	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
-	bridge = vexpress_config_bridge_register(pdev->dev.parent,
-			&vexpress_syscfg_bridge_ops, syscfg);
+	bridge = devm_kmalloc(&pdev->dev, sizeof(*bridge), GFP_KERNEL);
+	if (!bridge)
+		return -ENOMEM;
+
+	bridge->ops = &vexpress_syscfg_bridge_ops;
+	bridge->context = syscfg;
+
+	dev_set_drvdata(&pdev->dev, bridge);
 
-	return PTR_ERR_OR_ZERO(bridge);
+	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
+		struct device_node *bridge_np;
+
+		bridge_np = of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
+		if (bridge_np != pdev->dev.parent->of_node)
+			continue;
+
+		of_platform_populate(node, NULL, NULL, &pdev->dev);
+	}
+
+	return 0;
 }
 
 static const struct platform_device_id vexpress_syscfg_id_table[] = {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 15/17] vexpress: Move site master init to vexpress-config bus
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

There's only a single caller of vexpress_config_set_master() from
vexpress-sysreg.c. Let's just make the registers needed available to
vexpress-config and move all the code there. The registers needed aren't
used anywhere else either. With this, we can get rid of the private API
between these 2 drivers.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/bus/vexpress-config.c | 37 +++++++++++++++++++++++++++++++----
 drivers/mfd/vexpress-sysreg.c | 25 +----------------------
 include/linux/vexpress.h      |  9 ---------
 3 files changed, 34 insertions(+), 37 deletions(-)

diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index 43deb4df140b..caa35a4cb34d 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -14,9 +14,17 @@
 #include <linux/slab.h>
 #include <linux/vexpress.h>
 
-#define SYS_CFGDATA		0x0
+#define SYS_MISC		0x0
+#define SYS_MISC_MASTERSITE	(1 << 14)
 
-#define SYS_CFGCTRL		0x4
+#define SYS_PROCID0		0x24
+#define SYS_PROCID1		0x28
+#define SYS_HBI_MASK		0xfff
+#define SYS_PROCIDx_HBI_SHIFT	0
+
+#define SYS_CFGDATA		0x40
+
+#define SYS_CFGCTRL		0x44
 #define SYS_CFGCTRL_START	(1 << 31)
 #define SYS_CFGCTRL_WRITE	(1 << 30)
 #define SYS_CFGCTRL_DCC(n)	(((n) & 0xf) << 26)
@@ -25,10 +33,14 @@
 #define SYS_CFGCTRL_POSITION(n)	(((n) & 0xf) << 12)
 #define SYS_CFGCTRL_DEVICE(n)	(((n) & 0xfff) << 0)
 
-#define SYS_CFGSTAT		0x8
+#define SYS_CFGSTAT		0x48
 #define SYS_CFGSTAT_ERR		(1 << 1)
 #define SYS_CFGSTAT_COMPLETE	(1 << 0)
 
+#define VEXPRESS_SITE_MB		0
+#define VEXPRESS_SITE_DB1		1
+#define VEXPRESS_SITE_DB2		2
+#define VEXPRESS_SITE_MASTER		0xf
 
 struct vexpress_syscfg {
 	struct device *dev;
@@ -59,7 +71,7 @@ static DEFINE_MUTEX(vexpress_config_mutex);
 static u32 vexpress_config_site_master = VEXPRESS_SITE_MASTER;
 
 
-void vexpress_config_set_master(u32 site)
+static void vexpress_config_set_master(u32 site)
 {
 	vexpress_config_site_master = site;
 }
@@ -340,6 +352,8 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct vexpress_config_bridge *bridge;
 	struct device_node *node;
+	int master;
+	u32 dt_hbi;
 
 	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
 	if (!syscfg)
@@ -361,6 +375,21 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
 
 	dev_set_drvdata(&pdev->dev, bridge);
 
+	master = readl(syscfg->base + SYS_MISC) & SYS_MISC_MASTERSITE ?
+			VEXPRESS_SITE_DB2 : VEXPRESS_SITE_DB1;
+	vexpress_config_set_master(master);
+
+	/* Confirm board type against DT property, if available */
+	if (of_property_read_u32(of_root, "arm,hbi", &dt_hbi) == 0) {
+		u32 id = readl(syscfg->base + (master == VEXPRESS_SITE_DB1 ?
+				 SYS_PROCID0 : SYS_PROCID1));
+		u32 hbi = (id >> SYS_PROCIDx_HBI_SHIFT) & SYS_HBI_MASK;
+
+		if (WARN_ON(dt_hbi != hbi))
+			dev_warn(&pdev->dev, "DT HBI (%x) is not matching hardware (%x)!\n",
+					dt_hbi, hbi);
+	}
+
 	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
 		struct device_node *bridge_np;
 
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index eeeeb1d26d5d..aaf24af287dd 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -14,7 +14,6 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/stat.h>
-#include <linux/vexpress.h>
 
 #define SYS_ID			0x000
 #define SYS_SW			0x004
@@ -37,11 +36,6 @@
 #define SYS_CFGCTRL		0x0a4
 #define SYS_CFGSTAT		0x0a8
 
-#define SYS_HBI_MASK		0xfff
-#define SYS_PROCIDx_HBI_SHIFT	0
-
-#define SYS_MISC_MASTERSITE	(1 << 14)
-
 /* The sysreg block is just a random collection of various functions... */
 
 static struct bgpio_pdata vexpress_sysreg_sys_led_pdata = {
@@ -94,7 +88,7 @@ static struct mfd_cell vexpress_sysreg_cells[] = {
 		.name = "vexpress-syscfg",
 		.num_resources = 1,
 		.resources = (struct resource []) {
-			DEFINE_RES_MEM(SYS_CFGDATA, 0xc),
+			DEFINE_RES_MEM(SYS_MISC, 0x4c),
 		},
 	}
 };
@@ -104,8 +98,6 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
 	struct resource *mem;
 	void __iomem *base;
 	struct gpio_chip *mmc_gpio_chip;
-	int master;
-	u32 dt_hbi;
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!mem)
@@ -115,21 +107,6 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
 	if (!base)
 		return -ENOMEM;
 
-	master = readl(base + SYS_MISC) & SYS_MISC_MASTERSITE ?
-			VEXPRESS_SITE_DB2 : VEXPRESS_SITE_DB1;
-	vexpress_config_set_master(master);
-
-	/* Confirm board type against DT property, if available */
-	if (of_property_read_u32(of_root, "arm,hbi", &dt_hbi) == 0) {
-		u32 id = readl(base + (master == VEXPRESS_SITE_DB1 ?
-				 SYS_PROCID0 : SYS_PROCID1));
-		u32 hbi = (id >> SYS_PROCIDx_HBI_SHIFT) & SYS_HBI_MASK;
-
-		if (WARN_ON(dt_hbi != hbi))
-			dev_warn(&pdev->dev, "DT HBI (%x) is not matching hardware (%x)!\n",
-					dt_hbi, hbi);
-	}
-
 	/*
 	 * Duplicated SYS_MCI pseudo-GPIO controller for compatibility with
 	 * older trees using sysreg node for MMC control lines.
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
index 65096c792d57..2f9dd072f11f 100644
--- a/include/linux/vexpress.h
+++ b/include/linux/vexpress.h
@@ -10,15 +10,6 @@
 #include <linux/device.h>
 #include <linux/regmap.h>
 
-#define VEXPRESS_SITE_MB		0
-#define VEXPRESS_SITE_DB1		1
-#define VEXPRESS_SITE_DB2		2
-#define VEXPRESS_SITE_MASTER		0xf
-
-/* Config infrastructure */
-
-void vexpress_config_set_master(u32 site);
-
 /* Config regmap API */
 
 struct regmap *devm_regmap_init_vexpress_config(struct device *dev);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 15/17] vexpress: Move site master init to vexpress-config bus
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

There's only a single caller of vexpress_config_set_master() from
vexpress-sysreg.c. Let's just make the registers needed available to
vexpress-config and move all the code there. The registers needed aren't
used anywhere else either. With this, we can get rid of the private API
between these 2 drivers.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/bus/vexpress-config.c | 37 +++++++++++++++++++++++++++++++----
 drivers/mfd/vexpress-sysreg.c | 25 +----------------------
 include/linux/vexpress.h      |  9 ---------
 3 files changed, 34 insertions(+), 37 deletions(-)

diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index 43deb4df140b..caa35a4cb34d 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -14,9 +14,17 @@
 #include <linux/slab.h>
 #include <linux/vexpress.h>
 
-#define SYS_CFGDATA		0x0
+#define SYS_MISC		0x0
+#define SYS_MISC_MASTERSITE	(1 << 14)
 
-#define SYS_CFGCTRL		0x4
+#define SYS_PROCID0		0x24
+#define SYS_PROCID1		0x28
+#define SYS_HBI_MASK		0xfff
+#define SYS_PROCIDx_HBI_SHIFT	0
+
+#define SYS_CFGDATA		0x40
+
+#define SYS_CFGCTRL		0x44
 #define SYS_CFGCTRL_START	(1 << 31)
 #define SYS_CFGCTRL_WRITE	(1 << 30)
 #define SYS_CFGCTRL_DCC(n)	(((n) & 0xf) << 26)
@@ -25,10 +33,14 @@
 #define SYS_CFGCTRL_POSITION(n)	(((n) & 0xf) << 12)
 #define SYS_CFGCTRL_DEVICE(n)	(((n) & 0xfff) << 0)
 
-#define SYS_CFGSTAT		0x8
+#define SYS_CFGSTAT		0x48
 #define SYS_CFGSTAT_ERR		(1 << 1)
 #define SYS_CFGSTAT_COMPLETE	(1 << 0)
 
+#define VEXPRESS_SITE_MB		0
+#define VEXPRESS_SITE_DB1		1
+#define VEXPRESS_SITE_DB2		2
+#define VEXPRESS_SITE_MASTER		0xf
 
 struct vexpress_syscfg {
 	struct device *dev;
@@ -59,7 +71,7 @@ static DEFINE_MUTEX(vexpress_config_mutex);
 static u32 vexpress_config_site_master = VEXPRESS_SITE_MASTER;
 
 
-void vexpress_config_set_master(u32 site)
+static void vexpress_config_set_master(u32 site)
 {
 	vexpress_config_site_master = site;
 }
@@ -340,6 +352,8 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct vexpress_config_bridge *bridge;
 	struct device_node *node;
+	int master;
+	u32 dt_hbi;
 
 	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
 	if (!syscfg)
@@ -361,6 +375,21 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
 
 	dev_set_drvdata(&pdev->dev, bridge);
 
+	master = readl(syscfg->base + SYS_MISC) & SYS_MISC_MASTERSITE ?
+			VEXPRESS_SITE_DB2 : VEXPRESS_SITE_DB1;
+	vexpress_config_set_master(master);
+
+	/* Confirm board type against DT property, if available */
+	if (of_property_read_u32(of_root, "arm,hbi", &dt_hbi) == 0) {
+		u32 id = readl(syscfg->base + (master == VEXPRESS_SITE_DB1 ?
+				 SYS_PROCID0 : SYS_PROCID1));
+		u32 hbi = (id >> SYS_PROCIDx_HBI_SHIFT) & SYS_HBI_MASK;
+
+		if (WARN_ON(dt_hbi != hbi))
+			dev_warn(&pdev->dev, "DT HBI (%x) is not matching hardware (%x)!\n",
+					dt_hbi, hbi);
+	}
+
 	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
 		struct device_node *bridge_np;
 
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index eeeeb1d26d5d..aaf24af287dd 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -14,7 +14,6 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/stat.h>
-#include <linux/vexpress.h>
 
 #define SYS_ID			0x000
 #define SYS_SW			0x004
@@ -37,11 +36,6 @@
 #define SYS_CFGCTRL		0x0a4
 #define SYS_CFGSTAT		0x0a8
 
-#define SYS_HBI_MASK		0xfff
-#define SYS_PROCIDx_HBI_SHIFT	0
-
-#define SYS_MISC_MASTERSITE	(1 << 14)
-
 /* The sysreg block is just a random collection of various functions... */
 
 static struct bgpio_pdata vexpress_sysreg_sys_led_pdata = {
@@ -94,7 +88,7 @@ static struct mfd_cell vexpress_sysreg_cells[] = {
 		.name = "vexpress-syscfg",
 		.num_resources = 1,
 		.resources = (struct resource []) {
-			DEFINE_RES_MEM(SYS_CFGDATA, 0xc),
+			DEFINE_RES_MEM(SYS_MISC, 0x4c),
 		},
 	}
 };
@@ -104,8 +98,6 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
 	struct resource *mem;
 	void __iomem *base;
 	struct gpio_chip *mmc_gpio_chip;
-	int master;
-	u32 dt_hbi;
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!mem)
@@ -115,21 +107,6 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
 	if (!base)
 		return -ENOMEM;
 
-	master = readl(base + SYS_MISC) & SYS_MISC_MASTERSITE ?
-			VEXPRESS_SITE_DB2 : VEXPRESS_SITE_DB1;
-	vexpress_config_set_master(master);
-
-	/* Confirm board type against DT property, if available */
-	if (of_property_read_u32(of_root, "arm,hbi", &dt_hbi) == 0) {
-		u32 id = readl(base + (master == VEXPRESS_SITE_DB1 ?
-				 SYS_PROCID0 : SYS_PROCID1));
-		u32 hbi = (id >> SYS_PROCIDx_HBI_SHIFT) & SYS_HBI_MASK;
-
-		if (WARN_ON(dt_hbi != hbi))
-			dev_warn(&pdev->dev, "DT HBI (%x) is not matching hardware (%x)!\n",
-					dt_hbi, hbi);
-	}
-
 	/*
 	 * Duplicated SYS_MCI pseudo-GPIO controller for compatibility with
 	 * older trees using sysreg node for MMC control lines.
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
index 65096c792d57..2f9dd072f11f 100644
--- a/include/linux/vexpress.h
+++ b/include/linux/vexpress.h
@@ -10,15 +10,6 @@
 #include <linux/device.h>
 #include <linux/regmap.h>
 
-#define VEXPRESS_SITE_MB		0
-#define VEXPRESS_SITE_DB1		1
-#define VEXPRESS_SITE_DB2		2
-#define VEXPRESS_SITE_MASTER		0xf
-
-/* Config infrastructure */
-
-void vexpress_config_set_master(u32 site);
-
 /* Config regmap API */
 
 struct regmap *devm_regmap_init_vexpress_config(struct device *dev);
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 16/17] bus: vexpress-config: Support building as module
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

Enable building vexpress-config driver as a module.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/bus/Kconfig           |  2 +-
 drivers/bus/vexpress-config.c | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 6d4e4497b59b..c16268c53831 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -183,7 +183,7 @@ config UNIPHIER_SYSTEM_BUS
 	  needed to use on-board devices connected to UniPhier SoCs.
 
 config VEXPRESS_CONFIG
-	bool "Versatile Express configuration bus"
+	tristate "Versatile Express configuration bus"
 	default y if ARCH_VEXPRESS
 	depends on ARM || ARM64
 	depends on OF
diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index caa35a4cb34d..a58ac0c8e282 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -7,6 +7,7 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/of_device.h>
@@ -407,15 +408,12 @@ static const struct platform_device_id vexpress_syscfg_id_table[] = {
 	{ "vexpress-syscfg", },
 	{},
 };
+MODULE_DEVICE_TABLE(platform, vexpress_syscfg_id_table);
 
 static struct platform_driver vexpress_syscfg_driver = {
 	.driver.name = "vexpress-syscfg",
 	.id_table = vexpress_syscfg_id_table,
 	.probe = vexpress_syscfg_probe,
 };
-
-static int __init vexpress_syscfg_init(void)
-{
-	return platform_driver_register(&vexpress_syscfg_driver);
-}
-core_initcall(vexpress_syscfg_init);
+module_platform_driver(vexpress_syscfg_driver);
+MODULE_LICENSE("GPL v2");
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 16/17] bus: vexpress-config: Support building as module
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

Enable building vexpress-config driver as a module.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/bus/Kconfig           |  2 +-
 drivers/bus/vexpress-config.c | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 6d4e4497b59b..c16268c53831 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -183,7 +183,7 @@ config UNIPHIER_SYSTEM_BUS
 	  needed to use on-board devices connected to UniPhier SoCs.
 
 config VEXPRESS_CONFIG
-	bool "Versatile Express configuration bus"
+	tristate "Versatile Express configuration bus"
 	default y if ARCH_VEXPRESS
 	depends on ARM || ARM64
 	depends on OF
diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index caa35a4cb34d..a58ac0c8e282 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -7,6 +7,7 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/of_device.h>
@@ -407,15 +408,12 @@ static const struct platform_device_id vexpress_syscfg_id_table[] = {
 	{ "vexpress-syscfg", },
 	{},
 };
+MODULE_DEVICE_TABLE(platform, vexpress_syscfg_id_table);
 
 static struct platform_driver vexpress_syscfg_driver = {
 	.driver.name = "vexpress-syscfg",
 	.id_table = vexpress_syscfg_id_table,
 	.probe = vexpress_syscfg_probe,
 };
-
-static int __init vexpress_syscfg_init(void)
-{
-	return platform_driver_register(&vexpress_syscfg_driver);
-}
-core_initcall(vexpress_syscfg_init);
+module_platform_driver(vexpress_syscfg_driver);
+MODULE_LICENSE("GPL v2");
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 17/17] ARM: vexpress: Don't select VEXPRESS_CONFIG
  2020-04-19 17:07 ` Rob Herring
@ 2020-04-19 17:08   ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is
unnecessary. Selecting it also prevents setting CONFIG_VEXPRESS_CONFIG
to a module.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm/mach-vexpress/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 065e12991663..8391a5b3cd78 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -19,7 +19,6 @@ menuconfig ARCH_VEXPRESS
 	select POWER_SUPPLY
 	select REGULATOR if MMC_ARMMMCI
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
-	select VEXPRESS_CONFIG
 	help
 	  This option enables support for systems using Cortex processor based
 	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 136+ messages in thread

* [PATCH 17/17] ARM: vexpress: Don't select VEXPRESS_CONFIG
@ 2020-04-19 17:08   ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-19 17:08 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Stephen Boyd, Catalin Marinas,
	Kevin Brodsky, Sebastian Reichel, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is
unnecessary. Selecting it also prevents setting CONFIG_VEXPRESS_CONFIG
to a module.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm/mach-vexpress/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 065e12991663..8391a5b3cd78 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -19,7 +19,6 @@ menuconfig ARCH_VEXPRESS
 	select POWER_SUPPLY
 	select REGULATOR if MMC_ARMMMCI
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
-	select VEXPRESS_CONFIG
 	help
 	  This option enables support for systems using Cortex processor based
 	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 136+ messages in thread

* Re: [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-20  6:44     ` Linus Walleij
  -1 siblings, 0 replies; 136+ messages in thread
From: Linus Walleij @ 2020-04-20  6:44 UTC (permalink / raw)
  To: Rob Herring
  Cc: Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:

> CONFIG_COMMON_CLK_VERSATILE doesn't really do anything other than hiding
> Arm Ltd reference platform clock drivers. It is both selected by the
> platforms that need it and has a 'depends on' for those platforms. It
> selects REGMAP_MMIO, but really CONFIG_ICST should do that. Also,
> CONFIG_ICST can't be enabled for COMPILE_TEST unless something else
> selected it.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Good catch!

Since this conflicts a bit with other Kconfig patches I have pending for
mach:s in arch/arm it'd be great if I can get an ACK from the clk
maintainers and merge it with the rest in a pull request to the
SoC tree.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
@ 2020-04-20  6:44     ` Linus Walleij
  0 siblings, 0 replies; 136+ messages in thread
From: Linus Walleij @ 2020-04-20  6:44 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, Linux PM list, Stephen Boyd,
	Catalin Marinas, Sudeep Holla, Liviu Dudau, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:

> CONFIG_COMMON_CLK_VERSATILE doesn't really do anything other than hiding
> Arm Ltd reference platform clock drivers. It is both selected by the
> platforms that need it and has a 'depends on' for those platforms. It
> selects REGMAP_MMIO, but really CONFIG_ICST should do that. Also,
> CONFIG_ICST can't be enabled for COMPILE_TEST unless something else
> selected it.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Good catch!

Since this conflicts a bit with other Kconfig patches I have pending for
mach:s in arch/arm it'd be great if I can get an ACK from the clk
maintainers and merge it with the rest in a pull request to the
SoC tree.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 13/17] bus: vexpress-config: Merge vexpress-syscfg into vexpress-config
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-20 11:45     ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 136+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 11:45 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Arnd Bergmann, Catalin Marinas, Lee Jones, Sebastian Reichel,
	Stephen Boyd, Will Deacon, Kevin Brodsky, linux-arm-kernel,
	linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:08:06PM -0500, Rob Herring wrote:
> The only thing that vexpress-syscfg does is provide a regmap to
> vexpress-config bus child devices. There's little reason to have 2
> components for this. The current structure with initcall ordering
> requirements makes turning these components into modules more difficult.
> 
> So let's start to simplify things and merge vexpress-syscfg into
> vexpress-config. There's no functional change in this commit and it's
> still separate components until subsequent commits.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm/mach-vexpress/Kconfig |   1 -
>  drivers/bus/vexpress-config.c  | 283 +++++++++++++++++++++++++++++++--
>  drivers/misc/Kconfig           |   9 --
>  drivers/misc/Makefile          |   1 -
>  drivers/misc/vexpress-syscfg.c | 280 --------------------------------
>  include/linux/vexpress.h       |  17 --
>  6 files changed, 274 insertions(+), 317 deletions(-)
>  delete mode 100644 drivers/misc/vexpress-syscfg.c


Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 13/17] bus: vexpress-config: Merge vexpress-syscfg into vexpress-config
@ 2020-04-20 11:45     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 136+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 11:45 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Kevin Brodsky, Liviu Dudau,
	Sebastian Reichel, Will Deacon, Sudeep Holla, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:06PM -0500, Rob Herring wrote:
> The only thing that vexpress-syscfg does is provide a regmap to
> vexpress-config bus child devices. There's little reason to have 2
> components for this. The current structure with initcall ordering
> requirements makes turning these components into modules more difficult.
> 
> So let's start to simplify things and merge vexpress-syscfg into
> vexpress-config. There's no functional change in this commit and it's
> still separate components until subsequent commits.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm/mach-vexpress/Kconfig |   1 -
>  drivers/bus/vexpress-config.c  | 283 +++++++++++++++++++++++++++++++--
>  drivers/misc/Kconfig           |   9 --
>  drivers/misc/Makefile          |   1 -
>  drivers/misc/vexpress-syscfg.c | 280 --------------------------------
>  include/linux/vexpress.h       |  17 --
>  6 files changed, 274 insertions(+), 317 deletions(-)
>  delete mode 100644 drivers/misc/vexpress-syscfg.c


Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 01/17] ARM: vexpress: Move vexpress_flags_set() into arch code
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-20 15:17     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:17 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> vexpress_flags_set() is only used by the platform SMP related code and
> has nothing to do with the vexpress-sysreg MFD driver other than both
> access the same h/w block. It's also only needed for 32-bit systems and
> must be built-in for them. Let's move vexpress_flags_set() closer to
> where it is being used. This will allow for vexpress-sysreg to be built
> as a module.
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 01/17] ARM: vexpress: Move vexpress_flags_set() into arch code
@ 2020-04-20 15:17     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:17 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> vexpress_flags_set() is only used by the platform SMP related code and
> has nothing to do with the vexpress-sysreg MFD driver other than both
> access the same h/w block. It's also only needed for 32-bit systems and
> must be built-in for them. Let's move vexpress_flags_set() closer to
> where it is being used. This will allow for vexpress-sysreg to be built
> as a module.
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 02/17] arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-20 15:18     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> The VExpress power-off/reset driver is not needed on 64-bit platforms as
> PSCI power-off and reset can be used instead. Stop selecting it so it
> can be disabled and not always built-in.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 02/17] arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS
@ 2020-04-20 15:18     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> The VExpress power-off/reset driver is not needed on 64-bit platforms as
> PSCI power-off and reset can be used instead. Stop selecting it so it
> can be disabled and not always built-in.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 03/17] arm64: vexpress: Don't select CONFIG_VEXPRESS_CONFIG
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-20 15:18     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is
> unnecessary. It also prevents setting CONFIG_VEXPRESS_CONFIG to a module.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm64/Kconfig.platforms | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 9c084f995e0f..5c38dc56b808 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -278,7 +278,6 @@ config ARCH_VEXPRESS
>         select GPIOLIB
>         select PM
>         select PM_GENERIC_DOMAINS
> -       select VEXPRESS_CONFIG
>         help
>           This enables support for the ARMv8 software model (Versatile
>           Express).

Nothing wrong with this change, but I'd fold it into the previous patch,
as this 'select' was clearly meant to avoid a build failure on the
previous one.

      Arnd

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 03/17] arm64: vexpress: Don't select CONFIG_VEXPRESS_CONFIG
@ 2020-04-20 15:18     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is
> unnecessary. It also prevents setting CONFIG_VEXPRESS_CONFIG to a module.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm64/Kconfig.platforms | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 9c084f995e0f..5c38dc56b808 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -278,7 +278,6 @@ config ARCH_VEXPRESS
>         select GPIOLIB
>         select PM
>         select PM_GENERIC_DOMAINS
> -       select VEXPRESS_CONFIG
>         help
>           This enables support for the ARMv8 software model (Versatile
>           Express).

Nothing wrong with this change, but I'd fold it into the previous patch,
as this 'select' was clearly meant to avoid a build failure on the
previous one.

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 04/17] power/reset: vexpress: Support building as a module
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-20 15:23     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:23 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Enable building the VExpress power-off/reset driver as a module.

Your change allows loading and unloading the driver, but actually
unloading is a bug with the current implementation, as there is no
'release' handler to undo the _vexpress_register_restart_handler()
function.

It should not be hard to add a release handler, or you could just
mark the function as non-unloadable by only having a module_init()
but no module_exit() function.

I suppose if you do the latter, there should also be a suppress_bind_attrs
flag in the device_driver. This is a preexisting bug.

       Arnd

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 04/17] power/reset: vexpress: Support building as a module
@ 2020-04-20 15:23     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:23 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Enable building the VExpress power-off/reset driver as a module.

Your change allows loading and unloading the driver, but actually
unloading is a bug with the current implementation, as there is no
'release' handler to undo the _vexpress_register_restart_handler()
function.

It should not be hard to add a release handler, or you could just
mark the function as non-unloadable by only having a module_init()
but no module_exit() function.

I suppose if you do the latter, there should also be a suppress_bind_attrs
flag in the device_driver. This is a preexisting bug.

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-20 15:26     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> While 64-bit Arm reference platforms have SP810 for clocks for SP804
> timers, they are not needed since the arch timers are used instead.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

>
>  config CLK_SP810
>         bool "Clock driver for ARM SP810 System Controller"
> -       default y if ARCH_VEXPRESS
> +       default y if (ARCH_VEXPRESS && ARM)

But maybe add "|| (COMPILE_TEST && OF)" for extra points.

       Arnd

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
@ 2020-04-20 15:26     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> While 64-bit Arm reference platforms have SP810 for clocks for SP804
> timers, they are not needed since the arch timers are used instead.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

>
>  config CLK_SP810
>         bool "Clock driver for ARM SP810 System Controller"
> -       default y if ARCH_VEXPRESS
> +       default y if (ARCH_VEXPRESS && ARM)

But maybe add "|| (COMPILE_TEST && OF)" for extra points.

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-20 15:26     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> In preparation to enable the vexpress-osc clock driver as a module,
> convert the driver to use the managed devres clock API variants. With
> this, a driver .remove() hook is not needed.
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants
@ 2020-04-20 15:26     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> In preparation to enable the vexpress-osc clock driver as a module,
> convert the driver to use the managed devres clock API variants. With
> this, a driver .remove() hook is not needed.
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-20 15:27     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:27 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list, Michael Turquette

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Enable building the vexpress-osc clock driver as a module.

>
>  config CLK_VEXPRESS_OSC
> -       bool "Clock driver for Versatile Express OSC clock generators"
> -       depends on VEXPRESS_CONFIG || COMPILE_TEST
> +       tristate "Clock driver for Versatile Express OSC clock generators"
> +       depends on VEXPRESS_CONFIG

Why do you remove the "|| COMPILE_TEST" here?

       Arnd

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
@ 2020-04-20 15:27     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:27 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Michael Turquette,
	Greg Kroah-Hartman, Lee Jones, linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Enable building the vexpress-osc clock driver as a module.

>
>  config CLK_VEXPRESS_OSC
> -       bool "Clock driver for Versatile Express OSC clock generators"
> -       depends on VEXPRESS_CONFIG || COMPILE_TEST
> +       tristate "Clock driver for Versatile Express OSC clock generators"
> +       depends on VEXPRESS_CONFIG

Why do you remove the "|| COMPILE_TEST" here?

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 09/17] mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-20 15:29     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:29 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Nothing in the VExpress sysregs nor the MFD child drivers use
> CONFIG_CLKSRC_MMIO. There's the 24MHz counter, but that's handled by
> drivers/clocksource/timer-versatile.c which doesn't use
> CONFIG_CLKSRC_MMIO either. So let's just drop CONFIG_CLKSRC_MMIO.
>
> As the !ARCH_USES_GETTIMEOFFSET dependency was added for
> CONFIG_CLKSRC_MMIO, that can be dropped, too.
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 09/17] mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO
@ 2020-04-20 15:29     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:29 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Nothing in the VExpress sysregs nor the MFD child drivers use
> CONFIG_CLKSRC_MMIO. There's the 24MHz counter, but that's handled by
> drivers/clocksource/timer-versatile.c which doesn't use
> CONFIG_CLKSRC_MMIO either. So let's just drop CONFIG_CLKSRC_MMIO.
>
> As the !ARCH_USES_GETTIMEOFFSET dependency was added for
> CONFIG_CLKSRC_MMIO, that can be dropped, too.
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 10/17] mfd: vexpress-sysreg: Drop unused syscon child devices
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-20 15:30     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:30 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

No description? It would be nice to know why it was added in the first place,
or at least that you were unsuccessful in finding out why.

       Arnd

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 10/17] mfd: vexpress-sysreg: Drop unused syscon child devices
@ 2020-04-20 15:30     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:30 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

No description? It would be nice to know why it was added in the first place,
or at least that you were unsuccessful in finding out why.

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 11/17] mfd: vexpress-sysreg: Use devres API variants
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-20 15:31     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:31 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Use the managed devm_gpiochip_add_data() and devm_mfd_add_devices()
> instead of their unmanaged counterparts. With this, no .remove() hook is
> needed for driver unbind.
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 11/17] mfd: vexpress-sysreg: Use devres API variants
@ 2020-04-20 15:31     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:31 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Use the managed devm_gpiochip_add_data() and devm_mfd_add_devices()
> instead of their unmanaged counterparts. With this, no .remove() hook is
> needed for driver unbind.
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 12/17] mfd: vexpress-sysreg: Support building as a module
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-20 15:32     ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:32 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Enable building the vexpress-sysreg driver as a module.

> -
> -       /* Need the sysreg early, before any other device... */
> -       for_each_matching_node(node, vexpress_sysreg_match)
> -               of_platform_device_create(node, NULL, NULL);

Is this safe to remove? If yes, please mention it in the changelog.

      Arnd

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 12/17] mfd: vexpress-sysreg: Support building as a module
@ 2020-04-20 15:32     ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 15:32 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Enable building the vexpress-sysreg driver as a module.

> -
> -       /* Need the sysreg early, before any other device... */
> -       for_each_matching_node(node, vexpress_sysreg_match)
> -               of_platform_device_create(node, NULL, NULL);

Is this safe to remove? If yes, please mention it in the changelog.

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 12/17] mfd: vexpress-sysreg: Support building as a module
  2020-04-20 15:32     ` Arnd Bergmann
@ 2020-04-20 17:05       ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-20 17:05 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Mon, Apr 20, 2020 at 10:32 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> >
> > Enable building the vexpress-sysreg driver as a module.
>
> > -
> > -       /* Need the sysreg early, before any other device... */
> > -       for_each_matching_node(node, vexpress_sysreg_match)
> > -               of_platform_device_create(node, NULL, NULL);
>
> Is this safe to remove? If yes, please mention it in the changelog.

Well, yes and no (I think). This was purely to instantiate the device
early before the default DT probing would do it (as all the parents
are 'simple-bus' the default would descend to these nodes). It's fine
after patch 14 for sure, but before that I think it is changing the
initcall/probe order. So I'll stick this between patch 15 and 16.

Rob

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 12/17] mfd: vexpress-sysreg: Support building as a module
@ 2020-04-20 17:05       ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-20 17:05 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Mon, Apr 20, 2020 at 10:32 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> >
> > Enable building the vexpress-sysreg driver as a module.
>
> > -
> > -       /* Need the sysreg early, before any other device... */
> > -       for_each_matching_node(node, vexpress_sysreg_match)
> > -               of_platform_device_create(node, NULL, NULL);
>
> Is this safe to remove? If yes, please mention it in the changelog.

Well, yes and no (I think). This was purely to instantiate the device
early before the default DT probing would do it (as all the parents
are 'simple-bus' the default would descend to these nodes). It's fine
after patch 14 for sure, but before that I think it is changing the
initcall/probe order. So I'll stick this between patch 15 and 16.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
  2020-04-20 15:27     ` Arnd Bergmann
@ 2020-04-20 17:18       ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-20 17:18 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list, Michael Turquette

On Mon, Apr 20, 2020 at 10:28 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> >
> > Enable building the vexpress-osc clock driver as a module.
>
> >
> >  config CLK_VEXPRESS_OSC
> > -       bool "Clock driver for Versatile Express OSC clock generators"
> > -       depends on VEXPRESS_CONFIG || COMPILE_TEST
> > +       tristate "Clock driver for Versatile Express OSC clock generators"
> > +       depends on VEXPRESS_CONFIG
>
> Why do you remove the "|| COMPILE_TEST" here?

Looks like a rebasing error. I only added it in patch 5.

It has to depend on VEXPRESS_CONFIG because
devm_regmap_init_vexpress_config doesn't have an empty function.

Rob

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
@ 2020-04-20 17:18       ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-20 17:18 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Michael Turquette,
	Greg Kroah-Hartman, Lee Jones, linux-clk, Linux ARM

On Mon, Apr 20, 2020 at 10:28 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> >
> > Enable building the vexpress-osc clock driver as a module.
>
> >
> >  config CLK_VEXPRESS_OSC
> > -       bool "Clock driver for Versatile Express OSC clock generators"
> > -       depends on VEXPRESS_CONFIG || COMPILE_TEST
> > +       tristate "Clock driver for Versatile Express OSC clock generators"
> > +       depends on VEXPRESS_CONFIG
>
> Why do you remove the "|| COMPILE_TEST" here?

Looks like a rebasing error. I only added it in patch 5.

It has to depend on VEXPRESS_CONFIG because
devm_regmap_init_vexpress_config doesn't have an empty function.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 04/17] power/reset: vexpress: Support building as a module
  2020-04-20 15:23     ` Arnd Bergmann
@ 2020-04-20 17:23       ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-20 17:23 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Mon, Apr 20, 2020 at 10:24 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> >
> > Enable building the VExpress power-off/reset driver as a module.
>
> Your change allows loading and unloading the driver, but actually
> unloading is a bug with the current implementation, as there is no
> 'release' handler to undo the _vexpress_register_restart_handler()
> function.

And also to save and restore pm_power_off...

> It should not be hard to add a release handler, or you could just
> mark the function as non-unloadable by only having a module_init()
> but no module_exit() function.
>
> I suppose if you do the latter, there should also be a suppress_bind_attrs
> flag in the device_driver. This is a preexisting bug.

I may just drop this patch. I wrote it and then realized I don't need
it as PSCI can be used instead.

Rob

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 04/17] power/reset: vexpress: Support building as a module
@ 2020-04-20 17:23       ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-20 17:23 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Mon, Apr 20, 2020 at 10:24 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> >
> > Enable building the VExpress power-off/reset driver as a module.
>
> Your change allows loading and unloading the driver, but actually
> unloading is a bug with the current implementation, as there is no
> 'release' handler to undo the _vexpress_register_restart_handler()
> function.

And also to save and restore pm_power_off...

> It should not be hard to add a release handler, or you could just
> mark the function as non-unloadable by only having a module_init()
> but no module_exit() function.
>
> I suppose if you do the latter, there should also be a suppress_bind_attrs
> flag in the device_driver. This is a preexisting bug.

I may just drop this patch. I wrote it and then realized I don't need
it as PSCI can be used instead.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
  2020-04-20 15:26     ` Arnd Bergmann
@ 2020-04-20 17:48       ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-20 17:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Mon, Apr 20, 2020 at 10:26 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> >
> > While 64-bit Arm reference platforms have SP810 for clocks for SP804
> > timers, they are not needed since the arch timers are used instead.
> >
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: Will Deacon <will@kernel.org>
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Stephen Boyd <sboyd@kernel.org>
> > Cc: linux-clk@vger.kernel.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> >
> >  config CLK_SP810
> >         bool "Clock driver for ARM SP810 System Controller"
> > -       default y if ARCH_VEXPRESS
> > +       default y if (ARCH_VEXPRESS && ARM)
>
> But maybe add "|| (COMPILE_TEST && OF)" for extra points.

On a 'default y'? Not necessary.

Rob

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
@ 2020-04-20 17:48       ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-20 17:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Mon, Apr 20, 2020 at 10:26 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> >
> > While 64-bit Arm reference platforms have SP810 for clocks for SP804
> > timers, they are not needed since the arch timers are used instead.
> >
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: Will Deacon <will@kernel.org>
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Stephen Boyd <sboyd@kernel.org>
> > Cc: linux-clk@vger.kernel.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> >
> >  config CLK_SP810
> >         bool "Clock driver for ARM SP810 System Controller"
> > -       default y if ARCH_VEXPRESS
> > +       default y if (ARCH_VEXPRESS && ARM)
>
> But maybe add "|| (COMPILE_TEST && OF)" for extra points.

On a 'default y'? Not necessary.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
  2020-04-20 17:48       ` Rob Herring
@ 2020-04-20 20:07         ` Arnd Bergmann
  -1 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 20:07 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	Linux ARM, linux-clk, Linux PM list

On Mon, Apr 20, 2020 at 7:48 PM Rob Herring <robh@kernel.org> wrote:
>
> On Mon, Apr 20, 2020 at 10:26 AM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > While 64-bit Arm reference platforms have SP810 for clocks for SP804
> > > timers, they are not needed since the arch timers are used instead.
> > >
> > > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > > Cc: Will Deacon <will@kernel.org>
> > > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > Cc: Stephen Boyd <sboyd@kernel.org>
> > > Cc: linux-clk@vger.kernel.org
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> >
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> >
> > >
> > >  config CLK_SP810
> > >         bool "Clock driver for ARM SP810 System Controller"
> > > -       default y if ARCH_VEXPRESS
> > > +       default y if (ARCH_VEXPRESS && ARM)
> >
> > But maybe add "|| (COMPILE_TEST && OF)" for extra points.
>
> On a 'default y'? Not necessary.

Ah right, that would indeed result in negative points.

      Arnd

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
@ 2020-04-20 20:07         ` Arnd Bergmann
  0 siblings, 0 replies; 136+ messages in thread
From: Arnd Bergmann @ 2020-04-20 20:07 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Will Deacon, Linux PM list, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Greg Kroah-Hartman, Lee Jones,
	linux-clk, Linux ARM

On Mon, Apr 20, 2020 at 7:48 PM Rob Herring <robh@kernel.org> wrote:
>
> On Mon, Apr 20, 2020 at 10:26 AM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > While 64-bit Arm reference platforms have SP810 for clocks for SP804
> > > timers, they are not needed since the arch timers are used instead.
> > >
> > > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > > Cc: Will Deacon <will@kernel.org>
> > > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > Cc: Stephen Boyd <sboyd@kernel.org>
> > > Cc: linux-clk@vger.kernel.org
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> >
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> >
> > >
> > >  config CLK_SP810
> > >         bool "Clock driver for ARM SP810 System Controller"
> > > -       default y if ARCH_VEXPRESS
> > > +       default y if (ARCH_VEXPRESS && ARM)
> >
> > But maybe add "|| (COMPILE_TEST && OF)" for extra points.
>
> On a 'default y'? Not necessary.

Ah right, that would indeed result in negative points.

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22  9:47     ` Stephen Boyd
  -1 siblings, 0 replies; 136+ messages in thread
From: Stephen Boyd @ 2020-04-22  9:47 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Rob Herring, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Will Deacon, Kevin Brodsky, linux-arm-kernel,
	linux-clk, linux-pm

Quoting Rob Herring (2020-04-19 10:07:58)
> diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> index c2618f1477a2..3465fb291998 100644
> --- a/drivers/clk/versatile/Kconfig
> +++ b/drivers/clk/versatile/Kconfig
> @@ -1,22 +1,14 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  config ICST
> -       bool
> -
> -config COMMON_CLK_VERSATILE
> -       bool "Clock driver for ARM Reference designs"
> -       depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
> -               ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
> -               COMPILE_TEST
> +       bool "Clock driver for ARM Reference designs ICST" if COMPILE_TEST
>         select REGMAP_MMIO
>         ---help---
>           Supports clocking on ARM Reference designs:
>           - Integrator/AP and Integrator/CP
>           - RealView PB1176, EB, PB11MP and PBX
> -         - Versatile Express
>  
>  config CLK_SP810
>         bool "Clock driver for ARM SP810 System Controller"
> -       depends on COMMON_CLK_VERSATILE

Shouldn't this get the depends from COMMON_CLK_VERSATILE so that this
option isn't exposed unless someone is compile testing or using that
platform?

>         default y if ARCH_VEXPRESS
>         ---help---
>           Supports clock muxing (REFCLK/TIMCLK to TIMERCLKEN0-3) capabilities
> @@ -24,8 +16,7 @@ config CLK_SP810
>  
>  config CLK_VEXPRESS_OSC
>         bool "Clock driver for Versatile Express OSC clock generators"
> -       depends on COMMON_CLK_VERSATILE
> -       depends on VEXPRESS_CONFIG
> +       depends on VEXPRESS_CONFIG || COMPILE_TEST
>         default y if ARCH_VEXPRESS
>         ---help---
>           Simple regmap-based driver driving clock generators on Versatile

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
@ 2020-04-22  9:47     ` Stephen Boyd
  0 siblings, 0 replies; 136+ messages in thread
From: Stephen Boyd @ 2020-04-22  9:47 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Rob Herring, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Catalin Marinas, Kevin Brodsky,
	Sebastian Reichel, Greg Kroah-Hartman, Lee Jones, Will Deacon,
	linux-clk, linux-arm-kernel

Quoting Rob Herring (2020-04-19 10:07:58)
> diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> index c2618f1477a2..3465fb291998 100644
> --- a/drivers/clk/versatile/Kconfig
> +++ b/drivers/clk/versatile/Kconfig
> @@ -1,22 +1,14 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  config ICST
> -       bool
> -
> -config COMMON_CLK_VERSATILE
> -       bool "Clock driver for ARM Reference designs"
> -       depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
> -               ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
> -               COMPILE_TEST
> +       bool "Clock driver for ARM Reference designs ICST" if COMPILE_TEST
>         select REGMAP_MMIO
>         ---help---
>           Supports clocking on ARM Reference designs:
>           - Integrator/AP and Integrator/CP
>           - RealView PB1176, EB, PB11MP and PBX
> -         - Versatile Express
>  
>  config CLK_SP810
>         bool "Clock driver for ARM SP810 System Controller"
> -       depends on COMMON_CLK_VERSATILE

Shouldn't this get the depends from COMMON_CLK_VERSATILE so that this
option isn't exposed unless someone is compile testing or using that
platform?

>         default y if ARCH_VEXPRESS
>         ---help---
>           Supports clock muxing (REFCLK/TIMCLK to TIMERCLKEN0-3) capabilities
> @@ -24,8 +16,7 @@ config CLK_SP810
>  
>  config CLK_VEXPRESS_OSC
>         bool "Clock driver for Versatile Express OSC clock generators"
> -       depends on COMMON_CLK_VERSATILE
> -       depends on VEXPRESS_CONFIG
> +       depends on VEXPRESS_CONFIG || COMPILE_TEST
>         default y if ARCH_VEXPRESS
>         ---help---
>           Simple regmap-based driver driving clock generators on Versatile

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22  9:48     ` Stephen Boyd
  -1 siblings, 0 replies; 136+ messages in thread
From: Stephen Boyd @ 2020-04-22  9:48 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Rob Herring, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Will Deacon, Kevin Brodsky, linux-arm-kernel,
	linux-clk, linux-pm

Quoting Rob Herring (2020-04-19 10:07:59)
> While 64-bit Arm reference platforms have SP810 for clocks for SP804
> timers, they are not needed since the arch timers are used instead.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---

Acked-by: Stephen Boyd <sboyd@kernel.org>

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
@ 2020-04-22  9:48     ` Stephen Boyd
  0 siblings, 0 replies; 136+ messages in thread
From: Stephen Boyd @ 2020-04-22  9:48 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Rob Herring, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Catalin Marinas, Kevin Brodsky,
	Sebastian Reichel, Greg Kroah-Hartman, Lee Jones, Will Deacon,
	linux-clk, linux-arm-kernel

Quoting Rob Herring (2020-04-19 10:07:59)
> While 64-bit Arm reference platforms have SP810 for clocks for SP804
> timers, they are not needed since the arch timers are used instead.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---

Acked-by: Stephen Boyd <sboyd@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 15/17] vexpress: Move site master init to vexpress-config bus
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22  9:51     ` Stephen Boyd
  -1 siblings, 0 replies; 136+ messages in thread
From: Stephen Boyd @ 2020-04-22  9:51 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Rob Herring, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Will Deacon, Kevin Brodsky, linux-arm-kernel,
	linux-clk, linux-pm

Is the subject supposed to say 'set master' vs. 'site master'?

Quoting Rob Herring (2020-04-19 10:08:08)
> There's only a single caller of vexpress_config_set_master() from
> vexpress-sysreg.c. Let's just make the registers needed available to
> vexpress-config and move all the code there. The registers needed aren't
> used anywhere else either. With this, we can get rid of the private API
> between these 2 drivers.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 15/17] vexpress: Move site master init to vexpress-config bus
@ 2020-04-22  9:51     ` Stephen Boyd
  0 siblings, 0 replies; 136+ messages in thread
From: Stephen Boyd @ 2020-04-22  9:51 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Rob Herring, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Catalin Marinas, Kevin Brodsky,
	Sebastian Reichel, Greg Kroah-Hartman, Lee Jones, Will Deacon,
	linux-clk, linux-arm-kernel

Is the subject supposed to say 'set master' vs. 'site master'?

Quoting Rob Herring (2020-04-19 10:08:08)
> There's only a single caller of vexpress_config_set_master() from
> vexpress-sysreg.c. Let's just make the registers needed available to
> vexpress-config and move all the code there. The registers needed aren't
> used anywhere else either. With this, we can get rid of the private API
> between these 2 drivers.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22  9:51     ` Stephen Boyd
  -1 siblings, 0 replies; 136+ messages in thread
From: Stephen Boyd @ 2020-04-22  9:51 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Rob Herring, Sudeep Holla
  Cc: Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Will Deacon, Kevin Brodsky, linux-arm-kernel,
	linux-clk, linux-pm

Quoting Rob Herring (2020-04-19 10:08:00)
> In preparation to enable the vexpress-osc clock driver as a module,
> convert the driver to use the managed devres clock API variants. With
> this, a driver .remove() hook is not needed.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@kernel.org>

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants
@ 2020-04-22  9:51     ` Stephen Boyd
  0 siblings, 0 replies; 136+ messages in thread
From: Stephen Boyd @ 2020-04-22  9:51 UTC (permalink / raw)
  To: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Rob Herring, Sudeep Holla
  Cc: Arnd Bergmann, linux-pm, Catalin Marinas, Kevin Brodsky,
	Sebastian Reichel, Greg Kroah-Hartman, Lee Jones, Will Deacon,
	linux-clk, linux-arm-kernel

Quoting Rob Herring (2020-04-19 10:08:00)
> In preparation to enable the vexpress-osc clock driver as a module,
> convert the driver to use the managed devres clock API variants. With
> this, a driver .remove() hook is not needed.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 01/17] ARM: vexpress: Move vexpress_flags_set() into arch code
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22 10:15     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 10:15 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:07:54PM -0500, Rob Herring wrote:
> vexpress_flags_set() is only used by the platform SMP related code and
> has nothing to do with the vexpress-sysreg MFD driver other than both
> access the same h/w block. It's also only needed for 32-bit systems and
> must be built-in for them. Let's move vexpress_flags_set() closer to
> where it is being used. This will allow for vexpress-sysreg to be built
> as a module.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Unfortunately I did not had the forethought to leave my Versatile Express board
plugged in before our office lockdown, so I will not have a chance to test the
series.

Best regards,
Liviu

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm/mach-vexpress/Kconfig |  1 -
>  arch/arm/mach-vexpress/core.h  |  1 +
>  arch/arm/mach-vexpress/dcscb.c |  1 +
>  arch/arm/mach-vexpress/v2m.c   | 23 +++++++++++++++++++++++
>  drivers/mfd/vexpress-sysreg.c  | 19 -------------------
>  include/linux/vexpress.h       |  4 ----
>  6 files changed, 25 insertions(+), 24 deletions(-)
> 
> diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
> index 726a68085c3b..18951cd20d9d 100644
> --- a/arch/arm/mach-vexpress/Kconfig
> +++ b/arch/arm/mach-vexpress/Kconfig
> @@ -22,7 +22,6 @@ menuconfig ARCH_VEXPRESS
>  	select REGULATOR_FIXED_VOLTAGE if REGULATOR
>  	select VEXPRESS_CONFIG
>  	select VEXPRESS_SYSCFG
> -	select MFD_VEXPRESS_SYSREG
>  	help
>  	  This option enables support for systems using Cortex processor based
>  	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
> diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
> index f4a7519084f1..bda78675c55d 100644
> --- a/arch/arm/mach-vexpress/core.h
> +++ b/arch/arm/mach-vexpress/core.h
> @@ -1,3 +1,4 @@
>  bool vexpress_smp_init_ops(void);
> +void vexpress_flags_set(u32 data);
>  
>  extern const struct smp_operations vexpress_smp_dt_ops;
> diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c
> index 46a903c88c6a..a0554d7d04f7 100644
> --- a/arch/arm/mach-vexpress/dcscb.c
> +++ b/arch/arm/mach-vexpress/dcscb.c
> @@ -20,6 +20,7 @@
>  #include <asm/cputype.h>
>  #include <asm/cp15.h>
>  
> +#include "core.h"
>  
>  #define RST_HOLD0	0x0
>  #define RST_HOLD1	0x4
> diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
> index 95886b3bb9dd..ffe7c7a85ae9 100644
> --- a/arch/arm/mach-vexpress/v2m.c
> +++ b/arch/arm/mach-vexpress/v2m.c
> @@ -1,8 +1,31 @@
>  // SPDX-License-Identifier: GPL-2.0
> +#include <linux/of.h>
> +#include <linux/of_address.h>
>  #include <asm/mach/arch.h>
>  
>  #include "core.h"
>  
> +#define SYS_FLAGSSET		0x030
> +#define SYS_FLAGSCLR		0x034
> +
> +void vexpress_flags_set(u32 data)
> +{
> +	static void __iomem *base;
> +
> +	if (!base) {
> +		struct device_node *node = of_find_compatible_node(NULL, NULL,
> +				"arm,vexpress-sysreg");
> +
> +		base = of_iomap(node, 0);
> +	}
> +
> +	if (WARN_ON(!base))
> +		return;
> +
> +	writel(~0, base + SYS_FLAGSCLR);
> +	writel(data, base + SYS_FLAGSSET);
> +}
> +
>  static const char * const v2m_dt_match[] __initconst = {
>  	"arm,vexpress",
>  	NULL,
> diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
> index c68ff56dbdb1..0b9cc67706c7 100644
> --- a/drivers/mfd/vexpress-sysreg.c
> +++ b/drivers/mfd/vexpress-sysreg.c
> @@ -8,7 +8,6 @@
>  #include <linux/err.h>
>  #include <linux/io.h>
>  #include <linux/mfd/core.h>
> -#include <linux/of_address.h>
>  #include <linux/of_platform.h>
>  #include <linux/platform_data/syscon.h>
>  #include <linux/platform_device.h>
> @@ -42,24 +41,6 @@
>  
>  #define SYS_MISC_MASTERSITE	(1 << 14)
>  
> -void vexpress_flags_set(u32 data)
> -{
> -	static void __iomem *base;
> -
> -	if (!base) {
> -		struct device_node *node = of_find_compatible_node(NULL, NULL,
> -				"arm,vexpress-sysreg");
> -
> -		base = of_iomap(node, 0);
> -	}
> -
> -	if (WARN_ON(!base))
> -		return;
> -
> -	writel(~0, base + SYS_FLAGSCLR);
> -	writel(data, base + SYS_FLAGSSET);
> -}
> -
>  /* The sysreg block is just a random collection of various functions... */
>  
>  static struct syscon_platform_data vexpress_sysreg_sys_id_pdata = {
> diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
> index 0e130b5077a5..2ec7992b054c 100644
> --- a/include/linux/vexpress.h
> +++ b/include/linux/vexpress.h
> @@ -40,8 +40,4 @@ struct device *vexpress_config_bridge_register(struct device *parent,
>  
>  struct regmap *devm_regmap_init_vexpress_config(struct device *dev);
>  
> -/* Platform control */
> -
> -void vexpress_flags_set(u32 data);
> -
>  #endif
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 01/17] ARM: vexpress: Move vexpress_flags_set() into arch code
@ 2020-04-22 10:15     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 10:15 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:07:54PM -0500, Rob Herring wrote:
> vexpress_flags_set() is only used by the platform SMP related code and
> has nothing to do with the vexpress-sysreg MFD driver other than both
> access the same h/w block. It's also only needed for 32-bit systems and
> must be built-in for them. Let's move vexpress_flags_set() closer to
> where it is being used. This will allow for vexpress-sysreg to be built
> as a module.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Unfortunately I did not had the forethought to leave my Versatile Express board
plugged in before our office lockdown, so I will not have a chance to test the
series.

Best regards,
Liviu

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm/mach-vexpress/Kconfig |  1 -
>  arch/arm/mach-vexpress/core.h  |  1 +
>  arch/arm/mach-vexpress/dcscb.c |  1 +
>  arch/arm/mach-vexpress/v2m.c   | 23 +++++++++++++++++++++++
>  drivers/mfd/vexpress-sysreg.c  | 19 -------------------
>  include/linux/vexpress.h       |  4 ----
>  6 files changed, 25 insertions(+), 24 deletions(-)
> 
> diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
> index 726a68085c3b..18951cd20d9d 100644
> --- a/arch/arm/mach-vexpress/Kconfig
> +++ b/arch/arm/mach-vexpress/Kconfig
> @@ -22,7 +22,6 @@ menuconfig ARCH_VEXPRESS
>  	select REGULATOR_FIXED_VOLTAGE if REGULATOR
>  	select VEXPRESS_CONFIG
>  	select VEXPRESS_SYSCFG
> -	select MFD_VEXPRESS_SYSREG
>  	help
>  	  This option enables support for systems using Cortex processor based
>  	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
> diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
> index f4a7519084f1..bda78675c55d 100644
> --- a/arch/arm/mach-vexpress/core.h
> +++ b/arch/arm/mach-vexpress/core.h
> @@ -1,3 +1,4 @@
>  bool vexpress_smp_init_ops(void);
> +void vexpress_flags_set(u32 data);
>  
>  extern const struct smp_operations vexpress_smp_dt_ops;
> diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c
> index 46a903c88c6a..a0554d7d04f7 100644
> --- a/arch/arm/mach-vexpress/dcscb.c
> +++ b/arch/arm/mach-vexpress/dcscb.c
> @@ -20,6 +20,7 @@
>  #include <asm/cputype.h>
>  #include <asm/cp15.h>
>  
> +#include "core.h"
>  
>  #define RST_HOLD0	0x0
>  #define RST_HOLD1	0x4
> diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
> index 95886b3bb9dd..ffe7c7a85ae9 100644
> --- a/arch/arm/mach-vexpress/v2m.c
> +++ b/arch/arm/mach-vexpress/v2m.c
> @@ -1,8 +1,31 @@
>  // SPDX-License-Identifier: GPL-2.0
> +#include <linux/of.h>
> +#include <linux/of_address.h>
>  #include <asm/mach/arch.h>
>  
>  #include "core.h"
>  
> +#define SYS_FLAGSSET		0x030
> +#define SYS_FLAGSCLR		0x034
> +
> +void vexpress_flags_set(u32 data)
> +{
> +	static void __iomem *base;
> +
> +	if (!base) {
> +		struct device_node *node = of_find_compatible_node(NULL, NULL,
> +				"arm,vexpress-sysreg");
> +
> +		base = of_iomap(node, 0);
> +	}
> +
> +	if (WARN_ON(!base))
> +		return;
> +
> +	writel(~0, base + SYS_FLAGSCLR);
> +	writel(data, base + SYS_FLAGSSET);
> +}
> +
>  static const char * const v2m_dt_match[] __initconst = {
>  	"arm,vexpress",
>  	NULL,
> diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
> index c68ff56dbdb1..0b9cc67706c7 100644
> --- a/drivers/mfd/vexpress-sysreg.c
> +++ b/drivers/mfd/vexpress-sysreg.c
> @@ -8,7 +8,6 @@
>  #include <linux/err.h>
>  #include <linux/io.h>
>  #include <linux/mfd/core.h>
> -#include <linux/of_address.h>
>  #include <linux/of_platform.h>
>  #include <linux/platform_data/syscon.h>
>  #include <linux/platform_device.h>
> @@ -42,24 +41,6 @@
>  
>  #define SYS_MISC_MASTERSITE	(1 << 14)
>  
> -void vexpress_flags_set(u32 data)
> -{
> -	static void __iomem *base;
> -
> -	if (!base) {
> -		struct device_node *node = of_find_compatible_node(NULL, NULL,
> -				"arm,vexpress-sysreg");
> -
> -		base = of_iomap(node, 0);
> -	}
> -
> -	if (WARN_ON(!base))
> -		return;
> -
> -	writel(~0, base + SYS_FLAGSCLR);
> -	writel(data, base + SYS_FLAGSSET);
> -}
> -
>  /* The sysreg block is just a random collection of various functions... */
>  
>  static struct syscon_platform_data vexpress_sysreg_sys_id_pdata = {
> diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
> index 0e130b5077a5..2ec7992b054c 100644
> --- a/include/linux/vexpress.h
> +++ b/include/linux/vexpress.h
> @@ -40,8 +40,4 @@ struct device *vexpress_config_bridge_register(struct device *parent,
>  
>  struct regmap *devm_regmap_init_vexpress_config(struct device *dev);
>  
> -/* Platform control */
> -
> -void vexpress_flags_set(u32 data);
> -
>  #endif
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 02/17] arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22 10:16     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 10:16 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:07:55PM -0500, Rob Herring wrote:
> The VExpress power-off/reset driver is not needed on 64-bit platforms as
> PSCI power-off and reset can be used instead. Stop selecting it so it
> can be disabled and not always built-in.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm64/Kconfig.platforms | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 55d70cfe0f9e..9c084f995e0f 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -278,7 +278,6 @@ config ARCH_VEXPRESS
>  	select GPIOLIB
>  	select PM
>  	select PM_GENERIC_DOMAINS
> -	select POWER_RESET_VEXPRESS
>  	select VEXPRESS_CONFIG
>  	help
>  	  This enables support for the ARMv8 software model (Versatile
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 02/17] arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS
@ 2020-04-22 10:16     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 10:16 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:07:55PM -0500, Rob Herring wrote:
> The VExpress power-off/reset driver is not needed on 64-bit platforms as
> PSCI power-off and reset can be used instead. Stop selecting it so it
> can be disabled and not always built-in.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm64/Kconfig.platforms | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 55d70cfe0f9e..9c084f995e0f 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -278,7 +278,6 @@ config ARCH_VEXPRESS
>  	select GPIOLIB
>  	select PM
>  	select PM_GENERIC_DOMAINS
> -	select POWER_RESET_VEXPRESS
>  	select VEXPRESS_CONFIG
>  	help
>  	  This enables support for the ARMv8 software model (Versatile
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22 10:20     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 10:20 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:07:59PM -0500, Rob Herring wrote:
> While 64-bit Arm reference platforms have SP810 for clocks for SP804
> timers, they are not needed since the arch timers are used instead.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/clk/versatile/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> index 3465fb291998..5bdd5c98990b 100644
> --- a/drivers/clk/versatile/Kconfig
> +++ b/drivers/clk/versatile/Kconfig
> @@ -9,7 +9,7 @@ config ICST
>  
>  config CLK_SP810
>  	bool "Clock driver for ARM SP810 System Controller"
> -	default y if ARCH_VEXPRESS
> +	default y if (ARCH_VEXPRESS && ARM)
>  	---help---
>  	  Supports clock muxing (REFCLK/TIMCLK to TIMERCLKEN0-3) capabilities
>  	  of the ARM SP810 System Controller cell.
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
@ 2020-04-22 10:20     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 10:20 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:07:59PM -0500, Rob Herring wrote:
> While 64-bit Arm reference platforms have SP810 for clocks for SP804
> timers, they are not needed since the arch timers are used instead.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/clk/versatile/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> index 3465fb291998..5bdd5c98990b 100644
> --- a/drivers/clk/versatile/Kconfig
> +++ b/drivers/clk/versatile/Kconfig
> @@ -9,7 +9,7 @@ config ICST
>  
>  config CLK_SP810
>  	bool "Clock driver for ARM SP810 System Controller"
> -	default y if ARCH_VEXPRESS
> +	default y if (ARCH_VEXPRESS && ARM)
>  	---help---
>  	  Supports clock muxing (REFCLK/TIMCLK to TIMERCLKEN0-3) capabilities
>  	  of the ARM SP810 System Controller cell.
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 10:21     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 10:21 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:08:00PM -0500, Rob Herring wrote:
> In preparation to enable the vexpress-osc clock driver as a module,
> convert the driver to use the managed devres clock API variants. With
> this, a driver .remove() hook is not needed.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/clk/versatile/clk-vexpress-osc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> index 7ade146a3ea9..5bb1d5a714d0 100644
> --- a/drivers/clk/versatile/clk-vexpress-osc.c
> +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> @@ -65,8 +65,8 @@ static int vexpress_osc_probe(struct platform_device *pdev)
>  {
>  	struct clk_init_data init;
>  	struct vexpress_osc *osc;
> -	struct clk *clk;
>  	u32 range[2];
> +	int ret;
>  
>  	osc = devm_kzalloc(&pdev->dev, sizeof(*osc), GFP_KERNEL);
>  	if (!osc)
> @@ -92,11 +92,11 @@ static int vexpress_osc_probe(struct platform_device *pdev)
>  
>  	osc->hw.init = &init;
>  
> -	clk = clk_register(NULL, &osc->hw);
> -	if (IS_ERR(clk))
> -		return PTR_ERR(clk);
> +	ret = devm_clk_hw_register(&pdev->dev, &osc->hw);
> +	if (ret < 0)
> +		return ret;
>  
> -	of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, clk);
> +	devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, &osc->hw);
>  	clk_hw_set_rate_range(&osc->hw, osc->rate_min, osc->rate_max);
>  
>  	dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name);
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants
@ 2020-04-22 10:21     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 10:21 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:00PM -0500, Rob Herring wrote:
> In preparation to enable the vexpress-osc clock driver as a module,
> convert the driver to use the managed devres clock API variants. With
> this, a driver .remove() hook is not needed.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/clk/versatile/clk-vexpress-osc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> index 7ade146a3ea9..5bb1d5a714d0 100644
> --- a/drivers/clk/versatile/clk-vexpress-osc.c
> +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> @@ -65,8 +65,8 @@ static int vexpress_osc_probe(struct platform_device *pdev)
>  {
>  	struct clk_init_data init;
>  	struct vexpress_osc *osc;
> -	struct clk *clk;
>  	u32 range[2];
> +	int ret;
>  
>  	osc = devm_kzalloc(&pdev->dev, sizeof(*osc), GFP_KERNEL);
>  	if (!osc)
> @@ -92,11 +92,11 @@ static int vexpress_osc_probe(struct platform_device *pdev)
>  
>  	osc->hw.init = &init;
>  
> -	clk = clk_register(NULL, &osc->hw);
> -	if (IS_ERR(clk))
> -		return PTR_ERR(clk);
> +	ret = devm_clk_hw_register(&pdev->dev, &osc->hw);
> +	if (ret < 0)
> +		return ret;
>  
> -	of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, clk);
> +	devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, &osc->hw);
>  	clk_hw_set_rate_range(&osc->hw, osc->rate_min, osc->rate_max);
>  
>  	dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name);
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 11:01     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:01 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm, Michael Turquette

On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote:
> Enable building the vexpress-osc clock driver as a module.
> 
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/clk/versatile/Kconfig            |  4 ++--
>  drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
>  2 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> index 5bdd5c98990b..9de2396dcf9b 100644
> --- a/drivers/clk/versatile/Kconfig
> +++ b/drivers/clk/versatile/Kconfig
> @@ -15,8 +15,8 @@ config CLK_SP810
>  	  of the ARM SP810 System Controller cell.
>  
>  config CLK_VEXPRESS_OSC
> -	bool "Clock driver for Versatile Express OSC clock generators"
> -	depends on VEXPRESS_CONFIG || COMPILE_TEST
> +	tristate "Clock driver for Versatile Express OSC clock generators"
> +	depends on VEXPRESS_CONFIG

Looks good to me with the exception of COMPILE_TEST appearing in patch 5 and
disappearing here. Which one should be the one to survive?

Best regards,
Liviu

>  	default y if ARCH_VEXPRESS
>  	---help---
>  	  Simple regmap-based driver driving clock generators on Versatile
> diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> index 5bb1d5a714d0..b2b32fa2d7c3 100644
> --- a/drivers/clk/versatile/clk-vexpress-osc.c
> +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> @@ -7,6 +7,7 @@
>  #include <linux/clkdev.h>
>  #include <linux/clk-provider.h>
>  #include <linux/err.h>
> +#include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
> @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
>  	{ .compatible = "arm,vexpress-osc", },
>  	{}
>  };
> +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
>  
>  static struct platform_driver vexpress_osc_driver = {
>  	.driver	= {
> @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
>  	},
>  	.probe = vexpress_osc_probe,
>  };
> -
> -static int __init vexpress_osc_init(void)
> -{
> -	return platform_driver_register(&vexpress_osc_driver);
> -}
> -core_initcall(vexpress_osc_init);
> +module_platform_driver(vexpress_osc_driver);
> +MODULE_LICENSE("GPL v2");
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
@ 2020-04-22 11:01     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:01 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Michael Turquette, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote:
> Enable building the vexpress-osc clock driver as a module.
> 
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/clk/versatile/Kconfig            |  4 ++--
>  drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
>  2 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> index 5bdd5c98990b..9de2396dcf9b 100644
> --- a/drivers/clk/versatile/Kconfig
> +++ b/drivers/clk/versatile/Kconfig
> @@ -15,8 +15,8 @@ config CLK_SP810
>  	  of the ARM SP810 System Controller cell.
>  
>  config CLK_VEXPRESS_OSC
> -	bool "Clock driver for Versatile Express OSC clock generators"
> -	depends on VEXPRESS_CONFIG || COMPILE_TEST
> +	tristate "Clock driver for Versatile Express OSC clock generators"
> +	depends on VEXPRESS_CONFIG

Looks good to me with the exception of COMPILE_TEST appearing in patch 5 and
disappearing here. Which one should be the one to survive?

Best regards,
Liviu

>  	default y if ARCH_VEXPRESS
>  	---help---
>  	  Simple regmap-based driver driving clock generators on Versatile
> diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> index 5bb1d5a714d0..b2b32fa2d7c3 100644
> --- a/drivers/clk/versatile/clk-vexpress-osc.c
> +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> @@ -7,6 +7,7 @@
>  #include <linux/clkdev.h>
>  #include <linux/clk-provider.h>
>  #include <linux/err.h>
> +#include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
> @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
>  	{ .compatible = "arm,vexpress-osc", },
>  	{}
>  };
> +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
>  
>  static struct platform_driver vexpress_osc_driver = {
>  	.driver	= {
> @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
>  	},
>  	.probe = vexpress_osc_probe,
>  };
> -
> -static int __init vexpress_osc_init(void)
> -{
> -	return platform_driver_register(&vexpress_osc_driver);
> -}
> -core_initcall(vexpress_osc_init);
> +module_platform_driver(vexpress_osc_driver);
> +MODULE_LICENSE("GPL v2");
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 09/17] mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 11:02     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:02 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:08:02PM -0500, Rob Herring wrote:
> Nothing in the VExpress sysregs nor the MFD child drivers use
> CONFIG_CLKSRC_MMIO. There's the 24MHz counter, but that's handled by
> drivers/clocksource/timer-versatile.c which doesn't use
> CONFIG_CLKSRC_MMIO either. So let's just drop CONFIG_CLKSRC_MMIO.
> 
> As the !ARCH_USES_GETTIMEOFFSET dependency was added for
> CONFIG_CLKSRC_MMIO, that can be dropped, too.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/mfd/Kconfig | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 0a59249198d3..b1311dea2da1 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -2029,9 +2029,8 @@ endmenu
>  
>  config MFD_VEXPRESS_SYSREG
>  	bool "Versatile Express System Registers"
> -	depends on VEXPRESS_CONFIG && GPIOLIB && !ARCH_USES_GETTIMEOFFSET
> +	depends on VEXPRESS_CONFIG && GPIOLIB
>  	default y
> -	select CLKSRC_MMIO
>  	select GPIO_GENERIC_PLATFORM
>  	select MFD_CORE
>  	select MFD_SYSCON
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 09/17] mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO
@ 2020-04-22 11:02     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:02 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:02PM -0500, Rob Herring wrote:
> Nothing in the VExpress sysregs nor the MFD child drivers use
> CONFIG_CLKSRC_MMIO. There's the 24MHz counter, but that's handled by
> drivers/clocksource/timer-versatile.c which doesn't use
> CONFIG_CLKSRC_MMIO either. So let's just drop CONFIG_CLKSRC_MMIO.
> 
> As the !ARCH_USES_GETTIMEOFFSET dependency was added for
> CONFIG_CLKSRC_MMIO, that can be dropped, too.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/mfd/Kconfig | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 0a59249198d3..b1311dea2da1 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -2029,9 +2029,8 @@ endmenu
>  
>  config MFD_VEXPRESS_SYSREG
>  	bool "Versatile Express System Registers"
> -	depends on VEXPRESS_CONFIG && GPIOLIB && !ARCH_USES_GETTIMEOFFSET
> +	depends on VEXPRESS_CONFIG && GPIOLIB
>  	default y
> -	select CLKSRC_MMIO
>  	select GPIO_GENERIC_PLATFORM
>  	select MFD_CORE
>  	select MFD_SYSCON
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 10/17] mfd: vexpress-sysreg: Drop unused syscon child devices
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 11:18     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

Hi Rob,

Missing commit message?

On Sun, Apr 19, 2020 at 12:08:03PM -0500, Rob Herring wrote:
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/mfd/vexpress-sysreg.c | 36 -----------------------------------
>  1 file changed, 36 deletions(-)
> 
> diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
> index 0b9cc67706c7..90a4eda2ba2b 100644
> --- a/drivers/mfd/vexpress-sysreg.c
> +++ b/drivers/mfd/vexpress-sysreg.c
> @@ -43,10 +43,6 @@
>  
>  /* The sysreg block is just a random collection of various functions... */
>  
> -static struct syscon_platform_data vexpress_sysreg_sys_id_pdata = {
> -	.label = "sys_id",
> -};
> -
>  static struct bgpio_pdata vexpress_sysreg_sys_led_pdata = {
>  	.label = "sys_led",
>  	.base = -1,
> @@ -65,24 +61,8 @@ static struct bgpio_pdata vexpress_sysreg_sys_flash_pdata = {
>  	.ngpio = 1,
>  };
>  
> -static struct syscon_platform_data vexpress_sysreg_sys_misc_pdata = {
> -	.label = "sys_misc",
> -};
> -
> -static struct syscon_platform_data vexpress_sysreg_sys_procid_pdata = {
> -	.label = "sys_procid",
> -};
> -
>  static struct mfd_cell vexpress_sysreg_cells[] = {
>  	{
> -		.name = "syscon",
> -		.num_resources = 1,
> -		.resources = (struct resource []) {
> -			DEFINE_RES_MEM(SYS_ID, 0x4),
> -		},
> -		.platform_data = &vexpress_sysreg_sys_id_pdata,
> -		.pdata_size = sizeof(vexpress_sysreg_sys_id_pdata),
> -	}, {
>  		.name = "basic-mmio-gpio",
>  		.of_compatible = "arm,vexpress-sysreg,sys_led",
>  		.num_resources = 1,
> @@ -109,22 +89,6 @@ static struct mfd_cell vexpress_sysreg_cells[] = {
>  		},
>  		.platform_data = &vexpress_sysreg_sys_flash_pdata,
>  		.pdata_size = sizeof(vexpress_sysreg_sys_flash_pdata),
> -	}, {
> -		.name = "syscon",
> -		.num_resources = 1,
> -		.resources = (struct resource []) {
> -			DEFINE_RES_MEM(SYS_MISC, 0x4),
> -		},
> -		.platform_data = &vexpress_sysreg_sys_misc_pdata,
> -		.pdata_size = sizeof(vexpress_sysreg_sys_misc_pdata),
> -	}, {
> -		.name = "syscon",
> -		.num_resources = 1,
> -		.resources = (struct resource []) {
> -			DEFINE_RES_MEM(SYS_PROCID0, 0x8),
> -		},
> -		.platform_data = &vexpress_sysreg_sys_procid_pdata,
> -		.pdata_size = sizeof(vexpress_sysreg_sys_procid_pdata),

These were used for communication with the daughterboards. AFAIK there is no upstream
support for that in the kernel and even inside Arm I am almost sure there are no
users left.

With the commit message added:

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu


>  	}, {
>  		.name = "vexpress-syscfg",
>  		.num_resources = 1,
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 10/17] mfd: vexpress-sysreg: Drop unused syscon child devices
@ 2020-04-22 11:18     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

Hi Rob,

Missing commit message?

On Sun, Apr 19, 2020 at 12:08:03PM -0500, Rob Herring wrote:
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/mfd/vexpress-sysreg.c | 36 -----------------------------------
>  1 file changed, 36 deletions(-)
> 
> diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
> index 0b9cc67706c7..90a4eda2ba2b 100644
> --- a/drivers/mfd/vexpress-sysreg.c
> +++ b/drivers/mfd/vexpress-sysreg.c
> @@ -43,10 +43,6 @@
>  
>  /* The sysreg block is just a random collection of various functions... */
>  
> -static struct syscon_platform_data vexpress_sysreg_sys_id_pdata = {
> -	.label = "sys_id",
> -};
> -
>  static struct bgpio_pdata vexpress_sysreg_sys_led_pdata = {
>  	.label = "sys_led",
>  	.base = -1,
> @@ -65,24 +61,8 @@ static struct bgpio_pdata vexpress_sysreg_sys_flash_pdata = {
>  	.ngpio = 1,
>  };
>  
> -static struct syscon_platform_data vexpress_sysreg_sys_misc_pdata = {
> -	.label = "sys_misc",
> -};
> -
> -static struct syscon_platform_data vexpress_sysreg_sys_procid_pdata = {
> -	.label = "sys_procid",
> -};
> -
>  static struct mfd_cell vexpress_sysreg_cells[] = {
>  	{
> -		.name = "syscon",
> -		.num_resources = 1,
> -		.resources = (struct resource []) {
> -			DEFINE_RES_MEM(SYS_ID, 0x4),
> -		},
> -		.platform_data = &vexpress_sysreg_sys_id_pdata,
> -		.pdata_size = sizeof(vexpress_sysreg_sys_id_pdata),
> -	}, {
>  		.name = "basic-mmio-gpio",
>  		.of_compatible = "arm,vexpress-sysreg,sys_led",
>  		.num_resources = 1,
> @@ -109,22 +89,6 @@ static struct mfd_cell vexpress_sysreg_cells[] = {
>  		},
>  		.platform_data = &vexpress_sysreg_sys_flash_pdata,
>  		.pdata_size = sizeof(vexpress_sysreg_sys_flash_pdata),
> -	}, {
> -		.name = "syscon",
> -		.num_resources = 1,
> -		.resources = (struct resource []) {
> -			DEFINE_RES_MEM(SYS_MISC, 0x4),
> -		},
> -		.platform_data = &vexpress_sysreg_sys_misc_pdata,
> -		.pdata_size = sizeof(vexpress_sysreg_sys_misc_pdata),
> -	}, {
> -		.name = "syscon",
> -		.num_resources = 1,
> -		.resources = (struct resource []) {
> -			DEFINE_RES_MEM(SYS_PROCID0, 0x8),
> -		},
> -		.platform_data = &vexpress_sysreg_sys_procid_pdata,
> -		.pdata_size = sizeof(vexpress_sysreg_sys_procid_pdata),

These were used for communication with the daughterboards. AFAIK there is no upstream
support for that in the kernel and even inside Arm I am almost sure there are no
users left.

With the commit message added:

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu


>  	}, {
>  		.name = "vexpress-syscfg",
>  		.num_resources = 1,
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 11/17] mfd: vexpress-sysreg: Use devres API variants
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 11:18     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:08:04PM -0500, Rob Herring wrote:
> Use the managed devm_gpiochip_add_data() and devm_mfd_add_devices()
> instead of their unmanaged counterparts. With this, no .remove() hook is
> needed for driver unbind.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/mfd/vexpress-sysreg.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
> index 90a4eda2ba2b..9fb37fa689e0 100644
> --- a/drivers/mfd/vexpress-sysreg.c
> +++ b/drivers/mfd/vexpress-sysreg.c
> @@ -140,9 +140,9 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
>  	bgpio_init(mmc_gpio_chip, &pdev->dev, 0x4, base + SYS_MCI,
>  			NULL, NULL, NULL, NULL, 0);
>  	mmc_gpio_chip->ngpio = 2;
> -	gpiochip_add_data(mmc_gpio_chip, NULL);
> +	devm_gpiochip_add_data(&pdev->dev, mmc_gpio_chip, NULL);
>  
> -	return mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
> +	return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
>  			vexpress_sysreg_cells,
>  			ARRAY_SIZE(vexpress_sysreg_cells), mem, 0, NULL);
>  }
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 11/17] mfd: vexpress-sysreg: Use devres API variants
@ 2020-04-22 11:18     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:04PM -0500, Rob Herring wrote:
> Use the managed devm_gpiochip_add_data() and devm_mfd_add_devices()
> instead of their unmanaged counterparts. With this, no .remove() hook is
> needed for driver unbind.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/mfd/vexpress-sysreg.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
> index 90a4eda2ba2b..9fb37fa689e0 100644
> --- a/drivers/mfd/vexpress-sysreg.c
> +++ b/drivers/mfd/vexpress-sysreg.c
> @@ -140,9 +140,9 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
>  	bgpio_init(mmc_gpio_chip, &pdev->dev, 0x4, base + SYS_MCI,
>  			NULL, NULL, NULL, NULL, 0);
>  	mmc_gpio_chip->ngpio = 2;
> -	gpiochip_add_data(mmc_gpio_chip, NULL);
> +	devm_gpiochip_add_data(&pdev->dev, mmc_gpio_chip, NULL);
>  
> -	return mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
> +	return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
>  			vexpress_sysreg_cells,
>  			ARRAY_SIZE(vexpress_sysreg_cells), mem, 0, NULL);
>  }
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 13/17] bus: vexpress-config: Merge vexpress-syscfg into vexpress-config
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 11:22     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:22 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:08:06PM -0500, Rob Herring wrote:
> The only thing that vexpress-syscfg does is provide a regmap to
> vexpress-config bus child devices. There's little reason to have 2
> components for this. The current structure with initcall ordering
> requirements makes turning these components into modules more difficult.
> 
> So let's start to simplify things and merge vexpress-syscfg into
> vexpress-config. There's no functional change in this commit and it's
> still separate components until subsequent commits.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm/mach-vexpress/Kconfig |   1 -
>  drivers/bus/vexpress-config.c  | 283 +++++++++++++++++++++++++++++++--
>  drivers/misc/Kconfig           |   9 --
>  drivers/misc/Makefile          |   1 -
>  drivers/misc/vexpress-syscfg.c | 280 --------------------------------
>  include/linux/vexpress.h       |  17 --
>  6 files changed, 274 insertions(+), 317 deletions(-)
>  delete mode 100644 drivers/misc/vexpress-syscfg.c
> 
> diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
> index 2d1fdec4c230..065e12991663 100644
> --- a/arch/arm/mach-vexpress/Kconfig
> +++ b/arch/arm/mach-vexpress/Kconfig
> @@ -20,7 +20,6 @@ menuconfig ARCH_VEXPRESS
>  	select REGULATOR if MMC_ARMMMCI
>  	select REGULATOR_FIXED_VOLTAGE if REGULATOR
>  	select VEXPRESS_CONFIG
> -	select VEXPRESS_SYSCFG
>  	help
>  	  This option enables support for systems using Cortex processor based
>  	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
> diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
> index ff70575b2db6..43f5beac9811 100644
> --- a/drivers/bus/vexpress-config.c
> +++ b/drivers/bus/vexpress-config.c
> @@ -6,10 +6,48 @@
>  
>  #include <linux/err.h>
>  #include <linux/init.h>
> +#include <linux/io.h>
>  #include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/of_device.h>
> +#include <linux/sched/signal.h>
> +#include <linux/slab.h>
>  #include <linux/vexpress.h>
>  
> +#define SYS_CFGDATA		0x0
> +
> +#define SYS_CFGCTRL		0x4
> +#define SYS_CFGCTRL_START	(1 << 31)
> +#define SYS_CFGCTRL_WRITE	(1 << 30)
> +#define SYS_CFGCTRL_DCC(n)	(((n) & 0xf) << 26)
> +#define SYS_CFGCTRL_FUNC(n)	(((n) & 0x3f) << 20)
> +#define SYS_CFGCTRL_SITE(n)	(((n) & 0x3) << 16)
> +#define SYS_CFGCTRL_POSITION(n)	(((n) & 0xf) << 12)
> +#define SYS_CFGCTRL_DEVICE(n)	(((n) & 0xfff) << 0)
> +
> +#define SYS_CFGSTAT		0x8
> +#define SYS_CFGSTAT_ERR		(1 << 1)
> +#define SYS_CFGSTAT_COMPLETE	(1 << 0)
> +
> +
> +struct vexpress_syscfg {
> +	struct device *dev;
> +	void __iomem *base;
> +	struct list_head funcs;
> +};
> +
> +struct vexpress_syscfg_func {
> +	struct list_head list;
> +	struct vexpress_syscfg *syscfg;
> +	struct regmap *regmap;
> +	int num_templates;
> +	u32 template[]; /* Keep it last! */
> +};
> +
> +struct vexpress_config_bridge_ops {
> +	struct regmap * (*regmap_init)(struct device *dev, void *context);
> +	void (*regmap_exit)(struct regmap *regmap, void *context);
> +};
>  
>  struct vexpress_config_bridge {
>  	struct vexpress_config_bridge_ops *ops;
> @@ -27,17 +65,12 @@ void vexpress_config_set_master(u32 site)
>  	vexpress_config_site_master = site;
>  }
>  
> -u32 vexpress_config_get_master(void)
> -{
> -	return vexpress_config_site_master;
> -}
> -
> -void vexpress_config_lock(void *arg)
> +static void vexpress_config_lock(void *arg)
>  {
>  	mutex_lock(&vexpress_config_mutex);
>  }
>  
> -void vexpress_config_unlock(void *arg)
> +static void vexpress_config_unlock(void *arg)
>  {
>  	mutex_unlock(&vexpress_config_mutex);
>  }
> @@ -59,7 +92,7 @@ static void vexpress_config_find_prop(struct device_node *node,
>  	}
>  }
>  
> -int vexpress_config_get_topo(struct device_node *node, u32 *site,
> +static int vexpress_config_get_topo(struct device_node *node, u32 *site,
>  		u32 *position, u32 *dcc)
>  {
>  	vexpress_config_find_prop(node, "arm,vexpress,site", site);
> @@ -113,7 +146,7 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
>  }
>  EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
>  
> -struct device *vexpress_config_bridge_register(struct device *parent,
> +static struct device *vexpress_config_bridge_register(struct device *parent,
>  		struct vexpress_config_bridge_ops *ops, void *context)
>  {
>  	struct device *dev;
> @@ -201,3 +234,235 @@ static int __init vexpress_config_init(void)
>  }
>  postcore_initcall(vexpress_config_init);
>  
> +static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
> +		int index, bool write, u32 *data)
> +{
> +	struct vexpress_syscfg *syscfg = func->syscfg;
> +	u32 command, status;
> +	int tries;
> +	long timeout;
> +
> +	if (WARN_ON(index >= func->num_templates))
> +		return -EINVAL;
> +
> +	command = readl(syscfg->base + SYS_CFGCTRL);
> +	if (WARN_ON(command & SYS_CFGCTRL_START))
> +		return -EBUSY;
> +
> +	command = func->template[index];
> +	command |= SYS_CFGCTRL_START;
> +	command |= write ? SYS_CFGCTRL_WRITE : 0;
> +
> +	/* Use a canary for reads */
> +	if (!write)
> +		*data = 0xdeadbeef;
> +
> +	dev_dbg(syscfg->dev, "func %p, command %x, data %x\n",
> +			func, command, *data);
> +	writel(*data, syscfg->base + SYS_CFGDATA);
> +	writel(0, syscfg->base + SYS_CFGSTAT);
> +	writel(command, syscfg->base + SYS_CFGCTRL);
> +	mb();
> +
> +	/* The operation can take ages... Go to sleep, 100us initially */
> +	tries = 100;
> +	timeout = 100;
> +	do {
> +		if (!irqs_disabled()) {
> +			set_current_state(TASK_INTERRUPTIBLE);
> +			schedule_timeout(usecs_to_jiffies(timeout));
> +			if (signal_pending(current))
> +				return -EINTR;
> +		} else {
> +			udelay(timeout);
> +		}
> +
> +		status = readl(syscfg->base + SYS_CFGSTAT);
> +		if (status & SYS_CFGSTAT_ERR)
> +			return -EFAULT;
> +
> +		if (timeout > 20)
> +			timeout -= 20;
> +	} while (--tries && !(status & SYS_CFGSTAT_COMPLETE));
> +	if (WARN_ON_ONCE(!tries))
> +		return -ETIMEDOUT;
> +
> +	if (!write) {
> +		*data = readl(syscfg->base + SYS_CFGDATA);
> +		dev_dbg(syscfg->dev, "func %p, read data %x\n", func, *data);
> +	}
> +
> +	return 0;
> +}
> +
> +static int vexpress_syscfg_read(void *context, unsigned int index,
> +		unsigned int *val)
> +{
> +	struct vexpress_syscfg_func *func = context;
> +
> +	return vexpress_syscfg_exec(func, index, false, val);
> +}
> +
> +static int vexpress_syscfg_write(void *context, unsigned int index,
> +		unsigned int val)
> +{
> +	struct vexpress_syscfg_func *func = context;
> +
> +	return vexpress_syscfg_exec(func, index, true, &val);
> +}
> +
> +static struct regmap_config vexpress_syscfg_regmap_config = {
> +	.lock = vexpress_config_lock,
> +	.unlock = vexpress_config_unlock,
> +	.reg_bits = 32,
> +	.val_bits = 32,
> +	.reg_read = vexpress_syscfg_read,
> +	.reg_write = vexpress_syscfg_write,
> +	.reg_format_endian = REGMAP_ENDIAN_LITTLE,
> +	.val_format_endian = REGMAP_ENDIAN_LITTLE,
> +};
> +
> +
> +static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,
> +		void *context)
> +{
> +	int err;
> +	struct vexpress_syscfg *syscfg = context;
> +	struct vexpress_syscfg_func *func;
> +	struct property *prop;
> +	const __be32 *val = NULL;
> +	__be32 energy_quirk[4];
> +	int num;
> +	u32 site, position, dcc;
> +	int i;
> +
> +	err = vexpress_config_get_topo(dev->of_node, &site,
> +				&position, &dcc);
> +	if (err)
> +		return ERR_PTR(err);
> +
> +	prop = of_find_property(dev->of_node,
> +			"arm,vexpress-sysreg,func", NULL);
> +	if (!prop)
> +		return ERR_PTR(-EINVAL);
> +
> +	num = prop->length / sizeof(u32) / 2;
> +	val = prop->value;
> +
> +	/*
> +	 * "arm,vexpress-energy" function used to be described
> +	 * by its first device only, now it requires both
> +	 */
> +	if (num == 1 && of_device_is_compatible(dev->of_node,
> +			"arm,vexpress-energy")) {
> +		num = 2;
> +		energy_quirk[0] = *val;
> +		energy_quirk[2] = *val++;
> +		energy_quirk[1] = *val;
> +		energy_quirk[3] = cpu_to_be32(be32_to_cpup(val) + 1);
> +		val = energy_quirk;
> +	}
> +
> +	func = kzalloc(struct_size(func, template, num), GFP_KERNEL);
> +	if (!func)
> +		return ERR_PTR(-ENOMEM);
> +
> +	func->syscfg = syscfg;
> +	func->num_templates = num;
> +
> +	for (i = 0; i < num; i++) {
> +		u32 function, device;
> +
> +		function = be32_to_cpup(val++);
> +		device = be32_to_cpup(val++);
> +
> +		dev_dbg(dev, "func %p: %u/%u/%u/%u/%u\n",
> +				func, site, position, dcc,
> +				function, device);
> +
> +		func->template[i] = SYS_CFGCTRL_DCC(dcc);
> +		func->template[i] |= SYS_CFGCTRL_SITE(site);
> +		func->template[i] |= SYS_CFGCTRL_POSITION(position);
> +		func->template[i] |= SYS_CFGCTRL_FUNC(function);
> +		func->template[i] |= SYS_CFGCTRL_DEVICE(device);
> +	}
> +
> +	vexpress_syscfg_regmap_config.max_register = num - 1;
> +
> +	func->regmap = regmap_init(dev, NULL, func,
> +			&vexpress_syscfg_regmap_config);
> +
> +	if (IS_ERR(func->regmap)) {
> +		void *err = func->regmap;
> +
> +		kfree(func);
> +		return err;
> +	}
> +
> +	list_add(&func->list, &syscfg->funcs);
> +
> +	return func->regmap;
> +}
> +
> +static void vexpress_syscfg_regmap_exit(struct regmap *regmap, void *context)
> +{
> +	struct vexpress_syscfg *syscfg = context;
> +	struct vexpress_syscfg_func *func, *tmp;
> +
> +	regmap_exit(regmap);
> +
> +	list_for_each_entry_safe(func, tmp, &syscfg->funcs, list) {
> +		if (func->regmap == regmap) {
> +			list_del(&syscfg->funcs);
> +			kfree(func);
> +			break;
> +		}
> +	}
> +}
> +
> +static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = {
> +	.regmap_init = vexpress_syscfg_regmap_init,
> +	.regmap_exit = vexpress_syscfg_regmap_exit,
> +};
> +
> +
> +static int vexpress_syscfg_probe(struct platform_device *pdev)
> +{
> +	struct vexpress_syscfg *syscfg;
> +	struct resource *res;
> +	struct device *bridge;
> +
> +	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
> +	if (!syscfg)
> +		return -ENOMEM;
> +	syscfg->dev = &pdev->dev;
> +	INIT_LIST_HEAD(&syscfg->funcs);
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	syscfg->base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(syscfg->base))
> +		return PTR_ERR(syscfg->base);
> +
> +	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
> +	bridge = vexpress_config_bridge_register(pdev->dev.parent,
> +			&vexpress_syscfg_bridge_ops, syscfg);
> +
> +	return PTR_ERR_OR_ZERO(bridge);
> +}
> +
> +static const struct platform_device_id vexpress_syscfg_id_table[] = {
> +	{ "vexpress-syscfg", },
> +	{},
> +};
> +
> +static struct platform_driver vexpress_syscfg_driver = {
> +	.driver.name = "vexpress-syscfg",
> +	.id_table = vexpress_syscfg_id_table,
> +	.probe = vexpress_syscfg_probe,
> +};
> +
> +static int __init vexpress_syscfg_init(void)
> +{
> +	return platform_driver_register(&vexpress_syscfg_driver);
> +}
> +core_initcall(vexpress_syscfg_init);
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 99e151475d8f..edd5dd5ebfdc 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -423,15 +423,6 @@ config SRAM
>  config SRAM_EXEC
>  	bool
>  
> -config VEXPRESS_SYSCFG
> -	bool "Versatile Express System Configuration driver"
> -	depends on VEXPRESS_CONFIG
> -	default y
> -	help
> -	  ARM Ltd. Versatile Express uses specialised platform configuration
> -	  bus. System Configuration interface is one of the possible means
> -	  of generating transactions on this bus.
> -
>  config PCI_ENDPOINT_TEST
>  	depends on PCI
>  	select CRC32
> diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
> index 9abf2923d831..c7bd01ac6291 100644
> --- a/drivers/misc/Makefile
> +++ b/drivers/misc/Makefile
> @@ -49,7 +49,6 @@ obj-$(CONFIG_SRAM_EXEC)		+= sram-exec.o
>  obj-y				+= mic/
>  obj-$(CONFIG_GENWQE)		+= genwqe/
>  obj-$(CONFIG_ECHO)		+= echo/
> -obj-$(CONFIG_VEXPRESS_SYSCFG)	+= vexpress-syscfg.o
>  obj-$(CONFIG_CXL_BASE)		+= cxl/
>  obj-$(CONFIG_PCI_ENDPOINT_TEST)	+= pci_endpoint_test.o
>  obj-$(CONFIG_OCXL)		+= ocxl/
> diff --git a/drivers/misc/vexpress-syscfg.c b/drivers/misc/vexpress-syscfg.c
> deleted file mode 100644
> index a431787c0898..000000000000
> --- a/drivers/misc/vexpress-syscfg.c
> +++ /dev/null
> @@ -1,280 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - *
> - * Copyright (C) 2014 ARM Limited
> - */
> -
> -#include <linux/delay.h>
> -#include <linux/err.h>
> -#include <linux/io.h>
> -#include <linux/of.h>
> -#include <linux/platform_device.h>
> -#include <linux/sched/signal.h>
> -#include <linux/slab.h>
> -#include <linux/syscore_ops.h>
> -#include <linux/vexpress.h>
> -
> -
> -#define SYS_CFGDATA		0x0
> -
> -#define SYS_CFGCTRL		0x4
> -#define SYS_CFGCTRL_START	(1 << 31)
> -#define SYS_CFGCTRL_WRITE	(1 << 30)
> -#define SYS_CFGCTRL_DCC(n)	(((n) & 0xf) << 26)
> -#define SYS_CFGCTRL_FUNC(n)	(((n) & 0x3f) << 20)
> -#define SYS_CFGCTRL_SITE(n)	(((n) & 0x3) << 16)
> -#define SYS_CFGCTRL_POSITION(n)	(((n) & 0xf) << 12)
> -#define SYS_CFGCTRL_DEVICE(n)	(((n) & 0xfff) << 0)
> -
> -#define SYS_CFGSTAT		0x8
> -#define SYS_CFGSTAT_ERR		(1 << 1)
> -#define SYS_CFGSTAT_COMPLETE	(1 << 0)
> -
> -
> -struct vexpress_syscfg {
> -	struct device *dev;
> -	void __iomem *base;
> -	struct list_head funcs;
> -};
> -
> -struct vexpress_syscfg_func {
> -	struct list_head list;
> -	struct vexpress_syscfg *syscfg;
> -	struct regmap *regmap;
> -	int num_templates;
> -	u32 template[]; /* Keep it last! */
> -};
> -
> -
> -static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
> -		int index, bool write, u32 *data)
> -{
> -	struct vexpress_syscfg *syscfg = func->syscfg;
> -	u32 command, status;
> -	int tries;
> -	long timeout;
> -
> -	if (WARN_ON(index >= func->num_templates))
> -		return -EINVAL;
> -
> -	command = readl(syscfg->base + SYS_CFGCTRL);
> -	if (WARN_ON(command & SYS_CFGCTRL_START))
> -		return -EBUSY;
> -
> -	command = func->template[index];
> -	command |= SYS_CFGCTRL_START;
> -	command |= write ? SYS_CFGCTRL_WRITE : 0;
> -
> -	/* Use a canary for reads */
> -	if (!write)
> -		*data = 0xdeadbeef;
> -
> -	dev_dbg(syscfg->dev, "func %p, command %x, data %x\n",
> -			func, command, *data);
> -	writel(*data, syscfg->base + SYS_CFGDATA);
> -	writel(0, syscfg->base + SYS_CFGSTAT);
> -	writel(command, syscfg->base + SYS_CFGCTRL);
> -	mb();
> -
> -	/* The operation can take ages... Go to sleep, 100us initially */
> -	tries = 100;
> -	timeout = 100;
> -	do {
> -		if (!irqs_disabled()) {
> -			set_current_state(TASK_INTERRUPTIBLE);
> -			schedule_timeout(usecs_to_jiffies(timeout));
> -			if (signal_pending(current))
> -				return -EINTR;
> -		} else {
> -			udelay(timeout);
> -		}
> -
> -		status = readl(syscfg->base + SYS_CFGSTAT);
> -		if (status & SYS_CFGSTAT_ERR)
> -			return -EFAULT;
> -
> -		if (timeout > 20)
> -			timeout -= 20;
> -	} while (--tries && !(status & SYS_CFGSTAT_COMPLETE));
> -	if (WARN_ON_ONCE(!tries))
> -		return -ETIMEDOUT;
> -
> -	if (!write) {
> -		*data = readl(syscfg->base + SYS_CFGDATA);
> -		dev_dbg(syscfg->dev, "func %p, read data %x\n", func, *data);
> -	}
> -
> -	return 0;
> -}
> -
> -static int vexpress_syscfg_read(void *context, unsigned int index,
> -		unsigned int *val)
> -{
> -	struct vexpress_syscfg_func *func = context;
> -
> -	return vexpress_syscfg_exec(func, index, false, val);
> -}
> -
> -static int vexpress_syscfg_write(void *context, unsigned int index,
> -		unsigned int val)
> -{
> -	struct vexpress_syscfg_func *func = context;
> -
> -	return vexpress_syscfg_exec(func, index, true, &val);
> -}
> -
> -static struct regmap_config vexpress_syscfg_regmap_config = {
> -	.lock = vexpress_config_lock,
> -	.unlock = vexpress_config_unlock,
> -	.reg_bits = 32,
> -	.val_bits = 32,
> -	.reg_read = vexpress_syscfg_read,
> -	.reg_write = vexpress_syscfg_write,
> -	.reg_format_endian = REGMAP_ENDIAN_LITTLE,
> -	.val_format_endian = REGMAP_ENDIAN_LITTLE,
> -};
> -
> -
> -static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,
> -		void *context)
> -{
> -	int err;
> -	struct vexpress_syscfg *syscfg = context;
> -	struct vexpress_syscfg_func *func;
> -	struct property *prop;
> -	const __be32 *val = NULL;
> -	__be32 energy_quirk[4];
> -	int num;
> -	u32 site, position, dcc;
> -	int i;
> -
> -	err = vexpress_config_get_topo(dev->of_node, &site,
> -				&position, &dcc);
> -	if (err)
> -		return ERR_PTR(err);
> -
> -	prop = of_find_property(dev->of_node,
> -			"arm,vexpress-sysreg,func", NULL);
> -	if (!prop)
> -		return ERR_PTR(-EINVAL);
> -
> -	num = prop->length / sizeof(u32) / 2;
> -	val = prop->value;
> -
> -	/*
> -	 * "arm,vexpress-energy" function used to be described
> -	 * by its first device only, now it requires both
> -	 */
> -	if (num == 1 && of_device_is_compatible(dev->of_node,
> -			"arm,vexpress-energy")) {
> -		num = 2;
> -		energy_quirk[0] = *val;
> -		energy_quirk[2] = *val++;
> -		energy_quirk[1] = *val;
> -		energy_quirk[3] = cpu_to_be32(be32_to_cpup(val) + 1);
> -		val = energy_quirk;
> -	}
> -
> -	func = kzalloc(struct_size(func, template, num), GFP_KERNEL);
> -	if (!func)
> -		return ERR_PTR(-ENOMEM);
> -
> -	func->syscfg = syscfg;
> -	func->num_templates = num;
> -
> -	for (i = 0; i < num; i++) {
> -		u32 function, device;
> -
> -		function = be32_to_cpup(val++);
> -		device = be32_to_cpup(val++);
> -
> -		dev_dbg(dev, "func %p: %u/%u/%u/%u/%u\n",
> -				func, site, position, dcc,
> -				function, device);
> -
> -		func->template[i] = SYS_CFGCTRL_DCC(dcc);
> -		func->template[i] |= SYS_CFGCTRL_SITE(site);
> -		func->template[i] |= SYS_CFGCTRL_POSITION(position);
> -		func->template[i] |= SYS_CFGCTRL_FUNC(function);
> -		func->template[i] |= SYS_CFGCTRL_DEVICE(device);
> -	}
> -
> -	vexpress_syscfg_regmap_config.max_register = num - 1;
> -
> -	func->regmap = regmap_init(dev, NULL, func,
> -			&vexpress_syscfg_regmap_config);
> -
> -	if (IS_ERR(func->regmap)) {
> -		void *err = func->regmap;
> -
> -		kfree(func);
> -		return err;
> -	}
> -
> -	list_add(&func->list, &syscfg->funcs);
> -
> -	return func->regmap;
> -}
> -
> -static void vexpress_syscfg_regmap_exit(struct regmap *regmap, void *context)
> -{
> -	struct vexpress_syscfg *syscfg = context;
> -	struct vexpress_syscfg_func *func, *tmp;
> -
> -	regmap_exit(regmap);
> -
> -	list_for_each_entry_safe(func, tmp, &syscfg->funcs, list) {
> -		if (func->regmap == regmap) {
> -			list_del(&syscfg->funcs);
> -			kfree(func);
> -			break;
> -		}
> -	}
> -}
> -
> -static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = {
> -	.regmap_init = vexpress_syscfg_regmap_init,
> -	.regmap_exit = vexpress_syscfg_regmap_exit,
> -};
> -
> -
> -static int vexpress_syscfg_probe(struct platform_device *pdev)
> -{
> -	struct vexpress_syscfg *syscfg;
> -	struct resource *res;
> -	struct device *bridge;
> -
> -	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
> -	if (!syscfg)
> -		return -ENOMEM;
> -	syscfg->dev = &pdev->dev;
> -	INIT_LIST_HEAD(&syscfg->funcs);
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	syscfg->base = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(syscfg->base))
> -		return PTR_ERR(syscfg->base);
> -
> -	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
> -	bridge = vexpress_config_bridge_register(pdev->dev.parent,
> -			&vexpress_syscfg_bridge_ops, syscfg);
> -
> -	return PTR_ERR_OR_ZERO(bridge);
> -}
> -
> -static const struct platform_device_id vexpress_syscfg_id_table[] = {
> -	{ "vexpress-syscfg", },
> -	{},
> -};
> -
> -static struct platform_driver vexpress_syscfg_driver = {
> -	.driver.name = "vexpress-syscfg",
> -	.id_table = vexpress_syscfg_id_table,
> -	.probe = vexpress_syscfg_probe,
> -};
> -
> -static int __init vexpress_syscfg_init(void)
> -{
> -	return platform_driver_register(&vexpress_syscfg_driver);
> -}
> -core_initcall(vexpress_syscfg_init);
> diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
> index 2ec7992b054c..65096c792d57 100644
> --- a/include/linux/vexpress.h
> +++ b/include/linux/vexpress.h
> @@ -18,23 +18,6 @@
>  /* Config infrastructure */
>  
>  void vexpress_config_set_master(u32 site);
> -u32 vexpress_config_get_master(void);
> -
> -void vexpress_config_lock(void *arg);
> -void vexpress_config_unlock(void *arg);
> -
> -int vexpress_config_get_topo(struct device_node *node, u32 *site,
> -		u32 *position, u32 *dcc);
> -
> -/* Config bridge API */
> -
> -struct vexpress_config_bridge_ops {
> -	struct regmap * (*regmap_init)(struct device *dev, void *context);
> -	void (*regmap_exit)(struct regmap *regmap, void *context);
> -};
> -
> -struct device *vexpress_config_bridge_register(struct device *parent,
> -		struct vexpress_config_bridge_ops *ops, void *context);
>  
>  /* Config regmap API */
>  
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 13/17] bus: vexpress-config: Merge vexpress-syscfg into vexpress-config
@ 2020-04-22 11:22     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:22 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:06PM -0500, Rob Herring wrote:
> The only thing that vexpress-syscfg does is provide a regmap to
> vexpress-config bus child devices. There's little reason to have 2
> components for this. The current structure with initcall ordering
> requirements makes turning these components into modules more difficult.
> 
> So let's start to simplify things and merge vexpress-syscfg into
> vexpress-config. There's no functional change in this commit and it's
> still separate components until subsequent commits.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm/mach-vexpress/Kconfig |   1 -
>  drivers/bus/vexpress-config.c  | 283 +++++++++++++++++++++++++++++++--
>  drivers/misc/Kconfig           |   9 --
>  drivers/misc/Makefile          |   1 -
>  drivers/misc/vexpress-syscfg.c | 280 --------------------------------
>  include/linux/vexpress.h       |  17 --
>  6 files changed, 274 insertions(+), 317 deletions(-)
>  delete mode 100644 drivers/misc/vexpress-syscfg.c
> 
> diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
> index 2d1fdec4c230..065e12991663 100644
> --- a/arch/arm/mach-vexpress/Kconfig
> +++ b/arch/arm/mach-vexpress/Kconfig
> @@ -20,7 +20,6 @@ menuconfig ARCH_VEXPRESS
>  	select REGULATOR if MMC_ARMMMCI
>  	select REGULATOR_FIXED_VOLTAGE if REGULATOR
>  	select VEXPRESS_CONFIG
> -	select VEXPRESS_SYSCFG
>  	help
>  	  This option enables support for systems using Cortex processor based
>  	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
> diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
> index ff70575b2db6..43f5beac9811 100644
> --- a/drivers/bus/vexpress-config.c
> +++ b/drivers/bus/vexpress-config.c
> @@ -6,10 +6,48 @@
>  
>  #include <linux/err.h>
>  #include <linux/init.h>
> +#include <linux/io.h>
>  #include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/of_device.h>
> +#include <linux/sched/signal.h>
> +#include <linux/slab.h>
>  #include <linux/vexpress.h>
>  
> +#define SYS_CFGDATA		0x0
> +
> +#define SYS_CFGCTRL		0x4
> +#define SYS_CFGCTRL_START	(1 << 31)
> +#define SYS_CFGCTRL_WRITE	(1 << 30)
> +#define SYS_CFGCTRL_DCC(n)	(((n) & 0xf) << 26)
> +#define SYS_CFGCTRL_FUNC(n)	(((n) & 0x3f) << 20)
> +#define SYS_CFGCTRL_SITE(n)	(((n) & 0x3) << 16)
> +#define SYS_CFGCTRL_POSITION(n)	(((n) & 0xf) << 12)
> +#define SYS_CFGCTRL_DEVICE(n)	(((n) & 0xfff) << 0)
> +
> +#define SYS_CFGSTAT		0x8
> +#define SYS_CFGSTAT_ERR		(1 << 1)
> +#define SYS_CFGSTAT_COMPLETE	(1 << 0)
> +
> +
> +struct vexpress_syscfg {
> +	struct device *dev;
> +	void __iomem *base;
> +	struct list_head funcs;
> +};
> +
> +struct vexpress_syscfg_func {
> +	struct list_head list;
> +	struct vexpress_syscfg *syscfg;
> +	struct regmap *regmap;
> +	int num_templates;
> +	u32 template[]; /* Keep it last! */
> +};
> +
> +struct vexpress_config_bridge_ops {
> +	struct regmap * (*regmap_init)(struct device *dev, void *context);
> +	void (*regmap_exit)(struct regmap *regmap, void *context);
> +};
>  
>  struct vexpress_config_bridge {
>  	struct vexpress_config_bridge_ops *ops;
> @@ -27,17 +65,12 @@ void vexpress_config_set_master(u32 site)
>  	vexpress_config_site_master = site;
>  }
>  
> -u32 vexpress_config_get_master(void)
> -{
> -	return vexpress_config_site_master;
> -}
> -
> -void vexpress_config_lock(void *arg)
> +static void vexpress_config_lock(void *arg)
>  {
>  	mutex_lock(&vexpress_config_mutex);
>  }
>  
> -void vexpress_config_unlock(void *arg)
> +static void vexpress_config_unlock(void *arg)
>  {
>  	mutex_unlock(&vexpress_config_mutex);
>  }
> @@ -59,7 +92,7 @@ static void vexpress_config_find_prop(struct device_node *node,
>  	}
>  }
>  
> -int vexpress_config_get_topo(struct device_node *node, u32 *site,
> +static int vexpress_config_get_topo(struct device_node *node, u32 *site,
>  		u32 *position, u32 *dcc)
>  {
>  	vexpress_config_find_prop(node, "arm,vexpress,site", site);
> @@ -113,7 +146,7 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
>  }
>  EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
>  
> -struct device *vexpress_config_bridge_register(struct device *parent,
> +static struct device *vexpress_config_bridge_register(struct device *parent,
>  		struct vexpress_config_bridge_ops *ops, void *context)
>  {
>  	struct device *dev;
> @@ -201,3 +234,235 @@ static int __init vexpress_config_init(void)
>  }
>  postcore_initcall(vexpress_config_init);
>  
> +static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
> +		int index, bool write, u32 *data)
> +{
> +	struct vexpress_syscfg *syscfg = func->syscfg;
> +	u32 command, status;
> +	int tries;
> +	long timeout;
> +
> +	if (WARN_ON(index >= func->num_templates))
> +		return -EINVAL;
> +
> +	command = readl(syscfg->base + SYS_CFGCTRL);
> +	if (WARN_ON(command & SYS_CFGCTRL_START))
> +		return -EBUSY;
> +
> +	command = func->template[index];
> +	command |= SYS_CFGCTRL_START;
> +	command |= write ? SYS_CFGCTRL_WRITE : 0;
> +
> +	/* Use a canary for reads */
> +	if (!write)
> +		*data = 0xdeadbeef;
> +
> +	dev_dbg(syscfg->dev, "func %p, command %x, data %x\n",
> +			func, command, *data);
> +	writel(*data, syscfg->base + SYS_CFGDATA);
> +	writel(0, syscfg->base + SYS_CFGSTAT);
> +	writel(command, syscfg->base + SYS_CFGCTRL);
> +	mb();
> +
> +	/* The operation can take ages... Go to sleep, 100us initially */
> +	tries = 100;
> +	timeout = 100;
> +	do {
> +		if (!irqs_disabled()) {
> +			set_current_state(TASK_INTERRUPTIBLE);
> +			schedule_timeout(usecs_to_jiffies(timeout));
> +			if (signal_pending(current))
> +				return -EINTR;
> +		} else {
> +			udelay(timeout);
> +		}
> +
> +		status = readl(syscfg->base + SYS_CFGSTAT);
> +		if (status & SYS_CFGSTAT_ERR)
> +			return -EFAULT;
> +
> +		if (timeout > 20)
> +			timeout -= 20;
> +	} while (--tries && !(status & SYS_CFGSTAT_COMPLETE));
> +	if (WARN_ON_ONCE(!tries))
> +		return -ETIMEDOUT;
> +
> +	if (!write) {
> +		*data = readl(syscfg->base + SYS_CFGDATA);
> +		dev_dbg(syscfg->dev, "func %p, read data %x\n", func, *data);
> +	}
> +
> +	return 0;
> +}
> +
> +static int vexpress_syscfg_read(void *context, unsigned int index,
> +		unsigned int *val)
> +{
> +	struct vexpress_syscfg_func *func = context;
> +
> +	return vexpress_syscfg_exec(func, index, false, val);
> +}
> +
> +static int vexpress_syscfg_write(void *context, unsigned int index,
> +		unsigned int val)
> +{
> +	struct vexpress_syscfg_func *func = context;
> +
> +	return vexpress_syscfg_exec(func, index, true, &val);
> +}
> +
> +static struct regmap_config vexpress_syscfg_regmap_config = {
> +	.lock = vexpress_config_lock,
> +	.unlock = vexpress_config_unlock,
> +	.reg_bits = 32,
> +	.val_bits = 32,
> +	.reg_read = vexpress_syscfg_read,
> +	.reg_write = vexpress_syscfg_write,
> +	.reg_format_endian = REGMAP_ENDIAN_LITTLE,
> +	.val_format_endian = REGMAP_ENDIAN_LITTLE,
> +};
> +
> +
> +static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,
> +		void *context)
> +{
> +	int err;
> +	struct vexpress_syscfg *syscfg = context;
> +	struct vexpress_syscfg_func *func;
> +	struct property *prop;
> +	const __be32 *val = NULL;
> +	__be32 energy_quirk[4];
> +	int num;
> +	u32 site, position, dcc;
> +	int i;
> +
> +	err = vexpress_config_get_topo(dev->of_node, &site,
> +				&position, &dcc);
> +	if (err)
> +		return ERR_PTR(err);
> +
> +	prop = of_find_property(dev->of_node,
> +			"arm,vexpress-sysreg,func", NULL);
> +	if (!prop)
> +		return ERR_PTR(-EINVAL);
> +
> +	num = prop->length / sizeof(u32) / 2;
> +	val = prop->value;
> +
> +	/*
> +	 * "arm,vexpress-energy" function used to be described
> +	 * by its first device only, now it requires both
> +	 */
> +	if (num == 1 && of_device_is_compatible(dev->of_node,
> +			"arm,vexpress-energy")) {
> +		num = 2;
> +		energy_quirk[0] = *val;
> +		energy_quirk[2] = *val++;
> +		energy_quirk[1] = *val;
> +		energy_quirk[3] = cpu_to_be32(be32_to_cpup(val) + 1);
> +		val = energy_quirk;
> +	}
> +
> +	func = kzalloc(struct_size(func, template, num), GFP_KERNEL);
> +	if (!func)
> +		return ERR_PTR(-ENOMEM);
> +
> +	func->syscfg = syscfg;
> +	func->num_templates = num;
> +
> +	for (i = 0; i < num; i++) {
> +		u32 function, device;
> +
> +		function = be32_to_cpup(val++);
> +		device = be32_to_cpup(val++);
> +
> +		dev_dbg(dev, "func %p: %u/%u/%u/%u/%u\n",
> +				func, site, position, dcc,
> +				function, device);
> +
> +		func->template[i] = SYS_CFGCTRL_DCC(dcc);
> +		func->template[i] |= SYS_CFGCTRL_SITE(site);
> +		func->template[i] |= SYS_CFGCTRL_POSITION(position);
> +		func->template[i] |= SYS_CFGCTRL_FUNC(function);
> +		func->template[i] |= SYS_CFGCTRL_DEVICE(device);
> +	}
> +
> +	vexpress_syscfg_regmap_config.max_register = num - 1;
> +
> +	func->regmap = regmap_init(dev, NULL, func,
> +			&vexpress_syscfg_regmap_config);
> +
> +	if (IS_ERR(func->regmap)) {
> +		void *err = func->regmap;
> +
> +		kfree(func);
> +		return err;
> +	}
> +
> +	list_add(&func->list, &syscfg->funcs);
> +
> +	return func->regmap;
> +}
> +
> +static void vexpress_syscfg_regmap_exit(struct regmap *regmap, void *context)
> +{
> +	struct vexpress_syscfg *syscfg = context;
> +	struct vexpress_syscfg_func *func, *tmp;
> +
> +	regmap_exit(regmap);
> +
> +	list_for_each_entry_safe(func, tmp, &syscfg->funcs, list) {
> +		if (func->regmap == regmap) {
> +			list_del(&syscfg->funcs);
> +			kfree(func);
> +			break;
> +		}
> +	}
> +}
> +
> +static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = {
> +	.regmap_init = vexpress_syscfg_regmap_init,
> +	.regmap_exit = vexpress_syscfg_regmap_exit,
> +};
> +
> +
> +static int vexpress_syscfg_probe(struct platform_device *pdev)
> +{
> +	struct vexpress_syscfg *syscfg;
> +	struct resource *res;
> +	struct device *bridge;
> +
> +	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
> +	if (!syscfg)
> +		return -ENOMEM;
> +	syscfg->dev = &pdev->dev;
> +	INIT_LIST_HEAD(&syscfg->funcs);
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	syscfg->base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(syscfg->base))
> +		return PTR_ERR(syscfg->base);
> +
> +	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
> +	bridge = vexpress_config_bridge_register(pdev->dev.parent,
> +			&vexpress_syscfg_bridge_ops, syscfg);
> +
> +	return PTR_ERR_OR_ZERO(bridge);
> +}
> +
> +static const struct platform_device_id vexpress_syscfg_id_table[] = {
> +	{ "vexpress-syscfg", },
> +	{},
> +};
> +
> +static struct platform_driver vexpress_syscfg_driver = {
> +	.driver.name = "vexpress-syscfg",
> +	.id_table = vexpress_syscfg_id_table,
> +	.probe = vexpress_syscfg_probe,
> +};
> +
> +static int __init vexpress_syscfg_init(void)
> +{
> +	return platform_driver_register(&vexpress_syscfg_driver);
> +}
> +core_initcall(vexpress_syscfg_init);
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 99e151475d8f..edd5dd5ebfdc 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -423,15 +423,6 @@ config SRAM
>  config SRAM_EXEC
>  	bool
>  
> -config VEXPRESS_SYSCFG
> -	bool "Versatile Express System Configuration driver"
> -	depends on VEXPRESS_CONFIG
> -	default y
> -	help
> -	  ARM Ltd. Versatile Express uses specialised platform configuration
> -	  bus. System Configuration interface is one of the possible means
> -	  of generating transactions on this bus.
> -
>  config PCI_ENDPOINT_TEST
>  	depends on PCI
>  	select CRC32
> diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
> index 9abf2923d831..c7bd01ac6291 100644
> --- a/drivers/misc/Makefile
> +++ b/drivers/misc/Makefile
> @@ -49,7 +49,6 @@ obj-$(CONFIG_SRAM_EXEC)		+= sram-exec.o
>  obj-y				+= mic/
>  obj-$(CONFIG_GENWQE)		+= genwqe/
>  obj-$(CONFIG_ECHO)		+= echo/
> -obj-$(CONFIG_VEXPRESS_SYSCFG)	+= vexpress-syscfg.o
>  obj-$(CONFIG_CXL_BASE)		+= cxl/
>  obj-$(CONFIG_PCI_ENDPOINT_TEST)	+= pci_endpoint_test.o
>  obj-$(CONFIG_OCXL)		+= ocxl/
> diff --git a/drivers/misc/vexpress-syscfg.c b/drivers/misc/vexpress-syscfg.c
> deleted file mode 100644
> index a431787c0898..000000000000
> --- a/drivers/misc/vexpress-syscfg.c
> +++ /dev/null
> @@ -1,280 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - *
> - * Copyright (C) 2014 ARM Limited
> - */
> -
> -#include <linux/delay.h>
> -#include <linux/err.h>
> -#include <linux/io.h>
> -#include <linux/of.h>
> -#include <linux/platform_device.h>
> -#include <linux/sched/signal.h>
> -#include <linux/slab.h>
> -#include <linux/syscore_ops.h>
> -#include <linux/vexpress.h>
> -
> -
> -#define SYS_CFGDATA		0x0
> -
> -#define SYS_CFGCTRL		0x4
> -#define SYS_CFGCTRL_START	(1 << 31)
> -#define SYS_CFGCTRL_WRITE	(1 << 30)
> -#define SYS_CFGCTRL_DCC(n)	(((n) & 0xf) << 26)
> -#define SYS_CFGCTRL_FUNC(n)	(((n) & 0x3f) << 20)
> -#define SYS_CFGCTRL_SITE(n)	(((n) & 0x3) << 16)
> -#define SYS_CFGCTRL_POSITION(n)	(((n) & 0xf) << 12)
> -#define SYS_CFGCTRL_DEVICE(n)	(((n) & 0xfff) << 0)
> -
> -#define SYS_CFGSTAT		0x8
> -#define SYS_CFGSTAT_ERR		(1 << 1)
> -#define SYS_CFGSTAT_COMPLETE	(1 << 0)
> -
> -
> -struct vexpress_syscfg {
> -	struct device *dev;
> -	void __iomem *base;
> -	struct list_head funcs;
> -};
> -
> -struct vexpress_syscfg_func {
> -	struct list_head list;
> -	struct vexpress_syscfg *syscfg;
> -	struct regmap *regmap;
> -	int num_templates;
> -	u32 template[]; /* Keep it last! */
> -};
> -
> -
> -static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
> -		int index, bool write, u32 *data)
> -{
> -	struct vexpress_syscfg *syscfg = func->syscfg;
> -	u32 command, status;
> -	int tries;
> -	long timeout;
> -
> -	if (WARN_ON(index >= func->num_templates))
> -		return -EINVAL;
> -
> -	command = readl(syscfg->base + SYS_CFGCTRL);
> -	if (WARN_ON(command & SYS_CFGCTRL_START))
> -		return -EBUSY;
> -
> -	command = func->template[index];
> -	command |= SYS_CFGCTRL_START;
> -	command |= write ? SYS_CFGCTRL_WRITE : 0;
> -
> -	/* Use a canary for reads */
> -	if (!write)
> -		*data = 0xdeadbeef;
> -
> -	dev_dbg(syscfg->dev, "func %p, command %x, data %x\n",
> -			func, command, *data);
> -	writel(*data, syscfg->base + SYS_CFGDATA);
> -	writel(0, syscfg->base + SYS_CFGSTAT);
> -	writel(command, syscfg->base + SYS_CFGCTRL);
> -	mb();
> -
> -	/* The operation can take ages... Go to sleep, 100us initially */
> -	tries = 100;
> -	timeout = 100;
> -	do {
> -		if (!irqs_disabled()) {
> -			set_current_state(TASK_INTERRUPTIBLE);
> -			schedule_timeout(usecs_to_jiffies(timeout));
> -			if (signal_pending(current))
> -				return -EINTR;
> -		} else {
> -			udelay(timeout);
> -		}
> -
> -		status = readl(syscfg->base + SYS_CFGSTAT);
> -		if (status & SYS_CFGSTAT_ERR)
> -			return -EFAULT;
> -
> -		if (timeout > 20)
> -			timeout -= 20;
> -	} while (--tries && !(status & SYS_CFGSTAT_COMPLETE));
> -	if (WARN_ON_ONCE(!tries))
> -		return -ETIMEDOUT;
> -
> -	if (!write) {
> -		*data = readl(syscfg->base + SYS_CFGDATA);
> -		dev_dbg(syscfg->dev, "func %p, read data %x\n", func, *data);
> -	}
> -
> -	return 0;
> -}
> -
> -static int vexpress_syscfg_read(void *context, unsigned int index,
> -		unsigned int *val)
> -{
> -	struct vexpress_syscfg_func *func = context;
> -
> -	return vexpress_syscfg_exec(func, index, false, val);
> -}
> -
> -static int vexpress_syscfg_write(void *context, unsigned int index,
> -		unsigned int val)
> -{
> -	struct vexpress_syscfg_func *func = context;
> -
> -	return vexpress_syscfg_exec(func, index, true, &val);
> -}
> -
> -static struct regmap_config vexpress_syscfg_regmap_config = {
> -	.lock = vexpress_config_lock,
> -	.unlock = vexpress_config_unlock,
> -	.reg_bits = 32,
> -	.val_bits = 32,
> -	.reg_read = vexpress_syscfg_read,
> -	.reg_write = vexpress_syscfg_write,
> -	.reg_format_endian = REGMAP_ENDIAN_LITTLE,
> -	.val_format_endian = REGMAP_ENDIAN_LITTLE,
> -};
> -
> -
> -static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,
> -		void *context)
> -{
> -	int err;
> -	struct vexpress_syscfg *syscfg = context;
> -	struct vexpress_syscfg_func *func;
> -	struct property *prop;
> -	const __be32 *val = NULL;
> -	__be32 energy_quirk[4];
> -	int num;
> -	u32 site, position, dcc;
> -	int i;
> -
> -	err = vexpress_config_get_topo(dev->of_node, &site,
> -				&position, &dcc);
> -	if (err)
> -		return ERR_PTR(err);
> -
> -	prop = of_find_property(dev->of_node,
> -			"arm,vexpress-sysreg,func", NULL);
> -	if (!prop)
> -		return ERR_PTR(-EINVAL);
> -
> -	num = prop->length / sizeof(u32) / 2;
> -	val = prop->value;
> -
> -	/*
> -	 * "arm,vexpress-energy" function used to be described
> -	 * by its first device only, now it requires both
> -	 */
> -	if (num == 1 && of_device_is_compatible(dev->of_node,
> -			"arm,vexpress-energy")) {
> -		num = 2;
> -		energy_quirk[0] = *val;
> -		energy_quirk[2] = *val++;
> -		energy_quirk[1] = *val;
> -		energy_quirk[3] = cpu_to_be32(be32_to_cpup(val) + 1);
> -		val = energy_quirk;
> -	}
> -
> -	func = kzalloc(struct_size(func, template, num), GFP_KERNEL);
> -	if (!func)
> -		return ERR_PTR(-ENOMEM);
> -
> -	func->syscfg = syscfg;
> -	func->num_templates = num;
> -
> -	for (i = 0; i < num; i++) {
> -		u32 function, device;
> -
> -		function = be32_to_cpup(val++);
> -		device = be32_to_cpup(val++);
> -
> -		dev_dbg(dev, "func %p: %u/%u/%u/%u/%u\n",
> -				func, site, position, dcc,
> -				function, device);
> -
> -		func->template[i] = SYS_CFGCTRL_DCC(dcc);
> -		func->template[i] |= SYS_CFGCTRL_SITE(site);
> -		func->template[i] |= SYS_CFGCTRL_POSITION(position);
> -		func->template[i] |= SYS_CFGCTRL_FUNC(function);
> -		func->template[i] |= SYS_CFGCTRL_DEVICE(device);
> -	}
> -
> -	vexpress_syscfg_regmap_config.max_register = num - 1;
> -
> -	func->regmap = regmap_init(dev, NULL, func,
> -			&vexpress_syscfg_regmap_config);
> -
> -	if (IS_ERR(func->regmap)) {
> -		void *err = func->regmap;
> -
> -		kfree(func);
> -		return err;
> -	}
> -
> -	list_add(&func->list, &syscfg->funcs);
> -
> -	return func->regmap;
> -}
> -
> -static void vexpress_syscfg_regmap_exit(struct regmap *regmap, void *context)
> -{
> -	struct vexpress_syscfg *syscfg = context;
> -	struct vexpress_syscfg_func *func, *tmp;
> -
> -	regmap_exit(regmap);
> -
> -	list_for_each_entry_safe(func, tmp, &syscfg->funcs, list) {
> -		if (func->regmap == regmap) {
> -			list_del(&syscfg->funcs);
> -			kfree(func);
> -			break;
> -		}
> -	}
> -}
> -
> -static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = {
> -	.regmap_init = vexpress_syscfg_regmap_init,
> -	.regmap_exit = vexpress_syscfg_regmap_exit,
> -};
> -
> -
> -static int vexpress_syscfg_probe(struct platform_device *pdev)
> -{
> -	struct vexpress_syscfg *syscfg;
> -	struct resource *res;
> -	struct device *bridge;
> -
> -	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
> -	if (!syscfg)
> -		return -ENOMEM;
> -	syscfg->dev = &pdev->dev;
> -	INIT_LIST_HEAD(&syscfg->funcs);
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	syscfg->base = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(syscfg->base))
> -		return PTR_ERR(syscfg->base);
> -
> -	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
> -	bridge = vexpress_config_bridge_register(pdev->dev.parent,
> -			&vexpress_syscfg_bridge_ops, syscfg);
> -
> -	return PTR_ERR_OR_ZERO(bridge);
> -}
> -
> -static const struct platform_device_id vexpress_syscfg_id_table[] = {
> -	{ "vexpress-syscfg", },
> -	{},
> -};
> -
> -static struct platform_driver vexpress_syscfg_driver = {
> -	.driver.name = "vexpress-syscfg",
> -	.id_table = vexpress_syscfg_id_table,
> -	.probe = vexpress_syscfg_probe,
> -};
> -
> -static int __init vexpress_syscfg_init(void)
> -{
> -	return platform_driver_register(&vexpress_syscfg_driver);
> -}
> -core_initcall(vexpress_syscfg_init);
> diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
> index 2ec7992b054c..65096c792d57 100644
> --- a/include/linux/vexpress.h
> +++ b/include/linux/vexpress.h
> @@ -18,23 +18,6 @@
>  /* Config infrastructure */
>  
>  void vexpress_config_set_master(u32 site);
> -u32 vexpress_config_get_master(void);
> -
> -void vexpress_config_lock(void *arg);
> -void vexpress_config_unlock(void *arg);
> -
> -int vexpress_config_get_topo(struct device_node *node, u32 *site,
> -		u32 *position, u32 *dcc);
> -
> -/* Config bridge API */
> -
> -struct vexpress_config_bridge_ops {
> -	struct regmap * (*regmap_init)(struct device *dev, void *context);
> -	void (*regmap_exit)(struct regmap *regmap, void *context);
> -};
> -
> -struct device *vexpress_config_bridge_register(struct device *parent,
> -		struct vexpress_config_bridge_ops *ops, void *context);
>  
>  /* Config regmap API */
>  
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 14/17] bus: vexpress-config: simplify config bus probing
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 11:58     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:58 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:08:07PM -0500, Rob Herring wrote:
> The vexpress-config initialization is dependent on the vexpress-syscfg
> driver probing. As vexpress-config was not a driver, deferred probe
> could not be used and instead initcall ordering was relied upon. This is
> fragile and doesn't work for modules.
> 
> Let's move the config bus init into the vexpress-syscfg probe. This
> eliminates the initcall ordering requirement and the need to create a
> struct device and the "vexpress-config" class.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/bus/vexpress-config.c | 118 ++++++----------------------------
>  1 file changed, 21 insertions(+), 97 deletions(-)
> 
> diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
> index 43f5beac9811..43deb4df140b 100644
> --- a/drivers/bus/vexpress-config.c
> +++ b/drivers/bus/vexpress-config.c
> @@ -56,7 +56,6 @@ struct vexpress_config_bridge {
>  
>  
>  static DEFINE_MUTEX(vexpress_config_mutex);
> -static struct class *vexpress_config_class;
>  static u32 vexpress_config_site_master = VEXPRESS_SITE_MASTER;
>  
>  
> @@ -121,9 +120,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
>  	struct regmap *regmap;
>  	struct regmap **res;
>  
> -	if (WARN_ON(dev->parent->class != vexpress_config_class))
> -		return ERR_PTR(-ENODEV);
> -
>  	bridge = dev_get_drvdata(dev->parent);
>  	if (WARN_ON(!bridge))
>  		return ERR_PTR(-EINVAL);
> @@ -146,94 +142,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
>  }
>  EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
>  
> -static struct device *vexpress_config_bridge_register(struct device *parent,
> -		struct vexpress_config_bridge_ops *ops, void *context)
> -{
> -	struct device *dev;
> -	struct vexpress_config_bridge *bridge;
> -
> -	if (!vexpress_config_class) {
> -		vexpress_config_class = class_create(THIS_MODULE,
> -				"vexpress-config");
> -		if (IS_ERR(vexpress_config_class))
> -			return (void *)vexpress_config_class;
> -	}
> -
> -	dev = device_create(vexpress_config_class, parent, 0,
> -			NULL, "%s.bridge", dev_name(parent));
> -
> -	if (IS_ERR(dev))
> -		return dev;
> -
> -	bridge = devm_kmalloc(dev, sizeof(*bridge), GFP_KERNEL);
> -	if (!bridge) {
> -		put_device(dev);
> -		device_unregister(dev);
> -		return ERR_PTR(-ENOMEM);
> -	}
> -	bridge->ops = ops;
> -	bridge->context = context;
> -
> -	dev_set_drvdata(dev, bridge);
> -
> -	dev_dbg(parent, "Registered bridge '%s', parent node %p\n",
> -			dev_name(dev), parent->of_node);
> -
> -	return dev;
> -}
> -
> -
> -static int vexpress_config_node_match(struct device *dev, const void *data)
> -{
> -	const struct device_node *node = data;
> -
> -	dev_dbg(dev, "Parent node %p, looking for %p\n",
> -			dev->parent->of_node, node);
> -
> -	return dev->parent->of_node == node;
> -}
> -
> -static int vexpress_config_populate(struct device_node *node)
> -{
> -	struct device_node *bridge;
> -	struct device *parent;
> -	int ret;
> -
> -	bridge = of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
> -	if (!bridge)
> -		return -EINVAL;
> -
> -	parent = class_find_device(vexpress_config_class, NULL, bridge,
> -			vexpress_config_node_match);
> -	of_node_put(bridge);
> -	if (WARN_ON(!parent))
> -		return -ENODEV;
> -
> -	ret = of_platform_populate(node, NULL, NULL, parent);
> -
> -	put_device(parent);
> -
> -	return ret;
> -}
> -
> -static int __init vexpress_config_init(void)
> -{
> -	int err = 0;
> -	struct device_node *node;
> -
> -	/* Need the config devices early, before the "normal" devices... */
> -	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
> -		err = vexpress_config_populate(node);
> -		if (err) {
> -			of_node_put(node);
> -			break;
> -		}
> -	}
> -
> -	return err;
> -}
> -postcore_initcall(vexpress_config_init);
> -
>  static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
>  		int index, bool write, u32 *data)
>  {
> @@ -430,7 +338,8 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
>  {
>  	struct vexpress_syscfg *syscfg;
>  	struct resource *res;
> -	struct device *bridge;
> +	struct vexpress_config_bridge *bridge;
> +	struct device_node *node;
>  
>  	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
>  	if (!syscfg)
> @@ -443,11 +352,26 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
>  	if (IS_ERR(syscfg->base))
>  		return PTR_ERR(syscfg->base);
>  
> -	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
> -	bridge = vexpress_config_bridge_register(pdev->dev.parent,
> -			&vexpress_syscfg_bridge_ops, syscfg);
> +	bridge = devm_kmalloc(&pdev->dev, sizeof(*bridge), GFP_KERNEL);
> +	if (!bridge)
> +		return -ENOMEM;
> +
> +	bridge->ops = &vexpress_syscfg_bridge_ops;
> +	bridge->context = syscfg;
> +
> +	dev_set_drvdata(&pdev->dev, bridge);
>  
> -	return PTR_ERR_OR_ZERO(bridge);
> +	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
> +		struct device_node *bridge_np;
> +
> +		bridge_np = of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
> +		if (bridge_np != pdev->dev.parent->of_node)
> +			continue;
> +
> +		of_platform_populate(node, NULL, NULL, &pdev->dev);
> +	}
> +
> +	return 0;
>  }
>  
>  static const struct platform_device_id vexpress_syscfg_id_table[] = {
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 14/17] bus: vexpress-config: simplify config bus probing
@ 2020-04-22 11:58     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 11:58 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:07PM -0500, Rob Herring wrote:
> The vexpress-config initialization is dependent on the vexpress-syscfg
> driver probing. As vexpress-config was not a driver, deferred probe
> could not be used and instead initcall ordering was relied upon. This is
> fragile and doesn't work for modules.
> 
> Let's move the config bus init into the vexpress-syscfg probe. This
> eliminates the initcall ordering requirement and the need to create a
> struct device and the "vexpress-config" class.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/bus/vexpress-config.c | 118 ++++++----------------------------
>  1 file changed, 21 insertions(+), 97 deletions(-)
> 
> diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
> index 43f5beac9811..43deb4df140b 100644
> --- a/drivers/bus/vexpress-config.c
> +++ b/drivers/bus/vexpress-config.c
> @@ -56,7 +56,6 @@ struct vexpress_config_bridge {
>  
>  
>  static DEFINE_MUTEX(vexpress_config_mutex);
> -static struct class *vexpress_config_class;
>  static u32 vexpress_config_site_master = VEXPRESS_SITE_MASTER;
>  
>  
> @@ -121,9 +120,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
>  	struct regmap *regmap;
>  	struct regmap **res;
>  
> -	if (WARN_ON(dev->parent->class != vexpress_config_class))
> -		return ERR_PTR(-ENODEV);
> -
>  	bridge = dev_get_drvdata(dev->parent);
>  	if (WARN_ON(!bridge))
>  		return ERR_PTR(-EINVAL);
> @@ -146,94 +142,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
>  }
>  EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
>  
> -static struct device *vexpress_config_bridge_register(struct device *parent,
> -		struct vexpress_config_bridge_ops *ops, void *context)
> -{
> -	struct device *dev;
> -	struct vexpress_config_bridge *bridge;
> -
> -	if (!vexpress_config_class) {
> -		vexpress_config_class = class_create(THIS_MODULE,
> -				"vexpress-config");
> -		if (IS_ERR(vexpress_config_class))
> -			return (void *)vexpress_config_class;
> -	}
> -
> -	dev = device_create(vexpress_config_class, parent, 0,
> -			NULL, "%s.bridge", dev_name(parent));
> -
> -	if (IS_ERR(dev))
> -		return dev;
> -
> -	bridge = devm_kmalloc(dev, sizeof(*bridge), GFP_KERNEL);
> -	if (!bridge) {
> -		put_device(dev);
> -		device_unregister(dev);
> -		return ERR_PTR(-ENOMEM);
> -	}
> -	bridge->ops = ops;
> -	bridge->context = context;
> -
> -	dev_set_drvdata(dev, bridge);
> -
> -	dev_dbg(parent, "Registered bridge '%s', parent node %p\n",
> -			dev_name(dev), parent->of_node);
> -
> -	return dev;
> -}
> -
> -
> -static int vexpress_config_node_match(struct device *dev, const void *data)
> -{
> -	const struct device_node *node = data;
> -
> -	dev_dbg(dev, "Parent node %p, looking for %p\n",
> -			dev->parent->of_node, node);
> -
> -	return dev->parent->of_node == node;
> -}
> -
> -static int vexpress_config_populate(struct device_node *node)
> -{
> -	struct device_node *bridge;
> -	struct device *parent;
> -	int ret;
> -
> -	bridge = of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
> -	if (!bridge)
> -		return -EINVAL;
> -
> -	parent = class_find_device(vexpress_config_class, NULL, bridge,
> -			vexpress_config_node_match);
> -	of_node_put(bridge);
> -	if (WARN_ON(!parent))
> -		return -ENODEV;
> -
> -	ret = of_platform_populate(node, NULL, NULL, parent);
> -
> -	put_device(parent);
> -
> -	return ret;
> -}
> -
> -static int __init vexpress_config_init(void)
> -{
> -	int err = 0;
> -	struct device_node *node;
> -
> -	/* Need the config devices early, before the "normal" devices... */
> -	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
> -		err = vexpress_config_populate(node);
> -		if (err) {
> -			of_node_put(node);
> -			break;
> -		}
> -	}
> -
> -	return err;
> -}
> -postcore_initcall(vexpress_config_init);
> -
>  static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
>  		int index, bool write, u32 *data)
>  {
> @@ -430,7 +338,8 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
>  {
>  	struct vexpress_syscfg *syscfg;
>  	struct resource *res;
> -	struct device *bridge;
> +	struct vexpress_config_bridge *bridge;
> +	struct device_node *node;
>  
>  	syscfg = devm_kzalloc(&pdev->dev, sizeof(*syscfg), GFP_KERNEL);
>  	if (!syscfg)
> @@ -443,11 +352,26 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
>  	if (IS_ERR(syscfg->base))
>  		return PTR_ERR(syscfg->base);
>  
> -	/* Must use dev.parent (MFD), as that's where DT phandle points at... */
> -	bridge = vexpress_config_bridge_register(pdev->dev.parent,
> -			&vexpress_syscfg_bridge_ops, syscfg);
> +	bridge = devm_kmalloc(&pdev->dev, sizeof(*bridge), GFP_KERNEL);
> +	if (!bridge)
> +		return -ENOMEM;
> +
> +	bridge->ops = &vexpress_syscfg_bridge_ops;
> +	bridge->context = syscfg;
> +
> +	dev_set_drvdata(&pdev->dev, bridge);
>  
> -	return PTR_ERR_OR_ZERO(bridge);
> +	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
> +		struct device_node *bridge_np;
> +
> +		bridge_np = of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
> +		if (bridge_np != pdev->dev.parent->of_node)
> +			continue;
> +
> +		of_platform_populate(node, NULL, NULL, &pdev->dev);
> +	}
> +
> +	return 0;
>  }
>  
>  static const struct platform_device_id vexpress_syscfg_id_table[] = {
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 15/17] vexpress: Move site master init to vexpress-config bus
  2020-04-22  9:51     ` Stephen Boyd
@ 2020-04-22 12:03       ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 12:03 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Linus Walleij, Lorenzo Pieralisi, Rob Herring, Sudeep Holla,
	Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Will Deacon, Kevin Brodsky, linux-arm-kernel,
	linux-clk, linux-pm

On Wed, Apr 22, 2020 at 02:51:08AM -0700, Stephen Boyd wrote:
> Is the subject supposed to say 'set master' vs. 'site master'?

Funnily enough, the VExpress has two "sites" (daughterboard sockets) and this was
used to set which one was the master. Didn't realised the subject mismatch until
you pointed out. :)

Acked-by: Liviu Dudau <liviu.dudau@arm.com>


> 
> Quoting Rob Herring (2020-04-19 10:08:08)
> > There's only a single caller of vexpress_config_set_master() from
> > vexpress-sysreg.c. Let's just make the registers needed available to
> > vexpress-config and move all the code there. The registers needed aren't
> > used anywhere else either. With this, we can get rid of the private API
> > between these 2 drivers.
> > 
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Lee Jones <lee.jones@linaro.org>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Rob Herring <robh@kernel.org>

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 15/17] vexpress: Move site master init to vexpress-config bus
@ 2020-04-22 12:03       ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 12:03 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Rob Herring, Lorenzo Pieralisi, Arnd Bergmann,
	Greg Kroah-Hartman, Catalin Marinas, Linus Walleij,
	Kevin Brodsky, Sebastian Reichel, Will Deacon, Sudeep Holla,
	linux-pm, Lee Jones, linux-clk, linux-arm-kernel

On Wed, Apr 22, 2020 at 02:51:08AM -0700, Stephen Boyd wrote:
> Is the subject supposed to say 'set master' vs. 'site master'?

Funnily enough, the VExpress has two "sites" (daughterboard sockets) and this was
used to set which one was the master. Didn't realised the subject mismatch until
you pointed out. :)

Acked-by: Liviu Dudau <liviu.dudau@arm.com>


> 
> Quoting Rob Herring (2020-04-19 10:08:08)
> > There's only a single caller of vexpress_config_set_master() from
> > vexpress-sysreg.c. Let's just make the registers needed available to
> > vexpress-config and move all the code there. The registers needed aren't
> > used anywhere else either. With this, we can get rid of the private API
> > between these 2 drivers.
> > 
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Lee Jones <lee.jones@linaro.org>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Rob Herring <robh@kernel.org>

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 16/17] bus: vexpress-config: Support building as module
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 12:04     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 12:04 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:08:09PM -0500, Rob Herring wrote:
> Enable building vexpress-config driver as a module.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/bus/Kconfig           |  2 +-
>  drivers/bus/vexpress-config.c | 10 ++++------
>  2 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
> index 6d4e4497b59b..c16268c53831 100644
> --- a/drivers/bus/Kconfig
> +++ b/drivers/bus/Kconfig
> @@ -183,7 +183,7 @@ config UNIPHIER_SYSTEM_BUS
>  	  needed to use on-board devices connected to UniPhier SoCs.
>  
>  config VEXPRESS_CONFIG
> -	bool "Versatile Express configuration bus"
> +	tristate "Versatile Express configuration bus"
>  	default y if ARCH_VEXPRESS
>  	depends on ARM || ARM64
>  	depends on OF
> diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
> index caa35a4cb34d..a58ac0c8e282 100644
> --- a/drivers/bus/vexpress-config.c
> +++ b/drivers/bus/vexpress-config.c
> @@ -7,6 +7,7 @@
>  #include <linux/err.h>
>  #include <linux/init.h>
>  #include <linux/io.h>
> +#include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/of_device.h>
> @@ -407,15 +408,12 @@ static const struct platform_device_id vexpress_syscfg_id_table[] = {
>  	{ "vexpress-syscfg", },
>  	{},
>  };
> +MODULE_DEVICE_TABLE(platform, vexpress_syscfg_id_table);
>  
>  static struct platform_driver vexpress_syscfg_driver = {
>  	.driver.name = "vexpress-syscfg",
>  	.id_table = vexpress_syscfg_id_table,
>  	.probe = vexpress_syscfg_probe,
>  };
> -
> -static int __init vexpress_syscfg_init(void)
> -{
> -	return platform_driver_register(&vexpress_syscfg_driver);
> -}
> -core_initcall(vexpress_syscfg_init);
> +module_platform_driver(vexpress_syscfg_driver);
> +MODULE_LICENSE("GPL v2");
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 16/17] bus: vexpress-config: Support building as module
@ 2020-04-22 12:04     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 12:04 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:09PM -0500, Rob Herring wrote:
> Enable building vexpress-config driver as a module.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/bus/Kconfig           |  2 +-
>  drivers/bus/vexpress-config.c | 10 ++++------
>  2 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
> index 6d4e4497b59b..c16268c53831 100644
> --- a/drivers/bus/Kconfig
> +++ b/drivers/bus/Kconfig
> @@ -183,7 +183,7 @@ config UNIPHIER_SYSTEM_BUS
>  	  needed to use on-board devices connected to UniPhier SoCs.
>  
>  config VEXPRESS_CONFIG
> -	bool "Versatile Express configuration bus"
> +	tristate "Versatile Express configuration bus"
>  	default y if ARCH_VEXPRESS
>  	depends on ARM || ARM64
>  	depends on OF
> diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
> index caa35a4cb34d..a58ac0c8e282 100644
> --- a/drivers/bus/vexpress-config.c
> +++ b/drivers/bus/vexpress-config.c
> @@ -7,6 +7,7 @@
>  #include <linux/err.h>
>  #include <linux/init.h>
>  #include <linux/io.h>
> +#include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/of_device.h>
> @@ -407,15 +408,12 @@ static const struct platform_device_id vexpress_syscfg_id_table[] = {
>  	{ "vexpress-syscfg", },
>  	{},
>  };
> +MODULE_DEVICE_TABLE(platform, vexpress_syscfg_id_table);
>  
>  static struct platform_driver vexpress_syscfg_driver = {
>  	.driver.name = "vexpress-syscfg",
>  	.id_table = vexpress_syscfg_id_table,
>  	.probe = vexpress_syscfg_probe,
>  };
> -
> -static int __init vexpress_syscfg_init(void)
> -{
> -	return platform_driver_register(&vexpress_syscfg_driver);
> -}
> -core_initcall(vexpress_syscfg_init);
> +module_platform_driver(vexpress_syscfg_driver);
> +MODULE_LICENSE("GPL v2");
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 17/17] ARM: vexpress: Don't select VEXPRESS_CONFIG
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 12:05     ` Liviu Dudau
  -1 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 12:05 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Lorenzo Pieralisi, Sudeep Holla, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:08:10PM -0500, Rob Herring wrote:
> CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is
> unnecessary. Selecting it also prevents setting CONFIG_VEXPRESS_CONFIG
> to a module.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm/mach-vexpress/Kconfig | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
> index 065e12991663..8391a5b3cd78 100644
> --- a/arch/arm/mach-vexpress/Kconfig
> +++ b/arch/arm/mach-vexpress/Kconfig
> @@ -19,7 +19,6 @@ menuconfig ARCH_VEXPRESS
>  	select POWER_SUPPLY
>  	select REGULATOR if MMC_ARMMMCI
>  	select REGULATOR_FIXED_VOLTAGE if REGULATOR
> -	select VEXPRESS_CONFIG
>  	help
>  	  This option enables support for systems using Cortex processor based
>  	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 17/17] ARM: vexpress: Don't select VEXPRESS_CONFIG
@ 2020-04-22 12:05     ` Liviu Dudau
  0 siblings, 0 replies; 136+ messages in thread
From: Liviu Dudau @ 2020-04-22 12:05 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Sebastian Reichel,
	Kevin Brodsky, Will Deacon, Greg Kroah-Hartman, Lee Jones,
	linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:10PM -0500, Rob Herring wrote:
> CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is
> unnecessary. Selecting it also prevents setting CONFIG_VEXPRESS_CONFIG
> to a module.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/arm/mach-vexpress/Kconfig | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
> index 065e12991663..8391a5b3cd78 100644
> --- a/arch/arm/mach-vexpress/Kconfig
> +++ b/arch/arm/mach-vexpress/Kconfig
> @@ -19,7 +19,6 @@ menuconfig ARCH_VEXPRESS
>  	select POWER_SUPPLY
>  	select REGULATOR if MMC_ARMMMCI
>  	select REGULATOR_FIXED_VOLTAGE if REGULATOR
> -	select VEXPRESS_CONFIG
>  	help
>  	  This option enables support for systems using Cortex processor based
>  	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 01/17] ARM: vexpress: Move vexpress_flags_set() into arch code
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22 19:04     ` Sudeep Holla
  -1 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 19:04 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Sudeep Holla,
	Kevin Brodsky, linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:07:54PM -0500, Rob Herring wrote:
> vexpress_flags_set() is only used by the platform SMP related code and
> has nothing to do with the vexpress-sysreg MFD driver other than both
> access the same h/w block. It's also only needed for 32-bit systems and
> must be built-in for them. Let's move vexpress_flags_set() closer to
> where it is being used. This will allow for vexpress-sysreg to be built
> as a module.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> 

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 01/17] ARM: vexpress: Move vexpress_flags_set() into arch code
@ 2020-04-22 19:04     ` Sudeep Holla
  0 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 19:04 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:07:54PM -0500, Rob Herring wrote:
> vexpress_flags_set() is only used by the platform SMP related code and
> has nothing to do with the vexpress-sysreg MFD driver other than both
> access the same h/w block. It's also only needed for 32-bit systems and
> must be built-in for them. Let's move vexpress_flags_set() closer to
> where it is being used. This will allow for vexpress-sysreg to be built
> as a module.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> 

-- 
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 02/17] arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22 19:08     ` Sudeep Holla
  -1 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 19:08 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Sudeep Holla,
	Kevin Brodsky, linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:07:55PM -0500, Rob Herring wrote:
> The VExpress power-off/reset driver is not needed on 64-bit platforms as
> PSCI power-off and reset can be used instead. Stop selecting it so it
> can be disabled and not always built-in.
>

Indeed, doesn't set good example when we are shouting at people doing
non-PSCI system poweroff/reset. I guess just remnants from initial arm64
port before PSCI days 😄

> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 02/17] arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS
@ 2020-04-22 19:08     ` Sudeep Holla
  0 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 19:08 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:07:55PM -0500, Rob Herring wrote:
> The VExpress power-off/reset driver is not needed on 64-bit platforms as
> PSCI power-off and reset can be used instead. Stop selecting it so it
> can be disabled and not always built-in.
>

Indeed, doesn't set good example when we are shouting at people doing
non-PSCI system poweroff/reset. I guess just remnants from initial arm64
port before PSCI days 😄

> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 03/17] arm64: vexpress: Don't select CONFIG_VEXPRESS_CONFIG
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22 19:09     ` Sudeep Holla
  -1 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 19:09 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Sudeep Holla,
	Kevin Brodsky, linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:07:56PM -0500, Rob Herring wrote:
> CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is
> unnecessary. It also prevents setting CONFIG_VEXPRESS_CONFIG to a module.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 03/17] arm64: vexpress: Don't select CONFIG_VEXPRESS_CONFIG
@ 2020-04-22 19:09     ` Sudeep Holla
  0 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 19:09 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:07:56PM -0500, Rob Herring wrote:
> CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is
> unnecessary. It also prevents setting CONFIG_VEXPRESS_CONFIG to a module.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 04/17] power/reset: vexpress: Support building as a module
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22 19:11     ` Sudeep Holla
  -1 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 19:11 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Sudeep Holla,
	Kevin Brodsky, linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:07:57PM -0500, Rob Herring wrote:
> Enable building the VExpress power-off/reset driver as a module.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 04/17] power/reset: vexpress: Support building as a module
@ 2020-04-22 19:11     ` Sudeep Holla
  0 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 19:11 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:07:57PM -0500, Rob Herring wrote:
> Enable building the VExpress power-off/reset driver as a module.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22 19:17     ` Sudeep Holla
  -1 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 19:17 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Sudeep Holla,
	Kevin Brodsky, linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:07:58PM -0500, Rob Herring wrote:
> CONFIG_COMMON_CLK_VERSATILE doesn't really do anything other than hiding
> Arm Ltd reference platform clock drivers. It is both selected by the
> platforms that need it and has a 'depends on' for those platforms. It
> selects REGMAP_MMIO, but really CONFIG_ICST should do that. Also,
> CONFIG_ICST can't be enabled for COMPILE_TEST unless something else
> selected it.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
@ 2020-04-22 19:17     ` Sudeep Holla
  0 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 19:17 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:07:58PM -0500, Rob Herring wrote:
> CONFIG_COMMON_CLK_VERSATILE doesn't really do anything other than hiding
> Arm Ltd reference platform clock drivers. It is both selected by the
> platforms that need it and has a 'depends on' for those platforms. It
> selects REGMAP_MMIO, but really CONFIG_ICST should do that. Also,
> CONFIG_ICST can't be enabled for COMPILE_TEST unless something else
> selected it.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
  2020-04-19 17:07   ` Rob Herring
@ 2020-04-22 20:52     ` Sudeep Holla
  -1 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 20:52 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Sudeep Holla,
	Kevin Brodsky, linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:07:59PM -0500, Rob Herring wrote:
> While 64-bit Arm reference platforms have SP810 for clocks for SP804
> timers, they are not needed since the arch timers are used instead.
> 

Shouldn't we disable selection of SP804 for arm64 at the same time ?

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
@ 2020-04-22 20:52     ` Sudeep Holla
  0 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 20:52 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:07:59PM -0500, Rob Herring wrote:
> While 64-bit Arm reference platforms have SP810 for clocks for SP804
> timers, they are not needed since the arch timers are used instead.
> 

Shouldn't we disable selection of SP804 for arm64 at the same time ?

-- 
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 20:56     ` Sudeep Holla
  -1 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 20:56 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Sudeep Holla,
	Kevin Brodsky, linux-arm-kernel, linux-clk, linux-pm

On Sun, Apr 19, 2020 at 12:08:00PM -0500, Rob Herring wrote:
> In preparation to enable the vexpress-osc clock driver as a module,
> convert the driver to use the managed devres clock API variants. With
> this, a driver .remove() hook is not needed.
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants
@ 2020-04-22 20:56     ` Sudeep Holla
  0 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 20:56 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:00PM -0500, Rob Herring wrote:
> In preparation to enable the vexpress-osc clock driver as a module,
> convert the driver to use the managed devres clock API variants. With
> this, a driver .remove() hook is not needed.
>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
  2020-04-19 17:08   ` Rob Herring
@ 2020-04-22 21:08     ` Sudeep Holla
  -1 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 21:08 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	linux-arm-kernel, linux-clk, linux-pm, Michael Turquette

On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote:
> Enable building the vexpress-osc clock driver as a module.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/clk/versatile/Kconfig            |  4 ++--
>  drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
>  2 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> index 5bdd5c98990b..9de2396dcf9b 100644
> --- a/drivers/clk/versatile/Kconfig
> +++ b/drivers/clk/versatile/Kconfig
> @@ -15,8 +15,8 @@ config CLK_SP810
>  	  of the ARM SP810 System Controller cell.
>
>  config CLK_VEXPRESS_OSC
> -	bool "Clock driver for Versatile Express OSC clock generators"
> -	depends on VEXPRESS_CONFIG || COMPILE_TEST
> +	tristate "Clock driver for Versatile Express OSC clock generators"
> +	depends on VEXPRESS_CONFIG
>  	default y if ARCH_VEXPRESS
>  	---help---
>  	  Simple regmap-based driver driving clock generators on Versatile
> diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> index 5bb1d5a714d0..b2b32fa2d7c3 100644
> --- a/drivers/clk/versatile/clk-vexpress-osc.c
> +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> @@ -7,6 +7,7 @@
>  #include <linux/clkdev.h>
>  #include <linux/clk-provider.h>
>  #include <linux/err.h>
> +#include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
> @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
>  	{ .compatible = "arm,vexpress-osc", },
>  	{}
>  };
> +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
>
>  static struct platform_driver vexpress_osc_driver = {
>  	.driver	= {
> @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
>  	},
>  	.probe = vexpress_osc_probe,
>  };
> -
> -static int __init vexpress_osc_init(void)
> -{
> -	return platform_driver_register(&vexpress_osc_driver);
> -}
> -core_initcall(vexpress_osc_init);
> +module_platform_driver(vexpress_osc_driver);

I am not 100% sure of this. This might break the boot on CA9 and TC2
at-least. There are loads of MB peripherals that need this. This will
break the boot. We need to check if all the dependent modules are also
at module_initcall level and if they deal with deferred probe correctly.
Lot of them are legacy and may happen to be working by carefully initcall
level adjustments.

I will take a look at it again. I must be able to run and check on TC2
though I seem to have removed the network cable on my TC2 or office n/w
is acting crazy. I will check tomorrow again or run w/o network.

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
@ 2020-04-22 21:08     ` Sudeep Holla
  0 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-22 21:08 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Kevin Brodsky, Liviu Dudau,
	Sebastian Reichel, Michael Turquette, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote:
> Enable building the vexpress-osc clock driver as a module.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/clk/versatile/Kconfig            |  4 ++--
>  drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
>  2 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> index 5bdd5c98990b..9de2396dcf9b 100644
> --- a/drivers/clk/versatile/Kconfig
> +++ b/drivers/clk/versatile/Kconfig
> @@ -15,8 +15,8 @@ config CLK_SP810
>  	  of the ARM SP810 System Controller cell.
>
>  config CLK_VEXPRESS_OSC
> -	bool "Clock driver for Versatile Express OSC clock generators"
> -	depends on VEXPRESS_CONFIG || COMPILE_TEST
> +	tristate "Clock driver for Versatile Express OSC clock generators"
> +	depends on VEXPRESS_CONFIG
>  	default y if ARCH_VEXPRESS
>  	---help---
>  	  Simple regmap-based driver driving clock generators on Versatile
> diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> index 5bb1d5a714d0..b2b32fa2d7c3 100644
> --- a/drivers/clk/versatile/clk-vexpress-osc.c
> +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> @@ -7,6 +7,7 @@
>  #include <linux/clkdev.h>
>  #include <linux/clk-provider.h>
>  #include <linux/err.h>
> +#include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
> @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
>  	{ .compatible = "arm,vexpress-osc", },
>  	{}
>  };
> +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
>
>  static struct platform_driver vexpress_osc_driver = {
>  	.driver	= {
> @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
>  	},
>  	.probe = vexpress_osc_probe,
>  };
> -
> -static int __init vexpress_osc_init(void)
> -{
> -	return platform_driver_register(&vexpress_osc_driver);
> -}
> -core_initcall(vexpress_osc_init);
> +module_platform_driver(vexpress_osc_driver);

I am not 100% sure of this. This might break the boot on CA9 and TC2
at-least. There are loads of MB peripherals that need this. This will
break the boot. We need to check if all the dependent modules are also
at module_initcall level and if they deal with deferred probe correctly.
Lot of them are legacy and may happen to be working by carefully initcall
level adjustments.

I will take a look at it again. I must be able to run and check on TC2
though I seem to have removed the network cable on my TC2 or office n/w
is acting crazy. I will check tomorrow again or run w/o network.

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
  2020-04-22  9:47     ` Stephen Boyd
@ 2020-04-22 22:34       ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-22 22:34 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Will Deacon, Kevin Brodsky,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-clk, open list:THERMAL

On Wed, Apr 22, 2020 at 4:47 AM Stephen Boyd <sboyd@kernel.org> wrote:
>
> Quoting Rob Herring (2020-04-19 10:07:58)
> > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> > index c2618f1477a2..3465fb291998 100644
> > --- a/drivers/clk/versatile/Kconfig
> > +++ b/drivers/clk/versatile/Kconfig
> > @@ -1,22 +1,14 @@
> >  # SPDX-License-Identifier: GPL-2.0-only
> >  config ICST
> > -       bool
> > -
> > -config COMMON_CLK_VERSATILE
> > -       bool "Clock driver for ARM Reference designs"
> > -       depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
> > -               ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
> > -               COMPILE_TEST
> > +       bool "Clock driver for ARM Reference designs ICST" if COMPILE_TEST
> >         select REGMAP_MMIO
> >         ---help---
> >           Supports clocking on ARM Reference designs:
> >           - Integrator/AP and Integrator/CP
> >           - RealView PB1176, EB, PB11MP and PBX
> > -         - Versatile Express
> >
> >  config CLK_SP810
> >         bool "Clock driver for ARM SP810 System Controller"
> > -       depends on COMMON_CLK_VERSATILE
>
> Shouldn't this get the depends from COMMON_CLK_VERSATILE so that this
> option isn't exposed unless someone is compile testing or using that
> platform?

IMO, once the dependencies get complicated enough, it's better to just
expose the option. But I could drop just the select and keep the
depends. It's primarily having both that we didn't need.

Rob

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE
@ 2020-04-22 22:34       ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-22 22:34 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Lorenzo Pieralisi, Arnd Bergmann, Greg Kroah-Hartman,
	Catalin Marinas, Linus Walleij, Kevin Brodsky, Liviu Dudau,
	Sebastian Reichel, Will Deacon, Sudeep Holla, open list:THERMAL,
	Lee Jones, linux-clk,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Wed, Apr 22, 2020 at 4:47 AM Stephen Boyd <sboyd@kernel.org> wrote:
>
> Quoting Rob Herring (2020-04-19 10:07:58)
> > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> > index c2618f1477a2..3465fb291998 100644
> > --- a/drivers/clk/versatile/Kconfig
> > +++ b/drivers/clk/versatile/Kconfig
> > @@ -1,22 +1,14 @@
> >  # SPDX-License-Identifier: GPL-2.0-only
> >  config ICST
> > -       bool
> > -
> > -config COMMON_CLK_VERSATILE
> > -       bool "Clock driver for ARM Reference designs"
> > -       depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
> > -               ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
> > -               COMPILE_TEST
> > +       bool "Clock driver for ARM Reference designs ICST" if COMPILE_TEST
> >         select REGMAP_MMIO
> >         ---help---
> >           Supports clocking on ARM Reference designs:
> >           - Integrator/AP and Integrator/CP
> >           - RealView PB1176, EB, PB11MP and PBX
> > -         - Versatile Express
> >
> >  config CLK_SP810
> >         bool "Clock driver for ARM SP810 System Controller"
> > -       depends on COMMON_CLK_VERSATILE
>
> Shouldn't this get the depends from COMMON_CLK_VERSATILE so that this
> option isn't exposed unless someone is compile testing or using that
> platform?

IMO, once the dependencies get complicated enough, it's better to just
expose the option. But I could drop just the select and keep the
depends. It's primarily having both that we didn't need.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 15/17] vexpress: Move site master init to vexpress-config bus
  2020-04-22  9:51     ` Stephen Boyd
@ 2020-04-23  0:54       ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-23  0:54 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Sudeep Holla,
	Arnd Bergmann, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Will Deacon, Kevin Brodsky,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-clk, open list:THERMAL

On Wed, Apr 22, 2020 at 4:51 AM Stephen Boyd <sboyd@kernel.org> wrote:
>
> Is the subject supposed to say 'set master' vs. 'site master'?

Humm, maybe 'master site' instead.

>
> Quoting Rob Herring (2020-04-19 10:08:08)
> > There's only a single caller of vexpress_config_set_master() from
> > vexpress-sysreg.c. Let's just make the registers needed available to
> > vexpress-config and move all the code there. The registers needed aren't
> > used anywhere else either. With this, we can get rid of the private API
> > between these 2 drivers.
> >
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Lee Jones <lee.jones@linaro.org>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 15/17] vexpress: Move site master init to vexpress-config bus
@ 2020-04-23  0:54       ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-23  0:54 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Lorenzo Pieralisi, Arnd Bergmann, Greg Kroah-Hartman,
	Catalin Marinas, Linus Walleij, Kevin Brodsky, Liviu Dudau,
	Sebastian Reichel, Will Deacon, Sudeep Holla, open list:THERMAL,
	Lee Jones, linux-clk,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Wed, Apr 22, 2020 at 4:51 AM Stephen Boyd <sboyd@kernel.org> wrote:
>
> Is the subject supposed to say 'set master' vs. 'site master'?

Humm, maybe 'master site' instead.

>
> Quoting Rob Herring (2020-04-19 10:08:08)
> > There's only a single caller of vexpress_config_set_master() from
> > vexpress-sysreg.c. Let's just make the registers needed available to
> > vexpress-config and move all the code there. The registers needed aren't
> > used anywhere else either. With this, we can get rid of the private API
> > between these 2 drivers.
> >
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Lee Jones <lee.jones@linaro.org>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Rob Herring <robh@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
  2020-04-22 21:08     ` Sudeep Holla
@ 2020-04-23 13:45       ` Sudeep Holla
  -1 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-23 13:45 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Sudeep Holla,
	Kevin Brodsky, linux-arm-kernel, linux-clk, linux-pm,
	Michael Turquette

On Wed, Apr 22, 2020 at 10:08:02PM +0100, Sudeep Holla wrote:
> On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote:
> > Enable building the vexpress-osc clock driver as a module.
> >
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Cc: Michael Turquette <mturquette@baylibre.com>
> > Cc: Stephen Boyd <sboyd@kernel.org>
> > Cc: linux-clk@vger.kernel.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  drivers/clk/versatile/Kconfig            |  4 ++--
> >  drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
> >  2 files changed, 6 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> > index 5bdd5c98990b..9de2396dcf9b 100644
> > --- a/drivers/clk/versatile/Kconfig
> > +++ b/drivers/clk/versatile/Kconfig
> > @@ -15,8 +15,8 @@ config CLK_SP810
> >  	  of the ARM SP810 System Controller cell.
> >
> >  config CLK_VEXPRESS_OSC
> > -	bool "Clock driver for Versatile Express OSC clock generators"
> > -	depends on VEXPRESS_CONFIG || COMPILE_TEST
> > +	tristate "Clock driver for Versatile Express OSC clock generators"
> > +	depends on VEXPRESS_CONFIG
> >  	default y if ARCH_VEXPRESS
> >  	---help---
> >  	  Simple regmap-based driver driving clock generators on Versatile
> > diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> > index 5bb1d5a714d0..b2b32fa2d7c3 100644
> > --- a/drivers/clk/versatile/clk-vexpress-osc.c
> > +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> > @@ -7,6 +7,7 @@
> >  #include <linux/clkdev.h>
> >  #include <linux/clk-provider.h>
> >  #include <linux/err.h>
> > +#include <linux/module.h>
> >  #include <linux/of.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/slab.h>
> > @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
> >  	{ .compatible = "arm,vexpress-osc", },
> >  	{}
> >  };
> > +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
> >
> >  static struct platform_driver vexpress_osc_driver = {
> >  	.driver	= {
> > @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
> >  	},
> >  	.probe = vexpress_osc_probe,
> >  };
> > -
> > -static int __init vexpress_osc_init(void)
> > -{
> > -	return platform_driver_register(&vexpress_osc_driver);
> > -}
> > -core_initcall(vexpress_osc_init);
> > +module_platform_driver(vexpress_osc_driver);
>
> I am not 100% sure of this. This might break the boot on CA9 and TC2
> at-least. There are loads of MB peripherals that need this. This will
> break the boot. We need to check if all the dependent modules are also
> at module_initcall level and if they deal with deferred probe correctly.
> Lot of them are legacy and may happen to be working by carefully initcall
> level adjustments.
>

OK I managed to try this on my TC2 and it fails to boot. However when I
enable earlyprintk as I see no log without it, it boots just fine.

I also checked adding initcall_debug and I may be wrong on the dependency
part. The modules dependent on vexpress-osc are probed later correctly.

This make it more difficult to debug as I don't have any debugger attached
at the moment to look at the logbuf when it hangs without earlyprintk.

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
@ 2020-04-23 13:45       ` Sudeep Holla
  0 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-23 13:45 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, linux-pm, Stephen Boyd,
	Catalin Marinas, Linus Walleij, Sudeep Holla, Liviu Dudau,
	Sebastian Reichel, Kevin Brodsky, Michael Turquette, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk, linux-arm-kernel

On Wed, Apr 22, 2020 at 10:08:02PM +0100, Sudeep Holla wrote:
> On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote:
> > Enable building the vexpress-osc clock driver as a module.
> >
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Cc: Michael Turquette <mturquette@baylibre.com>
> > Cc: Stephen Boyd <sboyd@kernel.org>
> > Cc: linux-clk@vger.kernel.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  drivers/clk/versatile/Kconfig            |  4 ++--
> >  drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
> >  2 files changed, 6 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> > index 5bdd5c98990b..9de2396dcf9b 100644
> > --- a/drivers/clk/versatile/Kconfig
> > +++ b/drivers/clk/versatile/Kconfig
> > @@ -15,8 +15,8 @@ config CLK_SP810
> >  	  of the ARM SP810 System Controller cell.
> >
> >  config CLK_VEXPRESS_OSC
> > -	bool "Clock driver for Versatile Express OSC clock generators"
> > -	depends on VEXPRESS_CONFIG || COMPILE_TEST
> > +	tristate "Clock driver for Versatile Express OSC clock generators"
> > +	depends on VEXPRESS_CONFIG
> >  	default y if ARCH_VEXPRESS
> >  	---help---
> >  	  Simple regmap-based driver driving clock generators on Versatile
> > diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> > index 5bb1d5a714d0..b2b32fa2d7c3 100644
> > --- a/drivers/clk/versatile/clk-vexpress-osc.c
> > +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> > @@ -7,6 +7,7 @@
> >  #include <linux/clkdev.h>
> >  #include <linux/clk-provider.h>
> >  #include <linux/err.h>
> > +#include <linux/module.h>
> >  #include <linux/of.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/slab.h>
> > @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
> >  	{ .compatible = "arm,vexpress-osc", },
> >  	{}
> >  };
> > +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
> >
> >  static struct platform_driver vexpress_osc_driver = {
> >  	.driver	= {
> > @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
> >  	},
> >  	.probe = vexpress_osc_probe,
> >  };
> > -
> > -static int __init vexpress_osc_init(void)
> > -{
> > -	return platform_driver_register(&vexpress_osc_driver);
> > -}
> > -core_initcall(vexpress_osc_init);
> > +module_platform_driver(vexpress_osc_driver);
>
> I am not 100% sure of this. This might break the boot on CA9 and TC2
> at-least. There are loads of MB peripherals that need this. This will
> break the boot. We need to check if all the dependent modules are also
> at module_initcall level and if they deal with deferred probe correctly.
> Lot of them are legacy and may happen to be working by carefully initcall
> level adjustments.
>

OK I managed to try this on my TC2 and it fails to boot. However when I
enable earlyprintk as I see no log without it, it boots just fine.

I also checked adding initcall_debug and I may be wrong on the dependency
part. The modules dependent on vexpress-osc are probed later correctly.

This make it more difficult to debug as I don't have any debugger attached
at the moment to look at the logbuf when it hangs without earlyprintk.

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
  2020-04-22 20:52     ` Sudeep Holla
@ 2020-04-23 15:38       ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-23 15:38 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-clk, open list:THERMAL

On Wed, Apr 22, 2020 at 3:52 PM Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On Sun, Apr 19, 2020 at 12:07:59PM -0500, Rob Herring wrote:
> > While 64-bit Arm reference platforms have SP810 for clocks for SP804
> > timers, they are not needed since the arch timers are used instead.
> >
>
> Shouldn't we disable selection of SP804 for arm64 at the same time ?

SP804 is already not selected for VEXPRESS. Only RPi and HiSilicon
enable it on arm64. Though it makes me wonder why they require it as
they should have arch timer too.

Rob

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default
@ 2020-04-23 15:38       ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-23 15:38 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Lorenzo Pieralisi, Arnd Bergmann, open list:THERMAL,
	Stephen Boyd, Catalin Marinas, Linus Walleij, Kevin Brodsky,
	Liviu Dudau, Sebastian Reichel, Will Deacon, Greg Kroah-Hartman,
	Lee Jones, linux-clk,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Wed, Apr 22, 2020 at 3:52 PM Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On Sun, Apr 19, 2020 at 12:07:59PM -0500, Rob Herring wrote:
> > While 64-bit Arm reference platforms have SP810 for clocks for SP804
> > timers, they are not needed since the arch timers are used instead.
> >
>
> Shouldn't we disable selection of SP804 for arm64 at the same time ?

SP804 is already not selected for VEXPRESS. Only RPi and HiSilicon
enable it on arm64. Though it makes me wonder why they require it as
they should have arch timer too.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
  2020-04-23 13:45       ` Sudeep Holla
@ 2020-04-23 15:53         ` Rob Herring
  -1 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-23 15:53 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Kevin Brodsky,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-clk, open list:THERMAL, Michael Turquette

On Thu, Apr 23, 2020 at 8:45 AM Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On Wed, Apr 22, 2020 at 10:08:02PM +0100, Sudeep Holla wrote:
> > On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote:
> > > Enable building the vexpress-osc clock driver as a module.
> > >
> > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > > Cc: Michael Turquette <mturquette@baylibre.com>
> > > Cc: Stephen Boyd <sboyd@kernel.org>
> > > Cc: linux-clk@vger.kernel.org
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > ---
> > >  drivers/clk/versatile/Kconfig            |  4 ++--
> > >  drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
> > >  2 files changed, 6 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> > > index 5bdd5c98990b..9de2396dcf9b 100644
> > > --- a/drivers/clk/versatile/Kconfig
> > > +++ b/drivers/clk/versatile/Kconfig
> > > @@ -15,8 +15,8 @@ config CLK_SP810
> > >       of the ARM SP810 System Controller cell.
> > >
> > >  config CLK_VEXPRESS_OSC
> > > -   bool "Clock driver for Versatile Express OSC clock generators"
> > > -   depends on VEXPRESS_CONFIG || COMPILE_TEST
> > > +   tristate "Clock driver for Versatile Express OSC clock generators"
> > > +   depends on VEXPRESS_CONFIG
> > >     default y if ARCH_VEXPRESS
> > >     ---help---
> > >       Simple regmap-based driver driving clock generators on Versatile
> > > diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> > > index 5bb1d5a714d0..b2b32fa2d7c3 100644
> > > --- a/drivers/clk/versatile/clk-vexpress-osc.c
> > > +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> > > @@ -7,6 +7,7 @@
> > >  #include <linux/clkdev.h>
> > >  #include <linux/clk-provider.h>
> > >  #include <linux/err.h>
> > > +#include <linux/module.h>
> > >  #include <linux/of.h>
> > >  #include <linux/platform_device.h>
> > >  #include <linux/slab.h>
> > > @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
> > >     { .compatible = "arm,vexpress-osc", },
> > >     {}
> > >  };
> > > +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
> > >
> > >  static struct platform_driver vexpress_osc_driver = {
> > >     .driver = {
> > > @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
> > >     },
> > >     .probe = vexpress_osc_probe,
> > >  };
> > > -
> > > -static int __init vexpress_osc_init(void)
> > > -{
> > > -   return platform_driver_register(&vexpress_osc_driver);
> > > -}
> > > -core_initcall(vexpress_osc_init);
> > > +module_platform_driver(vexpress_osc_driver);
> >
> > I am not 100% sure of this. This might break the boot on CA9 and TC2
> > at-least. There are loads of MB peripherals that need this. This will
> > break the boot. We need to check if all the dependent modules are also
> > at module_initcall level and if they deal with deferred probe correctly.
> > Lot of them are legacy and may happen to be working by carefully initcall
> > level adjustments.
> >
>
> OK I managed to try this on my TC2 and it fails to boot. However when I
> enable earlyprintk as I see no log without it, it boots just fine.

Well, the uart clocks for TC2 are all dependent on vexpress-osc. The
console setup is going to fail to get the clocks and just fail as
there's no deferred probe for consoles. We need some way to retrigger
the console matching.

> I also checked adding initcall_debug and I may be wrong on the dependency
> part. The modules dependent on vexpress-osc are probed later correctly.
>
> This make it more difficult to debug as I don't have any debugger attached
> at the moment to look at the logbuf when it hangs without earlyprintk.
>
> --
> Regards,
> Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
@ 2020-04-23 15:53         ` Rob Herring
  0 siblings, 0 replies; 136+ messages in thread
From: Rob Herring @ 2020-04-23 15:53 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Lorenzo Pieralisi, Arnd Bergmann, open list:THERMAL,
	Stephen Boyd, Catalin Marinas, Linus Walleij, Kevin Brodsky,
	Liviu Dudau, Sebastian Reichel, Michael Turquette, Will Deacon,
	Greg Kroah-Hartman, Lee Jones, linux-clk,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Thu, Apr 23, 2020 at 8:45 AM Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On Wed, Apr 22, 2020 at 10:08:02PM +0100, Sudeep Holla wrote:
> > On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote:
> > > Enable building the vexpress-osc clock driver as a module.
> > >
> > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > > Cc: Michael Turquette <mturquette@baylibre.com>
> > > Cc: Stephen Boyd <sboyd@kernel.org>
> > > Cc: linux-clk@vger.kernel.org
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > ---
> > >  drivers/clk/versatile/Kconfig            |  4 ++--
> > >  drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
> > >  2 files changed, 6 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> > > index 5bdd5c98990b..9de2396dcf9b 100644
> > > --- a/drivers/clk/versatile/Kconfig
> > > +++ b/drivers/clk/versatile/Kconfig
> > > @@ -15,8 +15,8 @@ config CLK_SP810
> > >       of the ARM SP810 System Controller cell.
> > >
> > >  config CLK_VEXPRESS_OSC
> > > -   bool "Clock driver for Versatile Express OSC clock generators"
> > > -   depends on VEXPRESS_CONFIG || COMPILE_TEST
> > > +   tristate "Clock driver for Versatile Express OSC clock generators"
> > > +   depends on VEXPRESS_CONFIG
> > >     default y if ARCH_VEXPRESS
> > >     ---help---
> > >       Simple regmap-based driver driving clock generators on Versatile
> > > diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> > > index 5bb1d5a714d0..b2b32fa2d7c3 100644
> > > --- a/drivers/clk/versatile/clk-vexpress-osc.c
> > > +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> > > @@ -7,6 +7,7 @@
> > >  #include <linux/clkdev.h>
> > >  #include <linux/clk-provider.h>
> > >  #include <linux/err.h>
> > > +#include <linux/module.h>
> > >  #include <linux/of.h>
> > >  #include <linux/platform_device.h>
> > >  #include <linux/slab.h>
> > > @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
> > >     { .compatible = "arm,vexpress-osc", },
> > >     {}
> > >  };
> > > +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
> > >
> > >  static struct platform_driver vexpress_osc_driver = {
> > >     .driver = {
> > > @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
> > >     },
> > >     .probe = vexpress_osc_probe,
> > >  };
> > > -
> > > -static int __init vexpress_osc_init(void)
> > > -{
> > > -   return platform_driver_register(&vexpress_osc_driver);
> > > -}
> > > -core_initcall(vexpress_osc_init);
> > > +module_platform_driver(vexpress_osc_driver);
> >
> > I am not 100% sure of this. This might break the boot on CA9 and TC2
> > at-least. There are loads of MB peripherals that need this. This will
> > break the boot. We need to check if all the dependent modules are also
> > at module_initcall level and if they deal with deferred probe correctly.
> > Lot of them are legacy and may happen to be working by carefully initcall
> > level adjustments.
> >
>
> OK I managed to try this on my TC2 and it fails to boot. However when I
> enable earlyprintk as I see no log without it, it boots just fine.

Well, the uart clocks for TC2 are all dependent on vexpress-osc. The
console setup is going to fail to get the clocks and just fail as
there's no deferred probe for consoles. We need some way to retrigger
the console matching.

> I also checked adding initcall_debug and I may be wrong on the dependency
> part. The modules dependent on vexpress-osc are probed later correctly.
>
> This make it more difficult to debug as I don't have any debugger attached
> at the moment to look at the logbuf when it hangs without earlyprintk.
>
> --
> Regards,
> Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
  2020-04-23 15:53         ` Rob Herring
@ 2020-04-23 16:58           ` Sudeep Holla
  -1 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-23 16:58 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Arnd Bergmann,
	Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Will Deacon, Sudeep Holla,
	Kevin Brodsky,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-clk, open list:THERMAL, Michael Turquette

On Thu, Apr 23, 2020 at 10:53:40AM -0500, Rob Herring wrote:
> On Thu, Apr 23, 2020 at 8:45 AM Sudeep Holla <sudeep.holla@arm.com> wrote:
> >
> > On Wed, Apr 22, 2020 at 10:08:02PM +0100, Sudeep Holla wrote:
> > > On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote:
> > > > Enable building the vexpress-osc clock driver as a module.
> > > >
> > > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > > > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > > > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > > > Cc: Michael Turquette <mturquette@baylibre.com>
> > > > Cc: Stephen Boyd <sboyd@kernel.org>
> > > > Cc: linux-clk@vger.kernel.org
> > > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > > ---
> > > >  drivers/clk/versatile/Kconfig            |  4 ++--
> > > >  drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
> > > >  2 files changed, 6 insertions(+), 8 deletions(-)
> > > >
> > > > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> > > > index 5bdd5c98990b..9de2396dcf9b 100644
> > > > --- a/drivers/clk/versatile/Kconfig
> > > > +++ b/drivers/clk/versatile/Kconfig
> > > > @@ -15,8 +15,8 @@ config CLK_SP810
> > > >       of the ARM SP810 System Controller cell.
> > > >
> > > >  config CLK_VEXPRESS_OSC
> > > > -   bool "Clock driver for Versatile Express OSC clock generators"
> > > > -   depends on VEXPRESS_CONFIG || COMPILE_TEST
> > > > +   tristate "Clock driver for Versatile Express OSC clock generators"
> > > > +   depends on VEXPRESS_CONFIG
> > > >     default y if ARCH_VEXPRESS
> > > >     ---help---
> > > >       Simple regmap-based driver driving clock generators on Versatile
> > > > diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> > > > index 5bb1d5a714d0..b2b32fa2d7c3 100644
> > > > --- a/drivers/clk/versatile/clk-vexpress-osc.c
> > > > +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> > > > @@ -7,6 +7,7 @@
> > > >  #include <linux/clkdev.h>
> > > >  #include <linux/clk-provider.h>
> > > >  #include <linux/err.h>
> > > > +#include <linux/module.h>
> > > >  #include <linux/of.h>
> > > >  #include <linux/platform_device.h>
> > > >  #include <linux/slab.h>
> > > > @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
> > > >     { .compatible = "arm,vexpress-osc", },
> > > >     {}
> > > >  };
> > > > +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
> > > >
> > > >  static struct platform_driver vexpress_osc_driver = {
> > > >     .driver = {
> > > > @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
> > > >     },
> > > >     .probe = vexpress_osc_probe,
> > > >  };
> > > > -
> > > > -static int __init vexpress_osc_init(void)
> > > > -{
> > > > -   return platform_driver_register(&vexpress_osc_driver);
> > > > -}
> > > > -core_initcall(vexpress_osc_init);
> > > > +module_platform_driver(vexpress_osc_driver);
> > >
> > > I am not 100% sure of this. This might break the boot on CA9 and TC2
> > > at-least. There are loads of MB peripherals that need this. This will
> > > break the boot. We need to check if all the dependent modules are also
> > > at module_initcall level and if they deal with deferred probe correctly.
> > > Lot of them are legacy and may happen to be working by carefully initcall
> > > level adjustments.
> > >
> >
> > OK I managed to try this on my TC2 and it fails to boot. However when I
> > enable earlyprintk as I see no log without it, it boots just fine.
> 
> Well, the uart clocks for TC2 are all dependent on vexpress-osc. The
> console setup is going to fail to get the clocks and just fail as
> there's no deferred probe for consoles. We need some way to retrigger
> the console matching.
> 

Ah right, I didn't bother to look at pl011 as I got it confused with Juno
which has on-chip pl011.

Sorry I don't know details of how early console hands over to the console.
Just wondering how is the dependency resolved when earlyprintk is enabled.
The partial log from

$ dmesg  | grep -i -E "("pl0"|"vexpress"|"console")"

below when it boots earlyprintk. I see that console is enabled after
vexpress_osc_driver_init is called.

--->8
calling  vexpress_syscfg_init+0x1/0xe @ 1
initcall vexpress_syscfg_init+0x1/0xe returned 0 after 0 usecs
calling  vexpress_sysreg_init+0x1/0x48 @ 1
probe of vexpress-syscfg.6.auto returned 1 after 0 usecs
initcall vexpress_sysreg_init+0x1/0x48 returned 0 after 0 usecs
calling  vexpress_config_init+0x1/0xae @ 1
initcall vexpress_config_init+0x1/0xae returned 0 after 0 usecs
calling  pl011_init+0x1/0x38 @ 1
Serial: AMBA PL011 UART driver
initcall pl011_init+0x1/0x38 returned 0 after 9765 usecs
calling  pl022_init+0x1/0xc @ 1
initcall pl022_init+0x1/0xc returned 0 after 0 usecs
calling  pl061_gpio_init+0x1/0xc @ 1
initcall pl061_gpio_init+0x1/0xc returned 0 after 31 usecs
calling  vexpress_osc_driver_init+0x1/0x10 @ 1
initcall vexpress_osc_driver_init+0x1/0x10 returned 0 after 231119 usecs
calling  vexpress_regulator_driver_init+0x1/0xe @ 1
initcall vexpress_regulator_driver_init+0x1/0xe returned 0 after 114764 usecs
calling  pl031_driver_init+0x1/0xc @ 1
initcall pl031_driver_init+0x1/0xc returned 0 after 25 usecs
calling  vexpress_reset_driver_init+0x1/0xe @ 1
initcall vexpress_reset_driver_init+0x1/0xe returned 0 after 594 usecs
1c090000.uart: ttyAMA0 at MMIO 0x1c090000 (irq = 30, base_baud = 0) is a PL011 rev2
printk: console [ttyAMA0] enabled
printk: bootconsole [earlycon0] disabled
1c0a0000.uart: ttyAMA1 at MMIO 0x1c0a0000 (irq = 31, base_baud = 0) is a PL011 rev2
1c0b0000.uart: ttyAMA2 at MMIO 0x1c0b0000 (irq = 32, base_baud = 0) is a PL011 rev2
1c0c0000.uart: ttyAMA3 at MMIO 0x1c0c0000 (irq = 33, base_baud = 0) is a PL011 rev2
rtc-pl031 1c170000.rtc: registered as rtc0
rtc-pl031 1c170000.rtc: setting system clock to 2020-04-23T16:54:46 UTC (1587660886)
--->8

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module
@ 2020-04-23 16:58           ` Sudeep Holla
  0 siblings, 0 replies; 136+ messages in thread
From: Sudeep Holla @ 2020-04-23 16:58 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, open list:THERMAL,
	Stephen Boyd, Catalin Marinas, Linus Walleij, Sudeep Holla,
	Liviu Dudau, Sebastian Reichel, Kevin Brodsky, Michael Turquette,
	Will Deacon, Greg Kroah-Hartman, Lee Jones, linux-clk,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Thu, Apr 23, 2020 at 10:53:40AM -0500, Rob Herring wrote:
> On Thu, Apr 23, 2020 at 8:45 AM Sudeep Holla <sudeep.holla@arm.com> wrote:
> >
> > On Wed, Apr 22, 2020 at 10:08:02PM +0100, Sudeep Holla wrote:
> > > On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote:
> > > > Enable building the vexpress-osc clock driver as a module.
> > > >
> > > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > > > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > > > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > > > Cc: Michael Turquette <mturquette@baylibre.com>
> > > > Cc: Stephen Boyd <sboyd@kernel.org>
> > > > Cc: linux-clk@vger.kernel.org
> > > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > > ---
> > > >  drivers/clk/versatile/Kconfig            |  4 ++--
> > > >  drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------
> > > >  2 files changed, 6 insertions(+), 8 deletions(-)
> > > >
> > > > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> > > > index 5bdd5c98990b..9de2396dcf9b 100644
> > > > --- a/drivers/clk/versatile/Kconfig
> > > > +++ b/drivers/clk/versatile/Kconfig
> > > > @@ -15,8 +15,8 @@ config CLK_SP810
> > > >       of the ARM SP810 System Controller cell.
> > > >
> > > >  config CLK_VEXPRESS_OSC
> > > > -   bool "Clock driver for Versatile Express OSC clock generators"
> > > > -   depends on VEXPRESS_CONFIG || COMPILE_TEST
> > > > +   tristate "Clock driver for Versatile Express OSC clock generators"
> > > > +   depends on VEXPRESS_CONFIG
> > > >     default y if ARCH_VEXPRESS
> > > >     ---help---
> > > >       Simple regmap-based driver driving clock generators on Versatile
> > > > diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> > > > index 5bb1d5a714d0..b2b32fa2d7c3 100644
> > > > --- a/drivers/clk/versatile/clk-vexpress-osc.c
> > > > +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> > > > @@ -7,6 +7,7 @@
> > > >  #include <linux/clkdev.h>
> > > >  #include <linux/clk-provider.h>
> > > >  #include <linux/err.h>
> > > > +#include <linux/module.h>
> > > >  #include <linux/of.h>
> > > >  #include <linux/platform_device.h>
> > > >  #include <linux/slab.h>
> > > > @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = {
> > > >     { .compatible = "arm,vexpress-osc", },
> > > >     {}
> > > >  };
> > > > +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match);
> > > >
> > > >  static struct platform_driver vexpress_osc_driver = {
> > > >     .driver = {
> > > > @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = {
> > > >     },
> > > >     .probe = vexpress_osc_probe,
> > > >  };
> > > > -
> > > > -static int __init vexpress_osc_init(void)
> > > > -{
> > > > -   return platform_driver_register(&vexpress_osc_driver);
> > > > -}
> > > > -core_initcall(vexpress_osc_init);
> > > > +module_platform_driver(vexpress_osc_driver);
> > >
> > > I am not 100% sure of this. This might break the boot on CA9 and TC2
> > > at-least. There are loads of MB peripherals that need this. This will
> > > break the boot. We need to check if all the dependent modules are also
> > > at module_initcall level and if they deal with deferred probe correctly.
> > > Lot of them are legacy and may happen to be working by carefully initcall
> > > level adjustments.
> > >
> >
> > OK I managed to try this on my TC2 and it fails to boot. However when I
> > enable earlyprintk as I see no log without it, it boots just fine.
> 
> Well, the uart clocks for TC2 are all dependent on vexpress-osc. The
> console setup is going to fail to get the clocks and just fail as
> there's no deferred probe for consoles. We need some way to retrigger
> the console matching.
> 

Ah right, I didn't bother to look at pl011 as I got it confused with Juno
which has on-chip pl011.

Sorry I don't know details of how early console hands over to the console.
Just wondering how is the dependency resolved when earlyprintk is enabled.
The partial log from

$ dmesg  | grep -i -E "("pl0"|"vexpress"|"console")"

below when it boots earlyprintk. I see that console is enabled after
vexpress_osc_driver_init is called.

--->8
calling  vexpress_syscfg_init+0x1/0xe @ 1
initcall vexpress_syscfg_init+0x1/0xe returned 0 after 0 usecs
calling  vexpress_sysreg_init+0x1/0x48 @ 1
probe of vexpress-syscfg.6.auto returned 1 after 0 usecs
initcall vexpress_sysreg_init+0x1/0x48 returned 0 after 0 usecs
calling  vexpress_config_init+0x1/0xae @ 1
initcall vexpress_config_init+0x1/0xae returned 0 after 0 usecs
calling  pl011_init+0x1/0x38 @ 1
Serial: AMBA PL011 UART driver
initcall pl011_init+0x1/0x38 returned 0 after 9765 usecs
calling  pl022_init+0x1/0xc @ 1
initcall pl022_init+0x1/0xc returned 0 after 0 usecs
calling  pl061_gpio_init+0x1/0xc @ 1
initcall pl061_gpio_init+0x1/0xc returned 0 after 31 usecs
calling  vexpress_osc_driver_init+0x1/0x10 @ 1
initcall vexpress_osc_driver_init+0x1/0x10 returned 0 after 231119 usecs
calling  vexpress_regulator_driver_init+0x1/0xe @ 1
initcall vexpress_regulator_driver_init+0x1/0xe returned 0 after 114764 usecs
calling  pl031_driver_init+0x1/0xc @ 1
initcall pl031_driver_init+0x1/0xc returned 0 after 25 usecs
calling  vexpress_reset_driver_init+0x1/0xe @ 1
initcall vexpress_reset_driver_init+0x1/0xe returned 0 after 594 usecs
1c090000.uart: ttyAMA0 at MMIO 0x1c090000 (irq = 30, base_baud = 0) is a PL011 rev2
printk: console [ttyAMA0] enabled
printk: bootconsole [earlycon0] disabled
1c0a0000.uart: ttyAMA1 at MMIO 0x1c0a0000 (irq = 31, base_baud = 0) is a PL011 rev2
1c0b0000.uart: ttyAMA2 at MMIO 0x1c0b0000 (irq = 32, base_baud = 0) is a PL011 rev2
1c0c0000.uart: ttyAMA3 at MMIO 0x1c0c0000 (irq = 33, base_baud = 0) is a PL011 rev2
rtc-pl031 1c170000.rtc: registered as rtc0
rtc-pl031 1c170000.rtc: setting system clock to 2020-04-23T16:54:46 UTC (1587660886)
--->8

-- 
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 04/17] power/reset: vexpress: Support building as a module
  2020-04-20 17:23       ` Rob Herring
@ 2020-04-28 19:31         ` Sebastian Reichel
  -1 siblings, 0 replies; 136+ messages in thread
From: Sebastian Reichel @ 2020-04-28 19:31 UTC (permalink / raw)
  To: Rob Herring
  Cc: Arnd Bergmann, Linus Walleij, Liviu Dudau, Lorenzo Pieralisi,
	Sudeep Holla, Catalin Marinas, Greg Kroah-Hartman, Lee Jones,
	Stephen Boyd, Will Deacon, Kevin Brodsky, Linux ARM, linux-clk,
	Linux PM list

[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]

Hi,

On Mon, Apr 20, 2020 at 12:23:13PM -0500, Rob Herring wrote:
> On Mon, Apr 20, 2020 at 10:24 AM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > Enable building the VExpress power-off/reset driver as a module.
> >
> > Your change allows loading and unloading the driver, but actually
> > unloading is a bug with the current implementation, as there is no
> > 'release' handler to undo the _vexpress_register_restart_handler()
> > function.
> 
> And also to save and restore pm_power_off...

I'm fine with providing Acked-by for this for merging through a
different tree or taking it through my tree.

> > It should not be hard to add a release handler, or you could just
> > mark the function as non-unloadable by only having a module_init()
> > but no module_exit() function.
> >
> > I suppose if you do the latter, there should also be a suppress_bind_attrs
> > flag in the device_driver. This is a preexisting bug.
> 
> I may just drop this patch. I wrote it and then realized I don't need
> it as PSCI can be used instead.

So is the driver useless on arm64 and depends can be reduced to
arm32?

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 136+ messages in thread

* Re: [PATCH 04/17] power/reset: vexpress: Support building as a module
@ 2020-04-28 19:31         ` Sebastian Reichel
  0 siblings, 0 replies; 136+ messages in thread
From: Sebastian Reichel @ 2020-04-28 19:31 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lorenzo Pieralisi, Arnd Bergmann, Greg Kroah-Hartman,
	Stephen Boyd, Catalin Marinas, Linus Walleij, Kevin Brodsky,
	Liviu Dudau, Will Deacon, Sudeep Holla, Linux PM list, Lee Jones,
	linux-clk, Linux ARM


[-- Attachment #1.1: Type: text/plain, Size: 1228 bytes --]

Hi,

On Mon, Apr 20, 2020 at 12:23:13PM -0500, Rob Herring wrote:
> On Mon, Apr 20, 2020 at 10:24 AM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > On Sun, Apr 19, 2020 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > Enable building the VExpress power-off/reset driver as a module.
> >
> > Your change allows loading and unloading the driver, but actually
> > unloading is a bug with the current implementation, as there is no
> > 'release' handler to undo the _vexpress_register_restart_handler()
> > function.
> 
> And also to save and restore pm_power_off...

I'm fine with providing Acked-by for this for merging through a
different tree or taking it through my tree.

> > It should not be hard to add a release handler, or you could just
> > mark the function as non-unloadable by only having a module_init()
> > but no module_exit() function.
> >
> > I suppose if you do the latter, there should also be a suppress_bind_attrs
> > flag in the device_driver. This is a preexisting bug.
> 
> I may just drop this patch. I wrote it and then realized I don't need
> it as PSCI can be used instead.

So is the driver useless on arm64 and depends can be reduced to
arm32?

-- Sebastian

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 136+ messages in thread

end of thread, other threads:[~2020-04-28 19:31 UTC | newest]

Thread overview: 136+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-19 17:07 [PATCH 00/17] Modularizing Versatile Express Rob Herring
2020-04-19 17:07 ` Rob Herring
2020-04-19 17:07 ` [PATCH 01/17] ARM: vexpress: Move vexpress_flags_set() into arch code Rob Herring
2020-04-19 17:07   ` Rob Herring
2020-04-20 15:17   ` Arnd Bergmann
2020-04-20 15:17     ` Arnd Bergmann
2020-04-22 10:15   ` Liviu Dudau
2020-04-22 10:15     ` Liviu Dudau
2020-04-22 19:04   ` Sudeep Holla
2020-04-22 19:04     ` Sudeep Holla
2020-04-19 17:07 ` [PATCH 02/17] arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS Rob Herring
2020-04-19 17:07   ` Rob Herring
2020-04-20 15:18   ` Arnd Bergmann
2020-04-20 15:18     ` Arnd Bergmann
2020-04-22 10:16   ` Liviu Dudau
2020-04-22 10:16     ` Liviu Dudau
2020-04-22 19:08   ` Sudeep Holla
2020-04-22 19:08     ` Sudeep Holla
2020-04-19 17:07 ` [PATCH 03/17] arm64: vexpress: Don't select CONFIG_VEXPRESS_CONFIG Rob Herring
2020-04-19 17:07   ` Rob Herring
2020-04-20 15:18   ` Arnd Bergmann
2020-04-20 15:18     ` Arnd Bergmann
2020-04-22 19:09   ` Sudeep Holla
2020-04-22 19:09     ` Sudeep Holla
2020-04-19 17:07 ` [PATCH 04/17] power/reset: vexpress: Support building as a module Rob Herring
2020-04-19 17:07   ` Rob Herring
2020-04-20 15:23   ` Arnd Bergmann
2020-04-20 15:23     ` Arnd Bergmann
2020-04-20 17:23     ` Rob Herring
2020-04-20 17:23       ` Rob Herring
2020-04-28 19:31       ` Sebastian Reichel
2020-04-28 19:31         ` Sebastian Reichel
2020-04-22 19:11   ` Sudeep Holla
2020-04-22 19:11     ` Sudeep Holla
2020-04-19 17:07 ` [PATCH 05/17] clk: versatile: Kill CONFIG_COMMON_CLK_VERSATILE Rob Herring
2020-04-19 17:07   ` Rob Herring
2020-04-20  6:44   ` Linus Walleij
2020-04-20  6:44     ` Linus Walleij
2020-04-22  9:47   ` Stephen Boyd
2020-04-22  9:47     ` Stephen Boyd
2020-04-22 22:34     ` Rob Herring
2020-04-22 22:34       ` Rob Herring
2020-04-22 19:17   ` Sudeep Holla
2020-04-22 19:17     ` Sudeep Holla
2020-04-19 17:07 ` [PATCH 06/17] clk: versatile: Only enable SP810 on 32-bit by default Rob Herring
2020-04-19 17:07   ` Rob Herring
2020-04-20 15:26   ` Arnd Bergmann
2020-04-20 15:26     ` Arnd Bergmann
2020-04-20 17:48     ` Rob Herring
2020-04-20 17:48       ` Rob Herring
2020-04-20 20:07       ` Arnd Bergmann
2020-04-20 20:07         ` Arnd Bergmann
2020-04-22  9:48   ` Stephen Boyd
2020-04-22  9:48     ` Stephen Boyd
2020-04-22 10:20   ` Liviu Dudau
2020-04-22 10:20     ` Liviu Dudau
2020-04-22 20:52   ` Sudeep Holla
2020-04-22 20:52     ` Sudeep Holla
2020-04-23 15:38     ` Rob Herring
2020-04-23 15:38       ` Rob Herring
2020-04-19 17:08 ` [PATCH 07/17] clk: vexpress-osc: Use the devres clock API variants Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-20 15:26   ` Arnd Bergmann
2020-04-20 15:26     ` Arnd Bergmann
2020-04-22  9:51   ` Stephen Boyd
2020-04-22  9:51     ` Stephen Boyd
2020-04-22 10:21   ` Liviu Dudau
2020-04-22 10:21     ` Liviu Dudau
2020-04-22 20:56   ` Sudeep Holla
2020-04-22 20:56     ` Sudeep Holla
2020-04-19 17:08 ` [PATCH 08/17] clk: vexpress-osc: Support building as a module Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-20 15:27   ` Arnd Bergmann
2020-04-20 15:27     ` Arnd Bergmann
2020-04-20 17:18     ` Rob Herring
2020-04-20 17:18       ` Rob Herring
2020-04-22 11:01   ` Liviu Dudau
2020-04-22 11:01     ` Liviu Dudau
2020-04-22 21:08   ` Sudeep Holla
2020-04-22 21:08     ` Sudeep Holla
2020-04-23 13:45     ` Sudeep Holla
2020-04-23 13:45       ` Sudeep Holla
2020-04-23 15:53       ` Rob Herring
2020-04-23 15:53         ` Rob Herring
2020-04-23 16:58         ` Sudeep Holla
2020-04-23 16:58           ` Sudeep Holla
2020-04-19 17:08 ` [PATCH 09/17] mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-20 15:29   ` Arnd Bergmann
2020-04-20 15:29     ` Arnd Bergmann
2020-04-22 11:02   ` Liviu Dudau
2020-04-22 11:02     ` Liviu Dudau
2020-04-19 17:08 ` [PATCH 10/17] mfd: vexpress-sysreg: Drop unused syscon child devices Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-20 15:30   ` Arnd Bergmann
2020-04-20 15:30     ` Arnd Bergmann
2020-04-22 11:18   ` Liviu Dudau
2020-04-22 11:18     ` Liviu Dudau
2020-04-19 17:08 ` [PATCH 11/17] mfd: vexpress-sysreg: Use devres API variants Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-20 15:31   ` Arnd Bergmann
2020-04-20 15:31     ` Arnd Bergmann
2020-04-22 11:18   ` Liviu Dudau
2020-04-22 11:18     ` Liviu Dudau
2020-04-19 17:08 ` [PATCH 12/17] mfd: vexpress-sysreg: Support building as a module Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-20 15:32   ` Arnd Bergmann
2020-04-20 15:32     ` Arnd Bergmann
2020-04-20 17:05     ` Rob Herring
2020-04-20 17:05       ` Rob Herring
2020-04-19 17:08 ` [PATCH 13/17] bus: vexpress-config: Merge vexpress-syscfg into vexpress-config Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-20 11:45   ` Greg Kroah-Hartman
2020-04-20 11:45     ` Greg Kroah-Hartman
2020-04-22 11:22   ` Liviu Dudau
2020-04-22 11:22     ` Liviu Dudau
2020-04-19 17:08 ` [PATCH 14/17] bus: vexpress-config: simplify config bus probing Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-22 11:58   ` Liviu Dudau
2020-04-22 11:58     ` Liviu Dudau
2020-04-19 17:08 ` [PATCH 15/17] vexpress: Move site master init to vexpress-config bus Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-22  9:51   ` Stephen Boyd
2020-04-22  9:51     ` Stephen Boyd
2020-04-22 12:03     ` Liviu Dudau
2020-04-22 12:03       ` Liviu Dudau
2020-04-23  0:54     ` Rob Herring
2020-04-23  0:54       ` Rob Herring
2020-04-19 17:08 ` [PATCH 16/17] bus: vexpress-config: Support building as module Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-22 12:04   ` Liviu Dudau
2020-04-22 12:04     ` Liviu Dudau
2020-04-19 17:08 ` [PATCH 17/17] ARM: vexpress: Don't select VEXPRESS_CONFIG Rob Herring
2020-04-19 17:08   ` Rob Herring
2020-04-22 12:05   ` Liviu Dudau
2020-04-22 12:05     ` Liviu Dudau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.