Yocto 2.4

Move OpenBMC to Yocto 2.4(rocko)

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/meta-raspberrypi/conf/layer.conf b/import-layers/meta-raspberrypi/conf/layer.conf
index bea5a65..bbdce14 100644
--- a/import-layers/meta-raspberrypi/conf/layer.conf
+++ b/import-layers/meta-raspberrypi/conf/layer.conf
@@ -12,3 +12,12 @@
 # Additional license directories.
 LICENSE_PATH += "${LAYERDIR}/files/custom-licenses"
 
+# The dynamic-layers directory hosts the extensions and layer specific
+# modifications.
+#
+# The .bbappend and .bb files are included if the respective layer
+# collection is available.
+BBFILES += "${@' '.join('${LAYERDIR}/dynamic-layers/%s/recipes*/*/*.bbappend' % layer \
+               for layer in BBFILE_COLLECTIONS.split())}"
+BBFILES += "${@' '.join('${LAYERDIR}/dynamic-layers/%s/recipes*/*/*.bb' % layer \
+               for layer in BBFILE_COLLECTIONS.split())}"
diff --git a/import-layers/meta-raspberrypi/conf/machine/include/rpi-base.inc b/import-layers/meta-raspberrypi/conf/machine/include/rpi-base.inc
index 7ed1088..688227c 100644
--- a/import-layers/meta-raspberrypi/conf/machine/include/rpi-base.inc
+++ b/import-layers/meta-raspberrypi/conf/machine/include/rpi-base.inc
@@ -41,7 +41,17 @@
     overlays/pi3-miniuart-bt.dtbo \
     overlays/vc4-kms-v3d.dtbo \
     "
-KERNEL_IMAGETYPE ?= "Image"
+
+# By default:
+#
+# * When u-boot is disabled use the "Image" format which can be directly loaded
+#   by the rpi firmware.
+#
+# * When u-boot is enabled use the "uImage" format and the "bootm" command
+#   within u-boot to load the kernel.
+KERNEL_BOOTCMD ??= "bootm"
+KERNEL_IMAGETYPE_UBOOT ??= "uImage"
+KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', '${KERNEL_IMAGETYPE_UBOOT}', 'Image', d)}"
 
 MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio"
 
@@ -83,7 +93,7 @@
 
 IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \
                  ${@make_dtb_boot_files(d)} \
-                 ${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', \
+                 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
                     '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
                     '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
                  "
diff --git a/import-layers/meta-raspberrypi/conf/machine/raspberrypi3-64.conf b/import-layers/meta-raspberrypi/conf/machine/raspberrypi3-64.conf
index e3d11f2..ebc9f38 100644
--- a/import-layers/meta-raspberrypi/conf/machine/raspberrypi3-64.conf
+++ b/import-layers/meta-raspberrypi/conf/machine/raspberrypi3-64.conf
@@ -31,6 +31,7 @@
     overlays/pi3-disable-bt.dtbo \
     overlays/pi3-miniuart-bt.dtbo \
     overlays/vc4-kms-v3d.dtbo \
+    overlays/vc4-fkms-v3d.dtbo \
     "
 
 SERIAL_CONSOLE ?= "115200 ttyS0"
@@ -38,3 +39,8 @@
 
 UBOOT_MACHINE = "rpi_3_config"
 MACHINE_FEATURES_append = " vc4graphics"
+
+# When u-boot is enabled we need to use the "Image" format and the "booti"
+# command to load the kernel
+KERNEL_IMAGETYPE_UBOOT ?= "Image"
+KERNEL_BOOTCMD ?= "booti"