* [PATCH skeleton v3 0/4] Add inventory fan5
@ 2016-01-14 11:50 OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 1/4] " OpenBMC Patches
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: OpenBMC Patches @ 2016-01-14 11:50 UTC (permalink / raw)
To: openbmc
https://github.com/openbmc/skeleton/pull/25
Ken (4):
Add inventory fan5
Initial fan LED status
Remove reboot function in power button, reboot is in reset button.
Solve auto power on issue, confirm GPIO status before send the signal
bin/Barreleye.py | 1 +
bin/chassis_control.py | 5 +----
bin/startup_hacks.sh | 7 +++++++
objects/button_power_obj.c | 37 ++++++++++++++++++++++++-------------
4 files changed, 33 insertions(+), 17 deletions(-)
mode change 100644 => 100755 objects/button_power_obj.c
--
2.6.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH skeleton v3 1/4] Add inventory fan5
2016-01-14 11:50 [PATCH skeleton v3 0/4] Add inventory fan5 OpenBMC Patches
@ 2016-01-14 11:50 ` OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 2/4] Initial fan LED status OpenBMC Patches
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: OpenBMC Patches @ 2016-01-14 11:50 UTC (permalink / raw)
To: openbmc; +Cc: Ken
From: Ken <ken.sk.lai@mail.foxconn.com>
---
bin/Barreleye.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index f068ea1..ec4fab5 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -223,6 +223,7 @@ FRU_INSTANCES = {
'<inventory_root>/system/chassis/fan2' : { 'fru_type' : 'FAN','is_fru' : True, },
'<inventory_root>/system/chassis/fan3' : { 'fru_type' : 'FAN','is_fru' : True, },
'<inventory_root>/system/chassis/fan4' : { 'fru_type' : 'FAN','is_fru' : True, },
+ '<inventory_root>/system/chassis/fan5' : { 'fru_type' : 'FAN','is_fru' : True, },
'<inventory_root>/system/chassis/motherboard/bmc' : { 'fru_type' : 'BMC','is_fru' : False, 'manufacturer' : 'ASPEED' },
--
2.6.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH skeleton v3 2/4] Initial fan LED status
2016-01-14 11:50 [PATCH skeleton v3 0/4] Add inventory fan5 OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 1/4] " OpenBMC Patches
@ 2016-01-14 11:50 ` OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 3/4] Remove reboot function in power button, reboot is in reset button OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 4/4] Solve auto power on issue, confirm GPIO status before send the signal OpenBMC Patches
3 siblings, 0 replies; 6+ messages in thread
From: OpenBMC Patches @ 2016-01-14 11:50 UTC (permalink / raw)
To: openbmc; +Cc: Ken
From: Ken <ken.sk.lai@mail.foxconn.com>
---
bin/startup_hacks.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/bin/startup_hacks.sh b/bin/startup_hacks.sh
index 18582ae..02fd3a8 100755
--- a/bin/startup_hacks.sh
+++ b/bin/startup_hacks.sh
@@ -2,3 +2,10 @@
systemctl stop serial-getty@ttyS0
+# Set to output pin
+i2cset -y 0x06 0x20 0x06 0x00
+i2cset -y 0x06 0x20 0x07 0x00
+
+# Turn on all fan LED to BLUE
+i2cset -y 0x06 0x20 0x03 0x55
+i2cset -y 0x06 0x20 0x02 0xaa
--
2.6.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH skeleton v3 3/4] Remove reboot function in power button, reboot is in reset button.
2016-01-14 11:50 [PATCH skeleton v3 0/4] Add inventory fan5 OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 1/4] " OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 2/4] Initial fan LED status OpenBMC Patches
@ 2016-01-14 11:50 ` OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 4/4] Solve auto power on issue, confirm GPIO status before send the signal OpenBMC Patches
3 siblings, 0 replies; 6+ messages in thread
From: OpenBMC Patches @ 2016-01-14 11:50 UTC (permalink / raw)
To: openbmc; +Cc: Ken
From: Ken <ken.sk.lai@mail.foxconn.com>
---
bin/chassis_control.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/bin/chassis_control.py b/bin/chassis_control.py
index 27e9152..0a0b44d 100755
--- a/bin/chassis_control.py
+++ b/bin/chassis_control.py
@@ -57,9 +57,6 @@ class ChassisControlObject(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
bus.add_signal_receiver(self.power_button_signal_handler,
dbus_interface = "org.openbmc.Button", signal_name = "Released",
path="/org/openbmc/buttons/power0" )
- bus.add_signal_receiver(self.reset_button_signal_handler,
- dbus_interface = "org.openbmc.Button", signal_name = "PressedLong",
- path="/org/openbmc/buttons/power0" )
bus.add_signal_receiver(self.softreset_button_signal_handler,
dbus_interface = "org.openbmc.Button", signal_name = "Released",
path="/org/openbmc/buttons/reset0" )
@@ -184,7 +181,7 @@ class ChassisControlObject(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
self.reboot();
def softreset_button_signal_handler(self):
- self.softReboot();
+ self.reboot();
def host_watchdog_signal_handler(self):
print "Watchdog Error, Hard Rebooting"
--
2.6.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH skeleton v3 4/4] Solve auto power on issue, confirm GPIO status before send the signal
2016-01-14 11:50 [PATCH skeleton v3 0/4] Add inventory fan5 OpenBMC Patches
` (2 preceding siblings ...)
2016-01-14 11:50 ` [PATCH skeleton v3 3/4] Remove reboot function in power button, reboot is in reset button OpenBMC Patches
@ 2016-01-14 11:50 ` OpenBMC Patches
2016-01-18 22:58 ` Cyril Bur
3 siblings, 1 reply; 6+ messages in thread
From: OpenBMC Patches @ 2016-01-14 11:50 UTC (permalink / raw)
To: openbmc; +Cc: Ken
From: Ken <ken.sk.lai@mail.foxconn.com>
---
objects/button_power_obj.c | 37 ++++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 13 deletions(-)
mode change 100644 => 100755 objects/button_power_obj.c
diff --git a/objects/button_power_obj.c b/objects/button_power_obj.c
old mode 100644
new mode 100755
index 94f8922..4c986a1
--- a/objects/button_power_obj.c
+++ b/objects/button_power_obj.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <stdlib.h>
#include "interfaces/openbmc_intf.h"
#include "gpio.h"
#include "openbmc.h"
@@ -42,7 +43,11 @@ on_button_interrupt( GIOChannel *channel,
GError *error = 0;
gsize bytes_read = 0;
- gchar buf[2];
+ gchar buf[2];
+
+ uint8_t val;
+ int rc1 = GPIO_OK;
+
buf[1] = '\0';
g_io_channel_seek_position( channel, 0, G_SEEK_SET, 0 );
GIOStatus rc = g_io_channel_read_chars( channel,
@@ -50,7 +55,7 @@ on_button_interrupt( GIOChannel *channel,
&bytes_read,
&error );
printf("%s\n",buf);
-
+
time_t current_time = time(NULL);
if (gpio_button.irq_inited)
{
@@ -65,19 +70,25 @@ on_button_interrupt( GIOChannel *channel,
{
long press_time = current_time-button_get_timer(button);
printf("Power Button released, held for %ld seconds\n",press_time);
- if (press_time > LONG_PRESS_SECONDS)
- {
- button_emit_pressed_long(button);
- } else {
- button_emit_released(button);
- }
+ // if (press_time > LONG_PRESS_SECONDS)
+ // {
+ // button_emit_pressed_long(button);
+ // } else {
+ rc1 = gpio_open(&gpio_button);
+ rc1 = gpio_read(&gpio_button,&val);
+ if (val == 1)
+ button_emit_released(button);
+
+ // if (press_time > 1)
+ // sleep(1);
+ //}
}
- }
+ }
else { gpio_button.irq_inited = true; }
return TRUE;
}
-static void
+static void
on_bus_acquired (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
@@ -110,7 +121,7 @@ on_bus_acquired (GDBusConnection *connection,
G_CALLBACK (on_button_press),
NULL); /* user_data */
-
+
/* Export the object (@manager takes its own reference to @object) */
g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
g_object_unref (object);
@@ -130,7 +141,7 @@ on_bus_acquired (GDBusConnection *connection,
{
printf("ERROR PowerButton: GPIO setup (rc=%d)\n",rc);
}
- emit_object_added((GDBusObjectManager*)manager);
+ emit_object_added((GDBusObjectManager*)manager);
}
static void
@@ -171,7 +182,7 @@ main (gint argc, gchar *argv[])
NULL);
g_main_loop_run (loop);
-
+
g_bus_unown_name (id);
g_main_loop_unref (loop);
return 0;
--
2.6.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH skeleton v3 4/4] Solve auto power on issue, confirm GPIO status before send the signal
2016-01-14 11:50 ` [PATCH skeleton v3 4/4] Solve auto power on issue, confirm GPIO status before send the signal OpenBMC Patches
@ 2016-01-18 22:58 ` Cyril Bur
0 siblings, 0 replies; 6+ messages in thread
From: Cyril Bur @ 2016-01-18 22:58 UTC (permalink / raw)
To: OpenBMC Patches; +Cc: openbmc, Ken
On Thu, 14 Jan 2016 05:50:37 -0600
OpenBMC Patches <openbmc-patches@stwcx.xyz> wrote:
> From: Ken <ken.sk.lai@mail.foxconn.com>
>
Hi Ken,
Just a few comments mostly around style here, Jeremy has gone to some effort to
put up some docs on guidelines to follow when sending patches:
https://github.com/openbmc/docs/blob/master/contributing.md
Please be careful with whitespace changes, you have a few lines in your diff
that are functionally equivalent but just change whitespace.
If you do want to clean up whitespace problems, no objections but please have
them changes in a separate patch.
> ---
> objects/button_power_obj.c | 37 ++++++++++++++++++++++++-------------
> 1 file changed, 24 insertions(+), 13 deletions(-)
> mode change 100644 => 100755 objects/button_power_obj.c
>
> diff --git a/objects/button_power_obj.c b/objects/button_power_obj.c
> old mode 100644
> new mode 100755
> index 94f8922..4c986a1
> --- a/objects/button_power_obj.c
> +++ b/objects/button_power_obj.c
> @@ -1,4 +1,5 @@
> #include <stdio.h>
> +#include <stdlib.h>
> #include "interfaces/openbmc_intf.h"
> #include "gpio.h"
> #include "openbmc.h"
> @@ -42,7 +43,11 @@ on_button_interrupt( GIOChannel *channel,
>
> GError *error = 0;
> gsize bytes_read = 0;
> - gchar buf[2];
> + gchar buf[2];
> +
> + uint8_t val;
> + int rc1 = GPIO_OK;
> +
> buf[1] = '\0';
> g_io_channel_seek_position( channel, 0, G_SEEK_SET, 0 );
> GIOStatus rc = g_io_channel_read_chars( channel,
> @@ -50,7 +55,7 @@ on_button_interrupt( GIOChannel *channel,
> &bytes_read,
> &error );
> printf("%s\n",buf);
> -
> +
> time_t current_time = time(NULL);
> if (gpio_button.irq_inited)
> {
> @@ -65,19 +70,25 @@ on_button_interrupt( GIOChannel *channel,
> {
> long press_time = current_time-button_get_timer(button);
> printf("Power Button released, held for %ld seconds\n",press_time);
> - if (press_time > LONG_PRESS_SECONDS)
> - {
> - button_emit_pressed_long(button);
> - } else {
> - button_emit_released(button);
> - }
> + // if (press_time > LONG_PRESS_SECONDS)
> + // {
> + // button_emit_pressed_long(button);
> + // } else {
The benefit of using version control is that code can simply be deleted when it
is need to be non functional but will exist forever in the history and can
easily be looked up if/when it is needed again.
If you want to remove code even temporarily, please delete it.
> + rc1 = gpio_open(&gpio_button);
> + rc1 = gpio_read(&gpio_button,&val);
> + if (val == 1)
> + button_emit_released(button);
Please indent.
> +
> + // if (press_time > 1)
> + // sleep(1);
> + //}
> }
> - }
> + }
> else { gpio_button.irq_inited = true; }
>
> return TRUE;
> }
> -static void
> +static void
> on_bus_acquired (GDBusConnection *connection,
> const gchar *name,
> gpointer user_data)
> @@ -110,7 +121,7 @@ on_bus_acquired (GDBusConnection *connection,
> G_CALLBACK (on_button_press),
> NULL); /* user_data */
>
> -
> +
> /* Export the object (@manager takes its own reference to @object) */
> g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
> g_object_unref (object);
> @@ -130,7 +141,7 @@ on_bus_acquired (GDBusConnection *connection,
> {
> printf("ERROR PowerButton: GPIO setup (rc=%d)\n",rc);
> }
> - emit_object_added((GDBusObjectManager*)manager);
> + emit_object_added((GDBusObjectManager*)manager);
> }
>
> static void
> @@ -171,7 +182,7 @@ main (gint argc, gchar *argv[])
> NULL);
>
> g_main_loop_run (loop);
> -
> +
> g_bus_unown_name (id);
> g_main_loop_unref (loop);
> return 0;
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-01-18 22:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-14 11:50 [PATCH skeleton v3 0/4] Add inventory fan5 OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 1/4] " OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 2/4] Initial fan LED status OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 3/4] Remove reboot function in power button, reboot is in reset button OpenBMC Patches
2016-01-14 11:50 ` [PATCH skeleton v3 4/4] Solve auto power on issue, confirm GPIO status before send the signal OpenBMC Patches
2016-01-18 22:58 ` Cyril Bur
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.