diff options
author | Andrey V.Kosteltsev <AKosteltsev@IBS.RU> | 2022-05-23 00:36:13 +0300 |
---|---|---|
committer | Andrey V.Kosteltsev <AKosteltsev@IBS.RU> | 2022-05-23 00:36:13 +0300 |
commit | 816146249ab44fb9e85f8dfd413e18e92a13842c (patch) | |
tree | 97df436faa8607f63dba853024879f467eea3054 | |
parent | 1bd1f086e0ecfc9017891b5b9a492446eda41095 (diff) | |
download | openbmc-816146249ab44fb9e85f8dfd413e18e92a13842c.tar.xz |
Layers for SILA CP2-5422
129 files changed, 7529 insertions, 0 deletions
diff --git a/meta-ibs/conf/layer.conf b/meta-ibs/conf/layer.conf new file mode 100644 index 0000000000..38c8296246 --- /dev/null +++ b/meta-ibs/conf/layer.conf @@ -0,0 +1,19 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "ibs" +BBFILE_PATTERN_ibs = "^${LAYERDIR}/" +BBFILE_PATTERN_IGNORE_EMPTY_ibs = "1" +LAYERVERSION_ibs = "1" +LAYERSERIES_COMPAT_ibs = "honister kirkstone" +LAYERDEPENDS_ibs = "phosphor-layer" + +IMAGE_FEATURES[validitems] += "tools-sdk tools-debug validation-unsecure" + +IBSBASE = '${@os.path.normpath("${LAYERDIR}/")}' + +FACTORY = "ibs" diff --git a/meta-ibs/conf/machine/include/ibs.inc b/meta-ibs/conf/machine/include/ibs.inc new file mode 100644 index 0000000000..238dff337b --- /dev/null +++ b/meta-ibs/conf/machine/include/ibs.inc @@ -0,0 +1,27 @@ +MACHINE_FEATURES += "\ + obmc-bmc-state-mgmt \ + obmc-chassis-state-mgmt \ + obmc-host-state-mgmt \ + obmc-phosphor-chassis-mgmt \ + obmc-host-ipmi \ + obmc-host-ctl \ + obmc-phosphor-fan-mgmt \ + obmc-phosphor-flash-mgmt \ + " + +VIRTUAL-RUNTIME_skeleton_workbook = "${MACHINE}-config" + +VIRTUAL-RUNTIME_obmc-host-state-manager ?= "x86-power-control" +VIRTUAL-RUNTIME_obmc-chassis-state-manager ?= "x86-power-control" +VIRTUAL-RUNTIME_obmc-sensors-hwmon ?= "dbus-sensors" + +PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-ibs-apps" +PREFERRED_PROVIDER_virtual/obmc-fan-mgmt = "packagegroup-ibs-apps" +PREFERRED_PROVIDER_virtual/obmc-flash-mgmt = "packagegroup-ibs-apps" +PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "phosphor-ipmi-kcs" +PREFERRED_PROVIDER_virtual/obmc-inventory-data ?= "${VIRTUAL-RUNTIME_skeleton_workbook}" +PREFERRED_PROVIDER_virtual/obmc-system-mgmt = "packagegroup-ibs-apps" +PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native ?= "ibs-led-manager-config-native" +PREFERRED_PROVIDER_virtual/obmc-host-ctl ?= "obmc-op-control-host" + +OVERRIDES .= ":ibs" diff --git a/meta-ibs/meta-ast2500/conf/layer.conf b/meta-ibs/meta-ast2500/conf/layer.conf new file mode 100644 index 0000000000..35fe04be2f --- /dev/null +++ b/meta-ibs/meta-ast2500/conf/layer.conf @@ -0,0 +1,12 @@ +LOCALCONF_VERSION = "3" +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "ast2500" +BBFILE_PATTERN_ast2500 = "^${LAYERDIR}/" +BBFILE_PRIORITY_ast2500 = "10" +LAYERSERIES_COMPAT_ast2500 = "honister kirkstone" diff --git a/meta-ibs/meta-ast2500/conf/machine/include/obmc-bsp-sila-common.inc b/meta-ibs/meta-ast2500/conf/machine/include/obmc-bsp-sila-common.inc new file mode 100644 index 0000000000..419d47bfa9 --- /dev/null +++ b/meta-ibs/meta-ast2500/conf/machine/include/obmc-bsp-sila-common.inc @@ -0,0 +1,23 @@ +#@TYPE: Machine +#@NAME: OpenBMC +#@DESCRIPTION: Common machine configuration for OpenBMC chips + +IMAGE_FSTYPES += "squashfs-xz" +EXTRA_IMAGECMD:squashfs-xz:append = "-processors ${BB_NUMBER_THREADS} -b 262144 -Xdict-size 100% -Xbcj arm" + +IMAGE_CLASSES += "image_types qemuboot" + +MACHINE_FEATURES_BACKFILL_CONSIDERED = "qemu-usermode" + +KERNEL_IMAGETYPES += "zImage" + +# runqemu +QB_SYSTEM_NAME = "qemu-system-arm" +QB_DEFAULT_FSTYPE = "mtd" +QB_ROOTFS_OPT = "-drive file=@ROOTFS@,format=raw,if=mtd" +QB_MACHINE = "-M ast2500-evb,fmc-model=mx25l25635e,spi-model=mx25l25635e" +QB_OPT_APPEND += " -nographic -serial mon:stdio -serial none" +QB_NETWORK_DEVICE = "-net nic,macaddr=C0:FF:EE:00:00:02,model=ftgmac100" +QB_DEFAULT_KERNEL = "none" +QB_RNG = "" +QB_MEM = "512" diff --git a/meta-ibs/meta-ast2500/conf/machine/include/sila-ast2500.inc b/meta-ibs/meta-ast2500/conf/machine/include/sila-ast2500.inc new file mode 100644 index 0000000000..4e1691a358 --- /dev/null +++ b/meta-ibs/meta-ast2500/conf/machine/include/sila-ast2500.inc @@ -0,0 +1,22 @@ + +KMACHINE = "aspeed" +KERNEL_DEVICETREE = "${KMACHINE}-bmc-${FACTORY}-${MACHINE}.dtb" + +PREFERRED_PROVIDER_virtual/bootloader = "u-boot-aspeed" +PREFERRED_PROVIDER_u-boot = "u-boot-aspeed" +PREFERRED_PROVIDER_u-boot-fw-utils = "u-boot-fw-utils-aspeed" + +UBOOT_MACHINE = "ast_g5_phy_config" + +require conf/machine/include/ast2500.inc +require conf/machine/include/obmc-bsp-common.inc +require conf/machine/include/ibs.inc + +include conf/machine/include/obmc-bsp-sila-common.inc + +SERIAL_CONSOLES = "115200;ttyS3 115200;ttyS4" + +FLASH_SIZE = "32768" +FLASH_ROFS_OFFSET = "5632" + +IMAGE_FEATURES += "allow-root-login" diff --git a/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed/aspeed-bmc-sila-cp2-5422.dts b/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed/aspeed-bmc-sila-cp2-5422.dts new file mode 100644 index 0000000000..9410fc4794 --- /dev/null +++ b/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed/aspeed-bmc-sila-cp2-5422.dts @@ -0,0 +1,517 @@ +/dts-v1/; + +#include "aspeed-g5.dtsi" +#include <dt-bindings/gpio/aspeed-gpio.h> +#include <dt-bindings/i2c/i2c.h> + +/ { + model = "CP2-5422 BMC"; + compatible = "sila,cp2-5422-bmc", "aspeed,ast2500"; + + aliases { + serial4 = &uart5; + serial5 = &vuart; + }; + + chosen { + stdout-path = &uart5; + bootargs = "console=ttyS4,115200 earlyprintk"; + }; + + memory@80000000 { + reg = <0x80000000 0x20000000>; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + vga_memory: framebuffer@7f000000 { + no-map; + phandle = <0xf6>; + reg = <0x7f000000 0x01000000>; /* 16M */ + }; + + gfx_memory: framebuffer { + reusable; + compatible = "shared-dma-pool"; + alignment = <0x01000000>; + size = <0x01000000>; + phandle = <0x0a>; + }; + + video_engine_memory: jpegbuffer { + reusable; + compatible = "shared-dma-pool"; + alignment = <0x01000000>; + size = <0x02000000>; /* 32M */ + phandle = <0x0d>; + }; + + ramoops@9eff0000{ + compatible = "ramoops"; + record-size = <0x2000>; + console-size = <0x2000>; + reg = <0x9eff0000 0x10000>; + }; + }; + + vga-shared-memory { + compatible = "aspeed,ast2500-vga-sharedmem"; + reg = <0x9ff00000 0x100000>; + }; + + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>, + <&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>, + <&adc 8>, <&adc 9>, <&adc 10>, <&adc 11>, + <&adc 12>, <&adc 13>, <&adc 14>, <&adc 15>; + }; + + leds { + compatible = "gpio-leds"; + + identify { + default-state = "off"; + gpios = <&gpio ASPEED_GPIO(S, 6) GPIO_ACTIVE_LOW>; + }; + + status_amber { + default-state = "off"; + gpios = <&gpio ASPEED_GPIO(S, 5) GPIO_ACTIVE_LOW>; + }; + + status_green { + default-state = "keep"; + gpios = <&gpio ASPEED_GPIO(S, 4) GPIO_ACTIVE_LOW>; + }; + }; + + beeper { + compatible = "pwm-beeper"; + pwms = <&timer 6 1000000 0>; + }; +}; + +&fmc { + status = "okay"; + flash@0 { + status = "okay"; + m25p,fast-read; + label = "bmc"; +#include "openbmc-flash-layout-32MB.dtsi" + }; +}; + +&espi { + status = "okay"; +}; + +&jtag { + status = "okay"; +}; + +&peci0 { + status = "okay"; + gpios = <&gpio ASPEED_GPIO(F, 6) 0>; +}; + +&syscon { + uart-clock-high-speed; + status = "okay"; + + misc_control { + compatible = "aspeed,bmc-misc"; + uart_port_debug { + offset = <0x2c>; + bit-mask = <0x1>; + bit-shift = <10>; + read-only; + }; + p2a-bridge { + offset = <0x180>; + bit-mask = <0x1>; + bit-shift = <1>; + read-only; + }; + boot-2nd-flash { + offset = <0x70>; + bit-mask = <0x1>; + bit-shift = <17>; + read-only; + }; + chip_id { + offset = <0x150>; + bit-mask = <0x0fffffff 0xffffffff>; + bit-shift = <0>; + read-only; + reg-width = <64>; + hash-data = "d44f9b804976fa23c2e25d62f16154d26520a7e24c5555095fd1b55c027804f1570dcd16189739c640cd7d9a6ce14944a2c4eaf1dc429eed6940e8a83498a474"; + }; + silicon_id { + offset = <0x7c>; + bit-mask = <0xffffffff>; + bit-shift = <0>; + read-only; + reg-width = <32>; + }; + }; +}; + +&adc { + status = "okay"; +}; + +&gpio { + status = "okay"; + /* Enable GPIOE0 and GPIOE2 pass-through by default */ + pinctrl-names = "pass-through"; + pinctrl-0 = <&pinctrl_gpie0_default + &pinctrl_gpie2_default>; + gpio-line-names = + /*A0-A7*/ "","","","","","","","", + /*B0-B7*/ "","","","","","","","", + /*C0-C7*/ "","","","","","","","", + /*D0-D7*/ "","","","","","","","", + /*E0-E7*/ "RESET_BUTTON","RESET_OUT","POWER_BUTTON","POWER_OUT","","","","", + /*F0-F7*/ "NMI_OUT","","","","CPU_ERR0","CPU_ERR1","","", + /*G0-G7*/ "CPU_ERR2","CPU_CATERR","PCH_BMC_THERMTRIP","LCP_ENTER_BUTTON","LCP_LEFT_BUTTON","FM_BMC_BOARD_SKU_ID5_N","","", + /*H0-H7*/ "","","","FM_NODE_ID_1","FM_NODE_ID_2","FM_NODE_ID_3","FM_NODE_ID_4","FM_240VA_STATUS", + /*I0-I7*/ "FM_SYS_FAN0_PRSNT_D_N","FM_SYS_FAN1_PRSNT_D_N","FM_SYS_FAN2_PRSNT_D_N","FM_SYS_FAN3_PRSNT_D_N","FM_SYS_FAN4_PRSNT_D_N","FM_SYS_FAN5_PRSNT_D_N","","", + /*J0-J7*/ "","","","","","","","", + /*K0-K7*/ "","","","","","","","", + /*L0-L7*/ "","","","","","","","", + /*M0-M7*/ "","","","","","","","", + /*N0-N7*/ "","","","","","","","", + /*O0-O7*/ "","","","","","","","", + /*P0-P7*/ "","","","","","","","", + /*Q0-Q7*/ "","","","","","","","PWR_DEBUG_N", + /*R0-R7*/ "","XDP_PRST_N","","","","","","CHASSIS_INTRUSION", + /*S0-S7*/ "REMOTE_DEBUG_ENABLE","SYSPWROK","RSMRST_N","","","","","", + /*T0-T7*/ "","","","","","","","", + /*U0-U7*/ "","","","","","","","", + /*V0-V7*/ "","","","","","","","", + /*W0-W7*/ "","","","","","","","", + /*X0-X7*/ "","","","","","","","", + /*Y0-Y7*/ "SIO_S3","SIO_S5","","SIO_ONCONTROL","","","","", + /*Z0-Z7*/ "","SIO_POWER_GOOD","","","","","","", + /*AA0-AA7*/ "P3VBAT_BRIDGE_EN","","","","PREQ_N","TCK_MUX_SEL","SMI","POST_COMPLETE", + /*AB0-AB7*/ "","NMI_BUTTON","ID_BUTTON","PS_PWROK","","","","", + /*AC0-AC7*/ "","","","","","","",""; +}; + +&sgpio { + ngpios = <80>; + bus-frequency = <2000000>; + status = "okay"; + /* SGPIO lines. even: input, odd: output */ + gpio-line-names = + /*A0-A7*/ "CPU1_PRESENCE","","CPU1_THERMTRIP","","CPU1_VRHOT","","CPU1_FIVR_FAULT","","CPU1_MEM_ABCD_VRHOT","","CPU1_MEM_EFGH_VRHOT","","","","","", + /*B0-B7*/ "CPU1_MISMATCH","LED_CPU1_CH1_DIMM1_FAULT","CPU1_MEM_THERM_EVENT","LED_CPU1_CH1_DIMM2_FAULT","CPU2_PRESENCE","LED_CPU1_CH2_DIMM1_FAULT","CPU2_THERMTRIP","LED_CPU1_CH2_DIMM2_FAULT","CPU2_VRHOT","LED_CPU1_CH3_DIMM1_FAULT","CPU2_FIVR_FAULT","LED_CPU1_CH3_DIMM2_FAULT","CPU2_MEM_ABCD_VRHOT","LED_CPU1_CH4_DIMM1_FAULT","CPU2_MEM_EFGH_VRHOT","LED_CPU1_CH4_DIMM2_FAULT", + /*C0-C7*/ "","LED_CPU1_CH5_DIMM1_FAULT","","LED_CPU1_CH5_DIMM2_FAULT","CPU2_MISMATCH","LED_CPU1_CH6_DIMM1_FAULT","CPU2_MEM_THERM_EVENT","LED_CPU1_CH6_DIMM2_FAULT","","LED_FAN1_FAULT","","LED_FAN2_FAULT","","LED_FAN3_FAULT","","LED_FAN4_FAULT", + /*D0-D7*/ "","LED_FAN5_FAULT","","LED_FAN6_FAULT","","LED_FAN7_FAULT","","LED_FAN8_FAULT","","LED_CPU2_CH1_DIMM1_FAULT","","LED_CPU2_CH1_DIMM2_FAULT","","LED_CPU2_CH2_DIMM1_FAULT","","LED_CPU2_CH2_DIMM2_FAULT", + /*E0-E7*/ "","LED_CPU2_CH3_DIMM1_FAULT","","LED_CPU2_CH3_DIMM2_FAULT","","LED_CPU2_CH4_DIMM1_FAULT","","LED_CPU2_CH4_DIMM2_FAULT","","LED_CPU2_CH5_DIMM1_FAULT","","LED_CPU2_CH5_DIMM2_FAULT","","LED_CPU2_CH6_DIMM1_FAULT","","LED_CPU2_CH6_DIMM2_FAULT", + /*F0-F7*/ "SGPIO_PLD_MINOR_REV_BIT0","LED_CPU3_CH1_DIMM1_FAULT","SGPIO_PLD_MINOR_REV_BIT1","LED_CPU3_CH1_DIMM2_FAULT","SGPIO_PLD_MINOR_REV_BIT2","LED_CPU3_CH2_DIMM1_FAULT","SGPIO_PLD_MINOR_REV_BIT3","LED_CPU3_CH2_DIMM2_FAULT","SGPIO_PLD_MAJOR_REV_BIT0","LED_CPU3_CH3_DIMM1_FAULT","SGPIO_PLD_MAJOR_REV_BIT1","LED_CPU3_CH3_DIMM2_FAULT","SGPIO_PLD_MAJOR_REV_BIT2","LED_CPU3_CH4_DIMM1_FAULT","SGPIO_PLD_MAJOR_REV_BIT3","LED_CPU3_CH4_DIMM2_FAULT", + /*G0-G7*/ "MAIN_PLD_MINOR_REV_BIT0","LED_CPU3_CH5_DIMM1_FAULT","MAIN_PLD_MINOR_REV_BIT1","LED_CPU3_CH5_DIMM2_FAULT","MAIN_PLD_MINOR_REV_BIT2","LED_CPU3_CH6_DIMM1_FAULT","MAIN_PLD_MINOR_REV_BIT3","LED_CPU3_CH6_DIMM2_FAULT","MAIN_PLD_MAJOR_REV_BIT0","LED_CPU4_CH1_DIMM1_FAULT","MAIN_PLD_MAJOR_REV_BIT1","LED_CPU4_CH1_DIMM2_FAULT","MAIN_PLD_MAJOR_REV_BIT2","LED_CPU4_CH2_DIMM1_FAULT","MAIN_PLD_MAJOR_REV_BIT3","LED_CPU4_CH2_DIMM2_FAULT", + /*H0-H7*/ "","LED_CPU4_CH3_DIMM1_FAULT","","LED_CPU4_CH3_DIMM2_FAULT","","LED_CPU4_CH4_DIMM1_FAULT","","LED_CPU4_CH4_DIMM2_FAULT","","LED_CPU4_CH5_DIMM1_FAULT","","LED_CPU4_CH5_DIMM2_FAULT","","LED_CPU4_CH6_DIMM1_FAULT","","LED_CPU4_CH6_DIMM2_FAULT", + /*I0-I7*/ "","","","","","","","","","","","","","","","", + /*J0-J7*/ "","","","","","","","","","","","","","","",""; +#if 0 + status = "okay"; + gpio-line-names = + /* SGPIO output lines */ + /*OA0-OA7*/ "","","","","","","","", + /*OB0-OB7*/ "LED_CPU1_CH1_DIMM1_FAULT","LED_CPU1_CH1_DIMM2_FAULT","LED_CPU1_CH2_DIMM1_FAULT","LED_CPU1_CH2_DIMM2_FAULT","LED_CPU1_CH3_DIMM1_FAULT","LED_CPU1_CH3_DIMM2_FAULT","LED_CPU1_CH4_DIMM1_FAULT","LED_CPU1_CH4_DIMM2_FAULT", + /*OC0-OC7*/ "LED_CPU1_CH5_DIMM1_FAULT","LED_CPU1_CH5_DIMM2_FAULT","LED_CPU1_CH6_DIMM1_FAULT","LED_CPU1_CH6_DIMM2_FAULT","LED_FAN1_FAULT","LED_FAN2_FAULT","LED_FAN3_FAULT","LED_FAN4_FAULT", + /*OD0-OD7*/ "LED_FAN5_FAULT","LED_FAN6_FAULT","LED_FAN7_FAULT","LED_FAN8_FAULT","LED_CPU2_CH1_DIMM1_FAULT","LED_CPU1_CH1_DIMM2_FAULT","LED_CPU2_CH2_DIMM1_FAULT","LED_CPU2_CH2_DIMM2_FAULT", + /*OE0-OE7*/ "LED_CPU2_CH3_DIMM1_FAULT","LED_CPU2_CH3_DIMM2_FAULT","LED_CPU2_CH4_DIMM1_FAULT","LED_CPU2_CH4_DIMM2_FAULT","LED_CPU2_CH5_DIMM1_FAULT","LED_CPU2_CH5_DIMM2_FAULT","LED_CPU2_CH6_DIMM1_FAULT","LED_CPU2_CH6_DIMM2_FAULT", + /*OF0-OF7*/ "LED_CPU3_CH1_DIMM1_FAULT","LED_CPU3_CH1_DIMM2_FAULT","LED_CPU3_CH2_DIMM1_FAULT","LED_CPU3_CH2_DIMM2_FAULT","LED_CPU3_CH3_DIMM1_FAULT","LED_CPU3_CH3_DIMM2_FAULT","LED_CPU3_CH4_DIMM1_FAULT","LED_CPU3_CH4_DIMM2_FAULT", + /*OG0-OG7*/ "LED_CPU3_CH5_DIMM1_FAULT","LED_CPU3_CH5_DIMM2_FAULT","LED_CPU3_CH6_DIMM1_FAULT","LED_CPU3_CH6_DIMM2_FAULT","LED_CPU4_CH1_DIMM1_FAULT","LED_CPU4_CH1_DIMM2_FAULT","LED_CPU4_CH2_DIMM1_FAULT","LED_CPU4_CH2_DIMM2_FAULT", + /*OH0-OH7*/ "LED_CPU4_CH3_DIMM1_FAULT","LED_CPU4_CH3_DIMM2_FAULT","LED_CPU4_CH4_DIMM1_FAULT","LED_CPU4_CH4_DIMM2_FAULT","LED_CPU4_CH5_DIMM1_FAULT","LED_CPU4_CH5_DIMM2_FAULT","LED_CPU4_CH6_DIMM1_FAULT","LED_CPU4_CH6_DIMM2_FAULT", + /*OI0-OI7*/ "","","","","","","","", + /*OJ0-OJ7*/ "","","","","","","","", + /*DUMMY*/ "","","","","","","","", + /*DUMMY*/ "","","","","","","","", + + /* SGPIO input lines */ + /*IA0-IA7*/ "CPU1_PRESENCE","CPU1_THERMTRIP","CPU1_VRHOT","CPU1_FIVR_FAULT","CPU1_MEM_ABCD_VRHOT","CPU1_MEM_EFGH_VRHOT","","", + /*IB0-IB7*/ "CPU1_MISMATCH","CPU1_MEM_THERM_EVENT","CPU2_PRESENCE","CPU2_THERMTRIP","CPU2_VRHOT","CPU2_FIVR_FAULT","CPU2_MEM_ABCD_VRHOT","CPU2_MEM_EFGH_VRHOT", + /*IC0-IC7*/ "","","CPU2_MISMATCH","CPU2_MEM_THERM_EVENT","","","","", + /*ID0-ID7*/ "","","","","","","","", + /*IE0-IE7*/ "","","","","","","","", + /*IF0-IF7*/ "SGPIO_PLD_MINOR_REV_BIT0","SGPIO_PLD_MINOR_REV_BIT1","SGPIO_PLD_MINOR_REV_BIT2","SGPIO_PLD_MINOR_REV_BIT3","SGPIO_PLD_MAJOR_REV_BIT0","SGPIO_PLD_MAJOR_REV_BIT1","SGPIO_PLD_MAJOR_REV_BIT2","SGPIO_PLD_MAJOR_REV_BIT3", + /*IG0-IG7*/ "MAIN_PLD_MINOR_REV_BIT0","MAIN_PLD_MINOR_REV_BIT1","MAIN_PLD_MINOR_REV_BIT2","MAIN_PLD_MINOR_REV_BIT3","MAIN_PLD_MAJOR_REV_BIT0","MAIN_PLD_MAJOR_REV_BIT1","MAIN_PLD_MAJOR_REV_BIT2","MAIN_PLD_MAJOR_REV_BIT3", + /*IH0-IH7*/ "","","","","","","","", + /*II0-II7*/ "","","","","","","","", + /*IJ0-IJ7*/ "","","","","","","",""; +#endif +}; + +&kcs3 { + aspeed,lpc-io-reg = <0xCA2>; + status = "okay"; +}; + +&kcs4 { + aspeed,lpc-io-reg = <0xCA4>; + status = "okay"; +}; + +&sio_regs { + status = "okay"; + sio_status { + offset = <0x10C>; + bit-mask = <0x1F>; + bit-shift = <4>; + }; +}; + +&lpc_sio { + status = "okay"; +}; + +&lpc_snoop { + snoop-ports = <0x80>; + status = "okay"; +}; + +&mbox { + status = "okay"; +}; + +&uart_routing { + status = "okay"; +}; + +/** + * SAFS through SPI1 is available only on Wilson Point. + * These pins are used as fan presence checking gpios in WFP + * so commenting it out for now. + * &spi1 { + * status = "okay"; + * + * flash@0 { + * m25p,fast-read; + * status = "okay"; + * }; + *}; + */ + +&uart1 { + //Host Console + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd1_default + &pinctrl_rxd1_default + &pinctrl_nrts1_default + &pinctrl_ndtr1_default + &pinctrl_ndsr1_default + &pinctrl_ncts1_default + &pinctrl_ndcd1_default + &pinctrl_nri1_default>; +}; + +&uart2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd2_default + &pinctrl_rxd2_default + &pinctrl_nrts2_default + &pinctrl_ndtr2_default + &pinctrl_ndsr2_default + &pinctrl_ncts2_default + &pinctrl_ndcd2_default + &pinctrl_nri2_default>; +}; + +&uart3 { + status = "okay"; +}; + +&uart4 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <>; +}; + +&uart5 { + //BMC Console + status = "okay"; +}; + +&mac1 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rgmii2_default &pinctrl_mdio2_default>; +}; + +&mac0 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rmii1_default>; + use-ncsi; +}; + +&i2c0 { + multi-master; + general-call; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; +}; + +&i2c1 { + multi-master; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; +}; + +&i2c2 { + multi-master; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; +}; + +&i2c3 { + multi-master; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; + + rtc-pch@44 { + compatible = "rtc,pchc620"; + reg = <0x44>; + }; +}; + +&i2c4 { + multi-master; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; +}; + +&i2c5 { + bus-frequency = <1000000>; + multi-master; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; +}; + +&i2c6 { + multi-master; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; +}; + +&i2c7 { + multi-master; + #retries = <3>; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; +}; + +&i2c9 { + multi-master; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; +}; + +&i2c11 { + multi-master; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; +}; + +&i2c13 { + multi-master; + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; +}; + +&gfx { + status = "okay"; + memory-region = <&gfx_memory>; +}; + +&vuart { + status = "okay"; +}; + +&pwm_tacho { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default + &pinctrl_pwm2_default &pinctrl_pwm3_default + &pinctrl_pwm4_default &pinctrl_pwm5_default + &pinctrl_pwm6_default &pinctrl_pwm7_default>; + + fan@0 { + reg = <0x00>; + aspeed,fan-tach-ch = /bits/ 8 <0x00 0x01>; + }; + fan@1 { + reg = <0x01>; + aspeed,fan-tach-ch = /bits/ 8 <0x02 0x03>; + }; + fan@2 { + reg = <0x02>; + aspeed,fan-tach-ch = /bits/ 8 <0x04 0x05>; + }; + fan@3 { + reg = <0x03>; + aspeed,fan-tach-ch = /bits/ 8 <0x06 0x07>; + }; + fan@4 { + reg = <0x04>; + aspeed,fan-tach-ch = /bits/ 8 <0x08 0x09>; + }; + fan@5 { + reg = <0x05>; + aspeed,fan-tach-ch = /bits/ 8 <0x0A 0x0B>; + }; + fan@6 { + reg = <0x06>; + aspeed,fan-tach-ch = /bits/ 8 <0x0C 0x0D>; + }; + fan@7 { + reg = <0x07>; + aspeed,fan-tach-ch = /bits/ 8 <0x0E 0x0F>; + }; + +}; + +&timer { +/* + * Available settings: + * fttmr010,pwm-outputs = <5>, <6>, <7>, <8>; + * pinctrl-0 = <&pinctrl_timer5_default &pinctrl_timer6_default + * &pinctrl_timer7_default &pinctrl_timer8_default>; + */ + fttmr010,pwm-outputs = <6>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_timer6_default>; + #pwm-cells = <3>; + status = "okay"; +}; + +&video { + status = "okay"; + memory-region = <&video_engine_memory>; +}; + +&vhub { + status = "okay"; +}; diff --git a/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed/openbmc-flash-layout-32MB.dtsi b/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed/openbmc-flash-layout-32MB.dtsi new file mode 100644 index 0000000000..8412e0ec17 --- /dev/null +++ b/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed/openbmc-flash-layout-32MB.dtsi @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0+ +// 32MB flash layout: + +partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + u-boot@0 { + reg = <0x0 0x60000>; + label = "u-boot"; + }; + + u-boot-env@60000 { + reg = <0x60000 0x20000>; + label = "u-boot-env"; + }; + + kernel@80000 { + reg = <0x80000 0x500000>; + label = "kernel"; + }; + + rofs@580000 { + reg = <0x580000 0x1680000>; + label = "rofs"; + }; + + rwfs@1c00000 { + reg = <0x1c00000 0x400000>; + label = "rwfs"; + }; +}; diff --git a/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed/sila.cfg b/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed/sila.cfg new file mode 100644 index 0000000000..36eac9162f --- /dev/null +++ b/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed/sila.cfg @@ -0,0 +1,107 @@ +CONFIG_HWMON=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_IIO=y +CONFIG_SENSORS_IIO_HWMON=y +CONFIG_ASPEED_ADC=y +CONFIG_GPIO_ASPEED_SGPIO=y +CONFIG_CRC8=y +CONFIG_PECI=y +CONFIG_PECI_CHARDEV=y +CONFIG_PECI_ASPEED=y +CONFIG_SENSORS_PECI_CPUTEMP=y +CONFIG_SENSORS_PECI_DIMMTEMP=y +CONFIG_SENSORS_PECI_CPUPOWER=y +CONFIG_SENSORS_PECI_DIMMPOWER=y +CONFIG_SENSORS_PECI_PLATFORMPOWER=y +CONFIG_CONFIGFS_FS=y +CONFIG_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_SDHCI_OF_ASPEED=y +CONFIG_EXFAT_FS=y +CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" +CONFIG_FAT_FS=y +CONFIG_FAT_DEFAULT_IOCHARSET="utf8" +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=49152 +CONFIG_CIFS=y +CONFIG_CIFS_XATTR=y +CONFIG_AUTOFS4_FS=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x01 +CONFIG_MAGIC_SYSRQ_SERIAL=y +CONFIG_ASPEED_ESPI_SLAVE=y +CONFIG_ASPEED_KCS_IPMI_BMC=y +CONFIG_I2C_SLAVE=y +CONFIG_I2C_SLAVE_MQUEUE=y +CONFIG_I2C_SLAVE_MQUEUE_MESSAGE_SIZE=256 +CONFIG_I2C_SLAVE_MQUEUE_QUEUE_SIZE=32 +CONFIG_ASPEED_BT_IPMI_BMC=n +CONFIG_ASPEED_LPC_CTRL=n +CONFIG_ASPEED_LPC_MBOX=y +CONFIG_ASPEED_LPC_SIO=y +CONFIG_ASPEED_LPC_SNOOP=y +CONFIG_JTAG=y +CONFIG_JTAG_ASPEED=y +CONFIG_FRAME_VECTOR=y +CONFIG_MEDIA_SUPPORT=y +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_VIDEO_DEV=y +CONFIG_VIDEO_V4L2=y +CONFIG_V4L_PLATFORM_DRIVERS=y +CONFIG_VIDEO_ASPEED=y +CONFIG_VIDEOBUF2_CORE=y +CONFIG_VIDEOBUF2_V4L2=y +CONFIG_VIDEOBUF2_MEMOPS=y +CONFIG_VIDEOBUF2_DMA_CONTIG=y +CONFIG_MEDIA_SUBDRV_AUTOSELECT=y +CONFIG_USB_GADGET_VBUS_DRAW=2 +CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 +CONFIG_USB_LIBCOMPOSITE=y +CONFIG_USB_F_HID=y +CONFIG_USB_GADGET=y +CONFIG_U_SERIAL_CONSOLE=y +CONFIG_USB_ASPEED_VHUB=y +CONFIG_USB_MASS_STORAGE=y +CONFIG_USB_CONFIGFS=y +CONFIG_USB_CONFIGFS_MASS_STORAGE=y +CONFIG_USB_CONFIGFS_F_FS=y +CONFIG_USB_CONFIGFS_F_HID=y +CONFIG_ASPEED_UART_ROUTING=y +CONFIG_ASPEED_VGA_SHAREDMEM=y +CONFIG_PWM=y +CONFIG_PWM_FTTMR010=y +CONFIG_INPUT_MISC=y +CONFIG_INPUT_PWM_BEEPER=y +CONFIG_VFAT_FS=y +CONFIG_NLS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_15=y +CONFIG_NLS_UTF8=y +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_PSTORE=y +CONFIG_PSTORE_ZLIB_COMPRESS=y +CONFIG_PSTORE_RAM=y +CONFIG_FSI=n +CONFIG_FSI_MASTER_HUB=n +CONFIG_FSI_MASTER_ASPEED=n +CONFIG_FSI_SCOM=n +CONFIG_FSI_SBEFIFO=n +CONFIG_FSI_OCC=n +CONFIG_ASPEED_P2A_CTRL=n +CONFIG_USB=n +CONFIG_USB_ANNOUNCE_NEW_DEVICES=n +CONFIG_USB_DYNAMIC_MINORS=n +CONFIG_USB_EHCI_HCD=n +CONFIG_USB_EHCI_ROOT_HUB_TT=n +CONFIG_USB_EHCI_HCD_PLATFORM=n +CONFIG_IPMB_DEVICE_INTERFACE=y +CONFIG_BPF_SYSCALL=n +CONFIG_IPV6_SIT=n +CONFIG_RTC_DRV_PCHC620=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" diff --git a/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend new file mode 100644 index 0000000000..7ced02fda2 --- /dev/null +++ b/meta-ibs/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend @@ -0,0 +1,22 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +################################################################################# +LINUX_VERSION = "5.15.24" + +KBRANCH = "dev-5.15-intel" +KSRC = "git://github.com/Intel-BMC/linux;protocol=ssh;branch=${KBRANCH}" +# Include this as a comment only for downstream auto-bump +# SRC_URI = "git://github.com/Intel-BMC/linux;protocol=ssh;branch=dev-5.15-intel" +SRCREV = "6eca78d14f7aef61a149d9f4d3a3ec818b98f18e" + +do_compile:prepend(){ + # device tree compiler flags + export DTC_FLAGS=-@ +} +################################################################################# + +SRC_URI += " \ + file://sila.cfg \ + file://aspeed-bmc-sila-cp2-5422.dts;subdir=git/arch/arm/boot/dts \ + file://openbmc-flash-layout-32MB.dtsi;subdir=git/arch/arm/boot/dts \ + " diff --git a/meta-ibs/meta-ast2500/recipes-phosphor/configuration/entity-manager/SILA-Baseboard.json b/meta-ibs/meta-ast2500/recipes-phosphor/configuration/entity-manager/SILA-Baseboard.json new file mode 100644 index 0000000000..463edea23c --- /dev/null +++ b/meta-ibs/meta-ast2500/recipes-phosphor/configuration/entity-manager/SILA-Baseboard.json @@ -0,0 +1,1482 @@ +{ + "Exposes": [ + { + "Index": 0, + "Name": "Baseboard 12Volt", + "PowerState": "On", + "ScaleFactor": 0.1124, + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 13.494 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 13.101 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 10.945 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 10.616 + } + ], + "Type": "ADC" + }, + { + "Index": 3, + "Name": "P105_PCH_AUX", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 1.139 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 1.106 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 0.995 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0.966 + } + ], + "Type": "ADC" + }, + { + "Index": 5, + "Name": "P12V_AUX", + "ScaleFactor": 0.1124, + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 13.494 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 13.101 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 10.945 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 10.616 + } + ], + "Type": "ADC" + }, + { + "Index": 6, + "Name": "P1V8_PCH", + "ScaleFactor": 0.7505, + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 1.961 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 1.904 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 1.699 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 1.648 + } + ], + "Type": "ADC" + }, + { + "Index": 1, + "Name": "P3V3", + "PowerState": "On", + "ScaleFactor": 0.4107, + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 3.647 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 3.541 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 3.066 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 2.974 + } + ], + "Type": "ADC" + }, + { + "CPURequired": 1, + "Index": 8, + "Name": "PVCCIN_CPU1", + "PowerState": "On", + "ScaleFactor": 0.7505, + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 2.151 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 2.088 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 1.418 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 1.376 + } + ], + "Type": "ADC" + }, + { + "CPURequired": 2, + "Index": 9, + "Name": "PVCCIN_CPU2", + "PowerState": "On", + "ScaleFactor": 0.7505, + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 2.151 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 2.088 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 1.418 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 1.376 + } + ], + "Type": "ADC" + }, + { + "CPURequired": 1, + "Index": 14, + "Name": "PVCCIO_CPU1", + "PowerState": "On", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 1.19 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 1.155 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 0.752 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0.729 + } + ], + "Type": "ADC" + }, + { + "CPURequired": 2, + "Index": 15, + "Name": "PVCCIO_CPU2", + "PowerState": "On", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 1.19 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 1.155 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 0.752 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0.729 + } + ], + "Type": "ADC" + }, + { + "CPURequired": 1, + "Index": 10, + "Name": "PVDQ_ABC_CPU1", + "PowerState": "On", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 1.301 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 1.263 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 1.138 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 1.104 + } + ], + "Type": "ADC" + }, + { + "CPURequired": 2, + "Index": 12, + "Name": "PVDQ_ABC_CPU2", + "PowerState": "On", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 1.301 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 1.263 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 1.138 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 1.104 + } + ], + "Type": "ADC" + }, + { + "CPURequired": 1, + "Index": 11, + "Name": "PVDQ_DEF_CPU1", + "PowerState": "On", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 1.301 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 1.263 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 1.138 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 1.104 + } + ], + "Type": "ADC" + }, + { + "CPURequired": 2, + "Index": 13, + "Name": "PVDQ_DEF_CPU2", + "PowerState": "On", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 1.301 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 1.263 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 1.138 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 1.104 + } + ], + "Type": "ADC" + }, + { + "Index": 2, + "Name": "PVNN_PCH_AUX", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 1.081 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 1.049 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 0.807 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0.783 + } + ], + "Type": "ADC" + }, + { + "Name": "Host CPU Utilization", + "Polling": { + "AveragingPeriod": 3000, + "Interval": 1000 + }, + "Type": "HostCpuUtilization" + }, + { + "LED": "fan1_fault", + "Name": "1U System Fan connector 1", + "Pwm": 0, + "Status": "disabled", + "Tachs": [ + 0, + 1 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan2_fault", + "Name": "1U System Fan connector 2", + "Pwm": 1, + "Status": "disabled", + "Tachs": [ + 2, + 3 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan3_fault", + "Name": "1U System Fan connector 3", + "Pwm": 2, + "Status": "disabled", + "Tachs": [ + 4, + 5 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan4_fault", + "Name": "1U System Fan connector 4", + "Pwm": 3, + "Status": "disabled", + "Tachs": [ + 6, + 7 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan5_fault", + "Name": "1U System Fan connector 5", + "Pwm": 4, + "Status": "disabled", + "Tachs": [ + 8, + 9 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan6_fault", + "Name": "1U System Fan connector 6", + "Pwm": 5, + "Status": "disabled", + "Tachs": [ + 10, + 11 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan1_fault", + "Name": "2U System Fan connector 1", + "Pwm": 0, + "Status": "disabled", + "Tachs": [ + 0 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan2_fault", + "Name": "2U System Fan connector 2", + "Pwm": 1, + "Status": "disabled", + "Tachs": [ + 2 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan3_fault", + "Name": "2U System Fan connector 3", + "Pwm": 2, + "Status": "disabled", + "Tachs": [ + 4 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan4_fault", + "Name": "2U System Fan connector 4", + "Pwm": 3, + "Status": "disabled", + "Tachs": [ + 6 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan5_fault", + "Name": "2U System Fan connector 5", + "Pwm": 4, + "Status": "disabled", + "Tachs": [ + 8 + ], + "Type": "IntelFanConnector" + }, + { + "LED": "fan6_fault", + "Name": "2U System Fan connector 6", + "Pwm": 5, + "Status": "disabled", + "Tachs": [ + 10 + ], + "Type": "IntelFanConnector" + }, + { + "Name": "CPU 1 Fan Connector", + "Pwm": 7, + "Status": "disabled", + "Tachs": [ + 13 + ], + "Type": "IntelFanConnector" + }, + { + "Name": "CPU 2 Fan Connector", + "Pwm": 8, + "Status": "disabled", + "Tachs": [ + 14 + ], + "Type": "IntelFanConnector" + }, + { + "Address": "0x8", + "Class": "METemp", + "Name": "SSB Temp", + "PowerState": "BiosPost", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 103 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 98 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "IpmbSensor" + }, + { + "Address": "0x7c", + "Class": "PxeBridgeTemp", + "HostSMbusIndex": 3, + "Name": "CPU1 P12V PVCCIO VR Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "IpmbSensor" + }, + { + "Address": "0x70", + "Class": "PxeBridgeTemp", + "HostSMbusIndex": 3, + "Name": "CPU1 P12V PVCCIN VR Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "IpmbSensor" + }, + { + "Address": "0x74", + "Class": "PxeBridgeTemp", + "HostSMbusIndex": 3, + "Name": "CPU1 VR Mem ABC Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "IpmbSensor" + }, + { + "Address": "0x78", + "Class": "PxeBridgeTemp", + "HostSMbusIndex": 3, + "Name": "CPU1 VR Mem DEF Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "IpmbSensor" + }, + { + "Address": "0x9c", + "Class": "PxeBridgeTemp", + "HostSMbusIndex": 3, + "Name": "CPU2 P12V PVCCIO VR Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "IpmbSensor" + }, + { + "Address": "0x50", + "Class": "PxeBridgeTemp", + "HostSMbusIndex": 3, + "Name": "CPU2 P12V PVCCIN VR Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "IpmbSensor" + }, + { + "Address": "0x94", + "Class": "PxeBridgeTemp", + "HostSMbusIndex": 3, + "Name": "CPU2 VR Mem ABC Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "IpmbSensor" + }, + { + "Address": "0x98", + "Class": "PxeBridgeTemp", + "HostSMbusIndex": 3, + "Name": "CPU2 VR Mem DEF Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "IpmbSensor" + }, + { + "Address": "0xAC", + "Class": "PxeBridgeTemp", + "HostSMbusIndex": 3, + "Name": "VR P1V05 Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "IpmbSensor" + }, + { + "Name": "Node Manager Sensor", + "Type": "NMSensor" + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -4.64, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "BMC Temp" + ], + "Name": "BMC Temp", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": 80.0, + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 1", + "Zone 2", + "Zone 3" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -4.64, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "DIMM [ABC]\\d+ CPU1" + ], + "Name": "CPU1 DIMM ABC", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": -15.0, + "SetPointOffset": "WarningHigh", + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 2", + "Zone 3", + "Zone 4" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -4.64, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "DIMM [DEF]\\d+ CPU1" + ], + "Name": "CPU1 DIMM DEF", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": -15.0, + "SetPointOffset": "WarningHigh", + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 1", + "Zone 2" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -4.64, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "DIMM [ABC]\\d+ CPU2" + ], + "Name": "CPU2 DIMM ABC", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": -15.0, + "SetPointOffset": "WarningHigh", + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 5", + "Zone 6", + "PSU" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -4.64, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "DIMM [DEF]\\d+ CPU2" + ], + "Name": "CPU2 DIMM DEF", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": -15.0, + "SetPointOffset": "WarningHigh", + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 3", + "Zone 4", + "Zone 5" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -4.64, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "DTS CPU1" + ], + "Name": "DTS CPU1", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": -25.0, + "SetPointOffset": "WarningHigh", + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 1", + "Zone 2", + "Zone 3" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -4.64, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "DTS CPU2" + ], + "Name": "DTS CPU2", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": -25.0, + "SetPointOffset": "WarningHigh", + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 4", + "Zone 5", + "Zone 6", + "PSU" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -8.8, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "Left Rear Temp" + ], + "Name": "Left Rear Temp", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": 55.0, + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 4", + "Zone 5", + "Zone 6" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -8.8, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "Right Rear Board" + ], + "Name": "Right Rear Board", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": 55.0, + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 1", + "Zone 2", + "Zone 3" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -4.64, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "SSB Temp" + ], + "Name": "SSB Temp", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": 76.0, + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 2", + "Zone 3", + "Zone 4" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -8.8, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "VR 1 Temp" + ], + "Name": "VR 1 Temp", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": 90.0, + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 1", + "Zone 2", + "Zone 3" + ] + }, + { + "Class": "temp", + "FFGainCoefficient": 0.0, + "FFOffCoefficient": 0.0, + "ICoefficient": -8.8, + "ILimitMax": 100, + "ILimitMin": 30, + "Inputs": [ + "VR 2 Temp" + ], + "Name": "VR 2 Temp", + "NegativeHysteresis": 5.0, + "OutLimitMax": 100, + "OutLimitMin": 30, + "Outputs": [], + "PCoefficient": -0.15, + "PositiveHysteresis": 0.0, + "SetPoint": 90.0, + "SlewNeg": -1, + "SlewPos": 0.0, + "Type": "Pid", + "Zones": [ + "Zone 4", + "Zone 5", + "Zone 6", + "PSU" + ] + }, + { + "Address": "0x4D", + "Bus": 6, + "Name": "Right Rear Board Temp", + "Name1": "Right Rear TMP421 Internal Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "TMP421" + }, + { + "Address": "0x4A", + "Bus": 6, + "Name": "BMC Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "TMP75" + }, + { + "Address": "0x49", + "Bus": 6, + "Name": "Left Rear Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "TMP75" + }, + { + "Address": "0x48", + "Bus": 6, + "Name": "VR 1 Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "TMP75" + }, + { + "Address": "0x4B", + "Bus": 6, + "Name": "VR 2 Temp", + "Thresholds": [ + { + "Direction": "greater than", + "Name": "upper critical", + "Severity": 1, + "Value": 115 + }, + { + "Direction": "greater than", + "Name": "upper non critical", + "Severity": 0, + "Value": 110 + }, + { + "Direction": "less than", + "Name": "lower non critical", + "Severity": 0, + "Value": 5 + }, + { + "Direction": "less than", + "Name": "lower critical", + "Severity": 1, + "Value": 0 + } + ], + "Type": "TMP75" + }, + { + "Address": "0x30", + "Bus": 0, + "CpuID": 1, + "Name": "CPU 1", + "PresenceGpio": [ + { + "Name": "CPU1_PRESENCE", + "Polarity": "Low" + } + ], + "Type": "XeonCPU" + }, + { + "Address": "0x31", + "Bus": 0, + "CpuID": 2, + "Name": "CPU 2", + "PresenceGpio": [ + { + "Name": "CPU2_PRESENCE", + "Polarity": "Low" + } + ], + "Type": "XeonCPU" + } + ], + "Name": "SILA Baseboard", + "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'CP.*'})", + "Type": "Board", + "xyz.openbmc_project.Inventory.Decorator.Asset": { + "Manufacturer": "$BOARD_MANUFACTURER", + "Model": "$BOARD_PRODUCT_NAME", + "PartNumber": "$BOARD_PART_NUMBER", + "SerialNumber": "$BOARD_SERIAL_NUMBER" + }, + "xyz.openbmc_project.Inventory.Decorator.AssetTag": { + "AssetTag": "$PRODUCT_ASSET_TAG" + }, + "xyz.openbmc_project.Inventory.Item.Board.Motherboard": { + "ProductId": 123 + }, + "xyz.openbmc_project.Inventory.Item.System": {} +} diff --git a/meta-ibs/meta-ast2500/recipes-phosphor/configuration/entity-manager_%.bbappend b/meta-ibs/meta-ast2500/recipes-phosphor/configuration/entity-manager_%.bbappend new file mode 100644 index 0000000000..cb84bac7e8 --- /dev/null +++ b/meta-ibs/meta-ast2500/recipes-phosphor/configuration/entity-manager_%.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" +SRC_URI:append = " file://SILA-Baseboard.json \ + " + +RDEPENDS:${PN} += " default-fru" + +do_install:append() { + install -d ${D}/usr/share/entity-manager/configurations + install -m 0444 ${WORKDIR}/SILA-Baseboard.json ${D}/usr/share/entity-manager/configurations +} diff --git a/meta-ibs/meta-common/conf/layer.conf b/meta-ibs/meta-common/conf/layer.conf new file mode 100644 index 0000000000..d22521d90a --- /dev/null +++ b/meta-ibs/meta-common/conf/layer.conf @@ -0,0 +1,11 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "common" +BBFILE_PATTERN_common = "^${LAYERDIR}/" +BBFILE_PRIORITY_common = "9" +LAYERSERIES_COMPAT_common = "honister kirkstone" diff --git a/meta-ibs/meta-common/recipes-core/base-files/base-files/40-oom_reboot.conf b/meta-ibs/meta-common/recipes-core/base-files/base-files/40-oom_reboot.conf new file mode 100644 index 0000000000..43967a28b3 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/base-files/base-files/40-oom_reboot.conf @@ -0,0 +1,4 @@ +# panic kernel on OOM +vm.panic_on_oom=2 +# reboot after 10 sec on panic +kernel.panic=10 diff --git a/meta-ibs/meta-common/recipes-core/base-files/base-files/fstab b/meta-ibs/meta-common/recipes-core/base-files/base-files/fstab new file mode 100644 index 0000000000..12d9de7e94 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/base-files/base-files/fstab @@ -0,0 +1,10 @@ +/dev/root / auto defaults 1 1 +proc /proc proc defaults 0 0 +devpts /dev/pts devpts mode=0620,gid=5 0 0 +tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 +tmpfs /var/lib/systemd/coredump tmpfs rw,nosuid,nodev,size=67108864 0 0 +tmpfs /media tmpfs rw 0 0 + +# uncomment this if your device has a SD/MMC/Transflash slot +/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0 + diff --git a/meta-ibs/meta-common/recipes-core/base-files/base-files_%.bbappend b/meta-ibs/meta-common/recipes-core/base-files/base-files_%.bbappend new file mode 100644 index 0000000000..ba5e413608 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/base-files/base-files_%.bbappend @@ -0,0 +1,15 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI:append = " \ + file://fstab \ + file://40-oom_reboot.conf \ + " + +add_oom_reboot_config() { + install -d ${D}/${libdir}/sysctl.d + install -D -m 644 ${WORKDIR}/40-oom_reboot.conf ${D}/${libdir}/sysctl.d/40-oom_reboot.conf +} + +do_install:append() { + ${@bb.utils.contains('EXTRA_IMAGE_FEATURES', 'debug-tweaks', '', 'add_oom_reboot_config', d)} +} + diff --git a/meta-ibs/meta-common/recipes-core/busybox/busybox/enable-lsof.cfg b/meta-ibs/meta-common/recipes-core/busybox/busybox/enable-lsof.cfg new file mode 100644 index 0000000000..a302cb8b18 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/busybox/busybox/enable-lsof.cfg @@ -0,0 +1 @@ +CONFIG_LSOF=y diff --git a/meta-ibs/meta-common/recipes-core/busybox/busybox_%.bbappend b/meta-ibs/meta-common/recipes-core/busybox/busybox_%.bbappend new file mode 100644 index 0000000000..18e512bdc6 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/busybox/busybox_%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += " \ + file://enable-lsof.cfg \ + " diff --git a/meta-ibs/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb b/meta-ibs/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb new file mode 100644 index 0000000000..0a5bfdf5f8 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb @@ -0,0 +1,16 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=7becf906c8f8d03c237bad13bc3dac53" +inherit cmake systemd + +SRC_URI = "git://github.com/openbmc/host-error-monitor;branch=master;protocol=https" + +DEPENDS = "boost sdbusplus libgpiod libpeci" + +PV = "0.1+git${SRCPV}" +SRCREV = "57f47c44128222beb859ad9d63e9caf0c702b300" + +S = "${WORKDIR}/git" + +SYSTEMD_SERVICE:${PN} += "xyz.openbmc_project.HostErrorMonitor.service" + +EXTRA_OECMAKE = "-DYOCTO=1" diff --git a/meta-ibs/meta-common/recipes-core/kernel-panic-check/kernel-panic-check.bb b/meta-ibs/meta-common/recipes-core/kernel-panic-check/kernel-panic-check.bb new file mode 100644 index 0000000000..04e1b229a9 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/kernel-panic-check/kernel-panic-check.bb @@ -0,0 +1,26 @@ +SUMMARY = "Kernel panic Check" +DESCRIPTION = "script tool to check if the reboot is caused by kernel panic \ + log the kernel panic to systemd journal, and also log to redfish \ + " + +S = "${WORKDIR}" +SRC_URI = "file://kernel-panic-check.sh \ + file://kernel-panic-check.service \ +" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${IBSBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" +RDEPENDS:${PN} += "bash logger-systemd" + +inherit systemd + +FILES:${PN} += "${systemd_system_unitdir}/kernel-panic-check.service" + +do_install() { + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/kernel-panic-check.service ${D}${systemd_system_unitdir} + install -d ${D}${bindir} + install -m 0755 ${S}/kernel-panic-check.sh ${D}/${bindir}/kernel-panic-check.sh +} + +SYSTEMD_SERVICE:${PN} += " kernel-panic-check.service" diff --git a/meta-ibs/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.service b/meta-ibs/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.service new file mode 100644 index 0000000000..afe017baf3 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.service @@ -0,0 +1,9 @@ +[Unit] +Description=Check for kernel panic + +[Service] +Type=oneshot +ExecStart=/usr/bin/kernel-panic-check.sh + +[Install] +WantedBy=multi-user.target diff --git a/meta-ibs/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.sh b/meta-ibs/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.sh new file mode 100755 index 0000000000..815f50b711 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.sh @@ -0,0 +1,16 @@ +#!/bin/sh +panicFile="/sys/fs/pstore/dmesg-ramoops-0" +if [ -f $panicFile ] +then + # log the detailed last kernel panic messages + logger -t kernel-panic-check "Reboot from kernel panic! Log as following:" + cat $panicFile | logger + # Also log it to redfish + cat <<EOF | logger-systemd --journald +REDFISH_MESSAGE_ID=OpenBMC.0.1.BMCKernelPanic +PRIORITY=4 +MESSAGE=BMC rebooted due to kernel panic +EOF + + rm -rf $panicFile +fi diff --git a/meta-ibs/meta-common/recipes-core/systemd/systemd-conf/journald.conf b/meta-ibs/meta-common/recipes-core/systemd/systemd-conf/journald.conf new file mode 100644 index 0000000000..48c60d36b0 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/systemd/systemd-conf/journald.conf @@ -0,0 +1,42 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# Entries in this file show the compile time defaults. +# You can change settings by editing this file. +# Defaults can be restored by simply deleting this file. +# +# See journald.conf(5) for details. + +[Journal] +Storage=volatile +#Compress=yes +#Seal=yes +#SplitMode=uid +#SyncIntervalSec=5m +#RateLimitIntervalSec=30s +#RateLimitBurst=10000 +#SystemMaxUse=6M +#SystemKeepFree= +#SystemMaxFileSize=512K +#SystemMaxFiles=32 +RuntimeMaxUse=32M +#RuntimeKeepFree= +#RuntimeMaxFileSize= +#RuntimeMaxFiles=4 +#MaxRetentionSec= +#MaxFileSec=1month +#ForwardToSyslog=no +#ForwardToKMsg=no +#ForwardToConsole=no +#ForwardToWall=yes +#TTYPath=/dev/console +#MaxLevelStore=notice +#MaxLevelSyslog=debug +#MaxLevelKMsg=notice +#MaxLevelConsole=info +#MaxLevelWall=emerg +#LineMax=48K diff --git a/meta-ibs/meta-common/recipes-core/systemd/systemd-conf/systemd-timesyncd-save-time.conf b/meta-ibs/meta-common/recipes-core/systemd/systemd-conf/systemd-timesyncd-save-time.conf new file mode 100644 index 0000000000..aa455cbcb6 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/systemd/systemd-conf/systemd-timesyncd-save-time.conf @@ -0,0 +1,2 @@ +[Service] +ExecStop=touch /var/lib/systemd/timesync/clock
\ No newline at end of file diff --git a/meta-ibs/meta-common/recipes-core/systemd/systemd-conf_%.bbappend b/meta-ibs/meta-common/recipes-core/systemd/systemd-conf_%.bbappend new file mode 100644 index 0000000000..b7bd6796c2 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/systemd/systemd-conf_%.bbappend @@ -0,0 +1,11 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://journald.conf \ + file://systemd-timesyncd-save-time.conf \ + " + +FILES:${PN} += " ${systemd_system_unitdir}/systemd-timesyncd.service.d/systemd-timesyncd-save-time.conf" + +do_install:append() { + install -m 644 -D ${WORKDIR}/systemd-timesyncd-save-time.conf ${D}${systemd_system_unitdir}/systemd-timesyncd.service.d/systemd-timesyncd-save-time.conf +} diff --git a/meta-ibs/meta-common/recipes-core/systemd/systemd/0002-Add-event-log-for-system-time-synchronization.patch b/meta-ibs/meta-common/recipes-core/systemd/systemd/0002-Add-event-log-for-system-time-synchronization.patch new file mode 100644 index 0000000000..a9c90de850 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/systemd/systemd/0002-Add-event-log-for-system-time-synchronization.patch @@ -0,0 +1,114 @@ +From 5be7b53e598faa7605add3f9856d3b3eb4b50fe1 Mon Sep 17 00:00:00 2001 +From: Joshi-Mansi <mansi.joshi@linux.intel.com> +Date: Thu, 13 May 2021 03:09:24 +0530 +Subject: [PATCH] Add event log for time synchronization + +Adding time synchronization event logs can be helpful in distinguishing +older date and newly synced date with the first initialization +(from 1970) or any later syncs either done via NTP or Manually. + +Tested: +Confirmed that the event is getting logged correctly in Redfish. + +Signed-off-by: Joshi-Mansi <mansi.joshi@linux.intel.com> +Change-Id: I8901227990ee7bc41de30af13c775cc45016a626 +--- + src/timedate/timedated.c | 14 ++++++++++++++ + src/timesync/timesyncd-manager.c | 14 ++++++++++++++ + 2 files changed, 28 insertions(+) + +diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c +index 66b454269d..67cc4e0020 100644 +--- a/src/timedate/timedated.c ++++ b/src/timedate/timedated.c +@@ -9,6 +9,7 @@ + #include "sd-bus.h" + #include "sd-event.h" + #include "sd-messages.h" ++#include "sd-journal.h" + + #include "alloc-util.h" + #include "bus-common-errors.h" +@@ -830,6 +831,8 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro + struct timespec ts; + usec_t start; + struct tm tm; ++ char olddate[FORMAT_TIMESTAMP_MAX]; ++ char newdate[FORMAT_TIMESTAMP_MAX]; + + assert(m); + assert(c); +@@ -844,6 +847,9 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro + if (context_ntp_service_is_active(c) > 0) + return sd_bus_error_set(error, BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED, "Automatic time synchronization is enabled"); + ++ usec_t oldtime = now(CLOCK_REALTIME); ++ format_timestamp(olddate, sizeof(olddate), oldtime); ++ + /* this only gets used if dbus does not provide a timestamp */ + start = now(CLOCK_MONOTONIC); + +@@ -911,6 +917,14 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro + "REALTIME="USEC_FMT, timespec_load(&ts), + LOG_MESSAGE("Changed local time to %s", strnull(format_timestamp(buf, sizeof(buf), timespec_load(&ts))))); + ++ /* Log an event when the system time is set manually */ ++ usec_t newtime = now(CLOCK_REALTIME); ++ format_timestamp(newdate, sizeof(newdate), newtime); ++ sd_journal_send("MESSAGE=BMC time updated Manually: New time=%s, Old time=%s", ++ newdate, olddate, "PRIORITY=%i", LOG_INFO, ++ "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.BMCTimeUpdatedManually", ++ "REDFISH_MESSAGE_ARGS=%s,%s", newdate, olddate, NULL); ++ + return sd_bus_reply_method_return(m, NULL); + } + +diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c +index 918da195d8..24940c449b 100644 +--- a/src/timesync/timesyncd-manager.c ++++ b/src/timesync/timesyncd-manager.c +@@ -11,6 +11,7 @@ + #include <sys/types.h> + + #include "sd-daemon.h" ++#include "sd-journal.h" + + #include "alloc-util.h" + #include "dns-domain.h" +@@ -436,6 +437,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re + bool spike; + int leap_sec; + int r; ++ char olddate[FORMAT_TIMESTAMP_MAX]; ++ char newdate[FORMAT_TIMESTAMP_MAX]; + + assert(source); + assert(m); +@@ -526,6 +529,9 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re + return manager_connect(m); + } + ++ usec_t oldtime = now(CLOCK_REALTIME); ++ format_timestamp(olddate, sizeof(olddate), oldtime); ++ + /* valid packet */ + m->pending = false; + m->retry_interval = 0; +@@ -628,6 +634,14 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re + + server_address_pretty(m->current_server_address, &pretty); + /* "Initial", as further successful syncs will not be logged. */ ++ /* Log an event for NTP Synchronization from older date to newly synced date. */ ++ usec_t newtime = now(CLOCK_REALTIME); ++ format_timestamp(newdate, sizeof(newdate), newtime); ++ sd_journal_send("MESSAGE=BMC time updated via NTP: New time=%s, Old time=%s", ++ newdate, olddate, "PRIORITY=%i", LOG_INFO, ++ "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.BMCTimeUpdatedViaNTP", ++ "REDFISH_MESSAGE_ARGS=%s,%s", newdate, olddate, NULL); ++ + log_info("Initial synchronization to time server %s (%s).", strna(pretty), m->current_server_name->string); + sd_notifyf(false, "STATUS=Initial synchronization to time server %s (%s).", strna(pretty), m->current_server_name->string); + } +-- +2.33.0 + diff --git a/meta-ibs/meta-common/recipes-core/systemd/systemd_%.bbappend b/meta-ibs/meta-common/recipes-core/systemd/systemd_%.bbappend new file mode 100644 index 0000000000..2eb5330d88 --- /dev/null +++ b/meta-ibs/meta-common/recipes-core/systemd/systemd_%.bbappend @@ -0,0 +1,11 @@ +# add some configuration overrides for systemd defaults + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://0002-Add-event-log-for-system-time-synchronization.patch \ + " + +# We don't support loadable modules in kernel config +PACKAGECONFIG:remove = "kmod" +# Add systemd-logind service to get shutdown inhibition support +PACKAGECONFIG:append = " logind" diff --git a/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rotate-event-logs.service b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rotate-event-logs.service new file mode 100644 index 0000000000..8f3a2bc317 --- /dev/null +++ b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rotate-event-logs.service @@ -0,0 +1,9 @@ +[Unit] +Description=Rotate the event logs + +[Service] +Type=simple +ExecStart=/usr/bin/rotate-event-logs.sh + +[Install] +WantedBy=multi-user.target diff --git a/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rotate-event-logs.sh b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rotate-event-logs.sh new file mode 100644 index 0000000000..0428db29f1 --- /dev/null +++ b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rotate-event-logs.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +while true; do + sleep 60 + /usr/sbin/logrotate /etc/logrotate.d/*.rsyslog + ec=$? + if [ $ec -ne 0 ] ; then + echo "logrotate failed ($ec)" + fi +done diff --git a/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog-override.conf b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog-override.conf new file mode 100644 index 0000000000..14bcc07815 --- /dev/null +++ b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog-override.conf @@ -0,0 +1,2 @@ +[Service] +ExecReload=/bin/kill -HUP $MAINPID diff --git a/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.conf b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.conf new file mode 100644 index 0000000000..46a287eefb --- /dev/null +++ b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.conf @@ -0,0 +1,79 @@ +# if you experience problems, check +# http://www.rsyslog.com/troubleshoot for assistance + +# rsyslog v3: load input modules +# If you do not load inputs, nothing happens! +# You may need to set the module load path if modules are not found. +# +# Ported from debian's sysklogd.conf + +# Journal-style logging +# Limit to no more than 2000 entries in one minute and enable the +# journal workaround to avoid duplicate entries +module(load="imjournal" StateFile="/var/log/state" + RateLimit.Interval="60" + RateLimit.Burst="2000") + +# Template for IPMI SEL messages +# "<timestamp> <ID>,<Type>,<EventData>,[<Generator ID>,<Path>,<Direction>]" +template(name="IPMISELTemplate" type="list") { + property(name="timereported" dateFormat="rfc3339") + constant(value=" ") + property(name="$!IPMI_SEL_RECORD_ID") + constant(value=",") + property(name="$!IPMI_SEL_RECORD_TYPE") + constant(value=",") + property(name="$!IPMI_SEL_DATA") + constant(value=",") + property(name="$!IPMI_SEL_GENERATOR_ID") + constant(value=",") + property(name="$!IPMI_SEL_SENSOR_PATH") + constant(value=",") + property(name="$!IPMI_SEL_EVENT_DIR") + constant(value="\n") +} + +# Template for Redfish messages +# "<timestamp> <MessageId>,<MessageArgs>" +template(name="RedfishTemplate" type="list") { + property(name="timereported" dateFormat="rfc3339") + constant(value=" ") + property(name="$!REDFISH_MESSAGE_ID") + constant(value=",") + property(name="$!REDFISH_MESSAGE_ARGS") + constant(value="\n") +} + +# Template for Application Crashes +# "<timestamp> <MessageId>,<MessageArgs>" +template(name="CrashTemplate" type="list") { + property(name="timereported" dateFormat="rfc3339") + constant(value=" ") + constant(value="OpenBMC.0.1.ServiceFailure") + constant(value=",") + property(name="$!UNIT") + constant(value="\n") +} + + +# If the journal entry has the IPMI SEL MESSAGE_ID, save as IPMI SEL +# The MESSAGE_ID string is generated using journalctl and must match the +# MESSAGE_ID used in IPMI to correctly find the SEL entries. +if ($!MESSAGE_ID == "b370836ccf2f4850ac5bee185b77893a") then { + action(type="omfile" file="/var/log/ipmi_sel" template="IPMISELTemplate") +} + +# If the journal entry has a Redfish MessageId, save as a Redfish event +if ($!REDFISH_MESSAGE_ID != "") then { + action(type="omfile" file="/var/log/redfish" template="RedfishTemplate") +} + +# If the journal entry has a Exit Code, save as a Redfish event +if ($!EXIT_STATUS != "" and $!EXIT_STATUS != "0") then { + action(type="omfile" file="/var/log/redfish" template="CrashTemplate") +} + +# +# Include all config files in /etc/rsyslog.d/ +# +$IncludeConfig /etc/rsyslog.d/*.conf diff --git a/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate new file mode 100644 index 0000000000..a6ba28d864 --- /dev/null +++ b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate @@ -0,0 +1,22 @@ +# /etc/logrotate.d/rsyslog - Ported from Debian + +# Keep up to four 64k files for ipmi_sel (256k total) +/var/log/ipmi_sel +{ + rotate 3 + size 64k + missingok + postrotate + systemctl reload rsyslog 2> /dev/null || true + endscript +} +# Keep up to four 64k files for redfish (256k total) +/var/log/redfish +{ + rotate 3 + size 64k + missingok + postrotate + systemctl reload rsyslog 2> /dev/null || true + endscript +} diff --git a/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend new file mode 100644 index 0000000000..20cbaf8cd7 --- /dev/null +++ b/meta-ibs/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend @@ -0,0 +1,24 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://rsyslog.conf \ + file://rsyslog.logrotate \ + file://rotate-event-logs.service \ + file://rotate-event-logs.sh \ + file://rsyslog-override.conf \ +" + +FILES:${PN} += "${systemd_system_unitdir}/rsyslog.service.d/rsyslog-override.conf" + +PACKAGECONFIG:append = " imjournal" + +do_install:append() { + install -m 0644 ${WORKDIR}/rotate-event-logs.service ${D}${systemd_system_unitdir} + install -d ${D}${systemd_system_unitdir}/rsyslog.service.d + install -m 0644 ${WORKDIR}/rsyslog-override.conf \ + ${D}${systemd_system_unitdir}/rsyslog.service.d/rsyslog-override.conf + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/rotate-event-logs.sh ${D}/${bindir}/rotate-event-logs.sh + rm ${D}${sysconfdir}/rsyslog.d/imjournal.conf +} + +SYSTEMD_SERVICE:${PN} += " rotate-event-logs.service" diff --git a/meta-ibs/meta-common/recipes-ibs/images/obmc-phosphor-image.bbappend b/meta-ibs/meta-common/recipes-ibs/images/obmc-phosphor-image.bbappend new file mode 100644 index 0000000000..886b0205da --- /dev/null +++ b/meta-ibs/meta-common/recipes-ibs/images/obmc-phosphor-image.bbappend @@ -0,0 +1,28 @@ + +IMAGE_INSTALL += " openssl-bin \ + virtual-media \ + system-watchdog phosphor-u-boot-mgr \ + bmcweb-init-certs" + +OBMC_IMAGE_EXTRA_INSTALL += " strace" + +fix_shadow_perms() { + chgrp shadow ${IMAGE_ROOTFS}${sysconfdir}/shadow + chmod u=rw,g+r ${IMAGE_ROOTFS}${sysconfdir}/shadow +} + +disable_ttyS3_serial_getty() { + rm -f ${IMAGE_ROOTFS}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@ttyS3.service +} + +bmcweb_certs_directory() { + mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/ssl/certs/https + chmod 700 ${IMAGE_ROOTFS}${sysconfdir}/ssl/certs/https +} + + +ROOTFS_POSTPROCESS_COMMAND += " \ + fix_shadow_perms ; \ + disable_ttyS3_serial_getty ; \ + bmcweb_certs_directory ; \ + " diff --git a/meta-ibs/meta-common/recipes-ibs/ipmi/intel-ipmi-oem_git.bb b/meta-ibs/meta-common/recipes-ibs/ipmi/intel-ipmi-oem_git.bb new file mode 100644 index 0000000000..30f7542311 --- /dev/null +++ b/meta-ibs/meta-common/recipes-ibs/ipmi/intel-ipmi-oem_git.bb @@ -0,0 +1,32 @@ +SUMMARY = "Intel OEM IPMI commands" +DESCRIPTION = "Intel OEM IPMI commands" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=a6a4edad4aed50f39a66d098d74b265b" + +SRC_URI = "git://github.com/openbmc/intel-ipmi-oem;branch=master;protocol=https" +SRCREV = "429b085783f258da89d5c5b2979ba7030aef4d2b" + +S = "${WORKDIR}/git" +PV = "0.1+git${SRCPV}" + +DEPENDS = "boost phosphor-ipmi-host phosphor-logging systemd intel-dbus-interfaces libgpiod" + +inherit pkgconfig cmake obmc-phosphor-ipmiprovider-symlink + +EXTRA_OECMAKE="-DENABLE_TEST=0 -DYOCTO=1" + +LIBRARY_NAMES = "libzinteloemcmds.so" + +HOSTIPMI_PROVIDER_LIBRARY += "${LIBRARY_NAMES}" +NETIPMI_PROVIDER_LIBRARY += "${LIBRARY_NAMES}" + +FILES:${PN}:append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" +FILES:${PN}:append = " ${libdir}/host-ipmid/lib*${SOLIBS}" +FILES:${PN}:append = " ${libdir}/net-ipmid/lib*${SOLIBS}" +FILES:${PN}-dev:append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV}" + +do_install:append(){ + install -d ${D}${includedir}/intel-ipmi-oem + install -m 0644 -D ${S}/include/*.hpp ${D}${includedir}/intel-ipmi-oem +} diff --git a/meta-ibs/meta-common/recipes-ibs/packagegroups/packagegroup-ibs-apps.bb b/meta-ibs/meta-common/recipes-ibs/packagegroups/packagegroup-ibs-apps.bb new file mode 100644 index 0000000000..ddddb8eb4f --- /dev/null +++ b/meta-ibs/meta-common/recipes-ibs/packagegroups/packagegroup-ibs-apps.bb @@ -0,0 +1,66 @@ +SUMMARY = "OpenBMC for IBS - Applications" +PR = "r1" + +inherit packagegroup + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${IBSBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +PROVIDES = "${PACKAGES}" +PACKAGES = " \ + ${PN}-chassis \ + ${PN}-fans \ + ${PN}-flash \ + ${PN}-system \ + ${PN}-interface \ + ${PN}-cli \ + " + +PROVIDES += "virtual/obmc-chassis-mgmt" +PROVIDES += "virtual/obmc-fan-mgmt" +PROVIDES += "virtual/obmc-flash-mgmt" +PROVIDES += "virtual/obmc-system-mgmt" + +RPROVIDES:${PN}-chassis += "virtual-obmc-chassis-mgmt" +RPROVIDES:${PN}-fans += "virtual-obmc-fan-mgmt" +RPROVIDES:${PN}-flash += "virtual-obmc-flash-mgmt" +RPROVIDES:${PN}-system += "virtual-obmc-system-mgmt" + +SUMMARY:${PN}-chassis = "Chassis power control" +RDEPENDS:${PN}-chassis = " \ + x86-power-control \ + obmc-host-failure-reboots \ + " + +SUMMARY:${PN}-fans = "Fan control" +RDEPENDS:${PN}-fans = " \ + phosphor-pid-control \ + " + +SUMMARY:${PN}-flash = "Flash/firmware-related tools" +RDEPENDS:${PN}-flash = " \ + obmc-control-bmc \ + " + +SUMMARY:${PN}-system = "System software" +RDEPENDS:${PN}-system = " \ + dbus-sensors \ + entity-manager \ + intel-ipmi-oem \ + phosphor-hostlogger \ + ${PN}-interface \ + ${PN}-cli \ + " + +SUMMARY:${PN}-interface = "Interfaces" +RDEPENDS:${PN}-interface = " \ + bmcweb \ + webui-vue \ + phosphor-ipmi-ipmb \ + " + +SUMMARY:${PN}-cli = "CLI utils" +RDEPENDS:${PN}-cli = " \ + ipmitool \ + phosphor-gpio-monitor \ + " diff --git a/meta-ibs/meta-common/recipes-ibs/pfr/pfr-manager_git.bb b/meta-ibs/meta-common/recipes-ibs/pfr/pfr-manager_git.bb new file mode 100644 index 0000000000..d715b53a9f --- /dev/null +++ b/meta-ibs/meta-common/recipes-ibs/pfr/pfr-manager_git.bb @@ -0,0 +1,23 @@ +SUMMARY = "PFR Manager Service" +DESCRIPTION = "Daemon to handle all PFR functionalities" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=7becf906c8f8d03c237bad13bc3dac53" +inherit cmake systemd + +SRC_URI = "git://github.com/openbmc/pfr-manager;branch=master;protocol=https" + +PV = "0.1+git${SRCPV}" +SRCREV = "c96f37dc87d72331ade8ec263a6a182960a03ffb" + +S = "${WORKDIR}/git" + +SYSTEMD_SERVICE:${PN} = "xyz.openbmc_project.PFR.Manager.service" + +DEPENDS += " \ + sdbusplus \ + phosphor-logging \ + boost \ + i2c-tools \ + libgpiod \ + " diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/ibs-dbus-interfaces-mapper-config-native.bb b/meta-ibs/meta-common/recipes-phosphor/dbus/ibs-dbus-interfaces-mapper-config-native.bb new file mode 100644 index 0000000000..17ebc9dce1 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/ibs-dbus-interfaces-mapper-config-native.bb @@ -0,0 +1,11 @@ +SUMMARY="Add /com/ibs namespace to phosphor-mapper" +DESCRIPTION="Add the /com/ibs path namespace and \ +com.intel interface prefix to the mapper watch list." +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit phosphor-mapper +inherit native + +PHOSPHOR_MAPPER_SERVICE:append = " com.ibs" +PHOSPHOR_MAPPER_INTERFACE:append = " com.ibs" diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/intel-dbus-interfaces_git.bb b/meta-ibs/meta-common/recipes-phosphor/dbus/intel-dbus-interfaces_git.bb new file mode 100644 index 0000000000..ed5447d5bf --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/intel-dbus-interfaces_git.bb @@ -0,0 +1,31 @@ +SUMMARY = "Intel DBus Interfaces" +DESCRIPTION = "Generated bindings, using sdbus++, for the Intel YAML" +PR = "r1" +PV = "1.0+git${SRCPV}" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig +inherit python3native +inherit phosphor-dbus-yaml + +DEPENDS += "autoconf-archive-native" +DEPENDS += "${PYTHON_PN}-sdbus++-native" + +SRC_URI = "git://github.com/openbmc/intel-dbus-interfaces;branch=master;protocol=https" +SRCREV = "2b1255c47fdaaee6fd2db8f38f32abc13a7edf05" + +PACKAGECONFIG ??= "libintel_dbus" +PACKAGECONFIG[libintel_dbus] = " \ + --enable-libintel_dbus, \ + --disable-libintel_dbus, \ + systemd sdbusplus, \ + libsystemd \ + " + +PACKAGECONFIG:remove:class-native = "libintel_dbus" +PACKAGECONFIG:remove:class-nativesdk = "libintel_dbus" + +BBCLASSEXTEND += "native nativesdk" diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0007-ipmi-set-BIOS-id.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0007-ipmi-set-BIOS-id.patch new file mode 100644 index 0000000000..73347a763e --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0007-ipmi-set-BIOS-id.patch @@ -0,0 +1,32 @@ +From a6a94a79f8b94faf2bfcee0d32c406fc3dd78887 Mon Sep 17 00:00:00 2001 +From: "Jia, Chunhui" <chunhui.jia@intel.com> +Date: Tue, 24 Jul 2018 11:40:49 +0800 +Subject: [PATCH] set BIOS id + +change#2 +add new dbus interface for BIOS attributes + +Signed-off-by: Jia, Chunhui <chunhui.jia@intel.com> +--- + .../openbmc_project/Inventory/Item/Bios.interface.yaml | 9 +++++++++ + 1 file changed, 9 insertions(+) + create mode 100644 yaml/xyz/openbmc_project/Inventory/Item/Bios.interface.yaml + +diff --git a/yaml/xyz/openbmc_project/Inventory/Item/Bios.interface.yaml b/yaml/xyz/openbmc_project/Inventory/Item/Bios.interface.yaml +new file mode 100644 +index 00000000..d7a6b95b +--- /dev/null ++++ b/yaml/xyz/openbmc_project/Inventory/Item/Bios.interface.yaml +@@ -0,0 +1,9 @@ ++description: > ++ Implement to provide BIOS attributes. ++properties: ++ - name: BiosId ++ type: string ++ description: > ++ BIOS ID (version) string ++ ++# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0010-Increase-the-default-watchdog-timeout-value.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0010-Increase-the-default-watchdog-timeout-value.patch new file mode 100644 index 0000000000..39e01a7786 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0010-Increase-the-default-watchdog-timeout-value.patch @@ -0,0 +1,34 @@ +From 9e5a1b2c28fcf31b395c11d899dd2e46e97a3cbe Mon Sep 17 00:00:00 2001 +From: Yong Li <yong.b.li@linux.intel.com> +Date: Fri, 10 Aug 2018 16:23:13 +0800 +Subject: [PATCH] Increase the default watchdog timeout value + +The default timeout for poweron is 30 seconds, +but currently the host power on needs 120+ seconds +due to unimplemented ipmi commands for BIOS. + +Increase the value as a workaround, +to avoid the watchdog timeout during power on. +Will adjust this value in the future + +Signed-off-by: Yong Li <yong.b.li@linux.intel.com> +--- + yaml/xyz/openbmc_project/State/Watchdog.interface.yaml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml b/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml +index ac71e614..556dca10 100644 +--- a/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml ++++ b/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml +@@ -37,7 +37,7 @@ properties: + type: uint64 + description: > + Time interval to arm the watchdog, in milli-second. +- default: 30000 ++ default: 600000 + - name: TimeRemaining + type: uint64 + description: > +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0012-Add-RestoreDelay-interface-for-power-restore-delay.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0012-Add-RestoreDelay-interface-for-power-restore-delay.patch new file mode 100644 index 0000000000..266965ca07 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0012-Add-RestoreDelay-interface-for-power-restore-delay.patch @@ -0,0 +1,34 @@ +From beee21d8fe99d72b9a1b3391f818a16d110b1b86 Mon Sep 17 00:00:00 2001 +From: Kuiying Wang <kuiying.wang@intel.com> +Date: Fri, 24 Aug 2018 17:55:35 +0800 +Subject: [PATCH] Add RestoreDelay interface for power restore delay + +Which provide one property "PowerRestoreDelay" + +Change-Id: I4e6d3e45948b1e288301b4aa52cc08cace4f1bc2 +Signed-off-by: Kuiying Wang <kuiying.wang@intel.com> +--- + .../Control/Power/RestoreDelay.interface.yaml | 11 +++++++++++ + 1 file changed, 11 insertions(+) + create mode 100644 yaml/xyz/openbmc_project/Control/Power/RestoreDelay.interface.yaml + +diff --git a/yaml/xyz/openbmc_project/Control/Power/RestoreDelay.interface.yaml b/yaml/xyz/openbmc_project/Control/Power/RestoreDelay.interface.yaml +new file mode 100644 +index 00000000..55ee80a7 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/Control/Power/RestoreDelay.interface.yaml +@@ -0,0 +1,11 @@ ++description: > ++ Implement to specify power transition behavior on a BMC reset. ++ The implementation based on restore policy and set a delay time ++ for power restore. ++ ++properties: ++ - name: PowerRestoreDelay ++ type: uint16 ++ description: > ++ The delay time for power restore. ++ Power Restore Delay is NOT applied on power policy is "Always Off" +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0013-Add-ErrConfig.yaml-interface-for-processor-error-config.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0013-Add-ErrConfig.yaml-interface-for-processor-error-config.patch new file mode 100644 index 0000000000..41c3fcd8b4 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0013-Add-ErrConfig.yaml-interface-for-processor-error-config.patch @@ -0,0 +1,86 @@ +From 6c57cb9553a153d5fe827de80d359397c60194ed Mon Sep 17 00:00:00 2001 +From: Kuiying Wang <kuiying.wang@intel.com> +Date: Thu, 30 Aug 2018 16:22:43 +0800 +Subject: [PATCH] Add ErrConfig.yaml interface for processor error + configuration. + +Which provide 3 properties: + ResetCfg + type: byte + description: > + Reset Configuration + [0]: CATERR Reset Enabled + 0b: Disabled + 1b: Enabled + [1]: ERR2 Reset Enabled + 0b: Disabled + 1b: Enabled + [7:2]: Reserved + ResetErrorOccurrenceCounts + type: byte + description: > + Reset Error Occurrence Counts + [0]: Reset CPU Error Counts + 0b: Keep CPU Error Counts + 1b: Reset all CPU Error Counts to zero + [7:1]: Reserved + CATERRStatus + type: array[byte] + description: > + For all CPUs including the non-legacy socket CPU + CPU CATERR (Core Error) occurrence + [5:0]: Error Occurrence Count + [7:6]: CPU Status + 00b: Disabled + 01b: Enabled + 11b: Not Present + +Change-Id: Ibc5a7a5e15c998e56c04e23b1043d99243a91171 +Signed-off-by: Kuiying Wang <kuiying.wang@intel.com> +--- + .../Processor/ErrConfig.interface.yaml | 33 +++++++++++++++++++ + 1 file changed, 33 insertions(+) + create mode 100644 yaml/xyz/openbmc_project/Control/Processor/ErrConfig.interface.yaml + +diff --git a/yaml/xyz/openbmc_project/Control/Processor/ErrConfig.interface.yaml b/yaml/xyz/openbmc_project/Control/Processor/ErrConfig.interface.yaml +new file mode 100644 +index 00000000..23042633 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/Control/Processor/ErrConfig.interface.yaml +@@ -0,0 +1,33 @@ ++description: > ++ This defines processor error configuration. ++properties: ++ - name: ResetCfg ++ type: byte ++ description: > ++ Reset Configuration ++ [0]: CATERR Reset Enabled ++ 0b: Disabled ++ 1b: Enabled ++ [1]: ERR2 Reset Enabled ++ 0b: Disabled ++ 1b: Enabled ++ [7:2]: Reserved ++ ++ - name: ResetErrorOccurrenceCounts ++ type: byte ++ description: > ++ Reset Error Occurrence Counts ++ [0]: Reset CPU Error Counts ++ 0b: Keep CPU Error Counts ++ 1b: Reset all CPU Error Counts to zero ++ [7:1]: Reserved ++ - name: CATERRStatus ++ type: array[byte] ++ description: > ++ For all CPUs including the non-legacy socket CPU ++ CPU CATERR (Core Error) occurrence ++ [5:0]: Error Occurrence Count ++ [7:6]: CPU Status ++ 00b: Disabled ++ 01b: Enabled ++ 11b: Not Present +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0024-Add-the-pre-timeout-interrupt-defined-in-IPMI-spec.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0024-Add-the-pre-timeout-interrupt-defined-in-IPMI-spec.patch new file mode 100644 index 0000000000..4aa6f8448e --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0024-Add-the-pre-timeout-interrupt-defined-in-IPMI-spec.patch @@ -0,0 +1,57 @@ +From d6fff68710c965741d92fd02fe473a773fcf28cd Mon Sep 17 00:00:00 2001 +From: Ren Yu <yux.ren@intel.com> +Date: Fri, 24 May 2019 14:55:10 +0800 +Subject: [PATCH] Add the pre-timeout interrupt defined in IPMI spec + +The IPMI watchdog pre-timeout interrupt is used to set the different +pre-timeout interrupt source. Add them as a dbus property, +IPMI set/get watchdog commands will use it. + +Signed-off-by: Ren Yu <yux.ren@intel.com> +--- + .../State/Watchdog.interface.yaml | 22 +++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml b/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml +index 556dca10..5252c4ef 100644 +--- a/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml ++++ b/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml +@@ -33,6 +33,11 @@ properties: + description: > + The action the watchdog should perform when it expires. + default: "HardReset" ++ - name: PreTimeoutInterrupt ++ type: enum[self.PreTimeoutInterruptAction] ++ description: > ++ The BMC generates the selected interrupt before the timer expires. ++ default: 'None' + - name: Interval + type: uint64 + description: > +@@ -73,6 +78,23 @@ enumerations: + description: > + Perform a power cycle of the system. + ++ - name: PreTimeoutInterruptAction ++ description: > ++ The type of PreTimeout Interrupt. ++ values: ++ - name: 'None' ++ description: > ++ Do nothing. ++ - name: 'SMI' ++ description: > ++ SMI. ++ - name: 'NMI' ++ description: > ++ NMI / Diagnostic Interrupt. ++ - name: 'MI' ++ description: > ++ Messaging Interrupt. ++ + - name: TimerUse + description: > + The type of timer use. +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch new file mode 100644 index 0000000000..1d62a0d338 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch @@ -0,0 +1,39 @@ +From 410654c9e72f979cb3fedd495408ca389658b69b Mon Sep 17 00:00:00 2001 +From: Ren Yu <yux.ren@intel.com> +Date: Mon, 29 Jul 2019 10:51:12 +0800 +Subject: [PATCH] Add PreInterruptFlag properity in DBUS. + +PreTimeoutInterruptOccurFlag in DBUS would be set 'true' +when watchdog pre-timeout interrupt occurred. + +Tested: +Enable command(raw 0x06 0x31) that get message flag +can set right bit about watchdog, +need record PreTimeoutInterruptOccurFlag +at xyz.openbmmc_project.State.Watchdog when watchdog +pre-timeout interrupt occurred. + +Signed-off-by: Ren Yu <yux.ren@intel.com> +--- + yaml/xyz/openbmc_project/State/Watchdog.interface.yaml | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml b/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml +index 5252c4ef..5952eda9 100644 +--- a/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml ++++ b/yaml/xyz/openbmc_project/State/Watchdog.interface.yaml +@@ -59,6 +59,11 @@ properties: + description: > + The timer user at the time of expiration. + default: "Reserved" ++ - name: PreTimeoutInterruptOccurFlag ++ type: boolean ++ description: > ++ PreTimeoutInterruptOccurFlag that preTimeoutInterrupt action occurred. ++ default: false + + enumerations: + - name: Action +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0026-Add-StandbySpare-support-for-software-inventory.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0026-Add-StandbySpare-support-for-software-inventory.patch new file mode 100644 index 0000000000..e87c83992f --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0026-Add-StandbySpare-support-for-software-inventory.patch @@ -0,0 +1,55 @@ +From e981c37d6813b74ec90445d9bb28eb62fc3d1d4d Mon Sep 17 00:00:00 2001 +From: Vikram Bodireddy <vikram.bodireddy@intel.com> +Date: Wed, 15 Jan 2020 10:01:04 +0800 +Subject: [PATCH] Add StandbySpare support for software inventory + +Add support to allow update for active / recovery +regions of specified firmware. This update enables +the backend modules to advertise whether the +software object is active or recovery (StandbySpare) +image. + +Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com> +--- + .../Software/Activation.interface.yaml | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/yaml/xyz/openbmc_project/Software/Activation.interface.yaml b/yaml/xyz/openbmc_project/Software/Activation.interface.yaml +index 7153c415..6cf194bd 100644 +--- a/yaml/xyz/openbmc_project/Software/Activation.interface.yaml ++++ b/yaml/xyz/openbmc_project/Software/Activation.interface.yaml +@@ -28,12 +28,20 @@ enumerations: + - name: Activating + description: > + The Software.Version is in the process of being Activated. ++ - name: ActivatingAsStandbySpare ++ description: > ++ The Software.Version is in the process of being processed ++ as StandbySpare. + - name: Active + description: > + The Software.Version is currently Active. + - name: Failed + description: > + The Software.Version failed during or after Activation. ++ - name: StandbySpare ++ description: > ++ The Software.Version is part of a redundancy set and awaits ++ a failover or external action to activate. + - name: Staged + description: > + The Software.Version is currently in staged flash area. +@@ -52,6 +60,10 @@ enumerations: + - name: Active + description: > + The Software.Version has been requested for Activation. ++ - name: StandbySpare ++ description: > ++ The Software.Version has been requested to be enabled as ++ StandbySpare. + + # TODO: Specify "EAGAIN" type error when requested is unable to be acted on + # due to current system state. Currently, sdbusplus does not support +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0028-MCTP-Daemon-D-Bus-interface-definition.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0028-MCTP-Daemon-D-Bus-interface-definition.patch new file mode 100644 index 0000000000..511707ae44 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0028-MCTP-Daemon-D-Bus-interface-definition.patch @@ -0,0 +1,402 @@ +From 54d901a02737c62f9695c940e96fd37d8db496f4 Mon Sep 17 00:00:00 2001 +From: "Kowalski, Mariusz" <mariusz.kowalski@intel.com> +Date: Thu, 27 Feb 2020 15:48:56 +0100 +Subject: [PATCH] MCTP Daemon D-Bus interface definition. + +This interface definition was created on base of the MCTP design +proposed in this document: +https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/28424/9/designs/mctp.md + +Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com> +Signed-off-by: Mariusz Kowalski <mariusz.kowalski@intel.com> +Signed-off-by: Karol Wachowski <karol.wachowski@intel.com> +Change-Id: Ida66f8ffcf00003655edcb0fb0112202797b8e1a +--- + .../openbmc_project/MCTP/Base.interface.yaml | 227 ++++++++++++++++++ + .../MCTP/Binding/PCIe.interface.yaml | 29 +++ + .../MCTP/Binding/SMBus.interface.yaml | 17 ++ + .../MCTP/BusOwner.interface.yaml | 17 ++ + .../MCTP/Endpoint.interface.yaml | 5 + + .../MCTP/SupportedMessageTypes.interface.yaml | 36 +++ + 6 files changed, 331 insertions(+) + create mode 100644 yaml/xyz/openbmc_project/MCTP/Base.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/MCTP/Binding/PCIe.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/MCTP/Binding/SMBus.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/MCTP/BusOwner.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/MCTP/SupportedMessageTypes.interface.yaml + +diff --git a/yaml/xyz/openbmc_project/MCTP/Base.interface.yaml b/yaml/xyz/openbmc_project/MCTP/Base.interface.yaml +new file mode 100644 +index 00000000..9438551e +--- /dev/null ++++ b/yaml/xyz/openbmc_project/MCTP/Base.interface.yaml +@@ -0,0 +1,227 @@ ++description: > ++ Mandatory interface for each instance of the MCTP Daemon to expose ++ the base MCTP daemon and medium type interfaces. ++ ++methods: ++ - name: SendMctpMessagePayload ++ description: > ++ Sends message over MCTP interface ++ parameters: ++ - name: DestinationEID ++ type: byte ++ description: > ++ Destination Endpoint ID. The logical address used to route MCTP ++ messages to a specific MCTP endpoint. ++ - name: MsgTag ++ type: byte ++ description: > ++ Message tag. Field that, along with the Source Endpoint IDs and the ++ Tag Owner (TO) field, identifies a unique message at the MCTP ++ transport level. ++ - name: TagOwner ++ type: boolean ++ description: > ++ Tag Owner bit identifies whether the message tag was originated by ++ the endpoint that is the source of the message or by the endpoint ++ that is the destination of the message. ++ - name: Payload ++ type: array[byte] ++ description: Payload of message. ++ returns: ++ - name: Status ++ type: byte ++ description: 0 - if success ++ errors: ++ - xyz.openbmc_project.Common.Error.Timeout ++ - xyz.openbmc_project.Common.Error.InvalidArgument ++ - xyz.openbmc_project.Common.Error.InternalFailure ++ ++ - name: SendMctpMessageFileDescriptor ++ description: > ++ Sends message over MCTP interface ++ parameters: ++ - name: DestinationEID ++ type: byte ++ description: > ++ Destination Endpoint ID. The logical address used to route MCTP ++ messages to a specific MCTP endpoint. ++ - name: MsgTag ++ type: byte ++ description: > ++ Message tag. Field that, along with the Source Endpoint IDs and the ++ Tag Owner (TO) field, identifies a unique message at the MCTP ++ transport level. ++ - name: TagOwner ++ type: boolean ++ description: > ++ Tag Owner bit identifies whether the message tag was originated by ++ the endpoint that is the source of the message or by the endpoint ++ that is the destination of the message. ++ - name: FileDescriptor ++ type: unixfd ++ description: File descriptor of message. ++ returns: ++ - name: Status ++ type: byte ++ description: 0 - if success ++ errors: ++ - xyz.openbmc_project.Common.Error.Timeout ++ - xyz.openbmc_project.Common.Error.InvalidArgument ++ - xyz.openbmc_project.Common.Error.InternalFailure ++ ++signals: ++ - name: MessageReceivedSignal ++ description: > ++ Signal indicating upper layers about arrival of a MCTP message. ++ properties: ++ - name: MessageType ++ type: enum[self.MessageTypes] ++ description: > ++ Defines the values for the Message Type field for different message ++ types transported through MCTP. ++ - name: SrcEid ++ type: byte ++ description: > ++ Source Endpoint ID. The logical address used to route MCTP messages ++ to a specific MCTP endpoint. ++ - name: MsgTag ++ type: byte ++ description: > ++ Message tag. Field that, along with the Source Endpoint IDs and the ++ Tag Owner (TO) field, identifies a unique message at the MCTP ++ transport level. ++ - name: TagOwner ++ type: boolean ++ description: > ++ Tag Owner bit identifies whether the message tag was originated by ++ the endpoint that is the source of the message or by the endpoint ++ that is the destination of the message. ++ - name: Payload ++ type: array[byte] ++ description: Payload of message. ++ ++properties: ++ - name: Eid ++ type: byte ++ description: > ++ Endpoint ID. The logical address used to route MCTP messages to a ++ specific MCTP endpoint. ++ ++ - name: BindingID ++ type: enum[self.BindingTypes] ++ ++ - name: BindingMediumID ++ type: enum[self.MctpPhysicalMediumIdentifiers] ++ ++ - name: StaticEid ++ type: boolean ++ description: Support for statically/dynamicly allocated IDs ++ ++ - name: BindingMode ++ type: enum[self.BindingModeTypes] ++ description: Bus Owner / Endpoint / Bridge ++ ++enumerations: ++ - name: BindingTypes ++ description: > ++ All other values than described are reserved. ++ values: ++ - name: MctpOverSmbus ++ - name: MctpOverPcieVdm ++ - name: MctpOverUsb ++ description: Reserved for MCTP over USB ++ - name: MctpOverKcs ++ - name: MctpOverSerial ++ - name: VendorDefined ++ ++ - name: MctpPhysicalMediumIdentifiers ++ description: > ++ Identifies MCTP physical medium identifiers. see DSP0239. ++ values: ++ - name: Smbus ++ descritpion: SMBus 2.0 100 kHz compatible ++ - name: SmbusI2c ++ descritpion: SMBus 2.0 + I2C 100 kHz compatible ++ - name: I2cCompatible ++ description: I2C 100 kHz compatible (Standard-mode) ++ - name: Smbus3OrI2c400khzCompatible ++ description: SMBus 3.0 or I2C 400 kHz compatible (Fast-mode) ++ - name: Smbus3OrI2c1MhzCompatible ++ description: SMBus 3.0 or I2C 1 MHz compatible (Fast-mode Plus) ++ - name: I2c3Mhz4Compatible ++ description: I2C 3.4 MHz compatible (High-speed mode) ++ - name: Pcie11 ++ description: PCIe revision 1.1 compatible ++ - name: Pcie2 ++ description: PCIe revision 2.0 compatible ++ - name: Pcie21 ++ description: PCIe revision 2.1 compatible ++ - name: Pcie3 ++ description: PCIe revision 3.0 compatible ++ - name: Pcie4 ++ description: PCIe revision 4.0 compatible ++ - name: Pcie5 ++ description: PCIe revision 4.0 compatible ++ - name: PciCompatible ++ description: > ++ PCI compatible (PCI 1.0,2.0,2.1,2.2,2.3,3.0,PCI-X 1.0, PCI-X 2.0) ++ - name: Usb11Compatible ++ description: USB 1.1 compatible ++ - name: Usb20Compatible ++ description: USB 2.0 compatible ++ - name: Usb30Compatible ++ description: USB 3.0 compatible ++ - name: NcSiOverRbt ++ description: > ++ NC-SI over RBT (A physical interface based on RMII as defined in ++ DSP0222) ++ - name: KcsLegacy ++ description: KCS1 / Legacy (Fixed Address Decoding) ++ - name: KcsPci ++ description: KCS1 / PCI (Base Class 0xC0 Subclass 0x01) ++ - name: SerialHostLegacy ++ description: Serial Host2 / Legacy (Fixed Address Decoding) ++ - name: SerialHostPci ++ description: Serial Host2 / PCI (Base Class 0x07 Subclass 0x00) ++ - name: AsynchronousSerial ++ description: Asynchronous Serial (Between MCs and IMDs) ++ - name: I3cSDR ++ description: I3C 12.5 MHz compatible (SDR) ++ - name: I3cHDRDDR ++ description: I3C 25 MHz compatible (HDR-DDR) ++ ++ - name: BindingModeTypes ++ values: ++ - name: Endpoint ++ description: > ++ An MCTP communication terminus. An MCTP endpoint is a terminus or ++ origin of MCTP packets or messages. That is, the combined ++ functionality within a physical device that communicates using the ++ MCTP transport protocol and handles MCTP control commands. This ++ includes MCTP-capable management controllers and managed devices. ++ Also referred to in this document as "endpoint". ++ - name: BusOwner ++ description: > ++ The party responsible for managing address assignments (can be ++ logical or physical addresses) on a bus (for example, in MCTP, the ++ bus owner is the party responsible for managing EID assignments for ++ a given bus). A bus owner may also have additional media-specific ++ responsibilities, such as assignment of physical addresses. ++ - name: Bridge ++ description: > ++ An MCTP endpoint that can route MCTP messages not destined for ++ itself that it receives on one interconnect onto another without ++ interpreting them. The ingress and egress media at the bridge may ++ be either homogeneous or heterogeneous. Also referred to in this ++ document as a "bridge". ++ ++ - name: MessageTypes ++ values: ++ - name: MctpControl ++ - name: PLDM ++ - name: NCSI ++ - name: Ethernet ++ - name: NVMeMgmtMsg ++ - name: SPDM ++ - name: VDPCI ++ - name: VDIANA +diff --git a/yaml/xyz/openbmc_project/MCTP/Binding/PCIe.interface.yaml b/yaml/xyz/openbmc_project/MCTP/Binding/PCIe.interface.yaml +new file mode 100644 +index 00000000..1bd28818 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/MCTP/Binding/PCIe.interface.yaml +@@ -0,0 +1,29 @@ ++description: > ++ Interface exposed by MCTP daemon for PCIe binding ++ ++properties: ++ - name: DiscoveredFlag ++ type: enum[self.DiscoveryFlags] ++ description: > ++ Each endpoint (except the bus owner) on the PCIe bus maintains an ++ internal flag called the Discovered flag. The flag is set to the ++ discovered state when the Set Endpoint ID command is received. ++ ++ - name: BDF ++ type: uint16 ++ description: > ++ Byte 1 [7:0] Bus number ++ Byte 2 [7:3] Device number [2:0] Function Number ++ ++enumerations: ++ - name: DiscoveryFlags ++ description: > ++ The Prepare for Endpoint Discovery message causes each recipient ++ endpoint on the PCIe bus to set their respective Discovered flag to ++ the undiscovered state. For the Prepare for Endpoint Discovery request ++ message, the routing in the physical transport header should be set to ++ 011b (Broadcast from Root Complex). ++ values: ++ - name: Discovered ++ - name: Undiscovered ++ - name: NotApplicable +diff --git a/yaml/xyz/openbmc_project/MCTP/Binding/SMBus.interface.yaml b/yaml/xyz/openbmc_project/MCTP/Binding/SMBus.interface.yaml +new file mode 100644 +index 00000000..9219ad02 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/MCTP/Binding/SMBus.interface.yaml +@@ -0,0 +1,17 @@ ++description: > ++ Interface exposed by MCTP daemon for SMBus binding ++ ++properties: ++ - name: ArpMasterSupport ++ type: boolean ++ description: > ++ The SMBus binding can also run ARP Master protocol and ++ assign SMBus addresses to the devices on the bus. ++ ++ - name: BusNumber ++ type: byte ++ description: I2C bus number of the medium used ++ ++ - name: SlaveAddress ++ type: byte ++ description: Slave address to be used for this medium +diff --git a/yaml/xyz/openbmc_project/MCTP/BusOwner.interface.yaml b/yaml/xyz/openbmc_project/MCTP/BusOwner.interface.yaml +new file mode 100644 +index 00000000..d46298ed +--- /dev/null ++++ b/yaml/xyz/openbmc_project/MCTP/BusOwner.interface.yaml +@@ -0,0 +1,17 @@ ++description: > ++ Interface exposed by MCTP root object, when executing in Bus Owner mode. ++ ++properties: ++ - name: EidPool ++ type: array[struct[byte, byte]] ++ description: > ++ Pool of allowed EIDs to be used. ++ EID pool of 10-100 can be specified as {{10,100}}. ++ ++ - name: TopMostBusOwner ++ type: boolean ++ description: To indicate whether BMC is topmost Bus Owner ++ ++ - name: OwnEidPool ++ type: boolean ++ description: Indicates Eid pool is managed by self +diff --git a/yaml/xyz/openbmc_project/MCTP/Endpoint.interface.yaml b/yaml/xyz/openbmc_project/MCTP/Endpoint.interface.yaml +index 8cb0f133..abb3ac93 100644 +--- a/yaml/xyz/openbmc_project/MCTP/Endpoint.interface.yaml ++++ b/yaml/xyz/openbmc_project/MCTP/Endpoint.interface.yaml +@@ -6,6 +6,11 @@ description: > + MCTP-capable management controllers and managed devices. + + properties: ++ - name: Mode ++ type: enum[xyz.openbmc_project.MCTP.Base.BindingModeTypes] ++ description: > ++ Endpoint / BusOwner / Bridge ++ + - name: NetworkId + type: size + description: > +diff --git a/yaml/xyz/openbmc_project/MCTP/SupportedMessageTypes.interface.yaml b/yaml/xyz/openbmc_project/MCTP/SupportedMessageTypes.interface.yaml +new file mode 100644 +index 00000000..fa447ee6 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/MCTP/SupportedMessageTypes.interface.yaml +@@ -0,0 +1,36 @@ ++description: ++ Interface used to represent the supported MCTP message types. ++ This will be exposed by all MCTP endpoints. ++ ++properties: ++ - name: MctpControl ++ type: boolean ++ description: Indicates support availability ++ ++ - name: PLDM ++ type: boolean ++ description: Indicates support availability ++ ++ - name: NCSI ++ type: boolean ++ description: Indicates support availability ++ ++ - name: Ethernet ++ type: boolean ++ description: Indicates support availability ++ ++ - name: NVMeMgmtMsg ++ type: boolean ++ description: Indicates support availability ++ ++ - name: SPDM ++ type: boolean ++ description: Indicates support availability ++ ++ - name: VDPCI ++ type: boolean ++ description: Indicates support availability ++ ++ - name: VDIANA ++ type: boolean ++ description: Indicates support availability +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0029-Add-D-Bus-interfaces-for-PLDM-FW-update.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0029-Add-D-Bus-interfaces-for-PLDM-FW-update.patch new file mode 100644 index 0000000000..eec88dd4a0 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0029-Add-D-Bus-interfaces-for-PLDM-FW-update.patch @@ -0,0 +1,494 @@ +From 35f98cd01cfe9e7bb6101b9dd0891afda62ee55f Mon Sep 17 00:00:00 2001 +From: "Gade-RajasekharReddy@" <Gade-RajasekharReddy@> +Date: Wed, 16 Sep 2020 03:19:41 +0530 +Subject: [PATCH] Add D-Bus interfaces for PLDM FW update + +Added PLDM FW update base interface, which exposes a method. Using +this method PLDM FWU can be initiated. + +Added interfaces for exposing PLDM FW update inventory info. + +Test +supporting files are created for the yaml files. + +Signed-off-by: Gade-RajasekharReddy@ <raja.sekhar.reddy.gade@linux.intel.com> +--- + .../PLDM/FWU/ACPIDescriptor.interface.yaml | 14 +++ + ...ActiveComponentImageSetInfo.interface.yaml | 9 ++ + .../FWU/ActiveComponentInfo.interface.yaml | 55 ++++++++++ + .../CapabilitiesDuringUpdate.interface.yaml | 32 ++++++ + .../ComponentActivationMethods.interface.yaml | 40 +++++++ + .../PLDM/FWU/FWUBase.interface.yaml | 21 ++++ + .../PLDM/FWU/IANADescriptor.interface.yaml | 10 ++ + .../PLDM/FWU/PCIDescriptor.interface.yaml | 30 +++++ + ...endingComponentImageSetInfo.interface.yaml | 10 ++ + .../FWU/PendingComponentInfo.interface.yaml | 40 +++++++ + .../PLDM/FWU/PnPDescriptor.interface.yaml | 14 +++ + yaml/xyz/openbmc_project/PLDM/FWU/README.md | 103 ++++++++++++++++++ + 12 files changed, 378 insertions(+) + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/ACPIDescriptor.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/FWUBase.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/IANADescriptor.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/PCIDescriptor.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentInfo.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/PnPDescriptor.interface.yaml + create mode 100644 yaml/xyz/openbmc_project/PLDM/FWU/README.md + +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/ACPIDescriptor.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/ACPIDescriptor.interface.yaml +new file mode 100644 +index 00000000..e225bade +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/ACPIDescriptor.interface.yaml +@@ -0,0 +1,14 @@ ++description : > ++ This interface has ACPI descriptor properties. ++ ++properties : ++ ++ - name : ACPIVendorID ++ type : string ++ description: > ++ Property containing ACPI Vendor ID. ++ ++ - name : ACPIProductIdentifier ++ type : string ++ description: > ++ Property containing ACPI Product Identifier. +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo.interface.yaml +new file mode 100644 +index 00000000..94115a33 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo.interface.yaml +@@ -0,0 +1,9 @@ ++description : > ++ This interface has the PLDM FWU active component image set properties. ++ ++properties : ++ ++ - name : ActiveComponentImageSetVersionString ++ type : string ++ description: > ++ String describing the active component image set version. +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo.interface.yaml +new file mode 100644 +index 00000000..77a75669 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo.interface.yaml +@@ -0,0 +1,55 @@ ++description: > ++ This interface has the component entries for all of the updatable ++ active components that reside on the FD. ++ ++properties: ++ ++ - name: ComponentClassification ++ type: uint16 ++ description: > ++ Vendor specific component classification information. ++ Special values: 0x0000, 0xFFFF are reserved. ++ ++ - name: ComponentIdentifier ++ type: uint16 ++ description: > ++ FD vendor selected unique value to distinguish between ++ component images. ++ ++ - name: ComponentClassificationIndex ++ type: byte ++ description: > ++ Used to distinguish identical components that have the same ++ classification and identifier that can use the same component ++ image but the images are stored in different locations in the FD. ++ ++ - name: ActiveComponentComparisonStamp ++ type: uint32 ++ description: > ++ Optional Firmware component comparison stamp that is currently ++ active. If the firmware component does not provide a component ++ comparison stamp, this value should be set to 0x00000000. ++ ++ - name: ActiveComponentReleaseDate ++ type: string ++ description: > ++ Containing the date corresponding to the component version ++ level being reported – Format YYYYMMDD. ++ If the firmware component does not provide a date, this string ++ shall be empty. ++ ++ - name: ComponentAutoApply ++ type: boolean ++ description: > ++ Firmware Device performs an ‘auto-apply’ during transfer ++ phase and apply step will be completed immediately if this ++ property is true. ++ Firmware Device will execute an operation during the APPLY ++ state that will include migrating the new component image to its ++ final non-volatile storage destination if this property is ++ false. ++ ++ - name: ActiveComponentVersionString ++ type: string ++ description: > ++ String describing the active component version. +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate.interface.yaml +new file mode 100644 +index 00000000..36560ff0 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate.interface.yaml +@@ -0,0 +1,32 @@ ++description : > ++ This interface describes the capabilities during update. ++ ++properties : ++ ++ - name : UpdateModeRestrictions ++ type : boolean ++ description: > ++ This property tells whether update mode restrictions are ++ supported or not. ++ ++ - name : PartialUpdates ++ type : boolean ++ description: > ++ This property tells whether partial updates are supported or not. ++ ++ - name : HostFunctionalityDuringFirmwareUpdate ++ type : boolean ++ description: > ++ This property tells whether the host device functionality ++ during firmware update is reduced or not. ++ ++ - name : ComponentUpdateFailureRetryCapability ++ type : boolean ++ description: > ++ This property shows the component update failure retry capability. ++ ++ - name : ComponentUpdateFailureRecoveryCapability ++ type : boolean ++ description: > ++ This property shows the component update failure recovery ++ capability. +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods.interface.yaml +new file mode 100644 +index 00000000..d5ec47cb +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods.interface.yaml +@@ -0,0 +1,40 @@ ++description: > ++ This interface has the component activation methods. ++ ++properties: ++ ++ - name: ACPowerCycle ++ type: boolean ++ description: > ++ Property that tells whether AC power cycle is an activation ++ method or not. ++ ++ - name: DCPowerCycle ++ type: boolean ++ description: > ++ Property that tells whether DC power cycle is an activation ++ method or not. ++ ++ - name: SystemReboot ++ type: boolean ++ description: > ++ Property that tells whether System reboot is an activation ++ method or not. ++ ++ - name: MediumSpecificReset ++ type: boolean ++ description: > ++ Property that tells whether Medium-specific reset is an ++ activation method or not. ++ ++ - name: SelfContained ++ type: boolean ++ description: > ++ Property that tells whether Self-Contained option is activation ++ method or not. ++ ++ - name: Automatic ++ type: boolean ++ description: > ++ Property that tells whether the component can be activated ++ automatically once apply completes. +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/FWUBase.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/FWUBase.interface.yaml +new file mode 100644 +index 00000000..2ba15e26 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/FWUBase.interface.yaml +@@ -0,0 +1,21 @@ ++description: > ++ This interface provides a method to initiate the PLDM FW update. ++ ++methods: ++ - name: StartFWUpdate ++ description: > ++ This method initiates the PLDM FW update. ++ parameters: ++ - name: filePath ++ type: string ++ description: > ++ PLDM FW update package path. ++ returns: ++ - name: status ++ type: byte ++ description: > ++ PLDM FW update status. ++ errors: ++ - xyz.openbmc_project.Common.Error.NotAllowed ++ - xyz.openbmc_project.Common.Error.InvalidArgument ++ - xyz.openbmc_project.Common.Error.ResourceNotFound +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/IANADescriptor.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/IANADescriptor.interface.yaml +new file mode 100644 +index 00000000..c013955a +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/IANADescriptor.interface.yaml +@@ -0,0 +1,10 @@ ++description : > ++ This interface has device identification info, in which IANA ++ Enterprise ID is used as descriptor. ++ ++properties : ++ ++ - name : IANAEnterpriseID ++ type : string ++ description: > ++ Property containing the IANA Enterprise ID. +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/PCIDescriptor.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/PCIDescriptor.interface.yaml +new file mode 100644 +index 00000000..8d758ed5 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/PCIDescriptor.interface.yaml +@@ -0,0 +1,30 @@ ++description : > ++ This interface has device identification info,in which PCI Vendor ID ++ is used as descriptor. ++ ++properties : ++ ++ - name : PCIVendorID ++ type : string ++ description: > ++ Property containing the PCI Vendor ID. ++ ++ - name : PCIDeviceID ++ type : string ++ description: > ++ Property containing the PCI Device ID. ++ ++ - name : PCISubsystemVendorID ++ type : string ++ description: > ++ Property containing the PCI Subsystem Vendor ID. ++ ++ - name : PCISubsystemID ++ type : string ++ description: > ++ Property containing the PCI Subsystem ID. ++ ++ - name : PCIRevisionID ++ type : string ++ description: > ++ Property containing the PCI Revision ID. +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo.interface.yaml +new file mode 100644 +index 00000000..3861572d +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo.interface.yaml +@@ -0,0 +1,10 @@ ++description : > ++ This interface has the PLDM FWU pending component image set ++ properties. ++ ++properties : ++ ++ - name : PendingComponentImageSetVersionString ++ type : string ++ description: > ++ String describing the pending component image set version. +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentInfo.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentInfo.interface.yaml +new file mode 100644 +index 00000000..59a2ad8d +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentInfo.interface.yaml +@@ -0,0 +1,40 @@ ++description: > ++ This interface has the component entries for all of the pending ++ components that reside on the FD. ++ ++properties: ++ ++ - name: PendingComponentComparisonStamp ++ type: uint32 ++ description: > ++ Optional firmware component comparison stamp that is pending ++ activation. This field, and all other pending component fields, ++ are valid once the firmware device has received the ++ ActivateFirmware command to prepare the firmware component for ++ activation, but the activation method requires further action ++ to enable the pending image to become the actively running code ++ image. ++ If no pending firmware component exists, this value shall be ++ set to 0x00000000 ++ ++ - name: PendingComponentReleaseDate ++ type: string ++ description: > ++ Eight byte field containing the date corresponding to the ++ component version level being reported – Format YYYYMMDD. ++ If no pending firmware component exists, this string ++ shall be empty. ++ ++ ++ - name: PendingComponentVersionString ++ type: string ++ description: > ++ Firmware component version, which is pending activation. The ++ version reported here should be the one that will become active ++ on the next initialization or activation of the component. The ++ pending component version value may be same as the active ++ component version. Contains a variable type string describing ++ the pending component version. Refer to ++ PendingComponentComparisonStamp field for additional details. ++ If no pending firmware component exists, this field is zero ++ bytes in length. +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/PnPDescriptor.interface.yaml b/yaml/xyz/openbmc_project/PLDM/FWU/PnPDescriptor.interface.yaml +new file mode 100644 +index 00000000..801db6d6 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/PnPDescriptor.interface.yaml +@@ -0,0 +1,14 @@ ++description : > ++ This interface has PnP descriptor properties. ++ ++properties : ++ ++ - name : PnPVendorID ++ type : string ++ description: > ++ Property containing the PnP Vendor ID. ++ ++ - name : PnPProductIdentifier ++ type : string ++ description: > ++ Property containing the PnP Product Identifier. +diff --git a/yaml/xyz/openbmc_project/PLDM/FWU/README.md b/yaml/xyz/openbmc_project/PLDM/FWU/README.md +new file mode 100644 +index 00000000..29317393 +--- /dev/null ++++ b/yaml/xyz/openbmc_project/PLDM/FWU/README.md +@@ -0,0 +1,103 @@ ++#PLDM FW Update ++ ++##Overview ++ ++The PLDM FW update package contains two major sections: the FW package ++header, and the FW package payload. The FW package header is required to ++describe the target device that the package is intended to update and ++the component images that the FW update package contains. The FW ++package payload is the actual FW image which can be used by FW device ++for FW update. ++ ++Update Agent(BMC) will send the inventory commands to the all the ++devices which are capable of PLDM FW update and exposes the inventory ++info to the D-Bus. How PLDM FW update package reaches BMC is out of ++scope of PLDM FWU spec 1.0.1. Once BMC receives the FW package, it ++matches the package header with the inventory info, if matches proceeds ++for FW update. ++ ++###PLDM FW update interfaces overview and hierarchy ++ ++/xyz/openbmc_project/pldm/fwu ++|--xyz.openbmc_project.PLDM.FWU.FWUBase ++| ++|__/xyz/openbmc_project/pldm/fwu/<tid> ++ | ++ |__/xyz/openbmc_project/pldm/fwu/<tid>/deviceDescriptors ++ | |--xyz.openbmc_project.PLDM.FWU.PCIDescriptor ++ | |--xyz.openbmc_project.PLDM.FWU.IANADescriptor ++ | |--xyz.openbmc_project.PLDM.FWU.PnPDescriptor ++ | |--xyz.openbmc_project.PLDM.FWU.ACPIDescriptor ++ | ++ |__/xyz/openbmc_project/pldm/fwu/<tid>/componentImageSetInfo ++ | |--xyz.openbmc_project.PLDM.FWU.ActiveComponentImageSetInfo ++ | |--xyz.openbmc_project.PLDM.FWU.PendingComponentImageSetInfo ++ | ++ |__/xyz/openbmc_project/pldm/fwu/<tid>/componentImageSetInfo/component_<component_no> ++ |--xyz.openbmc_project.PLDM.FWU.ActiveComponentInfo ++ |--xyz.openbmc_project.PLDM.FWU.PendingComponentInfo ++ |--xyz.openbmc_project.PLDM.FWU.ComponentActivationMethods ++ |--xyz.openbmc_project.PLDM.FWU.CapabilitiesDuringUpdate ++ ++Note: ++Descriptor for a device shall be defined by one of the following ++(PCI Vendor ID, IANA Enterprise ID, UUID, PnP Vendor ID, or ACPI Vendor ++ID) and the corresponding descriptor`s interface is exposed by the. ++Device Descriptors object. ++No new UUID descriptor incterface is defined as the existing UUID ++interface will be used. ++ ++####FW Update Base ++It is exposed by the object `/xyz/openbmc_project/pldm/fwu` with the ++following interface ++1. `xyz.openbmc_project.pldm.FWUBase` exposes a method by which PLDM ++FWU can be initiated. ++ ++Each FW update capable device info is exposed by the object ++`/xyz/openbmc_project/pldm/fwu/<tid>`. ++It will have the following objects. ++1. Device Descriptors ++2. Component Image Set Info ++3. Component Image Info (Each component is exposed as an object) ++ ++####Device Descriptors ++Device Descriptors are exposed under the object path ++`/xyz/openbmc_project/pldm/fwu/deviceDescriptors` with one of the ++following interfaces. ++1. `xyz.openbmc_project.PLDM.FWU.PCIDescriptor` which exposes the PCI ++device descriptors. If the FD is a PCI device then this interface will ++be exposed by the device descriptors object. ++2. `xyz.openbmc_project.PLDM.FWU.IANADescriptor` which exposes IANA ++descriptor properties. If FD have IANA Enterprise ID as the descriptor ++type then this interface will be exposed by the device descriptors ++object. ++3. `xyz.openbmc_project.PLDM.FWU.PnPDescriptor` which exposes the Pnp ++descriptor properties. If FD have PnP vendor ID as the descriptor ++type then this interface will be exposed by the device descriptors ++object. ++4. `xyz.openbmc_project.PLDM.FWU.ACPIDescriptor` which exposes the ACPI ++descriptor properties. If FD have ACPI vendor ID as the descriptor ++type then this interface will be exposed by the device descriptors ++object. ++ ++####Component Image Set Info ++Component Image Set Info is exposed under the object path ++`/xyz/openbmc_project/pldm/fwu/componentImageSetInfo` with the ++following interface. ++1. `xyz.openbmc_project.PLDM.FWU.ActiveComponentImageSetInfo` which ++exposes the active component image set properties. ++2. `xyz.openbmc_project.PLDM.FWU.PendingComponentImageSetInfo` which ++exposes the pending component image set properties. ++ ++####Component Image Info ++Component Image Info is exposed under the object path ++`/xyz/openbmc_project/pldm/fwu/componentImageSetInfo/componentInfo_<component_no>' ++with the following interface ++1. `xyz.openbmc_project.PLDM.FWU.ActiveComponentInfo` which exposes the ++component Image properties. ++2. `xyz.openbmc_project.PLDM.FWU.PendingComponentInfo` which exposes the ++component Image properties. ++3. `xyz.openbmc_project.PLDM.FWU.CapabilitiesDuringUpdate` which exposes ++the capabilities of the component during update. ++4. `xyz.openbmc_project.PLDM.FWU.ComponentActivationMethods` which ++exposes the component activation methods. +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0030-Add-PLDM-version-purpose-enumeration.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0030-Add-PLDM-version-purpose-enumeration.patch new file mode 100644 index 0000000000..53e0fa4342 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0030-Add-PLDM-version-purpose-enumeration.patch @@ -0,0 +1,28 @@ +From f67821226e38f3289a103840975fdb232479099f Mon Sep 17 00:00:00 2001 +From: Ayushi Smriti <smriti.ayushi@intel.com> +Date: Wed, 23 Sep 2020 22:01:25 +0530 +Subject: [PATCH] Add PLDM version purpose enumeration + +This change is to add PLDM in enumeration of possible purposes +of the version to support pldm type version purpose + +Change-Id: I7b914d4323bfe44a4e3cd60ed4a627aeceb6b56f +Signed-off-by: Ayushi Smriti <smriti.ayushi@intel.com> +--- + yaml/xyz/openbmc_project/Software/Version.interface.yaml | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/yaml/xyz/openbmc_project/Software/Version.interface.yaml b/yaml/xyz/openbmc_project/Software/Version.interface.yaml +index 61760102..722c6e31 100644 +--- a/yaml/xyz/openbmc_project/Software/Version.interface.yaml ++++ b/yaml/xyz/openbmc_project/Software/Version.interface.yaml +@@ -41,3 +41,6 @@ enumerations: + - name: PSU + description: > + The version is a version for a PSU. ++ - name: PLDM ++ description: > ++ The version is a version for PLDM. +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0031-update-meson-build-files-for-control-and-bios.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0031-update-meson-build-files-for-control-and-bios.patch new file mode 100644 index 0000000000..87cc4eefa4 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0031-update-meson-build-files-for-control-and-bios.patch @@ -0,0 +1,149 @@ +From fd18d5d4cd98ba225ae8300ab1531a3462a9e8c5 Mon Sep 17 00:00:00 2001 +From: Zhikui Ren <zhikui.ren@intel.com> +Date: Tue, 8 Dec 2020 15:08:21 -0800 +Subject: [PATCH] update meson build files for control and bios + +Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> +--- + .../Control/Power/RestoreDelay/meson.build | 13 +++++++++++++ + gen/xyz/openbmc_project/Control/Power/meson.build | 14 ++++++++++++++ + .../Control/Processor/ErrConfig/meson.build | 13 +++++++++++++ + .../openbmc_project/Control/Processor/meson.build | 13 +++++++++++++ + .../Inventory/Item/Bios/meson.build | 13 +++++++++++++ + gen/xyz/openbmc_project/Inventory/Item/meson.build | 14 ++++++++++++++ + 6 files changed, 80 insertions(+) + create mode 100644 gen/xyz/openbmc_project/Control/Power/RestoreDelay/meson.build + create mode 100644 gen/xyz/openbmc_project/Control/Processor/ErrConfig/meson.build + create mode 100644 gen/xyz/openbmc_project/Inventory/Item/Bios/meson.build + +diff --git a/gen/xyz/openbmc_project/Control/Power/RestoreDelay/meson.build b/gen/xyz/openbmc_project/Control/Power/RestoreDelay/meson.build +new file mode 100644 +index 00000000..312adfd8 +--- /dev/null ++++ b/gen/xyz/openbmc_project/Control/Power/RestoreDelay/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/Control/Power/RestoreDelay__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/Control/Power/RestoreDelay.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/Control/Power/RestoreDelay', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/Control/Power/meson.build b/gen/xyz/openbmc_project/Control/Power/meson.build +index d7024e3e..6417aba5 100644 +--- a/gen/xyz/openbmc_project/Control/Power/meson.build ++++ b/gen/xyz/openbmc_project/Control/Power/meson.build +@@ -55,6 +55,20 @@ generated_others += custom_target( + ], + ) + ++subdir('RestoreDelay') ++generated_others += custom_target( ++ 'xyz/openbmc_project/Control/Power/RestoreDelay__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/Control/Power/RestoreDelay.interface.yaml', ], ++ output: [ 'RestoreDelay.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/Control/Power/RestoreDelay', ++ ], ++) ++ + subdir('RestorePolicy') + generated_others += custom_target( + 'xyz/openbmc_project/Control/Power/RestorePolicy__markdown'.underscorify(), +diff --git a/gen/xyz/openbmc_project/Control/Processor/ErrConfig/meson.build b/gen/xyz/openbmc_project/Control/Processor/ErrConfig/meson.build +new file mode 100644 +index 00000000..25ae30c4 +--- /dev/null ++++ b/gen/xyz/openbmc_project/Control/Processor/ErrConfig/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/Control/Processor/ErrConfig__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/Control/Processor/ErrConfig.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/Control/Processor/ErrConfig', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/Control/Processor/meson.build b/gen/xyz/openbmc_project/Control/Processor/meson.build +index fc32bf2f..cc2a1d65 100644 +--- a/gen/xyz/openbmc_project/Control/Processor/meson.build ++++ b/gen/xyz/openbmc_project/Control/Processor/meson.build +@@ -13,3 +13,16 @@ generated_others += custom_target( + ], + ) + ++subdir('ErrConfig') ++generated_others += custom_target( ++ 'xyz/openbmc_project/Control/Processor/ErrConfig__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/Control/Processor/ErrConfig.interface.yaml', ], ++ output: [ 'ErrConfig.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/Control/Processor/ErrConfig', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/Inventory/Item/Bios/meson.build b/gen/xyz/openbmc_project/Inventory/Item/Bios/meson.build +new file mode 100644 +index 00000000..d4d8fc31 +--- /dev/null ++++ b/gen/xyz/openbmc_project/Inventory/Item/Bios/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/Inventory/Item/Bios__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/Inventory/Item/Bios.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/Inventory/Item/Bios', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/Inventory/Item/meson.build b/gen/xyz/openbmc_project/Inventory/Item/meson.build +index c3bb46d9..e5f7cf93 100644 +--- a/gen/xyz/openbmc_project/Inventory/Item/meson.build ++++ b/gen/xyz/openbmc_project/Inventory/Item/meson.build +@@ -40,6 +40,20 @@ generated_others += custom_target( + ], + ) + ++subdir('Bios') ++generated_others += custom_target( ++ 'xyz/openbmc_project/Inventory/Item/Bios__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/Inventory/Item/Bios.interface.yaml', ], ++ output: [ 'Bios.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/Inventory/Item/Bios', ++ ], ++) ++ + subdir('Bmc') + generated_others += custom_target( + 'xyz/openbmc_project/Inventory/Item/Bmc__markdown'.underscorify(), +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0032-update-meson-build-for-MCTP-interfaces.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0032-update-meson-build-for-MCTP-interfaces.patch new file mode 100644 index 0000000000..3af5561332 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0032-update-meson-build-for-MCTP-interfaces.patch @@ -0,0 +1,209 @@ +From e4d177845b4320408e8ccbcee79219c88d936975 Mon Sep 17 00:00:00 2001 +From: Zhikui Ren <zhikui.ren@intel.com> +Date: Tue, 8 Dec 2020 15:16:25 -0800 +Subject: [PATCH] update meson build for MCTP interfaces + +Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> +--- + gen/xyz/openbmc_project/MCTP/Base/meson.build | 13 ++++++ + .../MCTP/Binding/PCIe/meson.build | 13 ++++++ + .../MCTP/Binding/SMBus/meson.build | 13 ++++++ + .../openbmc_project/MCTP/Binding/meson.build | 28 +++++++++++++ + .../openbmc_project/MCTP/BusOwner/meson.build | 13 ++++++ + .../MCTP/SupportedMessageTypes/meson.build | 13 ++++++ + gen/xyz/openbmc_project/MCTP/meson.build | 42 +++++++++++++++++++ + 7 files changed, 135 insertions(+) + create mode 100644 gen/xyz/openbmc_project/MCTP/Base/meson.build + create mode 100644 gen/xyz/openbmc_project/MCTP/Binding/PCIe/meson.build + create mode 100644 gen/xyz/openbmc_project/MCTP/Binding/SMBus/meson.build + create mode 100644 gen/xyz/openbmc_project/MCTP/Binding/meson.build + create mode 100644 gen/xyz/openbmc_project/MCTP/BusOwner/meson.build + create mode 100644 gen/xyz/openbmc_project/MCTP/SupportedMessageTypes/meson.build + +diff --git a/gen/xyz/openbmc_project/MCTP/Base/meson.build b/gen/xyz/openbmc_project/MCTP/Base/meson.build +new file mode 100644 +index 00000000..c605b2d4 +--- /dev/null ++++ b/gen/xyz/openbmc_project/MCTP/Base/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/MCTP/Base__cpp'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/MCTP/Base.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/MCTP/Base', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/MCTP/Binding/PCIe/meson.build b/gen/xyz/openbmc_project/MCTP/Binding/PCIe/meson.build +new file mode 100644 +index 00000000..382342bb +--- /dev/null ++++ b/gen/xyz/openbmc_project/MCTP/Binding/PCIe/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/MCTP/Binding/PCIe__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/MCTP/Binding/PCIe.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/MCTP/Binding/PCIe', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/MCTP/Binding/SMBus/meson.build b/gen/xyz/openbmc_project/MCTP/Binding/SMBus/meson.build +new file mode 100644 +index 00000000..6192e5b5 +--- /dev/null ++++ b/gen/xyz/openbmc_project/MCTP/Binding/SMBus/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/MCTP/Binding/SMBus__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/MCTP/Binding/SMBus.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/MCTP/Binding/SMBus', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/MCTP/Binding/meson.build b/gen/xyz/openbmc_project/MCTP/Binding/meson.build +new file mode 100644 +index 00000000..1a05e9de +--- /dev/null ++++ b/gen/xyz/openbmc_project/MCTP/Binding/meson.build +@@ -0,0 +1,28 @@ ++# Generated file; do not modify. ++subdir('PCIe') ++generated_others += custom_target( ++ 'xyz/openbmc_project/MCTP/Binding/PCIe__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/MCTP/Binding/PCIe.interface.yaml', ], ++ output: [ 'PCIe.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/MCTP/Binding/PCIe', ++ ], ++) ++ ++subdir('SMBus') ++generated_others += custom_target( ++ 'xyz/openbmc_project/MCTP/Binding/SMBus__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/MCTP/Binding/SMBus.interface.yaml', ], ++ output: [ 'SMBus.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/MCTP/Binding/SMBus', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/MCTP/BusOwner/meson.build b/gen/xyz/openbmc_project/MCTP/BusOwner/meson.build +new file mode 100644 +index 00000000..4b28bd6b +--- /dev/null ++++ b/gen/xyz/openbmc_project/MCTP/BusOwner/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/MCTP/BusOwner__cpp'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/MCTP/BusOwner.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/MCTP/BusOwner', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/MCTP/SupportedMessageTypes/meson.build b/gen/xyz/openbmc_project/MCTP/SupportedMessageTypes/meson.build +new file mode 100644 +index 00000000..4fd46823 +--- /dev/null ++++ b/gen/xyz/openbmc_project/MCTP/SupportedMessageTypes/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/MCTP/SupportedMessageTypes__cpp'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/MCTP/SupportedMessageTypes.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/MCTP/SupportedMessageTypes', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/MCTP/meson.build b/gen/xyz/openbmc_project/MCTP/meson.build +index b9598adf..6b5e508c 100644 +--- a/gen/xyz/openbmc_project/MCTP/meson.build ++++ b/gen/xyz/openbmc_project/MCTP/meson.build +@@ -1,4 +1,33 @@ + # Generated file; do not modify. ++subdir('Base') ++generated_others += custom_target( ++ 'xyz/openbmc_project/MCTP/Base__markdown'.underscorify(), ++ input: [ '../../../../yaml/xyz/openbmc_project/MCTP/Base.interface.yaml', ], ++ output: [ 'Base.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../yaml', ++ 'xyz/openbmc_project/MCTP/Base', ++ ], ++) ++ ++subdir('Binding') ++subdir('BusOwner') ++generated_others += custom_target( ++ 'xyz/openbmc_project/MCTP/BusOwner__markdown'.underscorify(), ++ input: [ '../../../../yaml/xyz/openbmc_project/MCTP/BusOwner.interface.yaml', ], ++ output: [ 'BusOwner.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../yaml', ++ 'xyz/openbmc_project/MCTP/BusOwner', ++ ], ++) ++ + subdir('Endpoint') + generated_others += custom_target( + 'xyz/openbmc_project/MCTP/Endpoint__markdown'.underscorify(), +@@ -13,3 +42,16 @@ generated_others += custom_target( + ], + ) + ++subdir('SupportedMessageTypes') ++generated_others += custom_target( ++ 'xyz/openbmc_project/MCTP/SupportedMessageTypes__markdown'.underscorify(), ++ input: [ '../../../../yaml/xyz/openbmc_project/MCTP/SupportedMessageTypes.interface.yaml', ], ++ output: [ 'SupportedMessageTypes.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../yaml', ++ 'xyz/openbmc_project/MCTP/SupportedMessageTypes', ++ ], ++) +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0033-update-meson-build-for-PLDM-FWU-interfaces.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0033-update-meson-build-for-PLDM-FWU-interfaces.patch new file mode 100644 index 0000000000..030917b058 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0033-update-meson-build-for-PLDM-FWU-interfaces.patch @@ -0,0 +1,418 @@ +From cf5599fe499f88e8ef28a9d343a7bd776a58a55a Mon Sep 17 00:00:00 2001 +From: Zhikui Ren <zhikui.ren@intel.com> +Date: Tue, 8 Dec 2020 15:28:42 -0800 +Subject: [PATCH] update meson build for PLDM FWU interfaces + +Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> +--- + .../PLDM/FWU/ACPIDescriptor/meson.build | 13 ++ + .../ActiveComponentImageSetInfo/meson.build | 13 ++ + .../PLDM/FWU/ActiveComponentInfo/meson.build | 13 ++ + .../FWU/CapabilitiesDuringUpdate/meson.build | 13 ++ + .../ComponentActivationMethods/meson.build | 13 ++ + .../PLDM/FWU/FWUBase/meson.build | 13 ++ + .../PLDM/FWU/IANADescriptor/meson.build | 13 ++ + .../PLDM/FWU/PCIDescriptor/meson.build | 13 ++ + .../PendingComponentImageSetInfo/meson.build | 13 ++ + .../PLDM/FWU/PendingComponentInfo/meson.build | 13 ++ + .../PLDM/FWU/PnPDescriptor/meson.build | 13 ++ + gen/xyz/openbmc_project/PLDM/FWU/meson.build | 154 ++++++++++++++++++ + gen/xyz/openbmc_project/PLDM/meson.build | 1 + + 13 files changed, 298 insertions(+) + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/ACPIDescriptor/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/FWUBase/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/IANADescriptor/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/PCIDescriptor/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/PendingComponentInfo/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/PnPDescriptor/meson.build + create mode 100644 gen/xyz/openbmc_project/PLDM/FWU/meson.build + +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/ACPIDescriptor/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/ACPIDescriptor/meson.build +new file mode 100644 +index 00000000..d749e0a1 +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/ACPIDescriptor/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/ACPIDescriptor__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/ACPIDescriptor.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/ACPIDescriptor', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo/meson.build +new file mode 100644 +index 00000000..6095764a +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo/meson.build +new file mode 100644 +index 00000000..531e3050 +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate/meson.build +new file mode 100644 +index 00000000..c0918434 +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods/meson.build +new file mode 100644 +index 00000000..778dcd75 +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/FWUBase/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/FWUBase/meson.build +new file mode 100644 +index 00000000..61af12b6 +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/FWUBase/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/FWUBase__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/FWUBase.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/FWUBase', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/IANADescriptor/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/IANADescriptor/meson.build +new file mode 100644 +index 00000000..95a3f701 +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/IANADescriptor/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/IANADescriptor__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/IANADescriptor.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/IANADescriptor', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/PCIDescriptor/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/PCIDescriptor/meson.build +new file mode 100644 +index 00000000..16a28d25 +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/PCIDescriptor/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/PCIDescriptor__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/PCIDescriptor.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/PCIDescriptor', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo/meson.build +new file mode 100644 +index 00000000..85f4c637 +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/PendingComponentInfo/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/PendingComponentInfo/meson.build +new file mode 100644 +index 00000000..3dcbb2de +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/PendingComponentInfo/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/PendingComponentInfo__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentInfo.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/PendingComponentInfo', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/PnPDescriptor/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/PnPDescriptor/meson.build +new file mode 100644 +index 00000000..997c6ddc +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/PnPDescriptor/meson.build +@@ -0,0 +1,13 @@ ++# Generated file; do not modify. ++generated_sources += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/PnPDescriptor__cpp'.underscorify(), ++ input: [ '../../../../../../yaml/xyz/openbmc_project/PLDM/FWU/PnPDescriptor.interface.yaml', ], ++ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'cpp', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/PnPDescriptor', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/FWU/meson.build b/gen/xyz/openbmc_project/PLDM/FWU/meson.build +new file mode 100644 +index 00000000..2bb71914 +--- /dev/null ++++ b/gen/xyz/openbmc_project/PLDM/FWU/meson.build +@@ -0,0 +1,154 @@ ++# Generated file; do not modify. ++subdir('ACPIDescriptor') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/ACPIDescriptor__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/ACPIDescriptor.interface.yaml', ], ++ output: [ 'ACPIDescriptor.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/ACPIDescriptor', ++ ], ++) ++ ++subdir('ActiveComponentImageSetInfo') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo.interface.yaml', ], ++ output: [ 'ActiveComponentImageSetInfo.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/ActiveComponentImageSetInfo', ++ ], ++) ++ ++subdir('ActiveComponentInfo') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo.interface.yaml', ], ++ output: [ 'ActiveComponentInfo.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/ActiveComponentInfo', ++ ], ++) ++ ++subdir('CapabilitiesDuringUpdate') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate.interface.yaml', ], ++ output: [ 'CapabilitiesDuringUpdate.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/CapabilitiesDuringUpdate', ++ ], ++) ++ ++subdir('ComponentActivationMethods') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods.interface.yaml', ], ++ output: [ 'ComponentActivationMethods.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/ComponentActivationMethods', ++ ], ++) ++ ++subdir('FWUBase') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/FWUBase__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/FWUBase.interface.yaml', ], ++ output: [ 'FWUBase.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/FWUBase', ++ ], ++) ++ ++subdir('IANADescriptor') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/IANADescriptor__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/IANADescriptor.interface.yaml', ], ++ output: [ 'IANADescriptor.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/IANADescriptor', ++ ], ++) ++ ++subdir('PCIDescriptor') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/PCIDescriptor__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/PCIDescriptor.interface.yaml', ], ++ output: [ 'PCIDescriptor.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/PCIDescriptor', ++ ], ++) ++ ++subdir('PendingComponentImageSetInfo') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo.interface.yaml', ], ++ output: [ 'PendingComponentImageSetInfo.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/PendingComponentImageSetInfo', ++ ], ++) ++ ++subdir('PendingComponentInfo') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/PendingComponentInfo__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/PendingComponentInfo.interface.yaml', ], ++ output: [ 'PendingComponentInfo.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/PendingComponentInfo', ++ ], ++) ++ ++subdir('PnPDescriptor') ++generated_others += custom_target( ++ 'xyz/openbmc_project/PLDM/FWU/PnPDescriptor__markdown'.underscorify(), ++ input: [ '../../../../../yaml/xyz/openbmc_project/PLDM/FWU/PnPDescriptor.interface.yaml', ], ++ output: [ 'PnPDescriptor.md' ], ++ command: [ ++ sdbuspp_gen_meson_prog, '--command', 'markdown', ++ '--output', meson.current_build_dir(), ++ '--tool', sdbusplusplus_prog, ++ '--directory', meson.current_source_dir() / '../../../../../yaml', ++ 'xyz/openbmc_project/PLDM/FWU/PnPDescriptor', ++ ], ++) +diff --git a/gen/xyz/openbmc_project/PLDM/meson.build b/gen/xyz/openbmc_project/PLDM/meson.build +index 2be636cb..35ff3019 100644 +--- a/gen/xyz/openbmc_project/PLDM/meson.build ++++ b/gen/xyz/openbmc_project/PLDM/meson.build +@@ -13,6 +13,7 @@ generated_others += custom_target( + ], + ) + ++subdir('FWU') + subdir('PDR') + generated_others += custom_target( + 'xyz/openbmc_project/PLDM/PDR__markdown'.underscorify(), +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0034-Add-username-property-to-SessionInfo-interface.patch b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0034-Add-username-property-to-SessionInfo-interface.patch new file mode 100644 index 0000000000..5744335d6b --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0034-Add-username-property-to-SessionInfo-interface.patch @@ -0,0 +1,64 @@ +From 1c16f55023fe3ab0a32b2cce4ef1db1a473c654a Mon Sep 17 00:00:00 2001 +From: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> +Date: Tue, 1 Jun 2021 12:27:50 +0000 +Subject: [PATCH] Add username property to SessionInfo interface + +Add username property to SessionInfo interface to get username info on +individual IPMI session Id's on Redfish + +Tested: +Verified on SessionInfo D-bus interface. + +busctl introspect xyz.openbmc_project.Ipmi.Channel.eth0 + /xyz/openbmc_project/ipmi/session/eth0/0 +NAME TYPE SIGNATURE RESULT/VALUE FLAGS +...... +xyz.openbmc_project.Ipmi.SessionInfo interface - - - +.ChannelNum property y 0 emits-change writable +.CurrentPrivilege property y 0 emits-change writable +.RemoteIPAddr property u 2225389066 emits-change writable +.RemoteMACAddress property ay 0 emits-change writable +.RemotePort property q 35749 emits-change writable +.SessionHandle property y 0 emits-change writable +.State property y 0 emits-change writable +.UserID property y 0 emits-change writable +.Username property s "" emits-change writable + +Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> +--- + yaml/xyz/openbmc_project/Ipmi/SESSION_README.md | 1 + + yaml/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml | 6 ++++++ + 2 files changed, 7 insertions(+) + +diff --git a/yaml/xyz/openbmc_project/Ipmi/SESSION_README.md b/yaml/xyz/openbmc_project/Ipmi/SESSION_README.md +index 4ad60f22..43374a95 100644 +--- a/yaml/xyz/openbmc_project/Ipmi/SESSION_README.md ++++ b/yaml/xyz/openbmc_project/Ipmi/SESSION_README.md +@@ -18,6 +18,7 @@ so that both phosphor-ipmi-host & phosphr-ipmi-net will be in sync. + - RemotePort - Remote port address. + - RemoteMACAddress -Remote MAC Address. + - UserID - Session created by given user id. ++- Username - Session created by given username. + + ### xyz.openbmc_project.Object.Delete + +diff --git a/yaml/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml b/yaml/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml +index 6d8a899d..b1a8741a 100644 +--- a/yaml/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml ++++ b/yaml/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml +@@ -46,6 +46,12 @@ properties: + Session created by given user ID. + errors: + - xyz.openbmc_project.Common.Error.InternalFailure ++ - name: Username ++ type: string ++ description: > ++ Session created by given username. ++ errors: ++ - xyz.openbmc_project.Common.Error.InternalFailure + - name: State + type: byte + default: 0 +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend new file mode 100644 index 0000000000..f153f6a2d7 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend @@ -0,0 +1,22 @@ +# Keep this as a comment to enable the auto-bump script without +# stomping on SRC_URI from previous .bbappend files +#SRC_URI = "git://github.com/openbmc/phosphor-dbus-interfaces.git;branch=master;protocol=https" +#SRCREV = "1bf1b7bfcf639a4e0eed39320181f9b155d787e7" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://0007-ipmi-set-BIOS-id.patch \ + file://0010-Increase-the-default-watchdog-timeout-value.patch \ + file://0012-Add-RestoreDelay-interface-for-power-restore-delay.patch \ + file://0013-Add-ErrConfig.yaml-interface-for-processor-error-config.patch \ + file://0024-Add-the-pre-timeout-interrupt-defined-in-IPMI-spec.patch \ + file://0025-Add-PreInterruptFlag-properity-in-DBUS.patch \ + file://0026-Add-StandbySpare-support-for-software-inventory.patch \ + file://0028-MCTP-Daemon-D-Bus-interface-definition.patch \ + file://0029-Add-D-Bus-interfaces-for-PLDM-FW-update.patch \ + file://0030-Add-PLDM-version-purpose-enumeration.patch \ + file://0031-update-meson-build-files-for-control-and-bios.patch \ + file://0032-update-meson-build-for-MCTP-interfaces.patch \ + file://0033-update-meson-build-for-PLDM-FWU-interfaces.patch \ + file://0034-Add-username-property-to-SessionInfo-interface.patch \ + " diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-mapper-config-native.bbappend b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-mapper-config-native.bbappend new file mode 100644 index 0000000000..5f38b8da94 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-mapper-config-native.bbappend @@ -0,0 +1 @@ +PHOSPHOR_MAPPER_CONFIGS:append:ibs = " ibs-dbus-interfaces-mapper-config-native" diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.service b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.service new file mode 100644 index 0000000000..9af9af2546 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.service @@ -0,0 +1,20 @@ +[Unit] +Description=Phosphor DBus Service Discovery Manager +Before=obmc-mapper.target +After=dbus.socket + +[Service] +Restart=always +Type=dbus +ExecStart=/usr/bin/env mapperx \ + --service-namespaces="xyz. com. org." \ + --interface-namespaces="org. com. xyz." \ + --service-blacklists="org.freedesktop.systemd1" +SyslogIdentifier=phosphor-mapper +BusName={BUSNAME} +TimeoutStartSec=300 +RestartSec=5 +EnvironmentFile={envfiledir}/obmc/mapper + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-mapper_%.bbappend b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-mapper_%.bbappend new file mode 100644 index 0000000000..4fc41d0580 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/phosphor-mapper_%.bbappend @@ -0,0 +1 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" diff --git a/meta-ibs/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-ibs/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend new file mode 100644 index 0000000000..29b3d39b08 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +EXTRA_OECONF:append = "--enable-configure-dbus=yes" diff --git a/meta-ibs/meta-common/recipes-phosphor/fru/default-fru.bb b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru.bb new file mode 100644 index 0000000000..205454d9eb --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru.bb @@ -0,0 +1,26 @@ +SUMMARY = "Default Fru" +DESCRIPTION = "Builds a default FRU file at runtime based on board ID" + +inherit obmc-phosphor-systemd +inherit cmake + +SRC_URI = "file://checkFru.sh;subdir=${BP} \ + file://decodeBoardID.sh;subdir=${BP} \ + file://mkfru.cpp;subdir=${BP} \ + file://CMakeLists.txt;subdir=${BP} \ + " +SYSTEMD_SERVICE:${PN} = "SetBaseboardFru.service" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "\ + file://${IBSBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658 \ + file://mkfru.cpp;beginline=2;endline=14;md5=c451359f18a13ee69602afce1588c01a \ + " + +RDEPENDS:${PN} = "bash" + +do_install:append() { + install -d ${D}${bindir} + install -m 0755 ${S}/checkFru.sh ${D}${bindir}/checkFru.sh + install -m 0755 ${S}/decodeBoardID.sh ${D}${bindir}/decodeBoardID.sh +} diff --git a/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/CMakeLists.txt b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/CMakeLists.txt new file mode 100644 index 0000000000..a8e6336441 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) +project(mkfru CXX) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +add_executable(mkfru mkfru.cpp) +install(TARGETS mkfru DESTINATION bin) + diff --git a/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/SetBaseboardFru.service b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/SetBaseboardFru.service new file mode 100644 index 0000000000..d8c2a75acd --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/SetBaseboardFru.service @@ -0,0 +1,9 @@ +[Unit] +Description=Check for FRU presence + +[Service] +ExecStart=/usr/bin/checkFru.sh +Type=oneshot + +[Install] +WantedBy=basic.target diff --git a/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/checkFru.sh b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/checkFru.sh new file mode 100755 index 0000000000..18a6c72601 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/checkFru.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# this script checks the gpio id and loads the correct baseboard fru +FRUPATH="/etc/fru" +PRODIDPATH="/var/cache/private" +fruFile="$FRUPATH/baseboard.fru.bin" +prodIDFile="$PRODIDPATH/prodID" +source decodeBoardID.sh + +read_id() { + local idx=0 + local result=0 + local value=0 + for ((idx=0; idx<6; idx++)) + do + typeset -i value=$(gpioget $(gpiofind "FM_BMC_BOARD_SKU_ID${idx}_N")) + value=$((value << idx)) + result=$((result | value)) + done + echo $result +} + +if [ -f $fruFile -a -f $prodIDFile ] && + grep -q 'CPU part\s*: 0xc07' /proc/cpuinfo; then + exit 0 +fi + +NAME="Unknown" +PRODID="0x00" +EEPROM_FRU=false + +BOARD_ID=$(read_id) +decode_board_id + +if [ ! -e $prodIDFile ] +then + echo $PRODID >$prodIDFile +fi + +if $EEPROM_FRU; +then + # Remove baseboard filesystem FRU(if any), as this platform has EEPROM FRU. + rm -f $fruFile + exit 0 +fi + +if [ ! -f $fruFile ] +then + cd /tmp + mkdir -p $FRUPATH + mkfru $NAME + mv $NAME.fru.bin $fruFile +fi + diff --git a/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/decodeBoardID.sh b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/decodeBoardID.sh new file mode 100644 index 0000000000..80710ae26d --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/decodeBoardID.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# this script uses the BOARD_ID set from checkFru.sh and provides the NAME, +# PRODID, and EEPROM_FRU values for this platform +decode_board_id() { +} diff --git a/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/mkfru.cpp b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/mkfru.cpp new file mode 100644 index 0000000000..bafbf8ec2f --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/fru/default-fru/mkfru.cpp @@ -0,0 +1,219 @@ +/* +// Copyright (c) 2019 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Abstract: default FRU generation +// +*/ + +#include <fstream> +#include <iostream> +#include <iterator> +#include <numeric> +#include <string> +#include <vector> + +constexpr uint8_t fillChar = '.'; +constexpr uint8_t eof = 0xc1; +const std::string ibs = "IBS Corporation"; + +// round up to nearest block size (power of 2) +constexpr size_t blockRound(size_t len, size_t blk) +{ + return ((len) + (((blk) - ((len) & ((blk)-1))) & ((blk)-1))); +} + +uint8_t mklen(uint8_t len) +{ + return static_cast<uint8_t>((0x3 << 6) | len); +} + +struct FruEntry +{ + static constexpr size_t fruBlockSize = 8; // type, length, checksum + static constexpr size_t fixedBytes = 3; // type, length, checksum + FruEntry() = delete; + FruEntry(const std::vector<uint8_t>& contents) + { + constexpr size_t verOffset = 0; + constexpr size_t lenOffset = 1; + value.resize(blockRound(fixedBytes + contents.size(), fruBlockSize)); + value[verOffset] = 1; + value[lenOffset] = blocks(); + std::copy(contents.begin(), contents.end(), value.begin() + 2); + addChecksum(); + } + + void addChecksum() + { + int sum = std::accumulate(value.begin(), value.end(), 0); + value.back() = static_cast<uint8_t>(256 - sum & 0xff); + } + + uint8_t blocks() const + { + return static_cast<uint8_t>(value.size() / 8); + } + + std::vector<uint8_t> value; +}; + +size_t fillDots(std::vector<uint8_t>::iterator start, size_t count) +{ + *start++ = mklen(count); // prefix with (0xc0 | count) + auto end = start + count++; + std::fill(start, end, '.'); + return count; +} + +size_t fillStr(std::vector<uint8_t>::iterator start, const std::string& str) +{ + size_t count = str.size(); + *start++ = mklen(count++); // prefix with (0xc0 | count) + std::copy(str.begin(), str.end(), start); + return count; +} + +std::vector<uint8_t> genChassisContents() +{ + constexpr size_t pnSize = 18; + constexpr size_t snSize = 18; + constexpr size_t amSize = 31; + constexpr size_t headerSize = 1; + constexpr size_t contentSize = headerSize + 1 + pnSize + 1 + snSize + 1 + + amSize + 1 + amSize + sizeof(eof); + std::vector<uint8_t> data(contentSize); + size_t offset = 0; + // chassis type (main server chassis) + data[offset++] = 0x17; + // chassis part number + offset += fillDots(data.begin() + offset, pnSize); + // chassis serial number + offset += fillDots(data.begin() + offset, snSize); + // info am1 + offset += fillDots(data.begin() + offset, amSize); + // info am2 + offset += fillDots(data.begin() + offset, amSize); + data[offset] = eof; + + return data; +} + +std::vector<uint8_t> genBoardContents(const std::string& name) +{ + constexpr size_t headerSize = 4; + constexpr size_t snSize = 12; + constexpr size_t pnSize = 10; + const std::string version = "FRU Ver 0.01"; + size_t contentSize = headerSize + 1 + name.size() + 1 + ibs.size() + 1 + + snSize + 1 + pnSize + 1 + version.size() + sizeof(eof); + std::vector<uint8_t> data(contentSize); + size_t offset = 0; + // chassis type (main server chassis) + data[offset++] = 0; // language code + data[offset++] = 0; // mfg date/time + data[offset++] = 0; // mfg date/time + data[offset++] = 0; // mfg date/time + // manufacturer name + offset += fillStr(data.begin() + offset, ibs); + // product name + offset += fillStr(data.begin() + offset, name); + // board sn + offset += fillDots(data.begin() + offset, snSize); + // board pn + offset += fillDots(data.begin() + offset, pnSize); + // fru version string + offset += fillStr(data.begin() + offset, version); + data[offset] = eof; + + return data; +} + +std::vector<uint8_t> genProductContents(const std::string& name) +{ + constexpr size_t headerSize = 1; + constexpr size_t pnSize = 10; + constexpr size_t pvSize = 20; + constexpr size_t snSize = 12; + constexpr size_t atSize = 20; + constexpr size_t idSize = 0; + const std::string version = "FRU Ver 0.01"; + size_t contentSize = headerSize + 1 + ibs.size() + 1 + name.size() + 1 + + pnSize + 1 + pvSize + 1 + snSize + 1 + atSize + 1 + + idSize + sizeof(eof); + std::vector<uint8_t> data(contentSize); + size_t offset = 0; + // chassis type (main server chassis) + data[offset++] = 0; // language code + // manufacturer name + offset += fillStr(data.begin() + offset, ibs); + // product name + offset += fillStr(data.begin() + offset, name); + // product part number + offset += fillDots(data.begin() + offset, pnSize); + // product version + offset += fillDots(data.begin() + offset, pvSize); + // product serial number + offset += fillDots(data.begin() + offset, snSize); + // product asset tag + offset += fillDots(data.begin() + offset, atSize); + // empty fru file id + offset += fillDots(data.begin() + offset, idSize); + data[offset] = eof; + + return data; +} + +int createFru(const std::string& name) +{ + std::vector<uint8_t> internal{1, 0, 0, 0, 0, 0, 0, 1}; // fixed data + FruEntry chassis(genChassisContents()); + FruEntry board(genBoardContents(name)); + FruEntry product(genProductContents(name)); + uint8_t offset = 1; // room for header's offset + FruEntry header({ + offset += 1, // internal size + offset += chassis.blocks(), + offset += board.blocks(), + }); + std::string filename = name + ".fru.bin"; + std::ofstream output(filename); + std::ostream_iterator<uint8_t> outputIter(output); + std::copy(header.value.begin(), header.value.end(), outputIter); + std::copy(internal.begin(), internal.end(), outputIter); + std::copy(chassis.value.begin(), chassis.value.end(), outputIter); + std::copy(board.value.begin(), board.value.end(), outputIter); + std::copy(product.value.begin(), product.value.end(), outputIter); + constexpr size_t minFruSize = 0x1ff; + size_t fruSize = header.value.size() + internal.size() + + chassis.value.size() + board.value.size() + + product.value.size(); + if (fruSize < minFruSize) + { + std::vector<uint8_t> padding(minFruSize - fruSize); + std::copy(padding.begin(), padding.end(), outputIter); + } + output.close(); + return 0; +} + +int main(int argc, const char* argv[]) +{ + if (argc != 2) + { + std::cerr << "Usage: " << argv[0] << " <'Product Name'>\n"; + return 1; + } + return createFru(argv[1]); +} diff --git a/meta-ibs/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bbappend b/meta-ibs/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bbappend new file mode 100644 index 0000000000..61fefda887 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +DESCRIPTION = "Pinging system watchdog before BMC update" + +SRC_URI += "file://obmc-shutdown.sh" diff --git a/meta-ibs/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/obmc-shutdown.sh b/meta-ibs/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/obmc-shutdown.sh new file mode 100644 index 0000000000..204665de7e --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/obmc-shutdown.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +echo shutdown: "$@" + +export PS1=shutdown-sh#\ +# exec bin/sh + +cd / +if [ ! -e /proc/mounts ] +then + mkdir -p /proc + mount proc /proc -tproc + umount_proc=1 +else + umount_proc= +fi + +# Remove an empty oldroot, that means we are not invoked from systemd-shutdown +rmdir /oldroot 2>/dev/null + +# Move /oldroot/run to /mnt in case it has the underlying rofs loop mounted. +# Ordered before /oldroot the overlay is unmounted before the loop mount +mkdir -p /mnt +mount --move /oldroot/run /mnt + +set -x +for f in $( awk '/oldroot|mnt/ { print $2 }' < /proc/mounts | sort -r ) +do + umount $f +done +set +x + +update=/run/initramfs/update +image=/run/initramfs/image- + +swdt="-t 10 -T 60" +wdt="-t 1 -T 5" +wdrst="-T 15" + +if ls $image* > /dev/null 2>&1 +then + if test -x $update + then + if test -c /dev/watchdog1 + then + echo Pinging BMC Hardware watchdog ${swdt+with args $swdt} + watchdog $swdt -F /dev/watchdog1 & + fi + if test -c /dev/watchdog + then + echo Pinging watchdog ${wdt+with args $wdt} + watchdog $wdt -F /dev/watchdog & + wd=$! + else + wd= + fi + $update --clean-saved-files + remaining=$(ls $image*) + if test -n "$remaining" + then + echo 1>&2 "Flash update failed to flash these images:" + echo 1>&2 "$remaining" + else + echo "Flash update completed." + fi + + if test -n "$wd" + then + kill -9 $wd + if test -n "$wdrst" + then + echo Resetting watchdog timeouts to $wdrst + watchdog $wdrst -F /dev/watchdog & + sleep 1 + # Kill the watchdog daemon, setting a timeout + # for the remaining shutdown work + kill -9 $! + fi + fi + else + echo 1>&2 "Flash update requested but $update program missing!" + fi +fi + +echo Remaining mounts: +cat /proc/mounts + +test "$umount_proc" && umount /proc && rmdir /proc + +# tcsattr(tty, TIOCDRAIN, mode) to drain tty messages to console +test -t 1 && stty cooked 0<&1 + +# Execute the command systemd told us to ... +if test -d /oldroot && test "$1" +then + if test "$1" = kexec + then + $1 -f -e + else + $1 -f + fi +fi + + +echo "Execute ${1-reboot} -f if all unmounted ok, or exec /init" + +export PS1=shutdown-sh#\ +exec /bin/sh diff --git a/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb-init-certs.bb b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb-init-certs.bb new file mode 100644 index 0000000000..21e411143f --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb-init-certs.bb @@ -0,0 +1,18 @@ +SUMMARY = "BMCWEB init Certificate" +DESCRIPTION = "At first BMC boot the BMCWEB service can create expired or invalid certificate. \ + This script should be run once at first BMC boot to reinstall default PEM-keys \ + and remove corresponded Logging/Entries." + +inherit allarch + +RDEPENDS:${PN} = "bash" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${IBSBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +SRC_URI += "file://bmcweb-init-certs" + +do_install:append(){ + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/bmcweb-init-certs ${D}${bindir} +} diff --git a/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb-init-certs/bmcweb-init-certs b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb-init-certs/bmcweb-init-certs new file mode 100644 index 0000000000..ea0d796f7d --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb-init-certs/bmcweb-init-certs @@ -0,0 +1,66 @@ +#!/bin/sh -eu + +# SPDX-License-Identifier: Apache-2.0 +# Copyright (C) 2022 IBS + +# +# At first BMC boot the BMCWEB service can create expired or invalid certificate. +# This script should be run once at first BMC boot to reinstall default PEM-keys +# and remove corresponded Logging/Entries. +# + +SSL_PATH="/etc/ssl/certs/https" +PRIV_KEY_NAME="${SSL_PATH}/.rsaprivkey.pem" +SERV_KEY_NAME="${SSL_PATH}/server.pem" + +HOST_NAME=`hostname` + +# +# Remove Keys: +# +rm -f ${PRIV_KEY_NAME} ${SERV_KEY_NAME} + +# +# Create new private PEM-key: +# +systemctl restart phosphor-certificate-manager@bmcweb.service + +count=0 +# wait for 5 minutes until the certificate manager creates the private PEM-key +while [ ! -f ${PRIV_KEY_NAME} ] && [ ${count} -lt 300 ] +do + count=$[ $count + 1] + sleep 1 +done + +# +# Create new server PEM-key: +# +systemctl restart bmcweb.service + +count=0 +# wait for 5 minutes until the bmcweb creates the server PEM-key +while [ ! -f ${PRIV_KEY_NAME} ] && [ ${count} -lt 300 ] +do + count=$[ $count + 1] + sleep 1 +done + +# +# Trigger the signal for bmcweb service: +# +busctl set-property xyz.openbmc_project.Network /xyz/openbmc_project/network/config xyz.openbmc_project.Network.SystemConfiguration HostName s "testhost" +busctl set-property xyz.openbmc_project.Network /xyz/openbmc_project/network/config xyz.openbmc_project.Network.SystemConfiguration HostName s "${HOSTNAME}" + +# +# Remove all 'xyz.openbmc_project.Certs.Error.InvalidCertificate' Logging Entries: +# +for eid in `ls /var/lib/phosphor-logging/errors/` ; do + if `grep -q xyz.openbmc_project.Certs.Error.InvalidCertificate "/var/lib/phosphor-logging/errors/${eid}"` ; then + message=`busctl get-property xyz.openbmc_project.Logging /xyz/openbmc_project/logging/entry/${eid} xyz.openbmc_project.Logging.Entry Message | sed 's,s "\(.*\)",\1,'` + if [ "${message}" = "xyz.openbmc_project.Certs.Error.InvalidCertificate" ] ; then + busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging/entry/${eid} xyz.openbmc_project.Object.Delete Delete + fi + fi +done + diff --git a/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Enable-vm-nbdproxy-option.patch b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Enable-vm-nbdproxy-option.patch new file mode 100644 index 0000000000..e738dcae15 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Enable-vm-nbdproxy-option.patch @@ -0,0 +1,47 @@ +From dd0744e05c5de4f4e7f462e6a1bf1da20cbee10d Mon Sep 17 00:00:00 2001 +From: kx <kx@radix.pro> +Date: Tue, 10 May 2022 17:10:11 +0300 +Subject: [PATCH] Enable vm-nbdproxy option + +--- + meson.build | 2 +- + meson_options.txt | 10 +++++----- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/meson.build b/meson.build +index e8897b393..a38a20466 100644 +--- a/meson.build ++++ b/meson.build +@@ -86,7 +86,7 @@ feature_map = { + 'static-hosting' : '-DBMCWEB_ENABLE_STATIC_HOSTING', + 'vm-websocket' : '-DBMCWEB_ENABLE_VM_WEBSOCKET', + 'xtoken-auth' : '-DBMCWEB_ENABLE_XTOKEN_AUTHENTICATION', +- #'vm-nbdproxy' : '-DBMCWEB_ENABLE_VM_NBDPROXY', ++ 'vm-nbdproxy' : '-DBMCWEB_ENABLE_VM_NBDPROXY', + } + + # Get the options status and build a project summary to show which flags are +diff --git a/meson_options.txt b/meson_options.txt +index d943222a4..799ebfc59 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -35,11 +35,11 @@ option( + # this interface, so for the moment this appears to be dead code; In leiu of + # removing it, it has been disabled to try to give those that use it the + # opportunity to upstream their backend implementation +-#option( +-# 'vm-nbdproxy', +-# type: 'feature', value: 'disabled', +-# description: 'Enable the Virtual Media WebSocket.' +-#) ++option( ++ 'vm-nbdproxy', ++ type: 'feature', value: 'disabled', ++ description: 'Enable the Virtual Media WebSocket.' ++) + + option( + 'rest', +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend new file mode 100644 index 0000000000..683f52eec9 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend @@ -0,0 +1,13 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRCREV = "550a6bf85f81c1725b6c320a5ee419335cff2cf6" + +SRC_URI += "\ + file://0001-Enable-vm-nbdproxy-option.patch \ + " + +EXTRA_OEMESON += "\ + -Dredfish-cpu-log=enabled \ + -Dredfish-bmc-journal=enabled \ + -Drest=enabled \ + " diff --git a/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend new file mode 100644 index 0000000000..eb6ee2fcbb --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend @@ -0,0 +1,5 @@ +do_install:append:ibs(){ + install -d ${D}${includedir}/phosphor-ipmi-host + install -m 0644 -D ${S}/sensorhandler.hpp ${D}${includedir}/phosphor-ipmi-host + install -m 0644 -D ${S}/selutility.hpp ${D}${includedir}/phosphor-ipmi-host +} diff --git a/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/ipmb-channels.json b/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/ipmb-channels.json new file mode 100644 index 0000000000..cf5a28303a --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/ipmb-channels.json @@ -0,0 +1,16 @@ +{ + "channels": [ + { + "type": "me", + "slave-path": "/dev/ipmb-5", + "bmc-addr": 32, + "remote-addr": 44 + }, + { + "type": "ipmb", + "slave-path": "/dev/ipmb-13", + "bmc-addr": 32, + "remote-addr": 56 + } + ] +} diff --git a/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend b/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend new file mode 100644 index 0000000000..29b98581fe --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append = " file://ipmb-channels.json" + +do_install:append(){ + install -m 0644 -D ${WORKDIR}/ipmb-channels.json \ + ${D}/usr/share/ipmbbridge +} diff --git a/meta-ibs/meta-common/recipes-phosphor/leds/ibs-led-manager-config-native.bb b/meta-ibs/meta-common/recipes-phosphor/leds/ibs-led-manager-config-native.bb new file mode 100644 index 0000000000..2624e6d5e8 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/leds/ibs-led-manager-config-native.bb @@ -0,0 +1,21 @@ +SUMMARY = "Phosphor LED Group Management for IBS" +PR = "r1" + +inherit obmc-phosphor-utils +inherit native + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${IBSBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +PROVIDES += "virtual/phosphor-led-manager-config-native" + +SRC_URI += "file://led.yaml" +S = "${WORKDIR}" + +# Overwrite the example led layout yaml file prior +# to building the phosphor-led-manager package +do_install() { + SRC=${S} + DEST=${D}${datadir}/phosphor-led-manager + install -D ${SRC}/led.yaml ${DEST}/led.yaml +} diff --git a/meta-ibs/meta-common/recipes-phosphor/leds/ibs-led-manager-config/led.yaml b/meta-ibs/meta-common/recipes-phosphor/leds/ibs-led-manager-config/led.yaml new file mode 100644 index 0000000000..533df68a4e --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/leds/ibs-led-manager-config/led.yaml @@ -0,0 +1,48 @@ +bmc_booted: + +power_on: + +status_ok: + status_green: + Action: 'On' + status_amber: + Action: 'Off' + +status_degraded: + status_green: + Action: 'Blink' + DutyOn: 50 + Period: 1000 + status_amber: + Action: 'Off' + +status_non_critical: + status_green: + Action: 'Off' + status_amber: + Action: 'Blink' + DutyOn: 50 + Period: 1000 + +status_critical: + status_green: + Action: 'Off' + status_amber: + Action: 'On' + +enclosure_identify: + identify: + Action: 'On' + +enclosure_identify_blink: + identify: + Action: 'Blink' + +cpu0_fault: + cpu0fault: + Action: 'On' + +cpu1_fault: + cpu1fault: + Action: 'On' + diff --git a/meta-ibs/meta-common/recipes-phosphor/leds/id-led-off/id-led-off.service b/meta-ibs/meta-common/recipes-phosphor/leds/id-led-off/id-led-off.service new file mode 100644 index 0000000000..51e59c6144 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/leds/id-led-off/id-led-off.service @@ -0,0 +1,11 @@ +[Unit] +Description=turn off the ID LED when BMC is ready +Wants=multi-user.target +After=multi-user.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/id-led-off.sh + +[Install] +WantedBy=multi-user.target diff --git a/meta-ibs/meta-common/recipes-phosphor/leds/id-led-off/id-led-off.sh b/meta-ibs/meta-common/recipes-phosphor/leds/id-led-off/id-led-off.sh new file mode 100755 index 0000000000..b609fc0ea8 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/leds/id-led-off/id-led-off.sh @@ -0,0 +1,12 @@ +#!/bin/sh +busctl set-property "xyz.openbmc_project.LED.GroupManager" \ +"/xyz/openbmc_project/led/groups/enclosure_identify" \ +"xyz.openbmc_project.Led.Group" "Asserted" b false + +busctl set-property "xyz.openbmc_project.LED.GroupManager" \ +"/xyz/openbmc_project/led/groups/enclosure_identify_blink" \ +"xyz.openbmc_project.Led.Group" "Asserted" b false + +busctl set-property "xyz.openbmc_project.LED.Controller.identify" \ +"/xyz/openbmc_project/led/physical/identify" \ +"xyz.openbmc_project.Led.Physical" "State" s "xyz.openbmc_project.Led.Physical.Action.Off" diff --git a/meta-ibs/meta-common/recipes-phosphor/leds/id-led-off_git.bb b/meta-ibs/meta-common/recipes-phosphor/leds/id-led-off_git.bb new file mode 100644 index 0000000000..6dc1a4306d --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/leds/id-led-off_git.bb @@ -0,0 +1,24 @@ +SUMMARY = "Turn off the ID LED" +DESCRIPTION = "Script to turn off the ID LED after BMC is ready" + +S = "${WORKDIR}" +SRC_URI = "file://id-led-off.sh \ + file://id-led-off.service \ + " + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${IBSBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" +RDEPENDS:${PN} += "bash" + +inherit systemd + +FILES:${PN} += "${systemd_system_unitdir}/id-led-off.service" + +do_install() { + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/id-led-off.service ${D}${systemd_system_unitdir} + install -d ${D}${bindir} + install -m 0755 ${S}/id-led-off.sh ${D}/${bindir}/id-led-off.sh +} + +SYSTEMD_SERVICE:${PN} += " id-led-off.service" diff --git a/meta-ibs/meta-common/recipes-phosphor/leds/phosphor-led-manager_%.bbappend b/meta-ibs/meta-common/recipes-phosphor/leds/phosphor-led-manager_%.bbappend new file mode 100644 index 0000000000..312ec6706c --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/leds/phosphor-led-manager_%.bbappend @@ -0,0 +1,11 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +RDEPENDS:${PN}:remove = "clear-once" + +do_compile:prepend(){ + install -m 0644 ${STAGING_DATADIR_NATIVE}/${PN}/led.yaml ${S} +} + +do_install:append(){ + rm -f ${S}/led.yaml +} diff --git a/meta-ibs/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb b/meta-ibs/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb new file mode 100644 index 0000000000..d5c3578168 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb @@ -0,0 +1,18 @@ +SUMMARY = "Phosphor U-Boot environment manager" +DESCRIPTION = "Daemon to read or write U-Boot environment variables" + +PV = "1.0+git${SRCPV}" + +S = "${WORKDIR}/git" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +SRC_URI = "git://github.com/openbmc/phosphor-u-boot-env-mgr.git;branch=master;protocol=https" + +SRCREV = "1979d3b31a96e9359402ac4d7867ec5dddbece7e" + +inherit pkgconfig cmake systemd +SYSTEMD_SERVICE:${PN} = "xyz.openbmc_project.U_Boot.Environment.Manager.service" + +DEPENDS = "boost sdbusplus phosphor-logging" diff --git a/meta-ibs/meta-common/recipes-phosphor/virtual-media/virtual-media.bb b/meta-ibs/meta-common/recipes-phosphor/virtual-media/virtual-media.bb new file mode 100644 index 0000000000..e1846d66d3 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/virtual-media/virtual-media.bb @@ -0,0 +1,25 @@ +SUMMARY = "Virtual Media Service" +DESCRIPTION = "Virtual Media Service" + +SRC_URI = "git://github.com/Intel-BMC/virtual-media.git;branch=main;protocol=https" +#SRCREV = "6165e07cd0ef6da314ed1ef4f58fe47b7d8112db" +SRCREV = "ed2aceab6ee059a40d939ea21364bc18ec80d94b" + +S = "${WORKDIR}/git" +PV = "1.0+git${SRCPV}" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +SYSTEMD_SERVICE:${PN} += "xyz.openbmc_project.VirtualMedia.service" + +DEPENDS = "udev boost nlohmann-json systemd sdbusplus" + +RDEPENDS:${PN} = "nbd-client nbdkit" + +inherit cmake systemd + +EXTRA_OECMAKE += "-DYOCTO_DEPENDENCIES=ON" +EXTRA_OECMAKE += "-DLEGACY_MODE_ENABLED=ON" + +FULL_OPTIMIZATION = "-Os -pipe -flto -fno-rtti" diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog.bb b/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog.bb new file mode 100644 index 0000000000..26a0fb2383 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog.bb @@ -0,0 +1,35 @@ + +SUMMARY = "FRB2 timer service" +DESCRIPTION = "The FRB2 timer service will monitor the mailbox register 0\ +and start a watchdog for FRB2 if the data is 1(BIOS will write this value)" + +SRC_URI = "\ + file://CMakeLists.txt \ + file://frb2-watchdog.cpp \ + " +PV = "0.1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${IBSBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +S = "${WORKDIR}" + +inherit cmake +inherit pkgconfig + +DEPENDS += " \ + systemd \ + sdbusplus \ + sdbusplus-native \ + phosphor-logging \ + phosphor-dbus-interfaces \ + phosphor-dbus-interfaces-native \ + boost \ + " + +RDEPENDS:${PN} += " \ + libsystemd \ + sdbusplus \ + phosphor-logging \ + phosphor-dbus-interfaces \ + " diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/.clang-format b/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/.clang-format new file mode 100644 index 0000000000..dd27708378 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/.clang-format @@ -0,0 +1,98 @@ +--- +Language: Cpp +# BasedOnStyle: LLVM +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlinesLeft: false +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: false +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterClass: true + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: true + AfterStruct: true + AfterUnion: true + BeforeCatch: true + BeforeElse: true + IndentBraces: false +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Custom +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: AfterColon +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: true +PointerAlignment: Left +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^[<"](gtest|gmock)' + Priority: 5 + - Regex: '^"config.h"' + Priority: -1 + - Regex: '^".*\.hpp"' + Priority: 1 + - Regex: '^<.*\.h>' + Priority: 2 + - Regex: '^<.*' + Priority: 3 + - Regex: '.*' + Priority: 4 +IndentCaseLabels: true +IndentWidth: 4 +IndentWrappedFunctionNames: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Right +ReflowComments: true +SortIncludes: true +SpaceAfterCStyleCast: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp11 +TabWidth: 4 +UseTab: Never +... diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/CMakeLists.txt b/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/CMakeLists.txt new file mode 100644 index 0000000000..bd5567d31a --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required (VERSION 3.5 FATAL_ERROR) +project (frb2-watchdog CXX) +set (CMAKE_CXX_STANDARD 17) +set (CMAKE_CXX_STANDARD_REQUIRED ON) +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") + +include_directories (${CMAKE_CURRENT_SOURCE_DIR}) + +# boost support +find_package (Boost REQUIRED) +# pkg_check_modules(Boost boost REQUIRED) +include_directories (${Boost_INCLUDE_DIRS}) +add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY) +add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED) +add_definitions (-DBOOST_ALL_NO_LIB) +add_definitions (-DBOOST_NO_RTTI) +add_definitions (-DBOOST_NO_TYPEID) +add_definitions (-DBOOST_ASIO_DISABLE_THREADS) + +# import libsystemd +find_package (PkgConfig REQUIRED) +pkg_check_modules (SYSTEMD libsystemd REQUIRED) +include_directories (${SYSTEMD_INCLUDE_DIRS}) +link_directories (${SYSTEMD_LIBRARY_DIRS}) + +# import sdbusplus +find_package (PkgConfig REQUIRED) +pkg_check_modules (SDBUSPLUSPLUS sdbusplus REQUIRED) +include_directories (${SDBUSPLUSPLUS_INCLUDE_DIRS}) +link_directories (${SDBUSPLUSPLUS_LIBRARY_DIRS}) + +# import phosphor-logging +find_package (PkgConfig REQUIRED) +pkg_check_modules (LOGGING phosphor-logging REQUIRED) +include_directories (${LOGGING_INCLUDE_DIRS}) +link_directories (${LOGGING_LIBRARY_DIRS}) + +# import phosphor-dbus-interfaces +find_package (PkgConfig REQUIRED) +pkg_check_modules (DBUSINTERFACE phosphor-dbus-interfaces REQUIRED) +include_directories (${DBUSINTERFACE_INCLUDE_DIRS}) +link_directories (${DBUSINTERFACE_LIBRARY_DIRS}) + +add_executable (frb2-watchdog frb2-watchdog.cpp) + +target_link_libraries (${PROJECT_NAME} systemd) +target_link_libraries (${PROJECT_NAME} ${Boost_LIBRARIES}) +target_link_libraries (${PROJECT_NAME} ${SDBUSPLUSPLUS_LIBRARIES}) +target_link_libraries (${PROJECT_NAME} ${DBUSINTERFACE_LIBRARIES} + phosphor_logging) +install (TARGETS frb2-watchdog DESTINATION bin) diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/cmake-format.json b/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/cmake-format.json new file mode 100644 index 0000000000..583c255a33 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/cmake-format.json @@ -0,0 +1,12 @@ +{ + "enum_char": ".", + "line_ending": "unix", + "bullet_char": "*", + "max_subargs_per_line": 99, + "command_case": "lower", + "tab_size": 4, + "line_width": 80, + "separate_fn_name_with_space": true, + "dangle_parens": true, + "separate_ctrl_name_with_space": true +}
\ No newline at end of file diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/frb2-watchdog.cpp b/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/frb2-watchdog.cpp new file mode 100644 index 0000000000..792e564d9c --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/frb2-watchdog/frb2-watchdog.cpp @@ -0,0 +1,257 @@ +/* Copyright 2018 Intel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <fcntl.h> +#include <stdlib.h> +#include <sys/ioctl.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> + +#include <boost/container/flat_set.hpp> +#include <cassert> +#include <cstdint> +#include <cstring> +#include <iostream> +#include <memory> +#include <optional> +#include <phosphor-logging/log.hpp> +#include <sdbusplus/asio/object_server.hpp> +#include <sdbusplus/bus.hpp> +#include <sdbusplus/bus/match.hpp> +#include <sdbusplus/message.hpp> +#include <sdbusplus/timer.hpp> +#include <vector> +#include <xyz/openbmc_project/State/Watchdog/server.hpp> + +void handleResponse(const boost::system::error_code &err, + std::size_t bytes_transferred); + +static int mailboxDevFd = -1; + +static boost::asio::io_service io; +static auto conn = std::make_shared<sdbusplus::asio::connection>(io); +boost::asio::ip::tcp::socket mailBoxDevSocket(io); +boost::asio::deadline_timer pollTimer(io); +boost::asio::posix::stream_descriptor inputDevice(io); + +// mailbox registre data[0:0] for FRB2 enable bit +boost::asio::streambuf readBuf(1); +std::string dataRead; + +// FRB2 watchdog timeout is 6 minutes +static constexpr unsigned int frb2TimerIntervalMs = 360 * 1000; + +// mailbox device polling time interval is 2 seconds +static constexpr unsigned int pollMs = 2000; + +static constexpr unsigned int frb2Started = 1; +static constexpr unsigned int frb2Stopped = 0; + +// FRB2 status +static uint8_t frb2Status = frb2Stopped; + +static constexpr const char *mailboxDevName = "/dev/aspeed-mbox"; + +static constexpr const char frb2Bus[] = "xyz.openbmc_project.FRB2"; +static constexpr const char frb2Obj[] = "/xyz/openbmc_project/FRB2"; +static constexpr const char frb2Intf[] = "xyz.openbmc_project.FRB2"; + +static constexpr char powerBus[] = "xyz.openbmc_project.Chassis.Control.Power"; +static constexpr char powerPath[] = + "/xyz/openbmc_project/Chassis/Control/Power0"; +static constexpr char powerIntf[] = "xyz.openbmc_project.Chassis.Control.Power"; + +static constexpr char wdBus[] = "xyz.openbmc_project.Watchdog"; +static constexpr char wdPath[] = "/xyz/openbmc_project/watchdog/host0"; +static constexpr char wdIntf[] = "xyz.openbmc_project.State.Watchdog"; +static constexpr char propIntf[] = "org.freedesktop.DBus.Properties"; + +typedef boost::asio::buffers_iterator<boost::asio::const_buffers_1> iterator; + +// check if FRB2 bit is 0x1 +std::pair<iterator, bool> matchFRB2(iterator begin, iterator end) +{ + unsigned char ch = 0; + iterator i = begin; + + while (i != end) + { + ch = static_cast<unsigned char>(*i); + if (ch & 0x1) + { + return std::make_pair(i, true); + } + i++; + } + + return std::make_pair(i, false); +} + +static void startRead() +{ + boost::asio::async_read_until(inputDevice, readBuf, matchFRB2, + [&](const boost::system::error_code &ec, + std::size_t bytes_transferred) { + handleResponse(ec, bytes_transferred); + }); +} + +template <typename T> void setProperty(const std::string &key, const T &val) +{ + phosphor::logging::log<phosphor::logging::level::DEBUG>( + "setProperty", phosphor::logging::entry("KEY=%s", key.c_str())); + + try + { + conn->async_method_call( + [](const boost::system::error_code &err) { + if (err) + { + phosphor::logging::log<phosphor::logging::level::ERR>( + "async_method_call error!", + phosphor::logging::entry( + "ERROR=%s", + boost::system::system_error(err).what())); + } + }, + wdBus, wdPath, propIntf, "Set", wdIntf, key, std::variant<T>(val)); + } + catch (sdbusplus::exception::SdBusError &e) + { + phosphor::logging::log<phosphor::logging::level::ERR>( + "Dbus error!", phosphor::logging::entry("ERROR=%s", e.what())); + } +} +void handleResponse(const boost::system::error_code &err, + std::size_t bytes_transferred) +{ + std::istream responseStream(&readBuf); + std::string response; + int n = 0; + uint64_t interval = frb2TimerIntervalMs; + + std::getline(responseStream, response); + responseStream.clear(); + + if (err == boost::system::errc::bad_file_descriptor) + { + + phosphor::logging::log<phosphor::logging::level::DEBUG>( + "bad file descriptor"); + return; // we're being destroyed + } + + if (!err) + { + // FRB2 is set by BIOS + if (frb2Stopped == frb2Status) + { + // start FRB2 watchdog + frb2Status = frb2Started; + phosphor::logging::log<phosphor::logging::level::DEBUG>( + "FRB2 enable, start FRB2 watchdog"); + setProperty( + "ExpireAction", + std::string( + "xyz.openbmc_project.State.Watchdog.Action.HardReset")); + setProperty("Interval", interval); + setProperty("TimeRemaining", interval); + setProperty("Initialized", true); + setProperty("Enabled", true); + } + } + else if (err == boost::asio::error::misc_errors::not_found) + { + // FRB2 is clear, stop FRB2 watchdog if it is started + if (frb2Started == frb2Status) + { + frb2Status = frb2Stopped; + phosphor::logging::log<phosphor::logging::level::DEBUG>( + "FRB2 is unset, stop FRB2 watchdog"); + setProperty("Enabled", false); + } + } + else + { + phosphor::logging::log<phosphor::logging::level::ERR>( + "handleResponse error!", + phosphor::logging::entry("ERROR=%s", + boost::system::system_error(err).what())); + } + + pollTimer.expires_from_now(boost::posix_time::milliseconds(pollMs)); + pollTimer.async_wait( + [](const boost::system::error_code &ec) { startRead(); }); +} + +int main(int argc, char **argv) +{ + phosphor::logging::log<phosphor::logging::level::DEBUG>( + "Monitor FRB2 signal"); + + sdbusplus::bus::match_t biosPostSignal( + static_cast<sdbusplus::bus::bus &>(*conn), + sdbusplus::bus::match::rules::type::signal() + + sdbusplus::bus::match::rules::member("PostCompleted") + + sdbusplus::bus::match::rules::path(powerPath) + + sdbusplus::bus::match::rules::interface(powerIntf), + [](sdbusplus::message::message &msg) { + uint8_t value = 0; + ssize_t rc = 0; + phosphor::logging::log<phosphor::logging::level::INFO>( + "BIOS post completed signal"); + // stop FRB2 and clean mailbox + value = 0; + rc = ::pwrite(mailboxDevFd, &value, 1, 0); + if (rc != 1) + { + phosphor::logging::log<phosphor::logging::level::ERR>( + "mailbox write error!"); + } + setProperty("Enabled", false); + frb2Status = frb2Stopped; + return; + }); + + conn->request_name(frb2Bus); + + auto server = sdbusplus::asio::object_server(conn); + + std::shared_ptr<sdbusplus::asio::dbus_interface> frb2Iface = + server.add_interface(frb2Obj, frb2Intf); + + frb2Iface->register_property("frb2Status", frb2Status); + + frb2Iface->initialize(); + + mailboxDevFd = ::open(mailboxDevName, O_RDWR | O_CLOEXEC); + if (mailboxDevFd < 0) + { + phosphor::logging::log<phosphor::logging::level::ERR>( + "mailbox device open fail!"); + return -1; + } + + inputDevice.assign(mailboxDevFd); + + startRead(); + + io.run(); + + ::close(mailboxDevFd); + + return 0; +} diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch b/meta-ibs/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch new file mode 100644 index 0000000000..14aeb56ba4 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch @@ -0,0 +1,348 @@ +From 854d461fc96bf4f76249e538065c4d1d9f61d3f8 Mon Sep 17 00:00:00 2001 +From: James Feist <james.feist@linux.intel.com> +Date: Mon, 17 Jun 2019 12:00:58 -0700 +Subject: [PATCH] Customize phosphor-watchdog for Intel platforms + +This patch adds various changes to phosphor-watchdog that are +required for compatibility with Intel platforms. + + 1. Add Redfish messages for watchdog timeout and pre-interrupt + 2. Use dbus properties for power control insted of service files + 3. Use host status to enable/disable watchdog + 4. Set preTimeoutInterruptOccurFlag + 5. Assign watchdog cause for correct reset cause reporting + 6. Add NMI Pre-Interrupt support for IPMI watchdog timer. + +Signed-off-by: James Feist <james.feist@linux.intel.com> +Signed-off-by: Ren Yu <yux.ren@intel.com> +Signed-off-by: Yong Li <yong.b.li@linux.intel.com> +Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com> +Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com> +Signed-off-by: Sunita Kumari <sunitax.kumari@intel.com> + +%% original patch: 0001-Customize-phosphor-watchdog-for-Intel-platforms.patch +--- + src/watchdog.cpp | 229 ++++++++++++++++++++++++++++++++++++++++++++--- + src/watchdog.hpp | 22 ++++- + 2 files changed, 240 insertions(+), 11 deletions(-) + +diff --git a/src/watchdog.cpp b/src/watchdog.cpp +index 05a95e9..ea94082 100644 +--- a/src/watchdog.cpp ++++ b/src/watchdog.cpp +@@ -5,8 +5,10 @@ + #include <phosphor-logging/elog.hpp> + #include <phosphor-logging/log.hpp> + #include <sdbusplus/exception.hpp> ++#include <systemd/sd-journal.h> + #include <string_view> + #include <xyz/openbmc_project/Common/error.hpp> ++#include <xyz/openbmc_project/State/Host/server.hpp> + + namespace phosphor + { +@@ -18,10 +20,86 @@ using namespace phosphor::logging; + + using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; + +-// systemd service to kick start a target. +-constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1"; +-constexpr auto SYSTEMD_ROOT = "/org/freedesktop/systemd1"; +-constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager"; ++const static constexpr char* currentHostState = "CurrentHostState"; ++const static constexpr char* hostStatusOff = ++ "xyz.openbmc_project.State.Host.HostState.Off"; ++ ++const static constexpr char* actionDescription = " due to Watchdog timeout"; ++const static constexpr char* hardResetDescription = "Hard Reset - System reset"; ++const static constexpr char* powerOffDescription = ++ "Power Down - System power down"; ++const static constexpr char* powerCycleDescription = ++ "Power Cycle - System power cycle"; ++const static constexpr char* timerExpiredDescription = "Timer expired"; ++ ++const static constexpr char* preInterruptActionNone = ++ "xyz.openbmc_project.State.Watchdog.PreTimeoutInterruptAction.None"; ++ ++const static constexpr char* preInterruptDescriptionSMI = "SMI"; ++const static constexpr char* preInterruptDescriptionNMI = "NMI"; ++const static constexpr char* preInterruptDescriptionMI = "Messaging Interrupt"; ++ ++const static constexpr char* reservedDescription = "Reserved"; ++ ++const static constexpr char* timerUseDescriptionBIOSFRB2 = "BIOS FRB2"; ++const static constexpr char* timerUseDescriptionBIOSPOST = "BIOS/POST"; ++const static constexpr char* timerUseDescriptionOSLoad = "OSLoad"; ++const static constexpr char* timerUseDescriptionSMSOS = "SMS/OS"; ++const static constexpr char* timerUseDescriptionOEM = "OEM"; ++ ++namespace restart ++{ ++static constexpr const char* busName = ++ "xyz.openbmc_project.Control.Host.RestartCause"; ++static constexpr const char* path = ++ "/xyz/openbmc_project/control/host0/restart_cause"; ++static constexpr const char* interface = ++ "xyz.openbmc_project.Control.Host.RestartCause"; ++static constexpr const char* property = "RequestedRestartCause"; ++} // namespace restart ++ ++// chassis state manager service ++namespace chassis ++{ ++static constexpr const char* busName = "xyz.openbmc_project.State.Chassis"; ++static constexpr const char* path = "/xyz/openbmc_project/state/chassis0"; ++static constexpr const char* interface = "xyz.openbmc_project.State.Chassis"; ++static constexpr const char* request = "RequestedPowerTransition"; ++} // namespace chassis ++ ++namespace host ++{ ++static constexpr const char* busName = "xyz.openbmc_project.State.Host"; ++static constexpr const char* path = "/xyz/openbmc_project/state/host0"; ++static constexpr const char* interface = "xyz.openbmc_project.State.Host"; ++static constexpr const char* request = "RequestedHostTransition"; ++} // namespace host ++ ++namespace nmi ++{ ++static constexpr const char* busName = "xyz.openbmc_project.Control.Host.NMI"; ++static constexpr const char* path = "/xyz/openbmc_project/control/host0/nmi"; ++static constexpr const char* interface = "xyz.openbmc_project.Control.Host.NMI"; ++static constexpr const char* request = "NMI"; ++ ++} // namespace nmi ++ ++void Watchdog::powerStateChangedHandler( ++ const std::map<std::string, std::variant<std::string>>& props) ++{ ++ const auto iter = props.find(currentHostState); ++ if (iter != props.end()) ++ { ++ const std::string* powerState = std::get_if<std::string>(&iter->second); ++ if (powerState && (*powerState == hostStatusOff)) ++ { ++ if (timerEnabled()) ++ { ++ enabled(false); ++ } ++ } ++ } ++} + + void Watchdog::resetTimeRemaining(bool enableWatchdog) + { +@@ -107,13 +185,111 @@ uint64_t Watchdog::interval(uint64_t value) + // Optional callback function on timer expiration + void Watchdog::timeOutHandler() + { ++ PreTimeoutInterruptAction preTimeoutInterruptAction = preTimeoutInterrupt(); ++ std::string preInterruptActionMessageArgs{}; ++ + Action action = expireAction(); ++ std::string actionMessageArgs{}; ++ ++ expiredTimerUse(currentTimerUse()); ++ ++ TimerUse timeUser = expiredTimerUse(); ++ std::string timeUserMessage{}; ++ + if (!this->enabled()) + { + action = fallback->action; + } + +- expiredTimerUse(currentTimerUse()); ++ switch (timeUser) ++ { ++ case Watchdog::TimerUse::BIOSFRB2: ++ timeUserMessage = timerUseDescriptionBIOSFRB2; ++ break; ++ case Watchdog::TimerUse::BIOSPOST: ++ timeUserMessage = timerUseDescriptionBIOSPOST; ++ break; ++ case Watchdog::TimerUse::OSLoad: ++ timeUserMessage = timerUseDescriptionOSLoad; ++ break; ++ case Watchdog::TimerUse::SMSOS: ++ timeUserMessage = timerUseDescriptionSMSOS; ++ break; ++ case Watchdog::TimerUse::OEM: ++ timeUserMessage = timerUseDescriptionOEM; ++ break; ++ default: ++ timeUserMessage = reservedDescription; ++ break; ++ } ++ ++ switch (action) ++ { ++ case Watchdog::Action::HardReset: ++ actionMessageArgs = std::string(hardResetDescription) + ++ std::string(actionDescription); ++ break; ++ case Watchdog::Action::PowerOff: ++ actionMessageArgs = std::string(powerOffDescription) + ++ std::string(actionDescription); ++ break; ++ case Watchdog::Action::PowerCycle: ++ actionMessageArgs = std::string(powerCycleDescription) + ++ std::string(actionDescription); ++ break; ++ case Watchdog::Action::None: ++ actionMessageArgs = timerExpiredDescription; ++ break; ++ default: ++ actionMessageArgs = reservedDescription; ++ break; ++ } ++ ++ // Log into redfish event log ++ sd_journal_send("MESSAGE=IPMIWatchdog: Timed out ACTION=%s", ++ convertForMessage(action).c_str(), "PRIORITY=%i", LOG_INFO, ++ "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.IPMIWatchdog", ++ "REDFISH_MESSAGE_ARGS=%s. timer use: %s", ++ actionMessageArgs.c_str(), timeUserMessage.c_str(), NULL); ++ ++ switch (preTimeoutInterruptAction) ++ { ++ case Watchdog::PreTimeoutInterruptAction::SMI: ++ preInterruptActionMessageArgs = preInterruptDescriptionSMI; ++ break; ++ case Watchdog::PreTimeoutInterruptAction::NMI: ++ preInterruptActionMessageArgs = preInterruptDescriptionNMI; ++ break; ++ case Watchdog::PreTimeoutInterruptAction::MI: ++ preInterruptActionMessageArgs = preInterruptDescriptionMI; ++ break; ++ default: ++ preInterruptActionMessageArgs = reservedDescription; ++ break; ++ } ++ ++ if (preInterruptActionNone != convertForMessage(preTimeoutInterruptAction)) ++ { ++ preTimeoutInterruptOccurFlag(true); ++ ++ sd_journal_send("MESSAGE=IPMIWatchdog: Pre Timed out Interrupt=%s", ++ convertForMessage(preTimeoutInterruptAction).c_str(), ++ "PRIORITY=%i", LOG_INFO, "REDFISH_MESSAGE_ID=%s", ++ "OpenBMC.0.1.IPMIWatchdog", ++ "REDFISH_MESSAGE_ARGS=Timer interrupt - %s due to " ++ "Watchdog timeout. timer use: %s", ++ preInterruptActionMessageArgs.c_str(), ++ timeUserMessage.c_str(), NULL); ++ ++ if (preTimeoutInterruptAction == ++ Watchdog::PreTimeoutInterruptAction::NMI) ++ { ++ sdbusplus::message::message preTimeoutInterruptHandler; ++ preTimeoutInterruptHandler = bus.new_method_call( ++ nmi::busName, nmi::path, nmi::interface, nmi::request); ++ bus.call_noreply(preTimeoutInterruptHandler); ++ } ++ } + + auto target = actionTargetMap.find(action); + if (target == actionTargetMap.end()) +@@ -146,12 +322,45 @@ void Watchdog::timeOutHandler() + + try + { +- auto method = bus.new_method_call(SYSTEMD_SERVICE, SYSTEMD_ROOT, +- SYSTEMD_INTERFACE, "StartUnit"); +- method.append(target->second); +- method.append("replace"); ++ sdbusplus::message::message method; ++ if (action == Watchdog::Action::HardReset) ++ { ++ auto method = bus.new_method_call( ++ restart::busName, restart::path, ++ "org.freedesktop.DBus.Properties", "Set"); ++ method.append( ++ restart::interface, restart::property, ++ std::variant<std::string>("xyz.openbmc_project.State.Host." ++ "RestartCause.WatchdogTimer")); ++ bus.call_noreply(method); + +- bus.call_noreply(method); ++ method = bus.new_method_call(host::busName, host::path, ++ "org.freedesktop.DBus.Properties", ++ "Set"); ++ method.append(host::interface, host::request, ++ std::variant<std::string>(target->second)); ++ bus.call_noreply(method); ++ } ++ else ++ { ++ if (action == Watchdog::Action::PowerCycle) ++ { ++ auto method = bus.new_method_call( ++ restart::busName, restart::path, ++ "org.freedesktop.DBus.Properties", "Set"); ++ method.append(restart::interface, restart::property, ++ std::variant<std::string>( ++ "xyz.openbmc_project.State.Host." ++ "RestartCause.WatchdogTimer")); ++ bus.call_noreply(method); ++ } ++ method = bus.new_method_call(chassis::busName, chassis::path, ++ "org.freedesktop.DBus.Properties", ++ "Set"); ++ method.append(chassis::interface, chassis::request, ++ std::variant<std::string>(target->second)); ++ bus.call_noreply(method); ++ } + } + catch (const sdbusplus::exception::exception& e) + { +diff --git a/src/watchdog.hpp b/src/watchdog.hpp +index 31cde63..2b7ff36 100644 +--- a/src/watchdog.hpp ++++ b/src/watchdog.hpp +@@ -73,7 +73,17 @@ class Watchdog : public WatchdogInherits + bus(bus), actionTargetMap(std::move(actionTargetMap)), + fallback(fallback), minInterval(minInterval), + timer(event, std::bind(&Watchdog::timeOutHandler, this)), +- objPath(objPath) ++ objPath(objPath), powerStateChangedSignal( ++ bus, ++ sdbusplus::bus::match::rules::propertiesChanged( ++ "/xyz/openbmc_project/state/host0", ++ "xyz.openbmc_project.State.Host"), ++ [this](sdbusplus::message::message& msg) { ++ std::string objectName; ++ std::map<std::string, std::variant<std::string>> props; ++ msg.read(objectName, props); ++ powerStateChangedHandler(props); ++ }) + { + // Use default if passed in otherwise just use default that comes + // with object +@@ -90,6 +100,12 @@ class Watchdog : public WatchdogInherits + tryFallbackOrDisable(); + } + ++ /** @brief Disable watchdog when power status change meet ++ * the specific requirement ++ */ ++ void powerStateChangedHandler( ++ const std::map<std::string, std::variant<std::string>>& props); ++ + /** @brief Resets the TimeRemaining to the configured Interval + * Optionally enables the watchdog. + * +@@ -178,6 +194,10 @@ class Watchdog : public WatchdogInherits + /** @brief Contained timer object */ + sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic> timer; + ++ /** @brief Optional Callback handler when power status change meet ++ * the specific requirement */ ++ sdbusplus::bus::match_t powerStateChangedSignal; ++ + /** @brief Optional Callback handler on timer expirartion */ + void timeOutHandler(); + +-- +2.35.1 + diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service b/meta-ibs/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service new file mode 100644 index 0000000000..6c069febec --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service @@ -0,0 +1,16 @@ +[Unit] +Description=Phosphor Watchdog + +[Service] +ExecStart=/usr/bin/env phosphor-watchdog --continue --service=xyz.openbmc_project.Watchdog \ + --path=/xyz/openbmc_project/watchdog/host0 \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=xyz.openbmc_project.State.Host.Transition.ForceWarmReboot \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=xyz.openbmc_project.State.Chassis.Transition.Off \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=xyz.openbmc_project.State.Chassis.Transition.PowerCycle + +SyslogIdentifier=phosphor-watchdog +BusName=xyz.openbmc_project.Watchdog +Type=dbus + +[Install] +WantedBy=basic.target diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend b/meta-ibs/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend new file mode 100644 index 0000000000..b6cbdac9c2 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend @@ -0,0 +1,9 @@ +FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" + +SRCREV = "90b400938fbed35040d9adf17c2af897b1046e12" +SRC_URI += "file://0001-Customize-phosphor-watchdog-for-Intel-platforms.patch \ + " + +# Remove the override to keep service running after DC cycle +SYSTEMD_OVERRIDE:${PN}:remove = "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf" +SYSTEMD_SERVICE:${PN} = "phosphor-watchdog.service" diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog.bb b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog.bb new file mode 100644 index 0000000000..4702f9f2e7 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog.bb @@ -0,0 +1,24 @@ +SUMMARY = "System watchdog" +DESCRIPTION = "BMC hardware watchdog service that is used to reset BMC \ + when unrecoverable events occurs" + +inherit allarch +inherit obmc-phosphor-systemd + +RDEPENDS:${PN} = "bash" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${IBSBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +SYSTEMD_SERVICE:${PN} += "system-watchdog.service" +SYSTEMD_ENVIRONMENT_FILE:${PN} += "obmc/system-watchdog/system-watchdog.conf" + +SYSTEMD_SERVICE:${PN} += "watchdog-reset@.service" +SYSTEMD_SERVICE:${PN} += "watchdog-clear-failures.service" +SYSTEMD_SERVICE:${PN} += "watchdog-clear-failures.timer" +SRC_URI += "file://watchdog-reset" + +do_install:append(){ + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/watchdog-reset ${D}${bindir} +} diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/obmc/system-watchdog/system-watchdog.conf b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/obmc/system-watchdog/system-watchdog.conf new file mode 100644 index 0000000000..defe830a1e --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/obmc/system-watchdog/system-watchdog.conf @@ -0,0 +1,3 @@ +TIMEOUT=60 +INTERVAL=10 +DEVICE=/dev/watchdog1 diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/system-watchdog.service b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/system-watchdog.service new file mode 100644 index 0000000000..1564fda207 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/system-watchdog.service @@ -0,0 +1,11 @@ +[Unit] +Description=BMC Hardware Watchdog Daemon + +[Service] +EnvironmentFile=/etc/default/obmc/system-watchdog/system-watchdog.conf +ExecStart=/sbin/watchdog -T ${{TIMEOUT}} -t ${{INTERVAL}} -F ${{DEVICE}} +KillSignal=SIGKILL + +[Install] +WantedBy=basic.target + diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-clear-failures.service b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-clear-failures.service new file mode 100644 index 0000000000..801f4ed273 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-clear-failures.service @@ -0,0 +1,10 @@ +[Unit] +Description=Reset BMC Hardware Watchdog Failure Count + +[Service] +ExecStart=busctl call xyz.openbmc_project.U_Boot.Environment.Manager \ + /xyz/openbmc_project/u_boot/environment/mgr \ + xyz.openbmc_project.U_Boot.Environment.Manager \ + Write ss bootfailures 0 +Type=oneshot + diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-clear-failures.timer b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-clear-failures.timer new file mode 100644 index 0000000000..1abac4326c --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-clear-failures.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Starts the clear watchdog serivce after 30 minutes + +[Timer] +OnBootSec=30min + +[Install] +WantedBy=timers.target diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-reset b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-reset new file mode 100644 index 0000000000..3413fdb9f3 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-reset @@ -0,0 +1,18 @@ +#!/bin/bash + +echo "Watchdog being started by $1" > /dev/kmsg + +if /sbin/fw_printenv bootfailures -n | grep -q 3; then + exit 0 # passed boot limit, user started again on purpose +fi + +if test -f "/tmp/nowatchdog"; then + echo "Not resetting due to nowatchdog file" > /dev/kmsg + exit 0 +fi + +echo "Log as follows:" > /dev/kmsg +journalctl -r -n 100 | while read line; do echo $line > /dev/kmsg; done + +systemctl stop system-watchdog.service +/sbin/watchdog -T 0 -F /dev/watchdog1 diff --git a/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-reset@.service b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-reset@.service new file mode 100644 index 0000000000..3d62cc0a89 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/watchdog/system-watchdog/watchdog-reset@.service @@ -0,0 +1,7 @@ +[Unit] +Description=Reset BMC Using Hardware Watchdog + +[Service] +ExecStart=/usr/bin/watchdog-reset %i +Type=oneshot + diff --git a/meta-ibs/meta-common/recipes-phosphor/webui/phosphor-webui/config.json b/meta-ibs/meta-common/recipes-phosphor/webui/phosphor-webui/config.json new file mode 100644 index 0000000000..1543a62494 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/webui/phosphor-webui/config.json @@ -0,0 +1,8 @@ +{ + "customKeyEnable": true, + "keyType" : "VT100+", + "customConsoleDisplaySize": { + "width": 100, + "height": 32 + } +} diff --git a/meta-ibs/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend b/meta-ibs/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend new file mode 100644 index 0000000000..ce0138bb21 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS:prepend:ibs := "${THISDIR}/${PN}:" + +SRC_URI:append:ibs = " file://config.json" + +do_compile:prepend:ibs() { + cp -r ${WORKDIR}/config.json ${S}/ +} + diff --git a/meta-ibs/meta-cp2-5422/conf/bblayers.conf.sample b/meta-ibs/meta-cp2-5422/conf/bblayers.conf.sample new file mode 100644 index 0000000000..7f46447184 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/conf/bblayers.conf.sample @@ -0,0 +1,23 @@ +# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +LCONF_VERSION = "8" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/meta-poky \ + ##OEROOT##/meta-openembedded/meta-oe \ + ##OEROOT##/meta-openembedded/meta-networking \ + ##OEROOT##/meta-openembedded/meta-perl \ + ##OEROOT##/meta-openembedded/meta-python \ + ##OEROOT##/meta-openembedded/meta-webserver \ + ##OEROOT##/meta-security \ + ##OEROOT##/meta-phosphor \ + ##OEROOT##/meta-aspeed \ + ##OEROOT##/meta-ibs \ + ##OEROOT##/meta-ibs/meta-common \ + ##OEROOT##/meta-ibs/meta-ast2500 \ + ##OEROOT##/meta-ibs/meta-cp2-5422 \ + " diff --git a/meta-ibs/meta-cp2-5422/conf/conf-notes.txt b/meta-ibs/meta-cp2-5422/conf/conf-notes.txt new file mode 100644 index 0000000000..071fc724e5 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/conf/conf-notes.txt @@ -0,0 +1,3 @@ +Common targets are: + obmc-phosphor-image + qemu-helper-native diff --git a/meta-ibs/meta-cp2-5422/conf/layer.conf b/meta-ibs/meta-cp2-5422/conf/layer.conf new file mode 100644 index 0000000000..0fbda955cf --- /dev/null +++ b/meta-ibs/meta-cp2-5422/conf/layer.conf @@ -0,0 +1,17 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "sila" +BBFILE_PATTERN_sila := "^${LAYERDIR}/" +BBFILE_PRIORITY_sila = "5" +BBFILE_PATTERN_IGNORE_EMPTY_sila = "1" + +LAYERSERIES_COMPAT_sila := "honister kirkstone" + +hostname:pn-base-files = "${MACHINE}" + +FACTORY:ibs:append = "sila" diff --git a/meta-ibs/meta-cp2-5422/conf/local.conf.sample b/meta-ibs/meta-cp2-5422/conf/local.conf.sample new file mode 100644 index 0000000000..1d2f7f82da --- /dev/null +++ b/meta-ibs/meta-cp2-5422/conf/local.conf.sample @@ -0,0 +1,274 @@ +# +# This file is your local configuration file and is where all local user settings +# are placed. The comments in this file give some guide to the options a new user +# to the system might want to change but pretty much any configuration option can +# be set in this file. More adventurous users can look at local.conf.extended +# which contains other examples of configuration which can be placed in this file +# but new users likely won't need any of them initially. +# +# Lines starting with the '#' character are commented out and in some cases the +# default values are provided as comments to show people example syntax. Enabling +# the option is a question of removing the # character and making any change to the +# variable as required. + +# +# Machine Selection +# +MACHINE ??= "cp2-5422" + +# +# Where to place downloads +# +# During a first build the system will download many different source code tarballs +# from various upstream projects. This can take a while, particularly if your network +# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you +# can preserve this directory to speed up this part of subsequent builds. This directory +# is safe to share between multiple builds on the same machine too. +# +# The default is a downloads directory under TOPDIR which is the build directory. +# +#DL_DIR ?= "${TOPDIR}/downloads" +#DL_DIR ?= "/home/akosteltsev/var/openbmc/downloads" +#DL_DIR ?= "/home/mzakharov/var/openbmc/downloads" +#DL_DIR ?= "/home/ailenko/var/openbmc/downloads" + +# +# Where to place shared-state files +# +# BitBake has the capability to accelerate builds based on previously built output. +# This is done using "shared state" files which can be thought of as cache objects +# and this option determines where those files are placed. +# +# You can wipe out TMPDIR leaving this directory intact and the build would regenerate +# from these files if no changes were made to the configuration. If changes were made +# to the configuration, only shared state files where the state was still valid would +# be used (done using checksums). +# +# The default is a sstate-cache directory under TOPDIR. +# +#SSTATE_DIR ?= "${TOPDIR}/sstate-cache" + +# +# Where to place the build output +# +# This option specifies where the bulk of the building work should be done and +# where BitBake should place its temporary files and output. Keep in mind that +# this includes the extraction and compilation of many applications and the toolchain +# which can use Gigabytes of hard disk space. +# +# The default is a tmp directory under TOPDIR. +# +#TMPDIR = "${TOPDIR}/tmp" + +# +# Default policy config +# +# The distribution setting controls which policy settings are used as defaults. +# The default value is fine for general Yocto project use, at least initially. +# Ultimately when creating custom policy, people will likely end up subclassing +# these defaults. +# +DISTRO ?= "openbmc-phosphor" +# As an example of a subclass there is a "bleeding" edge policy configuration +# where many versions are set to the absolute latest code from the upstream +# source control systems. This is just mentioned here as an example, its not +# useful to most new users. +# DISTRO ?= "poky-bleeding" + +# +# Package Management configuration +# +# This variable lists which packaging formats to enable. Multiple package backends +# can be enabled at once and the first item listed in the variable will be used +# to generate the root filesystems. +# Options are: +# - 'package_deb' for debian style deb files +# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager) +# - 'package_rpm' for rpm style packages +# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk" +# We default to ipk: +PACKAGE_CLASSES ?= "package_rpm" + +# +# SDK target architecture +# +# This variable specifies the architecture to build SDK items for and means +# you can build the SDK packages for architectures other than the machine you are +# running the build on (i.e. building i686 packages on an x86_64 host). +# Supported values are i686, x86_64, aarch64 +#SDKMACHINE ?= "i686" + +SANITY_TESTED_DISTROS:append ?= " *" + +# +# Extra image configuration defaults +# +# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated +# images. Some of these options are added to certain image types automatically. The +# variable can contain the following options: +# "dbg-pkgs" - add -dbg packages for all installed packages +# (adds symbol information for debugging/profiling) +# "src-pkgs" - add -src packages for all installed packages +# (adds source code for debugging) +# "dev-pkgs" - add -dev packages for all installed packages +# (useful if you want to develop against libs in the image) +# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages +# (useful if you want to run the package test suites) +# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.) +# "tools-debug" - add debugging tools (gdb, strace) +# "eclipse-debug" - add Eclipse remote debugging support +# "tools-profile" - add profiling tools (oprofile, lttng, valgrind) +# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.) +# "debug-tweaks" - make an image suitable for development +# e.g. ssh root access has a blank password +# There are other application targets that can be used here too, see +# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details. +# We default to enabling the debugging tweaks. +EXTRA_IMAGE_FEATURES ?= "debug-tweaks" +EXTRA_IMAGE_FEATURES += "validation-unsecure" + +# +# Additional image features +# +# The following is a list of additional classes to use when building images which +# enable extra features. Some available options which can be included in this variable +# are: +# - 'buildstats' collect build statistics +USER_CLASSES ?= "buildstats" + +# +# Runtime testing of images +# +# The build system can test booting virtual machine images under qemu (an emulator) +# after any root filesystems are created and run tests against those images. It can also +# run tests against any SDK that are built. To enable this uncomment these lines. +# See classes/test{image,sdk}.bbclass for further details. +#IMAGE_CLASSES += "testimage testsdk" +#TESTIMAGE_AUTO:qemuall = "1" + +# +# Interactive shell configuration +# +# Under certain circumstances the system may need input from you and to do this it +# can launch an interactive shell. It needs to do this since the build is +# multithreaded and needs to be able to handle the case where more than one parallel +# process may require the user's attention. The default is iterate over the available +# terminal types to find one that works. +# +# Examples of the occasions this may happen are when resolving patches which cannot +# be applied, to use the devshell or the kernel menuconfig +# +# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none +# Note: currently, Konsole support only works for KDE 3.x due to the way +# newer Konsole versions behave +#OE_TERMINAL = "auto" +# By default disable interactive patch resolution (tasks will just fail instead): +PATCHRESOLVE = "noop" + +# +# Disk Space Monitoring during the build +# +# Monitor the disk space during the build. If there is less that 1GB of space or less +# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully +# shutdown the build. If there is less than 100MB or 1K inodes, perform a hard abort +# of the build. The reason for this is that running completely out of space can corrupt +# files and damages the build in ways which may not be easily recoverable. +# It's necessary to monitor /tmp, if there is no space left the build will fail +# with very exotic errors. +BB_DISKMON_DIRS ??= "\ + STOPTASKS,${TMPDIR},1G,100K \ + STOPTASKS,${DL_DIR},1G,100K \ + STOPTASKS,${SSTATE_DIR},1G,100K \ + STOPTASKS,/tmp,100M,100K \ + HALT,${TMPDIR},100M,1K \ + HALT,${DL_DIR},100M,1K \ + HALT,${SSTATE_DIR},100M,1K \ + HALT,/tmp,10M,1K" + +# +# Shared-state files from other locations +# +# As mentioned above, shared state files are prebuilt cache data objects which can be +# used to accelerate build time. This variable can be used to configure the system +# to search other mirror locations for these objects before it builds the data itself. +# +# This can be a filesystem directory, or a remote url such as http or ftp. These +# would contain the sstate-cache results from previous builds (possibly from other +# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the +# cache locations to check for the shared objects. +# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH +# at the end as shown in the examples below. This will be substituted with the +# correct path within the directory structure. +#SSTATE_MIRRORS ?= "\ +#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ +#file://.* file:///some/local/dir/sstate/PATH" + +# +# Yocto Project SState Mirror +# +# The Yocto Project has prebuilt artefacts available for its releases, you can enable +# use of these by uncommenting the following line. This will mean the build uses +# the network to check for artefacts at the start of builds, which does slow it down +# equally, it will also speed up the builds by not having to build things if they are +# present in the cache. It assumes you can download something faster than you can build it +# which will depend on your network. +# +#SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/2.5/PATH;downloadfilename=PATH" + +# +# Qemu configuration +# +# By default native qemu will build with a builtin VNC server where graphical output can be +# seen. The line below enables the SDL UI frontend too. +PACKAGECONFIG:append:pn-qemu-system-native = " sdl" +# By default libsdl2-native will be built, if you want to use your host's libSDL instead of +# the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below. +#ASSUME_PROVIDED += "libsdl2-native" + +# You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds +# a handy set of menus for controlling the emulator. +#PACKAGECONFIG:append:pn-qemu-system-native = " gtk+" + +# +# Hash Equivalence +# +# Enable support for automatically running a local hash equivalence server and +# instruct bitbake to use a hash equivalence aware signature generator. Hash +# equivalence improves reuse of sstate by detecting when a given sstate +# artifact can be reused as equivalent, even if the current task hash doesn't +# match the one that generated the artifact. +# +# A shared hash equivalent server can be set with "<HOSTNAME>:<PORT>" format +# +#BB_HASHSERVE = "auto" +#BB_SIGNATURE_HANDLER = "OEEquivHash" + +# +# Memory Resident Bitbake +# +# Bitbake's server component can stay in memory after the UI for the current command +# has completed. This means subsequent commands can run faster since there is no need +# for bitbake to reload cache files and so on. Number is in seconds, after which the +# server will shut down. +# +#BB_SERVER_TIMEOUT = "60" + +# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to +# track the version of this file when it was generated. This can safely be ignored if +# this doesn't mean anything to you. +CONF_VERSION = "3" + +INHERIT += "extrausers" + +# +# Default root password '0penBmc' is set by meta-phosphor/conf/distro/include/phosphor-defaults.inc +# + +# +# Add default administrative account (login: admin, password: '0penBmc'): +# +DEFAULT_ADMIN_PASSWORD = "'\$6\$IBS\$3umMGtoW.bu0HC9HOGQZLgBKumD/XVW4Kg0l8l5tvnX1vEnqX/fCOoiUv4tzWotVQXKeE6.j92AqZEXr3JRTc.'" + +EXTRA_USERS_PARAMS:append:pn-obmc-phosphor-image = " \ + useradd -p ${DEFAULT_ADMIN_PASSWORD} -g users -G priv-admin,web,redfish,ipmi -N admin; \ + " diff --git a/meta-ibs/meta-cp2-5422/conf/machine/cp2-5422.conf b/meta-ibs/meta-cp2-5422/conf/machine/cp2-5422.conf new file mode 100644 index 0000000000..893dcc3fce --- /dev/null +++ b/meta-ibs/meta-cp2-5422/conf/machine/cp2-5422.conf @@ -0,0 +1 @@ +require conf/machine/include/sila-ast2500.inc diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console/obmc-console.conf b/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console/obmc-console.conf new file mode 100644 index 0000000000..1d332e2a21 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console/obmc-console.conf @@ -0,0 +1,3 @@ +baud = 921600 +local-tty = ttyS3 +local-tty-baud = 921600 diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console/obmc-console@.service b/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console/obmc-console@.service new file mode 100644 index 0000000000..38a16c3168 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console/obmc-console@.service @@ -0,0 +1,22 @@ +[Unit] +Description=Phosphor Console Muxer listening on device /dev/%I +ConditionPathExists=/etc/obmc-console/server.%i.conf +BindsTo=dev-%i.device +After=dev-%i.device + +[Service] +ExecStartPre=/usr/bin/sol-option-check.sh +ExecStartPre=/bin/sh -c 'echo -n "uart3" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart-routing/uart1' +ExecStartPre=/bin/sh -c 'echo -n "uart1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart-routing/uart3' +ExecStartPre=/bin/sh -c 'echo -n "io1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart-routing/uart4' +ExecStartPre=/bin/sh -c 'echo -n "uart4" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart-routing/io1' +ExecStart=/usr/bin/env obmc-console-server --config {sysconfdir}/obmc-console.conf %i +ExecStopPost=/bin/sh -c 'echo -n "io1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart-routing/uart1' +ExecStopPost=/bin/sh -c 'echo -n "io3" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart-routing/uart3' +ExecStopPost=/bin/sh -c 'echo -n "io4" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart-routing/uart4' +ExecStopPost=/bin/sh -c 'echo -n "uart1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart-routing/io1' +SyslogIdentifier=%i-console-server +Restart=always + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console/sol-option-check.sh b/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console/sol-option-check.sh new file mode 100755 index 0000000000..19179c4975 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console/sol-option-check.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Copyright 2017-2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +CPUPART="CPU part" +AST2500_ID="0xb76" +AST2600_ID="0xc07" + +if ([ $(grep "$CPUPART" /proc/cpuinfo | grep "$AST2500_ID" | wc -l) != 0 ] && \ + [ $(grep 192000000 /sys/class/tty/ttyS0/uartclk | wc -l) != 0 ]) || \ + ([ $(grep "$CPUPART" /proc/cpuinfo | grep "$AST2600_ID" | wc -l) != 0 ] && \ + [ $(grep 14769216 /sys/class/tty/ttyS0/uartclk | wc -l) != 0 ]); then + echo "hs-uart" + sed -i -e 's/115200/921600/g' /etc/obmc-console.conf +else + echo "normal uart" + sed -i -e 's/921600/115200/g' /etc/obmc-console.conf +fi diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console_%.bbappend new file mode 100644 index 0000000000..d9ff90d9c6 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/console/obmc-console_%.bbappend @@ -0,0 +1,17 @@ +FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" +OBMC_CONSOLE_HOST_TTY = "ttyVUART0" +SRC_URI += "file://sol-option-check.sh \ + file://obmc-console@.service \ + " +inherit obmc-phosphor-systemd + +SYSTEMD_SERVICE:${PN} += " \ + ${PN}@${OBMC_CONSOLE_HOST_TTY}.service \ + " + +do_install:append() { + rm -rf ${D}${base_libdir}/udev/rules.d/80-obmc-console-uart.rules + install -m 0644 ${WORKDIR}/${PN}@.service ${D}${systemd_system_unitdir} + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/sol-option-check.sh ${D}${bindir} +} diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager_%.bbappend new file mode 100644 index 0000000000..04f574b10b --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/flash/phosphor-software-manager_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +PACKAGECONFIG:append = " verify_signature" diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/fru/default-fru.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/fru/default-fru.bbappend new file mode 100644 index 0000000000..cef8105da3 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/fru/default-fru.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append = " file://decodeBoardID.sh;subdir=${BP}" diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/fru/default-fru/decodeBoardID.sh b/meta-ibs/meta-cp2-5422/recipes-phosphor/fru/default-fru/decodeBoardID.sh new file mode 100644 index 0000000000..98b4c98441 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/fru/default-fru/decodeBoardID.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# this script uses the BOARD_ID set from checkFru.sh and provides the NAME, +# PRODID, and EEPROM_FRU values for this platform +decode_board_id() { + if grep -q 'CPU part\s*: 0xb76' /proc/cpuinfo; then + # AST2500 + if [ -f $fruFile -a -f $prodIDFile -a $BOARD_ID -ne 0 ]; then + exit 0 + fi + NAME="CP2-5422" + PRODID="0x7b" + fi +} diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend new file mode 100644 index 0000000000..ce7bc597ae --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend @@ -0,0 +1,11 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +EXTRA_OEMESON += "\ + -Dredfish-allow-deprecated-power-thermal=disabled \ + -Dredfish-new-powersubsystem-thermalsubsystem=enabled \ + -Dredfish-host-logger=enabled \ + -Dredfish-dump-log=enabled \ + -Dredfish-dbus-log=enabled \ + -Dvm-nbdproxy=enabled \ + -Dhttp-body-limit=70 \ + " diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/logging/phosphor-hostlogger/cp2-5422/ttyVUART0.conf b/meta-ibs/meta-cp2-5422/recipes-phosphor/logging/phosphor-hostlogger/cp2-5422/ttyVUART0.conf new file mode 100644 index 0000000000..c75186415a --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/logging/phosphor-hostlogger/cp2-5422/ttyVUART0.conf @@ -0,0 +1,7 @@ +SOCKET_ID= +BUF_MAXSIZE=3000 +BUF_MAXTIME=0 +FLUSH_FULL=false +HOST_STATE=/xyz/openbmc_project/state/host0 +OUT_DIR=/var/lib/obmc/hostlogs +MAX_FILES=10 diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/logging/phosphor-hostlogger_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/logging/phosphor-hostlogger_%.bbappend new file mode 100644 index 0000000000..a8366ea8d6 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/logging/phosphor-hostlogger_%.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/${MACHINE}:" + +# Default service instance to install (single-host mode) +DEFAULT_INSTANCE = "ttyVUART0" + +SRC_URI:remove = "file://${BPN}.conf" +SRC_URI += "file://ttyVUART0.conf" + diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend new file mode 100644 index 0000000000..ca35bcb6a1 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG:append = " log-threshold log-pulse" diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json b/meta-ibs/meta-cp2-5422/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json new file mode 100644 index 0000000000..913a3e6df0 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json @@ -0,0 +1,47 @@ +{ + "gpio_configs": { + + "power_config": { + "power_good_in": "PGOOD", + "power_up_outs": [ + {"name": "POWER_OUT", "polarity": true} + ], + "reset_outs": [ + {"name": "RESET_OUT", "polarity": false} + ] + } + }, + + "gpio_definitions": [ + { + "name": "PGOOD", + "pin": "AB3", + "direction": "in" + }, + { + "name": "POWER_BUTTON", + "pin": "E2", + "direction": "both" + }, + { + "name": "POWER_OUT", + "pin": "E3", + "direction": "out" + }, + { + "name": "RESET_BUTTON", + "pin": "E0", + "direction": "both" + }, + { + "name": "RESET_OUT", + "pin": "E1", + "direction": "out" + }, + { + "name": "ID_BTN", + "pin": "AB2", + "direction": "both" + } + ] +} diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/skeleton/obmc-libobmc-intf_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/skeleton/obmc-libobmc-intf_%.bbappend new file mode 100644 index 0000000000..94d062959a --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/skeleton/obmc-libobmc-intf_%.bbappend @@ -0,0 +1 @@ +FILESEXTRAPATHS:prepend:ibs := "${THISDIR}/${PN}:" diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/virtual-media/virtual-media.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/virtual-media/virtual-media.bbappend new file mode 100644 index 0000000000..5925b776aa --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/virtual-media/virtual-media.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "\ + file://0001-VM-include-fstream-header.patch \ + " + +RDEPENDS:${PN}:append = " nfs-utils-mount" diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/virtual-media/virtual-media/0001-VM-include-fstream-header.patch b/meta-ibs/meta-cp2-5422/recipes-phosphor/virtual-media/virtual-media/0001-VM-include-fstream-header.patch new file mode 100644 index 0000000000..44f5b55f2f --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/virtual-media/virtual-media/0001-VM-include-fstream-header.patch @@ -0,0 +1,50 @@ +From 7bd55a821af91f1d804393435dc32dca57fad3f7 Mon Sep 17 00:00:00 2001 +From: "Andrey V.Kosteltsev" <AKosteltsev@IBS.RU> +Date: Sun, 22 May 2022 23:46:35 +0300 +Subject: [PATCH] VM: include <fstream> header + +--- + src/state/activating_state.cpp | 1 + + src/system.hpp | 1 + + src/utils.hpp | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/src/state/activating_state.cpp b/src/state/activating_state.cpp +index 7143545..1098192 100644 +--- a/src/state/activating_state.cpp ++++ b/src/state/activating_state.cpp +@@ -13,6 +13,7 @@ + #include <boost/process.hpp> + #include <boost/system/detail/error_code.hpp> + #include <filesystem> ++#include <fstream> + #include <iostream> + #include <memory> + #include <nlohmann/json.hpp> +diff --git a/src/system.hpp b/src/system.hpp +index ea88e25..d0af549 100644 +--- a/src/system.hpp ++++ b/src/system.hpp +@@ -8,6 +8,7 @@ + #include <boost/container/flat_map.hpp> + #include <boost/process.hpp> + #include <filesystem> ++#include <fstream> + #include <sdbusplus/asio/object_server.hpp> + + namespace fs = std::filesystem; +diff --git a/src/utils.hpp b/src/utils.hpp +index db9f325..1c03aa0 100644 +--- a/src/utils.hpp ++++ b/src/utils.hpp +@@ -9,6 +9,7 @@ + #include <boost/process/async_pipe.hpp> + #include <boost/type_traits/has_dereference.hpp> + #include <filesystem> ++#include <fstream> + #include <memory> + #include <optional> + #include <sdbusplus/asio/object_server.hpp> +-- +2.35.1 + diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/phosphor-webui/config.json b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/phosphor-webui/config.json new file mode 100644 index 0000000000..348a7792df --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/phosphor-webui/config.json @@ -0,0 +1,9 @@ +{ + "customKeyEnable": true, + "keyType" : "VT100+", + "customConsoleDisplaySize": { + "width": 100, + "height": 32 + }, + "VirtualMediaEnabled" : true +} diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/phosphor-webui/favicon.ico b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/phosphor-webui/favicon.ico Binary files differnew file mode 100644 index 0000000000..c287048077 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/phosphor-webui/favicon.ico diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/phosphor-webui_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/phosphor-webui_%.bbappend new file mode 100644 index 0000000000..1e22d05503 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/phosphor-webui_%.bbappend @@ -0,0 +1,13 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/${MACHINE}:" + +SRC_URI += "\ + file://favicon.ico \ + " + +do_update_logo () { + cp ${WORKDIR}/favicon.ico \ + ${S}/app/assets/images/. +} + +addtask update_logo after do_unpack before do_configure diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/.env.sila b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/.env.sila new file mode 100644 index 0000000000..52a1cc7b76 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/.env.sila @@ -0,0 +1,11 @@ +NODE_ENV=production +VUE_APP_COMPANY_NAME="IBS" +VUE_APP_GUI_NAME="BMC System Management" +VUE_APP_SUBSCRIBE_SOCKET_DISABLED="true" +VUE_APP_SWITCH_TO_BACKUP_IMAGE_DISABLED="true" +VUE_APP_MODIFY_SSH_POLICY_DISABLED="true" +VUE_APP_VIRTUAL_MEDIA_LIST_ENABLED="true" +CUSTOM_STYLES="true" +CUSTOM_APP_NAV="true" +CUSTOM_STORE="true" +CUSTOM_ROUTER="true" diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/0001-Set-login-brand-width.patch b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/0001-Set-login-brand-width.patch new file mode 100644 index 0000000000..bdcb8ddc7f --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/0001-Set-login-brand-width.patch @@ -0,0 +1,36 @@ +From 4d8254ef05b5dba035940f3194ef09f1a8770dc9 Mon Sep 17 00:00:00 2001 +From: "Andrey V.Kosteltsev" <AKosteltsev@IBS.RU> +Date: Wed, 16 Mar 2022 03:55:19 +0300 +Subject: [PATCH] Set login brand width + +--- + src/layouts/LoginLayout.vue | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/layouts/LoginLayout.vue b/src/layouts/LoginLayout.vue +index cdff204..46939e1 100644 +--- a/src/layouts/LoginLayout.vue ++++ b/src/layouts/LoginLayout.vue +@@ -5,7 +5,7 @@ + <div> + <div class="login-brand mb-5"> + <img +- width="90px" ++ width="60%" + src="@/assets/images/login-company-logo.svg" + :alt="altLogo" + /> +@@ -22,8 +22,8 @@ + </div> + <div class="login-aside__logo-bmc"> + <img +- height="60px" +- src="@/assets/images/built-on-openbmc-logo.svg" ++ height="24px" ++ src="@/assets/images/login-company-logo.svg" + alt="Built on OpenBMC" + /> + </div> +-- +2.33.0 + diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/favicon.ico b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/favicon.ico Binary files differnew file mode 100644 index 0000000000..1014ebd9c6 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/favicon.ico diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/login-company-logo.svg b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/login-company-logo.svg new file mode 100644 index 0000000000..57d11ff43c --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/login-company-logo.svg @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="220px" height="50px" viewBox="0 0 89 13" + version="1.1"> + <style type="text/css"> + .st0{fill:#e11717;} + </style> + <g id="surface1"> + <path class="st0" style=" stroke:none;fill-rule:nonzero;fill-opacity:1;" d="M 5.648438 3.261719 C 5.351562 3.253906 5.0625 3.363281 4.847656 3.566406 C 4.628906 3.773438 4.503906 4.054688 4.496094 4.351562 L 4.496094 8.160156 C 4.511719 8.773438 5.019531 9.261719 5.636719 9.246094 L 19.867188 9.246094 L 19.867188 12.960938 L 3.414062 12.960938 C 1.578125 13 0.0625 11.542969 0.0195312 9.710938 C -0.0273438 9.664062 0.0195312 3.28125 0.0195312 3.28125 C 0.0625 1.449219 1.578125 -0.0078125 3.414062 0.03125 L 19.867188 0.03125 L 19.867188 3.261719 Z M 5.648438 3.261719 "/> + <path class="st0" style=" stroke:none;fill-rule:nonzero;fill-opacity:1;" d="M 38.398438 0.0390625 L 28.191406 9.738281 L 28.191406 3.199219 L 30.476562 3.195312 L 30.476562 0.0390625 L 23.609375 0.0390625 L 23.609375 12.96875 L 29.929688 12.96875 L 39.78125 3.296875 L 39.78125 12.96875 L 44.269531 12.96875 L 44.269531 0.0390625 Z M 38.398438 0.0390625 "/> + <path class="st0" style=" stroke:none;fill-rule:nonzero;fill-opacity:1;" d="M 59.210938 0.0390625 L 50.109375 0.0390625 L 50.109375 3.226562 L 51.542969 3.226562 L 46.457031 12.96875 L 50.761719 12.96875 L 55.828125 3.269531 L 57.519531 3.269531 L 62.582031 12.96875 L 67.132812 12.96875 L 60.347656 0.0390625 Z M 59.210938 0.0390625 "/> + <path class="st0" style=" stroke:none;fill-rule:nonzero;fill-opacity:1;" d="M 82.214844 0.0390625 L 72.0625 0.0390625 L 72.0625 3.226562 L 73.410156 3.226562 L 68.34375 12.96875 L 72.648438 12.96875 L 73.46875 11.347656 L 83.597656 11.347656 L 84.441406 12.96875 L 88.996094 12.96875 Z M 75.160156 8.117188 L 77.6875 3.261719 L 79.378906 3.261719 L 81.910156 8.109375 Z M 75.160156 8.117188 "/> + </g> +</svg> diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/logo-header.svg b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/logo-header.svg new file mode 100644 index 0000000000..60eed5870d --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue/logo-header.svg @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="90px" height="32px" viewBox="0 0 89 13" + version="1.1"> + <style type="text/css"> + .st0{fill:#e11717;} + </style> + <g id="surface1"> + <path class="st0" style=" stroke:none;fill-rule:nonzero;fill-opacity:1;" d="M 5.648438 3.261719 C 5.351562 3.253906 5.0625 3.363281 4.847656 3.566406 C 4.628906 3.773438 4.503906 4.054688 4.496094 4.351562 L 4.496094 8.160156 C 4.511719 8.773438 5.019531 9.261719 5.636719 9.246094 L 19.867188 9.246094 L 19.867188 12.960938 L 3.414062 12.960938 C 1.578125 13 0.0625 11.542969 0.0195312 9.710938 C -0.0273438 9.664062 0.0195312 3.28125 0.0195312 3.28125 C 0.0625 1.449219 1.578125 -0.0078125 3.414062 0.03125 L 19.867188 0.03125 L 19.867188 3.261719 Z M 5.648438 3.261719 "/> + <path class="st0" style=" stroke:none;fill-rule:nonzero;fill-opacity:1;" d="M 38.398438 0.0390625 L 28.191406 9.738281 L 28.191406 3.199219 L 30.476562 3.195312 L 30.476562 0.0390625 L 23.609375 0.0390625 L 23.609375 12.96875 L 29.929688 12.96875 L 39.78125 3.296875 L 39.78125 12.96875 L 44.269531 12.96875 L 44.269531 0.0390625 Z M 38.398438 0.0390625 "/> + <path class="st0" style=" stroke:none;fill-rule:nonzero;fill-opacity:1;" d="M 59.210938 0.0390625 L 50.109375 0.0390625 L 50.109375 3.226562 L 51.542969 3.226562 L 46.457031 12.96875 L 50.761719 12.96875 L 55.828125 3.269531 L 57.519531 3.269531 L 62.582031 12.96875 L 67.132812 12.96875 L 60.347656 0.0390625 Z M 59.210938 0.0390625 "/> + <path class="st0" style=" stroke:none;fill-rule:nonzero;fill-opacity:1;" d="M 82.214844 0.0390625 L 72.0625 0.0390625 L 72.0625 3.226562 L 73.410156 3.226562 L 68.34375 12.96875 L 72.648438 12.96875 L 73.46875 11.347656 L 83.597656 11.347656 L 84.441406 12.96875 L 88.996094 12.96875 Z M 75.160156 8.117188 L 77.6875 3.261719 L 79.378906 3.261719 L 81.910156 8.109375 Z M 75.160156 8.117188 "/> + </g> +</svg> diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue_%.bbappend new file mode 100644 index 0000000000..a254f3e022 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/webui/webui-vue_%.bbappend @@ -0,0 +1,31 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/${MACHINE}:" + +PR = "r1" +PV = "1.0+git${SRCPV}" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +SRC_URI = "git://git@git.sila.ru/srv/pub/scm/git/openbmc/webui-vue.git;branch=sila;protocol=ssh" +SRCREV = "35be8fba7201cd69218415fb453e39c13994b0c9" + +SRC_URI += "\ + file://.env.sila \ + file://favicon.ico \ + file://login-company-logo.svg \ + file://logo-header.svg \ + file://0001-Set-login-brand-width.patch \ + " + +do_update_logo () { + cp ${WORKDIR}/.env.sila ${S}/.env + + cp ${WORKDIR}/favicon.ico \ + ${S}/public/. + + cp ${WORKDIR}/login-company-logo.svg \ + ${WORKDIR}/logo-header.svg \ + ${S}/src/assets/images/. +} + +addtask update_logo after do_unpack before do_configure diff --git a/meta-ibs/meta-cp2-5422/recipes-x86/chassis/x86-power-control/power-config-host0.json b/meta-ibs/meta-cp2-5422/recipes-x86/chassis/x86-power-control/power-config-host0.json new file mode 100644 index 0000000000..126d2ef1a4 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-x86/chassis/x86-power-control/power-config-host0.json @@ -0,0 +1,87 @@ +{ + "gpio_configs":[ + { + "Name" : "IdButton", + "LineName" : "ID_BUTTON", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "NMIButton", + "LineName" : "NMI_BUTTON", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "NMIOut", + "LineName" : "NMI_OUT", + "Type" : "GPIO", + "Polarity" : "ActiveHigh" + }, + { + "Name" : "PostComplete", + "LineName" : "POST_COMPLETE", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "PowerButton", + "LineName" : "POWER_BUTTON", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "PowerOk", + "LineName" : "PS_PWROK", + "Type" : "GPIO", + "Polarity" : "ActiveHigh" + }, + { + "Name" : "PowerOut", + "LineName" : "POWER_OUT", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "ResetButton", + "LineName" : "RESET_BUTTON", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "ResetOut", + "LineName" : "RESET_OUT", + "Type" : "GPIO", + "Polarity" : "ActiveHigh" + }, + { + "Name" : "SioPowerGood", + "LineName" : "SIO_POWER_GOOD", + "Type" : "GPIO", + "Polarity" : "ActiveHigh" + }, + { + "Name" : "SioOnControl", + "LineName" : "SIO_ONCONTROL", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "SIOS5", + "LineName" : "SIO_S5", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + } + ], + "timing_configs":{ + "PowerPulseMs": 200, + "ForceOffPulseMs": 15000, + "ResetPulseMs": 500, + "PowerCycleMs": 5000, + "SioPowerGoodWatchdogMs": 12000, + "PsPowerOKWatchdogMs": 8000, + "GracefulPowerOffS": 300, + "WarmResetCheckMs": 500, + "PowerOffSaveMs": 7000 + } +} diff --git a/meta-ibs/meta-cp2-5422/recipes-x86/chassis/x86-power-control_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-x86/chassis/x86-power-control_%.bbappend new file mode 100644 index 0000000000..c0fe1dd726 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-x86/chassis/x86-power-control_%.bbappend @@ -0,0 +1,11 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI:append = " \ + file://power-config-host0.json \ +" + +RDEPENDS:${PN}:append = " bash" + +do_install:append() { + install -d ${D}${datadir}/${PN} + install -m 0644 ${WORKDIR}/power-config-host0.json ${D}${datadir}/${PN} +} diff --git a/meta-ibs/recipes-utilities/collectd/collectd_%.bbappend b/meta-ibs/recipes-utilities/collectd/collectd_%.bbappend new file mode 100644 index 0000000000..814f7a57b4 --- /dev/null +++ b/meta-ibs/recipes-utilities/collectd/collectd_%.bbappend @@ -0,0 +1,2 @@ +SYSTEMD_AUTO_ENABLE:${PN} = "disable" +EXTRA_OECONF += " --disable-notify_email --disable-notify_nagios --disable-apache --disable-apcups --disable-battery --disable-bind --disable-email --disable-hddtemp --disable-nginx --disable-infiniband --disable-openvpn --disable-zfs_arc --disable-teamspeak2" |