bytedance: g220a: Initial commit for meta-g220a

G220a is an x86 server platform with an ast2500 BMC

(From meta-bytedance rev: f6d9fbafdfa3e5b0088f4d72792f2f3a031009a6)

Signed-off-by: John Wang <wangzhiqiang.bj@bytedance.com>
Change-Id: Ie0851a3e689fa7348cbb812e9ff51ea570632123
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-bytedance/meta-g220a/conf/bblayers.conf.sample b/meta-bytedance/meta-g220a/conf/bblayers.conf.sample
new file mode 100644
index 0000000..9a34c79
--- /dev/null
+++ b/meta-bytedance/meta-g220a/conf/bblayers.conf.sample
@@ -0,0 +1,31 @@
+# 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-x86 \
+  ##OEROOT##/meta-bytedance \
+  ##OEROOT##/meta-bytedance/meta-g220a \
+  "
+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-x86 \
+  ##OEROOT##/meta-bytedance \
+  ##OEROOT##/meta-bytedance/meta-g220a \
+  "
diff --git a/meta-bytedance/meta-g220a/conf/conf-notes.txt b/meta-bytedance/meta-g220a/conf/conf-notes.txt
new file mode 100644
index 0000000..9b3c01a
--- /dev/null
+++ b/meta-bytedance/meta-g220a/conf/conf-notes.txt
@@ -0,0 +1,2 @@
+Common targets are:
+     obmc-phosphor-image
diff --git a/meta-bytedance/meta-g220a/conf/layer.conf b/meta-bytedance/meta-g220a/conf/layer.conf
new file mode 100644
index 0000000..e6e376c
--- /dev/null
+++ b/meta-bytedance/meta-g220a/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 += "g220a-layer"
+BBFILE_PATTERN_g220a-layer := "^${LAYERDIR}/"
+LAYERSERIES_COMPAT_g220a-layer = "dunfell"
diff --git a/meta-bytedance/meta-g220a/conf/local.conf.sample b/meta-bytedance/meta-g220a/conf/local.conf.sample
new file mode 100644
index 0000000..0ebc07e
--- /dev/null
+++ b/meta-bytedance/meta-g220a/conf/local.conf.sample
@@ -0,0 +1,17 @@
+MACHINE ??= "g220a"
+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-bytedance/meta-g220a/conf/machine/g220a.conf b/meta-bytedance/meta-g220a/conf/machine/g220a.conf
new file mode 100644
index 0000000..692c9f6
--- /dev/null
+++ b/meta-bytedance/meta-g220a/conf/machine/g220a.conf
@@ -0,0 +1,35 @@
+KMACHINE = "aspeed"
+KERNEL_DEVICETREE = "${KMACHINE}-bmc-bytedance-${MACHINE}.dtb"
+
+UBOOT_MACHINE = "ast_g5_ncsi_config"
+
+FLASH_SIZE = "65536"
+FLASH_UBOOT_OFFSET = "0"
+FLASH_ROFS_OFFSET = "5632"
+FLASH_RWFS_OFFSET = "49152"
+
+require conf/machine/include/ast2500.inc
+require conf/machine/include/obmc-bsp-common.inc
+require conf/distro/include/phosphor-aspeednic-use-mac2.inc
+
+OBMC_MACHINE_FEATURES += "\
+        obmc-bmc-state-mgmt \
+        obmc-chassis-state-mgmt \
+        obmc-host-ipmi \
+        obmc-host-state-mgmt \
+        obmc-phosphor-chassis-mgmt \
+        obmc-phosphor-fan-mgmt \
+        obmc-phosphor-flash-mgmt \
+        "
+
+VIRTUAL-RUNTIME_obmc-inventory-manager = "entity-manager"
+PREFERRED_PROVIDER_virtual/obmc-inventory-data = "entity-manager"
+
+VIRTUAL-RUNTIME_obmc-host-state-manager ?= "x86-power-control"
+VIRTUAL-RUNTIME_obmc-chassis-state-manager ?= "x86-power-control"
+
+PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-bytedance-apps"
+PREFERRED_PROVIDER_virtual/obmc-fan-mgmt = "packagegroup-bytedance-apps"
+PREFERRED_PROVIDER_virtual/obmc-flash-mgmt = "packagegroup-bytedance-apps"
+PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw ?= "phosphor-ipmi-kcs"
+PREFERRED_PROVIDER_virtual/obmc-system-mgmt = "packagegroup-bytedance-apps"
diff --git a/meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/g220a.cfg b/meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/g220a.cfg
new file mode 100644
index 0000000..799a717
--- /dev/null
+++ b/meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/g220a.cfg
@@ -0,0 +1 @@
+CONFIG_SENSORS_EMC1403=y
diff --git a/meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed_%.bbappend
new file mode 100644
index 0000000..ab351eb
--- /dev/null
+++ b/meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed_%.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append_g220a = " file://g220a.cfg \
+                       "
diff --git a/meta-bytedance/meta-g220a/recipes.txt b/meta-bytedance/meta-g220a/recipes.txt
new file mode 100644
index 0000000..3ec3f4a
--- /dev/null
+++ b/meta-bytedance/meta-g220a/recipes.txt
@@ -0,0 +1,2 @@
+recipes-kernel       - The kernel and generic applications/libraries with strong kernel dependencies
+recipes-phosphor     - Phosphor OpenBMC applications and configuration
diff --git a/meta-bytedance/recipes-phosphor/packagegroups/packagegroup-bytedance-apps.bb b/meta-bytedance/recipes-phosphor/packagegroups/packagegroup-bytedance-apps.bb
new file mode 100644
index 0000000..0740a72
--- /dev/null
+++ b/meta-bytedance/recipes-phosphor/packagegroups/packagegroup-bytedance-apps.bb
@@ -0,0 +1,48 @@
+SUMMARY = "OpenBMC for Bytedance- 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 = "Bytedance Chassis"
+RDEPENDS_${PN}-chassis = " \
+        x86-power-control \
+        "
+
+SUMMARY_${PN}-fans = "Bytedance Fans"
+RDEPENDS_${PN}-fans = " \
+        phosphor-pid-control \
+        "
+
+SUMMARY_${PN}-flash = "Bytedance Flash"
+RDEPENDS_${PN}-flash = " \
+        phosphor-software-manager \
+        "
+
+SUMMARY_${PN}-system = "Bytedance System"
+RDEPENDS_${PN}-system = " \
+        dbus-sensors \
+        phosphor-ipmi-ipmb \
+        phosphor-hostlogger \
+        phosphor-sel-logger \
+        ipmitool \
+        phosphor-post-code-manager \
+        phosphor-host-postd \
+        "
diff --git a/meta-bytedance/recipes.txt b/meta-bytedance/recipes.txt
new file mode 100644
index 0000000..a943f59
--- /dev/null
+++ b/meta-bytedance/recipes.txt
@@ -0,0 +1,3 @@
+recipes-core         - What's needed to build a basic working Linux image including commonly used dependencies
+recipes-kernel       - The kernel and generic applications/libraries with strong kernel dependencies
+recipes-phosphor     - Phosphor OpenBMC applications and configuration