meta-facebook: yosemite4: Initial commit for yosemite4n

Description:
Add yosemite4n layer under yosemite4.
Add common configurations for yosemite4 and yosemite4n.
Add json file set uboot baudrate to 57600.

Tested:
Build Success.

Change-Id: I7ff2ffa3e008be9d2f132ac6c3f058fa7b33f329
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Signed-off-by: Tim Lee <timlee660101@gmail.com>
Signed-off-by: Ricky CX Wu <ricky.cx.wu.wiwynn@gmail.com>
diff --git a/meta-facebook/meta-yosemite4/conf/machine/include/yosemite4-common.inc b/meta-facebook/meta-yosemite4/conf/machine/include/yosemite4-common.inc
new file mode 100644
index 0000000..60db160
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/conf/machine/include/yosemite4-common.inc
@@ -0,0 +1,19 @@
+MACHINEOVERRIDES =. "yosemite4-common:"
+
+require conf/distro/include/phosphor-static-norootfs.inc
+require conf/distro/include/pldm.inc
+require conf/machine/include/facebook-compute-multihost.inc
+require conf/machine/include/obmc-bsp-common.inc
+require conf/machine/include/facebook-tpm2.inc
+require conf/machine/include/facebook-ncsi-nic.inc
+
+FLASH_SIZE = "131072"
+
+OBMC_HOST_INSTANCES = "1 2 3 4 5 6 7 8"
+# Primary chassis as Sled plus secondary chassis in N slots.
+OBMC_CHASSIS_INSTANCES = "0 ${OBMC_HOST_INSTANCES}"
+
+VIRTUAL-RUNTIME_obmc-host-state-manager = "phosphor-state-manager-host"
+VIRTUAL-RUNTIME_obmc-chassis-state-manager = "phosphor-state-manager-chassis"
+
+PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "yosemite4-led-manager-config-native"
diff --git a/meta-facebook/meta-yosemite4/conf/machine/yosemite4.conf b/meta-facebook/meta-yosemite4/conf/machine/yosemite4.conf
index 802a164..62afa1f 100644
--- a/meta-facebook/meta-yosemite4/conf/machine/yosemite4.conf
+++ b/meta-facebook/meta-yosemite4/conf/machine/yosemite4.conf
@@ -8,23 +8,5 @@
 
 OBMC_COMPATIBLE_NAMES = "com.meta.Hardware.BMC.Model.Yosemite4"
 
-require conf/distro/include/phosphor-static-norootfs.inc
-require conf/distro/include/pldm.inc
-require conf/machine/include/facebook-compute-multihost.inc
 require conf/machine/include/ast2600.inc
-require conf/machine/include/obmc-bsp-common.inc
-require conf/machine/include/facebook-tpm2.inc
-require conf/machine/include/facebook-ncsi-nic.inc
-
-FLASH_SIZE = "131072"
-
-OBMC_HOST_INSTANCES = "1 2 3 4 5 6 7 8"
-# Primary chassis as Sled plus secondary chassis in N slots.
-OBMC_CHASSIS_INSTANCES = "0 ${OBMC_HOST_INSTANCES}"
-
-NCSI_ETH_INTF = "eth0 eth1"
-
-VIRTUAL-RUNTIME_obmc-host-state-manager = "phosphor-state-manager-host"
-VIRTUAL-RUNTIME_obmc-chassis-state-manager = "phosphor-state-manager-chassis"
-
-PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "yosemite4-led-manager-config-native"
\ No newline at end of file
+require conf/machine/include/yosemite4-common.inc
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/layer.conf b/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/layer.conf
new file mode 100644
index 0000000..1f3253f
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/layer.conf
@@ -0,0 +1,14 @@
+# 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"
+
+# Ignore bbappend related to ASPEED in meta-yosemite4
+BBMASK += ".*aspeed.*\.bbappend"
+
+BBFILE_COLLECTIONS += "yosemite4n-layer"
+BBFILE_PATTERN_yosemite4n-layer := "^${LAYERDIR}/"
+
+LAYERSERIES_COMPAT_yosemite4n-layer := "nanbield scarthgap"
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/machine/yosemite4n.conf b/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/machine/yosemite4n.conf
new file mode 100644
index 0000000..643af5e
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/machine/yosemite4n.conf
@@ -0,0 +1,27 @@
+KMACHINE = "nuvoton"
+KERNEL_DEVICETREE = "nuvoton/${KMACHINE}-npcm845-yosemite4.dtb"
+
+UBOOT_MACHINE = "arbel_evb_defconfig"
+UBOOT_DEVICETREE = "nuvoton-npcm845-yosemite4"
+
+IGPS_MACHINE = "EB"
+DEVICE_GEN = "A1"
+
+OBMC_COMPATIBLE_NAMES = "com.meta.Hardware.BMC.Model.Yosemite4N"
+
+ARCH_DEFAULT_KERNELIMAGETYPE:npcm8xx = "Image"
+
+require meta-yosemite4/conf/machine/include/yosemite4-common.inc
+require conf/machine/include/npcm8xx.inc
+
+UBOOT_MKIMAGE:append:npcm8xx = " -E -B 8"
+
+FLASH_UBOOT_OFFSET:flash-131072 = "0"
+FLASH_MANIFEST_OFFSET:flash-131072 = "2808"
+FLASH_UBOOT_ENV_OFFSET:flash-131072 = "2816"
+FLASH_KERNEL_OFFSET:flash-131072 = "3072"
+FLASH_ROFS_OFFSET:flash-131072 = "9216"
+FLASH_RWFS_OFFSET:flash-131072 = "49152"
+
+SECURED_IMAGE = "False"
+TIP_IMAGE = "False"
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/templates/default/bblayers.conf.sample b/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/templates/default/bblayers.conf.sample
new file mode 100644
index 0000000..1073f08
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/templates/default/bblayers.conf.sample
@@ -0,0 +1,21 @@
+# 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-python \
+  ##OEROOT##/meta-security/meta-tpm \
+  ##OEROOT##/meta-phosphor \
+  ##OEROOT##/meta-arm/meta-arm \
+  ##OEROOT##/meta-arm/meta-arm-toolchain \
+  ##OEROOT##/meta-nuvoton \
+  ##OEROOT##/meta-facebook \
+  ##OEROOT##/meta-facebook/meta-yosemite4 \
+  ##OEROOT##/meta-facebook/meta-yosemite4/meta-yosemite4n \
+  "
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/templates/default/conf-notes.txt b/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/templates/default/conf-notes.txt
new file mode 100644
index 0000000..9b3c01a
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/templates/default/conf-notes.txt
@@ -0,0 +1,2 @@
+Common targets are:
+     obmc-phosphor-image
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/templates/default/local.conf.sample b/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/templates/default/local.conf.sample
new file mode 100644
index 0000000..e8ef5ff
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/conf/templates/default/local.conf.sample
@@ -0,0 +1,258 @@
+#
+# 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 ??= "yosemite4n"
+
+#
+# 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"
+
+# Set the root password to '0penBmc'
+# Defaults from meta-phosphor/conf/distro/include/phosphor-defaults.inc
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/images/file/settings.json b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/images/file/settings.json
new file mode 100644
index 0000000..361a78e
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/images/file/settings.json
@@ -0,0 +1,13 @@
+{
+    "BootBlockAndHeader_no_tip.xml":
+    {
+        "vendor": "100",
+        "board_type": "1",
+        "MC_CONFIG": "0x04",
+        "FIU0_CLK_DIVIDER": "0",
+        "FIU1_CLK_DIVIDER": "0",
+        "FIU3_CLK_DIVIDER": "0",
+        "BAUD_RATE": "57600",
+        "DestAddr": "0xFFFD0000"
+    }
+}
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/images/npcm8xx-bootloader_%.bbappend b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/images/npcm8xx-bootloader_%.bbappend
new file mode 100644
index 0000000..3c97a9f
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/images/npcm8xx-bootloader_%.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS:prepend :=  "${THISDIR}/file:"
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_%.bbappend b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_%.bbappend
new file mode 100644
index 0000000..dc0d8ca
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_%.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot-nuvoton:${THISDIR}/../../../../recipes-bsp/uboot/files:"
+
+SRC_URI +="file://yosemite4-common.cfg \
+           file://yosemite4.cfg"
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/u-boot/u-boot-nuvoton/yosemite4.cfg b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/u-boot/u-boot-nuvoton/yosemite4.cfg
new file mode 100644
index 0000000..096f5bd
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/u-boot/u-boot-nuvoton/yosemite4.cfg
@@ -0,0 +1,3 @@
+CONFIG_SYS_SKIP_UART_INIT=y
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND="setenv console ttyS4,57600n8; run common_bootargs; bootm 80300000"
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend
new file mode 100644
index 0000000..0e2c3fd
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:${THISDIR}/../../../../recipes-bsp/uboot/files:"
+
+SRC_URI +="file://yosemite4-common.cfg \
+           file://yosemite4.cfg"
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-kernel/linux/linux-nuvoton/yosemite4.cfg b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-kernel/linux/linux-nuvoton/yosemite4.cfg
new file mode 100644
index 0000000..0db12d8
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-kernel/linux/linux-nuvoton/yosemite4.cfg
@@ -0,0 +1,65 @@
+# TPM drivers
+CONFIG_TCG_TIS_SPI=y
+
+# I2C drivers
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_NPCM=y
+CONFIG_I2C_MUX=y
+
+# SPI controller master driver and spi-gpio
+CONFIG_SPI=y
+CONFIG_SPI_NPCM_FIU=y
+CONFIG_SPI_NPCM_PSPI=y
+
+# Jtag driver
+CONFIG_NUVOTON_JTAG=y
+CONFIG_NPCM8XX_JTAG_MASTER=y
+
+# Enable SGPIO Driver support
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_NPCM_SGPIO=y
+
+# Enable ADC
+CONFIG_NPCM_ADC=y
+CONFIG_IIO=y
+CONFIG_SENSORS_IIO_HWMON=y
+
+# Enable NCSI
+CONFIG_NET_NCSI=y
+
+# Disable unused MDIO functions
+# CONFIG_MDIO_BITBANG is not set
+# CONFIG_MDIO_GPIO is not set
+
+# MUX controller for setting UART switch mode
+CONFIG_IIO_MUX=y
+CONFIG_MULTIPLEXER=y
+CONFIG_MUX_MMIO=y
+
+# Enable UBIFS for static no-rootfs
+CONFIG_MTD_UBI=y
+CONFIG_UBIFS_FS=y
+# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
+
+# Enable VFAT FS
+CONFIG_VFAT_FS=y
+
+# LED
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+
+# I3C drivers
+CONFIG_SVC_I3C_MASTER=y
+CONFIG_NPCM845_I3C_MASTER=y
+
+# MCTP
+CONFIG_MCTP=y
+
+# PMBUS drivers
+CONFIG_PMBUS=y
+CONFIG_SENSORS_PMBUS=y
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-kernel/linux/linux-nuvoton_%.bbappend b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-kernel/linux/linux-nuvoton_%.bbappend
new file mode 100644
index 0000000..cac5c5b
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-kernel/linux/linux-nuvoton_%.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux-nuvoton:${THISDIR}/../../../../recipes-kernel/linux/files:"
+SRC_URI += "file://yosemite4-common.cfg \
+            file://yosemite4.cfg \
+           "
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-networking/mctp/mctp_%.bbappend b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-networking/mctp/mctp_%.bbappend
new file mode 100644
index 0000000..8802adb
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-networking/mctp/mctp_%.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
diff --git a/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-phosphor/images/fb-yosemite4n-phosphor-image.inc b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-phosphor/images/fb-yosemite4n-phosphor-image.inc
new file mode 100644
index 0000000..4de5a24
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-phosphor/images/fb-yosemite4n-phosphor-image.inc
@@ -0,0 +1 @@
+require meta-yosemite4/recipes-phosphor/images/fb-yosemite4-phosphor-image.inc
diff --git a/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-aspeed-sdk/yosemite4.cfg b/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-aspeed-sdk/yosemite4.cfg
deleted file mode 100644
index 1e2a374..0000000
--- a/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-aspeed-sdk/yosemite4.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="console=ttyS4,57600n8 root=/dev/ram rw vmalloc=768M"
-CONFIG_BAUDRATE=57600
diff --git a/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-aspeed-sdk_%.bbappend b/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-aspeed-sdk_%.bbappend
index a35fc42..8f468ce 100644
--- a/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-aspeed-sdk_%.bbappend
+++ b/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-aspeed-sdk_%.bbappend
@@ -1,2 +1,2 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
-SRC_URI +="file://yosemite4.cfg"
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:${THISDIR}/../../../recipes-bsp/uboot/files:"
+SRC_URI +="file://yosemite4-common.cfg"
diff --git a/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_%.bbappend b/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_%.bbappend
index bf843a5..8f468ce 100644
--- a/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_%.bbappend
+++ b/meta-facebook/meta-yosemite4/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_%.bbappend
@@ -1,2 +1,2 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot-aspeed-sdk:"
-SRC_URI +="file://yosemite4.cfg"
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:${THISDIR}/../../../recipes-bsp/uboot/files:"
+SRC_URI +="file://yosemite4-common.cfg"
diff --git a/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed/yosemite4.cfg b/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed/yosemite4.cfg
index c6005a7..6a2cab5 100644
--- a/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed/yosemite4.cfg
+++ b/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed/yosemite4.cfg
@@ -1,11 +1,3 @@
-# TPM drivers
-CONFIG_TCG_TPM=y
-CONFIG_TCG_TIS_CORE=y
-CONFIG_TCG_TIS=y
-CONFIG_TCG_TIS_SPI=m
-# I2C drivers
-CONFIG_I2C=y
-CONFIG_I2C_SLAVE=y
 # I2C mqueue for mctp
 CONFIG_I2C_SLAVE_MQUEUE=m
 CONFIG_I2C_SLAVE_MQUEUE_QUEUE_SIZE=32
@@ -14,8 +6,6 @@
 CONFIG_SPI_ASPEED=y
 CONFIG_SPI_GPIO=y
 # Jtag driver
-CONFIG_JTAG=y
-CONFIG_HAS_IOMEM=y
 CONFIG_JTAG_ASPEED=y
 CONFIG_JTAG_ASPEED_LEGACY_UIO=y
 # device driver
diff --git a/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed_%.bbappend
index 62623af..c0248c3 100644
--- a/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed_%.bbappend
+++ b/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed_%.bbappend
@@ -1,2 +1,3 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/linux-aspeed:"
-SRC_URI += "file://yosemite4.cfg"
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux-aspeed:${THISDIR}/../../../recipes-kernel/linux/files:"
+SRC_URI += "file://yosemite4-common.cfg \
+            file://yosemite4.cfg"
diff --git a/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/mctp-config.sh b/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/mctp-config.sh
index fcb8677..ded51ae 100644
--- a/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/mctp-config.sh
+++ b/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/mctp-config.sh
@@ -1,16 +1,33 @@
 #!/bin/sh
 
-# Set mctpi2c link up and assign local address.
+# Set mctpi2c/mctpi3c link up and assign local address.
 localEid=8
 
-# The Sentinel Dome BICs are on the i2c bus0 to bus7.
+# shellcheck source=meta-facebook/meta-yosemite4/recipes-yosemite4/plat-tool/files/yosemite4-common-functions
+. /usr/libexec/yosemite4-common-functions
+
+is_nuvoton_board="$(check_nuvoton_board)"
+
 busnum=0
-while [ $busnum -le 7 ]
-do
-    mctp link set mctpi2c${busnum} up
-    mctp addr add ${localEid} dev mctpi2c${busnum}
-    busnum=$((busnum+1))
-done
+if [ -n "$is_nuvoton_board" ]; then
+    # Enable MCTP-I3C for Nuvoton BMC
+    # The Sentinel Dome BICs are after the I3C hub on I3C bus0 and bus1.
+    while [ $busnum -le 1 ]
+    do
+        mctp link set mctpi3c${busnum} up
+        mctp addr add ${localEid} dev mctpi3c${busnum}
+        busnum=$((busnum+1))
+    done
+else
+    # Enable MCTP-I2C for ASPEED BMC
+    # The Sentinel Dome BICs are on the i2c bus0 to bus7.
+    while [ $busnum -le 7 ]
+    do
+        mctp link set mctpi2c${busnum} up
+        mctp addr add ${localEid} dev mctpi2c${busnum}
+        busnum=$((busnum+1))
+    done
+fi
 
 # The NICs are on the i2c bus24 to bus27.
 busnum=24
diff --git a/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/nic-gpio-addrs.sh b/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/nic-gpio-addrs.sh
new file mode 100644
index 0000000..bf56636
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/nic-gpio-addrs.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+# shellcheck disable=SC2034
+# shellcheck source=meta-facebook/meta-yosemite4/recipes-yosemite4/plat-tool/files/yosemite4-common-functions
+. /usr/libexec/yosemite4-common-functions
+
+is_nuvoton_board="$(check_nuvoton_board)"
+
+if [ -n "$is_nuvoton_board" ]
+then
+	WIDTH=32
+	# PRSNT_NIC0 is at the 23th bit (GPIO Bank5: GPIO183), 0 means NIC is present
+	PRSNT_NIC0=0xf0015004
+	BITMASK_NIC0=0x800000
+
+	# PRSNT_NIC1 is at the 29th bit (GPIO Bank5: GPIO189), 0 means NIC is present
+	PRSNT_NIC1=0xf0015004
+	BITMASK_NIC1=0x20000000
+
+	# PRSNT_NIC2 is at the 28th bit (GPIO Bank2: GPIO92), 0 means NIC is present
+	PRSNT_NIC2=0xf0012004
+	BITMASK_NIC2=0x10000000
+
+	# PRSNT_NIC3 is at the 24th bit (GPIO Bank5: GPIO184), 0 means NIC is present
+	PRSNT_NIC3=0xf0015004
+	BITMASK_NIC3=0x400000
+else
+	WIDTH=8
+	# PRSNT_NIC0 is at the 6th bit (GPIOU5), 0 means NIC is present
+	PRSNT_NIC0=0x1e780088
+	BITMASK_NIC0=0x20
+
+	# PRSNT_NIC1 is at the 1th bit (GPIOE0), 0 means NIC is present
+	PRSNT_NIC1=0x1e780020
+	BITMASK_NIC1=0x01
+
+	# PRSNT_NIC2 is at the 2th bit (GPIOE1), 0 means NIC is present
+	PRSNT_NIC2=0x1e780020
+	BITMASK_NIC2=0x02
+
+	# PRSNT_NIC3 is at the 4th bit (GPIOM3), 0 means NIC is present
+	PRSNT_NIC3=0x1e780078
+	BITMASK_NIC3=0x08
+fi
diff --git a/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/setup-static-endpoints.sh b/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/setup-static-endpoints.sh
index e71e147..6cacf32 100644
--- a/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/setup-static-endpoints.sh
+++ b/meta-facebook/meta-yosemite4/recipes-networking/mctp/files/setup-static-endpoints.sh
@@ -4,27 +4,29 @@
 # the gpio pin is occupied by gpio-monitor, read the value from
 # gpioget is not possible.
 
+# shellcheck source=meta-facebook/meta-yosemite4/recipes-networking/mctp/files/nic-gpio-addrs.sh
+. /usr/share/mctp/nic-gpio-addrs.sh
+
 # Setup slot1 NIC
-gpio_val=$(devmem 0x1e780088 8)
-# PRSNT_NIC0 is at the 6th bit (GPIOU5), 0 means NIC is present
-if [ $((gpio_val & 0x20)) -eq 0 ]; then
-    systemctl start setup-nic-endpoint-slot@0.service
+gpio_val=$(devmem "$PRSNT_NIC0" "$WIDTH")
+if [ $((gpio_val & "$BITMASK_NIC0")) -eq 0 ]; then
+	systemctl start setup-nic-endpoint-slot@0.service
 fi
 
-# Setup slot2 & 3 NIC
-gpio_val=$(devmem 0x1e780020 8)
-# PRSNT_NIC1 is at the 1th bit (GPIOE0), 0 means NIC is present
-if [ $((gpio_val & 0x01)) -eq 0 ]; then
-    systemctl start setup-nic-endpoint-slot@1.service
+# Setup slot2 NIC
+gpio_val=$(devmem "$PRSNT_NIC1" "$WIDTH")
+if [ $((gpio_val & "$BITMASK_NIC1")) -eq 0 ]; then
+	systemctl start setup-nic-endpoint-slot@1.service
 fi
-# PRSNT_NIC2 is at the 2th bit (GPIOE1), 0 means NIC is present
-if [ $((gpio_val & 0x02)) -eq 0 ]; then
-    systemctl start setup-nic-endpoint-slot@2.service
+
+# Setup slot3 NIC
+gpio_val=$(devmem "$PRSNT_NIC2" "$WIDTH")
+if [ $((gpio_val & "$BITMASK_NIC2")) -eq 0 ]; then
+	systemctl start setup-nic-endpoint-slot@2.service
 fi
 
 # Setup slot4 NIC
-gpio_val=$(devmem 0x1e780078 8)
-# PRSNT_NIC3 is at the 4th bit (GPIOM3), 0 means NIC is present
-if [ $((gpio_val & 0x08)) -eq 0 ]; then
-    systemctl start setup-nic-endpoint-slot@3.service
+gpio_val=$(devmem "$PRSNT_NIC3" "$WIDTH")
+if [ $((gpio_val & "$BITMASK_NIC3")) -eq 0 ]; then
+	systemctl start setup-nic-endpoint-slot@3.service
 fi
diff --git a/meta-facebook/meta-yosemite4/recipes-networking/mctp/mctp_%.bbappend b/meta-facebook/meta-yosemite4/recipes-networking/mctp/mctp_%.bbappend
index 04dcac3..41e2a65 100644
--- a/meta-facebook/meta-yosemite4/recipes-networking/mctp/mctp_%.bbappend
+++ b/meta-facebook/meta-yosemite4/recipes-networking/mctp/mctp_%.bbappend
@@ -1,11 +1,11 @@
 FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
 
-
 SRC_URI += " \
     file://setup-local-eid.conf \
     file://setup-static-endpoints.conf \
     file://mctp-config.sh \
     file://setup-static-endpoints.sh \
+    file://nic-gpio-addrs.sh \
 "
 
 FILES:${PN} += "${systemd_system_unitdir}/*"
@@ -22,4 +22,7 @@
             ${D}${datadir}/mctp/
     install -m 0755 ${WORKDIR}/setup-static-endpoints.sh \
             ${D}${datadir}/mctp/
+    install -d ${D}${datadir}/mctp
+    install -m 0755 ${WORKDIR}/nic-gpio-addrs.sh \
+            ${D}${datadir}/mctp/
 }