meta-evb: meta-evb-arm: Add new board FVP Base Board

This layer contains a reference implementation of OpenBMC for
Armv-A Base RevC AEM FVP.

Tested:
    - Build success
    - booted to bmc kernel shell

Change-Id: Ie1b100a78232fb986377e3b58d637b97bbf64f42
Signed-off-by: Lean Sheng Tan <sheng.tan@9elements.com>
diff --git a/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/layer.conf b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/layer.conf
new file mode 100644
index 0000000..07b6e36
--- /dev/null
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/layer.conf
@@ -0,0 +1,11 @@
+BBPATH .= ":${LAYERDIR}"
+
+BBFILES += "\
+${LAYERDIR}/recipes-*/*/*.bb \
+${LAYERDIR}/recipes-*/*/*.bbappend \
+"
+
+BBFILE_COLLECTIONS += "evb-fvp-base"
+BBFILE_PATTERN_evb-fvp-base = "^${LAYERDIR}/"
+BBFILE_PRIORITY_evb-fvp-base = "6"
+LAYERSERIES_COMPAT_evb-fvp-base = " nanbield scarthgap"
diff --git a/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/machine/fvp-config.inc b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/machine/fvp-config.inc
new file mode 100644
index 0000000..c0c22dc
--- /dev/null
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/machine/fvp-config.inc
@@ -0,0 +1,46 @@
+# Armv8-A Base Platform FVP Specific Parameters
+
+FVP_PROVIDER ?= "fvp-base-a-aem-native"
+FVP_EXE ?= "FVP_Base_RevC-2xAEMvA"
+
+# Network
+FVP_CONFIG[bp.hostbridge.interfaceName]="enp97s0"
+FVP_CONFIG[bp.hostbridge.userNetworking]="1"
+
+# Ethernet controller
+FVP_CONFIG[bp.smsc_91c111.enabled] = "1"
+
+# Disable dc4 device for uart1
+FVP_CONFIG[bp.pl011_uart1.enable_dc4] = "0"
+
+# Set the baseline to ARMv8.4, as the default is 8.0.
+FVP_CONFIG[cluster0.has_arm_v8-4] = "1"
+FVP_CONFIG[cluster1.has_arm_v8-4] = "1"
+
+# FVP Terminal/console outpot settings
+FVP_CONFIG[bp.hostbridge.userNetPorts] = "4222=22,4223=443,4224=80"
+FVP_CONSOLES[default] = "terminal_0"
+FVP_TERMINALS[bp.terminal_0] ?= "Console"
+FVP_TERMINALS[bp.terminal_1] ?= ""
+FVP_TERMINALS[bp.terminal_2] ?= ""
+FVP_TERMINALS[bp.terminal_3] ?= ""
+# user can update ports as needed
+FVP_CONFIG[bp.terminal_0.start_port] = "5064"
+FVP_CONFIG[bp.terminal_1.start_port] = "5065"
+FVP_CONFIG[bp.terminal_2.start_port] = "5066"
+FVP_CONFIG[bp.terminal_3.start_port] = "5067"
+
+# FIP image settings
+# fip images can be inspected with 'fiptool' from TF-A
+FVP_CONFIG[bp.secureflashloader.fname] = "bl1-fvp.bin"
+FVP_CONFIG[bp.flashloader0.fname] = "fip-fvp.bin"
+# enable randomness which is needed for various security related applications
+FVP_CONFIG[bp.virtio_rng.enabled] = "1"
+FVP_CONFIG[bp.virtio_rng.diagnostics] = "1"
+FVP_CONFIG[cache_state_modelled] ?= "0"
+
+# Enable MMC support
+FVP_CONFIG[bp.mmc.p_mmc_file]="obmc-phosphor-image-fvp.wic"
+# use pad instead of silently truncate emmc image
+FVP_CONFIG[bp.mmc.support_unpadded_images]="1"
+FVP_CONFIG[bp.mmc.diagnostics]="0x1"
diff --git a/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/machine/fvp.conf b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/machine/fvp.conf
new file mode 100644
index 0000000..1a65c6f
--- /dev/null
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/machine/fvp.conf
@@ -0,0 +1,51 @@
+#@TYPE: Machine
+#@NAME: Armv8-A Base Platform FVP machine
+#@DESCRIPTION: Machine configuration for Armv8-A Base Platform FVP model
+
+include fvp-config.inc
+
+require conf/distro/include/phosphor-mmc.inc
+require conf/machine/include/arm/arch-armv8-4a.inc
+require conf/distro/include/pldm.inc
+require conf/machine/include/obmc-evb-common.inc
+require conf/machine/include/obmc-bsp-common.inc
+
+INHERIT += "fvpboot"
+
+IMAGE_FSTYPES = "wic"
+WKS_FILE = "emmc-fvp.wks.in"
+IMAGE_BOOT_FILES = "fitImage-fvp.bin;fitImage"
+
+SERIAL_CONSOLES = "115200;ttyAMA0"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+KERNEL_DEVICETREE = "arm/fvp-base-revc.dtb"
+KERNEL_IMAGETYPE = "fitImage"
+
+EXTRA_IMAGEDEPENDS += "trusted-firmware-a"
+
+UBOOT_MACHINE = "vexpress_fvp_defconfig"
+
+EXTRA_IMAGEDEPENDS += "u-boot"
+
+FIT_ADDRESS_CELLS = "2"
+UBOOT_LOADADDRESS = "0xa0000000"
+UBOOT_ENTRYPOINT = "0xa0000000"
+
+INITRAMFS_IMGAGE = "core-image-minimal-initramfs"
+INITRAMFS_IMAGE_BUNDLE = "1"
+
+IMAGE_INSTALL:append = "\
+    ssh-pregen-hostkeys \
+    pldm \
+"
+
+PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-fvp-apps"
+PREFERRED_PROVIDER_virtual/obmc-fan-mgmt = "packagegroup-fvp-apps"
+PREFERRED_PROVIDER_virtual/obmc-flash-mgmt = "packagegroup-fvp-apps"
+PREFERRED_PROVIDER_virtual/obmc-system-mgmt = "packagegroup-fvp-apps"
+PREFERRED_PROVIDER_virtual/obmc-inventory-data = "packagegroup-fvp-apps"
+PREFERRED_PROVIDER_virtual/obmc-user-mgmt = "packagegroup-fvp-apps"
+
+# Disable "time jumped backwards" error as FVP could be out of sync with real time due to slower simulation
+PACKAGECONFIG:remove:pn-systemd = "timesyncd"
diff --git a/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/templates/default/bblayers.conf.sample b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/templates/default/bblayers.conf.sample
new file mode 100644
index 0000000..b150ecb
--- /dev/null
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/templates/default/bblayers.conf.sample
@@ -0,0 +1,20 @@
+# 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-arm/meta-arm \
+  ##OEROOT##/meta-arm/meta-arm-toolchain \
+  ##OEROOT##/meta-arm/meta-arm-bsp \
+  ##OEROOT##/meta-evb \
+  ##OEROOT##/meta-evb/meta-evb-arm/meta-evb-fvp-base \
+"
+
diff --git a/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/templates/default/conf-notes.txt b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/templates/default/conf-notes.txt
new file mode 100644
index 0000000..43d4ab0
--- /dev/null
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/templates/default/conf-notes.txt
@@ -0,0 +1,2 @@
+Common targets are:
+    obmc-phosphor-image
diff --git a/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/templates/default/local.conf.sample b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/templates/default/local.conf.sample
new file mode 100644
index 0000000..33c5d11
--- /dev/null
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/templates/default/local.conf.sample
@@ -0,0 +1,20 @@
+MACHINE ??= "evb-fvp-base"
+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 \
+    HALT,${TMPDIR},100M,1K \
+    HALT,${DL_DIR},100M,1K \
+    HALT,${SSTATE_DIR},100M,1K \
+    HALT,/tmp,10M,1K"
+CONF_VERSION = "2"
+
+LICENSE_FLAGS_ACCEPTED = "Arm-FVP-EULA"
+