Add meta-qualcomm and meta-centriq2400-rep
Initial a new platfom for ARM system
Change-Id: I1f92a54f9b09503c69de4cb8ffd8d31f4fd2d032
Signed-off-by: Ken Chen <chen.kenyy@inventec.com>
diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/conf/layer.conf b/meta-openbmc-machines/meta-arm/meta-qualcomm/conf/layer.conf
new file mode 100644
index 0000000..5079054
--- /dev/null
+++ b/meta-openbmc-machines/meta-arm/meta-qualcomm/conf/layer.conf
@@ -0,0 +1,5 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+BBFILE_COLLECTIONS += "qualcomm"
+BBFILE_PATTERN_qualcomm = ""
diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/conf/machine/include/qualcomm.inc b/meta-openbmc-machines/meta-arm/meta-qualcomm/conf/machine/include/qualcomm.inc
new file mode 100644
index 0000000..976e2d0
--- /dev/null
+++ b/meta-openbmc-machines/meta-arm/meta-qualcomm/conf/machine/include/qualcomm.inc
@@ -0,0 +1,3 @@
+require conf/machine/include/arm.inc
+
+VIRTUAL-RUNTIME_skeleton_workbook = "${MACHINE}-config"
diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/bblayers.conf.sample b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/bblayers.conf.sample
new file mode 100644
index 0000000..b32cfff
--- /dev/null
+++ b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/bblayers.conf.sample
@@ -0,0 +1,37 @@
+# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
+# changes incompatibly
+LCONF_VERSION = "6"
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+
+BBLAYERS ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-poky \
+ ##OEROOT##/import-layers/meta-openembedded/meta-oe \
+ ##OEROOT##/import-layers/meta-openembedded/meta-networking \
+ ##OEROOT##/import-layers/meta-openembedded/meta-perl \
+ ##OEROOT##/import-layers/meta-openembedded/meta-python \
+ ##OEROOT##/import-layers/meta-virtualization \
+ ##OEROOT##/meta-phosphor \
+ ##OEROOT##/meta-openbmc-bsp/meta-aspeed \
+ ##OEROOT##/meta-openbmc-bsp/meta-aspeed/meta-ast2500 \
+ ##OEROOT##/meta-openbmc-machines/meta-arm \
+ ##OEROOT##/meta-openbmc-machines/meta-arm/meta-qualcomm \
+ ##OEROOT##/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep \
+ "
+BBLAYERS_NON_REMOVABLE ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-poky \
+ ##OEROOT##/import-layers/meta-openembedded/meta-oe \
+ ##OEROOT##/import-layers/meta-openembedded/meta-networking \
+ ##OEROOT##/import-layers/meta-openembedded/meta-perl \
+ ##OEROOT##/import-layers/meta-openembedded/meta-python \
+ ##OEROOT##/import-layers/meta-virtualization \
+ ##OEROOT##/meta-phosphor \
+ ##OEROOT##/meta-openbmc-bsp/meta-aspeed \
+ ##OEROOT##/meta-openbmc-bsp/meta-aspeed/meta-ast2500 \
+ ##OEROOT##/meta-openbmc-machines/meta-arm \
+ ##OEROOT##/meta-openbmc-machines/meta-arm/meta-qualcomm \
+ ##OEROOT##/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep \
+ "
diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/conf-notes.txt b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/conf-notes.txt
new file mode 100644
index 0000000..9b3c01a
--- /dev/null
+++ b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/conf-notes.txt
@@ -0,0 +1,2 @@
+Common targets are:
+ obmc-phosphor-image
diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/layer.conf b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/layer.conf
new file mode 100644
index 0000000..670fd43
--- /dev/null
+++ b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/layer.conf
@@ -0,0 +1,9 @@
+# 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 += "centriq2400-rep"
+BBFILE_PATTERN_centriq2400-rep = ""
diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/local.conf.sample b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/local.conf.sample
new file mode 100644
index 0000000..e054bef
--- /dev/null
+++ b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/local.conf.sample
@@ -0,0 +1,21 @@
+MACHINE ??= "centriq2400-rep"
+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"
+INHERIT += "extrausers"
+EXTRA_USERS_PARAMS = " \
+ usermod -p '\$1\$UGMqyqdG\$FZiylVFmRRfl9Z0Ue8G7e/' root; \
+ "
diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/machine/centriq2400-rep.conf b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/machine/centriq2400-rep.conf
new file mode 100644
index 0000000..2fe2483
--- /dev/null
+++ b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/conf/machine/centriq2400-rep.conf
@@ -0,0 +1,13 @@
+KMACHINE = "aspeed"
+KERNEL_DEVICETREE = "${KMACHINE}-ast2500-evb.dtb"
+
+UBOOT_MACHINE = "ast_g5_ncsi_config"
+
+FLASH_SIZE = "32768"
+
+
+PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-hostfw-config= ""
+require conf/machine/include/ast2500.inc
+require conf/machine/include/obmc-bsp-common.inc
+require conf/machine/include/qualcomm.inc
+
diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/workbook/centriq2400-rep-config.bb b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/workbook/centriq2400-rep-config.bb
new file mode 100644
index 0000000..8fbb22f
--- /dev/null
+++ b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/workbook/centriq2400-rep-config.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Qualcomm Rep board wiring"
+DESCRIPTION = "Board wiring information for the Qualcomm Rep system."
+PR = "r1"
+
+inherit allarch
+inherit setuptools
+inherit pythonnative
+inherit obmc-phosphor-license
+
+PROVIDES += "virtual/obmc-inventory-data"
+RPROVIDES_${PN} += "virtual-obmc-inventory-data"
+
+DEPENDS += "python"
+
+S = "${WORKDIR}"
+SRC_URI += "file://Centriq2400-rep.py"
+
+python() {
+ machine = d.getVar('MACHINE', True).capitalize() + '.py'
+ d.setVar('_config_in_skeleton', machine)
+}
+
+do_make_setup() {
+ cp ${S}/${_config_in_skeleton} \
+ ${S}/obmc_system_config.py
+ cat <<EOF > ${S}/setup.py
+from distutils.core import setup
+
+setup(name='${BPN}',
+ version='${PR}',
+ py_modules=['obmc_system_config'],
+ )
+EOF
+}
+
+addtask make_setup after do_patch before do_configure
+
diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/workbook/centriq2400-rep-config/Centriq2400-rep.py b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/workbook/centriq2400-rep-config/Centriq2400-rep.py
new file mode 100644
index 0000000..01cff57
--- /dev/null
+++ b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/workbook/centriq2400-rep-config/Centriq2400-rep.py
@@ -0,0 +1,81 @@
+## System states
+## state can change to next state in 2 ways:
+## - a process emits a GotoSystemState signal with state name to goto
+## - objects specified in EXIT_STATE_DEPEND have started
+SYSTEM_STATES = [
+ 'BASE_APPS',
+ 'BMC_STARTING',
+ 'BMC_READY',
+ 'HOST_POWERING_ON',
+ 'HOST_POWERED_ON',
+ 'HOST_BOOTING',
+ 'HOST_BOOTED',
+ 'HOST_POWERED_OFF',
+]
+
+EXIT_STATE_DEPEND = {
+ 'BASE_APPS' : {
+ '/org/openbmc/sensors': 0,
+ },
+ 'BMC_STARTING' : {
+ '/org/openbmc/control/power0' : 0,
+ '/org/openbmc/control/host0' : 0,
+ '/org/openbmc/control/chassis0' : 0,
+ },
+}
+
+FRU_INSTANCES = {
+'<inventory_root>/system/chassis/motherboard/bmc' : { 'fru_type' : 'BMC','is_fru' : False, 'manufacturer' : 'ASPEED' },
+}
+# I believe these numbers need to match the yaml file used to create the c++ ipmi map.
+# the devices have types, but I don't believe that factors in here, I think these are
+# just unique IDs.
+ID_LOOKUP = {
+ 'FRU' : {},
+ # The number at the end needs to match the FRU ID.
+ # https://github.com/openbmc/skeleton/blob/master/pysystemmgr/system_manager.py#L143
+ # The paramter for it is of type 'y' (unsigned 8-bit integer) presumably decimal?
+ 'FRU_STR' : {},
+ 'SENSOR' : {},
+ 'GPIO_PRESENT' : {}
+}
+
+GPIO_CONFIG = {}
+GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_pin': 'D3', 'direction': 'out' }
+GPIO_CONFIG['PGOOD'] = { 'gpio_pin': 'E2', 'direction': 'in' }
+GPIO_CONFIG['BMC_READY'] = { 'gpio_pin': 'Q4', 'direction': 'out' }
+GPIO_CONFIG['HOST_SPI_SWITCH'] = { 'gpio_pin': 'C7', 'direction': 'out'}
+GPIO_CONFIG['IMC_READY'] = { 'gpio_pin': 'O3', 'direction': 'both' }
+GPIO_CONFIG['IMC_INTERRUPT'] = { 'gpio_pin': 'O4', 'direction': 'both' }
+GPIO_CONFIG['RESET_BUTTON'] = { 'gpio_pin': 'G5', 'direction': 'both' }
+GPIO_CONFIG['QDF_RAS_ERROR_0'] = { 'gpio_pin': 'D6', 'direction': 'in' }
+GPIO_CONFIG['QDF_RAS_ERROR_1'] = { 'gpio_pin': 'D7', 'direction': 'in' }
+GPIO_CONFIG['QDF_RAS_ERROR_2'] = { 'gpio_pin': 'F1', 'direction': 'in' }
+
+GPIO_CONFIGS = {
+ 'power_config' : {
+ 'power_good_in' : 'PGOOD',
+ 'power_up' : [
+#delay in ms
+ ('POWER_BUTTON', 'LOW_HIGH',1000),
+ ],
+ 'power_out' : [
+ ('POWER_BUTTON', 'LOW_HIGH',8000),
+ ],
+ }}
+ 'host_config' : {
+ 'imc_ready' : 'IMC_READY',
+ 'imc_interrupt': 'IMC_INTERRUPT',
+ 'bmc_ready' : 'BMC_READY',
+ 'host_spi_switch' : 'HOST_SPI_SWITCH',
+ },
+}
+
+# Miscellaneous non-poll sensor with system specific properties.
+# The sensor id is the same as those defined in ID_LOOKUP['SENSOR'].
+
+MISC_SENSORS = {
+
+}
+
+# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4