Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 1 | ## System states |
| 2 | ## state can change to next state in 2 ways: |
| 3 | ## - a process emits a GotoSystemState signal with state name to goto |
| 4 | ## - objects specified in EXIT_STATE_DEPEND have started |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 5 | SYSTEM_STATES = [ |
Norman James | b714eb2 | 2015-10-26 17:12:57 -0500 | [diff] [blame] | 6 | 'BASE_APPS', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 7 | 'BMC_STARTING', |
| 8 | 'BMC_READY', |
| 9 | 'HOST_POWERING_ON', |
| 10 | 'HOST_POWERED_ON', |
| 11 | 'HOST_BOOTING', |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 12 | 'HOST_BOOTED', |
Adriana Kobylak | c5a1605 | 2016-03-01 14:29:47 -0600 | [diff] [blame] | 13 | 'HOST_POWERED_OFF', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 14 | ] |
| 15 | |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 16 | EXIT_STATE_DEPEND = { |
Norman James | b714eb2 | 2015-10-26 17:12:57 -0500 | [diff] [blame] | 17 | 'BASE_APPS' : { |
Norman James | 76abea3 | 2015-10-29 06:17:54 -0500 | [diff] [blame] | 18 | '/org/openbmc/sensors': 0, |
Norman James | b714eb2 | 2015-10-26 17:12:57 -0500 | [diff] [blame] | 19 | }, |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 20 | 'BMC_STARTING' : { |
| 21 | '/org/openbmc/control/chassis0': 0, |
| 22 | '/org/openbmc/control/power0' : 0, |
Adriana Kobylak | 9c75104 | 2016-02-09 13:44:32 -0600 | [diff] [blame] | 23 | '/org/openbmc/control/led/identify' : 0, |
Norman James | b38ea5a | 2015-10-28 12:44:56 -0500 | [diff] [blame] | 24 | '/org/openbmc/control/host0' : 0, |
Norman James | 2943cc6 | 2015-10-28 18:59:53 -0500 | [diff] [blame] | 25 | '/org/openbmc/control/flash/bios' : 0, |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 26 | } |
| 27 | } |
| 28 | |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 29 | ID_LOOKUP = { |
| 30 | 'FRU' : { |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 31 | 0x0d : '<inventory_root>/system/chassis', |
| 32 | 0x34 : '<inventory_root>/system/chassis/motherboard', |
Matt Spinler | cad44d6 | 2016-09-21 09:52:52 -0500 | [diff] [blame] | 33 | 0x01 : '<inventory_root>/system/chassis/motherboard/cpu', |
| 34 | 0x02 : '<inventory_root>/system/chassis/motherboard/membuf', |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 35 | 0x03 : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 36 | 0x04 : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 37 | 0x05 : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 38 | 0x06 : '<inventory_root>/system/chassis/motherboard/dimm3', |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 39 | 0x35 : '<inventory_root>/system', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 40 | }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 41 | 'FRU_STR' : { |
Norman James | fe635e8 | 2015-10-20 07:47:22 -0500 | [diff] [blame] | 42 | 'PRODUCT_15' : '<inventory_root>/system', |
| 43 | 'CHASSIS_2' : '<inventory_root>/system/chassis', |
Matt Spinler | cad44d6 | 2016-09-21 09:52:52 -0500 | [diff] [blame] | 44 | 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu', |
| 45 | 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/membuf', |
Chris Austen | 4c9ea5d | 2015-12-09 23:26:08 -0600 | [diff] [blame] | 46 | 'BOARD_14' : '<inventory_root>/system/chassis/motherboard', |
Norman James | fe635e8 | 2015-10-20 07:47:22 -0500 | [diff] [blame] | 47 | 'PRODUCT_3' : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 48 | 'PRODUCT_4' : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 49 | 'PRODUCT_5' : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 50 | 'PRODUCT_6' : '<inventory_root>/system/chassis/motherboard/dimm3', |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 51 | }, |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 52 | 'SENSOR' : { |
Chris Austen | 4c9ea5d | 2015-12-09 23:26:08 -0600 | [diff] [blame] | 53 | 0x34 : '<inventory_root>/system/chassis/motherboard', |
Chris Austen | 4c9ea5d | 2015-12-09 23:26:08 -0600 | [diff] [blame] | 54 | 0x37 : '<inventory_root>/system/chassis/motherboard/refclock', |
| 55 | 0x38 : '<inventory_root>/system/chassis/motherboard/pcieclock', |
| 56 | 0x39 : '<inventory_root>/system/chassis/motherboard/todclock', |
Matt Spinler | cad44d6 | 2016-09-21 09:52:52 -0500 | [diff] [blame] | 57 | 0x3A : '<inventory_root>/system/chassis/apss', |
| 58 | 0x2f : '<inventory_root>/system/chassis/motherboard/cpu', |
| 59 | 0x22 : '<inventory_root>/system/chassis/motherboard/cpu/core1', |
| 60 | 0x23 : '<inventory_root>/system/chassis/motherboard/cpu/core2', |
| 61 | 0x24 : '<inventory_root>/system/chassis/motherboard/cpu/core3', |
| 62 | 0x25 : '<inventory_root>/system/chassis/motherboard/cpu/core4', |
| 63 | 0x26 : '<inventory_root>/system/chassis/motherboard/cpu/core5', |
| 64 | 0x27 : '<inventory_root>/system/chassis/motherboard/cpu/core6', |
| 65 | 0x28 : '<inventory_root>/system/chassis/motherboard/cpu/core9', |
| 66 | 0x29 : '<inventory_root>/system/chassis/motherboard/cpu/core10', |
| 67 | 0x2a : '<inventory_root>/system/chassis/motherboard/cpu/core11', |
| 68 | 0x2b : '<inventory_root>/system/chassis/motherboard/cpu/core12', |
| 69 | 0x2c : '<inventory_root>/system/chassis/motherboard/cpu/core13', |
| 70 | 0x2d : '<inventory_root>/system/chassis/motherboard/cpu/core14', |
| 71 | 0x2e : '<inventory_root>/system/chassis/motherboard/membuf', |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 72 | 0x1e : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 73 | 0x1f : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 74 | 0x20 : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 75 | 0x21 : '<inventory_root>/system/chassis/motherboard/dimm3', |
Chris Austen | 4c9ea5d | 2015-12-09 23:26:08 -0600 | [diff] [blame] | 76 | 0x09 : '/org/openbmc/sensors/host/BootCount', |
| 77 | 0x05 : '/org/openbmc/sensors/host/BootProgress', |
Chris Austen | 4c9ea5d | 2015-12-09 23:26:08 -0600 | [diff] [blame] | 78 | 0x32 : '/org/openbmc/sensors/host/OperatingSystemStatus', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 79 | }, |
| 80 | 'GPIO_PRESENT' : { |
Matt Spinler | cad44d6 | 2016-09-21 09:52:52 -0500 | [diff] [blame] | 81 | 'SLOT0_PRESENT' : '<inventory_root>/system/chassis/motherboard/pciecard_x16', |
| 82 | 'SLOT1_PRESENT' : '<inventory_root>/system/chassis/motherboard/pciecard_x8', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 83 | } |
| 84 | } |
| 85 | |
| 86 | GPIO_CONFIG = {} |
Norman James | b38ea5a | 2015-10-28 12:44:56 -0500 | [diff] [blame] | 87 | GPIO_CONFIG['FSI_CLK'] = { 'gpio_pin': 'A4', 'direction': 'out' } |
| 88 | GPIO_CONFIG['FSI_DATA'] = { 'gpio_pin': 'A5', 'direction': 'out' } |
| 89 | GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_pin': 'D0', 'direction': 'out' } |
| 90 | GPIO_CONFIG['POWER_PIN'] = { 'gpio_pin': 'E1', 'direction': 'out' } |
| 91 | GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_pin': 'A6', 'direction': 'out' } |
| 92 | GPIO_CONFIG['PGOOD'] = { 'gpio_pin': 'C7', 'direction': 'in' } |
Norman James | 7b8811e | 2016-01-12 12:51:29 -0600 | [diff] [blame] | 93 | GPIO_CONFIG['BMC_THROTTLE'] = { 'gpio_pin': 'J3', 'direction': 'out' } |
Chris Austen | cd6a560 | 2016-05-24 13:33:51 -0500 | [diff] [blame] | 94 | GPIO_CONFIG['IDBTN'] = { 'gpio_pin': 'Q7', 'direction': 'out' } |
Norman James | 2943cc6 | 2015-10-28 18:59:53 -0500 | [diff] [blame] | 95 | GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_pin': 'E0', 'direction': 'both' } |
Norman James | e62f445 | 2015-10-31 17:33:10 -0500 | [diff] [blame] | 96 | GPIO_CONFIG['PCIE_RESET'] = { 'gpio_pin': 'B5', 'direction': 'out' } |
| 97 | GPIO_CONFIG['USB_RESET'] = { 'gpio_pin': 'B6', 'direction': 'out' } |
Norman James | b38ea5a | 2015-10-28 12:44:56 -0500 | [diff] [blame] | 98 | GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_pin': 'N0', 'direction': 'in' } |
| 99 | GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_pin': 'N1', 'direction': 'in' } |
| 100 | GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_pin': 'N2', 'direction': 'in' } |
| 101 | GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_pin': 'N3', 'direction': 'in' } |
| 102 | GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_pin': 'N4', 'direction': 'in' } |
| 103 | GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_pin': 'N5', 'direction': 'in' } |
| 104 | GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_pin': 'O0', 'direction': 'in' } |
| 105 | GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_pin': 'O1', 'direction': 'in' } |
Adriana Kobylak | 341c8c2 | 2016-06-16 09:20:55 -0500 | [diff] [blame] | 106 | GPIO_CONFIG['CHECKSTOP'] = { 'gpio_pin': 'P5', 'direction': 'falling' } |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 107 | |
Lei YU | 75a18a2 | 2016-11-22 01:47:47 +0800 | [diff] [blame] | 108 | GPIO_CONFIGS = { |
| 109 | 'power_config' : { |
| 110 | 'power_good_in' : 'PGOOD', |
| 111 | 'power_up_outs' : [ |
| 112 | ('POWER_PIN', False), |
| 113 | ], |
| 114 | 'reset_outs' : [ |
| 115 | ('USB_RESET', False), |
| 116 | ], |
| 117 | 'pci_reset_outs': [ |
| 118 | # net name, polarity, reset hold |
| 119 | ('PCIE_RESET', False, False), |
| 120 | ], |
| 121 | }, |
| 122 | 'hostctl_config' : { |
| 123 | 'fsi_data' : 'FSI_DATA', |
| 124 | 'fsi_clk' : 'FSI_CLK', |
| 125 | 'fsi_enable' : 'FSI_ENABLE', |
| 126 | 'cronus_sel' : 'CRONUS_SEL', |
| 127 | 'optionals' : [ |
| 128 | ('BMC_THROTTLE', True), |
| 129 | ('IDBTN', False), |
| 130 | ], |
| 131 | }, |
Xo Wang | 4088ec3 | 2016-09-22 13:00:58 -0700 | [diff] [blame] | 132 | } |
| 133 | |
Yi Li | 54decc8 | 2016-05-05 17:42:56 +0800 | [diff] [blame] | 134 | # Miscellaneous non-poll sensor with system specific properties. |
| 135 | # The sensor id is the same as those defined in ID_LOOKUP['SENSOR']. |
| 136 | MISC_SENSORS = { |
| 137 | 0x09 : { 'class' : 'BootCountSensor' }, |
| 138 | 0x05 : { 'class' : 'BootProgressSensor' }, |
Yi Li | 54decc8 | 2016-05-05 17:42:56 +0800 | [diff] [blame] | 139 | 0x32 : { 'class' : 'OperatingSystemStatusSensor' }, |
Yi Li | 54decc8 | 2016-05-05 17:42:56 +0800 | [diff] [blame] | 140 | } |
Brad Bishop | 5306675 | 2016-09-21 08:48:04 -0400 | [diff] [blame] | 141 | |
| 142 | # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 |