Skip to contentSkip to conversation

firmware: psci: enable DM_FLAG_PRE_RELOC

PATCH In review Peng Fan (OSS) 3 participants 8 messages Apr 6, 2023 – Apr 26, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 firmware: psci: enable DM_FLAG_PRE_RELOC

From: Peng Fan <[email protected]>

It is possible that cpu core may reset before relocation with PSCI reset

---
 drivers/firmware/psci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/firmware/psci.c +1 -0
index ef3e9836461..c6b9efab41c 100644
@@ -319,4 +319,5 @@ U_BOOT_DRIVER(psci) = {
 #ifdef CONFIG_ARM_SMCCC_FEATURES
 	.plat_auto = sizeof(struct psci_plat_data),
 #endif
+	.flags = DM_FLAG_PRE_RELOC,
 };
Signature · 1 line
2.36.0
#1 lore raw

PATCH 2/3 sysreset: psci: enable DM_FLAG_PRE_RELOC

From: Peng Fan <[email protected]>

It is possible that cpu core may reset before relocation with PSCI reset

---
 drivers/sysreset/sysreset_psci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/sysreset/sysreset_psci.c +1 -0
index 83ecbcb9d2c..30c4b9c1f5d 100644
@@ -34,4 +34,5 @@ U_BOOT_DRIVER(psci_sysreset) = {
 	.name = "psci-sysreset",
 	.id = UCLASS_SYSRESET,
 	.ops = &psci_sysreset_ops,
+	.flags = DM_FLAG_PRE_RELOC,
 };
Signature · 1 line
2.36.0
#2 lore raw

Re: [PATCH 2/3] sysreset: psci: enable DM_FLAG_PRE_RELOC

Quoted 5 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

It is possible that cpu core may reset before relocation with PSCI reset

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#3 lore raw

PATCH 3/3 sysreset: psci: add psci_sysreset_get_status

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Add weak function psci_sysreset_get_status for platform to define their own reset status with CONFIG_SYSRESET enabled.

---
 drivers/sysreset/sysreset_psci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/sysreset/sysreset_psci.c +6 -0
index 30c4b9c1f5d..c9a044b5719 100644
@@ -9,6 +9,11 @@
 #include <linux/errno.h>
 #include <linux/psci.h>
 
+__weak int psci_sysreset_get_status(struct udevice *dev, char *buf, int size)
+{
+	return -EOPNOTSUPP;
+}
+
 static int psci_sysreset_request(struct udevice *dev, enum sysreset_t type)
 {
 	switch (type) {
@@ -28,6 +33,7 @@ static int psci_sysreset_request(struct udevice *dev, enum sysreset_t type)
 
 static struct sysreset_ops psci_sysreset_ops = {
 	.request = psci_sysreset_request,
+	.get_status = psci_sysreset_get_status,
 };
 
 U_BOOT_DRIVER(psci_sysreset) = {
Signature · 1 line
2.36.0
#4 lore raw

Re: [PATCH 3/3] sysreset: psci: add psci_sysreset_get_status

Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Add weak function psci_sysreset_get_status for platform to define their own reset status with CONFIG_SYSRESET enabled.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#5 lore raw
In reply to Peng Fan (OSS)

Tom, Simon,

Sorry for ping early, I have other patches pending on this patchset, just wonder whether you are fine with this patchset.

Thanks,
Peng.

Quoted 22 lines

Subject: [PATCH 1/3] firmware: psci: enable DM_FLAG_PRE_RELOC

From: Peng Fan <[email protected]>

It is possible that cpu core may reset before relocation with PSCI reset

---
 drivers/firmware/psci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/firmware/psci.c index renamed from drivers/firmware/psci.c +0 -0

ef3e9836461..c6b9efab41c 100644

drivers/firmware/psci.c +0 -0
@@ -319,4 +319,5 @@ U_BOOT_DRIVER(psci) = {  #ifdef

CONFIG_ARM_SMCCC_FEATURES

drivers/firmware/psci.c +1 -1
 	.plat_auto = sizeof(struct psci_plat_data),  #endif
+	.flags = DM_FLAG_PRE_RELOC,
 };
--

2.36.0

#6 lore raw
Quoted 4 lines · Peng Fan

Tom, Simon,

Sorry for ping early, I have other patches pending on this patchset, just wonder whether you are fine with this patchset.

This is fine I think.

Quoted 26 lines

Thanks,
Peng.

Quoted 22 lines

Subject: [PATCH 1/3] firmware: psci: enable DM_FLAG_PRE_RELOC

From: Peng Fan <[email protected]>

It is possible that cpu core may reset before relocation with PSCI reset

---
 drivers/firmware/psci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/firmware/psci.c index renamed from drivers/firmware/psci.c +0 -0

ef3e9836461..c6b9efab41c 100644

drivers/firmware/psci.c +0 -0
@@ -319,4 +319,5 @@ U_BOOT_DRIVER(psci) = {  #ifdef

CONFIG_ARM_SMCCC_FEATURES

drivers/firmware/psci.c +1 -1
 	.plat_auto = sizeof(struct psci_plat_data),  #endif
+	.flags = DM_FLAG_PRE_RELOC,
 };
--

2.36.0

Signature · 1 line
Tom