Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
+11
View File
@@ -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 += "vegman-layer"
BBFILE_PATTERN_vegman-layer := "^${LAYERDIR}/"
LAYERSERIES_COMPAT_vegman-layer := "langdale mickledore"
@@ -0,0 +1,40 @@
OVERRIDES .= ":vegman"
KMACHINE = "aspeed"
KERNEL_DEVICETREE = "${KMACHINE}-bmc-${MACHINE}.dtb"
UBOOT_MACHINE = "evb-ast2500_defconfig"
UBOOT_DEVICETREE = "ast2500-evb"
require conf/machine/include/ast2500.inc
include conf/machine/include/vegman-bsp.inc
require ${@bb.utils.contains('BSP_TYPE', 'vegman', '', 'conf/machine/include/obmc-bsp-common.inc', d)}
SERIAL_CONSOLES = "115200;ttyS3 115200;ttyS4"
FLASH_SIZE = "65536"
IMAGE_FEATURES += "allow-root-login"
MACHINE_FEATURES += " \
obmc-chassis-state-mgmt \
obmc-host-ipmi \
obmc-host-state-mgmt \
obmc-phosphor-chassis-mgmt \
obmc-phosphor-fan-mgmt \
obmc-phosphor-flash-mgmt \
"
VIRTUAL-RUNTIME_obmc-host-state-manager ?= "x86-power-control"
VIRTUAL-RUNTIME_obmc-chassis-state-manager ?= "x86-power-control"
VIRTUAL-RUNTIME_obmc-discover-system-state ?= "x86-power-control"
VIRTUAL-RUNTIME_obmc-sensors-hwmon ?= "dbus-sensors"
PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-yadro-apps"
PREFERRED_PROVIDER_virtual/obmc-fan-mgmt = "packagegroup-yadro-apps"
PREFERRED_PROVIDER_virtual/obmc-flash-mgmt = "packagegroup-yadro-apps"
PREFERRED_PROVIDER_virtual/obmc-system-mgmt = "packagegroup-yadro-apps"
PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw ?= "phosphor-ipmi-kcs"
PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "vegman-led-manager-config-native"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-aspeed-sdk"
PREFERRED_PROVIDER_u-boot = "u-boot-aspeed-sdk"
PREFERRED_PROVIDER_u-boot-fw-utils = "u-boot-fw-utils-aspeed-sdk"
@@ -0,0 +1,5 @@
require conf/machine/include/vegman.inc
# Apply all the machine override from the VEGMAN Sx20, because
# the TATLIN.ARCHIVE.xS have an exactly same hardware as the VEGMAN Sx20
MACHINEOVERRIDES .= ":vegman-sx20"
KERNEL_DEVICETREE = "${KMACHINE}-bmc-vegman-sx20.dtb"
@@ -0,0 +1 @@
require conf/machine/include/vegman.inc
@@ -0,0 +1,2 @@
require conf/machine/include/vegman.inc
PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "rx20-led-manager-config-native"
@@ -0,0 +1 @@
require conf/machine/include/vegman.inc
@@ -0,0 +1,18 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "8"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
##OEROOT##/meta \
##OEROOT##/meta-openembedded/meta-oe \
##OEROOT##/meta-openembedded/meta-networking \
##OEROOT##/meta-openembedded/meta-perl \
##OEROOT##/meta-openembedded/meta-python \
##OEROOT##/meta-phosphor \
##OEROOT##/meta-aspeed \
##OEROOT##/meta-yadro \
##OEROOT##/meta-yadro/meta-vegman \
"
@@ -0,0 +1,2 @@
Common targets are:
obmc-phosphor-image
@@ -0,0 +1,259 @@
#
# 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 ??= "vegman"
#
# 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"
#
# 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_ipk"
#
# 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"
#
# 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 = "2"
EXTRA_USERS_PARAMS:append:pn-obmc-phosphor-image = " \
useradd -g users -G priv-admin,web,redfish,ipmi -N admin; \
"
@@ -0,0 +1,46 @@
# ASPEED peripheral drivers
CONFIG_GPIO_ASPEED_SGPIO=y
CONFIG_ASPEED_LPC_SNOOP=y
CONFIG_ASPEED_UART_ROUTING=y
# Beeper
CONFIG_PWM=y
CONFIG_INPUT_PWM_BEEPER=y
# IPMB
CONFIG_IPMB_DEVICE_INTERFACE=y
# Ethernet
CONFIG_MICREL_PHY=y
CONFIG_NCSI_OEM_CMD_KEEP_PHY=y
# Sensors
CONFIG_SENSORS_MP2975=y
CONFIG_SENSORS_LM63=y
CONFIG_SENSORS_LM90=y
CONFIG_SENSORS_TMP401=y
# Other I2C periphery
CONFIG_GPIO_PCF857X=y
# FS
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
# Disable Power specific
CONFIG_FSI=n
CONFIG_SENSORS_OCC=n
CONFIG_SENSORS_OCC_P8_I2C=n
CONFIG_SENSORS_OCC_P9_SBE=n
@@ -0,0 +1,4 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += "\
file://vegman.cfg \
"
@@ -0,0 +1,4 @@
{
"buses": [0, 3, 4, 5, 6, 8, 9, 10, 12]
}
@@ -0,0 +1,8 @@
FILESEXTRAPATHS:append := ":${THISDIR}/${PN}"
SRC_URI:append = " \
file://blacklist.json \
"
do_install:append() {
install -m 0444 ${WORKDIR}/blacklist.json -D -t ${D}${datadir}/entity-manager
}
@@ -0,0 +1,23 @@
SUMMARY = "YAML configuration for VEGMAN"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit allarch
SRC_URI = " \
file://vegman-ipmi-sensors-static.yaml \
"
S = "${WORKDIR}"
do_install() {
install -m 0644 -D vegman-ipmi-sensors-static.yaml \
${D}${datadir}/${BPN}/ipmi-sensors-static.yaml
}
FILES:${PN}-dev = " \
${datadir}/${BPN}/ipmi-sensors-static.yaml \
"
ALLOW_EMPTY:${PN} = "1"
@@ -0,0 +1,17 @@
0x01:
entityID: 0x07
entityInstance: 1
sensorType: 0x21
path: /xyz/openbmc_project/led/groups/enclosure_identify_blink
sensorReadingType: 0x6F
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: assertion
sensorNamePattern: nameLeaf
interfaces:
xyz.openbmc_project.Led.Group:
Asserted:
Offsets:
0x00:
type: bool
assert: true
@@ -0,0 +1,3 @@
baud = 115200
local-tty = ttyS3
local-tty-baud = 115200
@@ -0,0 +1,14 @@
[Unit]
Description=Phosphor Console Muxer listening on device /dev/%I
BindsTo=dev-%i.device
After=dev-%i.device
[Service]
ExecStartPre=/usr/sbin/uart-remapping.sh init
ExecStart=obmc-console-server --config {sysconfdir}/obmc-console.conf %i
ExecStopPost=/usr/sbin/uart-remapping.sh reset
SyslogIdentifier=obmc-console-server
Restart=always
[Install]
WantedBy={SYSTEMD_DEFAULT_TARGET}
@@ -0,0 +1,33 @@
#!/bin/bash -eu
function usage()
{
echo "Usage: $(basename "$0") init|reset"
}
if [ "$#" -ne "1" ] ; then
usage
exit 1;
fi
cmd="${1}"
UART_ROUTING_PATH="/sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart-routing"
case "${cmd}" in
init)
echo -n "uart3" > ${UART_ROUTING_PATH}/uart1
echo -n "uart1" > ${UART_ROUTING_PATH}/uart3
echo -n "io1" > ${UART_ROUTING_PATH}/uart4
echo -n "uart4" > ${UART_ROUTING_PATH}/io1
;;
reset)
echo -n "io1" > ${UART_ROUTING_PATH}/uart1
echo -n "io3" > ${UART_ROUTING_PATH}/uart3
echo -n "io4" > ${UART_ROUTING_PATH}/uart4
echo -n "uart1" > ${UART_ROUTING_PATH}/io1
;;
*)
usage
exit 1;
;;
esac
@@ -0,0 +1,19 @@
FILESEXTRAPATHS:append := ":${THISDIR}/${PN}"
RDEPENDS:${PN} += "bash"
OBMC_CONSOLE_HOST_TTY = "ttyS2"
SRC_URI += " \
file://obmc-console@.service \
file://uart-remapping.sh \
"
inherit obmc-phosphor-systemd
SYSTEMD_SERVICE:${PN} += " \
${PN}@${OBMC_CONSOLE_HOST_TTY}.service \
"
do_install:append() {
rm -rf ${D}${nonarch_base_libdir}/udev/rules.d/80-obmc-console-uart.rules
install -m 0644 ${WORKDIR}/${PN}@.service -D -t ${D}${systemd_system_unitdir}
install -m 0755 ${WORKDIR}/uart-remapping.sh -D -t ${D}${sbindir}
}
@@ -0,0 +1 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
@@ -0,0 +1,178 @@
{
"0" : {
"name" : "Ipmb",
"is_valid" : true,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "ipmb",
"protocol_type" : "ipmb-1.0",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"1" : {
"name" : "eth0",
"is_valid" : true,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "lan-802.3",
"protocol_type" : "ipmb-1.0",
"session_supported" : "multi-session",
"is_ipmi" : true
}
},
"2" : {
"name" : "eth1",
"is_valid" : true,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "lan-802.3",
"protocol_type" : "ipmb-1.0",
"session_supported" : "multi-session",
"is_ipmi" : true
}
},
"3" : {
"name" : "RESERVED",
"is_valid" : false,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "reserved",
"protocol_type" : "na",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"4" : {
"name" : "RESERVED",
"is_valid" : false,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "reserved",
"protocol_type" : "na",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"5" : {
"name" : "RESERVED",
"is_valid" : false,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "reserved",
"protocol_type" : "na",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"6" : {
"name" : "SMLINK",
"is_valid" : true,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "ipmb",
"protocol_type" : "ipmb-1.0",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"7" : {
"name" : "ipmi_kcs4",
"is_valid" : true,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "system-interface",
"protocol_type" : "kcs",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"8" : {
"name" : "INTRABMC",
"is_valid" : true,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "oem",
"protocol_type" : "oem",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"9" : {
"name" : "SIPMB",
"is_valid" : true,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "ipmb",
"protocol_type" : "ipmb-1.0",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"10" : {
"name" : "PCIE",
"is_valid" : true,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "ipmb",
"protocol_type" : "ipmb-1.0",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"11" : {
"name" : "RESERVED",
"is_valid" : false,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "reserved",
"protocol_type" : "na",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"12" : {
"name" : "INTERNAL",
"is_valid" : false,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "ipmb",
"protocol_type" : "ipmb-1.0",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"13" : {
"name" : "RESERVED",
"is_valid" : false,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "reserved",
"protocol_type" : "na",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"14" : {
"name" : "SELF",
"is_valid" : false,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "unknown",
"protocol_type" : "na",
"session_supported" : "session-less",
"is_ipmi" : true
}
},
"15" : {
"name" : "ipmi_kcs3",
"is_valid" : true,
"active_sessions" : 0,
"channel_info" : {
"medium_type" : "system-interface",
"protocol_type" : "kcs",
"session_supported" : "session-less",
"is_ipmi" : true
}
}
}
@@ -0,0 +1,8 @@
{
"id": 0,
"revision": 0,
"addn_dev_support": 143,
"manuf_id": 49769,
"prod_id": 20,
"aux": 0
}
@@ -0,0 +1,8 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
PACKAGECONFIG:append = " dynamic-sensors hybrid-sensors"
DEPENDS:append= " vegman-yaml-config"
EXTRA_OEMESON= " \
-Dsensor-yaml-gen=${STAGING_DIR_HOST}${datadir}/vegman-yaml-config/ipmi-sensors-static.yaml \
"
@@ -0,0 +1,10 @@
{
"channels": [
{
"type": "me",
"slave-path": "/dev/ipmb-5",
"bmc-addr": 32,
"remote-addr": 44
}
]
}
@@ -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}${datadir}/ipmbbridge/
}
@@ -0,0 +1,3 @@
# Replace the '-' to '_', since Dbus object/interface names do not allow '-'.
KERNEL=="ipmi-kcs3", SYMLINK+="ipmi_kcs3"
KERNEL=="ipmi-kcs4", SYMLINK+="ipmi_kcs4"
@@ -0,0 +1,11 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
KCS_DEVICE = "ipmi_kcs3"
SMM_DEVICE = "ipmi_kcs4"
SYSTEMD_SERVICE:${PN}:append = " ${PN}@${SMM_DEVICE}.service "
SRC_URI += "file://99-ipmi-kcs.rules"
do_install:append() {
install -m 0644 ${WORKDIR}/99-ipmi-kcs.rules -D -t ${D}${nonarch_base_libdir}/udev/rules.d/
}
@@ -0,0 +1,5 @@
RMCPP_EXTRA = "eth1"
SYSTEMD_SERVICE:${PN} += " \
${PN}@${RMCPP_EXTRA}.service \
${PN}@${RMCPP_EXTRA}.socket \
"
@@ -0,0 +1,19 @@
SUMMARY = "Phosphor LED Group Management for VEGMAN-Rx20"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit native
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
}
@@ -0,0 +1,123 @@
bmc_booted:
# No LED required.
# Status LED indication
# Managed by callback-manager
status_ok:
platform_status_green:
Action: 'On'
platform_status_red:
Action: 'Off'
status_degraded:
platform_status_green:
Action: 'Blink'
platform_status_red:
Action: 'Blink'
status_non_critical:
platform_status_green:
Action: 'Off'
platform_status_red:
Action: 'Blink'
status_critical:
platform_status_green:
Action: 'Off'
platform_status_red:
Action: 'On'
enclosure_identify:
platform_indicator_blue:
Action: 'On'
#
# May be asserted through IPMI or RedFish.
# We decided that it should be the same as enclosure_identify.
enclosure_identify_blink:
platform_indicator_blue:
Action: 'On'
#
# Asserted while firmware is flashing
firmware_flashing:
platform_indicator_blue:
Action: 'Blink'
#
# Power button indication
# Managed by phosphor-dbus-monitor
power_standby:
platform_power_green:
Action: 'On'
platform_power_red:
Action: 'On'
power_sequence:
platform_power_green:
Action: 'Blink'
DutyOn: 50
Period: 1000
platform_power_red:
Action: 'Off'
power_on:
platform_power_green:
Action: 'On'
platform_power_red:
Action: 'Off'
power_failure:
platform_power_green:
Action: 'Off'
platform_power_red:
Action: 'On'
#
# Temperature status
# Managed by phosphor-dbus-monitor
temp_ok:
temp_status_green:
Action: 'On'
temp_status_red:
Action: 'Off'
temp_failure:
temp_status_green:
Action: 'Blink'
temp_status_red:
Action: 'Blink'
temp_warn:
temp_status_green:
Action: 'On'
temp_status_red:
Action: 'On'
temp_crit:
temp_status_green:
Action: 'Off'
temp_status_red:
Action: 'On'
#
# PSU status
# Managed by phosphor-dbus-monitor
psu_ok:
psu_status_green:
Action: 'On'
psu_status_red:
Action: 'Off'
psu_warn:
psu_status_green:
Action: 'Blink'
psu_status_red:
Action: 'Blink'
psu_crit:
psu_status_green:
Action: 'Off'
psu_status_red:
Action: 'Blink'
@@ -0,0 +1,19 @@
SUMMARY = "Phosphor LED Group Management for VEGMAN"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit native
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
}
@@ -0,0 +1,82 @@
bmc_booted:
# No LED required.
# Status LED indication
# Managed by callback-manager
# NOTE: The green LED actually has different colors on the front and rear
# panels. So, we decided not to use it.
# See https://j.yadro.com/browse/BBMC-221 for details.
status_ok:
platform_status_green:
Action: 'Off'
platform_status_red:
Action: 'Off'
status_degraded:
platform_status_green:
Action: 'Off'
platform_status_red:
Action: 'Blink'
DutyOn: 25
Period: 2000
status_non_critical:
platform_status_green:
Action: 'Off'
platform_status_red:
Action: 'Blink'
DutyOn: 50
Period: 1000
status_critical:
platform_status_green:
Action: 'Off'
platform_status_red:
Action: 'On'
enclosure_identify:
platform_indicator_blue:
Action: 'On'
#
# May be asserted through IPMI or RedFish.
# We decided that it should be the same as enclosure_identify.
enclosure_identify_blink:
platform_indicator_blue:
Action: 'On'
#
# Asserted while firmware is flashing
firmware_flashing:
platform_indicator_blue:
Action: 'Blink'
#
# Power button indication
# Managed by phosphor-dbus-monitor
power_standby:
platform_power_green:
Action: 'On'
platform_power_red:
Action: 'On'
power_sequence:
platform_power_green:
Action: 'Blink'
DutyOn: 50
Period: 1000
platform_power_red:
Action: 'Off'
power_on:
platform_power_green:
Action: 'On'
platform_power_red:
Action: 'Off'
power_failure:
platform_power_green:
Action: 'Off'
platform_power_red:
Action: 'On'
@@ -0,0 +1,9 @@
PACKAGECONFIG = " \
adcsensor \
intelcpusensor \
fansensor \
hwmontempsensor \
intrusionsensor \
ipmbsensor \
psusensor \
"
@@ -0,0 +1 @@
PACKAGECONFIG:remove = " cpuinfo"
@@ -0,0 +1,21 @@
[Unit]
Description=Power Cycle Host Server
After=xyz.openbmc_project.Chassis.Power.service
[Service]
ExecStart=/usr/bin/busctl set-property \
xyz.openbmc_project.State.Chassis \
/xyz/openbmc_project/state/chassis0 \
xyz.openbmc_project.State.Chassis \
RequestedPowerTransition s \
xyz.openbmc_project.State.Chassis.Transition.PowerCycle
ExecStart=/usr/bin/busctl set-property \
xyz.openbmc_project.Control.Host.RestartCause \
/xyz/openbmc_project/control/host0/restart_cause \
xyz.openbmc_project.Control.Host.RestartCause \
RequestedRestartCause s \
xyz.openbmc_project.State.Host.RestartCause.WatchdogTimer
Type=oneshot
SyslogIdentifier=phosphor-watchdog
@@ -0,0 +1,14 @@
[Unit]
Description=Shutdown Host Server
After=xyz.openbmc_project.Chassis.Power.service
[Service]
ExecStart=/usr/bin/busctl set-property \
xyz.openbmc_project.State.Chassis \
/xyz/openbmc_project/state/chassis0 \
xyz.openbmc_project.State.Chassis \
RequestedPowerTransition s \
xyz.openbmc_project.State.Chassis.Transition.Off
Type=oneshot
SyslogIdentifier=phosphor-watchdog
@@ -0,0 +1,21 @@
[Unit]
Description=Reset Host Server
After=xyz.openbmc_project.Chassis.Power.service
[Service]
ExecStart=/usr/bin/busctl set-property \
xyz.openbmc_project.State.Host \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.Host \
RequestedHostTransition s \
xyz.openbmc_project.State.Host.Transition.ForceWarmReboot
ExecStart=/usr/bin/busctl set-property \
xyz.openbmc_project.Control.Host.RestartCause \
/xyz/openbmc_project/control/host0/restart_cause \
xyz.openbmc_project.Control.Host.RestartCause \
RequestedRestartCause s \
xyz.openbmc_project.State.Host.RestartCause.WatchdogTimer
Type=oneshot
SyslogIdentifier=phosphor-watchdog
@@ -0,0 +1,17 @@
[Unit]
Description=Phosphow 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=phosphor-watchdog-host-reset.service \
--action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=phosphor-watchdog-host-poweroff.service \
--action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=phosphor-watchdog-host-cycle.service \
SyslogIdentifier=phosphor-watchdog
BusName=xyz.openbmc_project.Watchdog
Type=dbus
[Install]
WantedBy=basic.target
@@ -0,0 +1,12 @@
FILESEXTRAPATHS:append := ":${THISDIR}/${PN}"
# 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 \
phosphor-watchdog-host-poweroff.service \
phosphor-watchdog-host-reset.service \
phosphor-watchdog-host-cycle.service \
"
@@ -0,0 +1,23 @@
SUMMARY = "Apply default configuration from baseboard FRU"
DESCRIPTION = "Provide baseboard FRU EEPROM handlers to apply platform configuration on system boot"
inherit systemd
SYSTEMD_SERVICE:${PN} = " \
baseboard-fru-handler.service \
"
RDEPENDS:${PN} = "bash u-boot-fw-utils"
S = "${WORKDIR}"
SRC_URI = " \
file://baseboard-fru-handler.sh \
file://baseboard-fru-handler.service \
"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
do_install() {
install -m 0755 ${S}/baseboard-fru-handler.sh -D -t ${D}${bindir}
install -m 0644 ${S}/baseboard-fru-handler.service -D -t ${D}${systemd_system_unitdir}
}
@@ -0,0 +1,17 @@
[Unit]
Description=Enforce Static MAC addr mapping and hostname setting
Wants=xyz.openbmc_project.FruDevice.service
After=xyz.openbmc_project.FruDevice.service
Wants=systemd-hostnamed.service
After=systemd-hostnamed.service
Before=xyz.openbmc_project.Network.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/env baseboard-fru-handler.sh
SyslogIdentifier=baseboard-fru-handler
[Install]
WantedBy=network.target
@@ -0,0 +1,180 @@
#!/bin/bash -eu
# SPDX-License-Identifier: Apache-2.0
# Copyright 2020-2021 YADRO
log_msg() {
echo "$@"
}
log_err() {
echo "$@" >&2
}
read_hw_mac() {
local iface="$1"
cat /sys/class/net/"${iface}"/address 2>/dev/null ||:
}
set_hw_mac() {
local iface="$1"
local mac="$2"
local up=""
if ip link show dev "${iface}" | grep -q "${iface}:.*\<UP\>" 2>/dev/null; then
up=true
fi
if [ "${up}" = true ]; then
ip link set dev "${iface}" down ||:
fi
ip link set dev "${iface}" address "${mac}" ||:
if [ "${up}" = true ]; then
ip link set dev "${iface}" up ||:
fi
}
set_fw_env_mac() {
local iface="$1"
local mac="$2"
local envname=""
case "${iface}" in
eth0)
envname="ethaddr"
;;
eth1)
envname="eth1addr"
;;
*)
return 1
;;
esac
if ! fw_setenv "$envname" "$mac"; then
return 1
fi
}
######## MAIN ########
FRU_DBUS_SERVICE="xyz.openbmc_project.FruDevice"
FRU_DBUS_OBJECT_TEMPLATE="\/xyz.*_Motherboard"
FRU_DBUS_INTERFACE="xyz.openbmc_project.FruDevice"
fru_dbus_object=""
######## Parse D-bus data ########
n=1
while true; do
fru_dbus_object=$(busctl tree ${FRU_DBUS_SERVICE} 2>/dev/null |
sed -n "s/^.*\(${FRU_DBUS_OBJECT_TEMPLATE}\).*$/\1/p"
) && [ -n "${fru_dbus_object}" ] && break
if [ ${n} -lt 15 ]; then
n=$((n+1))
sleep 1
else
log_err "Failed to find baseboard FRU object"
exit 1
fi
done
dbusData=$(dbus-send --system --print-reply=literal \
--dest=${FRU_DBUS_SERVICE} \
"${fru_dbus_object}" \
org.freedesktop.DBus.Properties.GetAll \
string:${FRU_DBUS_INTERFACE} 2>/dev/null ||:)
if [ -z "${dbusData}" ]; then
log_err "Failed to get data from D-Bus"
exit 1
fi
# This awk script matches strings 010xyyyyyyyyyyyy, where x is interface index
# and yyyyyyyyyyyy - interface mac address.
# The output would be in form ethx=yy:yy:yy:yy:yy:yy
macsList=$(echo "${dbusData}" | \
awk '/BOARD_INFO_AM[0-9]+\s+variant\s+010[0-9a-f]{13}/{
totalMacDigits=12
singleOctet=2
offset=4
printf "eth%s=", substr($3, offset, 1)
for(i = 1 + offset; i < totalMacDigits + offset; i += singleOctet) {
printf "%s", substr($3, i, singleOctet)
if (i <= totalMacDigits + offset - singleOctet) printf ":"
}
printf "\n"
}'||:)
if [ -z "${macsList}" ]; then
log_err "Failed to get MAC address"
exit 1
fi
# Get hardware model name from PRODUCT_PRODUCT_NAME
# Examples:
# 'VEGMAN N110 Server' -> 'VEGMAN-N110'
# 'TATLIN.ARCHIVE.XS' -> 'TATLIN-ARCHIVE-XS'
modelName=$(echo "${dbusData}" | \
awk '/PRODUCT_PRODUCT_NAME\s+variant\s+/{
if ($3 ~ /^VEGMAN/) {
printf "%s-%s", $3, $4
} else if ($3 ~ /^TATLIN/) {
print gensub(/\./, "-", "g", $3)
}
}'||:)
serialNumber=$(echo "${dbusData}" | \
awk '/PRODUCT_SERIAL_NUMBER\s+variant\s+/{print $3}'||:)
if [ -z "${serialNumber}" ]; then
log_err "Failed to get product Serial Number"
exit 1
fi
# shellcheck disable=SC1091
source /etc/os-release
######## Check and set MAC addresses ########
retCode=0
IFS='
'
for line in ${macsList} ; do
ifaceName=$(echo "${line}" | cut -f 1 -d '=' || :)
macAddr=$(echo "${line}" | cut -f 2- -d '=' || :)
if [ -n "${ifaceName}" ] && [ -n "${macAddr}" ]; then
curMacAddr=$(read_hw_mac "${ifaceName}")
if [ "${macAddr}" != "${curMacAddr}" ] ; then
log_msg "Changing MAC address for ${ifaceName}: ${curMacAddr} -> ${macAddr}"
# A factory assigned address was found, and it is newly assigned.
# Update the active interface and save the new value to the u-boot
# environment.
if ! set_hw_mac "${ifaceName}" "${macAddr}"; then
log_err "Failed to set address"
retCode=1
fi
if ! set_fw_env_mac "${ifaceName}" "${macAddr}"; then
log_err "Failed to set boot env for ${ifaceName}"
retCode=1
fi
fi
fi
[ ${retCode} -eq 0 ] || exit ${retCode}
done
######## Check and set hostname ########
hostname=$(hostname)
if [ "${OPENBMC_TARGET_MACHINE}" = "${hostname}" ] ; then
hostname="${modelName,,}-${serialNumber}"
log_msg "Changing hostname to ${hostname}"
if ! hostnamectl set-hostname "${hostname}"; then
log_err "Failed to set new hostname"
exit 1
fi
fi
######## Run optional scripts ########
snmp_handler="/usr/sbin/snmpd-generate-conf.sh"
if [ -x ${snmp_handler} ]; then
if ! ${snmp_handler} "${modelName}"; then
log_err "Failed to setup snmp"
fi
fi
@@ -0,0 +1,63 @@
SUMMARY = "OpenBMC for Yadro - Applications"
PR = "r1"
inherit packagegroup
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 = " \
phosphor-post-code-manager \
phosphor-host-postd \
"
SUMMARY:${PN}-fans = "Fan control"
RDEPENDS:${PN}-fans = " \
"
SUMMARY:${PN}-flash = "Flash/firmware-related tools"
RDEPENDS:${PN}-flash = " \
"
SUMMARY:${PN}-system = "System software"
RDEPENDS:${PN}-system = " \
vegman-fru-handler \
fru-device \
entity-manager \
smbios-mdr \
${PN}-interface \
${PN}-cli \
"
SUMMARY:${PN}-interface = "Interfaces"
RDEPENDS:${PN}-interface = " \
webui-vue \
phosphor-ipmi-ipmb \
"
SUMMARY:${PN}-cli = "CLI utils"
RDEPENDS:${PN}-cli = " \
ipmitool \
obmc-yadro-cli \
obmc-yadro-lssensors \
obmc-yadro-lsinventory \
obmc-yadro-netconfig \
"