Skip to contentSkip to conversation

platform/chrome: cros_ec: Add host command to keep AP off after EC reset.

PATCH Superseded Pi-Hsun Shih 2 participants 3 messages Dec 17, 2020 – Dec 18, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 platform/chrome: cros_ec: Add host command to keep AP off after EC reset.

Add command to EC_CMD_REBOOT_EC to reset EC but don't boot AP.

---

The corresponding changes in ChromeOS EC firmware is at crrev.com/c/2428361

---
 include/linux/platform_data/cros_ec_commands.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/platform_data/cros_ec_commands.h +1 -0
index a3a9a878415f..b80a4a7038e4 100644
@@ -4729,6 +4729,7 @@ enum ec_reboot_cmd {
 	EC_REBOOT_DISABLE_JUMP = 5,  /* Disable jump until next reboot */
 	EC_REBOOT_HIBERNATE = 6,     /* Hibernate EC */
 	EC_REBOOT_HIBERNATE_CLEAR_AP_OFF = 7, /* and clears AP_OFF flag */
+	EC_REBOOT_COLD_AP_OFF = 8,   /* Cold-reboot and don't boot AP */
 };
 
 /* Flags for ec_params_reboot_ec.reboot_flags */

base-commit: accefff5b547a9a1d959c7e76ad539bf2480e78b

Signature · 1 line
2.29.2.684.gfbc64c5ab5-goog
#1 lore raw

PATCH 2/2 platform/chrome: cros_ec_sysfs: Add cold-ap-off to sysfs reboot.

---
 drivers/platform/chrome/cros_ec_sysfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_sysfs.c +2 -1
index f521a5c65091..8210fb10e839 100644
@@ -28,7 +28,7 @@ static ssize_t reboot_show(struct device *dev,
 	int count = 0;
 
 	count += scnprintf(buf + count, PAGE_SIZE - count,
-			   "ro|rw|cancel|cold|disable-jump|hibernate");
+			   "ro|rw|cancel|cold|disable-jump|hibernate|cold-ap-off");
 	count += scnprintf(buf + count, PAGE_SIZE - count,
 			   " [at-shutdown]\n");
 	return count;
@@ -46,6 +46,7 @@ static ssize_t reboot_store(struct device *dev,
 		{"cancel",       EC_REBOOT_CANCEL, 0},
 		{"ro",           EC_REBOOT_JUMP_RO, 0},
 		{"rw",           EC_REBOOT_JUMP_RW, 0},
+		{"cold-ap-off",  EC_REBOOT_COLD_AP_OFF, 0},
 		{"cold",         EC_REBOOT_COLD, 0},
 		{"disable-jump", EC_REBOOT_DISABLE_JUMP, 0},
 		{"hibernate",    EC_REBOOT_HIBERNATE, 0},
Signature · 1 line
2.29.2.684.gfbc64c5ab5-goog
#2 lore raw

Re: [PATCH 2/2] platform/chrome: cros_ec_sysfs: Add cold-ap-off to sysfs reboot.

Hi Pi-Hsun,

Thank you for your patch. I don't accept patches with an empty commit description. Can you add it? (maybe you could just explain more what cold-ap-off means here. Apart from this, the patch LGTM.

Thanks,
Enric

Quoted 27 lines · Pi-Hsun Shih
---
 drivers/platform/chrome/cros_ec_sysfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_sysfs.c +2 -1
index f521a5c65091..8210fb10e839 100644
@@ -28,7 +28,7 @@ static ssize_t reboot_show(struct device *dev,
 	int count = 0;
 
 	count += scnprintf(buf + count, PAGE_SIZE - count,
-			   "ro|rw|cancel|cold|disable-jump|hibernate");
+			   "ro|rw|cancel|cold|disable-jump|hibernate|cold-ap-off");
 	count += scnprintf(buf + count, PAGE_SIZE - count,
 			   " [at-shutdown]\n");
 	return count;
@@ -46,6 +46,7 @@ static ssize_t reboot_store(struct device *dev,
 		{"cancel",       EC_REBOOT_CANCEL, 0},
 		{"ro",           EC_REBOOT_JUMP_RO, 0},
 		{"rw",           EC_REBOOT_JUMP_RW, 0},
+		{"cold-ap-off",  EC_REBOOT_COLD_AP_OFF, 0},
 		{"cold",         EC_REBOOT_COLD, 0},
 		{"disable-jump", EC_REBOOT_DISABLE_JUMP, 0},
 		{"hibernate",    EC_REBOOT_HIBERNATE, 0},