Merge pull request #23 from williamspatrick/update_for_ken

Update for ken
diff --git a/Makefile b/Makefile
old mode 100644
new mode 100755
index e3875ad..ea2dde2
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@
 %.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 @@
 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 e93f881..f068ea1 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -36,7 +36,7 @@
 		'/org/openbmc/inventory/system/chassis/io_board' : 0,
 	},
 	'BMC_STARTING2' : {
-		'/org/openbmc/control/fans' : 0,	
+		'/org/openbmc/control/fans' : 0,
 		'/org/openbmc/control/chassis0': 0,
 	},
 }
@@ -44,7 +44,7 @@
 ## method will be called when state is entered
 ENTER_STATE_CALLBACK = {
 	'HOST_POWERED_ON' : {
-		'boot' : { 
+		'boot' : {
 			'bus_name'    : 'org.openbmc.control.Host',
 			'obj_name'    : '/org/openbmc/control/host0',
 			'interface_name' : 'org.openbmc.control.Host',
@@ -53,19 +53,32 @@
 			'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',
 		}
 	},
+	'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/BMC_READY',
+			'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',
 			'interface_name' : 'org.openbmc.Flash',
-		},
+		}
 	}
 }
 
@@ -115,7 +128,7 @@
 		'monitor_process' : True,
 		'process_name'    : 'host_watchdog.exe',
 	},
-	'power_control' : {	
+	'power_control' : {
 		'system_state'    : 'BMC_STARTING',
 		'start_process'   : True,
 		'monitor_process' : True,
@@ -128,6 +141,15 @@
 		'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,
@@ -232,7 +254,7 @@
 	'<inventory_root>/system/chassis/motherboard/cpu1/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, },
 	'<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/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, },
@@ -393,7 +415,7 @@
 		0x37 : '<inventory_root>/system/chassis/motherboard/refclock',
 		0x38 : '<inventory_root>/system/chassis/motherboard/pcieclock',
 		0x39 : '<inventory_root>/system/chassis/motherboard/todclock',
-		0x3A : '<inventory_root>/system/chassis/motherboard/apss', 
+		0x3A : '<inventory_root>/system/chassis/motherboard/apss',
 		0x0c : '<inventory_root>/system/chassis/motherboard/cpu0',
                 0x0e : '<inventory_root>/system/chassis/motherboard/cpu1',
 		0xc8 : '<inventory_root>/system/chassis/motherboard/cpu0/core0',
@@ -459,7 +481,7 @@
                 0x2c : '<inventory_root>/system/chassis/motherboard/dimm28',
                 0x2d : '<inventory_root>/system/chassis/motherboard/dimm29',
                 0x2e : '<inventory_root>/system/chassis/motherboard/dimm30',
-                0x2f : '<inventory_root>/system/chassis/motherboard/dimm31',	
+                0x2f : '<inventory_root>/system/chassis/motherboard/dimm31',
 		0x09 : '/org/openbmc/sensors/host/BootCount',
 		0x05 : '/org/openbmc/sensors/host/BootProgress',
 		0x04 : '/org/openbmc/sensors/host/HostStatus',
@@ -468,14 +490,14 @@
 		0x33 : '/org/openbmc/sensors/host/powercap',
 	},
 	'GPIO_PRESENT' : {
-		'SLOT0_RISER_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0_riser', 
-		'SLOT1_RISER_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1_riser', 
-		'SLOT2_RISER_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot2_riser', 
-		'SLOT0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0', 
-		'SLOT1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1', 
-		'SLOT2_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot2', 
-		'MEZZ0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_mezz0', 
-		'MEZZ1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_mezz1', 
+		'SLOT0_RISER_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0_riser',
+		'SLOT1_RISER_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1_riser',
+		'SLOT2_RISER_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot2_riser',
+		'SLOT0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0',
+		'SLOT1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1',
+		'SLOT2_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot2',
+		'MEZZ0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_mezz0',
+		'MEZZ1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_mezz1',
 	}
 }
 
@@ -491,6 +513,16 @@
 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' }
@@ -511,7 +543,7 @@
 
 HWMON_CONFIG = {
 	'0-004a' :  {
-		'names' : { 
+		'names' : {
 			'temp1_input' : { 'object_path' : 'temperature/ambient','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
 		}
 	},
@@ -519,7 +551,21 @@
 		'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' : '' },
+                        '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' : '' },
 		}
 	},
 	'6-002e' : {
@@ -527,8 +573,22 @@
 			'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' : '' },
 		}
-	},
+         },
 	'3-0050' : {
 		'labels' : {
 		'176' :  { 'object_path' : 'temperature/cpu0/core0','poll_interval' : 5000,'scale' : 1000,'units' : 'C' },
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 @@
 		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 @@
 
 	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/includes/gpio.c b/includes/gpio.c
old mode 100644
new mode 100755
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;
+}
+
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 @@
 	//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);

diff --git a/objects/control_host_obj.c b/objects/control_host_obj.c
old mode 100644
new mode 100755
index 672ef85..ac72b6e
--- a/objects/control_host_obj.c
+++ b/objects/control_host_obj.c
@@ -21,6 +21,7 @@
 GPIO fsi_clk      = (GPIO){ "FSI_CLK" };

 GPIO fsi_enable   = (GPIO){ "FSI_ENABLE" };

 GPIO cronus_sel   = (GPIO){ "CRONUS_SEL" };

+GPIO Throttle     = (GPIO){ "BMC_THROTTLE" };

 

 /* Bit bang patterns */

 

@@ -102,12 +103,14 @@
 		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 @@
 	gpio_close(&fsi_data);

 	gpio_close(&fsi_enable);

 	gpio_close(&cronus_sel);

+	gpio_close(&Throttle);

 

 	control_host_emit_booted(host);

 	return TRUE;

@@ -221,6 +225,7 @@
 	gpio_init(connection,&fsi_clk);

 	gpio_init(connection,&fsi_enable);

 	gpio_init(connection,&cronus_sel);

+	gpio_init(connection,&Throttle);

 	emit_object_added((GDBusObjectManager*)manager); 	

 }

 

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 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"}

 };