meta-amd: added meta-common folder
This is to keep all AMD layer common recipes at one place.
Change-Id: I5e407e9673437e203dc46d1bb4dea51387a91afd
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/meta-amd/meta-common/conf/layer.conf b/meta-amd/meta-common/conf/layer.conf
new file mode 100644
index 0000000..82f1a93
--- /dev/null
+++ b/meta-amd/meta-common/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 += "common-layer"
+BBFILE_PATTERN_common-layer := "^${LAYERDIR}/"
+LAYERSERIES_COMPAT_common-layer = "nanbield scarthgap"
diff --git a/meta-amd/meta-common/recipes-amd/packagegroups/packagegroup-amd-apps.bb b/meta-amd/meta-common/recipes-amd/packagegroups/packagegroup-amd-apps.bb
new file mode 100644
index 0000000..43a0be0
--- /dev/null
+++ b/meta-amd/meta-common/recipes-amd/packagegroups/packagegroup-amd-apps.bb
@@ -0,0 +1,55 @@
+SUMMARY = "OpenBMC for AMD - Applications"
+PR = "r1"
+
+inherit packagegroup
+
+PROVIDES = "${PACKAGES}"
+PACKAGES = " \
+ ${PN}-fans \
+ ${PN}-flash \
+ ${PN}-system \
+ "
+PACKAGES:append:amd-withhost = " \
+ ${PN}-chassis \
+ ${PN}-hostmgmt \
+ "
+
+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 = "AMD Chassis"
+RDEPENDS:${PN}-chassis = " \
+ x86-power-control \
+ obmc-host-failure-reboots \
+ "
+
+SUMMARY:${PN}-fans = "AMD Fans"
+RDEPENDS:${PN}-fans = " \
+ phosphor-pid-control \
+ "
+
+SUMMARY:${PN}-flash = "AMD Flash"
+RDEPENDS:${PN}-flash = " \
+ phosphor-software-manager \
+ "
+
+SUMMARY:${PN}-system = "AMD System"
+RDEPENDS:${PN}-system = " \
+ dbus-sensors \
+ entity-manager \
+ ipmitool \
+ srvcfg-manager \
+ ${RDEPENDS_PN_SYSTEM_EXTRAS} \
+ "
+RDEPENDS_PN_SYSTEM_EXTRAS = ""
+RDEPENDS_PN_SYSTEM_EXTRAS:amd-withhost = " \
+ amd-fpga \
+ phosphor-hostlogger \
+ "
diff --git a/meta-amd/meta-common/recipes-phosphor/console/obmc-console/daytonax/server.ttyVUART0.conf b/meta-amd/meta-common/recipes-phosphor/console/obmc-console/daytonax/server.ttyVUART0.conf
new file mode 100644
index 0000000..8dc6943
--- /dev/null
+++ b/meta-amd/meta-common/recipes-phosphor/console/obmc-console/daytonax/server.ttyVUART0.conf
@@ -0,0 +1,3 @@
+lpc-address = 0x3f8
+sirq = 4
+baud = 115200
diff --git a/meta-amd/meta-common/recipes-phosphor/console/obmc-console/ethanolx/server.ttyS0.conf b/meta-amd/meta-common/recipes-phosphor/console/obmc-console/ethanolx/server.ttyS0.conf
new file mode 100644
index 0000000..666e66a
--- /dev/null
+++ b/meta-amd/meta-common/recipes-phosphor/console/obmc-console/ethanolx/server.ttyS0.conf
@@ -0,0 +1 @@
+baud = 115200
diff --git a/meta-amd/meta-common/recipes-phosphor/console/obmc-console_%.bbappend b/meta-amd/meta-common/recipes-phosphor/console/obmc-console_%.bbappend
new file mode 100644
index 0000000..8ffa93b
--- /dev/null
+++ b/meta-amd/meta-common/recipes-phosphor/console/obmc-console_%.bbappend
@@ -0,0 +1,17 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/${MACHINE}:"
+OBMC_CONSOLE_HOST_TTY:ethanolx = "ttyS0"
+OBMC_CONSOLE_HOST_TTY:daytonax = "ttyVUART0"
+
+SRC_URI:remove = "file://${BPN}.conf"
+SRC_URI:append:ethanolx = " file://server.ttyS0.conf"
+SRC_URI:append:daytonax = " file://server.ttyVUART0.conf"
+
+do_install:append() {
+ # Remove upstream-provided configuration
+ rm -rf ${D}${sysconfdir}/${BPN}
+
+ # Install the server configuration
+ install -m 0755 -d ${D}${sysconfdir}/${BPN}
+ install -m 0644 ${WORKDIR}/*.conf ${D}${sysconfdir}/${BPN}/
+
+}
diff --git a/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger/daytonax/ttyVUART0.conf b/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger/daytonax/ttyVUART0.conf
new file mode 100644
index 0000000..c751864
--- /dev/null
+++ b/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger/daytonax/ttyVUART0.conf
@@ -0,0 +1,7 @@
+SOCKET_ID=
+BUF_MAXSIZE=3000
+BUF_MAXTIME=0
+FLUSH_FULL=false
+HOST_STATE=/xyz/openbmc_project/state/host0
+OUT_DIR=/var/lib/obmc/hostlogs
+MAX_FILES=10
diff --git a/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger/ethanolx/ttyS0.conf b/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger/ethanolx/ttyS0.conf
new file mode 100644
index 0000000..c751864
--- /dev/null
+++ b/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger/ethanolx/ttyS0.conf
@@ -0,0 +1,7 @@
+SOCKET_ID=
+BUF_MAXSIZE=3000
+BUF_MAXTIME=0
+FLUSH_FULL=false
+HOST_STATE=/xyz/openbmc_project/state/host0
+OUT_DIR=/var/lib/obmc/hostlogs
+MAX_FILES=10
diff --git a/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger_%.bbappend b/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger_%.bbappend
new file mode 100644
index 0000000..690ac8a
--- /dev/null
+++ b/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger_%.bbappend
@@ -0,0 +1,9 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/${MACHINE}:"
+
+# Default service instance to install (single-host mode)
+DEFAULT_INSTANCE:ethanolx = "ttyS0"
+DEFAULT_INSTANCE:daytonax = "ttyVUART0"
+
+SRC_URI:remove = "file://${BPN}.conf"
+SRC_URI:append:ethanolx = " file://ttyS0.conf"
+SRC_URI:append:daytonax = " file://ttyVUART0.conf"
diff --git a/meta-amd/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend b/meta-amd/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend
new file mode 100644
index 0000000..ca35bcb
--- /dev/null
+++ b/meta-amd/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend
@@ -0,0 +1 @@
+PACKAGECONFIG:append = " log-threshold log-pulse"
diff --git a/meta-amd/meta-common/recipes-x86/chassis/x86-power-control/daytonax/power-config-host0.json b/meta-amd/meta-common/recipes-x86/chassis/x86-power-control/daytonax/power-config-host0.json
new file mode 100644
index 0000000..afc8d8b
--- /dev/null
+++ b/meta-amd/meta-common/recipes-x86/chassis/x86-power-control/daytonax/power-config-host0.json
@@ -0,0 +1,64 @@
+{
+ "gpio_configs":[
+ {
+ "Name" : "IdButton",
+ "LineName" : "id-button",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveLow"
+ },
+ {
+ "Name" : "NMIOut",
+ "LineName" : "ASSERT_NMI_BTN",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveLow"
+ },
+ {
+ "Name" : "PostComplete",
+ "LineName" : "power-ok",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveHigh"
+ },
+ {
+ "Name" : "PowerButton",
+ "LineName" : "power-button",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveLow"
+ },
+ {
+ "Name" : "PowerOk",
+ "LineName" : "power-good",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveHigh"
+ },
+ {
+ "Name" : "PowerOut",
+ "LineName" : "power-control",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveLow"
+ },
+ {
+ "Name" : "ResetButton",
+ "LineName" : "reset-button",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveLow"
+ },
+ {
+ "Name" : "ResetOut",
+ "LineName" : "reset-control",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveLow"
+ }
+],
+ "timing_configs":{
+ "PowerPulseMs": 200,
+ "ForceOffPulseMs": 15000,
+ "ResetPulseMs": 500,
+ "PowerCycleMs": 5000,
+ "SioPowerGoodWatchdogMs": 1000,
+ "PsPowerOKWatchdogMs": 8000,
+ "GracefulPowerOffS": 300,
+ "WarmResetCheckMs": 500,
+ "PowerOffSaveMs": 7000
+ }
+}
+
diff --git a/meta-amd/meta-common/recipes-x86/chassis/x86-power-control/ethanolx/power-config-host0.json b/meta-amd/meta-common/recipes-x86/chassis/x86-power-control/ethanolx/power-config-host0.json
new file mode 100644
index 0000000..0d0faf9
--- /dev/null
+++ b/meta-amd/meta-common/recipes-x86/chassis/x86-power-control/ethanolx/power-config-host0.json
@@ -0,0 +1,58 @@
+{
+ "gpio_configs":[
+ {
+ "Name" : "IdButton",
+ "LineName" : "CHASSIS_ID_BTN",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveLow"
+ },
+ {
+ "Name" : "NMIButton",
+ "LineName" : "MON_P0_NMI_BTN",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveLow"
+ },
+ {
+ "Name" : "NMIOut",
+ "LineName" : "ASSERT_NMI_BTN",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveHigh"
+ },
+ {
+ "Name" : "PostComplete",
+ "LineName" : "MON_PWROK",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveHigh"
+ },
+ {
+ "Name" : "PowerButton",
+ "LineName" : "MON_P0_PWR_BTN",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveLow"
+ },
+ {
+ "Name" : "PowerOk",
+ "LineName" : "MON_P0_PWR_GOOD",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveHigh"
+ },
+ {
+ "Name" : "PowerOut",
+ "LineName" : "ASSERT_PWR_BTN",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveHigh"
+ },
+ {
+ "Name" : "ResetButton",
+ "LineName" : "MON_P0_RST_BTN",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveLow"
+ },
+ {
+ "Name" : "ResetOut",
+ "LineName" : "ASSERT_RST_BTN",
+ "Type" : "GPIO",
+ "Polarity" : "ActiveHigh"
+ }
+]
+}
diff --git a/meta-amd/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend b/meta-amd/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend
new file mode 100644
index 0000000..b2e79a8
--- /dev/null
+++ b/meta-amd/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend
@@ -0,0 +1,16 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/${MACHINE}:"
+
+SRC_URI:append:ethanolx = " file://power-config-host0.json"
+SRC_URI:append:daytonax = " file://power-config-host0.json"
+
+do_install:append:ethanolx() {
+ install -m 0755 -d ${D}/${datadir}/${PN}
+ install -m 0644 -D ${WORKDIR}/power-config-host0.json \
+ ${D}/${datadir}/${PN}/
+}
+
+do_install:append:daytonax() {
+ install -m 0755 -d ${D}/${datadir}/${PN}
+ install -m 0644 -D ${WORKDIR}/power-config-host0.json \
+ ${D}/${datadir}/${PN}/
+}