All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors.
@ 2015-12-18 23:40 OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 01/15] Set default LED status, pull high BMC_Throttle OpenBMC Patches
                   ` (14 more replies)
  0 siblings, 15 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc

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

Ken (10):
  Set default LED status, pull high BMC_Throttle
  Init GPIO Thottle, add BMC heartbeat, change power LED status
  Fix THROTTLE typo:
  sync to 14caa527e0b10e0aece119693bf003ec95929370
  Add all voltage sensors
  remove in15_input sensor
  Remove setblinkslow
  Add all voltage sensors
  remove in15_input sensor
  Add reset button

Norman James (5):
  use real names for occ sensors
  add introspect=False to get_object calls for performance
  add new flash ids
  new process to discover initial power state on bmc reboot
  add softreboot

 Makefile                           |   6 +-
 bin/Barreleye.py                   | 296 +++++++++++++++++++++++--------------
 bin/chassis_control.py             |  10 +-
 bin/discover_system_state.py       |  49 ++++++
 bin/fan_control.py                 |   2 +-
 bin/hwmon.py                       |  94 +++++++-----
 bin/obmcutil                       |   2 +-
 bin/system_manager.py              |   2 +-
 includes/gpio.c                    |   0
 objects/button_reset_obj.c         | 179 ++++++++++++++++++++++
 objects/control_bmc_obj.c          |   1 +
 objects/control_host_obj.c         |   5 +
 objects/led_controller.c           |   6 +-
 objects/pflash/libflash/libflash.c |   6 +
 14 files changed, 504 insertions(+), 154 deletions(-)
 mode change 100644 => 100755 Makefile
 create mode 100755 bin/discover_system_state.py
 mode change 100644 => 100755 includes/gpio.c
 create mode 100755 objects/button_reset_obj.c
 mode change 100644 => 100755 objects/control_host_obj.c
 mode change 100644 => 100755 objects/led_controller.c

-- 
2.6.3

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

* [PATCH skeleton 01/15] Set default LED status, pull high BMC_Throttle
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 02/15] Init GPIO Thottle, add BMC heartbeat, change power LED status OpenBMC Patches
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

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

---
 bin/Barreleye.py           | 15 +++++++++++++++
 objects/control_host_obj.c |  4 ++++
 objects/led_controller.c   |  6 ++++--
 3 files changed, 23 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 objects/control_host_obj.c
 mode change 100644 => 100755 objects/led_controller.c

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 306f293..2006c83 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -62,6 +62,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',
@@ -500,6 +505,16 @@ 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['HEART_BEAT']       = { 'gpio_pin': 'R4', 'direction': 'out' }
+GPIO_CONFIG['BMC_THROTTLE']       = { 'gpio_pin': 'J3', 'direction': 'out' }
+GPIO_CONFIG['RESET_BUTTON']       = { 'gpio_pin': 'E2', 'direction': 'both' }
+GPIO_CONFIG['CPLD_TCK']    	  =   { 'gpio_pin': 'P0', 'direction': 'out' }
+GPIO_CONFIG['CPLD_TDO']    	  =   { 'gpio_pin': 'P1', 'direction': 'out' }
+GPIO_CONFIG['CPLD_TDI']    	  =   { 'gpio_pin': 'P2', 'direction': 'out' }
+GPIO_CONFIG['CPLD_TMS']    	  =   { 'gpio_pin': 'P3', '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/control_host_obj.c b/objects/control_host_obj.c
old mode 100644
new mode 100755
index 672ef85..79d375b
--- a/objects/control_host_obj.c
+++ b/objects/control_host_obj.c
@@ -21,6 +21,7 @@ GPIO fsi_data     = (GPIO){ "FSI_DATA" };
 GPIO fsi_clk      = (GPIO){ "FSI_CLK" };
 GPIO fsi_enable   = (GPIO){ "FSI_ENABLE" };
 GPIO cronus_sel   = (GPIO){ "CRONUS_SEL" };
+GPIO Throttle   = (GPIO){ "BMC_TROTTLE" };
 
 /* Bit bang patterns */
 
@@ -102,12 +103,14 @@ on_boot         (ControlHost        *host,
 		rc |= gpio_open(&fsi_data);
 		rc |= gpio_open(&fsi_enable);
 		rc |= gpio_open(&cronus_sel);
+		rc |= gpio_open(&Throttle);
 		if (rc!=GPIO_OK) { break; }
 
 		//setup dc pins		
 		rc = gpio_write(&cronus_sel,1);
 		rc |= gpio_write(&fsi_enable,1);
 		rc |= gpio_write(&fsi_clk,1);
+		rc |= gpio_write(&Throttle,1);
 		if (rc!=GPIO_OK) { break; }
 
 		//data standy state
@@ -165,6 +168,7 @@ on_boot         (ControlHost        *host,
 	gpio_close(&fsi_data);
 	gpio_close(&fsi_enable);
 	gpio_close(&cronus_sel);
+	gpio_close(&Throttle);
 
 	control_host_emit_booted(host);
 	return TRUE;
diff --git a/objects/led_controller.c b/objects/led_controller.c
old mode 100644
new mode 100755
index 8c3fa3c..1240b30
--- a/objects/led_controller.c
+++ b/objects/led_controller.c
@@ -10,11 +10,13 @@ static const gchar* dbus_name        = "org.openbmc.control.led";
 
 static GDBusObjectManagerServer *manager = NULL;
 
-#define  NUM_GPIO 2
+#define  NUM_GPIO 4
 
 GPIO led_gpio[NUM_GPIO] = { 
 	(GPIO){"IDENTIFY"},
-	(GPIO){"BMC_READY"}
+	(GPIO){"BMC_READY"},
+	(GPIO){"BEEP"},
+    (GPIO){"HEART_BEAT"}
 };
 
 
-- 
2.6.3

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

* [PATCH skeleton 02/15] Init GPIO Thottle, add BMC heartbeat, change power LED status
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 01/15] Set default LED status, pull high BMC_Throttle OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 03/15] Fix THROTTLE typo: OpenBMC Patches
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

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

---
 bin/Barreleye.py           | 22 ++++++++++++++++++----
 includes/gpio.c            |  0
 objects/control_host_obj.c |  1 +
 3 files changed, 19 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 includes/gpio.c

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 2006c83..01931c9 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -54,24 +54,38 @@ ENTER_STATE_CALLBACK = {
 			'bus_name'    : 'org.openbmc.control.Fans',
 			'obj_name'    : '/org/openbmc/control/fans',
 			'interface_name' : 'org.openbmc.control.Fans',
+		},
+		'setOn' : {
+			'bus_name'   : 'org.openbmc.control.led',
+			'obj_name'   : '/org/openbmc/control/led/BMC_READY',
+			'interface_name' : 'org.openbmc.Led',
 		}
 	},
-	'BMC_READY' : {
-		'setOn' : {
+	'HOST_POWERED_OFF' : {
+		'setOff' : {
 			'bus_name'   : 'org.openbmc.control.led',
 			'obj_name'   : '/org/openbmc/control/led/BMC_READY',
 			'interface_name' : 'org.openbmc.Led',
-		},
+		}
+
+	},
+	'BMC_READY' : {
 		'setOn' : {
 			'bus_name'   : 'org.openbmc.control.led',
 			'obj_name'   : '/org/openbmc/control/led/BEEP',
 			'interface_name' : 'org.openbmc.Led',
 		},
+		'setBlinkSlow' : {
+			'bus_name'   : 'org.openbmc.control.led',
+			'obj_name'   : '/org/openbmc/control/led/HEART_BEAT',
+			'interface_name' : 'org.openbmc.Led',
+		},
+
 		'init' : {
 			'bus_name'   : 'org.openbmc.control.Flash',
 			'obj_name'   : '/org/openbmc/control/flash/bios',
 			'interface_name' : 'org.openbmc.Flash',
-		},
+		}
 	}
 }
 
diff --git a/includes/gpio.c b/includes/gpio.c
old mode 100644
new mode 100755
diff --git a/objects/control_host_obj.c b/objects/control_host_obj.c
index 79d375b..56b02de 100755
--- a/objects/control_host_obj.c
+++ b/objects/control_host_obj.c
@@ -225,6 +225,7 @@ on_bus_acquired (GDBusConnection *connection,
 	gpio_init(connection,&fsi_clk);
 	gpio_init(connection,&fsi_enable);
 	gpio_init(connection,&cronus_sel);
+	gpio_init(connection,&Throttle);
 	emit_object_added((GDBusObjectManager*)manager); 	
 }
 
-- 
2.6.3

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

* [PATCH skeleton 03/15] Fix THROTTLE typo:
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 01/15] Set default LED status, pull high BMC_Throttle OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 02/15] Init GPIO Thottle, add BMC heartbeat, change power LED status OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-23  1:09   ` Stewart Smith
  2015-12-18 23:40 ` [PATCH skeleton 04/15] sync to 14caa527e0b10e0aece119693bf003ec95929370 OpenBMC Patches
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

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

---
 objects/control_host_obj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/objects/control_host_obj.c b/objects/control_host_obj.c
index 56b02de..ac72b6e 100755
--- a/objects/control_host_obj.c
+++ b/objects/control_host_obj.c
@@ -21,7 +21,7 @@ GPIO fsi_data     = (GPIO){ "FSI_DATA" };
 GPIO fsi_clk      = (GPIO){ "FSI_CLK" };
 GPIO fsi_enable   = (GPIO){ "FSI_ENABLE" };
 GPIO cronus_sel   = (GPIO){ "CRONUS_SEL" };
-GPIO Throttle   = (GPIO){ "BMC_TROTTLE" };
+GPIO Throttle     = (GPIO){ "BMC_THROTTLE" };
 
 /* Bit bang patterns */
 
-- 
2.6.3

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

* [PATCH skeleton 04/15] sync to 14caa527e0b10e0aece119693bf003ec95929370
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (2 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 03/15] Fix THROTTLE typo: OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 05/15] Add all voltage sensors OpenBMC Patches
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

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

---
 objects/control_bmc_obj.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/objects/control_bmc_obj.c b/objects/control_bmc_obj.c
index ae2827e..6b92235 100644
--- a/objects/control_bmc_obj.c
+++ b/objects/control_bmc_obj.c
@@ -85,6 +85,7 @@ void reg_init()
 	//GPIO
 	bmcreg = memmap(mem_fd,GPIO_BASE);
 	devmem(bmcreg+0x84,0x00fff0c0);  //Enable UART1
+        devmem(bmcreg+0x70,0x120CE406);
 	devmem(bmcreg+0x80,0xCB000000);
 	devmem(bmcreg+0x88,0x01C000FF);
 	devmem(bmcreg+0x8c,0xC1C000FF);
-- 
2.6.3

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

* [PATCH skeleton 05/15] Add all voltage sensors
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (3 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 04/15] sync to 14caa527e0b10e0aece119693bf003ec95929370 OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 06/15] remove in15_input sensor OpenBMC Patches
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

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

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

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 01931c9..303b25c 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -555,11 +555,43 @@ HWMON_CONFIG = {
 		'pwm1' : { 'object_path' : 'speed/fan0','poll_interval' : 10000,'scale' : 1,'units' : '' },
 		'pwm2' : { 'object_path' : 'speed/fan1','poll_interval' : 10000,'scale' : 1,'units' : '' },
 		'pwm3' : { 'object_path' : 'speed/fan2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+		'in1_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in2_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in3_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in4_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in5_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in6_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in7_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in8_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in9_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+		'in10_input' : { 'object_path' : 'voltage/P0V97_CPU0','poll_interval' : 10000,'scale' : 1,'units' : '' },
+		'in11_input' : { 'object_path' : 'voltage/P1V1_MEM0','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in12_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in13_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in14_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in15_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+
 	},
 	'6-002e' : {
 		'pwm1' : { 'object_path' : 'speed/fan3','poll_interval' : 10000,'scale' : 1,'units' : '' },
 		'pwm2' : { 'object_path' : 'speed/fan4','poll_interval' : 10000,'scale' : 1,'units' : '' },
 		'pwm3' : { 'object_path' : 'speed/fan5','poll_interval' : 10000,'scale' : 1,'units' : '' },
+		'in1_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in2_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in3_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in4_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in5_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in6_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in7_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in8_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in9_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in10_input' : { 'object_path' : 'voltage/P0V97_CPU1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in11_input' : { 'object_path' : 'voltage/P1V1_MEM1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in12_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in13_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in14_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in15_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+
 	},
 	'3-0050' : {
 		'temp1_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-- 
2.6.3

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

* [PATCH skeleton 06/15] remove in15_input sensor
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (4 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 05/15] Add all voltage sensors OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 07/15] Remove setblinkslow OpenBMC Patches
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

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

---
 bin/Barreleye.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 303b25c..ff6fdcc 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -569,9 +569,7 @@ HWMON_CONFIG = {
                 'in12_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
                 'in13_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
                 'in14_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in15_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
-
-	},
+ 	},
 	'6-002e' : {
 		'pwm1' : { 'object_path' : 'speed/fan3','poll_interval' : 10000,'scale' : 1,'units' : '' },
 		'pwm2' : { 'object_path' : 'speed/fan4','poll_interval' : 10000,'scale' : 1,'units' : '' },
@@ -590,9 +588,7 @@ HWMON_CONFIG = {
                 'in12_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
                 'in13_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
                 'in14_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in15_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
-
-	},
+         },
 	'3-0050' : {
 		'temp1_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
 		'temp2_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-- 
2.6.3

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

* [PATCH skeleton 07/15] Remove setblinkslow
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (5 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 06/15] remove in15_input sensor OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 08/15] use real names for occ sensors OpenBMC Patches
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

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

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

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index ff6fdcc..90655da 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -75,12 +75,6 @@ ENTER_STATE_CALLBACK = {
 			'obj_name'   : '/org/openbmc/control/led/BEEP',
 			'interface_name' : 'org.openbmc.Led',
 		},
-		'setBlinkSlow' : {
-			'bus_name'   : 'org.openbmc.control.led',
-			'obj_name'   : '/org/openbmc/control/led/HEART_BEAT',
-			'interface_name' : 'org.openbmc.Led',
-		},
-
 		'init' : {
 			'bus_name'   : 'org.openbmc.control.Flash',
 			'obj_name'   : '/org/openbmc/control/flash/bios',
-- 
2.6.3

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

* [PATCH skeleton 08/15] use real names for occ sensors
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (6 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 07/15] Remove setblinkslow OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 09/15] add introspect=False to get_object calls for performance OpenBMC Patches
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc

From: Norman James <njames@us.ibm.com>

---
 bin/Barreleye.py | 261 +++++++++++++++++++++++++++----------------------------
 bin/hwmon.py     |  94 +++++++++++---------
 2 files changed, 181 insertions(+), 174 deletions(-)

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 90655da..2e59392 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -13,7 +13,6 @@ SYSTEM_NAME = "Barreleye"
 ##   - objects specified in EXIT_STATE_DEPEND have started
 SYSTEM_STATES = [
 	'BASE_APPS',
-	'BMC_INIT',
 	'BMC_STARTING',
 	'BMC_STARTING2',
 	'BMC_READY',
@@ -90,12 +89,6 @@ APPS = {
 		'monitor_process' : False,
 		'process_name'    : 'startup_hacks.sh',
 	},
-	'bmc_init' : {
-		'system_state'    : 'BMC_INIT',
-		'start_process'   : True,
-		'monitor_process' : False,
-		'process_name'    : 'control_bmc_barreleye.exe',
-	},
 	'inventory' : {
 		'system_state'    : 'BMC_STARTING',
 		'start_process'   : True,
@@ -115,7 +108,7 @@ APPS = {
 		'monitor_process' : True,
 		'process_name'    : 'fan_control.py',
 	},
-	'virtual_sensors' : {
+	'hwmon' : {
 		'system_state'    : 'BMC_STARTING',
 		'start_process'   : True,
 		'monitor_process' : True,
@@ -186,13 +179,12 @@ APPS = {
 		'process_name'    : 'phosphor-read-eeprom',
 		'args'            : ['--eeprom','/sys/devices/platform/ahb/ahb:apb/1e78a000.i2c/1e78a040.i2c-bus/i2c-0/0-0050/eeprom','--fruid','64'],
 	},
-	'hwmon' : {
-		'system_state'    : 'BMC_STARTING',
+	'restore' : {
+		'system_state'    : 'BMC_READY',
 		'start_process'   : True,
-		'monitor_process' : True,
-		'process_name'    : 'sensors_hwmon.py',
-		'args'            : [ SYSTEM_NAME ]
-	}
+		'monitor_process' : False,
+		'process_name'    : 'discover_system_state.py',
+	},
 }
 
 CACHED_INTERFACES = {
@@ -203,7 +195,8 @@ INVENTORY_ROOT = '/org/openbmc/inventory'
 
 FRU_INSTANCES = {
 	'<inventory_root>/system' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" },
-	'<inventory_root>/system/na' : { 'fru_type' : 'SYSTEM','is_fru' : False, },
+	'<inventory_root>/system/bios' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" },
+	'<inventory_root>/system/misc' : { 'fru_type' : 'SYSTEM','is_fru' : False, },
 
 	'<inventory_root>/system/chassis' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" },
 
@@ -253,14 +246,14 @@ FRU_INSTANCES = {
 	'<inventory_root>/system/chassis/motherboard/cpu1/core10' : { 'fru_type' : 'CORE', 'is_fru' : False, },
 	'<inventory_root>/system/chassis/motherboard/cpu1/core11' : { 'fru_type' : 'CORE', 'is_fru' : False, },
 	
-	'<inventory_root>/system/chassis/motherboard/centaur0' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
-	'<inventory_root>/system/chassis/motherboard/centaur1' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
-	'<inventory_root>/system/chassis/motherboard/centaur2' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
-	'<inventory_root>/system/chassis/motherboard/centaur3' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
-	'<inventory_root>/system/chassis/motherboard/centaur4' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
-	'<inventory_root>/system/chassis/motherboard/centaur5' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
-	'<inventory_root>/system/chassis/motherboard/centaur6' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
-	'<inventory_root>/system/chassis/motherboard/centaur7' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
+	'<inventory_root>/system/chassis/motherboard/membuf0' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
+	'<inventory_root>/system/chassis/motherboard/membuf1' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
+	'<inventory_root>/system/chassis/motherboard/membuf2' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
+	'<inventory_root>/system/chassis/motherboard/membuf3' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
+	'<inventory_root>/system/chassis/motherboard/membuf4' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
+	'<inventory_root>/system/chassis/motherboard/membuf5' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
+	'<inventory_root>/system/chassis/motherboard/membuf6' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
+	'<inventory_root>/system/chassis/motherboard/membuf7' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
 
 	'<inventory_root>/system/chassis/motherboard/dimm0' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
 	'<inventory_root>/system/chassis/motherboard/dimm1' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
@@ -311,14 +304,14 @@ ID_LOOKUP = {
 		0x40 : '<inventory_root>/system/chassis/io_board',
 		0x01 : '<inventory_root>/system/chassis/motherboard/cpu0',
                 0x02 : '<inventory_root>/system/chassis/motherboard/cpu1',
-		0x04 : '<inventory_root>/system/chassis/motherboard/centaur0',
-                0x05 : '<inventory_root>/system/chassis/motherboard/centaur1',
-                0x06 : '<inventory_root>/system/chassis/motherboard/centaur2',
-                0x07 : '<inventory_root>/system/chassis/motherboard/centaur3',
-                0x08 : '<inventory_root>/system/chassis/motherboard/centaur4',
-                0x09 : '<inventory_root>/system/chassis/motherboard/centaur5',
-                0x0a : '<inventory_root>/system/chassis/motherboard/centaur6',
-                0x0b : '<inventory_root>/system/chassis/motherboard/centaur7',
+		0x04 : '<inventory_root>/system/chassis/motherboard/membuf0',
+                0x05 : '<inventory_root>/system/chassis/motherboard/membuf1',
+                0x06 : '<inventory_root>/system/chassis/motherboard/membuf2',
+                0x07 : '<inventory_root>/system/chassis/motherboard/membuf3',
+                0x08 : '<inventory_root>/system/chassis/motherboard/membuf4',
+                0x09 : '<inventory_root>/system/chassis/motherboard/membuf5',
+                0x0a : '<inventory_root>/system/chassis/motherboard/membuf6',
+                0x0b : '<inventory_root>/system/chassis/motherboard/membuf7',
 		0x0c : '<inventory_root>/system/chassis/motherboard/dimm0',
 		0x0d : '<inventory_root>/system/chassis/motherboard/dimm1',
 		0x0e : '<inventory_root>/system/chassis/motherboard/dimm2',
@@ -354,11 +347,9 @@ ID_LOOKUP = {
 		0x33 : '<inventory_root>/system',
 	},
 	'FRU_STR' : {
-		'PRODUCT_0'  : '<inventory_root>/system/na',
-		'BOARD_3'    : '<inventory_root>/system/na',
-		'PRODUCT_15' : '<inventory_root>/system',
-		'PRODUCT_33' : '<inventory_root>/system',
-		'PRODUCT_51' : '<inventory_root>/system',
+		'PRODUCT_0'  : '<inventory_root>/system/bios',
+		'BOARD_3'    : '<inventory_root>/system/misc',
+		'PRODUCT_51' : '<inventory_root>/system/misc',
 		'PRODUCT_100': '<inventory_root>/system',
 		'CHASSIS_2'  : '<inventory_root>/system/chassis',
 		'CHASSIS_100': '<inventory_root>/system/chassis',
@@ -366,14 +357,14 @@ ID_LOOKUP = {
 		'CHASSIS_3'  : '<inventory_root>/system/chassis/motherboard',
 		'BOARD_1'    : '<inventory_root>/system/chassis/motherboard/cpu0',
 		'BOARD_2'    : '<inventory_root>/system/chassis/motherboard/cpu1',
-		'BOARD_4'    : '<inventory_root>/system/chassis/motherboard/centaur0',
-		'BOARD_5'    : '<inventory_root>/system/chassis/motherboard/centaur1',
-		'BOARD_6'    : '<inventory_root>/system/chassis/motherboard/centaur2',
-		'BOARD_7'    : '<inventory_root>/system/chassis/motherboard/centaur3',
-		'BOARD_8'    : '<inventory_root>/system/chassis/motherboard/centaur4',
-		'BOARD_9'    : '<inventory_root>/system/chassis/motherboard/centaur5',
-		'BOARD_10'   : '<inventory_root>/system/chassis/motherboard/centaur6',
-		'BOARD_11'   : '<inventory_root>/system/chassis/motherboard/centaur7',
+		'BOARD_4'    : '<inventory_root>/system/chassis/motherboard/membuf0',
+		'BOARD_5'    : '<inventory_root>/system/chassis/motherboard/membuf1',
+		'BOARD_6'    : '<inventory_root>/system/chassis/motherboard/membuf2',
+		'BOARD_7'    : '<inventory_root>/system/chassis/motherboard/membuf3',
+		'BOARD_8'    : '<inventory_root>/system/chassis/motherboard/membuf4',
+		'BOARD_9'    : '<inventory_root>/system/chassis/motherboard/membuf5',
+		'BOARD_10'   : '<inventory_root>/system/chassis/motherboard/membuf6',
+		'BOARD_11'   : '<inventory_root>/system/chassis/motherboard/membuf7',
 		'PRODUCT_12'   : '<inventory_root>/system/chassis/motherboard/dimm0',
 		'PRODUCT_13'   : '<inventory_root>/system/chassis/motherboard/dimm1',
 		'PRODUCT_14'   : '<inventory_root>/system/chassis/motherboard/dimm2',
@@ -442,14 +433,14 @@ ID_LOOKUP = {
                 0xdd : '<inventory_root>/system/chassis/motherboard/cpu1/core9',
                 0xde : '<inventory_root>/system/chassis/motherboard/cpu1/core10',
                 0xdf : '<inventory_root>/system/chassis/motherboard/cpu1/core11',
-		0x40 : '<inventory_root>/system/chassis/motherboard/centaur0',
-    	        0x41 : '<inventory_root>/system/chassis/motherboard/centaur1',
-       		0x42 : '<inventory_root>/system/chassis/motherboard/centaur2',
-       		0x43 : '<inventory_root>/system/chassis/motherboard/centaur3',
-       		0x44 : '<inventory_root>/system/chassis/motherboard/centaur4',
-                0x45 : '<inventory_root>/system/chassis/motherboard/centaur5',
-                0x46 : '<inventory_root>/system/chassis/motherboard/centaur6',
-                0x47 : '<inventory_root>/system/chassis/motherboard/centaur7',
+		0x40 : '<inventory_root>/system/chassis/motherboard/membuf0',
+    	        0x41 : '<inventory_root>/system/chassis/motherboard/membuf1',
+       		0x42 : '<inventory_root>/system/chassis/motherboard/membuf2',
+       		0x43 : '<inventory_root>/system/chassis/motherboard/membuf3',
+       		0x44 : '<inventory_root>/system/chassis/motherboard/membuf4',
+                0x45 : '<inventory_root>/system/chassis/motherboard/membuf5',
+                0x46 : '<inventory_root>/system/chassis/motherboard/membuf6',
+                0x47 : '<inventory_root>/system/chassis/motherboard/membuf7',
 		0x10 : '<inventory_root>/system/chassis/motherboard/dimm0',
 		0x11 : '<inventory_root>/system/chassis/motherboard/dimm1',
 		0x12 : '<inventory_root>/system/chassis/motherboard/dimm2',
@@ -542,94 +533,96 @@ def convertGpio(name):
 
 
 HWMON_CONFIG = {
-	'0-004a' :  { 
-		'temp1_input' : { 'object_path' : 'temperature/ambient','poll_interval' : 3000,'scale' : 1000,'units' : 'C' },
+	'0-004a' :  {
+		'names' : { 
+			'temp1_input' : { 'object_path' : 'temperature/ambient','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		}
 	},
 	'6-002d' : {
-		'pwm1' : { 'object_path' : 'speed/fan0','poll_interval' : 10000,'scale' : 1,'units' : '' },
-		'pwm2' : { 'object_path' : 'speed/fan1','poll_interval' : 10000,'scale' : 1,'units' : '' },
-		'pwm3' : { 'object_path' : 'speed/fan2','poll_interval' : 10000,'scale' : 1,'units' : '' },
-		'in1_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in2_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in3_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in4_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in5_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in6_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in7_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in8_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in9_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
-		'in10_input' : { 'object_path' : 'voltage/P0V97_CPU0','poll_interval' : 10000,'scale' : 1,'units' : '' },
-		'in11_input' : { 'object_path' : 'voltage/P1V1_MEM0','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in12_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in13_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in14_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
- 	},
+		'names' : {
+			'pwm1' : { 'object_path' : 'speed/fan0','poll_interval' : 10000,'scale' : 1,'units' : '' },
+			'pwm2' : { 'object_path' : 'speed/fan1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+			'pwm3' : { 'object_path' : 'speed/fan2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+		}
+	},
 	'6-002e' : {
-		'pwm1' : { 'object_path' : 'speed/fan3','poll_interval' : 10000,'scale' : 1,'units' : '' },
-		'pwm2' : { 'object_path' : 'speed/fan4','poll_interval' : 10000,'scale' : 1,'units' : '' },
-		'pwm3' : { 'object_path' : 'speed/fan5','poll_interval' : 10000,'scale' : 1,'units' : '' },
-		'in1_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in2_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in3_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in4_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in5_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in6_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in7_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in8_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in9_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in10_input' : { 'object_path' : 'voltage/P0V97_CPU1','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in11_input' : { 'object_path' : 'voltage/P1V1_MEM1','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in12_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in13_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in14_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
-         },
+		'names' : {
+			'pwm1' : { 'object_path' : 'speed/fan3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+			'pwm2' : { 'object_path' : 'speed/fan4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+			'pwm3' : { 'object_path' : 'speed/fan5','poll_interval' : 10000,'scale' : 1,'units' : '' },
+		}
+},
 	'3-0050' : {
-		'temp1_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp2_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp3_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp4_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp5_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp6_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp7_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp8_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp9_input' :  { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp10_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp11_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp12_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp13_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp14_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp15_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp16_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp17_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp18_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp19_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp20_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp21_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp22_input' : { 'object_path' : 'temperature/cpu0/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
+		'labels' : {
+		'176' :  { 'object_path' : 'temperature/cpu0/core0','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'177' :  { 'object_path' : 'temperature/cpu0/core1','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'178' :  { 'object_path' : 'temperature/cpu0/core2','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'179' :  { 'object_path' : 'temperature/cpu0/core3','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'180' :  { 'object_path' : 'temperature/cpu0/core4','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'181' :  { 'object_path' : 'temperature/cpu0/core5','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'182' :  { 'object_path' : 'temperature/cpu0/core6','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'183' :  { 'object_path' : 'temperature/cpu0/core7','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'184' :  { 'object_path' : 'temperature/cpu0/core8','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'185' :  { 'object_path' : 'temperature/cpu0/core9','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'186' :  { 'object_path' : 'temperature/cpu0/core10','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'187' :  { 'object_path' : 'temperature/cpu0/core11','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'102' :  { 'object_path' : 'temperature/dimm0','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'103' :  { 'object_path' : 'temperature/dimm1','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'104' :  { 'object_path' : 'temperature/dimm2','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'105' :  { 'object_path' : 'temperature/dimm3','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'106' :  { 'object_path' : 'temperature/dimm4','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'107' :  { 'object_path' : 'temperature/dimm5','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'108' :  { 'object_path' : 'temperature/dimm6','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'109' :  { 'object_path' : 'temperature/dimm7','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'110' :  { 'object_path' : 'temperature/dimm8','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'111' :  { 'object_path' : 'temperature/dimm9','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'112' :  { 'object_path' : 'temperature/dimm10','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'113' :  { 'object_path' : 'temperature/dimm11','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'114' :  { 'object_path' : 'temperature/dimm12','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'115' :  { 'object_path' : 'temperature/dimm13','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'116' :  { 'object_path' : 'temperature/dimm14','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'117' :  { 'object_path' : 'temperature/dimm15','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'94' :  { 'object_path' : 'temperature/membuf0','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'95' :  { 'object_path' : 'temperature/membuf1','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'96' :  { 'object_path' : 'temperature/membuf2','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'97' :  { 'object_path' : 'temperature/membuf3','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		}
 	},
 	'3-0051' : {
-		'temp1_input' :  { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp2_input' :  { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp3_input' :  { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp4_input' :  { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp5_input' :  { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp6_input' :  { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp7_input' :  { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp8_input' :  { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp9_input' :  { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp10_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp11_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp12_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp13_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp14_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp15_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp16_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp17_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp18_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp19_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp20_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp21_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
-		'temp22_input' : { 'object_path' : 'temperature/cpu1/<label>','poll_interval' : 1000,'scale' : 1000,'units' : 'C' },
+		'labels' :  {
+		'188' :  { 'object_path' : 'temperature/cpu1/core0','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'189' :  { 'object_path' : 'temperature/cpu1/core1','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'190' :  { 'object_path' : 'temperature/cpu1/core2','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'191' :  { 'object_path' : 'temperature/cpu1/core3','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'192' :  { 'object_path' : 'temperature/cpu1/core4','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'193' :  { 'object_path' : 'temperature/cpu1/core5','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'194' :  { 'object_path' : 'temperature/cpu1/core6','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'195' :  { 'object_path' : 'temperature/cpu1/core7','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'196' :  { 'object_path' : 'temperature/cpu1/core8','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'197' :  { 'object_path' : 'temperature/cpu1/core9','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'198' :  { 'object_path' : 'temperature/cpu1/core10','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'199' :  { 'object_path' : 'temperature/cpu1/core11','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'118' :  { 'object_path' : 'temperature/dimm16','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'119' :  { 'object_path' : 'temperature/dimm17','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'120' :  { 'object_path' : 'temperature/dimm18','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'121' :  { 'object_path' : 'temperature/dimm19','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'122' :  { 'object_path' : 'temperature/dimm20','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'123' :  { 'object_path' : 'temperature/dimm21','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'124' :  { 'object_path' : 'temperature/dimm22','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'125' :  { 'object_path' : 'temperature/dimm23','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'126' :  { 'object_path' : 'temperature/dimm24','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'127' :  { 'object_path' : 'temperature/dimm25','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'128' :  { 'object_path' : 'temperature/dimm26','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'129' :  { 'object_path' : 'temperature/dimm27','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'130' :  { 'object_path' : 'temperature/dimm28','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'131' :  { 'object_path' : 'temperature/dimm29','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'132' :  { 'object_path' : 'temperature/dimm30','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'133' :  { 'object_path' : 'temperature/dimm31','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'98' :  { 'object_path' : 'temperature/membuf4','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'99' :  { 'object_path' : 'temperature/membuf5','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'100' :  { 'object_path' : 'temperature/membuf6','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		'101' :  { 'object_path' : 'temperature/membuf7','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
+		}
 	},
 }
 
diff --git a/bin/hwmon.py b/bin/hwmon.py
index 513c760..9a7a56e 100755
--- a/bin/hwmon.py
+++ b/bin/hwmon.py
@@ -3,13 +3,17 @@
 import sys
 import os
 import gobject
+import glob
 import dbus
 import dbus.service
 import dbus.mainloop.glib
 import Openbmc
+import re
+
 from Sensors import SensorValue as SensorValue
 from Sensors import HwmonSensor as HwmonSensor
 from Sensors import SensorThresholds as SensorThresholds
+
 if (len(sys.argv) < 2):
 	print "Usage:  sensors_hwmon.py [system name]"
 	exit(1)
@@ -18,7 +22,7 @@ System = __import__(sys.argv[1])
 
 SENSOR_BUS = 'org.openbmc.Sensors'
 SENSOR_PATH = '/org/openbmc/sensors'
-DIR_POLL_INTERVAL = 10000
+DIR_POLL_INTERVAL = 30000
 HWMON_PATH = '/sys/class/hwmon'
 
 ## static define which interface each property is under
@@ -55,7 +59,7 @@ class Hwmons():
 	def poll(self,objpath,attribute):
 		try:
 			raw_value = int(self.readAttribute(attribute))
-			obj = bus.get_object(SENSOR_BUS,objpath)
+			obj = bus.get_object(SENSOR_BUS,objpath,introspect=False)
 			intf = dbus.Interface(obj,HwmonSensor.IFACE_NAME)
 			rtn = intf.setByPoll(raw_value)
 			if (rtn[0] == True):
@@ -68,48 +72,41 @@ class Hwmons():
 		return True
 
 
-	def addObject(self,dpath,instance_name,attribute):
-		hwmon = System.HWMON_CONFIG[instance_name][attribute]
+	def addObject(self,dpath,hwmon_path,hwmon):
 		objsuf = hwmon['object_path']
-		try:
-			if (objsuf.find('<label>') > -1):
-				label_file = attribute.replace('_input','_label')
-				label = self.readAttribute(dpath+label_file)
-				objsuf = objsuf.replace('<label>',label)
-		except Exception as e:
-			print e
-			return
-
 		objpath = SENSOR_PATH+'/'+objsuf
-		spath = dpath+attribute
+		
 		if (self.sensors.has_key(objpath) == False):
-			if os.path.isfile(spath):
-				print "HWMON add: "+objpath+" : "+spath
-				obj = bus.get_object(SENSOR_BUS,SENSOR_PATH)
-				intf = dbus.Interface(obj,SENSOR_BUS)
-				intf.register("HwmonSensor",objpath)
+			print "HWMON add: "+objpath+" : "+hwmon_path
+
+			## register object with sensor manager
+			obj = bus.get_object(SENSOR_BUS,SENSOR_PATH,introspect=False)
+			intf = dbus.Interface(obj,SENSOR_BUS)
+			intf.register("HwmonSensor",objpath)
+
+			## set some properties in dbus object		
+			obj = bus.get_object(SENSOR_BUS,objpath,introspect=False)
+			intf = dbus.Interface(obj,dbus.PROPERTIES_IFACE)
+			intf.Set(HwmonSensor.IFACE_NAME,'filename',hwmon_path)
 			
-				obj = bus.get_object(SENSOR_BUS,objpath)
-				intf = dbus.Interface(obj,dbus.PROPERTIES_IFACE)
-				intf.Set(HwmonSensor.IFACE_NAME,'filename',spath)
-				
-				## check if one of thresholds is defined to know
-				## whether to enable thresholds or not
-				if (hwmon.has_key('critical_upper')):
-					intf.Set(SensorThresholds.IFACE_NAME,'thresholds_enabled',True)
-
-				for prop in hwmon.keys():
-					if (IFACE_LOOKUP.has_key(prop)):
-						intf.Set(IFACE_LOOKUP[prop],prop,hwmon[prop])
-						print "Setting: "+prop+" = "+str(hwmon[prop])
-
-				self.sensors[objpath]=True
-				self.hwmon_root[dpath].append(objpath)
-				gobject.timeout_add(hwmon['poll_interval'],self.poll,objpath,spath)
+			## check if one of thresholds is defined to know
+			## whether to enable thresholds or not
+			if (hwmon.has_key('critical_upper')):
+				intf.Set(SensorThresholds.IFACE_NAME,'thresholds_enabled',True)
+
+			for prop in hwmon.keys():
+				if (IFACE_LOOKUP.has_key(prop)):
+					intf.Set(IFACE_LOOKUP[prop],prop,hwmon[prop])
+					print "Setting: "+prop+" = "+str(hwmon[prop])
+
+			self.sensors[objpath]=True
+			self.hwmon_root[dpath].append(objpath)
+			gobject.timeout_add(hwmon['poll_interval'],self.poll,objpath,hwmon_path)
 	
 	def scanDirectory(self):
 	 	devices = os.listdir(HWMON_PATH)
 		found_hwmon = {}
+		regx = re.compile('([a-z]+)\d+\_')
 		for d in devices:
 			dpath = HWMON_PATH+'/'+d+'/'
 			found_hwmon[dpath] = True
@@ -117,11 +114,28 @@ class Hwmons():
 				self.hwmon_root[dpath] = []
 			## the instance name is a soft link
 			instance_name = os.path.realpath(dpath+'device').split('/').pop()
+			
+			
 			if (System.HWMON_CONFIG.has_key(instance_name)):
-	 			for attribute in System.HWMON_CONFIG[instance_name].keys():
-					self.addObject(dpath,instance_name,attribute)
+				hwmon = System.HWMON_CONFIG[instance_name]
+	 			
+				if (hwmon.has_key('labels')):
+					label_files = glob.glob(dpath+'/*_label')
+					for f in label_files:
+						label_key = self.readAttribute(f)
+						if (hwmon['labels'].has_key(label_key)):
+							namef = f.replace('_label','_input')
+							self.addObject(dpath,namef,hwmon['labels'][label_key])
+						else:
+							pass
+							#print "WARNING - hwmon: label ("+label_key+") not found in lookup: "+f
+							
+				if hwmon.has_key('names'):
+					for attribute in hwmon['names'].keys():
+						self.addObject(dpath,dpath+attribute,hwmon['names'][attribute])
+						
 			else:
-				print "WARNING: Unhandled hwmon: "+dpath
+				print "WARNING - hwmon: Unhandled hwmon: "+dpath
 	
 
 		for k in self.hwmon_root.keys():
@@ -132,7 +146,7 @@ class Hwmons():
 					if (self.sensors.has_key(objpath) == True):
 						print "HWMON remove: "+objpath
 						self.sensors.pop(objpath,None)
-						obj = bus.get_object(SENSOR_BUS,SENSOR_PATH)
+						obj = bus.get_object(SENSOR_BUS,SENSOR_PATH,introspect=False)
 						intf = dbus.Interface(obj,SENSOR_BUS)
 						intf.delete(objpath)
 
-- 
2.6.3

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

* [PATCH skeleton 09/15] add introspect=False to get_object calls for performance
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (7 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 08/15] use real names for occ sensors OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 10/15] add new flash ids OpenBMC Patches
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc

From: Norman James <njames@us.ibm.com>

---
 bin/chassis_control.py | 2 +-
 bin/fan_control.py     | 2 +-
 bin/obmcutil           | 2 +-
 bin/system_manager.py  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/chassis_control.py b/bin/chassis_control.py
index aa656fd..8ae0f55 100755
--- a/bin/chassis_control.py
+++ b/bin/chassis_control.py
@@ -69,7 +69,7 @@ class ChassisControlObject(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 
 	def getInterface(self,name):
 		o = self.dbus_objects[name]
-		obj = bus.get_object(o['bus_name'],o['object_name'])
+		obj = bus.get_object(o['bus_name'],o['object_name'],introspect=False)
 		return dbus.Interface(obj,o['interface_name'])
 
 
diff --git a/bin/fan_control.py b/bin/fan_control.py
index 1a528fd..bb070e5 100755
--- a/bin/fan_control.py
+++ b/bin/fan_control.py
@@ -34,7 +34,7 @@ class FanControl(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 		## create interface proxies to all fans
 		for fan in FAN_OBJS:
 			print "Initializing fan: "+fan
-			obj = bus.get_object(FAN_BUS,fan)
+			obj = bus.get_object(FAN_BUS,fan,introspect=False)
 			self.fan_intf.append(dbus.Interface(obj,FAN_IFACE))
 		self.InterfacesAdded(name,self.properties)
 			
diff --git a/bin/obmcutil b/bin/obmcutil
index e63fa27..55b5e2d 100755
--- a/bin/obmcutil
+++ b/bin/obmcutil
@@ -175,7 +175,7 @@ elif (len(sys.argv)>0):
 bus_name = objinfo['bus_name']
 obj_path = objinfo['object_name']
 intf_name = objinfo['interface_name']
-obj = bus.get_object(bus_name,obj_path)
+obj = bus.get_object(bus_name,obj_path,introspect=False)
 
 if (method_name != ""):
 	methd = obj.get_dbus_method(method_name,intf_name)
diff --git a/bin/system_manager.py b/bin/system_manager.py
index 63e2319..004d978 100755
--- a/bin/system_manager.py
+++ b/bin/system_manager.py
@@ -86,7 +86,7 @@ class SystemManager(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 		try:	
 			cb = System.ENTER_STATE_CALLBACK[state_name]
 			for methd in cb.keys():
-				obj = bus.get_object(cb[methd]['bus_name'],cb[methd]['obj_name'])
+				obj = bus.get_object(cb[methd]['bus_name'],cb[methd]['obj_name'],introspect=False)
 				method = obj.get_dbus_method(methd,cb[methd]['interface_name'])
 				method()
 		except:
-- 
2.6.3

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

* [PATCH skeleton 10/15] add new flash ids
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (8 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 09/15] add introspect=False to get_object calls for performance OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2016-01-14  2:59   ` Stewart Smith
  2015-12-18 23:40 ` [PATCH skeleton 11/15] new process to discover initial power state on bmc reboot OpenBMC Patches
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc

From: Norman James <njames@us.ibm.com>

---
 objects/pflash/libflash/libflash.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/objects/pflash/libflash/libflash.c b/objects/pflash/libflash/libflash.c
index 1482137..01eee97 100644
--- a/objects/pflash/libflash/libflash.c
+++ b/objects/pflash/libflash/libflash.c
@@ -12,6 +12,12 @@ static const struct flash_info flash_info[] = {
 	{ 0x20ba20, 0x04000000, FL_ERASE_4K  | FL_ERASE_64K | FL_CAN_4B |
                                 FL_ERASE_BULK | FL_MICRON_BUGS,
                                                           "Micron N25Qx512Ax"   },
+	{ 0x20ba19, 0x02000000, FL_ERASE_4K  | FL_ERASE_64K | FL_CAN_4B |
+                                FL_ERASE_BULK | FL_MICRON_BUGS,
+                                                          "Micron N25Q256Ax"    },
+	{ 0x1940ef, 0x02000000, FL_ERASE_4K  | FL_ERASE_64K | FL_CAN_4B |
+                                FL_ERASE_BULK | FL_MICRON_BUGS,
+                                                          "Micron N25Qx256Ax"   },
 	{ 0x55aa55, 0x00100000, FL_ERASE_ALL | FL_CAN_4B, "TEST_FLASH" },
 
 };
-- 
2.6.3

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

* [PATCH skeleton 11/15] new process to discover initial power state on bmc reboot
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (9 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 10/15] add new flash ids OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 12/15] add softreboot OpenBMC Patches
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc

From: Norman James <njames@us.ibm.com>

---
 bin/discover_system_state.py | 49 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100755 bin/discover_system_state.py

diff --git a/bin/discover_system_state.py b/bin/discover_system_state.py
new file mode 100755
index 0000000..236bd01
--- /dev/null
+++ b/bin/discover_system_state.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+
+import sys
+import gobject
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+
+
+dbus_objects = {
+	'power' : { 
+		'bus_name' : 'org.openbmc.control.Power',
+		'object_name' : '/org/openbmc/control/power0',
+		'interface_name' : 'org.openbmc.control.Power'
+	},
+	'occstatus' : { 
+		'bus_name' : 'org.openbmc.Sensors',
+		'object_name' : '/org/openbmc/sensors/host/OccStatus',
+		'interface_name' : 'org.openbmc.SensorValue'
+	},
+	'bootprogress' : { 
+		'bus_name' : 'org.openbmc.Sensors',
+		'object_name' : '/org/openbmc/sensors/host/BootProgress',
+		'interface_name' : 'org.openbmc.SensorValue'
+	},
+}
+
+def getInterface(bus,objs,key):
+	obj = bus.get_object(objs[key]['bus_name'],objs[key]['object_name'],introspect=False)
+	return dbus.Interface(obj,objs[key]['interface_name'])
+
+def getProperty(bus,objs,key,prop):
+	obj = bus.get_object(objs[key]['bus_name'],objs[key]['object_name'],introspect=False)
+	intf = dbus.Interface(obj,dbus.PROPERTIES_IFACE)
+	return intf.Get(objs[key]['interface_name'],prop)
+
+
+bus = dbus.SystemBus()
+pgood = getProperty(bus,dbus_objects,'power','pgood')
+
+if (pgood == 1):
+	intf = getInterface(bus,dbus_objects,'bootprogress')
+	intf.setValue("FW Progress, Starting OS")
+	intf = getInterface(bus,dbus_objects,'occstatus')
+	intf.setValue("Enabled")
+	
+
+		
+
-- 
2.6.3

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

* [PATCH skeleton 12/15] add softreboot
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (10 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 11/15] new process to discover initial power state on bmc reboot OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 13/15] Add all voltage sensors OpenBMC Patches
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc

From: Norman James <njames@us.ibm.com>

---
 bin/chassis_control.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bin/chassis_control.py b/bin/chassis_control.py
index 8ae0f55..1981a82 100755
--- a/bin/chassis_control.py
+++ b/bin/chassis_control.py
@@ -132,6 +132,8 @@ class ChassisControlObject(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 			self.powerOff()
 		return None
 
+	@dbus.service.method(DBUS_NAME,
+		in_signature='', out_signature='')
 	def softReboot(self):
 		print "Soft Rebooting"
 		if self.getPowerState() == POWER_OFF:
-- 
2.6.3

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

* [PATCH skeleton 13/15] Add all voltage sensors
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (11 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 12/15] add softreboot OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 14/15] remove in15_input sensor OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 15/15] Add reset button OpenBMC Patches
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

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

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

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 2e59392..93c3694 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -543,6 +543,22 @@ HWMON_CONFIG = {
 			'pwm1' : { 'object_path' : 'speed/fan0','poll_interval' : 10000,'scale' : 1,'units' : '' },
 			'pwm2' : { 'object_path' : 'speed/fan1','poll_interval' : 10000,'scale' : 1,'units' : '' },
 			'pwm3' : { 'object_path' : 'speed/fan2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in1_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in2_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in3_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in4_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in5_input' : { 'object_path' : 'voltage/P0V9_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in6_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in7_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in8_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in9_input' : { 'object_path' : 'voltage/P1V09_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in10_input' : { 'object_path' : 'voltage/P0V97_CPU0','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in11_input' : { 'object_path' : 'voltage/P1V1_MEM0','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in12_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in13_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in14_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in15_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+
 		}
 	},
 	'6-002e' : {
@@ -550,6 +566,22 @@ HWMON_CONFIG = {
 			'pwm1' : { 'object_path' : 'speed/fan3','poll_interval' : 10000,'scale' : 1,'units' : '' },
 			'pwm2' : { 'object_path' : 'speed/fan4','poll_interval' : 10000,'scale' : 1,'units' : '' },
 			'pwm3' : { 'object_path' : 'speed/fan5','poll_interval' : 10000,'scale' : 1,'units' : '' },
+   			'in1_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in2_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in3_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in4_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in5_input' : { 'object_path' : 'voltage/P0V9_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in6_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in7_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in8_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in9_input' : { 'object_path' : 'voltage/P1V09_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in10_input' : { 'object_path' : 'voltage/P0V97_CPU1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in11_input' : { 'object_path' : 'voltage/P1V1_MEM1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in12_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in13_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in14_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
+                'in15_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
+
 		}
 },
 	'3-0050' : {
-- 
2.6.3

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

* [PATCH skeleton 14/15] remove in15_input sensor
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (12 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 13/15] Add all voltage sensors OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  2015-12-18 23:40 ` [PATCH skeleton 15/15] Add reset button OpenBMC Patches
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

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

---
 bin/Barreleye.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 93c3694..5d3d2b7 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -557,8 +557,6 @@ HWMON_CONFIG = {
                 'in12_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
                 'in13_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
                 'in14_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in15_input' : { 'object_path' : 'voltage/P1V35_CPU0_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
-
 		}
 	},
 	'6-002e' : {
@@ -580,10 +578,9 @@ HWMON_CONFIG = {
                 'in12_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF1','poll_interval' : 10000,'scale' : 1,'units' : '' },
                 'in13_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF2','poll_interval' : 10000,'scale' : 1,'units' : '' },
                 'in14_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF3','poll_interval' : 10000,'scale' : 1,'units' : '' },
-                'in15_input' : { 'object_path' : 'voltage/P1V35_CPU1_BUF4','poll_interval' : 10000,'scale' : 1,'units' : '' },
 
 		}
-},
+         },
 	'3-0050' : {
 		'labels' : {
 		'176' :  { 'object_path' : 'temperature/cpu0/core0','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
-- 
2.6.3

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

* [PATCH skeleton 15/15] Add reset button
  2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
                   ` (13 preceding siblings ...)
  2015-12-18 23:40 ` [PATCH skeleton 14/15] remove in15_input sensor OpenBMC Patches
@ 2015-12-18 23:40 ` OpenBMC Patches
  14 siblings, 0 replies; 19+ messages in thread
From: OpenBMC Patches @ 2015-12-18 23:40 UTC (permalink / raw)
  To: openbmc; +Cc: Ken

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

---
 Makefile                   |   6 +-
 bin/Barreleye.py           |   9 +++
 bin/chassis_control.py     |   6 ++
 objects/button_reset_obj.c | 179 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 199 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 Makefile
 create mode 100755 objects/button_reset_obj.c

diff --git a/Makefile b/Makefile
old mode 100644
new mode 100755
index e3875ad..ea2dde2
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ LIBS=$(shell pkg-config --libs gio-unix-2.0 glib-2.0) -Llib -lopenbmc_intf
 %.o: objects/pflash/libflash/%.c
 	$(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES)
 
-all: setup libopenbmc_intf power_control led_controller button_power control_host host_watchdog control_bmc board_vpd pcie_slot_present flash_bios flasher control_bmc_barreleye pflash hwmons_barreleye
+all: setup libopenbmc_intf power_control led_controller button_power button_reset control_host host_watchdog control_bmc board_vpd pcie_slot_present flash_bios flasher control_bmc_barreleye pflash hwmons_barreleye
 
 setup: 
 	mkdir -p obj lib
@@ -42,6 +42,10 @@ led_controller: led_controller.o gpio.o object_mapper.o libopenbmc_intf
 button_power: button_power_obj.o gpio.o object_mapper.o libopenbmc_intf
 	$(CC) -o bin/$@.exe obj/button_power_obj.o obj/gpio.o obj/object_mapper.o $(LDFLAGS) $(LIBS)
 
+button_reset: button_reset_obj.o gpio.o object_mapper.o libopenbmc_intf
+	$(CC) -o bin/$@.exe obj/button_reset_obj.o obj/gpio.o obj/object_mapper.o $(LDFLAGS) $(LIBS)
+
+
 control_host: control_host_obj.o gpio.o object_mapper.o libopenbmc_intf
 	$(CC) -o bin/$@.exe obj/gpio.o obj/control_host_obj.o obj/object_mapper.o $(LDFLAGS) $(LIBS)
 
diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 5d3d2b7..e8a90d0 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -141,6 +141,15 @@ APPS = {
 		'monitor_process' : True,
 		'process_name'    : 'button_power.exe',
 	},
+
+        'reset_button' : {
+                'system_state'    : 'BMC_STARTING',
+                'start_process'   : True,
+                'monitor_process' : True,
+                'process_name'    : 'button_reset.exe',
+        },
+
+
 	'led_control' : {
 		'system_state'    : 'BMC_STARTING',
 		'start_process'   : True,
diff --git a/bin/chassis_control.py b/bin/chassis_control.py
index 1981a82..27e9152 100755
--- a/bin/chassis_control.py
+++ b/bin/chassis_control.py
@@ -60,6 +60,9 @@ class ChassisControlObject(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 		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" )
 
     		bus.add_signal_receiver(self.host_watchdog_signal_handler, 
 					dbus_interface = "org.openbmc.Watchdog", signal_name = "WatchdogError")
@@ -179,6 +182,9 @@ class ChassisControlObject(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 
 	def reset_button_signal_handler(self):
 		self.reboot();
+
+	def softreset_button_signal_handler(self):
+		self.softReboot();
 		
 	def host_watchdog_signal_handler(self):
 		print "Watchdog Error, Hard Rebooting"
diff --git a/objects/button_reset_obj.c b/objects/button_reset_obj.c
new file mode 100755
index 0000000..759e83a
--- /dev/null
+++ b/objects/button_reset_obj.c
@@ -0,0 +1,179 @@
+#include <stdio.h>
+#include "interfaces/openbmc_intf.h"
+#include "gpio.h"
+#include "openbmc.h"
+#include "object_mapper.h"
+
+/* ---------------------------------------------------------------------------------------------------- */
+static const gchar* dbus_object_path = "/org/openbmc/buttons";
+static const gchar* instance_name = "reset0";
+static const gchar* dbus_name        = "org.openbmc.buttons.reset";
+static const int LONG_PRESS_SECONDS = 3;
+static GDBusObjectManagerServer *manager = NULL;
+
+//This object will use these GPIOs
+GPIO gpio_button    = (GPIO){ "RESET_BUTTON" };
+
+static gboolean
+on_is_on       (Button          *btn,
+                GDBusMethodInvocation  *invocation,
+                gpointer                user_data)
+{
+  gboolean btn_state=button_get_state(btn);
+  button_complete_is_on(btn,invocation,btn_state);
+  return TRUE;
+
+}
+
+static gboolean
+on_button_press       (Button          *btn,
+                GDBusMethodInvocation  *invocation,
+                gpointer                user_data)
+{
+	button_emit_pressed(btn);
+	button_complete_sim_press(btn,invocation);
+	return TRUE;
+}
+static gboolean
+on_button_interrupt( GIOChannel *channel,
+               GIOCondition condition,
+               gpointer user_data )
+{
+
+	GError *error = 0;
+	gsize bytes_read = 0;
+	gchar buf[2]; 
+	buf[1] = '\0';
+	g_io_channel_seek_position( channel, 0, G_SEEK_SET, 0 );
+	GIOStatus rc = g_io_channel_read_chars( channel,
+                                            buf, 1,
+                                            &bytes_read,
+                                            &error );
+	printf("%s\n",buf);
+	
+	time_t current_time = time(NULL);
+	if (gpio_button.irq_inited)
+	{
+		Button* button = object_get_button((Object*)user_data);
+		if (buf[0] == '0')
+		{
+			printf("reset Button pressed\n");
+			button_emit_pressed(button);
+			button_set_timer(button,(long)current_time);
+		}
+		else
+		{
+			long press_time = current_time-button_get_timer(button);
+			printf("reset 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);
+			}
+		}
+	} 
+	else { gpio_button.irq_inited = true; }
+
+	return TRUE;
+}
+static void 
+on_bus_acquired (GDBusConnection *connection,
+                 const gchar     *name,
+                 gpointer         user_data)
+{
+	ObjectSkeleton *object;
+	//g_print ("Acquired a message bus connection: %s\n",name);
+ 	cmdline *cmd = user_data;
+  	manager = g_dbus_object_manager_server_new (dbus_object_path);
+  	int i=0;
+	gchar *s;
+	s = g_strdup_printf ("%s/%s",dbus_object_path,instance_name);
+	object = object_skeleton_new (s);
+	g_free (s);
+
+	Button* button = button_skeleton_new ();
+	object_skeleton_set_button (object, button);
+	g_object_unref (button);
+
+	ObjectMapper* mapper = object_mapper_skeleton_new ();
+	object_skeleton_set_object_mapper (object, mapper);
+	g_object_unref (mapper);
+
+	//define method callbacks
+	g_signal_connect (button,
+                   "handle-is-on",
+                   G_CALLBACK (on_is_on),
+                   NULL); /* user_data */
+	g_signal_connect (button,
+                    "handle-sim-press",
+                    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);
+
+	/* Export all objects */
+	g_dbus_object_manager_server_set_connection (manager, connection);
+
+	// get gpio device paths
+	int rc = GPIO_OK;
+	do {
+		rc = gpio_init(connection,&gpio_button);
+		if (rc != GPIO_OK) { break; }
+		rc = gpio_open_interrupt(&gpio_button,on_button_interrupt,object);
+		if (rc != GPIO_OK) { break; }
+	} while(0);
+	if (rc != GPIO_OK)
+	{
+		printf("ERROR PowerButton: GPIO setup (rc=%d)\n",rc);
+	}
+	emit_object_added((GDBusObjectManager*)manager); 
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+                  const gchar     *name,
+                  gpointer         user_data)
+{
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+              const gchar     *name,
+              gpointer         user_data)
+{
+}
+
+
+gint
+main (gint argc, gchar *argv[])
+{
+  GMainLoop *loop;
+
+  cmdline cmd;
+  cmd.argc = argc;
+  cmd.argv = argv;
+
+  guint id;
+  loop = g_main_loop_new (NULL, FALSE);
+
+  id = g_bus_own_name (DBUS_TYPE,
+                       dbus_name,
+                       G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
+                       G_BUS_NAME_OWNER_FLAGS_REPLACE,
+                       on_bus_acquired,
+                       on_name_acquired,
+                       on_name_lost,
+                       &cmd,
+                       NULL);
+
+  g_main_loop_run (loop);
+  
+  g_bus_unown_name (id);
+  g_main_loop_unref (loop);
+  return 0;
+}
+
-- 
2.6.3

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

* Re: [PATCH skeleton 03/15] Fix THROTTLE typo:
  2015-12-18 23:40 ` [PATCH skeleton 03/15] Fix THROTTLE typo: OpenBMC Patches
@ 2015-12-23  1:09   ` Stewart Smith
  0 siblings, 0 replies; 19+ messages in thread
From: Stewart Smith @ 2015-12-23  1:09 UTC (permalink / raw)
  To: OpenBMC Patches, openbmc; +Cc: Ken

OpenBMC Patches <openbmc-patches@stwcx.xyz> writes:
> From: Ken <ken.sk.lai@mail.foxconn.com>
>
> ---
>  objects/control_host_obj.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/objects/control_host_obj.c b/objects/control_host_obj.c
> index 56b02de..ac72b6e 100755
> --- a/objects/control_host_obj.c
> +++ b/objects/control_host_obj.c
> @@ -21,7 +21,7 @@ GPIO fsi_data     = (GPIO){ "FSI_DATA" };
>  GPIO fsi_clk      = (GPIO){ "FSI_CLK" };
>  GPIO fsi_enable   = (GPIO){ "FSI_ENABLE" };
>  GPIO cronus_sel   = (GPIO){ "CRONUS_SEL" };
> -GPIO Throttle   = (GPIO){ "BMC_TROTTLE" };
> +GPIO Throttle     = (GPIO){ "BMC_THROTTLE" };
>  
>  /* Bit bang patterns */

Should be squashed into previous commit.

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

* Re: [PATCH skeleton 10/15] add new flash ids
  2015-12-18 23:40 ` [PATCH skeleton 10/15] add new flash ids OpenBMC Patches
@ 2016-01-14  2:59   ` Stewart Smith
  2016-01-15 22:51     ` Adriana Kobylak
  0 siblings, 1 reply; 19+ messages in thread
From: Stewart Smith @ 2016-01-14  2:59 UTC (permalink / raw)
  To: OpenBMC Patches, openbmc

OpenBMC Patches <openbmc-patches@stwcx.xyz> writes:
> From: Norman James <njames@us.ibm.com>
>
> ---
>  objects/pflash/libflash/libflash.c | 6 ++++++
>  1 file changed, 6 insertions(+)

has this gone upstream to pflash?

-- 
Stewart Smith
OPAL Architect, IBM.

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

* Re: [PATCH skeleton 10/15] add new flash ids
  2016-01-14  2:59   ` Stewart Smith
@ 2016-01-15 22:51     ` Adriana Kobylak
  0 siblings, 0 replies; 19+ messages in thread
From: Adriana Kobylak @ 2016-01-15 22:51 UTC (permalink / raw)
  To: Stewart Smith; +Cc: OpenBMC Patches, openbmc

[-- Attachment #1: Type: text/plain, Size: 818 bytes --]

I sent a patch for upstream pflash to skiboot@lists.ozlabs.org for review.





From:   Stewart Smith <stewart@linux.vnet.ibm.com>
To:     OpenBMC Patches <openbmc-patches@stwcx.xyz>, 
openbmc@lists.ozlabs.org
Date:   01/13/2016 09:14 PM
Subject:        Re: [PATCH skeleton 10/15] add new flash ids
Sent by:        "openbmc" 
<openbmc-bounces+anoo=us.ibm.com@lists.ozlabs.org>



OpenBMC Patches <openbmc-patches@stwcx.xyz> writes:
> From: Norman James <njames@us.ibm.com>
>
> ---
>  objects/pflash/libflash/libflash.c | 6 ++++++
>  1 file changed, 6 insertions(+)

has this gone upstream to pflash?

-- 
Stewart Smith
OPAL Architect, IBM.

_______________________________________________
openbmc mailing list
openbmc@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/openbmc





[-- Attachment #2: Type: text/html, Size: 1709 bytes --]

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

end of thread, other threads:[~2016-01-15 22:52 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-18 23:40 [PATCH skeleton 00/15] Add LED behavior, soft reset, voltage sensors OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 01/15] Set default LED status, pull high BMC_Throttle OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 02/15] Init GPIO Thottle, add BMC heartbeat, change power LED status OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 03/15] Fix THROTTLE typo: OpenBMC Patches
2015-12-23  1:09   ` Stewart Smith
2015-12-18 23:40 ` [PATCH skeleton 04/15] sync to 14caa527e0b10e0aece119693bf003ec95929370 OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 05/15] Add all voltage sensors OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 06/15] remove in15_input sensor OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 07/15] Remove setblinkslow OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 08/15] use real names for occ sensors OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 09/15] add introspect=False to get_object calls for performance OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 10/15] add new flash ids OpenBMC Patches
2016-01-14  2:59   ` Stewart Smith
2016-01-15 22:51     ` Adriana Kobylak
2015-12-18 23:40 ` [PATCH skeleton 11/15] new process to discover initial power state on bmc reboot OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 12/15] add softreboot OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 13/15] Add all voltage sensors OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 14/15] remove in15_input sensor OpenBMC Patches
2015-12-18 23:40 ` [PATCH skeleton 15/15] Add reset button 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.