summaryrefslogtreecommitdiff
path: root/meta-ampere/meta-jade
diff options
context:
space:
mode:
Diffstat (limited to 'meta-ampere/meta-jade')
-rw-r--r--meta-ampere/meta-jade/conf/bblayers.conf.sample29
-rw-r--r--meta-ampere/meta-jade/conf/conf-notes.txt2
-rw-r--r--meta-ampere/meta-jade/conf/layer.conf10
-rw-r--r--meta-ampere/meta-jade/conf/local.conf.sample216
-rw-r--r--meta-ampere/meta-jade/conf/machine/mtjade.conf27
-rw-r--r--meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils.bb23
-rwxr-xr-xmeta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils/ampere_flash_bios.sh103
-rw-r--r--meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0001-aspeed-scu-Switch-PWM-pin-to-GPIO-input-mode.patch87
-rw-r--r--meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0002-aspeed-Disable-internal-PD-resistors-for-GPIOs.patch45
-rw-r--r--meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0003-aspeed-support-passing-system-reset-status-to-kernel.patch180
-rw-r--r--meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend7
-rw-r--r--meta-ampere/meta-jade/recipes-kernel/linux/linux-aspeed/mtjade.cfg22
-rw-r--r--meta-ampere/meta-jade/recipes-kernel/linux/linux-aspeed_%.bbappend6
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config.bb27
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config/mtjade-ipmi-fru-properties.yaml23
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config/mtjade-ipmi-fru.yaml85
-rwxr-xr-xmeta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh84
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh42
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS0-ssh.socket10
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS0-ssh@.service12
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS1-ssh.socket10
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS1-ssh@.service12
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS2-ssh.socket10
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS2-ssh@.service12
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS3-ssh.socket10
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS3-ssh@.service12
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console@.service17
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS0.conf3
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS1.conf4
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS2.conf4
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS3.conf4
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/console/obmc-console_%.bbappend54
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup.bb17
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml16
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json72
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend10
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend1
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json2
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/motherboard2
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend26
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend14
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend1
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@28.conf5
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@29.conf5
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2a.conf5
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2b.conf5
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2c.conf5
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2d.conf5
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@1c0/psu@58.conf15
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@1c0/psu@59.conf15
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/pwm-tacho-controller@1e786000.conf84
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon-adc14.conf6
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon-battery.conf13
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon.conf179
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend31
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json54
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/skeleton/obmc-libobmc-intf_%.bbappend1
57 files changed, 1781 insertions, 0 deletions
diff --git a/meta-ampere/meta-jade/conf/bblayers.conf.sample b/meta-ampere/meta-jade/conf/bblayers.conf.sample
new file mode 100644
index 000000000..f4d7fc399
--- /dev/null
+++ b/meta-ampere/meta-jade/conf/bblayers.conf.sample
@@ -0,0 +1,29 @@
+# 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-ampere \
+ ##OEROOT##/meta-ampere/meta-jade \
+ "
+BBLAYERS_NON_REMOVABLE ?= " \
+ ##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-ampere \
+ ##OEROOT##/meta-ampere/meta-jade \
+ "
diff --git a/meta-ampere/meta-jade/conf/conf-notes.txt b/meta-ampere/meta-jade/conf/conf-notes.txt
new file mode 100644
index 000000000..9b3c01a55
--- /dev/null
+++ b/meta-ampere/meta-jade/conf/conf-notes.txt
@@ -0,0 +1,2 @@
+Common targets are:
+ obmc-phosphor-image
diff --git a/meta-ampere/meta-jade/conf/layer.conf b/meta-ampere/meta-jade/conf/layer.conf
new file mode 100644
index 000000000..2cf1805c7
--- /dev/null
+++ b/meta-ampere/meta-jade/conf/layer.conf
@@ -0,0 +1,10 @@
+# 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 += "jade-layer"
+BBFILE_PATTERN_jade-layer := "^${LAYERDIR}/"
+LAYERSERIES_COMPAT_jade-layer = "dunfell gatesgarth"
diff --git a/meta-ampere/meta-jade/conf/local.conf.sample b/meta-ampere/meta-jade/conf/local.conf.sample
new file mode 100644
index 000000000..200d89797
--- /dev/null
+++ b/meta-ampere/meta-jade/conf/local.conf.sample
@@ -0,0 +1,216 @@
+#
+# 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.
+#
+# 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 ??= "mtjade"
+
+#
+# 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 rpm:
+PACKAGE_CLASSES ?= "package_rpm"
+
+#
+# SDK/ADT target architecture
+#
+# This variable specifies the architecture to build SDK/ADT 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 and x86_64
+#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)
+# "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, exmap, 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
+# - 'image-mklibs' to reduce shared library files size for an image
+# - 'image-prelink' in order to prelink the filesystem image
+# - 'image-swab' to perform host system intrusion detection
+# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
+# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
+USER_CLASSES ?= "buildstats image-mklibs image-prelink"
+
+#
+# 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. To
+# enable this uncomment this line. See classes/testimage(-auto).bbclass for
+# further details.
+#TEST_IMAGE = "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 that 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 \
+ ABORT,${TMPDIR},100M,1K \
+ ABORT,${DL_DIR},100M,1K \
+ ABORT,${SSTATE_DIR},100M,1K \
+ ABORT,/tmp,10M,1K"
+
+#
+# Shared-state files from other locations
+#
+# As mentioned above, shared state files are prebuilt cache data objects which can
+# 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"
+
+
+#
+# Qemu configuration
+#
+# By default qemu will build with a builtin VNC server where graphical output can be
+# seen. The two lines below enable the SDL backend too. This assumes there is a
+# libsdl library available on your build system.
+#PACKAGECONFIG_append_pn-qemu-native = " sdl"
+#PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
+#ASSUME_PROVIDED += "libsdl-native"
+
+
+# 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 = "1"
diff --git a/meta-ampere/meta-jade/conf/machine/mtjade.conf b/meta-ampere/meta-jade/conf/machine/mtjade.conf
new file mode 100644
index 000000000..ec6e27f17
--- /dev/null
+++ b/meta-ampere/meta-jade/conf/machine/mtjade.conf
@@ -0,0 +1,27 @@
+KMACHINE = "aspeed"
+KERNEL_DEVICETREE = "${KMACHINE}-bmc-ampere-${MACHINE}.dtb"
+UBOOT_MACHINE = "ast_g5_phy_config"
+
+require conf/machine/include/ast2500.inc
+require conf/machine/include/obmc-bsp-common.inc
+require conf/distro/include/phosphor-isolation.inc
+
+OBMC_MACHINE_FEATURES += "\
+ obmc-phosphor-chassis-mgmt \
+ obmc-phosphor-flash-mgmt \
+ obmc-chassis-state-mgmt \
+ obmc-bmc-state-mgmt \
+ "
+
+VOLATILE_LOG_DIR = "no"
+
+OBMC_IMAGE_EXTRA_INSTALL_append = "\
+ ampere-usbnet \
+ ampere-flash-utils \
+ ampere-mac-update \
+ "
+
+PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-ampere-apps"
+PREFERRED_PROVIDER_virtual/obmc-system-mgmt = "packagegroup-ampere-apps"
+PREFERRED_PROVIDER_virtual/obmc-flash-mgmt = "packagegroup-ampere-apps"
+PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-hostfw-config ?= "hostboot-inventory-config-native"
diff --git a/meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils.bb b/meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils.bb
new file mode 100644
index 000000000..9b2840134
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils.bb
@@ -0,0 +1,23 @@
+
+SUMMARY = "Ampere Computing LLC Flashing Utilities"
+DESCRIPTION = "Application to support flashing utilities on Ampere platforms"
+PR = "r0"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+RDEPENDS_${PN} = "bash"
+DEPENDS = "zlib"
+
+SRC_URI += "\
+ file://ampere_flash_bios.sh \
+ "
+
+S = "${WORKDIR}"
+ROOT = "${STAGING_DIR_TARGET}"
+
+LDFLAGS += "-L ${ROOT}/usr/lib/ -lz "
+
+do_install_append() {
+ install -d ${D}/usr/sbin
+ install -m 0755 ${S}/ampere_flash_bios.sh ${D}/${sbindir}/ampere_flash_bios.sh
+}
diff --git a/meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils/ampere_flash_bios.sh b/meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils/ampere_flash_bios.sh
new file mode 100755
index 000000000..876671c1b
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils/ampere_flash_bios.sh
@@ -0,0 +1,103 @@
+#!/bin/bash
+#
+# Copyright (c) 2021 Ampere Computing LLC
+#
+# 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.
+
+do_flash () {
+ # Check the PNOR partition available
+ HOST_MTD=$(cat /proc/mtd | grep "pnor" | sed -n 's/^\(.*\):.*/\1/p')
+ if [ -z "$HOST_MTD" ];
+ then
+ # If the PNOR partition is not available, then bind again driver
+ echo "--- Bind the ASpeed SMC driver"
+ echo 1e630000.spi > /sys/bus/platform/drivers/aspeed-smc/bind
+ sleep 2
+
+ HOST_MTD=$(cat /proc/mtd | grep "pnor" | sed -n 's/^\(.*\):.*/\1/p')
+ if [ -z "$HOST_MTD" ];
+ then
+ echo "Fail to probe Host SPI-NOR device"
+ exit 1
+ fi
+
+ echo "--- Flashing firmware to @/dev/$HOST_MTD"
+ flash_eraseall /dev/$HOST_MTD
+ flashcp -v $IMAGE /dev/$HOST_MTD
+
+ echo "--- Unbind the ASpeed SMC driver"
+ echo 1e630000.spi > /sys/bus/platform/drivers/aspeed-smc/unbind
+ else
+ echo "--- Flashing firmware to @/dev/$HOST_MTD"
+ flash_eraseall /dev/$HOST_MTD
+ flashcp -v $IMAGE /dev/$HOST_MTD
+ fi
+}
+
+
+if [ $# -eq 0 ]; then
+ echo "Usage: $(basename $0) <BIOS image file>"
+ exit 0
+fi
+
+IMAGE="$1"
+if [ ! -f $IMAGE ]; then
+ echo $IMAGE
+ echo "The image file $IMAGE does not exist"
+ exit 1
+fi
+
+# Turn off the Host if it is currently ON
+chassisstate=$(obmcutil chassisstate | awk -F. '{print $NF}')
+echo "--- Current Chassis State: $chassisstate"
+if [ "$chassisstate" == 'On' ];
+then
+ echo "--- Turning the Chassis off"
+ obmcutil chassisoff
+ sleep 10
+ # Check if HOST was OFF
+ chassisstate_off=$(obmcutil chassisstate | awk -F. '{print $NF}')
+ if [ "$chassisstate_off" == 'On' ];
+ then
+ echo "--- Error : Failed turning the Chassis off"
+ exit 1
+ fi
+fi
+
+# Switch the host SPI bus to BMC"
+echo "--- Switch the host SPI bus to BMC."
+gpioset 0 226=0
+
+if [[ $? -ne 0 ]]; then
+ echo "ERROR: Switch the host SPI bus to BMC. Please check gpio state"
+ exit 1
+fi
+
+# Flash the firmware
+do_flash
+
+# Switch the host SPI bus to HOST."
+echo "--- Switch the host SPI bus to HOST."
+gpioset 0 226=1
+
+if [[ $? -ne 0 ]]; then
+ echo "ERROR: Switch the host SPI bus to HOST. Please check gpio state"
+ exit 1
+fi
+
+if [ "$chassisstate" == 'On' ];
+then
+ sleep 5
+ echo "Turn on the Host"
+ obmcutil chassison
+fi
diff --git a/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0001-aspeed-scu-Switch-PWM-pin-to-GPIO-input-mode.patch b/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0001-aspeed-scu-Switch-PWM-pin-to-GPIO-input-mode.patch
new file mode 100644
index 000000000..b714be4c6
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0001-aspeed-scu-Switch-PWM-pin-to-GPIO-input-mode.patch
@@ -0,0 +1,87 @@
+From 03dcf584823b8b7db7d437257dbb45bd4b7f95b4 Mon Sep 17 00:00:00 2001
+From: Chanh Nguyen <chnguyen@amperecomputing.com>
+Date: Mon, 21 Dec 2020 07:01:14 +0000
+Subject: [PATCH] aspeed/scu : Switch PWM pin to GPIO input mode
+
+In hardware design, the PWM pins will be at a high level if they are
+configured in GPIO Input mode. This commit configures all PWM function
+pins to input GPIO mode. This will allow fans to run at full speed when BMC resets or in U-boot.
+
+Signed-off-by: Chanh Nguyen <chnguyen@amperecomputing.com>
+---
+ arch/arm/include/asm/arch-aspeed/ast_scu.h | 1 +
+ arch/arm/mach-aspeed/ast-scu.c | 12 ++++++++++++
+ board/aspeed/ast-g5/ast-g5.c | 10 ++++++++++
+ include/configs/ast-g5-phy.h | 3 +++
+ 4 files changed, 26 insertions(+)
+
+diff --git a/arch/arm/include/asm/arch-aspeed/ast_scu.h b/arch/arm/include/asm/arch-aspeed/ast_scu.h
+index dcbc6730d4..d2c010a0dc 100644
+--- a/arch/arm/include/asm/arch-aspeed/ast_scu.h
++++ b/arch/arm/include/asm/arch-aspeed/ast_scu.h
+@@ -45,5 +45,6 @@ extern u32 ast_scu_get_vga_memsize(void);
+ extern void ast_scu_init_eth(u8 num);
+ extern void ast_scu_multi_func_eth(u8 num);
+ extern void ast_scu_multi_func_romcs(u8 num);
++extern void ast_scu_switch_pwm_to_gpio_mode(void);
+
+ #endif
+diff --git a/arch/arm/mach-aspeed/ast-scu.c b/arch/arm/mach-aspeed/ast-scu.c
+index 12de9b8036..ef90ef3805 100644
+--- a/arch/arm/mach-aspeed/ast-scu.c
++++ b/arch/arm/mach-aspeed/ast-scu.c
+@@ -443,6 +443,18 @@ void ast_scu_multi_func_eth(u8 num)
+ }
+ }
+
++void ast_scu_switch_pwm_to_gpio_mode(void)
++{
++ ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL3) &
++ ~SCU_FUN_PIN_VPIG2 &
++ ~SCU_FUN_PIN_VPIG3 &
++ ~SCU_FUN_PIN_VPIG4 &
++ ~SCU_FUN_PIN_VPIG5 &
++ ~SCU_FUN_PIN_VPIG6 &
++ ~SCU_FUN_PIN_VPIG7,
++ AST_SCU_FUN_PIN_CTRL3);
++}
++
+ void ast_scu_multi_func_romcs(u8 num)
+ {
+ ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL3) |
+diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
+index e67a4bf8b2..fba22a728e 100644
+--- a/board/aspeed/ast-g5/ast-g5.c
++++ b/board/aspeed/ast-g5/ast-g5.c
+@@ -24,6 +24,16 @@ int board_init(void)
+ return 0;
+ }
+
++#ifdef CONFIG_BOARD_LATE_INIT
++int board_late_init(void)
++{
++ /* Switch PWM to GPIO mode to make FAN run in max speed */
++ ast_scu_switch_pwm_to_gpio_mode();
++
++ return 0;
++}
++#endif
++
+ int dram_init(void)
+ {
+ u32 vga = ast_scu_get_vga_memsize();
+diff --git a/include/configs/ast-g5-phy.h b/include/configs/ast-g5-phy.h
+index 62ddb841e5..5443a26cab 100644
+--- a/include/configs/ast-g5-phy.h
++++ b/include/configs/ast-g5-phy.h
+@@ -30,4 +30,7 @@
+ /* platform.S */
+ #define CONFIG_DRAM_ECC_SIZE 0x10000000
+
++/* Call board_late_init */
++#define CONFIG_BOARD_LATE_INIT 1
++
+ #endif /* __AST_G5_PHY_CONFIG_H */
+--
+2.25.1
+
diff --git a/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0002-aspeed-Disable-internal-PD-resistors-for-GPIOs.patch b/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0002-aspeed-Disable-internal-PD-resistors-for-GPIOs.patch
new file mode 100644
index 000000000..249d4398f
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0002-aspeed-Disable-internal-PD-resistors-for-GPIOs.patch
@@ -0,0 +1,45 @@
+From c6e0470d82417b79b23f218c6db1099eb6e160af Mon Sep 17 00:00:00 2001
+From: "Thang Q. Nguyen" <thang@os.amperecomputing.com>
+Date: Wed, 23 Dec 2020 04:42:21 +0000
+Subject: [PATCH] aspeed: Disable internal PD resistors for GPIOs
+
+Configure SCU8C - Multi-function pin control 4 to disable internal pull
+down resistors for GPIOJ, GPIOG/GPIOAB, GPIOD/GPIOY, GPIOC/GPIOS as
+external resistors are already installed.
+
+Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com>
+---
+ board/aspeed/ast-g5/ast-g5.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
+index fba22a728e..9bf6c905fe 100644
+--- a/board/aspeed/ast-g5/ast-g5.c
++++ b/board/aspeed/ast-g5/ast-g5.c
+@@ -27,9 +27,23 @@ int board_init(void)
+ #ifdef CONFIG_BOARD_LATE_INIT
+ int board_late_init(void)
+ {
++ u32 val;
++
+ /* Switch PWM to GPIO mode to make FAN run in max speed */
+ ast_scu_switch_pwm_to_gpio_mode();
+
++ /*
++ * Disable internal pull down resistor for GPIOJ,
++ * GPIOG/GPIOAB, GPIOD/GPIOY, GPIOC/GPIOS as external pull up/down
++ * resistors are installed already. Unlock SCU regs before writing.
++ */
++ writel(SCU_PROTECT_UNLOCK, AST_SCU_BASE);
++ val = readl(AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL4) | 0x024C0000;
++ writel(val, AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL4);
++#ifdef CONFIG_AST_SCU_LOCK
++ writel(0xaa, AST_SCU_BASE);
++#endif
++
+ return 0;
+ }
+ #endif
+--
+2.25.1
+
diff --git a/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0003-aspeed-support-passing-system-reset-status-to-kernel.patch b/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0003-aspeed-support-passing-system-reset-status-to-kernel.patch
new file mode 100644
index 000000000..0381b5d84
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0003-aspeed-support-passing-system-reset-status-to-kernel.patch
@@ -0,0 +1,180 @@
+From af4353ab19aaf29dc68ff89a0d581102ca5be43c Mon Sep 17 00:00:00 2001
+From: "Thang Q. Nguyen" <thang@os.amperecomputing.com>
+Date: Wed, 6 Jan 2021 06:33:36 +0000
+Subject: [PATCH] aspeed: support passing system reset status to kernel via
+ bootargs
+
+This is a backport of the patch file from
+openbmc/meta-yadro/meta-nicole/recipes-bsp/u-boot/
+to add the Aspeed reset reason to bootargs so kernel applications
+can query it.
+
+Test case: /proc/cmdline must contain:
+ - resetreason=power after cold bmc boot
+ - resetreason=watchdog after warm bmc reboot
+
+Signed-off-by: Chanh Nguyen <chanh@os.amperecomputing.com>
+Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com>
+---
+ arch/arm/include/asm/arch-aspeed/ast_scu.h | 2 +-
+ arch/arm/mach-aspeed/ast-scu.c | 6 +-
+ board/aspeed/ast-g5/ast-g5.c | 81 ++++++++++++++++++++++
+ 3 files changed, 87 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/include/asm/arch-aspeed/ast_scu.h b/arch/arm/include/asm/arch-aspeed/ast_scu.h
+index d2c010a0dc..f5c9126ec0 100644
+--- a/arch/arm/include/asm/arch-aspeed/ast_scu.h
++++ b/arch/arm/include/asm/arch-aspeed/ast_scu.h
+@@ -29,7 +29,7 @@
+ #define __AST_SCU_H
+
+ extern void ast_scu_show_system_info (void);
+-extern void ast_scu_sys_rest_info(void);
++extern u32 ast_scu_sys_rest_info(void);
+ extern void ast_scu_security_info(void);
+ extern u32 ast_scu_revision_id(void);
+ extern u32 ast_scu_get_vga_memsize(void);
+diff --git a/arch/arm/mach-aspeed/ast-scu.c b/arch/arm/mach-aspeed/ast-scu.c
+index ef90ef3805..c7ab66415f 100644
+--- a/arch/arm/mach-aspeed/ast-scu.c
++++ b/arch/arm/mach-aspeed/ast-scu.c
+@@ -494,22 +494,26 @@ void ast_scu_security_info(void)
+ }
+ }
+
+-void ast_scu_sys_rest_info(void)
++u32 ast_scu_sys_rest_info(void)
+ {
+ u32 rest = ast_scu_read(AST_SCU_SYS_CTRL);
+
+ if (rest & SCU_SYS_EXT_RESET_FLAG) {
+ printf("RST : External\n");
+ ast_scu_write(SCU_SYS_EXT_RESET_FLAG, AST_SCU_SYS_CTRL);
++ rest = SCU_SYS_EXT_RESET_FLAG;
+ } else if (rest & SCU_SYS_WDT_RESET_FLAG) {
+ printf("RST : Watchdog\n");
+ ast_scu_write(SCU_SYS_WDT_RESET_FLAG, AST_SCU_SYS_CTRL);
++ rest = SCU_SYS_WDT_RESET_FLAG;
+ } else if (rest & SCU_SYS_PWR_RESET_FLAG) {
+ printf("RST : Power On\n");
+ ast_scu_write(SCU_SYS_PWR_RESET_FLAG, AST_SCU_SYS_CTRL);
++ rest = SCU_SYS_PWR_RESET_FLAG;
+ } else {
+ printf("RST : CLK en\n");
+ }
++ return rest;
+ }
+
+ u32 ast_scu_get_vga_memsize(void)
+diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
+index 9bf6c905fe..9e27bce0f5 100644
+--- a/board/aspeed/ast-g5/ast-g5.c
++++ b/board/aspeed/ast-g5/ast-g5.c
+@@ -8,6 +8,8 @@
+ */
+
+ #include <common.h>
++#include <stdlib.h>
++#include <asm/arch/regs-scu.h>
+ #include <netdev.h>
+
+ #include <asm/arch/ast_scu.h>
+@@ -25,9 +27,76 @@ int board_init(void)
+ }
+
+ #ifdef CONFIG_BOARD_LATE_INIT
++static void update_bootargs_cmd(const char *key, const char *value)
++{
++ int buf_len;
++ char *buf;
++ char *cmdline;
++ char *end = NULL;
++
++ if (!key || (key[0] == '\0')) {
++ printf("%s: Empty key not allowed\n", __func__);
++ return;
++ }
++
++ cmdline = getenv("bootargs");
++
++ /* Allocate space for maximum possible new command line */
++ buf_len = (cmdline ? strlen(cmdline) : 0)
++ + 1 /* spacebar as delimiter */
++ + strlen(key)
++ + (value ? 1 /* equal sign */ + strlen(value) : 0)
++ + 1 /* terminating null */;
++
++ buf = calloc(buf_len, sizeof(char));
++ if (!buf) {
++ printf("%s: out of memory\n", __func__);
++ return;
++ }
++
++ if (cmdline)
++ {
++ char *start = strstr(cmdline, key);
++
++ /* Check for full word match. Match should be start of cmdline
++ * or there should be space before match
++ **/
++ if (start && ((start == cmdline) || (*(start - 1) == ' '))) {
++ strncat(buf, cmdline, (start - cmdline));
++
++ /* Find the end of the keyword[=value] pair,
++ * including a single training space character, if any.
++ * Skip the found substring, mark the tail of cmdline.
++ **/
++ end = strchr(start, ' ');
++ if (end) {
++ end++;
++ }
++ } else {
++ strcat(buf, cmdline);
++ strcat(buf, " ");
++ }
++ }
++
++ strcat(buf, key);
++ if (value) {
++ strcat(buf, "=");
++ strcat(buf, value);
++ }
++
++ if (end) {
++ strcat(buf, " ");
++ strcat(buf, end);
++ }
++
++ setenv("bootargs", buf);
++ free(buf);
++}
++
+ int board_late_init(void)
+ {
+ u32 val;
++ u32 reset_reason = ast_scu_sys_rest_info();
+
+ /* Switch PWM to GPIO mode to make FAN run in max speed */
+ ast_scu_switch_pwm_to_gpio_mode();
+@@ -44,6 +113,18 @@ int board_late_init(void)
+ writel(0xaa, AST_SCU_BASE);
+ #endif
+
++ if (reset_reason & SCU_SYS_EXT_RESET_FLAG) {
++ update_bootargs_cmd("resetreason", "external");
++ } else if (reset_reason & SCU_SYS_WDT_RESET_FLAG) {
++ update_bootargs_cmd("resetreason", "watchdog");
++ } else if (reset_reason & SCU_SYS_PWR_RESET_FLAG) {
++ update_bootargs_cmd("resetreason", "power");
++ } else {
++ char value[32];
++ snprintf(value, sizeof(value) - 1, "0x%x", reset_reason);
++ update_bootargs_cmd("resetreason", value);
++ }
++
+ return 0;
+ }
+ #endif
+--
+2.25.1
+
diff --git a/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend b/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend
new file mode 100644
index 000000000..77a58f523
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_append_mtjade := "${THISDIR}/${PN}:"
+
+SRC_URI += " \
+ file://0001-aspeed-scu-Switch-PWM-pin-to-GPIO-input-mode.patch \
+ file://0002-aspeed-Disable-internal-PD-resistors-for-GPIOs.patch \
+ file://0003-aspeed-support-passing-system-reset-status-to-kernel.patch \
+ "
diff --git a/meta-ampere/meta-jade/recipes-kernel/linux/linux-aspeed/mtjade.cfg b/meta-ampere/meta-jade/recipes-kernel/linux/linux-aspeed/mtjade.cfg
new file mode 100644
index 000000000..fdda06d3e
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-kernel/linux/linux-aspeed/mtjade.cfg
@@ -0,0 +1,22 @@
+#
+# BOM
+#
+CONFIG_RTC_DRV_PCF85063=y
+CONFIG_IIO_MUX=y
+CONFIG_MUX_GPIO=y
+CONFIG_I2C_MUX=y
+
+#
+# Mtjade driver build flags
+#
+CONFIG_SENSORS_IIO_HWMON=y
+CONFIG_ASPEED_ADC=y
+CONFIG_SENSORS_LM75=y
+CONFIG_I2C_SLAVE=y
+CONFIG_SENSORS_ASPEED=y
+
+CONFIG_USB_PHY=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_CONFIGFS=y
+CONFIG_USB_ASPEED_VHUB=y
+CONFIG_USB_CONFIGFS_ECM=y
diff --git a/meta-ampere/meta-jade/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-ampere/meta-jade/recipes-kernel/linux/linux-aspeed_%.bbappend
new file mode 100644
index 000000000..d95f27602
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-kernel/linux/linux-aspeed_%.bbappend
@@ -0,0 +1,6 @@
+FILESEXTRAPATHS_prepend_mtjade := "${THISDIR}/${PN}:"
+
+SRC_URI += " \
+ file://${MACHINE}.cfg \
+"
+
diff --git a/meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config.bb b/meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config.bb
new file mode 100644
index 000000000..66238dcf3
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config.bb
@@ -0,0 +1,27 @@
+SUMMARY = "YAML configuration for Mt.Jade"
+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://mtjade-ipmi-fru.yaml \
+ file://mtjade-ipmi-fru-properties.yaml \
+ "
+
+S = "${WORKDIR}"
+
+do_install() {
+ cat mtjade-ipmi-fru.yaml > fru-read.yaml
+ install -m 0644 -D mtjade-ipmi-fru-properties.yaml \
+ ${D}${datadir}/${BPN}/ipmi-extra-properties.yaml
+ install -m 0644 -D fru-read.yaml \
+ ${D}${datadir}/${BPN}/ipmi-fru-read.yaml
+}
+
+FILES_${PN}-dev = " \
+ ${datadir}/${BPN}/ipmi-extra-properties.yaml \
+ ${datadir}/${BPN}/ipmi-fru-read.yaml \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config/mtjade-ipmi-fru-properties.yaml b/meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config/mtjade-ipmi-fru-properties.yaml
new file mode 100644
index 000000000..db8de9f40
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config/mtjade-ipmi-fru-properties.yaml
@@ -0,0 +1,23 @@
+/system/chassis/motherboard:
+ xyz.openbmc_project.Inventory.Decorator.Replaceable:
+ FieldReplaceable: 'true'
+ xyz.openbmc_project.Inventory.Decorator.Cacheable:
+ Cached: 'true'
+ xyz.openbmc_project.Inventory.Item:
+ Present: 'true'
+
+/system/chassis:
+ xyz.openbmc_project.Inventory.Decorator.Replaceable:
+ FieldReplaceable: 'true'
+ xyz.openbmc_project.Inventory.Decorator.Cacheable:
+ Cached: 'true'
+ xyz.openbmc_project.Inventory.Item:
+ Present: 'true'
+
+/system:
+ xyz.openbmc_project.Inventory.Decorator.Replaceable:
+ FieldReplaceable: 'true'
+ xyz.openbmc_project.Inventory.Decorator.Cacheable:
+ Cached: 'true'
+ xyz.openbmc_project.Inventory.Item:
+ Present: 'true'
diff --git a/meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config/mtjade-ipmi-fru.yaml b/meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config/mtjade-ipmi-fru.yaml
new file mode 100644
index 000000000..80bcce434
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/configuration/mtjade-yaml-config/mtjade-ipmi-fru.yaml
@@ -0,0 +1,85 @@
+0x00:
+ /system/chassis/motherboard:
+ entityID: 7
+ entityInstance: 1
+ interfaces:
+ xyz.openbmc_project.Inventory.Decorator.Asset:
+ BuildDate:
+ IPMIFruProperty: Mfg Date
+ IPMIFruSection: Board
+ PartNumber:
+ IPMIFruProperty: Part Number
+ IPMIFruSection: Board
+ Manufacturer:
+ IPMIFruProperty: Manufacturer
+ IPMIFruSection: Board
+ SerialNumber:
+ IPMIFruProperty: Serial Number
+ IPMIFruSection: Board
+ xyz.openbmc_project.Inventory.Item:
+ PrettyName:
+ IPMIFruProperty: Name
+ IPMIFruSection: Board
+ xyz.openbmc_project.Inventory.Item.NetworkInterface:
+ MACAddress:
+ IPMIFruProperty: Custom Field 1
+ IPMIFruSection: Board
+ xyz.openbmc_project.Inventory.Decorator.VendorInformation:
+ CustomField1:
+ IPMIFruProperty: FRU File ID
+ IPMIFruSection: Board
+ xyz.openbmc_project.Common.UUID:
+ UUID:
+ IPMIFruProperty: UUID
+ IPMIFruSection: MultiRecord
+ /system/chassis:
+ entityID: 23
+ entityInstance: 1
+ interfaces:
+ xyz.openbmc_project.Inventory.Decorator.Asset:
+ SerialNumber:
+ IPMIFruProperty: Serial Number
+ IPMIFruSection: Chassis
+ PartNumber:
+ IPMIFruProperty: Part Number
+ IPMIFruSection: Chassis
+ Model:
+ IPMIFruProperty: Type
+ IPMIFruSection: Chassis
+ xyz.openbmc_project.Inventory.Decorator.VendorInformation:
+ CustomField2:
+ IPMIFruProperty: Custom Field 1
+ IPMIFruSection: Chassis
+ /system:
+ entityID: 7
+ entityInstance: 2
+ interfaces:
+ xyz.openbmc_project.Inventory.Item:
+ PrettyName:
+ IPMIFruProperty: Name
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Decorator.Asset:
+ PartNumber:
+ IPMIFruProperty: Model Number
+ IPMIFruSection: Product
+ Manufacturer:
+ IPMIFruProperty: Manufacturer
+ IPMIFruSection: Product
+ SerialNumber:
+ IPMIFruProperty: Serial Number
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Decorator.Revision:
+ Version:
+ IPMIFruProperty: Version
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Decorator.AssetTag:
+ AssetTag:
+ IPMIFruProperty: Asset Tag
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Decorator.VendorInformation:
+ CustomField1:
+ IPMIFruProperty: FRU File ID
+ IPMIFruSection: Product
+ CustomField2:
+ IPMIFruProperty: Custom Field 1
+ IPMIFruSection: Product
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh
new file mode 100755
index 000000000..58fffd8fe
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh
@@ -0,0 +1,84 @@
+#!/bin/bash
+#
+# Copyright (c) 2020 Ampere Computing LLC
+#
+# 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.
+
+# Ampere Computing LLC: UART MUX/DEMUX for CPU0 UART0,1,4 and CPU1 UART1
+# Usage: ampere_uartmux_ctrl.sh <CPU UART port number> <UARTx_MODE>
+# <UARTx_MODE> of 1 sets CPU To HDR_CONN
+# <UARTx_MODE> of 2 sets BMC to CPU (eg dropbear ssh server on port 2200)
+
+if [ $# -lt 2 ]; then
+ exit 1
+fi
+
+function set_gpio_active_low() {
+ if [ $# -ne 2 ]; then
+ echo "set_gpio_active_low: need both GPIO# and initial level";
+ return;
+ fi
+
+ if [ ! -d /sys/class/gpio/gpio$1 ]; then
+ echo $1 > /sys/class/gpio/export
+ fi
+ echo $2 > /sys/class/gpio/gpio$1/direction
+}
+
+GPIO_BASE=$(cat /sys/class/gpio/gpio*/base)
+
+case "$1" in
+ 1) GPIO_UARTx_MODE0=56
+ # CPU0 UART0 connects to BMC UART1
+ CONSOLE_PORT=0
+ ;;
+ 2) GPIO_UARTx_MODE0=57
+ # CPU0 UART1 connects to BMC UART2
+ CONSOLE_PORT=1
+ ;;
+ 3) GPIO_UARTx_MODE0=58
+ # CPU0 UART4 connects to BMC UART3
+ CONSOLE_PORT=2
+ ;;
+ 4) GPIO_UARTx_MODE0=59
+ # CPU1 UART1 connects to BMC UART4
+ CONSOLE_PORT=3
+ ;;
+ *) echo "Invalid UART port selection"
+ exit 1
+ ;;
+esac
+
+# Only switch the MUX when there is no active connection. This means we only
+# switch the MUX before the first session starts and after the last session
+# closes. We do this by querying number of connected sessions to the socket
+# of requested console port.
+# Example format: Accepted: 1; Connected: 1;
+CONNECTED=$(systemctl --no-pager status obmc-console-ttyS${CONSOLE_PORT}-ssh.socket | grep -w Connected | cut -d ':' -f 3 | tr -d ' ;')
+if [ ! $CONNECTED -le 1 ]; then
+ exit 0
+fi
+
+echo "Ampere UART MUX CTRL UART port $1 to mode $2"
+
+case "$2" in
+ 1) set_gpio_active_low $((${GPIO_BASE} + ${GPIO_UARTx_MODE0})) low
+ exit 0
+ ;;
+ 2) set_gpio_active_low $((${GPIO_BASE} + ${GPIO_UARTx_MODE0})) high
+ exit 0
+ ;;
+ *) echo "Invalid UART mode selection"
+ exit 1
+ ;;
+esac
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh
new file mode 100644
index 000000000..fe2d5ab03
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh
@@ -0,0 +1,42 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2020 Ampere Computing LLC
+#
+# 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.
+
+set -euo pipefail
+
+tty="$1"
+uart=0
+
+case "${tty}" in
+ "ttyS0") uart=1
+ ;;
+ "ttyS1") uart=2
+ ;;
+ "ttyS2") uart=3
+ ;;
+ "ttyS3") uart=4
+ ;;
+ *) echo "Invalid tty passed to $0. Exiting!"
+ exit 1;
+ ;;
+esac
+
+# Default the host routing through the mux to use the BMC (2)
+# This allows the SoL console in webui, and the ssh port 2200, to work
+# upon startup. If UART transcievers are installed on the header and required,
+# this value should be set to 1
+/usr/sbin/ampere_uartmux_ctrl.sh ${uart} 2
+
+/usr/sbin/obmc-console-server --config /etc/obmc-console/server.${tty}.conf ${tty}
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS0-ssh.socket b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS0-ssh.socket
new file mode 100644
index 000000000..183a7a4f3
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS0-ssh.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=Phosphor Host Console SSH Per-Connection socket
+Wants=obmc-console@ttyS0.service
+
+[Socket]
+ListenStream=2200
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS0-ssh@.service b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS0-ssh@.service
new file mode 100644
index 000000000..f964454e0
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS0-ssh@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Phosphor Host Console SSH Per-Connection
+Wants=obmc-console@ttyS0.service
+
+[Service]
+Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
+EnvironmentFile=/etc/default/dropbear
+ExecStart=/usr/sbin/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -c /etc/obmc-console/server.ttyS0.conf" -p ttyS0 -F $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=dropbear
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS1-ssh.socket b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS1-ssh.socket
new file mode 100644
index 000000000..bdbf56258
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS1-ssh.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=Phosphor Host Console SSH Per-Connection socket
+Wants=obmc-console@ttyS1.service
+
+[Socket]
+ListenStream=2201
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS1-ssh@.service b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS1-ssh@.service
new file mode 100644
index 000000000..697c24271
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS1-ssh@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Phosphor Host Console SSH Per-Connection
+Wants=obmc-console@ttyS1.service
+
+[Service]
+Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
+EnvironmentFile=/etc/default/dropbear
+ExecStart=/usr/sbin/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -c /etc/obmc-console/server.ttyS1.conf" -p ttyS1 -F $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=dropbear
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS2-ssh.socket b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS2-ssh.socket
new file mode 100644
index 000000000..f8934fd41
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS2-ssh.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=Phosphor Host Console SSH Per-Connection socket
+Wants=obmc-console@ttyS2.service
+
+[Socket]
+ListenStream=2202
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS2-ssh@.service b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS2-ssh@.service
new file mode 100644
index 000000000..7d7f31490
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS2-ssh@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Phosphor Host Console SSH Per-Connection
+Wants=obmc-console@ttyS2.service
+
+[Service]
+Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
+EnvironmentFile=/etc/default/dropbear
+ExecStart=/usr/sbin/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -c /etc/obmc-console/server.ttyS2.conf" -p ttyS2 -F $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=dropbear
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS3-ssh.socket b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS3-ssh.socket
new file mode 100644
index 000000000..fd7f3e3f9
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS3-ssh.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=Phosphor Host Console SSH Per-Connection socket
+Wants=obmc-console@ttyS3.service
+
+[Socket]
+ListenStream=2203
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS3-ssh@.service b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS3-ssh@.service
new file mode 100644
index 000000000..261f3a12e
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-ttyS3-ssh@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Phosphor Host Console SSH Per-Connection
+Wants=obmc-console@ttyS3.service
+
+[Service]
+Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
+EnvironmentFile=/etc/default/dropbear
+ExecStart=/usr/sbin/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -c /etc/obmc-console/server.ttyS3.conf" -p ttyS3 -F $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=dropbear
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console@.service b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console@.service
new file mode 100644
index 000000000..22a5df269
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console@.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Phosphor Console Muxer listening on device /dev/%I
+BindsTo=dev-%i.device
+After=dev-%i.device
+StartLimitBurst=3
+StartLimitIntervalSec=300
+
+[Service]
+ExecStart=/usr/sbin/obmc-console-server-setup.sh %i
+SyslogIdentifier=obmc-console-server
+Restart=always
+RestartSec=10
+TimeoutStartSec=60
+TimeoutStopSec=60
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS0.conf b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS0.conf
new file mode 100644
index 000000000..2d02a5138
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS0.conf
@@ -0,0 +1,3 @@
+local-tty = ttyS0
+local-tty-baud = 115200
+logfile = /var/log/obmc-console-cpu.log
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS1.conf b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS1.conf
new file mode 100644
index 000000000..a77188412
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS1.conf
@@ -0,0 +1,4 @@
+local-tty = ttyS1
+local-tty-baud = 115200
+socket-id = ttyS1
+logfile = /var/log/obmc-console-scp0.log
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS2.conf b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS2.conf
new file mode 100644
index 000000000..7ac6953e4
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS2.conf
@@ -0,0 +1,4 @@
+local-tty = ttyS2
+local-tty-baud = 115200
+socket-id = ttyS2
+logfile = /var/log/obmc-console-atf.log
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS3.conf b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS3.conf
new file mode 100644
index 000000000..0ec1b693b
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/server.ttyS3.conf
@@ -0,0 +1,4 @@
+local-tty = ttyS3
+local-tty-baud = 115200
+socket-id = ttyS3
+logfile = /var/log/obmc-console-scp1.log
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console_%.bbappend
new file mode 100644
index 000000000..452554c28
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console_%.bbappend
@@ -0,0 +1,54 @@
+FILESEXTRAPATHS_append := "${THISDIR}/${PN}:"
+RDEPENDS_${PN} += "bash"
+
+# Remove what installed by common recipe
+OBMC_CONSOLE_HOST_TTY = ""
+SYSTEMD_SUBSTITUTIONS_remove += "OBMC_CONSOLE_HOST_TTY:${OBMC_CONSOLE_HOST_TTY}:${PN}-ssh@.service"
+SYSTEMD_SUBSTITUTIONS_remove += "OBMC_CONSOLE_HOST_TTY:${OBMC_CONSOLE_HOST_TTY}:${PN}-ssh.socket"
+SYSTEMD_SERVICE_${PN}_remove = " \
+ ${PN}-ssh.socket \
+ ${PN}-ssh@.service \
+ "
+
+# Declare port spcific conf and service files
+HOST_CONSOLE_TTY = "ttyS0 ttyS1 ttyS2 ttyS3"
+
+CONSOLE_CONF_FMT = "file://server.{0}.conf"
+SRC_URI += "${@compose_list(d, 'CONSOLE_CONF_FMT', 'HOST_CONSOLE_TTY')}"
+SRC_URI += "file://${BPN}-server-setup.sh"
+SRC_URI += "file://${BPN}@.service"
+SRC_URI += "file://ampere_uartmux_ctrl.sh"
+
+CONSOLE_SSH_SOCKET_FILE_FMT = "file://${PN}-{0}-ssh.socket"
+CONSOLE_SSH_SERVICE_FILE_FMT = "file://${PN}-{0}-ssh@.service"
+SRC_URI += "${@compose_list(d, 'CONSOLE_SSH_SOCKET_FILE_FMT', 'HOST_CONSOLE_TTY')}"
+SRC_URI += "${@compose_list(d, 'CONSOLE_SSH_SERVICE_FILE_FMT', 'HOST_CONSOLE_TTY')}"
+
+CONSOLE_SSH_SOCKET_FMT = "${PN}-{0}-ssh.socket"
+CONSOLE_SSH_SERVICE_FMT = "${PN}-{0}-ssh@.service"
+
+SYSTEMD_SERVICE_${PN} = " \
+ ${PN}@.service \
+ ${@compose_list(d, 'CONSOLE_SSH_SOCKET_FMT', 'HOST_CONSOLE_TTY')} \
+ ${@compose_list(d, 'CONSOLE_SSH_SERVICE_FMT', 'HOST_CONSOLE_TTY')} \
+ "
+do_install_append() {
+ for i in ${HOST_CONSOLE_TTY}
+ do
+ install -m 0644 ${WORKDIR}/server.${i}.conf ${D}${sysconfdir}/${BPN}/server.${i}.conf
+ install -m 0644 ${WORKDIR}/${BPN}-${i}-ssh.socket ${D}${systemd_unitdir}/system/${BPN}-${i}-ssh.socket
+ install -m 0644 ${WORKDIR}/${BPN}-${i}-ssh@.service ${D}${systemd_unitdir}/system/${BPN}-${i}-ssh@.service
+ done
+ install -m 0755 ${WORKDIR}/${BPN}-server-setup.sh ${D}${sbindir}/${BPN}-server-setup.sh
+
+ # Deal with files installed by the base package's .bb install function
+ rm -f ${D}${sysconfdir}/${BPN}.conf
+ rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
+ rm -rf ${D}${systemd_unitdir}/system/${BPN}-ssh@.service.d/
+ rm -f ${D}${systemd_unitdir}/system/${BPN}-ssh@.service
+ rm -f ${D}${systemd_unitdir}/system/${BPN}-ssh.socket
+ # Overwrite base package's obmc-console@.service with our own
+ install -m 0644 ${WORKDIR}/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
+ install -d ${D}/usr/sbin
+ install -m 0755 ${WORKDIR}/ampere_uartmux_ctrl.sh ${D}/${sbindir}/ampere_uartmux_ctrl.sh
+}
diff --git a/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup.bb b/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup.bb
new file mode 100644
index 000000000..0c4b56f72
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Copy the inventory cleanup yaml for inventory manager"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit allarch
+inherit phosphor-inventory-manager
+
+S = "${WORKDIR}"
+
+SRC_URI = "file://inventory-cleanup.yaml"
+
+do_install() {
+ install -D inventory-cleanup.yaml ${D}${base_datadir}/events.d/inventory-cleanup.yaml
+}
+
+FILES_${PN} += "${base_datadir}/events.d/inventory-cleanup.yaml"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml b/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml
new file mode 100644
index 000000000..e900ad789
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml
@@ -0,0 +1,16 @@
+description: >
+ Mt.Jade inventory fixups
+
+events:
+ - name: Add Chassis interface
+ description: >
+ Add the chassis interface on the chassis inventory path
+ type: startup
+ actions:
+ - name: createObjects
+ objs:
+ /system/chassis:
+ xyz.openbmc_project.Inventory.Item.Chassis:
+ Type:
+ value: "RackMount"
+ type: string
diff --git a/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json b/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json
new file mode 100644
index 000000000..bc9cfee32
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json
@@ -0,0 +1,72 @@
+[
+ {
+ "path": "system/chassis",
+ "endpoints":
+ [
+ {
+ "types":
+ {
+ "rType": "chassis",
+ "fType": "all_sensors"
+ },
+ "paths":
+ [
+ "/xyz/openbmc_project/sensors/fan_tach/FAN3_1",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN3_2",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN4_1",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN4_2",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN5_1",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN5_2",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN6_1",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN6_2",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN7_1",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN7_2",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN8_1",
+ "/xyz/openbmc_project/sensors/fan_tach/FAN8_2",
+ "/xyz/openbmc_project/sensors/fan_tach/PSU0_fan1",
+ "/xyz/openbmc_project/sensors/fan_tach/PSU1_fan1",
+
+ "/xyz/openbmc_project/sensors/temperature/TS1_Temp",
+ "/xyz/openbmc_project/sensors/temperature/TS2_Temp",
+ "/xyz/openbmc_project/sensors/temperature/TS3_Temp",
+ "/xyz/openbmc_project/sensors/temperature/TS4_Temp",
+ "/xyz/openbmc_project/sensors/temperature/TS5_Temp",
+ "/xyz/openbmc_project/sensors/temperature/TS6_Temp",
+ "/xyz/openbmc_project/sensors/temperature/PSU0_TEMP",
+ "/xyz/openbmc_project/sensors/temperature/PSU1_TEMP",
+
+ "/xyz/openbmc_project/sensors/voltage/S0_0V6_VTT0123",
+ "/xyz/openbmc_project/sensors/voltage/S0_0V6_VTT4567",
+ "/xyz/openbmc_project/sensors/voltage/S0_0V75_PCP",
+ "/xyz/openbmc_project/sensors/voltage/S0_0V8_VDDC_SOC",
+ "/xyz/openbmc_project/sensors/voltage/S0_0V85_RCA",
+ "/xyz/openbmc_project/sensors/voltage/S0_1V2_VDDQ0123",
+ "/xyz/openbmc_project/sensors/voltage/S0_1V2_VDDQ4567",
+ "/xyz/openbmc_project/sensors/voltage/S0_1V5_VDDH",
+ "/xyz/openbmc_project/sensors/voltage/S0_1V8_VDDH",
+ "/xyz/openbmc_project/sensors/voltage/S0_1V8_SOC",
+ "/xyz/openbmc_project/sensors/voltage/S0_1V8_PCP",
+ "/xyz/openbmc_project/sensors/voltage/S0_2V5_VPP0123",
+ "/xyz/openbmc_project/sensors/voltage/S0_2V5_VPP4567",
+ "/xyz/openbmc_project/sensors/voltage/S0_3V3_SOC",
+ "/xyz/openbmc_project/sensors/voltage/S1_0V6_VTT0123",
+ "/xyz/openbmc_project/sensors/voltage/S1_0V6_VTT4567",
+ "/xyz/openbmc_project/sensors/voltage/S1_0V75_PCP",
+ "/xyz/openbmc_project/sensors/voltage/S1_0V8_VDDC_SOC",
+ "/xyz/openbmc_project/sensors/voltage/S1_0V85_RCA",
+ "/xyz/openbmc_project/sensors/voltage/S1_1V2_VDDQ0123",
+ "/xyz/openbmc_project/sensors/voltage/S1_1V2_VDDQ4567",
+ "/xyz/openbmc_project/sensors/voltage/S1_1V5_VDDH",
+ "/xyz/openbmc_project/sensors/voltage/S1_1V8_VDDH",
+ "/xyz/openbmc_project/sensors/voltage/S1_1V8_SOC",
+ "/xyz/openbmc_project/sensors/voltage/S1_1V8_PCP",
+ "/xyz/openbmc_project/sensors/voltage/S1_2V5_VPP0123",
+ "/xyz/openbmc_project/sensors/voltage/S1_2V5_VPP4567",
+ "/xyz/openbmc_project/sensors/voltage/S1_3V3_SOC",
+ "/xyz/openbmc_project/sensors/voltage/3V3_SB",
+ "/xyz/openbmc_project/sensors/voltage/VBAT_RTC"
+ ]
+ }
+ ]
+ }
+]
diff --git a/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend
new file mode 100644
index 000000000..a8856809b
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend
@@ -0,0 +1,10 @@
+DEPENDS_append_mtjade = " inventory-cleanup"
+
+FILESEXTRAPATHS_prepend_mtjade := "${THISDIR}/${PN}:"
+PACKAGECONFIG_append_mtjade = " associations"
+SRC_URI_append_mtjade = " file://associations.json"
+
+do_install_append_mtjade() {
+ install -d ${D}${base_datadir}
+ install -m 0755 ${WORKDIR}/associations.json ${D}${base_datadir}
+}
diff --git a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
new file mode 100644
index 000000000..83a929746
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_append_mtjade := "${THISDIR}/${PN}:"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json
new file mode 100644
index 000000000..5d8510ee6
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json
@@ -0,0 +1,2 @@
+{"id": 32, "revision": 1, "addn_dev_support": 141,
+ "manuf_id": 52538, "prod_id": 130, "aux": 0}
diff --git a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/motherboard b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/motherboard
new file mode 100644
index 000000000..f0498347b
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/motherboard
@@ -0,0 +1,2 @@
+SYSFS_PATH=/sys/bus/i2c/devices/3-0050/eeprom
+FRUID=0
diff --git a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend
new file mode 100644
index 000000000..be3e7fe5e
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend
@@ -0,0 +1,26 @@
+inherit obmc-phosphor-systemd
+
+DEPENDS_append_mtjade = " mtjade-yaml-config"
+
+EXTRA_OECONF_mtjade = " \
+ YAML_GEN=${STAGING_DIR_HOST}${datadir}/mtjade-yaml-config/ipmi-fru-read.yaml \
+ PROP_YAML=${STAGING_DIR_HOST}${datadir}/mtjade-yaml-config/ipmi-extra-properties.yaml \
+ "
+FILESEXTRAPATHS_prepend_mtjade := "${THISDIR}/${PN}:"
+
+EEPROM_NAMES = "motherboard"
+
+EEPROMFMT = "system/chassis/{0}"
+EEPROM_ESCAPEDFMT = "system-chassis-{0}"
+EEPROMS = "${@compose_list(d, 'EEPROMFMT', 'EEPROM_NAMES')}"
+EEPROMS_ESCAPED = "${@compose_list(d, 'EEPROM_ESCAPEDFMT', 'EEPROM_NAMES')}"
+
+ENVFMT = "obmc/eeproms/{0}"
+SYSTEMD_ENVIRONMENT_FILE_${PN}_append_mtjade := "${@compose_list(d, 'ENVFMT', 'EEPROMS')}"
+
+TMPL = "obmc-read-eeprom@.service"
+TGT = "multi-user.target"
+INSTFMT = "obmc-read-eeprom@{0}.service"
+FMT = "../${TMPL}:${TGT}.wants/${INSTFMT}"
+
+SYSTEMD_LINK_${PN}_append_mtjade := "${@compose_list(d, 'FMT', 'EEPROMS_ESCAPED')}"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
new file mode 100644
index 000000000..980746ede
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
@@ -0,0 +1,14 @@
+FILESEXTRAPATHS_append_mtjade := "${THISDIR}/${PN}:"
+
+DEPENDS_append_mtjade = " mtjade-yaml-config"
+
+RRECOMMENDS_${PN} += "ipmitool"
+
+EXTRA_OECONF_mtjade = " \
+ FRU_YAML_GEN=${STAGING_DIR_HOST}${datadir}/mtjade-yaml-config/ipmi-fru-read.yaml \
+ "
+
+do_install_append_mtjade(){
+ install -d ${D}${includedir}/phosphor-ipmi-host
+ install -m 0644 -D ${S}/selutility.hpp ${D}${includedir}/phosphor-ipmi-host
+}
diff --git a/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
new file mode 100644
index 000000000..07bff9390
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
@@ -0,0 +1 @@
+RDEPENDS_${PN}-extras_append_mtjade = " phosphor-webui phosphor-image-signing"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@28.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@28.conf
new file mode 100644
index 000000000..2ea76ae96
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@28.conf
@@ -0,0 +1,5 @@
+LABEL_temp1=TS1_Temp
+CRITHI_temp1=50000
+CRITLO_temp1=1000
+WARNHI_temp1=48000
+WARNLO_temp1=3000
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@29.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@29.conf
new file mode 100644
index 000000000..186ae09d7
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@29.conf
@@ -0,0 +1,5 @@
+LABEL_temp1=TS2_Temp
+CRITHI_temp1=50000
+CRITLO_temp1=1000
+WARNHI_temp1=48000
+WARNLO_temp1=3000
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2a.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2a.conf
new file mode 100644
index 000000000..f87872b84
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2a.conf
@@ -0,0 +1,5 @@
+LABEL_temp1=TS3_Temp
+CRITHI_temp1=50000
+CRITLO_temp1=1000
+WARNHI_temp1=48000
+WARNLO_temp1=3000
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2b.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2b.conf
new file mode 100644
index 000000000..a2229ece9
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2b.conf
@@ -0,0 +1,5 @@
+LABEL_temp1=TS4_Temp
+CRITHI_temp1=50000
+CRITLO_temp1=1000
+WARNHI_temp1=48000
+WARNLO_temp1=3000
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2c.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2c.conf
new file mode 100644
index 000000000..4cd5b1bfc
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2c.conf
@@ -0,0 +1,5 @@
+LABEL_temp1=TS5_Temp
+CRITHI_temp1=50000
+CRITLO_temp1=1000
+WARNHI_temp1=48000
+WARNLO_temp1=3000
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2d.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2d.conf
new file mode 100644
index 000000000..6f72d2a21
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/tmp175@2d.conf
@@ -0,0 +1,5 @@
+LABEL_temp1=TS6_Temp
+CRITHI_temp1=50000
+CRITLO_temp1=1000
+WARNHI_temp1=48000
+WARNLO_temp1=3000
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@1c0/psu@58.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@1c0/psu@58.conf
new file mode 100644
index 000000000..a1ff27801
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@1c0/psu@58.conf
@@ -0,0 +1,15 @@
+LABEL_temp1= "PSU0_TEMP"
+CRITHI_temp1=64000
+CRITLO_temp1=1000
+WARNHI_temp1=62000
+WARNLO_temp1=3000
+
+LABEL_power2= "PSU0_POUT"
+
+LABEL_fan1="PSU0_fan1"
+CRITHI_fan1=20300
+CRITLO_fan1=500
+WARNHI_fan1=19300
+WARNLO_fan1=600
+
+INTERVAL=10000000
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@1c0/psu@59.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@1c0/psu@59.conf
new file mode 100644
index 000000000..f1e722241
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/bus@1e78a000/i2c-bus@1c0/psu@59.conf
@@ -0,0 +1,15 @@
+LABEL_temp1 = "PSU1_TEMP"
+CRITHI_temp1=64000
+CRITLO_temp1=1000
+WARNHI_temp1=62000
+WARNLO_temp1=3000
+
+LABEL_power2 = "PSU1_POUT"
+
+LABEL_fan1 = "PSU1_fan1"
+CRITHI_fan1=20300
+CRITLO_fan1=500
+WARNHI_fan1=19300
+WARNLO_fan1=600
+
+INTERVAL=10000000
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/pwm-tacho-controller@1e786000.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/pwm-tacho-controller@1e786000.conf
new file mode 100644
index 000000000..6448c37c5
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/ahb/apb/pwm-tacho-controller@1e786000.conf
@@ -0,0 +1,84 @@
+LABEL_fan5 = "FAN3_1"
+CRITLO_fan5=500
+CRITHI_fan5=23100
+WARNLO_fan5=1600
+WARNHI_fan5=22000
+
+LABEL_fan6 = "FAN3_2"
+CRITLO_fan6=500
+CRITHI_fan6=23100
+WARNLO_fan6=1600
+WARNHI_fan6=22000
+
+LABEL_fan7 = "FAN4_1"
+CRITLO_fan7=500
+CRITHI_fan7=23100
+WARNLO_fan7=1600
+WARNHI_fan7=22000
+
+LABEL_fan8 = "FAN4_2"
+CRITLO_fan8=500
+CRITHI_fan8=23100
+WARNLO_fan8=1600
+WARNHI_fan8=22000
+
+LABEL_fan9 = "FAN5_1"
+CRITLO_fan9=500
+CRITHI_fan9=23100
+WARNLO_fan9=1600
+WARNHI_fan9=22000
+
+LABEL_fan10 = "FAN5_2"
+CRITLO_fan10=500
+CRITHI_fan10=23100
+WARNLO_fan10=1600
+WARNHI_fan10=22000
+
+LABEL_fan11 = "FAN6_1"
+CRITLO_fan11=500
+CRITHI_fan11=23100
+WARNLO_fan11=1600
+WARNHI_fan11=22000
+
+LABEL_fan12 = "FAN6_2"
+CRITLO_fan12=500
+CRITHI_fan12=23100
+WARNLO_fan12=1600
+WARNHI_fan12=22000
+
+LABEL_fan13 = "FAN7_1"
+CRITLO_fan13=500
+CRITHI_fan13=23100
+WARNLO_fan13=1600
+WARNHI_fan13=22000
+
+LABEL_fan14 = "FAN7_2"
+CRITLO_fan14=500
+CRITHI_fan14=23100
+WARNLO_fan14=1600
+WARNHI_fan14=22000
+
+LABEL_fan15 = "FAN8_1"
+CRITLO_fan15=500
+CRITHI_fan15=23100
+WARNLO_fan15=1600
+WARNHI_fan15=22000
+
+LABEL_fan16 = "FAN8_2"
+CRITLO_fan16=500
+CRITHI_fan16=23100
+WARNLO_fan16=1600
+WARNHI_fan16=22000
+
+PWM_TARGET_fan5 = "3"
+PWM_TARGET_fan6 = "3"
+PWM_TARGET_fan7 = "4"
+PWM_TARGET_fan8 = "4"
+PWM_TARGET_fan9 = "5"
+PWM_TARGET_fan10 = "5"
+PWM_TARGET_fan11 = "6"
+PWM_TARGET_fan12 = "6"
+PWM_TARGET_fan13 = "7"
+PWM_TARGET_fan14 = "7"
+PWM_TARGET_fan15 = "8"
+PWM_TARGET_fan16 = "8"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon-adc14.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon-adc14.conf
new file mode 100644
index 000000000..d144cfd28
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon-adc14.conf
@@ -0,0 +1,6 @@
+LABEL_in1=3V3_SB
+GAIN_in1=3
+CRITHI_in1=3960
+CRITLO_in1=2320
+WARNHI_in1=3920
+WARNLO_in1=2360
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon-battery.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon-battery.conf
new file mode 100644
index 000000000..50a45e3b4
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon-battery.conf
@@ -0,0 +1,13 @@
+LABEL_in1=VBAT_RTC
+GAIN_in1=3
+CRITHI_in1=3564
+CRITLO_in1=2106
+WARNHI_in1=3528
+WARNLO_in1=2142
+
+# GPIOS4 needs to be pulled high for battery voltage reading
+GPIOCHIP_in1=0
+GPIO_in1=148
+
+# Read it every day so it does not impact battery life
+INTERVAL=86400000000
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon.conf b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon.conf
new file mode 100644
index 000000000..46b975d7c
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon/obmc/mtjade/hwmon/iio-hwmon.conf
@@ -0,0 +1,179 @@
+LABEL_in1=S0_0V8_VDDC_SOC
+CRITHI_in1=960
+CRITLO_in1=560
+WARNHI_in1=950
+WARNLO_in1=570
+
+LABEL_in2=S1_0V8_VDDC_SOC
+CRITHI_in2=960
+CRITLO_in2=560
+WARNHI_in2=950
+WARNLO_in2=570
+
+LABEL_in3=S0_0V75_PCP
+CRITHI_in3=1323
+CRITLO_in3=504
+WARNHI_in3=1295
+WARNLO_in3=532
+
+LABEL_in4=S1_0V75_PCP
+CRITHI_in4=1323
+CRITLO_in4=504
+WARNHI_in4=1295
+WARNLO_in4=532
+
+LABEL_in5=S0_1V2_VDDQ0123
+CRITHI_in5=1442
+CRITLO_in5=840
+WARNHI_in5=1330
+WARNLO_in5=854
+
+LABEL_in6=S1_1V2_VDDQ0123
+CRITHI_in6=1442
+CRITLO_in6=840
+WARNHI_in6=1330
+WARNLO_in6=854
+
+LABEL_in7=S0_0V6_VTT0123
+CRITHI_in7=720
+CRITLO_in7=420
+WARNHI_in7=712
+WARNLO_in7=428
+
+LABEL_in8=S1_0V6_VTT0123
+CRITHI_in8=720
+CRITLO_in8=420
+WARNHI_in8=648
+WARNLO_in8=460
+
+LABEL_in9=S0_2V5_VPP0123
+GAIN_in9=2
+CRITHI_in9=3000
+CRITLO_in9=1755
+WARNHI_in9=2970
+WARNLO_in9=1785
+
+LABEL_in10=S1_2V5_VPP0123
+GAIN_in10=2
+CRITHI_in10=3000
+CRITLO_in10=1755
+WARNHI_in10=2970
+WARNLO_in10=1785
+
+LABEL_in11=S0_1V2_VDDQ4567
+CRITHI_in11=1442
+CRITLO_in11=840
+WARNHI_in11=1330
+WARNLO_in11=854
+
+LABEL_in12=S1_1V2_VDDQ4567
+CRITHI_in12=1442
+CRITLO_in12=840
+WARNHI_in12=1330
+WARNLO_in12=854
+
+LABEL_in13=S0_0V6_VTT4567
+CRITHI_in13=720
+CRITLO_in13=420
+WARNHI_in13=712
+WARNLO_in13=428
+
+LABEL_in14=S1_0V6_VTT4567
+CRITHI_in14=720
+CRITLO_in14=420
+WARNHI_in14=712
+WARNLO_in14=428
+
+LABEL_in15=S0_2V5_VPP4567
+GAIN_in15=2
+CRITHI_in15=3000
+CRITLO_in15=1755
+WARNHI_in15=2970
+WARNLO_in15=1785
+
+LABEL_in16=S1_2V5_VPP4567
+GAIN_in16=2
+CRITHI_in16=3000
+CRITLO_in16=1755
+WARNHI_in16=2970
+WARNLO_in16=1785
+
+LABEL_in17=S0_0V85_RCA
+CRITHI_in17=1020
+CRITLO_in17=595
+WARNHI_in17=1005
+WARNLO_in17=610
+
+LABEL_in18=S1_0V85_RCA
+CRITHI_in18=1020
+CRITLO_in18=595
+WARNHI_in18=1005
+WARNLO_in18=610
+
+LABEL_in19=S0_1V8_VDDH
+GAIN_in19=2
+CRITHI_in19=2156
+CRITLO_in19=1265
+WARNHI_in19=2134
+WARNLO_in19=1287
+
+LABEL_in20=S1_1V8_VDDH
+GAIN_in20=2
+CRITHI_in20=2156
+CRITLO_in20=1265
+WARNHI_in20=2134
+WARNLO_in20=1287
+
+LABEL_in21=S0_1V5_VDDH
+CRITHI_in21=1800
+CRITLO_in21=1053
+WARNHI_in21=1782
+WARNLO_in21=1071
+
+LABEL_in22=S1_1V5_VDDH
+CRITHI_in22=1800
+CRITLO_in22=1053
+WARNHI_in22=1782
+WARNLO_in22=1071
+
+LABEL_in23=S0_1V8_SOC
+GAIN_in23=2
+CRITHI_in23=2156
+CRITLO_in23=1265
+WARNHI_in23=2134
+WARNLO_in23=1287
+
+LABEL_in24=S1_1V8_SOC
+GAIN_in24=2
+CRITHI_in24=2156
+CRITLO_in24=1265
+WARNHI_in24=2134
+WARNLO_in24=1287
+
+LABEL_in25=S0_1V8_PCP
+GAIN_in25=2
+CRITHI_in25=2156
+CRITLO_in25=1265
+WARNHI_in25=2134
+WARNLO_in25=1287
+
+LABEL_in26=S1_1V8_PCP
+GAIN_in26=2
+CRITHI_in26=2156
+CRITLO_in26=1265
+WARNHI_in26=2134
+WARNLO_in26=1287
+
+LABEL_in27=S0_3V3_SOC
+GAIN_in27=3
+CRITHI_in27=3960
+CRITLO_in27=2320
+WARNHI_in27=3920
+WARNLO_in27=2360
+
+LABEL_in28=S1_3V3_SOC
+GAIN_in28=3
+CRITHI_in28=3960
+CRITLO_in28=2320
+WARNHI_in28=3920
+WARNLO_in28=2360
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
new file mode 100644
index 000000000..e69b83e14
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
@@ -0,0 +1,31 @@
+FILESEXTRAPATHS_append_mtjade := "${THISDIR}/${PN}:"
+
+EXTRA_OECONF_append_mtjade = " --enable-negative-errno-on-fail"
+
+CHIPS_mtjade = " \
+ bus@1e78a000/i2c-bus@100/tmp175@28 \
+ bus@1e78a000/i2c-bus@100/tmp175@29 \
+ bus@1e78a000/i2c-bus@100/tmp175@2a \
+ bus@1e78a000/i2c-bus@100/tmp175@2b \
+ bus@1e78a000/i2c-bus@100/tmp175@2c \
+ bus@1e78a000/i2c-bus@100/tmp175@2d \
+ bus@1e78a000/i2c-bus@1c0/psu@58 \
+ bus@1e78a000/i2c-bus@1c0/psu@59 \
+ pwm-tacho-controller@1e786000 \
+ "
+
+ITEMSFMT = "ahb/apb/{0}.conf"
+
+ITEMS = "${@compose_list(d, 'ITEMSFMT', 'CHIPS_${MACHINE}')}"
+
+ITEMS += "iio-hwmon.conf iio-hwmon-adc14.conf iio-hwmon-battery.conf"
+
+ENVS = "obmc/${MACHINE}/hwmon/{0}"
+SYSTEMD_ENVIRONMENT_FILE_${PN}_append_mtjade = " ${@compose_list(d, 'ENVS', 'ITEMS')}"
+
+do_install_append_mtjade() {
+ SOURCEDIR="${WORKDIR}/obmc/${MACHINE}/hwmon"
+ DESTDIR="${D}${sysconfdir}/default/obmc"
+ install -d ${DESTDIR}
+ cp -r ${SOURCEDIR} ${DESTDIR}
+}
diff --git a/meta-ampere/meta-jade/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json b/meta-ampere/meta-jade/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json
new file mode 100644
index 000000000..dd218c0c9
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json
@@ -0,0 +1,54 @@
+{
+ "gpio_configs": {
+
+ "power_config": {
+ "power_good_in": "PGOOD",
+ "power_up_outs": [
+ {"name": "BMC_SYS_PSON_L", "polarity": false},
+ {"name": "BMC_READY", "polarity": true}
+ ],
+ "reset_outs": [
+ {"name": "BMC_S0_SYSRESET_L", "polarity": false},
+ {"name": "BMC_S1_SYSRESET_L", "polarity": false}
+ ]
+ }
+ },
+
+ "gpio_definitions": [
+ {
+ "name": "PGOOD",
+ "pin": "F4",
+ "direction": "in"
+ },
+ {
+ "name": "BMC_SYS_PSON_L",
+ "pin": "F2",
+ "direction": "out"
+ },
+ {
+ "name": "BMC_S0_SYSRESET_L",
+ "pin": "L3",
+ "direction": "out"
+ },
+ {
+ "name": "BMC_S1_SYSRESET_L",
+ "pin": "L4",
+ "direction": "out"
+ },
+ {
+ "name": "POWER_BUTTON",
+ "pin": "B4",
+ "direction": "both"
+ },
+ {
+ "name": "RESET_BUTTON",
+ "pin": "R5",
+ "direction": "both"
+ },
+ {
+ "name": "BMC_READY",
+ "pin": "AC5",
+ "direction": "out"
+ }
+ ]
+}
diff --git a/meta-ampere/meta-jade/recipes-phosphor/skeleton/obmc-libobmc-intf_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/skeleton/obmc-libobmc-intf_%.bbappend
new file mode 100644
index 000000000..83a929746
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/skeleton/obmc-libobmc-intf_%.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_append_mtjade := "${THISDIR}/${PN}:"