Skip to contentSkip to conversation

stm32mp: add minimal RCC support for STM32MP13

PATCH Superseded Patrick Delaunay 3 participants 10 messages May 10, 2022 – May 19, 2022

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover stm32mp: add minimal RCC support for STM32MP13

Add a minimal support for STM32MP13 RCC, the reset and clock controller
- update of the RCC MISC driver to bind the correct clock and reset driver
- reset driver, same than STM32MP15x = drivers/reset/stm32-reset.c
- clock driver, add a empty driver for STM32MP13x = drivers/clk/stm32/clk-stm32mp13.c
- Add RCC node in SOC device tree with u-boot,dm-pre-reloc property

This serie is only a preliminary step for STM32MP13 clock and reset support in U-Boot, based on Linux kernel binding introduced by [1] and it prepares the next device tree alignment with Linux kernel.

The functional STMP13 clock driver based on CCF and on SCMI clocks provided by OP-TEE and the clock and reset references in SOC device tree will be pushed when the associated patches in [1] will be accepted.

[1] Introduction of STM32MP13 RCC driver (Reset Clock Controller)

    https://lore.kernel.org/linux-arm-kernel/[email protected]/

Patrick Delaunay (4):
clk: Add directory for STM32 clock drivers
clk: stm32mp13: add a STM32MP13 RCC clock driver
misc: stm32mp13: introduce STM32MP13 RCC driver
ARM: dts: stm32: add rcc node for STM32MP13

 MAINTAINERS                            |  2 +-
 arch/arm/dts/stm32mp13-u-boot.dtsi     |  4 ++++
 arch/arm/dts/stm32mp131.dtsi           |  7 ++++++
 drivers/clk/Kconfig                    | 17 +-------------
 drivers/clk/Makefile                   |  5 ++---
 drivers/clk/stm32/Kconfig              | 31 ++++++++++++++++++++++++++
 drivers/clk/stm32/Makefile             |  8 +++++++
 drivers/clk/stm32/clk-stm32mp13.c      | 21 +++++++++++++++++
 drivers/clk/{ => stm32}/clk_stm32f.c   |  0
 drivers/clk/{ => stm32}/clk_stm32h7.c  |  0
 drivers/clk/{ => stm32}/clk_stm32mp1.c |  0
 drivers/misc/stm32_rcc.c               |  6 +++++
 12 files changed, 81 insertions(+), 20 deletions(-)
 create mode 100644 drivers/clk/stm32/Kconfig
 create mode 100644 drivers/clk/stm32/Makefile
 create mode 100644 drivers/clk/stm32/clk-stm32mp13.c
 rename drivers/clk/{ => stm32}/clk_stm32f.c (100%)
 rename drivers/clk/{ => stm32}/clk_stm32h7.c (100%)
 rename drivers/clk/{ => stm32}/clk_stm32mp1.c (100%)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/4 clk: Add directory for STM32 clock drivers

Add a directory in drivers/clk to regroup the clock drivers for all STM32 Soc with CONFIG_ARCH_STM32 (MCUs with cortex M) or CONFIG_ARCH_STM32MP (MPUs with cortex A).

---

 MAINTAINERS                            |  2 +-
 drivers/clk/Kconfig                    | 17 +----------------
 drivers/clk/Makefile                   |  5 ++---
 drivers/clk/stm32/Kconfig              | 23 +++++++++++++++++++++++
 drivers/clk/stm32/Makefile             |  7 +++++++
 drivers/clk/{ => stm32}/clk_stm32f.c   |  0
 drivers/clk/{ => stm32}/clk_stm32h7.c  |  0
 drivers/clk/{ => stm32}/clk_stm32mp1.c |  0
 8 files changed, 34 insertions(+), 20 deletions(-)
 create mode 100644 drivers/clk/stm32/Kconfig
 create mode 100644 drivers/clk/stm32/Makefile
 rename drivers/clk/{ => stm32}/clk_stm32f.c (100%)
 rename drivers/clk/{ => stm32}/clk_stm32h7.c (100%)
 rename drivers/clk/{ => stm32}/clk_stm32mp1.c (100%)
MAINTAINERS +1 -1
index 56be0bfad0..3f37edd716 100644
@@ -469,7 +469,7 @@ S:	Maintained
 F:	arch/arm/mach-stm32mp/
 F:	doc/board/st/
 F:	drivers/adc/stm32-adc*
-F:	drivers/clk/clk_stm32mp1.c
+F:	drivers/clk/stm32/
 F:	drivers/gpio/stm32_gpio.c
 F:	drivers/hwspinlock/stm32_hwspinlock.c
 F:	drivers/i2c/stm32f7_i2c.c
drivers/clk/Kconfig +1 -16
index 6dc271f71b..98ad481d9e 100644
@@ -140,22 +140,6 @@ config CLK_SCMI
 	  by a SCMI agent based on SCMI clock protocol communication
 	  with a SCMI server.
 
-config CLK_STM32F
-	bool "Enable clock driver support for STM32F family"
-	depends on CLK && (STM32F7 || STM32F4)
-	default y
-	help
-	  This clock driver adds support for RCC clock management
-	  for STM32F4 and STM32F7 SoCs.
-
-config CLK_STM32MP1
-	bool "Enable RCC clock driver for STM32MP1"
-	depends on ARCH_STM32MP && CLK
-	default y
-	help
-	  Enable the STM32 clock (RCC) driver. Enable support for
-	  manipulating STM32MP1's on-SoC clocks.
-
 config CLK_HSDK
 	bool "Enable cgu clock driver for HSDK boards"
 	depends on CLK && TARGET_HSDK
@@ -225,6 +209,7 @@ source "drivers/clk/owl/Kconfig"
 source "drivers/clk/renesas/Kconfig"
 source "drivers/clk/sunxi/Kconfig"
 source "drivers/clk/sifive/Kconfig"
+source "drivers/clk/stm32/Kconfig"
 source "drivers/clk/tegra/Kconfig"
 source "drivers/clk/ti/Kconfig"
 source "drivers/clk/uniphier/Kconfig"
drivers/clk/Makefile +2 -3
index bb4eee5d99..09fbaf6233 100644
@@ -22,6 +22,8 @@ obj-$(CONFIG_ARCH_MESON) += meson/
 obj-$(CONFIG_ARCH_MTMIPS) += mtmips/
 obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
 obj-$(CONFIG_ARCH_SOCFPGA) += altera/
+obj-$(CONFIG_ARCH_STM32) += stm32/
+obj-$(CONFIG_ARCH_STM32MP) += stm32/
 obj-$(CONFIG_ARCH_SUNXI) += sunxi/
 obj-$(CONFIG_CLK_AT91) += at91/
 obj-$(CONFIG_CLK_BCM6345) += clk_bcm6345.o
@@ -38,8 +40,6 @@ obj-$(CONFIG_CLK_OWL) += owl/
 obj-$(CONFIG_CLK_RENESAS) += renesas/
 obj-$(CONFIG_CLK_SCMI) += clk_scmi.o
 obj-$(CONFIG_CLK_SIFIVE) += sifive/
-obj-$(CONFIG_CLK_STM32F) += clk_stm32f.o
-obj-$(CONFIG_CLK_STM32MP1) += clk_stm32mp1.o
 obj-$(CONFIG_CLK_UNIPHIER) += uniphier/
 obj-$(CONFIG_CLK_VERSACLOCK) += clk_versaclock.o
 obj-$(CONFIG_CLK_VERSAL) += clk_versal.o
@@ -52,4 +52,3 @@ obj-$(CONFIG_MACH_PIC32) += clk_pic32.o
 obj-$(CONFIG_SANDBOX_CLK_CCF) += clk_sandbox_ccf.o
 obj-$(CONFIG_SANDBOX) += clk_sandbox.o
 obj-$(CONFIG_SANDBOX) += clk_sandbox_test.o
-obj-$(CONFIG_STM32H7) += clk_stm32h7.o
drivers/clk/stm32/Kconfig new file +23 -0
new file mode 100644
index 0000000000..eac3fc1e9d
@@ -0,0 +1,23 @@
+config CLK_STM32F
+	bool "Enable clock driver support for STM32F family"
+	depends on CLK && (STM32F7 || STM32F4)
+	default y
+	help
+	  This clock driver adds support for RCC clock management
+	  for STM32F4 and STM32F7 SoCs.
+
+config CLK_STM32H7
+	bool "Enable clock driver support for STM32H7 family"
+	depends on CLK && STM32H7
+	default y
+	help
+	  This clock driver adds support for RCC clock management
+	  for STM32H7 SoCs.
+
+config CLK_STM32MP1
+	bool "Enable RCC clock driver for STM32MP15"
+	depends on ARCH_STM32MP && CLK
+	default y if STM32MP15x
+	help
+	  Enable the STM32 clock (RCC) driver. Enable support for
+	  manipulating STM32MP15's on-SoC clocks.
drivers/clk/stm32/Makefile new file +7 -0
new file mode 100644
index 0000000000..b420eeaa4e
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Copyright (C) 2022, STMicroelectronics - All Rights Reserved
+
+obj-$(CONFIG_CLK_STM32F) += clk_stm32f.o
+obj-$(CONFIG_CLK_STM32H7) += clk_stm32h7.o
+obj-$(CONFIG_CLK_STM32MP1) += clk_stm32mp1.o
drivers/clk/stm32/clk_stm32f.c renamed from drivers/clk/clk_stm32f.c +0 -0
similarity index 100%
rename from drivers/clk/clk_stm32f.c
rename to drivers/clk/stm32/clk_stm32f.c
drivers/clk/stm32/clk_stm32h7.c renamed from drivers/clk/clk_stm32h7.c +0 -0
similarity index 100%
rename from drivers/clk/clk_stm32h7.c
rename to drivers/clk/stm32/clk_stm32h7.c
drivers/clk/stm32/clk_stm32mp1.c renamed from drivers/clk/clk_stm32mp1.c +0 -0
similarity index 100%
rename from drivers/clk/clk_stm32mp1.c
rename to drivers/clk/stm32/clk_stm32mp1.c
Signature · 1 line
2.25.1
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] clk: Add directory for STM32 clock drivers

drivers/clk/stm32/clk_stm32mp1.c

Quoted 152 lines · Patrick Delaunay

Add a directory in drivers/clk to regroup the clock drivers for all STM32 Soc with CONFIG_ARCH_STM32 (MCUs with cortex M) or CONFIG_ARCH_STM32MP (MPUs with cortex A).

---

  MAINTAINERS                            |  2 +-
  drivers/clk/Kconfig                    | 17 +----------------
  drivers/clk/Makefile                   |  5 ++---
  drivers/clk/stm32/Kconfig              | 23 +++++++++++++++++++++++
  drivers/clk/stm32/Makefile             |  7 +++++++
  drivers/clk/{ => stm32}/clk_stm32f.c   |  0
  drivers/clk/{ => stm32}/clk_stm32h7.c  |  0
  drivers/clk/{ => stm32}/clk_stm32mp1.c |  0
  8 files changed, 34 insertions(+), 20 deletions(-)

create mode 100644 drivers/clk/stm32/Kconfig create mode 100644 drivers/clk/stm32/Makefile rename drivers/clk/{ => stm32}/clk_stm32f.c (100%) rename drivers/clk/{ => stm32}/clk_stm32h7.c (100%) rename drivers/clk/{ => stm32}/clk_stm32mp1.c (100%)

MAINTAINERS +1 -1
index 56be0bfad0..3f37edd716 100644
@@ -469,7 +469,7 @@ S:	Maintained
  F:	arch/arm/mach-stm32mp/
  F:	doc/board/st/
  F:	drivers/adc/stm32-adc*
-F:	drivers/clk/clk_stm32mp1.c
+F:	drivers/clk/stm32/
  F:	drivers/gpio/stm32_gpio.c
  F:	drivers/hwspinlock/stm32_hwspinlock.c
  F:	drivers/i2c/stm32f7_i2c.c
drivers/clk/Kconfig +1 -16
index 6dc271f71b..98ad481d9e 100644
@@ -140,22 +140,6 @@ config CLK_SCMI
  	  by a SCMI agent based on SCMI clock protocol communication
  	  with a SCMI server.
 
-config CLK_STM32F
-	bool "Enable clock driver support for STM32F family"
-	depends on CLK && (STM32F7 || STM32F4)
-	default y
-	help
-	  This clock driver adds support for RCC clock management
-	  for STM32F4 and STM32F7 SoCs.
-
-config CLK_STM32MP1
-	bool "Enable RCC clock driver for STM32MP1"
-	depends on ARCH_STM32MP && CLK
-	default y
-	help
-	  Enable the STM32 clock (RCC) driver. Enable support for
-	  manipulating STM32MP1's on-SoC clocks.
-
  config CLK_HSDK
  	bool "Enable cgu clock driver for HSDK boards"
  	depends on CLK && TARGET_HSDK
@@ -225,6 +209,7 @@ source "drivers/clk/owl/Kconfig"
  source "drivers/clk/renesas/Kconfig"
  source "drivers/clk/sunxi/Kconfig"
  source "drivers/clk/sifive/Kconfig"
+source "drivers/clk/stm32/Kconfig"
  source "drivers/clk/tegra/Kconfig"
  source "drivers/clk/ti/Kconfig"
  source "drivers/clk/uniphier/Kconfig"
drivers/clk/Makefile +2 -3
index bb4eee5d99..09fbaf6233 100644
@@ -22,6 +22,8 @@ obj-$(CONFIG_ARCH_MESON) += meson/
  obj-$(CONFIG_ARCH_MTMIPS) += mtmips/
  obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
  obj-$(CONFIG_ARCH_SOCFPGA) += altera/
+obj-$(CONFIG_ARCH_STM32) += stm32/
+obj-$(CONFIG_ARCH_STM32MP) += stm32/
  obj-$(CONFIG_ARCH_SUNXI) += sunxi/
  obj-$(CONFIG_CLK_AT91) += at91/
  obj-$(CONFIG_CLK_BCM6345) += clk_bcm6345.o
@@ -38,8 +40,6 @@ obj-$(CONFIG_CLK_OWL) += owl/
  obj-$(CONFIG_CLK_RENESAS) += renesas/
  obj-$(CONFIG_CLK_SCMI) += clk_scmi.o
  obj-$(CONFIG_CLK_SIFIVE) += sifive/
-obj-$(CONFIG_CLK_STM32F) += clk_stm32f.o
-obj-$(CONFIG_CLK_STM32MP1) += clk_stm32mp1.o
  obj-$(CONFIG_CLK_UNIPHIER) += uniphier/
  obj-$(CONFIG_CLK_VERSACLOCK) += clk_versaclock.o
  obj-$(CONFIG_CLK_VERSAL) += clk_versal.o
@@ -52,4 +52,3 @@ obj-$(CONFIG_MACH_PIC32) += clk_pic32.o
  obj-$(CONFIG_SANDBOX_CLK_CCF) += clk_sandbox_ccf.o
  obj-$(CONFIG_SANDBOX) += clk_sandbox.o
  obj-$(CONFIG_SANDBOX) += clk_sandbox_test.o
-obj-$(CONFIG_STM32H7) += clk_stm32h7.o
drivers/clk/stm32/Kconfig new file +23 -0
new file mode 100644
index 0000000000..eac3fc1e9d
@@ -0,0 +1,23 @@
+config CLK_STM32F
+	bool "Enable clock driver support for STM32F family"
+	depends on CLK && (STM32F7 || STM32F4)
+	default y
+	help
+	  This clock driver adds support for RCC clock management
+	  for STM32F4 and STM32F7 SoCs.
+
+config CLK_STM32H7
+	bool "Enable clock driver support for STM32H7 family"
+	depends on CLK && STM32H7
+	default y
+	help
+	  This clock driver adds support for RCC clock management
+	  for STM32H7 SoCs.
+
+config CLK_STM32MP1
+	bool "Enable RCC clock driver for STM32MP15"
+	depends on ARCH_STM32MP && CLK
+	default y if STM32MP15x
+	help
+	  Enable the STM32 clock (RCC) driver. Enable support for
+	  manipulating STM32MP15's on-SoC clocks.
drivers/clk/stm32/Makefile new file +7 -0
new file mode 100644
index 0000000000..b420eeaa4e
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Copyright (C) 2022, STMicroelectronics - All Rights Reserved
+
+obj-$(CONFIG_CLK_STM32F) += clk_stm32f.o
+obj-$(CONFIG_CLK_STM32H7) += clk_stm32h7.o
+obj-$(CONFIG_CLK_STM32MP1) += clk_stm32mp1.o
drivers/clk/stm32/clk_stm32f.c renamed from drivers/clk/clk_stm32f.c +0 -0
similarity index 100%
rename from drivers/clk/clk_stm32f.c
rename to drivers/clk/stm32/clk_stm32f.c
drivers/clk/stm32/clk_stm32h7.c renamed from drivers/clk/clk_stm32h7.c +0 -0
similarity index 100%
rename from drivers/clk/clk_stm32h7.c
rename to drivers/clk/stm32/clk_stm32h7.c
drivers/clk/stm32/clk_stm32mp1.c renamed from drivers/clk/clk_stm32mp1.c +0 -0
similarity index 100%
rename from drivers/clk/clk_stm32mp1.c
rename to drivers/clk/stm32/clk_stm32mp1.c
#3 lore raw

PATCH 2/4 clk: stm32mp13: add a STM32MP13 RCC clock driver

In reply to Patrick Delaunay

Introduce a minimal STM32MP13 RCC driver only to allow bind of RCC MISC driver.

---

 drivers/clk/stm32/Kconfig         |  8 ++++++++
 drivers/clk/stm32/Makefile        |  1 +
 drivers/clk/stm32/clk-stm32mp13.c | 21 +++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 drivers/clk/stm32/clk-stm32mp13.c
drivers/clk/stm32/Kconfig +8 -0
index eac3fc1e9d..7444164b81 100644
@@ -21,3 +21,11 @@ config CLK_STM32MP1
 	help
 	  Enable the STM32 clock (RCC) driver. Enable support for
 	  manipulating STM32MP15's on-SoC clocks.
+
+config CLK_STM32MP13
+	bool "Enable RCC clock driver for STM32MP13"
+	depends on ARCH_STM32MP && CLK
+	default y if STM32MP13x
+	help
+	  Enable the STM32 clock (RCC) driver. Enable support for
+	  manipulating STM32MP13's on-SoC clocks.
drivers/clk/stm32/Makefile +1 -0
index b420eeaa4e..feeb796f76 100644
@@ -5,3 +5,4 @@
 obj-$(CONFIG_CLK_STM32F) += clk_stm32f.o
 obj-$(CONFIG_CLK_STM32H7) += clk_stm32h7.o
 obj-$(CONFIG_CLK_STM32MP1) += clk_stm32mp1.o
+obj-$(CONFIG_CLK_STM32MP13) += clk-stm32mp13.o
\ No newline at end of file
drivers/clk/stm32/clk-stm32mp13.c new file +21 -0
new file mode 100644
index 0000000000..afd116361b
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
+/*
+ * Copyright (C) 2022, STMicroelectronics - All Rights Reserved
+ * Author: Gabriel Fernandez <[email protected]> for STMicroelectronics.
+ */
+
+#define LOG_CATEGORY UCLASS_CLK
+
+#include <common.h>
+#include <dm.h>
+
+static int stm32mp1_clk_probe(struct udevice *dev)
+{
+	return -EINVAL;
+}
+
+U_BOOT_DRIVER(stm32mp1_clock) = {
+	.name = "stm32mp13_clk",
+	.id = UCLASS_CLK,
+	.probe = stm32mp1_clk_probe,
+};
Signature · 1 line
2.25.1
#4 lore raw

Re: [Uboot-stm32] [PATCH 2/4] clk: stm32mp13: add a STM32MP13 RCC clock driver

Hi,

Quoted 2 lines · Patrick Delaunay

Introduce a minimal STM32MP13 RCC driver only to allow bind of RCC MISC driver.

Consider s/only/just/ and s/bind of/binding of the/.

drivers/clk/stm32/Makefile line 8

Quoted 5 lines
drivers/clk/stm32/Makefile +1 -1
-%<-
 obj-$(CONFIG_CLK_STM32MP1) += clk_stm32mp1.o
+obj-$(CONFIG_CLK_STM32MP13) += clk-stm32mp13.o
\ No newline at end of file

Could you add a newline here? I think it was there in the previous patch. Also, note that the new file name seems to break the convention of using underscores.

All the best

Signature · 1 line
Grzegorz
#5 lore raw

PATCH 3/4 misc: stm32mp13: introduce STM32MP13 RCC driver

In reply to Patrick Delaunay

Add the MISC RCC driver for STM32MP13, and bind it to the RCC reset driver, required for initial support.

---

 drivers/misc/stm32_rcc.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/misc/stm32_rcc.c +6 -0
index f14d6e26d9..b816503bfa 100644
@@ -39,6 +39,11 @@ struct stm32_rcc_clk stm32_rcc_clk_mp1 = {
 	.soc = STM32MP1,
 };
 
+struct stm32_rcc_clk stm32_rcc_clk_mp13 = {
+	.drv_name = "stm32mp13_clk",
+	.soc = STM32MP1,
+};
+
 static int stm32_rcc_bind(struct udevice *dev)
 {
 	struct udevice *child;
@@ -79,6 +84,7 @@ static const struct udevice_id stm32_rcc_ids[] = {
 	{.compatible = "st,stm32f746-rcc", .data = (ulong)&stm32_rcc_clk_f7 },
 	{.compatible = "st,stm32h743-rcc", .data = (ulong)&stm32_rcc_clk_h7 },
 	{.compatible = "st,stm32mp1-rcc", .data = (ulong)&stm32_rcc_clk_mp1 },
+	{.compatible = "st,stm32mp13-rcc", .data = (ulong)&stm32_rcc_clk_mp13 },
 	{ }
 };
 
Signature · 1 line
2.25.1
#6 lore raw

PATCH 4/4 ARM: dts: stm32: add rcc node for STM32MP13

In reply to Patrick Delaunay

Add the RCC node, not yet in Linux kernel device tree to handle the U-Boot RCC drivers.

---

 arch/arm/dts/stm32mp13-u-boot.dtsi | 4 ++++
 arch/arm/dts/stm32mp131.dtsi       | 7 +++++++
 2 files changed, 11 insertions(+)
arch/arm/dts/stm32mp13-u-boot.dtsi +4 -0
index 1b5b358690..126f282816 100644
@@ -86,6 +86,10 @@
 	u-boot,dm-pre-reloc;
 };
 
+&rcc {
+	u-boot,dm-pre-reloc;
+};
+
 &syscfg {
 	u-boot,dm-pre-reloc;
 };
arch/arm/dts/stm32mp131.dtsi +7 -0
index 950e172e45..fcb0af09b5 100644
@@ -159,6 +159,13 @@
 			dma-channels = <16>;
 		};
 
+		rcc: rcc@50000000 {
+			compatible = "st,stm32mp13-rcc", "syscon";
+			reg = <0x50000000 0x1000>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+		};
+
 		exti: interrupt-controller@5000d000 {
 			compatible = "st,stm32mp13-exti", "syscon";
 			interrupt-controller;
Signature · 1 line
2.25.1
#7 lore raw
In reply to Patrick Delaunay

Hi Patrick,

Quoted 12 lines · Patrick Delaunay

Add a minimal support for STM32MP13 RCC, the reset and clock controller
- update of the RCC MISC driver to bind the correct clock and reset driver
- reset driver, same than STM32MP15x = drivers/reset/stm32-reset.c
- clock driver, add a empty driver for STM32MP13x = drivers/clk/stm32/clk-stm32mp13.c
- Add RCC node in SOC device tree with u-boot,dm-pre-reloc property

This serie is only a preliminary step for STM32MP13 clock and reset support in U-Boot, based on Linux kernel binding introduced by [1] and it prepares the next device tree alignment with Linux kernel.

Quoted 6 lines

The functional STMP13 clock driver based on CCF and on SCMI clocks provided by OP-TEE and the clock and reset references in SOC device tree will be pushed when the associated patches in [1] will be accepted.

[1] Introduction of STM32MP13 RCC driver (Reset Clock Controller)

     https://lore.kernel.org/linux-arm-kernel/[email protected]/

I'm not really sure what the purpose of this series is. Can you elaborate a bit on why we need a dummy clock driver? Why don't you just add the binding to the device tree without the associated driver?

--Sean

#8 lore raw

Hi,

Quoted 20 lines · Sean Anderson

Hi Patrick,

Quoted 17 lines · Patrick Delaunay

Add a minimal support for STM32MP13 RCC, the reset and clock controller
- update of the RCC MISC driver to bind the correct clock and reset driver
- reset driver, same than STM32MP15x = drivers/reset/stm32-reset.c
- clock driver, add a empty driver for STM32MP13x = drivers/clk/stm32/clk-stm32mp13.c
- Add RCC node in SOC device tree with u-boot,dm-pre-reloc property

This serie is only a preliminary step for STM32MP13 clock and reset support in U-Boot, based on Linux kernel binding introduced by [1] and it prepares the next device tree alignment with Linux kernel.

The functional STMP13 clock driver based on CCF and on SCMI clocks provided by OP-TEE and the clock and reset references in SOC device tree will be pushed when the associated patches in [1] will be accepted.

Quoted 7 lines
Quoted 2 lines

[1] Introduction of STM32MP13 RCC driver (Reset Clock Controller)
https://lore.kernel.org/linux-arm-kernel/[email protected]/

I'm not really sure what the purpose of this series is. Can you elaborate a bit on why we need a dummy clock driver? Why don't you just add the binding to the device tree without the associated driver?

After this serie, the RCC reset part is functional on STM32MP13 (probe and ops)

even if the associated binding is not present in device tree.

tested with:

------------------------- arch/arm/dts/stm32mp131.dtsi ------------------------- index fcb0af09b5..d9c6185bcf 100644
@@ -197,6 +197,7 @@
             interrupt-names = "cmd_irq";
             clocks = <&clk_pll4_p>;
             clock-names = "apb_pclk";
+            resets = <&rcc 14224>;
             cap-sd-highspeed;
             cap-mmc-highspeed;
             max-frequency = <130000000>;

A dummy STM32MP13 clock driver is requested to allow RCC MISC and RCC RESET

binding and probe without issue.

This reset support was requested by SDMCC driver and SD-Card boot, before the patch:

http://patchwork.ozlabs.org/project/uboot/patch/20220506160540.13.I39b69e8dc7b43b8e265e77388fb53f7c1fa2a007@changeid/

As we solve the SDMCC dependency issue (reset become optionnal), so this serie is no more mandatory.

This serie is a just a cleanup / preliminary step, but I can drop this dummy RCC driver if it is disturbing.

Quoted 2 lines

--Sean

Patrick

#9 lore raw

Hi Patrick,

Quoted 49 lines · Patrick DELAUNAY

Hi,

Quoted 19 lines · Sean Anderson

Hi Patrick,

Quoted 16 lines · Patrick Delaunay

Add a minimal support for STM32MP13 RCC, the reset and clock controller
- update of the RCC MISC driver to bind the correct clock and reset driver
- reset driver, same than STM32MP15x = drivers/reset/stm32-reset.c
- clock driver, add a empty driver for STM32MP13x = drivers/clk/stm32/clk-stm32mp13.c
- Add RCC node in SOC device tree with u-boot,dm-pre-reloc property

This serie is only a preliminary step for STM32MP13 clock and reset support in U-Boot, based on Linux kernel binding introduced by [1] and it prepares the next device tree alignment with Linux kernel.

The functional STMP13 clock driver based on CCF and on SCMI clocks provided by OP-TEE and the clock and reset references in SOC device tree will be pushed when the associated patches in [1] will be accepted.

Quoted 7 lines
Quoted 2 lines

[1] Introduction of STM32MP13 RCC driver (Reset Clock Controller)
https://lore.kernel.org/linux-arm-kernel/[email protected]/

I'm not really sure what the purpose of this series is. Can you elaborate a bit on why we need a dummy clock driver? Why don't you just add the binding to the device tree without the associated driver?

After this serie, the RCC reset part is functional on STM32MP13 (probe and ops)

even if the associated binding is not present in device tree.

tested with:

------------------------- arch/arm/dts/stm32mp131.dtsi ------------------------- index fcb0af09b5..d9c6185bcf 100644

(quoted diff) +1 -0
@@ -197,6 +197,7 @@
              interrupt-names = "cmd_irq";
              clocks = <&clk_pll4_p>;
              clock-names = "apb_pclk";
+            resets = <&rcc 14224>;
              cap-sd-highspeed;
              cap-mmc-highspeed;
              max-frequency = <130000000>;
Quoted 3 lines

A dummy STM32MP13 clock driver is requested to allow RCC MISC and RCC RESET

binding and probe without issue.

Shouldn't the solution be to make the clock optional in the user?

Quoted 9 lines

This reset support was requested by SDMCC driver and SD-Card boot, before the patch:

http://patchwork.ozlabs.org/project/uboot/patch/20220506160540.13.I39b69e8dc7b43b8e265e77388fb53f7c1fa2a007@changeid/

As we solve the SDMCC dependency issue (reset become optionnal), so this serie is no more mandatory.

This serie is a just a cleanup / preliminary step, but I can drop this dummy RCC driver if it is disturbing.

I would like that, since this is not mandatory.

--Sean