tyan, s8036: Initial commit for TYAN S8036

The TYAN S8036 is a server mainboard with an Aspeed AST2500 BMC.

Signed-off-by: Ali El-Haj-Mahmoud <aaelhaj@google.com>
Change-Id: I80b01ce83fb3538945ddd34f28e38f0cb3c20fc8
diff --git a/meta-tyan/meta-s8036/conf/bblayers.conf.sample b/meta-tyan/meta-s8036/conf/bblayers.conf.sample
new file mode 100644
index 0000000..6e928fa
--- /dev/null
+++ b/meta-tyan/meta-s8036/conf/bblayers.conf.sample
@@ -0,0 +1,19 @@
+# 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-security \
+  ##OEROOT##/meta-phosphor \
+  ##OEROOT##/meta-aspeed \
+  ##OEROOT##/meta-tyan \
+  ##OEROOT##/meta-tyan/meta-s8036 \
+"
diff --git a/meta-tyan/meta-s8036/conf/conf-notes.txt b/meta-tyan/meta-s8036/conf/conf-notes.txt
new file mode 100644
index 0000000..43d4ab0
--- /dev/null
+++ b/meta-tyan/meta-s8036/conf/conf-notes.txt
@@ -0,0 +1,2 @@
+Common targets are:
+    obmc-phosphor-image
diff --git a/meta-tyan/meta-s8036/conf/layer.conf b/meta-tyan/meta-s8036/conf/layer.conf
new file mode 100644
index 0000000..474eafa
--- /dev/null
+++ b/meta-tyan/meta-s8036/conf/layer.conf
@@ -0,0 +1,11 @@
+# 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 += "s8036-layer"
+BBFILE_PATTERN_s8036-layer = "^${LAYERDIR}/"
+BBFILE_PRIORITY_s8036-layer = "5"
+LAYERSERIES_COMPAT_s8036-layer = "honister kirkstone"
diff --git a/meta-tyan/meta-s8036/conf/local.conf.sample b/meta-tyan/meta-s8036/conf/local.conf.sample
new file mode 100644
index 0000000..f954b40
--- /dev/null
+++ b/meta-tyan/meta-s8036/conf/local.conf.sample
@@ -0,0 +1,17 @@
+MACHINE ??= "s8036"
+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 \
+    ABORT,${TMPDIR},100M,1K \
+    ABORT,${DL_DIR},100M,1K \
+    ABORT,${SSTATE_DIR},100M,1K \
+    ABORT,/tmp,10M,1K"
+CONF_VERSION = "2"
diff --git a/meta-tyan/meta-s8036/conf/machine/s8036.conf b/meta-tyan/meta-s8036/conf/machine/s8036.conf
new file mode 100644
index 0000000..d78a501
--- /dev/null
+++ b/meta-tyan/meta-s8036/conf/machine/s8036.conf
@@ -0,0 +1,19 @@
+KMACHINE = "aspeed"
+KERNEL_DEVICETREE = "${KMACHINE}-bmc-tyan-${MACHINE}.dtb"
+
+PREFERRED_PROVIDER_virtual/bootloader = "u-boot-aspeed"
+PREFERRED_PROVIDER_u-boot = "u-boot-aspeed"
+PREFERRED_PROVIDER_u-boot-fw-utils = "u-boot-fw-utils-aspeed"
+UBOOT_MACHINE = "ast_g5_phy_config"
+
+require conf/machine/include/ast2500.inc
+require conf/machine/include/obmc-bsp-common.inc
+require conf/machine/include/tyan.inc
+
+FLASH_SIZE = "32768"
+
+# We don't have configuration for these components yet, so remove them.
+PREFERRED_PROVIDER_virtual/obmc-fan-mgmt = "tyan-dummy"
+IMAGE_FEATURES:remove = "obmc-fan-control"
+IMAGE_FEATURES:remove = "obmc-fan-mgmt"
+IMAGE_FEATURES:remove = "obmc-flash-mgmt"
diff --git a/meta-tyan/meta-s8036/recipes-kernel/linux/linux-aspeed/s8036.cfg b/meta-tyan/meta-s8036/recipes-kernel/linux/linux-aspeed/s8036.cfg
new file mode 100644
index 0000000..691601d
--- /dev/null
+++ b/meta-tyan/meta-s8036/recipes-kernel/linux/linux-aspeed/s8036.cfg
@@ -0,0 +1,10 @@
+CONFIG_ASPEED_UART_ROUTING=y
+CONFIG_DEVMEM=y
+CONFIG_I2C_MUX_GPIO=y
+CONFIG_SENSORS_NCT7802=y
+
+# Support for virtual USB NIC
+CONFIG_USB_U_ETHER=y
+CONFIG_USB_F_ECM=y
+CONFIG_USB_CONFIGFS_ECM=y
+CONFIG_USB_CONFIGFS_ECM_SUBSET=y
diff --git a/meta-tyan/meta-s8036/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-tyan/meta-s8036/recipes-kernel/linux/linux-aspeed_%.bbappend
new file mode 100644
index 0000000..a21c978
--- /dev/null
+++ b/meta-tyan/meta-s8036/recipes-kernel/linux/linux-aspeed_%.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+SRC_URI:append = " \
+  file://s8036.cfg \
+  "
\ No newline at end of file
diff --git a/meta-tyan/meta-s8036/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend b/meta-tyan/meta-s8036/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend
new file mode 100644
index 0000000..ff1d547
--- /dev/null
+++ b/meta-tyan/meta-s8036/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend
@@ -0,0 +1,3 @@
+# Create additional kcsbridge service on /dev/ipmi-kcs1
+KCS_DEVICE_ALT = "ipmi-kcs1"
+SYSTEMD_SERVICE:${PN} += " ${PN}@${KCS_DEVICE_ALT}.service"