meta-evb-nuvoton: add meta-evb-npcm845 layer for Arbel EVB

Create meta-evb-npcm845 layer under meta-evb-nuvoton then make "setup" script
looks for machine config files being present to know that the meta-layer
contains a valid machine for OpenBMC.

Also add symlinks for the machine config files from meta-nuvoton into
meta-evb-nuvoton so that setup recognizes them as valid machines, but
using the phosphor layers.

Tested:
/openbmc$ . setup evb-npcm845
Machine evb-npcm845 found in meta-evb/meta-evb-nuvoton/meta-evb-npcm845
Common targets are:
     obmc-phosphor-image

Signed-off-by: Tim Lee <timlee660101@gmail.com>
Change-Id: I21de23ded94244bed52c571a8e68b38cf498fc54
diff --git a/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/layer.conf b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/layer.conf
new file mode 100644
index 0000000..a1959cc
--- /dev/null
+++ b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/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 += "evb-npcm845"
+BBFILE_PATTERN_evb-npcm845 = "^${LAYERDIR}/"
+LAYERSERIES_COMPAT_evb-npcm845 = "kirkstone langdale"
diff --git a/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/machine/evb-npcm845.conf b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/machine/evb-npcm845.conf
new file mode 100644
index 0000000..e1dd521
--- /dev/null
+++ b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/machine/evb-npcm845.conf
@@ -0,0 +1 @@
+../../../../../meta-nuvoton/conf/machine/evb-npcm845.conf
diff --git a/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/templates/default/bblayers.conf.sample b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/templates/default/bblayers.conf.sample
new file mode 100644
index 0000000..71d9e56
--- /dev/null
+++ b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/templates/default/bblayers.conf.sample
@@ -0,0 +1,20 @@
+# 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-phosphor \
+  ##OEROOT##/meta-arm/meta-arm \
+  ##OEROOT##/meta-arm/meta-arm-toolchain \
+  ##OEROOT##/meta-nuvoton \
+  ##OEROOT##/meta-evb \
+  ##OEROOT##/meta-evb/meta-evb-nuvoton \
+  ##OEROOT##/meta-evb/meta-evb-nuvoton/meta-evb-npcm845 \
+  "
diff --git a/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/templates/default/conf-notes.txt b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/templates/default/conf-notes.txt
new file mode 100644
index 0000000..9b3c01a
--- /dev/null
+++ b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/templates/default/conf-notes.txt
@@ -0,0 +1,2 @@
+Common targets are:
+     obmc-phosphor-image
diff --git a/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/templates/default/local.conf.sample b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/templates/default/local.conf.sample
new file mode 100644
index 0000000..21aaace
--- /dev/null
+++ b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/conf/templates/default/local.conf.sample
@@ -0,0 +1,17 @@
+MACHINE ??= "evb-npcm845"
+DISTRO ?= "openbmc-phosphor"
+PACKAGE_CLASSES ?= "package_ipk"
+SANITY_TESTED_DISTROS:append ?= " *"
+EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
+USER_CLASSES ?= "buildstats"
+PATCHRESOLVE = "noop"
+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"
+CONF_VERSION = "2"
diff --git a/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/recipes-evb-npcm845/packagegroups/packagegroup-evb-npcm845-apps.bb b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/recipes-evb-npcm845/packagegroups/packagegroup-evb-npcm845-apps.bb
new file mode 100644
index 0000000..4958991
--- /dev/null
+++ b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/recipes-evb-npcm845/packagegroups/packagegroup-evb-npcm845-apps.bb
@@ -0,0 +1,62 @@
+SUMMARY = "OpenBMC for EVB NPCM845 system - Applications"
+PR = "r1"
+
+inherit packagegroup
+
+PROVIDES = "${PACKAGES}"
+PACKAGES = " \
+        ${PN}-chassis \
+        ${PN}-fans \
+        ${PN}-flash \
+        ${PN}-system \
+        "
+PROVIDES += "virtual/obmc-chassis-mgmt"
+PROVIDES += "virtual/obmc-fan-mgmt"
+PROVIDES += "virtual/obmc-flash-mgmt"
+PROVIDES += "virtual/obmc-system-mgmt"
+
+RPROVIDES:${PN}-chassis += "virtual-obmc-chassis-mgmt"
+RPROVIDES:${PN}-fans += "virtual-obmc-fan-mgmt"
+RPROVIDES:${PN}-flash += "virtual-obmc-flash-mgmt"
+RPROVIDES:${PN}-system += "virtual-obmc-system-mgmt"
+
+SUMMARY:${PN}-chassis = "EVB NPCM845 Chassis"
+RDEPENDS:${PN}-chassis = " \
+        x86-power-control \
+        "
+
+SUMMARY:${PN}-fans = "EVB NPCM845 Fans"
+RDEPENDS:${PN}-fans = " \
+        phosphor-pid-control \
+        "
+
+SUMMARY:${PN}-flash = "EVB NPCM845 Flash"
+RDEPENDS:${PN}-flash = " \
+        phosphor-ipmi-flash \
+        "
+
+SUMMARY:${PN}-system = "EVB NPCM845 System"
+RDEPENDS:${PN}-system = " \
+        webui-vue \
+        obmc-ikvm \
+        iperf3 \
+        nmon \
+        memtester \
+        htop \
+        ipmitool \
+        phosphor-ipmi-ipmb \
+        nuvoton-ipmi-oem \
+        openssl-bin \
+        openssl-engines \
+        phosphor-host-postd \
+        phosphor-sel-logger \
+        rsyslog \
+        loadsvf \
+        pciutils \
+        dhrystone \
+        phosphor-ecc \
+        phosphor-ipmi-blobs \
+        phosphor-image-signing \
+        optee-client \
+        optee-test \
+        "
diff --git a/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/recipes-kernel/linux/linux-nuvoton/evb-npcm845.cfg b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/recipes-kernel/linux/linux-nuvoton/evb-npcm845.cfg
new file mode 100644
index 0000000..439fa9c
--- /dev/null
+++ b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/recipes-kernel/linux/linux-nuvoton/evb-npcm845.cfg
@@ -0,0 +1,64 @@
+# I2C
+CONFIG_EEPROM_AT24=y
+CONFIG_I2C_SLAVE_EEPROM=y
+
+# USB
+CONFIG_USB_CONFIGFS_ECM_SUBSET=y
+CONFIG_USB_CONFIGFS_ECM=y
+CONFIG_USB_CONFIGFS_EEM=y
+CONFIG_USB_CONFIGFS_F_HID=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
+CONFIG_USB_CONFIGFS_RNDIS=y
+CONFIG_USB_CONFIGFS=y
+CONFIG_USB_F_ECM=y
+CONFIG_USB_F_EEM=y
+CONFIG_USB_F_MASS_STORAGE=y
+CONFIG_USB_F_RNDIS=y
+CONFIG_USB_F_SUBSET=y
+CONFIG_USB_U_ETHER=y
+
+
+# FS
+CONFIG_EXT4_FS=y
+
+CONFIG_NPCM7XX_MCU_FLASH=y
+
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_CDCETHER=y
+CONFIG_USB_NET_RNDIS_HOST=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
+
+# IPMB
+CONFIG_IPMB_DEVICE_INTERFACE=y
+
+#
+# Nuvoton Crypto and test
+#
+CONFIG_NPCM750_OTP=y
+CONFIG_CRYPTO_DEV_NPCM=y
+CONFIG_CRYPTO_DEV_NPCM_AES=y
+CONFIG_CRYPTO_DEV_NPCM_SHA=y
+CONFIG_CRYPTO_TEST=m
+# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
+# reduce kernel module size
+CONFIG_MEDIA_SUPPORT_FILTER=y
+# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
+CONFIG_DEBUG_FS=y
+CONFIG_DYNAMIC_DEBUG=y
+CONFIG_EEPROM_AT25=y
+CONFIG_SPI_GPIO=m
+
+# TEE
+CONFIG_TEE=y
+CONFIG_OPTEE=y
+
+# NCSI
+CONFIG_NET_NCSI=y
diff --git a/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/recipes-kernel/linux/linux-nuvoton_%.bbappend b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/recipes-kernel/linux/linux-nuvoton_%.bbappend
new file mode 100644
index 0000000..0b7b084
--- /dev/null
+++ b/meta-evb/meta-evb-nuvoton/meta-evb-npcm845/recipes-kernel/linux/linux-nuvoton_%.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux-nuvoton:"
+
+SRC_URI:append:evb-npcm845 = " file://evb-npcm845.cfg"