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/yocto-poky/meta/recipes-bsp/u-boot/files/10m50-update-device-tree.patch b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/files/10m50-update-device-tree.patch
new file mode 100644
index 0000000..841953c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/files/10m50-update-device-tree.patch
@@ -0,0 +1,28 @@
+Nios II for MAX10 10m50 board requires update to 
+its device tree to enable CPU driver during
+u-boot pre-relocation. This patch tag the CPU 
+with dm-pre-reloc flag.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Gan, Yau Wai <yau.wai.gan@intel.com>
+
+---
+ arch/nios2/dts/10m50_devboard.dts | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/nios2/dts/10m50_devboard.dts b/arch/nios2/dts/10m50_devboard.dts
+index 05eac30..461ae68 100644
+--- a/arch/nios2/dts/10m50_devboard.dts
++++ b/arch/nios2/dts/10m50_devboard.dts
+@@ -19,6 +19,7 @@
+ 		#size-cells = <0>;
+ 
+ 		cpu: cpu@0 {
++			u-boot,dm-pre-reloc;
+ 			device_type = "cpu";
+ 			compatible = "altr,nios2-1.1";
+ 			reg = <0x00000000>;
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/files/MPC8315ERDB-enable-DHCP.patch b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/files/MPC8315ERDB-enable-DHCP.patch
new file mode 100644
index 0000000..cea52b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/files/MPC8315ERDB-enable-DHCP.patch
@@ -0,0 +1,19 @@
+Enabled dhcp client functionality for Yocto reference
+hardware MPC8315E-RDB.
+
+Upstream-Status: Pending
+
+Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
+
+diff --git a/configs/MPC8315ERDB_defconfig b/configs/MPC8315ERDB_defconfig
+index 4e2b705..b02ab1f 100644
+--- a/configs/MPC8315ERDB_defconfig
++++ b/configs/MPC8315ERDB_defconfig
+@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
+ CONFIG_CMD_I2C=y
+ CONFIG_CMD_USB=y
+ # CONFIG_CMD_SETEXPR is not set
++CONFIG_CMD_DHCP=y
+ CONFIG_CMD_MII=y
+ CONFIG_CMD_PING=y
+ CONFIG_CMD_EXT2=y
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/files/default-gcc.patch b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/files/default-gcc.patch
deleted file mode 100644
index 04184df..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/files/default-gcc.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-OE needs to be able to change the default compiler. If we pass in HOSTCC
-through the make command, it overwrites not only this setting but also the 
-setting in tools/Makefile wrapped in ifneq ($(CROSS_BUILD_TOOLS),) which 
-breaks the build.
-
-We therefore use override to ensure the value of HOSTCC is overwritten when
-needed.
-
-RP: Updated the patch to the version being submitted to upstream u-boot
-
-Upstream-Status: Submitted [emailed to Masahiro Yamada for discussion]
-RP 2017/3/11
-
-Index: git/tools/Makefile
-===================================================================
---- git.orig/tools/Makefile
-+++ git/tools/Makefile
-@@ -262,7 +262,7 @@ $(LICENSE_H): $(obj)/bin2header $(srctre
- subdir- += env
- 
- ifneq ($(CROSS_BUILD_TOOLS),)
--HOSTCC = $(CC)
-+override HOSTCC = $(CC)
- 
- quiet_cmd_crosstools_strip = STRIP   $^
-       cmd_crosstools_strip = $(STRIP) $^; touch $@
-Index: git/tools/env/Makefile
-===================================================================
---- git.orig/tools/env/Makefile
-+++ git/tools/env/Makefile
-@@ -8,7 +8,7 @@
- # fw_printenv is supposed to run on the target system, which means it should be
- # built with cross tools. Although it may look weird, we only replace "HOSTCC"
- # with "CC" here for the maximum code reuse of scripts/Makefile.host.
--HOSTCC = $(CC)
-+override HOSTCC = $(CC)
- 
- # Compile for a hosted environment on the target
- HOST_EXTRACFLAGS  = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-common_2017.01.inc b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-common_2017.09.inc
similarity index 61%
rename from import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-common_2017.01.inc
rename to import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-common_2017.09.inc
index df24c85..02e5124 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-common_2017.01.inc
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-common_2017.09.inc
@@ -7,8 +7,11 @@
 
 # We use the revision in order to avoid having to fetch it from the
 # repo during parse
-SRCREV = "a705ebc81b7f91bbd0ef7c634284208342901149"
+SRCREV = "c98ac3487e413c71e5d36322ef3324b21c6f60f9"
 
-SRC_URI = "git://git.denx.de/u-boot.git"
+SRC_URI = "git://git.denx.de/u-boot.git \
+    file://MPC8315ERDB-enable-DHCP.patch \
+    file://10m50-update-device-tree.patch \
+"
 
 S = "${WORKDIR}/git"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.01.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.09.bb
similarity index 87%
rename from import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.01.bb
rename to import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.09.bb
index 2631499..02887a1 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.01.bb
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.09.bb
@@ -1,19 +1,17 @@
 require u-boot-common_${PV}.inc
 
-SRC_URI += "file://default-gcc.patch"
-
 SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
 DEPENDS = "mtd-utils"
 
 INSANE_SKIP_${PN} = "already-stripped"
 EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
-EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+EXTRA_OEMAKE_class-cross = 'HOSTCC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
 
 inherit uboot-config
 
 do_compile () {
 	oe_runmake ${UBOOT_MACHINE}
-	oe_runmake env
+	oe_runmake envtools
 }
 
 do_install () {
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.09.bb
similarity index 96%
rename from import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb
rename to import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.09.bb
index de999e7..f1fc564 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.09.bb
@@ -1,7 +1,5 @@
 require u-boot-common_${PV}.inc
 
-SRC_URI += "file://default-gcc.patch"
-
 SUMMARY = "U-Boot bootloader image creation tool"
 DEPENDS = "openssl"
 
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc
index aa21c0e..c2bcf99 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc
@@ -304,4 +304,4 @@
     fi
 }
 
-addtask deploy before do_build after do_install
+addtask deploy before do_build after do_compile
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2017.01.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2017.09.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2017.01.bb
rename to import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2017.09.bb