xref: /openbmc/skeleton/configs/Garrison.py (revision c14f6fec)
140a360c2SBrad Bishop#! /usr/bin/python
240a360c2SBrad Bishop
340a360c2SBrad BishopHOME_PATH = './'
440a360c2SBrad BishopGPIO_BASE = 320
540a360c2SBrad BishopSYSTEM_NAME = "Garrison"
640a360c2SBrad Bishop
740a360c2SBrad Bishop
840a360c2SBrad Bishop## System states
940a360c2SBrad Bishop##   state can change to next state in 2 ways:
1040a360c2SBrad Bishop##   - a process emits a GotoSystemState signal with state name to goto
1140a360c2SBrad Bishop##   - objects specified in EXIT_STATE_DEPEND have started
1240a360c2SBrad BishopSYSTEM_STATES = [
1340a360c2SBrad Bishop    'BASE_APPS',
1440a360c2SBrad Bishop    'BMC_STARTING',
1540a360c2SBrad Bishop    'BMC_READY',
1640a360c2SBrad Bishop    'HOST_POWERING_ON',
1740a360c2SBrad Bishop    'HOST_POWERED_ON',
1840a360c2SBrad Bishop    'HOST_BOOTING',
1940a360c2SBrad Bishop    'HOST_BOOTED',
2040a360c2SBrad Bishop    'HOST_POWERED_OFF',
2140a360c2SBrad Bishop]
2240a360c2SBrad Bishop
2340a360c2SBrad BishopEXIT_STATE_DEPEND = {
2440a360c2SBrad Bishop    'BASE_APPS' : {
2540a360c2SBrad Bishop        '/org/openbmc/sensors': 0,
2640a360c2SBrad Bishop    },
2740a360c2SBrad Bishop    'BMC_STARTING' : {
2840a360c2SBrad Bishop        '/org/openbmc/control/chassis0': 0,
2940a360c2SBrad Bishop        '/org/openbmc/control/power0' : 0,
3040a360c2SBrad Bishop        '/org/openbmc/control/host0' : 0,
3140a360c2SBrad Bishop        '/org/openbmc/control/flash/bios' : 0,
3240a360c2SBrad Bishop    },
3340a360c2SBrad Bishop}
3440a360c2SBrad Bishop
3540a360c2SBrad Bishop## method will be called when state is entered
3640a360c2SBrad BishopENTER_STATE_CALLBACK = {
3740a360c2SBrad Bishop    'HOST_POWERED_ON' : {
3840a360c2SBrad Bishop        'boot' : {
3940a360c2SBrad Bishop            'bus_name'    : 'org.openbmc.control.Host',
4040a360c2SBrad Bishop            'obj_name'    : '/org/openbmc/control/host0',
4140a360c2SBrad Bishop            'interface_name' : 'org.openbmc.control.Host',
4240a360c2SBrad Bishop        },
4340a360c2SBrad Bishop    },
4440a360c2SBrad Bishop    'HOST_POWERED_OFF' : {
4540a360c2SBrad Bishop        'setOff' : {
4640a360c2SBrad Bishop            'bus_name'   : 'org.openbmc.control.led',
4740a360c2SBrad Bishop            'obj_name'   : '/org/openbmc/control/led/identify',
4840a360c2SBrad Bishop            'interface_name' : 'org.openbmc.Led',
4940a360c2SBrad Bishop        }
5040a360c2SBrad Bishop    },
5140a360c2SBrad Bishop    'BMC_READY' : {
5240a360c2SBrad Bishop        'setOn' : {
5340a360c2SBrad Bishop            'bus_name'   : 'org.openbmc.control.led',
5440a360c2SBrad Bishop            'obj_name'   : '/org/openbmc/control/led/beep',
5540a360c2SBrad Bishop            'interface_name' : 'org.openbmc.Led',
5640a360c2SBrad Bishop        },
5740a360c2SBrad Bishop        'init' : {
5840a360c2SBrad Bishop            'bus_name'   : 'org.openbmc.control.Flash',
5940a360c2SBrad Bishop            'obj_name'   : '/org/openbmc/control/flash/bios',
6040a360c2SBrad Bishop            'interface_name' : 'org.openbmc.Flash',
6140a360c2SBrad Bishop        }
6240a360c2SBrad Bishop    }
6340a360c2SBrad Bishop}
6440a360c2SBrad Bishop
6540a360c2SBrad BishopAPPS = {
6640a360c2SBrad Bishop    'startup_hacks' : {
6740a360c2SBrad Bishop        'system_state'    : 'BASE_APPS',
6840a360c2SBrad Bishop        'start_process'   : True,
6940a360c2SBrad Bishop        'monitor_process' : False,
7040a360c2SBrad Bishop        'process_name'    : 'startup_hacks.sh',
7140a360c2SBrad Bishop    },
7240a360c2SBrad Bishop    'inventory' : {
7340a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
7440a360c2SBrad Bishop        'start_process'   : True,
7540a360c2SBrad Bishop        'monitor_process' : True,
7640a360c2SBrad Bishop        'process_name'    : 'inventory_items.py',
7740a360c2SBrad Bishop        'args'            : [ SYSTEM_NAME ]
7840a360c2SBrad Bishop    },
7940a360c2SBrad Bishop    'hwmon' : {
8040a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
8140a360c2SBrad Bishop        'start_process'   : True,
8240a360c2SBrad Bishop        'monitor_process' : True,
8340a360c2SBrad Bishop        'process_name'    : 'hwmon.py',
8440a360c2SBrad Bishop        'args'            : [ SYSTEM_NAME ]
8540a360c2SBrad Bishop    },
8640a360c2SBrad Bishop    'sensor_manager' : {
8740a360c2SBrad Bishop        'system_state'    : 'BASE_APPS',
8840a360c2SBrad Bishop        'start_process'   : True,
8940a360c2SBrad Bishop        'monitor_process' : True,
9040a360c2SBrad Bishop        'process_name'    : 'sensor_manager2.py',
9140a360c2SBrad Bishop        'args'            : [ SYSTEM_NAME ]
9240a360c2SBrad Bishop    },
9340a360c2SBrad Bishop    'host_watchdog' : {
9440a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
9540a360c2SBrad Bishop        'start_process'   : True,
9640a360c2SBrad Bishop        'monitor_process' : True,
9740a360c2SBrad Bishop        'process_name'    : 'host_watchdog.exe',
9840a360c2SBrad Bishop    },
9940a360c2SBrad Bishop    'power_control' : {
10040a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
10140a360c2SBrad Bishop        'start_process'   : True,
10240a360c2SBrad Bishop        'monitor_process' : True,
10340a360c2SBrad Bishop        'process_name' : 'power_control.exe',
10440a360c2SBrad Bishop        'args' : [ '3000', '10' ]
10540a360c2SBrad Bishop    },
10640a360c2SBrad Bishop    'power_button' : {
10740a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
10840a360c2SBrad Bishop        'start_process'   : True,
10940a360c2SBrad Bishop        'monitor_process' : True,
11040a360c2SBrad Bishop        'process_name'    : 'button_power.exe',
11140a360c2SBrad Bishop    },
11240a360c2SBrad Bishop    'reset_button' : {
11340a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
11440a360c2SBrad Bishop        'start_process'   : True,
11540a360c2SBrad Bishop        'monitor_process' : True,
11640a360c2SBrad Bishop        'process_name'    : 'button_reset.exe',
11740a360c2SBrad Bishop    },
118b4140b88SAdriana Kobylak    'host_checkstop' : {
119b4140b88SAdriana Kobylak        'system_state'    : 'BMC_STARTING',
120b4140b88SAdriana Kobylak        'start_process'   : True,
121b4140b88SAdriana Kobylak        'monitor_process' : True,
122b4140b88SAdriana Kobylak        'process_name'    : 'host_checkstop.exe',
123b4140b88SAdriana Kobylak    },
12440a360c2SBrad Bishop    'led_control' : {
12540a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
12640a360c2SBrad Bishop        'start_process'   : True,
12740a360c2SBrad Bishop        'monitor_process' : True,
12840a360c2SBrad Bishop        'process_name'    : 'led_controller.exe',
12940a360c2SBrad Bishop    },
13040a360c2SBrad Bishop    'flash_control' : {
13140a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
13240a360c2SBrad Bishop        'start_process'   : True,
13340a360c2SBrad Bishop        'monitor_process' : True,
13440a360c2SBrad Bishop        'process_name'    : 'flash_bios.exe',
13540a360c2SBrad Bishop    },
13640a360c2SBrad Bishop    'bmc_flash_control' : {
13740a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
13840a360c2SBrad Bishop        'start_process'   : True,
13940a360c2SBrad Bishop        'monitor_process' : True,
14040a360c2SBrad Bishop        'process_name'    : 'bmc_update.py',
14140a360c2SBrad Bishop    },
14240a360c2SBrad Bishop    'download_manager' : {
14340a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
14440a360c2SBrad Bishop        'start_process'   : True,
14540a360c2SBrad Bishop        'monitor_process' : True,
14640a360c2SBrad Bishop        'process_name'    : 'download_manager.py',
14740a360c2SBrad Bishop        'args'            : [ SYSTEM_NAME ]
14840a360c2SBrad Bishop    },
14940a360c2SBrad Bishop    'host_control' : {
15040a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
15140a360c2SBrad Bishop        'start_process'   : True,
15240a360c2SBrad Bishop        'monitor_process' : True,
15340a360c2SBrad Bishop        'process_name'    : 'control_host.exe',
15440a360c2SBrad Bishop    },
15540a360c2SBrad Bishop    'chassis_control' : {
15640a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
15740a360c2SBrad Bishop        'start_process'   : True,
15840a360c2SBrad Bishop        'monitor_process' : True,
15940a360c2SBrad Bishop        'process_name'    : 'chassis_control.py',
16040a360c2SBrad Bishop    },
16140a360c2SBrad Bishop    'restore' : {
16240a360c2SBrad Bishop        'system_state'    : 'BMC_READY',
16340a360c2SBrad Bishop        'start_process'   : True,
16440a360c2SBrad Bishop        'monitor_process' : False,
16540a360c2SBrad Bishop        'process_name'    : 'discover_system_state.py',
16640a360c2SBrad Bishop    },
16740a360c2SBrad Bishop    'bmc_control' : {
16840a360c2SBrad Bishop        'system_state'    : 'BMC_STARTING',
16940a360c2SBrad Bishop        'start_process'   : True,
17040a360c2SBrad Bishop        'monitor_process' : True,
17140a360c2SBrad Bishop        'process_name'    : 'control_bmc.exe',
17240a360c2SBrad Bishop    },
17340a360c2SBrad Bishop}
17440a360c2SBrad Bishop
17540a360c2SBrad BishopCACHED_INTERFACES = {
17640a360c2SBrad Bishop        "org.openbmc.InventoryItem" : True,
17740a360c2SBrad Bishop        "org.openbmc.control.Chassis" : True,
17840a360c2SBrad Bishop}
17940a360c2SBrad Bishop
18040a360c2SBrad BishopINVENTORY_ROOT = '/org/openbmc/inventory'
18140a360c2SBrad Bishop
18240a360c2SBrad BishopFRU_INSTANCES = {
18340a360c2SBrad Bishop    '<inventory_root>/system' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" },
18440a360c2SBrad Bishop    '<inventory_root>/system/bios' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" },
18540a360c2SBrad Bishop    '<inventory_root>/system/misc' : { 'fru_type' : 'SYSTEM','is_fru' : False, },
18640a360c2SBrad Bishop
18740a360c2SBrad Bishop    '<inventory_root>/system/chassis' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" },
18840a360c2SBrad Bishop
18940a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard' : { 'fru_type' : 'MAIN_PLANAR','is_fru' : True, },
19040a360c2SBrad Bishop
19140a360c2SBrad Bishop    '<inventory_root>/system/systemevent'                  : { 'fru_type' : 'SYSTEM_EVENT', 'is_fru' : False, },
19240a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/refclock' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, },
19340a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/pcieclock': { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, },
19440a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/todclock' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, },
19540a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/apss'     : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, },
19640a360c2SBrad Bishop
19740a360c2SBrad Bishop    '<inventory_root>/system/chassis/fan0' : { 'fru_type' : 'FAN','is_fru' : True, },
19840a360c2SBrad Bishop    '<inventory_root>/system/chassis/fan1' : { 'fru_type' : 'FAN','is_fru' : True, },
19940a360c2SBrad Bishop    '<inventory_root>/system/chassis/fan2' : { 'fru_type' : 'FAN','is_fru' : True, },
20040a360c2SBrad Bishop    '<inventory_root>/system/chassis/fan3' : { 'fru_type' : 'FAN','is_fru' : True, },
20140a360c2SBrad Bishop
20240a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/bmc' : { 'fru_type' : 'BMC','is_fru' : False, 'manufacturer' : 'ASPEED' },
20340a360c2SBrad Bishop
20440a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0' : { 'fru_type' : 'CPU', 'is_fru' : True, },
20540a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1' : { 'fru_type' : 'CPU', 'is_fru' : True, },
20640a360c2SBrad Bishop
20740a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, },
20840a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, },
20940a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, },
21040a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, },
21140a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, },
21240a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, },
21340a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, },
21440a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, },
21540a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, },
21640a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, },
21740a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core10': { 'fru_type' : 'CORE', 'is_fru' : False, },
21840a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu0/core11': { 'fru_type' : 'CORE', 'is_fru' : False, },
21940a360c2SBrad Bishop
22040a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, },
22140a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, },
22240a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, },
22340a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, },
22440a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, },
22540a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, },
22640a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, },
22740a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, },
22840a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, },
22940a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, },
23040a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core10' : { 'fru_type' : 'CORE', 'is_fru' : False, },
23140a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/cpu1/core11' : { 'fru_type' : 'CORE', 'is_fru' : False, },
23240a360c2SBrad Bishop
23340a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/membuf0' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
23440a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/membuf1' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
23540a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/membuf2' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
23640a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/membuf3' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
23740a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/membuf4' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
23840a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/membuf5' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
23940a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/membuf6' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
24040a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/membuf7' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
24140a360c2SBrad Bishop
24240a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm0' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
24340a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm1' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
24440a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm2' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
24540a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm3' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
24640a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm4' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
24740a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm5' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
24840a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm6' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
24940a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm7' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
25040a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm8' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
25140a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm9' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
25240a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm10' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
25340a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm11' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
25440a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm12' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
25540a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm13' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
25640a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm14' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
25740a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm15' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
25840a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm16' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
25940a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm17' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
26040a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm18' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
26140a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm19' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
26240a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm20' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
26340a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm21' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
26440a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm22' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
26540a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm23' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
26640a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm24' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
26740a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm25' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
26840a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm26' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
26940a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm27' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
27040a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm28' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
27140a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm29' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
27240a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm30' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
27340a360c2SBrad Bishop    '<inventory_root>/system/chassis/motherboard/dimm31' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
27440a360c2SBrad Bishop}
27540a360c2SBrad Bishop
27640a360c2SBrad BishopID_LOOKUP = {
27740a360c2SBrad Bishop    'FRU' : {
27840a360c2SBrad Bishop        0x01 : '<inventory_root>/system/chassis/motherboard/cpu0',
27940a360c2SBrad Bishop        0x02 : '<inventory_root>/system/chassis/motherboard/cpu1',
28040a360c2SBrad Bishop        0x03 : '<inventory_root>/system/chassis/motherboard',
28140a360c2SBrad Bishop        0x04 : '<inventory_root>/system/chassis/motherboard/membuf0',
28240a360c2SBrad Bishop        0x05 : '<inventory_root>/system/chassis/motherboard/membuf1',
28340a360c2SBrad Bishop        0x06 : '<inventory_root>/system/chassis/motherboard/membuf2',
28440a360c2SBrad Bishop        0x07 : '<inventory_root>/system/chassis/motherboard/membuf3',
28540a360c2SBrad Bishop        0x08 : '<inventory_root>/system/chassis/motherboard/membuf4',
28640a360c2SBrad Bishop        0x09 : '<inventory_root>/system/chassis/motherboard/membuf5',
28740a360c2SBrad Bishop        0x0c : '<inventory_root>/system/chassis/motherboard/dimm0',
28840a360c2SBrad Bishop        0x0d : '<inventory_root>/system/chassis/motherboard/dimm1',
28940a360c2SBrad Bishop        0x0e : '<inventory_root>/system/chassis/motherboard/dimm2',
29040a360c2SBrad Bishop        0x0f : '<inventory_root>/system/chassis/motherboard/dimm3',
29140a360c2SBrad Bishop        0x10 : '<inventory_root>/system/chassis/motherboard/dimm4',
29240a360c2SBrad Bishop        0x11 : '<inventory_root>/system/chassis/motherboard/dimm5',
29340a360c2SBrad Bishop        0x12 : '<inventory_root>/system/chassis/motherboard/dimm6',
29440a360c2SBrad Bishop        0x13 : '<inventory_root>/system/chassis/motherboard/dimm7',
29540a360c2SBrad Bishop        0x14 : '<inventory_root>/system/chassis/motherboard/dimm8',
29640a360c2SBrad Bishop        0x15 : '<inventory_root>/system/chassis/motherboard/dimm9',
29740a360c2SBrad Bishop        0x16 : '<inventory_root>/system/chassis/motherboard/dimm10',
29840a360c2SBrad Bishop        0x17 : '<inventory_root>/system/chassis/motherboard/dimm11',
29940a360c2SBrad Bishop        0x18 : '<inventory_root>/system/chassis/motherboard/dimm12',
30040a360c2SBrad Bishop        0x19 : '<inventory_root>/system/chassis/motherboard/dimm13',
30140a360c2SBrad Bishop        0x1a : '<inventory_root>/system/chassis/motherboard/dimm14',
30240a360c2SBrad Bishop        0x1b : '<inventory_root>/system/chassis/motherboard/dimm15',
30340a360c2SBrad Bishop        0x1c : '<inventory_root>/system/chassis/motherboard/dimm16',
30440a360c2SBrad Bishop        0x1d : '<inventory_root>/system/chassis/motherboard/dimm17',
30540a360c2SBrad Bishop        0x1e : '<inventory_root>/system/chassis/motherboard/dimm18',
30640a360c2SBrad Bishop        0x1f : '<inventory_root>/system/chassis/motherboard/dimm19',
30740a360c2SBrad Bishop        0x20 : '<inventory_root>/system/chassis/motherboard/dimm20',
30840a360c2SBrad Bishop        0x21 : '<inventory_root>/system/chassis/motherboard/dimm21',
30940a360c2SBrad Bishop        0x22 : '<inventory_root>/system/chassis/motherboard/dimm22',
31040a360c2SBrad Bishop        0x23 : '<inventory_root>/system/chassis/motherboard/dimm23',
31140a360c2SBrad Bishop        0x24 : '<inventory_root>/system/chassis/motherboard/dimm24',
31240a360c2SBrad Bishop        0x25 : '<inventory_root>/system/chassis/motherboard/dimm25',
31340a360c2SBrad Bishop        0x26 : '<inventory_root>/system/chassis/motherboard/dimm26',
31440a360c2SBrad Bishop        0x27 : '<inventory_root>/system/chassis/motherboard/dimm27',
31540a360c2SBrad Bishop        0x28 : '<inventory_root>/system/chassis/motherboard/dimm28',
31640a360c2SBrad Bishop        0x29 : '<inventory_root>/system/chassis/motherboard/dimm29',
31740a360c2SBrad Bishop        0x2a : '<inventory_root>/system/chassis/motherboard/dimm30',
31840a360c2SBrad Bishop        0x2b : '<inventory_root>/system/chassis/motherboard/dimm31',
31940a360c2SBrad Bishop    },
32040a360c2SBrad Bishop    'FRU_STR' : {
32140a360c2SBrad Bishop        'PRODUCT_0'  : '<inventory_root>/system/bios',
32240a360c2SBrad Bishop        'BOARD_1'    : '<inventory_root>/system/chassis/motherboard/cpu0',
32340a360c2SBrad Bishop        'BOARD_2'    : '<inventory_root>/system/chassis/motherboard/cpu1',
32440a360c2SBrad Bishop        'CHASSIS_3'  : '<inventory_root>/system/chassis/motherboard',
32540a360c2SBrad Bishop        'BOARD_3'    : '<inventory_root>/system/misc',
32640a360c2SBrad Bishop        'BOARD_4'    : '<inventory_root>/system/chassis/motherboard/membuf0',
32740a360c2SBrad Bishop        'BOARD_5'    : '<inventory_root>/system/chassis/motherboard/membuf1',
32840a360c2SBrad Bishop        'BOARD_6'    : '<inventory_root>/system/chassis/motherboard/membuf2',
32940a360c2SBrad Bishop        'BOARD_7'    : '<inventory_root>/system/chassis/motherboard/membuf3',
33040a360c2SBrad Bishop        'BOARD_8'    : '<inventory_root>/system/chassis/motherboard/membuf4',
33140a360c2SBrad Bishop        'BOARD_9'    : '<inventory_root>/system/chassis/motherboard/membuf5',
33240a360c2SBrad Bishop        'BOARD_10'   : '<inventory_root>/system/chassis/motherboard/membuf6',
33340a360c2SBrad Bishop        'BOARD_11'   : '<inventory_root>/system/chassis/motherboard/membuf7',
33440a360c2SBrad Bishop        'PRODUCT_12'   : '<inventory_root>/system/chassis/motherboard/dimm0',
33540a360c2SBrad Bishop        'PRODUCT_13'   : '<inventory_root>/system/chassis/motherboard/dimm1',
33640a360c2SBrad Bishop        'PRODUCT_14'   : '<inventory_root>/system/chassis/motherboard/dimm2',
33740a360c2SBrad Bishop        'PRODUCT_15'   : '<inventory_root>/system/chassis/motherboard/dimm3',
33840a360c2SBrad Bishop        'PRODUCT_16'   : '<inventory_root>/system/chassis/motherboard/dimm4',
33940a360c2SBrad Bishop        'PRODUCT_17'   : '<inventory_root>/system/chassis/motherboard/dimm5',
34040a360c2SBrad Bishop        'PRODUCT_18'   : '<inventory_root>/system/chassis/motherboard/dimm6',
34140a360c2SBrad Bishop        'PRODUCT_19'   : '<inventory_root>/system/chassis/motherboard/dimm7',
34240a360c2SBrad Bishop        'PRODUCT_20'   : '<inventory_root>/system/chassis/motherboard/dimm8',
34340a360c2SBrad Bishop        'PRODUCT_21'   : '<inventory_root>/system/chassis/motherboard/dimm9',
34440a360c2SBrad Bishop        'PRODUCT_22'   : '<inventory_root>/system/chassis/motherboard/dimm10',
34540a360c2SBrad Bishop        'PRODUCT_23'   : '<inventory_root>/system/chassis/motherboard/dimm11',
34640a360c2SBrad Bishop        'PRODUCT_24'   : '<inventory_root>/system/chassis/motherboard/dimm12',
34740a360c2SBrad Bishop        'PRODUCT_25'   : '<inventory_root>/system/chassis/motherboard/dimm13',
34840a360c2SBrad Bishop        'PRODUCT_26'   : '<inventory_root>/system/chassis/motherboard/dimm14',
34940a360c2SBrad Bishop        'PRODUCT_27'   : '<inventory_root>/system/chassis/motherboard/dimm15',
35040a360c2SBrad Bishop        'PRODUCT_28'   : '<inventory_root>/system/chassis/motherboard/dimm16',
35140a360c2SBrad Bishop        'PRODUCT_29'   : '<inventory_root>/system/chassis/motherboard/dimm17',
35240a360c2SBrad Bishop        'PRODUCT_30'   : '<inventory_root>/system/chassis/motherboard/dimm18',
35340a360c2SBrad Bishop        'PRODUCT_31'   : '<inventory_root>/system/chassis/motherboard/dimm19',
35440a360c2SBrad Bishop        'PRODUCT_32'   : '<inventory_root>/system/chassis/motherboard/dimm20',
35540a360c2SBrad Bishop        'PRODUCT_33'   : '<inventory_root>/system/chassis/motherboard/dimm21',
35640a360c2SBrad Bishop        'PRODUCT_34'   : '<inventory_root>/system/chassis/motherboard/dimm22',
35740a360c2SBrad Bishop        'PRODUCT_35'   : '<inventory_root>/system/chassis/motherboard/dimm23',
35840a360c2SBrad Bishop        'PRODUCT_36'   : '<inventory_root>/system/chassis/motherboard/dimm24',
35940a360c2SBrad Bishop        'PRODUCT_37'   : '<inventory_root>/system/chassis/motherboard/dimm25',
36040a360c2SBrad Bishop        'PRODUCT_38'   : '<inventory_root>/system/chassis/motherboard/dimm26',
36140a360c2SBrad Bishop        'PRODUCT_39'   : '<inventory_root>/system/chassis/motherboard/dimm27',
36240a360c2SBrad Bishop        'PRODUCT_40'   : '<inventory_root>/system/chassis/motherboard/dimm28',
36340a360c2SBrad Bishop        'PRODUCT_41'   : '<inventory_root>/system/chassis/motherboard/dimm29',
36440a360c2SBrad Bishop        'PRODUCT_42'   : '<inventory_root>/system/chassis/motherboard/dimm30',
36540a360c2SBrad Bishop        'PRODUCT_43'   : '<inventory_root>/system/chassis/motherboard/dimm31',
36640a360c2SBrad Bishop        'PRODUCT_47'   : '<inventory_root>/system/misc',
36740a360c2SBrad Bishop    },
36840a360c2SBrad Bishop    'SENSOR' : {
36940a360c2SBrad Bishop        0x04 : '/org/openbmc/sensors/host/HostStatus',
37040a360c2SBrad Bishop        0x05 : '/org/openbmc/sensors/host/BootProgress',
37140a360c2SBrad Bishop        0x08 : '/org/openbmc/sensors/host/cpu0/OccStatus',
37240a360c2SBrad Bishop        0x09 : '/org/openbmc/sensors/host/cpu1/OccStatus',
37340a360c2SBrad Bishop        0x0c : '<inventory_root>/system/chassis/motherboard/cpu0',
37440a360c2SBrad Bishop        0x0e : '<inventory_root>/system/chassis/motherboard/cpu1',
37540a360c2SBrad Bishop        0x1e : '<inventory_root>/system/chassis/motherboard/dimm3',
37640a360c2SBrad Bishop        0x1f : '<inventory_root>/system/chassis/motherboard/dimm2',
37740a360c2SBrad Bishop        0x20 : '<inventory_root>/system/chassis/motherboard/dimm1',
37840a360c2SBrad Bishop        0x21 : '<inventory_root>/system/chassis/motherboard/dimm0',
37940a360c2SBrad Bishop        0x22 : '<inventory_root>/system/chassis/motherboard/dimm7',
38040a360c2SBrad Bishop        0x23 : '<inventory_root>/system/chassis/motherboard/dimm6',
38140a360c2SBrad Bishop        0x24 : '<inventory_root>/system/chassis/motherboard/dimm5',
38240a360c2SBrad Bishop        0x25 : '<inventory_root>/system/chassis/motherboard/dimm4',
38340a360c2SBrad Bishop        0x26 : '<inventory_root>/system/chassis/motherboard/dimm11',
38440a360c2SBrad Bishop        0x27 : '<inventory_root>/system/chassis/motherboard/dimm10',
38540a360c2SBrad Bishop        0x28 : '<inventory_root>/system/chassis/motherboard/dimm9',
38640a360c2SBrad Bishop        0x29 : '<inventory_root>/system/chassis/motherboard/dimm8',
38740a360c2SBrad Bishop        0x2a : '<inventory_root>/system/chassis/motherboard/dimm15',
38840a360c2SBrad Bishop        0x2b : '<inventory_root>/system/chassis/motherboard/dimm14',
38940a360c2SBrad Bishop        0x2c : '<inventory_root>/system/chassis/motherboard/dimm13',
39040a360c2SBrad Bishop        0x2d : '<inventory_root>/system/chassis/motherboard/dimm12',
39140a360c2SBrad Bishop        0x2e : '<inventory_root>/system/chassis/motherboard/dimm19',
39240a360c2SBrad Bishop        0x2f : '<inventory_root>/system/chassis/motherboard/dimm18',
39340a360c2SBrad Bishop        0x30 : '<inventory_root>/system/chassis/motherboard/dimm17',
39440a360c2SBrad Bishop        0x31 : '<inventory_root>/system/chassis/motherboard/dimm16',
39540a360c2SBrad Bishop        0x32 : '<inventory_root>/system/chassis/motherboard/dimm23',
39640a360c2SBrad Bishop        0x33 : '<inventory_root>/system/chassis/motherboard/dimm22',
39740a360c2SBrad Bishop        0x34 : '<inventory_root>/system/chassis/motherboard/dimm21',
39840a360c2SBrad Bishop        0x35 : '<inventory_root>/system/chassis/motherboard/dimm20',
39940a360c2SBrad Bishop        0x36 : '<inventory_root>/system/chassis/motherboard/dimm27',
40040a360c2SBrad Bishop        0x37 : '<inventory_root>/system/chassis/motherboard/dimm26',
40140a360c2SBrad Bishop        0x38 : '<inventory_root>/system/chassis/motherboard/dimm25',
40240a360c2SBrad Bishop        0x39 : '<inventory_root>/system/chassis/motherboard/dimm24',
40340a360c2SBrad Bishop        0x3a : '<inventory_root>/system/chassis/motherboard/dimm31',
40440a360c2SBrad Bishop        0x3b : '<inventory_root>/system/chassis/motherboard/dimm30',
40540a360c2SBrad Bishop        0x3c : '<inventory_root>/system/chassis/motherboard/dimm29',
40640a360c2SBrad Bishop        0x3d : '<inventory_root>/system/chassis/motherboard/dimm28',
40740a360c2SBrad Bishop        0x3e : '<inventory_root>/system/chassis/motherboard/cpu0/core0',
40840a360c2SBrad Bishop        0x3f : '<inventory_root>/system/chassis/motherboard/cpu0/core1',
40940a360c2SBrad Bishop        0x40 : '<inventory_root>/system/chassis/motherboard/cpu0/core2',
41040a360c2SBrad Bishop        0x41 : '<inventory_root>/system/chassis/motherboard/cpu0/core3',
41140a360c2SBrad Bishop        0x42 : '<inventory_root>/system/chassis/motherboard/cpu0/core4',
41240a360c2SBrad Bishop        0x43 : '<inventory_root>/system/chassis/motherboard/cpu0/core5',
41340a360c2SBrad Bishop        0x44 : '<inventory_root>/system/chassis/motherboard/cpu0/core6',
41440a360c2SBrad Bishop        0x45 : '<inventory_root>/system/chassis/motherboard/cpu0/core7',
41540a360c2SBrad Bishop        0x46 : '<inventory_root>/system/chassis/motherboard/cpu0/core8',
41640a360c2SBrad Bishop        0x47 : '<inventory_root>/system/chassis/motherboard/cpu0/core9',
41740a360c2SBrad Bishop        0x48 : '<inventory_root>/system/chassis/motherboard/cpu0/core10',
41840a360c2SBrad Bishop        0x49 : '<inventory_root>/system/chassis/motherboard/cpu0/core11',
41940a360c2SBrad Bishop        0x4a : '<inventory_root>/system/chassis/motherboard/cpu1/core0',
42040a360c2SBrad Bishop        0x4b : '<inventory_root>/system/chassis/motherboard/cpu1/core1',
42140a360c2SBrad Bishop        0x4c : '<inventory_root>/system/chassis/motherboard/cpu1/core2',
42240a360c2SBrad Bishop        0x4d : '<inventory_root>/system/chassis/motherboard/cpu1/core3',
42340a360c2SBrad Bishop        0x4e : '<inventory_root>/system/chassis/motherboard/cpu1/core4',
42440a360c2SBrad Bishop        0x4f : '<inventory_root>/system/chassis/motherboard/cpu1/core5',
42540a360c2SBrad Bishop        0x50 : '<inventory_root>/system/chassis/motherboard/cpu1/core6',
42640a360c2SBrad Bishop        0x51 : '<inventory_root>/system/chassis/motherboard/cpu1/core7',
42740a360c2SBrad Bishop        0x52 : '<inventory_root>/system/chassis/motherboard/cpu1/core8',
42840a360c2SBrad Bishop        0x53 : '<inventory_root>/system/chassis/motherboard/cpu1/core9',
42940a360c2SBrad Bishop        0x54 : '<inventory_root>/system/chassis/motherboard/cpu1/core10',
43040a360c2SBrad Bishop        0x55 : '<inventory_root>/system/chassis/motherboard/cpu1/core11',
43140a360c2SBrad Bishop        0x56 : '<inventory_root>/system/chassis/motherboard/membuf0',
43240a360c2SBrad Bishop        0x57 : '<inventory_root>/system/chassis/motherboard/membuf1',
43340a360c2SBrad Bishop        0x58 : '<inventory_root>/system/chassis/motherboard/membuf2',
43440a360c2SBrad Bishop        0x59 : '<inventory_root>/system/chassis/motherboard/membuf3',
43540a360c2SBrad Bishop        0x5a : '<inventory_root>/system/chassis/motherboard/membuf4',
43640a360c2SBrad Bishop        0x5b : '<inventory_root>/system/chassis/motherboard/membuf5',
43740a360c2SBrad Bishop        0x5c : '<inventory_root>/system/chassis/motherboard/membuf6',
43840a360c2SBrad Bishop        0x5d : '<inventory_root>/system/chassis/motherboard/membuf7',
43940a360c2SBrad Bishop        0x5f : '/org/openbmc/sensors/host/BootCount',
44040a360c2SBrad Bishop        0x60 : '<inventory_root>/system/chassis/motherboard',
44140a360c2SBrad Bishop        0x61 : '<inventory_root>/system/systemevent',
44240a360c2SBrad Bishop        0x62 : '<inventory_root>/system/powerlimit',
44340a360c2SBrad Bishop        0x63 : '<inventory_root>/system/chassis/motherboard/refclock',
44440a360c2SBrad Bishop        0x64 : '<inventory_root>/system/chassis/motherboard/pcieclock',
44540a360c2SBrad Bishop        0xb1 : '<inventory_root>/system/chassis/motherboard/todclock',
44640a360c2SBrad Bishop        0xb2 : '<inventory_root>/system/chassis/motherboard/apss',
44740a360c2SBrad Bishop        0xb3 : '/org/openbmc/sensors/host/powercap',
44840a360c2SBrad Bishop        0xb5 : '/org/openbmc/sensors/host/OperatingSystemStatus',
44940a360c2SBrad Bishop        0xb6 : '<inventory_root>/system/chassis/motherboard/pcielink',
45040a360c2SBrad Bishop    },
45140a360c2SBrad Bishop    'GPIO_PRESENT' : {}
45240a360c2SBrad Bishop}
45340a360c2SBrad Bishop
45440a360c2SBrad BishopGPIO_CONFIG = {}
45540a360c2SBrad BishopGPIO_CONFIG['BMC_POWER_UP'] = \
45640a360c2SBrad Bishop        {'gpio_pin': 'D1', 'direction': 'out'}
45740a360c2SBrad BishopGPIO_CONFIG['SYS_PWROK_BUFF'] = \
45840a360c2SBrad Bishop        {'gpio_pin': 'D2', 'direction': 'in'}
45940a360c2SBrad BishopGPIO_CONFIG['BMC_WD_CLEAR_PULSE_N'] = \
46040a360c2SBrad Bishop        {'gpio_pin': 'N4', 'direction': 'out'}
46140a360c2SBrad BishopGPIO_CONFIG['CM1_OE_R_N'] = \
46240a360c2SBrad Bishop        {'gpio_pin': 'Q6', 'direction': 'out'}
46340a360c2SBrad BishopGPIO_CONFIG['BMC_CP0_RESET_N'] = \
46440a360c2SBrad Bishop        {'gpio_pin': 'O2', 'direction': 'out'}
46540a360c2SBrad BishopGPIO_CONFIG['BMC_CFAM_RESET_N_R'] = \
46640a360c2SBrad Bishop        {'gpio_pin': 'J2', 'direction': 'out'}
46740a360c2SBrad BishopGPIO_CONFIG['PEX8718_DEVICES_RESET_N'] = \
46840a360c2SBrad Bishop        {'gpio_pin': 'B6', 'direction': 'out'}
46940a360c2SBrad BishopGPIO_CONFIG['CP0_DEVICES_RESET_N'] = \
47040a360c2SBrad Bishop        {'gpio_pin': 'N3', 'direction': 'out'}
47140a360c2SBrad BishopGPIO_CONFIG['CP1_DEVICES_RESET_N'] = \
47240a360c2SBrad Bishop        {'gpio_pin': 'N5', 'direction': 'out'}
47340a360c2SBrad Bishop
47440a360c2SBrad BishopGPIO_CONFIG['FSI_DATA'] = \
47540a360c2SBrad Bishop        {'gpio_pin': 'A5', 'direction': 'out'}
47640a360c2SBrad BishopGPIO_CONFIG['FSI_CLK'] = \
47740a360c2SBrad Bishop        {'gpio_pin': 'A4', 'direction': 'out'}
47840a360c2SBrad BishopGPIO_CONFIG['FSI_ENABLE'] = \
47940a360c2SBrad Bishop        {'gpio_pin': 'D0', 'direction': 'out'}
48040a360c2SBrad BishopGPIO_CONFIG['CRONUS_SEL'] = \
48140a360c2SBrad Bishop        {'gpio_pin': 'A6', 'direction': 'out'}
48240a360c2SBrad BishopGPIO_CONFIG['BMC_THROTTLE'] = \
48340a360c2SBrad Bishop        {'gpio_pin': 'J3', 'direction': 'out'}
48440a360c2SBrad Bishop
48540a360c2SBrad BishopGPIO_CONFIG['IDBTN']       = \
48640a360c2SBrad Bishop    { 'gpio_pin': 'Q7', 'direction': 'out' }
48740a360c2SBrad BishopGPIO_CONFIG['POWER_BUTTON'] = \
48840a360c2SBrad Bishop        {'gpio_pin': 'E0', 'direction': 'both'}
48940a360c2SBrad BishopGPIO_CONFIG['RESET_BUTTON'] = \
49040a360c2SBrad Bishop        {'gpio_pin': 'E4', 'direction': 'both'}
491b4140b88SAdriana KobylakGPIO_CONFIG['CHECKSTOP'] = \
492b4140b88SAdriana Kobylak        {'gpio_pin': 'H0', 'direction': 'falling'}
49340a360c2SBrad Bishop
49440a360c2SBrad BishopGPIO_CONFIG['PS0_PRES_N'] = \
49540a360c2SBrad Bishop        {'gpio_pin': 'P7', 'direction': 'in'}
49640a360c2SBrad BishopGPIO_CONFIG['PS1_PRES_N'] = \
49740a360c2SBrad Bishop        {'gpio_pin': 'N0', 'direction': 'in'}
49840a360c2SBrad BishopGPIO_CONFIG['CARD_PRES_N'] = \
49940a360c2SBrad Bishop        {'gpio_pin': 'J0', 'direction': 'in'}
50040a360c2SBrad Bishop
50140a360c2SBrad Bishop
50240a360c2SBrad Bishop
50340a360c2SBrad Bishop
50440a360c2SBrad Bishopdef convertGpio(name):
50540a360c2SBrad Bishop    name = name.upper()
50640a360c2SBrad Bishop    c = name[0:1]
50740a360c2SBrad Bishop    offset = int(name[1:])
50840a360c2SBrad Bishop    a = ord(c)-65
50940a360c2SBrad Bishop    base = a*8+GPIO_BASE
51040a360c2SBrad Bishop    return base+offset
51140a360c2SBrad Bishop
51240a360c2SBrad Bishop
51340a360c2SBrad BishopHWMON_CONFIG = {
51440a360c2SBrad Bishop    '4-0050' : {
51540a360c2SBrad Bishop        'names' : {
51640a360c2SBrad Bishop            'caps_curr_powercap' : { 'object_path' : 'powercap/curr_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
51740a360c2SBrad Bishop            'caps_curr_powerreading' : { 'object_path' : 'powercap/system_power','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
51840a360c2SBrad Bishop            'caps_max_powercap' : { 'object_path' : 'powercap/max_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
51940a360c2SBrad Bishop            'caps_min_powercap' : { 'object_path' : 'powercap/min_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
52040a360c2SBrad Bishop            'caps_norm_powercap' : { 'object_path' : 'powercap/n_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
52140a360c2SBrad Bishop            'caps_user_powerlimit' : { 'object_path' : 'powercap/user_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
52240a360c2SBrad Bishop        },
52340a360c2SBrad Bishop        'labels' : {
524*c14f6fecSEdward A. James        '176' :  { 'object_path' : 'temperature/cpu0/core0','poll_interval' : 5000,'scale' : -3,'units' : 'C',
52540a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
526*c14f6fecSEdward A. James        '177' :  { 'object_path' : 'temperature/cpu0/core1','poll_interval' : 5000,'scale' : -3,'units' : 'C',
52740a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
528*c14f6fecSEdward A. James        '178' :  { 'object_path' : 'temperature/cpu0/core2','poll_interval' : 5000,'scale' : -3,'units' : 'C',
52940a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
530*c14f6fecSEdward A. James        '179' :  { 'object_path' : 'temperature/cpu0/core3','poll_interval' : 5000,'scale' : -3,'units' : 'C',
53140a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
532*c14f6fecSEdward A. James        '180' :  { 'object_path' : 'temperature/cpu0/core4','poll_interval' : 5000,'scale' : -3,'units' : 'C',
53340a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
534*c14f6fecSEdward A. James        '181' :  { 'object_path' : 'temperature/cpu0/core5','poll_interval' : 5000,'scale' : -3,'units' : 'C',
53540a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
536*c14f6fecSEdward A. James        '182' :  { 'object_path' : 'temperature/cpu0/core6','poll_interval' : 5000,'scale' : -3,'units' : 'C',
53740a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
538*c14f6fecSEdward A. James        '183' :  { 'object_path' : 'temperature/cpu0/core7','poll_interval' : 5000,'scale' : -3,'units' : 'C',
53940a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
540*c14f6fecSEdward A. James        '184' :  { 'object_path' : 'temperature/cpu0/core8','poll_interval' : 5000,'scale' : -3,'units' : 'C',
54140a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
542*c14f6fecSEdward A. James        '185' :  { 'object_path' : 'temperature/cpu0/core9','poll_interval' : 5000,'scale' : -3,'units' : 'C',
54340a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
544*c14f6fecSEdward A. James        '186' :  { 'object_path' : 'temperature/cpu0/core10','poll_interval' : 5000,'scale' : -3,'units' : 'C',
54540a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
546*c14f6fecSEdward A. James        '187' :  { 'object_path' : 'temperature/cpu0/core11','poll_interval' : 5000,'scale' : -3,'units' : 'C',
54740a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
548*c14f6fecSEdward A. James        '102' :  { 'object_path' : 'temperature/dimm0','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
549*c14f6fecSEdward A. James        '103' :  { 'object_path' : 'temperature/dimm1','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
550*c14f6fecSEdward A. James        '104' :  { 'object_path' : 'temperature/dimm2','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
551*c14f6fecSEdward A. James        '105' :  { 'object_path' : 'temperature/dimm3','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
552*c14f6fecSEdward A. James        '106' :  { 'object_path' : 'temperature/dimm4','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
553*c14f6fecSEdward A. James        '107' :  { 'object_path' : 'temperature/dimm5','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
554*c14f6fecSEdward A. James        '108' :  { 'object_path' : 'temperature/dimm6','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
555*c14f6fecSEdward A. James        '109' :  { 'object_path' : 'temperature/dimm7','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
556*c14f6fecSEdward A. James        '110' :  { 'object_path' : 'temperature/dimm8','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
557*c14f6fecSEdward A. James        '111' :  { 'object_path' : 'temperature/dimm9','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
558*c14f6fecSEdward A. James        '112' :  { 'object_path' : 'temperature/dimm10','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
559*c14f6fecSEdward A. James        '113' :  { 'object_path' : 'temperature/dimm11','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
560*c14f6fecSEdward A. James        '114' :  { 'object_path' : 'temperature/dimm12','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
561*c14f6fecSEdward A. James        '115' :  { 'object_path' : 'temperature/dimm13','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
562*c14f6fecSEdward A. James        '116' :  { 'object_path' : 'temperature/dimm14','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
563*c14f6fecSEdward A. James        '117' :  { 'object_path' : 'temperature/dimm15','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
564*c14f6fecSEdward A. James        '94' :  { 'object_path' : 'temperature/membuf0','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
565*c14f6fecSEdward A. James        '95' :  { 'object_path' : 'temperature/membuf1','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
566*c14f6fecSEdward A. James        '96' :  { 'object_path' : 'temperature/membuf2','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
567*c14f6fecSEdward A. James        '97' :  { 'object_path' : 'temperature/membuf3','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
56840a360c2SBrad Bishop        }
56940a360c2SBrad Bishop    },
57040a360c2SBrad Bishop    '5-0050' : {
57140a360c2SBrad Bishop        'labels' :  {
572*c14f6fecSEdward A. James        '188' :  { 'object_path' : 'temperature/cpu1/core0','poll_interval' : 5000,'scale' : -3,'units' : 'C',
57340a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
574*c14f6fecSEdward A. James        '189' :  { 'object_path' : 'temperature/cpu1/core1','poll_interval' : 5000,'scale' : -3,'units' : 'C',
57540a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
576*c14f6fecSEdward A. James        '190' :  { 'object_path' : 'temperature/cpu1/core2','poll_interval' : 5000,'scale' : -3,'units' : 'C',
57740a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
578*c14f6fecSEdward A. James        '191' :  { 'object_path' : 'temperature/cpu1/core3','poll_interval' : 5000,'scale' : -3,'units' : 'C',
57940a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
580*c14f6fecSEdward A. James        '192' :  { 'object_path' : 'temperature/cpu1/core4','poll_interval' : 5000,'scale' : -3,'units' : 'C',
58140a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
582*c14f6fecSEdward A. James        '193' :  { 'object_path' : 'temperature/cpu1/core5','poll_interval' : 5000,'scale' : -3,'units' : 'C',
58340a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
584*c14f6fecSEdward A. James        '194' :  { 'object_path' : 'temperature/cpu1/core6','poll_interval' : 5000,'scale' : -3,'units' : 'C',
58540a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
586*c14f6fecSEdward A. James        '195' :  { 'object_path' : 'temperature/cpu1/core7','poll_interval' : 5000,'scale' : -3,'units' : 'C',
58740a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
588*c14f6fecSEdward A. James        '196' :  { 'object_path' : 'temperature/cpu1/core8','poll_interval' : 5000,'scale' : -3,'units' : 'C',
58940a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
590*c14f6fecSEdward A. James        '197' :  { 'object_path' : 'temperature/cpu1/core9','poll_interval' : 5000,'scale' : -3,'units' : 'C',
59140a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
592*c14f6fecSEdward A. James        '198' :  { 'object_path' : 'temperature/cpu1/core10','poll_interval' : 5000,'scale' : -3,'units' : 'C',
59340a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
594*c14f6fecSEdward A. James        '199' :  { 'object_path' : 'temperature/cpu1/core11','poll_interval' : 5000,'scale' : -3,'units' : 'C',
59540a360c2SBrad Bishop            'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True },
596*c14f6fecSEdward A. James        '118' :  { 'object_path' : 'temperature/dimm16','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
597*c14f6fecSEdward A. James        '119' :  { 'object_path' : 'temperature/dimm17','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
598*c14f6fecSEdward A. James        '120' :  { 'object_path' : 'temperature/dimm18','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
599*c14f6fecSEdward A. James        '121' :  { 'object_path' : 'temperature/dimm19','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
600*c14f6fecSEdward A. James        '122' :  { 'object_path' : 'temperature/dimm20','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
601*c14f6fecSEdward A. James        '123' :  { 'object_path' : 'temperature/dimm21','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
602*c14f6fecSEdward A. James        '124' :  { 'object_path' : 'temperature/dimm22','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
603*c14f6fecSEdward A. James        '125' :  { 'object_path' : 'temperature/dimm23','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
604*c14f6fecSEdward A. James        '126' :  { 'object_path' : 'temperature/dimm24','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
605*c14f6fecSEdward A. James        '127' :  { 'object_path' : 'temperature/dimm25','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
606*c14f6fecSEdward A. James        '128' :  { 'object_path' : 'temperature/dimm26','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
607*c14f6fecSEdward A. James        '129' :  { 'object_path' : 'temperature/dimm27','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
608*c14f6fecSEdward A. James        '130' :  { 'object_path' : 'temperature/dimm28','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
609*c14f6fecSEdward A. James        '131' :  { 'object_path' : 'temperature/dimm29','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
610*c14f6fecSEdward A. James        '132' :  { 'object_path' : 'temperature/dimm30','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
611*c14f6fecSEdward A. James        '133' :  { 'object_path' : 'temperature/dimm31','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
612*c14f6fecSEdward A. James        '98' :  { 'object_path' : 'temperature/membuf4','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
613*c14f6fecSEdward A. James        '99' :  { 'object_path' : 'temperature/membuf5','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
614*c14f6fecSEdward A. James        '100' :  { 'object_path' : 'temperature/membuf6','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
615*c14f6fecSEdward A. James        '101' :  { 'object_path' : 'temperature/membuf7','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
61640a360c2SBrad Bishop        }
61740a360c2SBrad Bishop    },
61840a360c2SBrad Bishop}
61940a360c2SBrad Bishop
62040a360c2SBrad Bishop# Miscellaneous non-poll sensor with system specific properties.
62140a360c2SBrad Bishop# The sensor id is the same as those defined in ID_LOOKUP['SENSOR'].
62240a360c2SBrad BishopMISC_SENSORS = {
62340a360c2SBrad Bishop	0x5f : { 'class' : 'BootCountSensor' },
62440a360c2SBrad Bishop	0x05 : { 'class' : 'BootProgressSensor' },
62540a360c2SBrad Bishop	0x08 : { 'class' : 'OccStatusSensor',
62657b53bd0SBrad Bishop		'os_path' : '/sys/class/i2c-adapter/i2c-4/4-0050/online' },
62740a360c2SBrad Bishop	0x09 : { 'class' : 'OccStatusSensor',
62857b53bd0SBrad Bishop		'os_path' : '/sys/class/i2c-adapter/i2c-5/5-0050/online' },
62940a360c2SBrad Bishop	0xb5 : { 'class' : 'OperatingSystemStatusSensor' },
63040a360c2SBrad Bishop	0xb3 : { 'class' : 'PowerCap',
63140a360c2SBrad Bishop		'os_path' : '/sys/class/hwmon/hwmon3/user_powercap' },
63240a360c2SBrad Bishop}
633