// NOTE: These may change from platform to platform!
// The values below are valid for Raptor Computing Systems Talos II / Blackbird
#define IPMI_SENSOR_FW_BOOT0x02// XML ID /sys-0/fw_boot_sensor [W]
#define IPMI_SENSOR_CPU0_OCC_ACTIVE0x03// XML ID /sys-0/node-0/motherboard-0/proc_socket-0/module-0/p9_proc_s/occ/occ_active_sensor [W]
#define IPMI_SENSOR_CPU1_OCC_ACTIVE0x04// XML ID /sys-0/node-0/motherboard-0/proc_socket-1/module-0/p9_proc_s/occ/occ_active_sensor [W]
#define IPMI_SENSOR_CPU0_FUNC0x08// XML ID /sys-0/node-0/motherboard-0/proc_socket-0/module-0/p9_proc_s/cpu_func_sensor [W]
#define IPMI_SENSOR_CPU1_FUNC0x09// XML ID /sys-0/node-0/motherboard-0/proc_socket-1/module-0/p9_proc_s/cpu_func_sensor [W]
#define IPMI_SENSOR_BOOT_COUNT0x8b// XML ID /sys-0/boot_count_sensor [RW]
#define IPMI_SENSOR_PLANAR_FAULT0x8c// XML ID /sys-0/node-0/motherboard_fault_sensor [W]
#define IPMI_SENSOR_REF_CLK_FAULT0x8d// XML ID /sys-0/node-0/ref_clk_sensor [W]
#define IPMI_SENSOR_PCIE_CLK_FAULT0x8e// XML ID /sys-0/node-0/pci_clk_sensor [W]
#define IPMI_SENSOR_TOD_CLK_FAULT0x8f// XML ID /sys-0/node-0/tod_clk_sensor [W]
#define IPMI_SENSOR_APSS_FAULT0x93// XML ID /sys-0/node-0/apss_fault_sensor [W]
#define IPMI_SENSOR_DERATING_FACTOR0x96// XML ID /sys-0/ps_derating_sensor [R]
#define IPMI_SENSOR_FW_BOOT0x02// XML ID /sys-0/fw_boot_sensor [W]
#define IPMI_SENSOR_CPU0_OCC_ACTIVE0x03// XML ID /sys-0/node-0/motherboard-0/proc_socket-0/module-0/p9_proc_s/occ/occ_active_sensor [W]
#define IPMI_SENSOR_CPU1_OCC_ACTIVE0x04// XML ID /sys-0/node-0/motherboard-0/proc_socket-1/module-0/p9_proc_s/occ/occ_active_sensor [W]
#define IPMI_SENSOR_CPU0_FUNC0x08// XML ID /sys-0/node-0/motherboard-0/proc_socket-0/module-0/p9_proc_s/cpu_func_sensor [W]
#define IPMI_SENSOR_CPU1_FUNC0x09// XML ID /sys-0/node-0/motherboard-0/proc_socket-1/module-0/p9_proc_s/cpu_func_sensor [W]
#define IPMI_SENSOR_BOOT_COUNT0x8b// XML ID /sys-0/boot_count_sensor [RW]
#define IPMI_SENSOR_PLANAR_FAULT0x8c// XML ID /sys-0/node-0/motherboard_fault_sensor [W]
#define IPMI_SENSOR_REF_CLK_FAULT0x8d// XML ID /sys-0/node-0/ref_clk_sensor [W]
#define IPMI_SENSOR_PCIE_CLK_FAULT0x8e// XML ID /sys-0/node-0/pci_clk_sensor [W]
#define IPMI_SENSOR_TOD_CLK_FAULT0x8f// XML ID /sys-0/node-0/tod_clk_sensor [W]
#define IPMI_SENSOR_APSS_FAULT0x93// XML ID /sys-0/node-0/apss_fault_sensor [W]
#define IPMI_SENSOR_DERATING_FACTOR0x96// XML ID /sys-0/ps_derating_sensor [R]
// Inventory bitfield sensor ranges
#define IPMI_SENSOR_INV_DIMM_FUNC_BEG0x0b// XML ID /sys-0/node-0/motherboard-0/dimmconn-<X>/dimm-0/dimm_func_sensor [W]
#define IPMI_SENSOR_INV_DIMM_FUNC_END0x1a
#define IPMI_SENSOR_INV_CPU0_FUNC_BEG0x2b// XML ID /sys-0/node-0/motherboard-0/proc_socket-0/module-0/p9_proc_s/eq<X>/ex<Y>/core<Z>/cpucore_func_sensor [W]
#define IPMI_SENSOR_INV_CPU0_FUNC_END0x42
#define IPMI_SENSOR_INV_CPU1_FUNC_BEG0x43// XML ID /sys-0/node-0/motherboard-0/proc_socket-1/module-0/p9_proc_s/eq<X>/ex<Y>/core<Z>/cpucore_func_sensor [W]
#define IPMI_SENSOR_INV_CPU1_FUNC_END0x5a
#define IPMI_SENSOR_INV_DIMM_FUNC_BEG0x0b// XML ID /sys-0/node-0/motherboard-0/dimmconn-<X>/dimm-0/dimm_func_sensor [W]
#define IPMI_SENSOR_INV_DIMM_FUNC_END0x1a
#define IPMI_SENSOR_INV_CPU0_FUNC_BEG0x2b// XML ID /sys-0/node-0/motherboard-0/proc_socket-0/module-0/p9_proc_s/eq<X>/ex<Y>/core<Z>/cpucore_func_sensor [W]
#define IPMI_SENSOR_INV_CPU0_FUNC_END0x42
#define IPMI_SENSOR_INV_CPU1_FUNC_BEG0x43// XML ID /sys-0/node-0/motherboard-0/proc_socket-1/module-0/p9_proc_s/eq<X>/ex<Y>/core<Z>/cpucore_func_sensor [W]
#define IPMI_SENSOR_INV_CPU1_FUNC_END0x5a
// Event Data Byte bitfield mappings
// These are believed constant across hostboot versions, and are defined in hostboot src/include/usr/ipmi/ipmisensor.H
// NOTE: The same command code is used for both QSPI 3BA and QSPI 4BA extended quad input writes, thus the device must be placed in either 3BA or 4BA mode prior to issuing PAGE PROGRAM
// NOTE: The same command code is used for both QSPI 3BA and QSPI 4BA extended quad input writes, thus the device must be placed in either 3BA or 4BA mode prior
printf("Desired prescale register: 0x%04x (system clock %dMHz, bus frequency %dkHz)\n",i2c_prescale,CONFIG_CLOCK_FREQUENCY/1000000LL,i2c_bus_frequency/1000LL);