Skip to content

Commit 4a1b447

Browse files
committed
SOL start/stop added with Host power contol
Some of the SH5 system was capturing junc data while Host is off. To prevent junc data caprute, SOL start stop is added with Host power controle. Signed-off-by: Vinu Vaghasia <[email protected]> Change-Id: I92947b06b22fe9aa2fc406720b5bc25d3a1a8f2c
1 parent 0457fe4 commit 4a1b447

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
From 376353f1493e16d0464160c4078a224e7a7f1d44 Mon Sep 17 00:00:00 2001
2+
Message-Id: <376353f1493e16d0464160c4078a224e7a7f1d44.1704743427.git.vinu.vaghasia@amd.com>
3+
From: Vinu Vaghasia <[email protected]>
4+
Date: Mon, 8 Jan 2024 13:22:37 -0600
5+
Subject: [PATCH] amd-power-control: modify SOL service start stop added with
6+
power control
7+
8+
SOL service start/stop control added with Host power control to avoid
9+
the junk character being captured from serial port while Host is power
10+
off.
11+
12+
Signed-off-by: Vinu Vaghasia <[email protected]>
13+
---
14+
power-control-x86/src/power_control.cpp | 17 +++++++++++++++++
15+
1 file changed, 17 insertions(+)
16+
17+
diff --git a/power-control-x86/src/power_control.cpp b/power-control-x86/src/power_control.cpp
18+
index ddd4c1e..6f29431 100644
19+
--- a/power-control-x86/src/power_control.cpp
20+
+++ b/power-control-x86/src/power_control.cpp
21+
@@ -860,18 +860,35 @@ static int setGPIOOutputForMs(const std::string& name, const int value,
22+
return 0;
23+
}
24+
25+
+static void stopSOLservice()
26+
+{
27+
+ system("/bin/systemctl mask [email protected] [email protected]");
28+
+ system("/bin/systemctl stop [email protected] [email protected]");
29+
+ std::cerr << "SOL service stopped as Host powered off\n";
30+
+}
31+
+
32+
+static void startSOLservice()
33+
+{
34+
+ system("/bin/systemctl unmask [email protected] [email protected]");
35+
+ system("/bin/systemctl start [email protected] [email protected]");
36+
+ std::cerr << "SOL service started as Host powering on/n";
37+
+}
38+
+
39+
static void powerOn()
40+
{
41+
setGPIOOutputForMs("ASSERT_PWR_BTN_L", 0, powerPulseTimeMs);
42+
+ startSOLservice();
43+
}
44+
45+
static void gracefulPowerOff()
46+
{
47+
+ stopSOLservice();
48+
setGPIOOutputForMs("ASSERT_PWR_BTN_L", 0, powerPulseTimeMs);
49+
}
50+
51+
static void forcePowerOff()
52+
{
53+
+ stopSOLservice();
54+
setGPIOOutputForMs("ASSERT_PWR_BTN_L", 0, forceOffPulseTimeMs);
55+
return;
56+
}
57+
--
58+
2.17.1
59+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
DESCRIPTION_sh5 = "SOL start/stop with Host Power ON/Off for MI300A SH5 platform"
2+
3+
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
4+
SRC_URI += "file://0001-amd-power-control-modify-SOL-service-start-stop-add.patch"
5+

0 commit comments

Comments
 (0)