Yocto 2.3

Move OpenBMC to Yocto 2.3(pyro).

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I50744030e771f4850afc2a93a10d3507e76d36bc
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Resolves: openbmc/openbmc#2461
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch
deleted file mode 100644
index 5113e23..0000000
--- a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 13c8784da3dbd977f64cec740eba775b6fab11c2 Mon Sep 17 00:00:00 2001
-From: Herve Jourdain <herve.jourdain@neuf.fr>
-Date: Fri, 20 May 2016 16:02:23 +0800
-Subject: [yocto][meta-raspberrypi][PATCH v4 4/5] linux-raspberrypi_4.4.inc:
- support for .dtbo files for dtb overlays
-
-Upstream-Status: Pending
-
-Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
-Patch the kernel, which has faulty rules to generate .dtbo the way yocto does
-
-Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
----
- .../0001-fix-dtbo-rules.patch                      | 27 ++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
- create mode 100644 recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch
-
-diff --git a/arch/arm/Makefile b/arch/arm/Makefile
-index a2e7cf7..673c1cb 100644
---- a/arch/arm/Makefile
-+++ b/arch/arm/Makefile
-@@ -333,6 +333,8 @@ $(INSTALL_TARGETS):
- 
- %.dtb: | scripts
- 	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
-+%.dtbo: | scripts
-+	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
- 
- PHONY += dtbs dtbs_install
- 
-diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
-index 3079c4f..6cc3766 100644
---- a/scripts/Makefile.lib
-+++ b/scripts/Makefile.lib
-@@ -293,7 +293,8 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
- 	$(call if_changed_dep,dtc)
- 
- quiet_cmd_dtco = DTCO    $@
--cmd_dtco = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
-+cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \
-+	$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- 	$(objtree)/scripts/dtc/dtc -@ -H epapr -O dtb -o $@ -b 0 \
- 		-i $(dir $<) $(DTC_FLAGS) \
- 		-d $(depfile).dtc.tmp $(dtc-tmp) ; \
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb
new file mode 100644
index 0000000..0879bcb
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb
@@ -0,0 +1,26 @@
+python __anonymous() {
+    if "linux-raspberrypi-dev" not in d.getVar("PREFERRED_PROVIDER_virtual/kernel"):
+        msg = "Skipping linux-raspberrypi-dev as it is not the preferred " + \
+              "provider of virtual/kernel."
+        raise bb.parse.SkipRecipe(msg)
+}
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:"
+
+LINUX_VERSION ?= "4.11"
+LINUX_RPI_DEV_BRANCH ?= "rpi-4.11.y"
+
+SRCREV = "${AUTOREV}"
+SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=${LINUX_RPI_DEV_BRANCH} \
+           file://0001-build-arm64-Add-rules-for-.dtbo-files-for-dts-overla.patch \
+"
+require linux-raspberrypi.inc
+
+# A LOADADDR is needed when building a uImage format kernel. This value is not
+# set by default in rpi-4.8.y and later branches so we need to provide it
+# manually. This value unused if KERNEL_IMAGETYPE is not uImage.
+KERNEL_EXTRA_ARGS += "LOADADDR=0x00008000"
+
+# Disable version check so that we don't have to edit this recipe every time
+# upstream bumps the version
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev/0001-build-arm64-Add-rules-for-.dtbo-files-for-dts-overla.patch b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev/0001-build-arm64-Add-rules-for-.dtbo-files-for-dts-overla.patch
new file mode 100644
index 0000000..e8bc52e
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev/0001-build-arm64-Add-rules-for-.dtbo-files-for-dts-overla.patch
@@ -0,0 +1,29 @@
+From 922ce1fd0eb810b713f6ffa9a7ab97c11b6e38cf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 10 Feb 2017 17:57:08 -0800
+Subject: [PATCH] build/arm64: Add rules for .dtbo files for dts overlays
+
+We now create overlays as .dtbo files.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ arch/arm64/Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
+index 3635b8662724..822fefeb1cd0 100644
+--- a/arch/arm64/Makefile
++++ b/arch/arm64/Makefile
+@@ -113,6 +113,9 @@ zinstall install:
+ %.dtb: scripts
+ 	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
+ 
++%.dtbo: | scripts
++	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
++
+ PHONY += dtbs dtbs_install
+ 
+ dtbs: prepare scripts
+-- 
+2.11.1
+
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
index d196d8e..9265d55 100644
--- a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
@@ -21,7 +21,7 @@
 KERNEL_DEFCONFIG_raspberrypi3-64 ?= "bcmrpi3_defconfig"
 
 # CMDLINE for raspberrypi
-CMDLINE = "dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
+CMDLINE ?= "dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
 
 # Add the kernel debugger over console kernel command line option if enabled
 CMDLINE_append = ' ${@base_conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'
@@ -33,8 +33,8 @@
 # Set programmatically some variables during recipe parsing
 # See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions
 python __anonymous () {
-    kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
-    kerneldt = get_dts(d, d.getVar('LINUX_VERSION', True))
+    kerneltype = d.getVar('KERNEL_IMAGETYPE')
+    kerneldt = get_dts(d, d.getVar('LINUX_VERSION'))
     d.setVar("KERNEL_DEVICETREE", kerneldt)
 }
 
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bb b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bb
deleted file mode 100644
index b6be0ec..0000000
--- a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
-
-LINUX_VERSION ?= "4.4.50"
-
-SRCREV = "04c8e47067d4873c584395e5cb260b4f170a99ea"
-SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.4.y \
-           file://0001-fix-dtbo-rules.patch \
-"
-
-require linux-raspberrypi.inc
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb
index 074f448..df28fda 100644
--- a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb
@@ -1,10 +1,10 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
 
-LINUX_VERSION ?= "4.9.27"
+LINUX_VERSION ?= "4.9.59"
 
-SRCREV = "9a5f215eda12bad29b35040dff00d0346fe517e2"
-SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.9.y \
-"
+SRCREV = "e7976b2affa8c05bd299ead0ad9c36ddaf135b9d"
+SRC_URI = "git://github.com/raspberrypi/linux.git;branch=rpi-4.9.y"
+
 require linux-raspberrypi.inc
 
 # A LOADADDR is needed when building a uImage format kernel. This value is not