meta-quanta: Add meta-runbmc-nuvoton machine
Initial introduction of Quanta RunBMC family.
The meta-runbmc-nuvoton equipped with Nuvoton NPCM750 BMC SoC.
Tested: Build Quanta RunBMC board and load on the target hardware.
Ensure that BMC boots to console.
(From meta-quanta rev: 3501fdf64a14ad925fa911800f662585eb5b5965)
Change-Id: If43607a2c7ae177ea2c91b406d7d99fcf4450936
Signed-off-by: Samuel Jiang <Samuel.Jiang@quantatw.com>
Signed-off-by: PKLee-Quanta <p.k.lee@quantatw.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-quanta/meta-runbmc-nuvoton/conf/bblayers.conf.sample b/meta-quanta/meta-runbmc-nuvoton/conf/bblayers.conf.sample
new file mode 100644
index 0000000..1e6f3b0
--- /dev/null
+++ b/meta-quanta/meta-runbmc-nuvoton/conf/bblayers.conf.sample
@@ -0,0 +1,27 @@
+# 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-nuvoton \
+ ##OEROOT##/meta-quanta \
+ ##OEROOT##/meta-quanta/meta-runbmc-nuvoton \
+ "
+BBLAYERS_NON_REMOVABLE ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-openembedded/meta-oe \
+ ##OEROOT##/meta-openembedded/meta-networking \
+ ##OEROOT##/meta-openembedded/meta-python \
+ ##OEROOT##/meta-phosphor \
+ ##OEROOT##/meta-nuvoton \
+ ##OEROOT##/meta-quanta \
+ ##OEROOT##/meta-quanta/meta-runbmc-nuvoton \
+ "
diff --git a/meta-quanta/meta-runbmc-nuvoton/conf/conf-notes.txt b/meta-quanta/meta-runbmc-nuvoton/conf/conf-notes.txt
new file mode 100644
index 0000000..9b3c01a
--- /dev/null
+++ b/meta-quanta/meta-runbmc-nuvoton/conf/conf-notes.txt
@@ -0,0 +1,2 @@
+Common targets are:
+ obmc-phosphor-image
diff --git a/meta-quanta/meta-runbmc-nuvoton/conf/layer.conf b/meta-quanta/meta-runbmc-nuvoton/conf/layer.conf
new file mode 100644
index 0000000..0f45bc7
--- /dev/null
+++ b/meta-quanta/meta-runbmc-nuvoton/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 += "runbmc-nuvoton-layer"
+BBFILE_PATTERN_runbmc-nuvoton-layer = ""
+LAYERSERIES_COMPAT_runbmc-nuvoton-layer = "thud"
diff --git a/meta-quanta/meta-runbmc-nuvoton/conf/local.conf.sample b/meta-quanta/meta-runbmc-nuvoton/conf/local.conf.sample
new file mode 100644
index 0000000..37ae2b3
--- /dev/null
+++ b/meta-quanta/meta-runbmc-nuvoton/conf/local.conf.sample
@@ -0,0 +1,17 @@
+MACHINE ??= "runbmc-nuvoton"
+DISTRO ?= "openbmc-phosphor"
+PACKAGE_CLASSES ?= "package_rpm"
+SANITY_TESTED_DISTROS_append ?= " *"
+EXTRA_IMAGE_FEATURES = "debug-tweaks"
+USER_CLASSES ?= "buildstats image-mklibs image-prelink"
+PATCHRESOLVE = "noop"
+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"
+CONF_VERSION = "1"
diff --git a/meta-quanta/meta-runbmc-nuvoton/conf/machine/runbmc-nuvoton.conf b/meta-quanta/meta-runbmc-nuvoton/conf/machine/runbmc-nuvoton.conf
new file mode 100644
index 0000000..4653ce5
--- /dev/null
+++ b/meta-quanta/meta-runbmc-nuvoton/conf/machine/runbmc-nuvoton.conf
@@ -0,0 +1,11 @@
+KMACHINE = "nuvoton"
+KERNEL_DEVICETREE = "${KMACHINE}-npcm750-runbmc.dtb"
+
+UBOOT_MACHINE = "PolegSVB_config"
+
+FLASH_SIZE = "32768"
+require conf/machine/include/npcm7xx.inc
+require conf/machine/include/obmc-bsp-common.inc
+
+IMAGE_FSTYPES += " cpio.${INITRAMFS_CTYPE}.u-boot"
+IMAGE_FSTYPES += " mtd-ubi-tar"
diff --git a/meta-quanta/meta-runbmc-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton/fw_env.config b/meta-quanta/meta-runbmc-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton/fw_env.config
new file mode 100644
index 0000000..0c38427
--- /dev/null
+++ b/meta-quanta/meta-runbmc-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton/fw_env.config
@@ -0,0 +1,24 @@
+# Configuration file for fw_(printenv/setenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+# Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash.
+# Futhermore, if the Flash sector size is ommitted, this value is assumed to
+# be the same as the Environment size, which is valid for NOR and SPI-dataflash
+
+# NOR example
+# MTD device name Device offset Env. size Flash sector size Number of sectors
+/dev/mtd2 0x0000 0x40000 0x4000
+
+# MTD SPI-dataflash example
+# MTD device name Device offset Env. size Flash sector size Number of sectors
+#/dev/mtd5 0x4200 0x4200
+#/dev/mtd6 0x4200 0x4200
+
+# NAND example
+#/dev/mtd0 0x4000 0x4000 0x20000 2
+
+# Block device example
+#/dev/mmcblk0 0xc0000 0x20000
+
+# VFAT example
+#/boot/uboot.env 0x0000 0x4000
diff --git a/meta-quanta/meta-runbmc-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_%.bbappend b/meta-quanta/meta-runbmc-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_%.bbappend
new file mode 100644
index 0000000..91518de
--- /dev/null
+++ b/meta-quanta/meta-runbmc-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_%.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://fw_env.config"
+
+do_install_append () {
+ install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
+}
diff --git a/meta-quanta/meta-runbmc-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend b/meta-quanta/meta-runbmc-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend
new file mode 100644
index 0000000..cdcbecb
--- /dev/null
+++ b/meta-quanta/meta-runbmc-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+UBRANCH = "runbmc_mdio"
+SRC_URI = "git://github.com/Nuvoton-Israel/u-boot.git;branch=${UBRANCH}"
+SRCREV = "${AUTOREV}"
diff --git a/meta-quanta/meta-runbmc-nuvoton/recipes-kernel/linux/linux-nuvoton/runbmc-nuvoton.cfg b/meta-quanta/meta-runbmc-nuvoton/recipes-kernel/linux/linux-nuvoton/runbmc-nuvoton.cfg
new file mode 100644
index 0000000..6890fbe
--- /dev/null
+++ b/meta-quanta/meta-runbmc-nuvoton/recipes-kernel/linux/linux-nuvoton/runbmc-nuvoton.cfg
@@ -0,0 +1,58 @@
+CONFIG_HWMON=y
+CONFIG_SENSORS_TMP100=y
+CONFIG_SENSORS_LM75=y
+CONFIG_SENSORS_FAN=y
+
+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
+
+CONFIG_OVERLAY_FS=y
+CONFIG_SQUASHFS=y
+CONFIG_SQUASHFS_XZ=y
+CONFIG_JFFS2_FS=y
+
+CONFIG_MTD_M25P80=y
+CONFIG_SPI_NPCM_FIU=y
+CONFIG_SPI=y
+CONFIG_SPI_NPCM_PSPI=y
+
+CONFIG_NET_NCSI=y
+
+CONFIG_EEPROM_AT24=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_PCA954x=y
+CONFIG_I2C_SLAVE_EEPROM=y
+CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCA953X_IRQ=y
+CONFIG_GPIO_PCF857X=y
+CONFIG_PMBUS=y
+CONFIG_SENSORS_PMBUS=y
+CONFIG_SENSORS_ADM1275=y
+CONFIG_SENSORS_TMP102=y
+CONFIG_SENSORS_TMP421=y
+CONFIG_NUVOTON_JTAG=y
+CONFIG_MUX_MMIO=y
+CONFIG_USB_U_ETHER=y
+CONFIG_USB_F_ECM=y
+CONFIG_USB_F_EEM=y
+CONFIG_USB_F_SUBSET=y
+CONFIG_USB_F_RNDIS=y
+CONFIG_USB_F_MASS_STORAGE=y
+CONFIG_USB_CONFIGFS=y
+CONFIG_USB_CONFIGFS_ECM=y
+CONFIG_USB_CONFIGFS_ECM_SUBSET=y
+CONFIG_USB_CONFIGFS_RNDIS=y
+CONFIG_USB_CONFIGFS_EEM=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
+CONFIG_USB_CONFIGFS_F_HID=y
+
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_VIDEO_NUVOTON=y
+CONFIG_NPCM750_VCD=y
+CONFIG_NPCM750_ECE=y
+CONFIG_FORCE_MAX_ZONEORDER=12
diff --git a/meta-quanta/meta-runbmc-nuvoton/recipes-kernel/linux/linux-nuvoton_%.bbappend b/meta-quanta/meta-runbmc-nuvoton/recipes-kernel/linux/linux-nuvoton_%.bbappend
new file mode 100644
index 0000000..de375ce
--- /dev/null
+++ b/meta-quanta/meta-runbmc-nuvoton/recipes-kernel/linux/linux-nuvoton_%.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux-nuvoton:"
+
+SRC_URI += "file://runbmc-nuvoton.cfg"