Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 1 | HOME_PATH = './' |
Norman James | a9966b3 | 2015-10-28 06:55:58 -0500 | [diff] [blame] | 2 | GPIO_BASE = 320 |
Norman James | 969227c | 2015-10-08 15:10:47 -0500 | [diff] [blame] | 3 | SYSTEM_NAME = "Palmetto" |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 4 | |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 5 | |
| 6 | ## System states |
| 7 | ## state can change to next state in 2 ways: |
| 8 | ## - a process emits a GotoSystemState signal with state name to goto |
| 9 | ## - objects specified in EXIT_STATE_DEPEND have started |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 10 | SYSTEM_STATES = [ |
Norman James | b714eb2 | 2015-10-26 17:12:57 -0500 | [diff] [blame] | 11 | 'BASE_APPS', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 12 | 'BMC_STARTING', |
| 13 | 'BMC_READY', |
| 14 | 'HOST_POWERING_ON', |
| 15 | 'HOST_POWERED_ON', |
| 16 | 'HOST_BOOTING', |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 17 | 'HOST_BOOTED', |
Adriana Kobylak | c5a1605 | 2016-03-01 14:29:47 -0600 | [diff] [blame] | 18 | 'HOST_POWERED_OFF', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 19 | ] |
| 20 | |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 21 | EXIT_STATE_DEPEND = { |
Norman James | b714eb2 | 2015-10-26 17:12:57 -0500 | [diff] [blame] | 22 | 'BASE_APPS' : { |
Norman James | 76abea3 | 2015-10-29 06:17:54 -0500 | [diff] [blame] | 23 | '/org/openbmc/sensors': 0, |
Norman James | b714eb2 | 2015-10-26 17:12:57 -0500 | [diff] [blame] | 24 | }, |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 25 | 'BMC_STARTING' : { |
| 26 | '/org/openbmc/control/chassis0': 0, |
| 27 | '/org/openbmc/control/power0' : 0, |
Adriana Kobylak | 9c75104 | 2016-02-09 13:44:32 -0600 | [diff] [blame] | 28 | '/org/openbmc/control/led/identify' : 0, |
Norman James | b38ea5a | 2015-10-28 12:44:56 -0500 | [diff] [blame] | 29 | '/org/openbmc/control/host0' : 0, |
Norman James | 2943cc6 | 2015-10-28 18:59:53 -0500 | [diff] [blame] | 30 | '/org/openbmc/control/flash/bios' : 0, |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 31 | } |
| 32 | } |
| 33 | |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 34 | CACHED_INTERFACES = { |
| 35 | "org.openbmc.InventoryItem" : True, |
| 36 | "org.openbmc.control.Chassis" : True, |
| 37 | } |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 38 | INVENTORY_ROOT = '/org/openbmc/inventory' |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 39 | |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 40 | ID_LOOKUP = { |
| 41 | 'FRU' : { |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 42 | 0x0d : '<inventory_root>/system/chassis', |
| 43 | 0x34 : '<inventory_root>/system/chassis/motherboard', |
Matt Spinler | cad44d6 | 2016-09-21 09:52:52 -0500 | [diff] [blame] | 44 | 0x01 : '<inventory_root>/system/chassis/motherboard/cpu', |
| 45 | 0x02 : '<inventory_root>/system/chassis/motherboard/membuf', |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 46 | 0x03 : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 47 | 0x04 : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 48 | 0x05 : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 49 | 0x06 : '<inventory_root>/system/chassis/motherboard/dimm3', |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 50 | 0x35 : '<inventory_root>/system', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 51 | }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 52 | 'FRU_STR' : { |
Norman James | fe635e8 | 2015-10-20 07:47:22 -0500 | [diff] [blame] | 53 | 'PRODUCT_15' : '<inventory_root>/system', |
| 54 | 'CHASSIS_2' : '<inventory_root>/system/chassis', |
Matt Spinler | cad44d6 | 2016-09-21 09:52:52 -0500 | [diff] [blame] | 55 | 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu', |
| 56 | 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/membuf', |
Chris Austen | 4c9ea5d | 2015-12-09 23:26:08 -0600 | [diff] [blame] | 57 | 'BOARD_14' : '<inventory_root>/system/chassis/motherboard', |
Norman James | fe635e8 | 2015-10-20 07:47:22 -0500 | [diff] [blame] | 58 | 'PRODUCT_3' : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 59 | 'PRODUCT_4' : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 60 | 'PRODUCT_5' : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 61 | 'PRODUCT_6' : '<inventory_root>/system/chassis/motherboard/dimm3', |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 62 | }, |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 63 | 'SENSOR' : { |
Chris Austen | 4c9ea5d | 2015-12-09 23:26:08 -0600 | [diff] [blame] | 64 | 0x34 : '<inventory_root>/system/chassis/motherboard', |
Chris Austen | 4c9ea5d | 2015-12-09 23:26:08 -0600 | [diff] [blame] | 65 | 0x37 : '<inventory_root>/system/chassis/motherboard/refclock', |
| 66 | 0x38 : '<inventory_root>/system/chassis/motherboard/pcieclock', |
| 67 | 0x39 : '<inventory_root>/system/chassis/motherboard/todclock', |
Matt Spinler | cad44d6 | 2016-09-21 09:52:52 -0500 | [diff] [blame] | 68 | 0x3A : '<inventory_root>/system/chassis/apss', |
| 69 | 0x2f : '<inventory_root>/system/chassis/motherboard/cpu', |
| 70 | 0x22 : '<inventory_root>/system/chassis/motherboard/cpu/core1', |
| 71 | 0x23 : '<inventory_root>/system/chassis/motherboard/cpu/core2', |
| 72 | 0x24 : '<inventory_root>/system/chassis/motherboard/cpu/core3', |
| 73 | 0x25 : '<inventory_root>/system/chassis/motherboard/cpu/core4', |
| 74 | 0x26 : '<inventory_root>/system/chassis/motherboard/cpu/core5', |
| 75 | 0x27 : '<inventory_root>/system/chassis/motherboard/cpu/core6', |
| 76 | 0x28 : '<inventory_root>/system/chassis/motherboard/cpu/core9', |
| 77 | 0x29 : '<inventory_root>/system/chassis/motherboard/cpu/core10', |
| 78 | 0x2a : '<inventory_root>/system/chassis/motherboard/cpu/core11', |
| 79 | 0x2b : '<inventory_root>/system/chassis/motherboard/cpu/core12', |
| 80 | 0x2c : '<inventory_root>/system/chassis/motherboard/cpu/core13', |
| 81 | 0x2d : '<inventory_root>/system/chassis/motherboard/cpu/core14', |
| 82 | 0x2e : '<inventory_root>/system/chassis/motherboard/membuf', |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 83 | 0x1e : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 84 | 0x1f : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 85 | 0x20 : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 86 | 0x21 : '<inventory_root>/system/chassis/motherboard/dimm3', |
Chris Austen | 4c9ea5d | 2015-12-09 23:26:08 -0600 | [diff] [blame] | 87 | 0x09 : '/org/openbmc/sensors/host/BootCount', |
| 88 | 0x05 : '/org/openbmc/sensors/host/BootProgress', |
Norman James | 86f2a07 | 2016-01-30 22:48:54 -0600 | [diff] [blame] | 89 | 0x08 : '/org/openbmc/sensors/host/cpu0/OccStatus', |
Chris Austen | 4c9ea5d | 2015-12-09 23:26:08 -0600 | [diff] [blame] | 90 | 0x32 : '/org/openbmc/sensors/host/OperatingSystemStatus', |
| 91 | 0x33 : '/org/openbmc/sensors/host/PowerCap', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 92 | }, |
| 93 | 'GPIO_PRESENT' : { |
Matt Spinler | cad44d6 | 2016-09-21 09:52:52 -0500 | [diff] [blame] | 94 | 'SLOT0_PRESENT' : '<inventory_root>/system/chassis/motherboard/pciecard_x16', |
| 95 | 'SLOT1_PRESENT' : '<inventory_root>/system/chassis/motherboard/pciecard_x8', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 96 | } |
| 97 | } |
| 98 | |
| 99 | GPIO_CONFIG = {} |
Norman James | b38ea5a | 2015-10-28 12:44:56 -0500 | [diff] [blame] | 100 | GPIO_CONFIG['FSI_CLK'] = { 'gpio_pin': 'A4', 'direction': 'out' } |
| 101 | GPIO_CONFIG['FSI_DATA'] = { 'gpio_pin': 'A5', 'direction': 'out' } |
| 102 | GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_pin': 'D0', 'direction': 'out' } |
| 103 | GPIO_CONFIG['POWER_PIN'] = { 'gpio_pin': 'E1', 'direction': 'out' } |
| 104 | GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_pin': 'A6', 'direction': 'out' } |
| 105 | GPIO_CONFIG['PGOOD'] = { 'gpio_pin': 'C7', 'direction': 'in' } |
Norman James | 7b8811e | 2016-01-12 12:51:29 -0600 | [diff] [blame] | 106 | GPIO_CONFIG['BMC_THROTTLE'] = { 'gpio_pin': 'J3', 'direction': 'out' } |
Chris Austen | cd6a560 | 2016-05-24 13:33:51 -0500 | [diff] [blame] | 107 | GPIO_CONFIG['IDBTN'] = { 'gpio_pin': 'Q7', 'direction': 'out' } |
Norman James | 2943cc6 | 2015-10-28 18:59:53 -0500 | [diff] [blame] | 108 | GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_pin': 'E0', 'direction': 'both' } |
Norman James | e62f445 | 2015-10-31 17:33:10 -0500 | [diff] [blame] | 109 | GPIO_CONFIG['PCIE_RESET'] = { 'gpio_pin': 'B5', 'direction': 'out' } |
| 110 | GPIO_CONFIG['USB_RESET'] = { 'gpio_pin': 'B6', 'direction': 'out' } |
Norman James | b38ea5a | 2015-10-28 12:44:56 -0500 | [diff] [blame] | 111 | GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_pin': 'N0', 'direction': 'in' } |
| 112 | GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_pin': 'N1', 'direction': 'in' } |
| 113 | GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_pin': 'N2', 'direction': 'in' } |
| 114 | GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_pin': 'N3', 'direction': 'in' } |
| 115 | GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_pin': 'N4', 'direction': 'in' } |
| 116 | GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_pin': 'N5', 'direction': 'in' } |
| 117 | GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_pin': 'O0', 'direction': 'in' } |
| 118 | GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_pin': 'O1', 'direction': 'in' } |
Adriana Kobylak | 341c8c2 | 2016-06-16 09:20:55 -0500 | [diff] [blame] | 119 | GPIO_CONFIG['CHECKSTOP'] = { 'gpio_pin': 'P5', 'direction': 'falling' } |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 120 | |
Norman James | 6bbe0b5 | 2015-10-27 09:18:05 -0500 | [diff] [blame] | 121 | def convertGpio(name): |
| 122 | name = name.upper() |
| 123 | c = name[0:1] |
Norman James | a9966b3 | 2015-10-28 06:55:58 -0500 | [diff] [blame] | 124 | offset = int(name[1:]) |
Norman James | 6bbe0b5 | 2015-10-27 09:18:05 -0500 | [diff] [blame] | 125 | a = ord(c)-65 |
Norman James | a9966b3 | 2015-10-28 06:55:58 -0500 | [diff] [blame] | 126 | base = a*8+GPIO_BASE |
Norman James | 7b8811e | 2016-01-12 12:51:29 -0600 | [diff] [blame] | 127 | return base+offset |
| 128 | |
| 129 | HWMON_CONFIG = { |
| 130 | '2-004c' : { |
| 131 | 'names' : { |
Edward A. James | c14f6fe | 2016-08-11 11:02:15 -0500 | [diff] [blame] | 132 | 'temp1_input' : { 'object_path' : 'temperature/ambient','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, |
Norman James | 7b8811e | 2016-01-12 12:51:29 -0600 | [diff] [blame] | 133 | } |
Yi Li | 155f93f | 2016-01-30 15:30:14 +0800 | [diff] [blame] | 134 | }, |
| 135 | '3-0050' : { |
| 136 | 'names' : { |
| 137 | 'caps_curr_powercap' : { 'object_path' : 'powercap/curr_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, |
| 138 | 'caps_curr_powerreading' : { 'object_path' : 'powercap/system_power','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, |
| 139 | 'caps_max_powercap' : { 'object_path' : 'powercap/max_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, |
| 140 | 'caps_min_powercap' : { 'object_path' : 'powercap/min_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, |
| 141 | 'caps_norm_powercap' : { 'object_path' : 'powercap/n_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, |
| 142 | 'caps_user_powerlimit' : { 'object_path' : 'powercap/user_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, |
| 143 | } |
Norman James | 7b8811e | 2016-01-12 12:51:29 -0600 | [diff] [blame] | 144 | } |
| 145 | } |
Yi Li | 54decc8 | 2016-05-05 17:42:56 +0800 | [diff] [blame] | 146 | |
| 147 | # Miscellaneous non-poll sensor with system specific properties. |
| 148 | # The sensor id is the same as those defined in ID_LOOKUP['SENSOR']. |
| 149 | MISC_SENSORS = { |
| 150 | 0x09 : { 'class' : 'BootCountSensor' }, |
| 151 | 0x05 : { 'class' : 'BootProgressSensor' }, |
| 152 | 0x08 : { 'class' : 'OccStatusSensor', |
| 153 | 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0050/online' }, |
| 154 | 0x32 : { 'class' : 'OperatingSystemStatusSensor' }, |
| 155 | 0x33 : { 'class' : 'PowerCap', |
| 156 | 'os_path' : '/sys/class/hwmon/hwmon1/user_powercap' }, |
| 157 | } |