Skip to contentSkip to conversation

stm32mp: bsec: manage clock when present in device tree

PATCH New Patrick Delaunay 2 participants 3 messages Feb 25, 2021 – Mar 12, 2021

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

PATCH 1/1 stm32mp: bsec: manage clock when present in device tree

Enable the clocks during bsec probe when they are present in device tree.

---

 arch/arm/mach-stm32mp/bsec.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/mach-stm32mp/bsec.c +10 -0
index 88c7aec8b4..fe39bd80cf 100644
@@ -6,6 +6,7 @@
 #define LOG_CATEGORY UCLASS_MISC
 
 #include <common.h>
+#include <clk.h>
 #include <dm.h>
 #include <log.h>
 #include <misc.h>
@@ -490,6 +491,15 @@ static int stm32mp_bsec_probe(struct udevice *dev)
 {
 	int otp;
 	struct stm32mp_bsec_plat *plat;
+	struct clk_bulk clk_bulk;
+	int ret;
+
+	ret = clk_get_bulk(dev, &clk_bulk);
+	if (!ret) {
+		ret = clk_enable_bulk(&clk_bulk);
+		if (ret)
+			return ret;
+	}
 
 	/*
 	 * update unlocked shadow for OTP cleared by the rom code
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 stm32mp: bsec: manage clock when present in device tree

Hi Patrick

Quoted 27 lines · Patrick Delaunay

Enable the clocks during bsec probe when they are present in device tree.

---

 arch/arm/mach-stm32mp/bsec.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/mach-stm32mp/bsec.c +3 -0
index 88c7aec8b4..fe39bd80cf 100644
@@ -6,6 +6,7 @@
 #define LOG_CATEGORY UCLASS_MISC
 
 #include <common.h>
+#include <clk.h>
 #include <dm.h>
 #include <log.h>
 #include <misc.h>
@@ -490,6 +491,15 @@ static int stm32mp_bsec_probe(struct udevice *dev)
 {
 	int otp;
 	struct stm32mp_bsec_plat *plat;
+	struct clk_bulk clk_bulk;
+	int ret;

arch/arm/mach-stm32mp/bsec.c static int stm32mp_bsec_probe(struct udevice *dev) · line 505

Quoted 10 lines
arch/arm/mach-stm32mp/bsec.c +7 -0
+
+	ret = clk_get_bulk(dev, &clk_bulk);
+	if (!ret) {
+		ret = clk_enable_bulk(&clk_bulk);
+		if (ret)
+			return ret;
+	}
 
 	/*
 	 * update unlocked shadow for OTP cleared by the rom code

Thanks
Patrice

#2 lore raw

PATCH 1/1 stm32mp: bsec: manage clock when present in device tree

Hi

Quoted 37 lines · Patrice CHOTARD

Hi Patrick

Quoted 34 lines · Patrick Delaunay

Enable the clocks during bsec probe when they are present in device tree.

---

 arch/arm/mach-stm32mp/bsec.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/mach-stm32mp/bsec.c +10 -0
index 88c7aec8b4..fe39bd80cf 100644
@@ -6,6 +6,7 @@
 #define LOG_CATEGORY UCLASS_MISC
 
 #include <common.h>
+#include <clk.h>
 #include <dm.h>
 #include <log.h>
 #include <misc.h>
@@ -490,6 +491,15 @@ static int stm32mp_bsec_probe(struct udevice *dev)
 {
 	int otp;
 	struct stm32mp_bsec_plat *plat;
+	struct clk_bulk clk_bulk;
+	int ret;
+
+	ret = clk_get_bulk(dev, &clk_bulk);
+	if (!ret) {
+		ret = clk_enable_bulk(&clk_bulk);
+		if (ret)
+			return ret;
+	}
 
Quoted 8 lines

arch/arm/mach-stm32mp/bsec.c static int stm32mp_bsec_probe(struct udevice *dev) · line 505

Quoted 3 lines
arch/arm/mach-stm32mp/bsec.c +0 -0
 	/*
 	 * update unlocked shadow for OTP cleared by the rom code

Thanks
Patrice

Applied to u-boot-stm/next

Thanks

Patrice