All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH skeleton 0/7] Set default LED status.
@ 2015-11-08  1:20 OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 1/7] LED test OpenBMC Patches
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: OpenBMC Patches @ 2015-11-08  1:20 UTC (permalink / raw)
  To: openbmc

BEEP LED (GPION7) light on for when system has someting abnormal. This LED is used to warning user.
So default is OFF. We will check when this LED on for what event.
BMC_READY LED (GPIOH2) is OFF when standby power active and system power off. So default is OFF.  When system power on, the LED on.
So far user can know the timing of push power button after BEEP LED off. But it needs to wait about 15 seconds. I want  BEEP LED off right after BMC Ready status, can you suggest how can I achive this?

For Identify feature, we use the same LED with BMC_READY LED. Below is the behavior.
Power off, Chassis identify off: BMC_READY LED consistently off 
Power off, Chassis identify on: BMC_READY LED on for 0.1sec, off for 0.9sec, and loop 
Power on, Chassis identify off: BMC_READY LED consistently on 
Power on, Chassis identify on: BMC_READY LED on for 0.9sec, off for 0.1sec, and loop
You may confuse about GPIOR5. FXN BMC will check with EE and implement this part.


https://github.com/openbmc/skeleton/pull/13

Ken (7):
  LED test
  LED test 2
  LED test3
  Remove ;
  Force fan duty to 100%
  Workarounf for fan PWM 100%
  Remove git 1e751075d5a11736df67c40ead5a8375141269d3

 bin/Barreleye.py         | 7 ++++++-
 bin/startup_hacks.sh     | 9 +++++++++
 objects/led_controller.c | 9 +++++++--
 3 files changed, 22 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 objects/led_controller.c

-- 
2.6.3

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH skeleton 1/7] LED test
  2015-11-08  1:20 [PATCH skeleton 0/7] Set default LED status OpenBMC Patches
@ 2015-11-08  1:20 ` OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 2/7] LED test 2 OpenBMC Patches
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: OpenBMC Patches @ 2015-11-08  1:20 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

From: Ken <ken.sk.lai@mail.foxconn.com>

---
 bin/Barreleye.py         |  1 +
 objects/led_controller.c | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 objects/led_controller.c

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 65a6aa4..98d7321 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -408,6 +408,7 @@ GPIO_CONFIG['BMC_READY']   =  { 'gpio_pin': 'H2', 'direction': 'out' }
 GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_pin': 'E0', 'direction': 'both' }
 GPIO_CONFIG['PCIE_RESET']   = { 'gpio_pin': 'B5', 'direction': 'out' }
 GPIO_CONFIG['USB_RESET']    = { 'gpio_pin': 'B6', 'direction': 'out' }
+GPIO_CONFIG['BEEP']    	  =   { 'gpio_pin': 'N7', 'direction': 'out' }
 GPIO_CONFIG['SLOT0_RISER_PRESENT'] =   { 'gpio_pin': 'N0', 'direction': 'in' }
 GPIO_CONFIG['SLOT1_RISER_PRESENT'] =   { 'gpio_pin': 'N1', 'direction': 'in' }
 GPIO_CONFIG['SLOT2_RISER_PRESENT'] =   { 'gpio_pin': 'N2', 'direction': 'in' }
diff --git a/objects/led_controller.c b/objects/led_controller.c
old mode 100644
new mode 100755
index 8c3fa3c..5bb4542
--- a/objects/led_controller.c
+++ b/objects/led_controller.c
@@ -10,11 +10,12 @@ static const gchar* dbus_name        = "org.openbmc.control.led";
 
 static GDBusObjectManagerServer *manager = NULL;
 
-#define  NUM_GPIO 2
+#define  NUM_GPIO 3
 
 GPIO led_gpio[NUM_GPIO] = { 
 	(GPIO){"IDENTIFY"},
-	(GPIO){"BMC_READY"}
+	(GPIO){"BMC_READY"},
+	(GPIO){"BEEP"}
 };
 
 
@@ -67,21 +68,30 @@ on_set_off       (Led          *led,
 	return TRUE;
 }
 
+int tmp=0;
 void init_led(Led* led, GPIO* mygpio)
 {
 	int rc = GPIO_OK;
+	int i=5;
+	tmp++;
 	do {
 		uint8_t val;
 		rc = gpio_open(mygpio);
 		if (rc != GPIO_OK) { break; }
 		rc = gpio_read(mygpio,&val);
 		if (rc != GPIO_OK) { break; }
+		led_set_state(led,"off");
 		if (val == 0) {
 			led_set_state(led,"on");
 		} else {
 			led_set_state(led,"off");
 		}
-	} while(0);
+	i--;
+	} while(i!=0);
+	
+if(tmp==3)
+	led_set_state(led,"off");
+
 	gpio_close(mygpio);
 	if (rc != GPIO_OK) {
 		g_print("ERROR led controller: GPIO error %s (rc=%d)\n",
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH skeleton 2/7] LED test 2
  2015-11-08  1:20 [PATCH skeleton 0/7] Set default LED status OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 1/7] LED test OpenBMC Patches
@ 2015-11-08  1:20 ` OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 3/7] LED test3 OpenBMC Patches
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: OpenBMC Patches @ 2015-11-08  1:20 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

From: Ken <ken.sk.lai@mail.foxconn.com>

---
 bin/Barreleye.py         | 5 +++++
 objects/led_controller.c | 9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 98d7321..783aa88 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -51,6 +51,11 @@ ENTER_STATE_CALLBACK = {
 			'obj_name'   : '/org/openbmc/control/led/BMC_READY',
 			'interface_name' : 'org.openbmc.Led',
 		},
+		'setOn' : {
+			'bus_name'   : 'org.openbmc.control.led',
+			'obj_name'   : '/org/openbmc/control/led/BEEP',
+			'interface_name' : 'org.openbmc.Led',
+		},
 		'init' : {
 			'bus_name'   : 'org.openbmc.control.Flash',
 			'obj_name'   : '/org/openbmc/control/flash/bios',
diff --git a/objects/led_controller.c b/objects/led_controller.c
index 5bb4542..6f773c9 100755
--- a/objects/led_controller.c
+++ b/objects/led_controller.c
@@ -68,13 +68,14 @@ on_set_off       (Led          *led,
 	return TRUE;
 }
 
-int tmp=0;
+//int tmp=0;
 void init_led(Led* led, GPIO* mygpio)
 {
 	int rc = GPIO_OK;
 	int i=5;
-	tmp++;
+//	tmp++;
 	do {
+		sleep(2);
 		uint8_t val;
 		rc = gpio_open(mygpio);
 		if (rc != GPIO_OK) { break; }
@@ -89,8 +90,8 @@ void init_led(Led* led, GPIO* mygpio)
 	i--;
 	} while(i!=0);
 	
-if(tmp==3)
-	led_set_state(led,"off");
+//if(tmp==3)
+//	led_set_state(led,"off");
 
 	gpio_close(mygpio);
 	if (rc != GPIO_OK) {
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH skeleton 3/7] LED test3
  2015-11-08  1:20 [PATCH skeleton 0/7] Set default LED status OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 1/7] LED test OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 2/7] LED test 2 OpenBMC Patches
@ 2015-11-08  1:20 ` OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 4/7] Remove ; OpenBMC Patches
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: OpenBMC Patches @ 2015-11-08  1:20 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

From: Ken <ken.sk.lai@mail.foxconn.com>

---
 objects/led_controller.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/objects/led_controller.c b/objects/led_controller.c
index 6f773c9..24cfc19 100755
--- a/objects/led_controller.c
+++ b/objects/led_controller.c
@@ -68,30 +68,23 @@ on_set_off       (Led          *led,
 	return TRUE;
 }
 
-//int tmp=0;
+
 void init_led(Led* led, GPIO* mygpio)
 {
-	int rc = GPIO_OK;
-	int i=5;
-//	tmp++;
+	int rc = GPIO_OK;;
 	do {
-		sleep(2);
 		uint8_t val;
 		rc = gpio_open(mygpio);
 		if (rc != GPIO_OK) { break; }
 		rc = gpio_read(mygpio,&val);
 		if (rc != GPIO_OK) { break; }
-		led_set_state(led,"off");
 		if (val == 0) {
 			led_set_state(led,"on");
 		} else {
 			led_set_state(led,"off");
 		}
-	i--;
-	} while(i!=0);
+	} while(0);
 	
-//if(tmp==3)
-//	led_set_state(led,"off");
 
 	gpio_close(mygpio);
 	if (rc != GPIO_OK) {
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH skeleton 4/7] Remove ;
  2015-11-08  1:20 [PATCH skeleton 0/7] Set default LED status OpenBMC Patches
                   ` (2 preceding siblings ...)
  2015-11-08  1:20 ` [PATCH skeleton 3/7] LED test3 OpenBMC Patches
@ 2015-11-08  1:20 ` OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 5/7] Force fan duty to 100% OpenBMC Patches
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: OpenBMC Patches @ 2015-11-08  1:20 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

From: Ken <ken.sk.lai@mail.foxconn.com>

---
 objects/led_controller.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/objects/led_controller.c b/objects/led_controller.c
index 24cfc19..34945e1 100755
--- a/objects/led_controller.c
+++ b/objects/led_controller.c
@@ -71,7 +71,8 @@ on_set_off       (Led          *led,
 
 void init_led(Led* led, GPIO* mygpio)
 {
-	int rc = GPIO_OK;;
+	int rc = GPIO_OK;
+
 	do {
 		uint8_t val;
 		rc = gpio_open(mygpio);
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH skeleton 5/7] Force fan duty to 100%
  2015-11-08  1:20 [PATCH skeleton 0/7] Set default LED status OpenBMC Patches
                   ` (3 preceding siblings ...)
  2015-11-08  1:20 ` [PATCH skeleton 4/7] Remove ; OpenBMC Patches
@ 2015-11-08  1:20 ` OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 6/7] Workarounf for fan PWM 100% OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 7/7] Remove git 1e751075d5a11736df67c40ead5a8375141269d3 OpenBMC Patches
  6 siblings, 0 replies; 8+ messages in thread
From: OpenBMC Patches @ 2015-11-08  1:20 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

From: Ken <ken.sk.lai@mail.foxconn.com>

---
 bin/Barreleye.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 783aa88..0e92e83 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -6,6 +6,11 @@ FLASH_DOWNLOAD_PATH = "/tmp"
 GPIO_BASE = 320
 SYSTEM_NAME = "Barreleye"
 
+import sys
+import gobject
+import dbus
+import dbus.service
+import dbus.mainloop.glib
 
 ## System states
 ##   state can change to next state in 2 ways:
@@ -423,6 +428,15 @@ GPIO_CONFIG['SLOT2_PRESENT'] =         { 'gpio_pin': 'N5', 'direction': 'in' }
 GPIO_CONFIG['MEZZ0_PRESENT'] =         { 'gpio_pin': 'O0', 'direction': 'in' }
 GPIO_CONFIG['MEZZ1_PRESENT'] =         { 'gpio_pin': 'O1', 'direction': 'in' }
 
+
+bus = dbus.SystemBus()
+
+for i in range(1,6):
+ print i
+ obj = bus.get_object("org.openbmc,sensors,hwmon","/org/openbmc/sensors/speed/fan"+str(i))
+ intf = dbus.Interface (obj,"org.openbmc.SensorValue")
+ intf.setValue(dbus.UInt32(255))
+
 def convertGpio(name):
 	name = name.upper()
 	c = name[0:1]
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH skeleton 6/7] Workarounf for fan PWM 100%
  2015-11-08  1:20 [PATCH skeleton 0/7] Set default LED status OpenBMC Patches
                   ` (4 preceding siblings ...)
  2015-11-08  1:20 ` [PATCH skeleton 5/7] Force fan duty to 100% OpenBMC Patches
@ 2015-11-08  1:20 ` OpenBMC Patches
  2015-11-08  1:20 ` [PATCH skeleton 7/7] Remove git 1e751075d5a11736df67c40ead5a8375141269d3 OpenBMC Patches
  6 siblings, 0 replies; 8+ messages in thread
From: OpenBMC Patches @ 2015-11-08  1:20 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

From: Ken <ken.sk.lai@mail.foxconn.com>

---
 bin/startup_hacks.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bin/startup_hacks.sh b/bin/startup_hacks.sh
index 5868e8a..603fc1c 100755
--- a/bin/startup_hacks.sh
+++ b/bin/startup_hacks.sh
@@ -11,3 +11,12 @@ echo 0x2e > /sys/bus/i2c/devices/i2c-6/delete_device
 echo nct7904 0x2e > /sys/bus/i2c/devices/i2c-6/new_device
 echo nct7904 0x2d > /sys/bus/i2c/devices/i2c-6/new_device
 
+echo 255 > /sys/class/hwmon/hwmon1/pwm1
+echo 255 > /sys/class/hwmon/hwmon1/pwm2
+echo 255 > /sys/class/hwmon/hwmon1/pwm3
+echo 255 > /sys/class/hwmon/hwmon1/pwm4
+
+echo 255 > /sys/class/hwmon/hwmon2/pwm1
+echo 255 > /sys/class/hwmon/hwmon2/pwm2
+echo 255 > /sys/class/hwmon/hwmon2/pwm3
+echo 255 > /sys/class/hwmon/hwmon2/pwm4
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH skeleton 7/7] Remove git 1e751075d5a11736df67c40ead5a8375141269d3
  2015-11-08  1:20 [PATCH skeleton 0/7] Set default LED status OpenBMC Patches
                   ` (5 preceding siblings ...)
  2015-11-08  1:20 ` [PATCH skeleton 6/7] Workarounf for fan PWM 100% OpenBMC Patches
@ 2015-11-08  1:20 ` OpenBMC Patches
  6 siblings, 0 replies; 8+ messages in thread
From: OpenBMC Patches @ 2015-11-08  1:20 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

From: Ken <ken.sk.lai@mail.foxconn.com>

---
 bin/Barreleye.py | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 0e92e83..64decbf 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -6,12 +6,6 @@ FLASH_DOWNLOAD_PATH = "/tmp"
 GPIO_BASE = 320
 SYSTEM_NAME = "Barreleye"
 
-import sys
-import gobject
-import dbus
-import dbus.service
-import dbus.mainloop.glib
-
 ## System states
 ##   state can change to next state in 2 ways:
 ##   - a process emits a GotoSystemState signal with state name to goto
@@ -428,15 +422,6 @@ GPIO_CONFIG['SLOT2_PRESENT'] =         { 'gpio_pin': 'N5', 'direction': 'in' }
 GPIO_CONFIG['MEZZ0_PRESENT'] =         { 'gpio_pin': 'O0', 'direction': 'in' }
 GPIO_CONFIG['MEZZ1_PRESENT'] =         { 'gpio_pin': 'O1', 'direction': 'in' }
 
-
-bus = dbus.SystemBus()
-
-for i in range(1,6):
- print i
- obj = bus.get_object("org.openbmc,sensors,hwmon","/org/openbmc/sensors/speed/fan"+str(i))
- intf = dbus.Interface (obj,"org.openbmc.SensorValue")
- intf.setValue(dbus.UInt32(255))
-
 def convertGpio(name):
 	name = name.upper()
 	c = name[0:1]
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-11-08  1:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-08  1:20 [PATCH skeleton 0/7] Set default LED status OpenBMC Patches
2015-11-08  1:20 ` [PATCH skeleton 1/7] LED test OpenBMC Patches
2015-11-08  1:20 ` [PATCH skeleton 2/7] LED test 2 OpenBMC Patches
2015-11-08  1:20 ` [PATCH skeleton 3/7] LED test3 OpenBMC Patches
2015-11-08  1:20 ` [PATCH skeleton 4/7] Remove ; OpenBMC Patches
2015-11-08  1:20 ` [PATCH skeleton 5/7] Force fan duty to 100% OpenBMC Patches
2015-11-08  1:20 ` [PATCH skeleton 6/7] Workarounf for fan PWM 100% OpenBMC Patches
2015-11-08  1:20 ` [PATCH skeleton 7/7] Remove git 1e751075d5a11736df67c40ead5a8375141269d3 OpenBMC Patches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.