Merge pull request #393 from open-power/master-next

Merge master-next content to master for v1.8
diff --git a/.gitmodules b/.gitmodules
index 2c4a18c..20509fa 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,4 @@
 [submodule "buildroot"]
 	path = buildroot
+	branch = 2015.11.1-op-build
 	url = https://github.com/open-power/buildroot
diff --git a/README b/README
deleted file mode 100644
index 81b1f6c..0000000
--- a/README
+++ /dev/null
@@ -1,44 +0,0 @@
-=== Building an image ===
-
-git clone --recursive git@github.com:open-power/op-build.git
-cd op-build
-. op-build-env
-op-build palmetto_defconfig && op-build
-
-Building on *64-bit* Ubuntu/Debian systems
-==========================================
-
-1. Install Ubuntu 14.04 or Debian 7.5 64-bit.
-2. Install the packages necessary for the build:
-> sudo apt-get install cscope ctags libz-dev libexpat-dev \
-  python language-pack-en texinfo \
-  build-essential g++ git bison flex unzip \
-  libxml-simple-perl libxml-sax-perl libxml2-dev libxml2-utils xsltproc
-3. Continue with the clone, environment setup, and build as noted above.
-
-Building on *64-bit* Fedora systems
-==========================================
-
-1. Install Fedora 20 64-bit.
-2. Install the packages necessary for the build:
-> sudo yum update vim-minimal
-> sudo yum install vim gcc-c++ flex bison git ctags cscope expat-devel patch glibc-devel.i686 libgcc.i686 zlib-devel zlib-static libstdc++.i686 libxml2-devel.i686
-3. Install PERL modules necessary for the build:
->  sudo yum install "perl(XML::Simple)" "perl(YAML)" "perl(XML::SAX)" "perl(Fatal)" "perl(Thread::Queue)" "perl(Env)" "perl(XML::LibXML)" "perl(Digest::SHA1)"
-
-Troubleshooting
-===============
-
-* If git is complaining about "fatal: reference is not a tree" with a commit matching a buildroot change, try:
-> rm -rf op-build/buildroot
-> cd op-build
-> git clone --recursive git@github.com:open-power/buildroot.git
-
-
-* If make is complaining during skiboot link phases, revert make to version 3.81
--- On Fedora
---> sudo rpm -del --nodeps make
---> sudo wget ftp://fr2.rpmfind.net/linux/centos/6.5/os/x86_64/Packages/make-3.81-20.el6.x86_64.rpm
---> sudo rpm --install make-3.81-20.el6.x86_64.rpm
-
-(instructions for make reversion from http://curiositydrivendevelopment.blogspot.com)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..9eeabd0
--- /dev/null
+++ b/README.md
@@ -0,0 +1,54 @@
+# OpenPower Firmware Build Environment
+
+The OpenPower firmware build process uses Buildroot to create a toolchain and
+build the various components of the PNOR firmware, including Hostboot, Skiboot,
+OCC, Petitboot etc.
+
+## Development
+
+Issues, Milestones, pull requests and code hosting is on github:
+https://github.com/open-power/op-build
+
+Mailing list: openpower-firmware@lists.ozlabs.org  
+Info/Subscribe: https://lists.ozlabs.org/listinfo/openpower-firmware  
+Archives: https://lists.ozlabs.org/pipermail/openpower-firmware/  
+
+## Building an image
+
+```
+git clone --recursive git@github.com:open-power/op-build.git
+cd op-build
+. op-build-env
+op-build palmetto_defconfig && op-build
+```
+
+This will build an image for a Palmetto system. There exists default
+configurations for other platforms in openpower/configs/ such as
+Habanero and Firestone.
+
+### Dependancies for *64-bit* Ubuntu/Debian systems
+
+1. Install Ubuntu (>= 14.04) or Debian (>= 7.5) 64-bit.
+2. Enable Universe:
+
+        sudo apt-get install software-properties-common
+        sudo add-apt-repository universe
+3. Install the packages necessary for the build:
+
+        sudo apt-get install cscope ctags libz-dev libexpat-dev \
+          python language-pack-en texinfo \
+          build-essential g++ git bison flex unzip \
+          libxml-simple-perl libxml-sax-perl libxml2-dev libxml2-utils xsltproc \
+          wget bc
+
+### Dependancies for *64-bit* Fedora systems
+
+1. Install Fedora 23 64-bit.
+2. Install the packages necessary for the build:
+
+        sudo dnf install gcc-c++ flex bison git ctags cscope expat-devel patch \
+          zlib-devel zlib-static texinfo perl-bignum "perl(XML::Simple)" \
+          "perl(YAML)" "perl(XML::SAX)" "perl(Fatal)" "perl(Thread::Queue)" \
+          "perl(Env)" "perl(XML::LibXML)" "perl(Digest::SHA1)" libxml2-devel \
+          which wget unzip tar cpio python bzip2 bc findutils ncurses-devel
+
diff --git a/buildroot b/buildroot
index 40ff8b4..fda20bd 160000
--- a/buildroot
+++ b/buildroot
@@ -1 +1 @@
-Subproject commit 40ff8b41146a34d16439413b89470573e355912f
+Subproject commit fda20bd82acd118fff5211772f483b700b605c9d
diff --git a/ci/Dockerfile/fedora23 b/ci/Dockerfile/fedora23
new file mode 100644
index 0000000..5c425a3
--- /dev/null
+++ b/ci/Dockerfile/fedora23
@@ -0,0 +1,5 @@
+FROM fedora:23
+RUN dnf -y install gcc-c++ flex bison git ctags cscope expat-devel patch zlib-devel zlib-static texinfo perl-bignum "perl(XML::Simple)" "perl(YAML)" "perl(XML::SAX)" "perl(Fatal)" "perl(Thread::Queue)" "perl(Env)" "perl(XML::LibXML)" "perl(Digest::SHA1)" libxml2-devel
+RUN dnf -y install which wget unzip tar cpio python bzip2 bc
+RUN dnf -y install findutils
+RUN dnf -y install ncurses-devel
diff --git a/ci/Dockerfile/fedora23.x86_64 b/ci/Dockerfile/fedora23.x86_64
new file mode 120000
index 0000000..5322ce7
--- /dev/null
+++ b/ci/Dockerfile/fedora23.x86_64
@@ -0,0 +1 @@
+fedora23
\ No newline at end of file
diff --git a/ci/Dockerfile/ubuntu1404 b/ci/Dockerfile/ubuntu1404
new file mode 100644
index 0000000..8acb932
--- /dev/null
+++ b/ci/Dockerfile/ubuntu1404
@@ -0,0 +1,10 @@
+FROM ubuntu:14.04
+# Don't ask. Ubuntu is awful.
+RUN sed -e 's/main$/main universe/' --in-place=orig /etc/apt/sources.list
+RUN DEBIAN_FRONTEND=noninteractive apt-get update
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -yy cscope ctags \
+  libz-dev libexpat-dev \
+  python language-pack-en texinfo \
+  build-essential g++ git bison flex unzip \
+  libxml-simple-perl libxml-sax-perl libxml2-dev libxml2-utils xsltproc
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -yy wget bc
diff --git a/ci/Dockerfile/ubuntu1404.ppc64le b/ci/Dockerfile/ubuntu1404.ppc64le
new file mode 120000
index 0000000..529a5fa
--- /dev/null
+++ b/ci/Dockerfile/ubuntu1404.ppc64le
@@ -0,0 +1 @@
+ubuntu1404
\ No newline at end of file
diff --git a/ci/Dockerfile/ubuntu1404.x86_64 b/ci/Dockerfile/ubuntu1404.x86_64
new file mode 120000
index 0000000..529a5fa
--- /dev/null
+++ b/ci/Dockerfile/ubuntu1404.x86_64
@@ -0,0 +1 @@
+ubuntu1404
\ No newline at end of file
diff --git a/ci/build-all-defconfigs.sh b/ci/build-all-defconfigs.sh
new file mode 100755
index 0000000..1730e28
--- /dev/null
+++ b/ci/build-all-defconfigs.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+set -ex
+set -eo pipefail
+
+DEFCONFIGS=`(cd openpower/configs; ls -1 *_defconfig)`
+
+if [ -z "$1" or ! -d "$1" ]; then
+	echo "No output directory specified"
+	exit 1;
+fi
+
+if [ -z "$CCACHE_DIR" ]; then
+	CCACHE_DIR=`pwd`/.op-build_ccache
+fi
+
+shopt -s expand_aliases
+source op-build-env
+
+for i in $DEFCONFIGS; do
+        op-build $i
+        echo 'BR2_CCACHE=y' >> output/.config
+        echo "BR2_CCACHE_DIR=\"$CCACHE_DIR\"" >> output/.config
+        echo 'BR2_CCACHE_INITIAL_SETUP=""' >> output/.config
+
+        op-build olddefconfig
+        op-build
+        r=$?
+        mkdir $1/$i-images
+        mv output/images/* $1/$i-images/
+        mv output/.config $1/$i-images/.config
+	lsb_release -a > $1/$i-images/lsb_release
+        rm -rf output/*
+        if [ $r -ne 0 ]; then
+        	exit $r
+        fi
+done
+
diff --git a/ci/build.sh b/ci/build.sh
new file mode 100755
index 0000000..d7e98ca
--- /dev/null
+++ b/ci/build.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+set -ex
+set -eo pipefail
+
+function run_docker
+{
+	$DOCKER_PREFIX docker run --cap-add=sys_admin --net=host --rm=true \
+	 --user="${USER}" -w "${PWD}" -v "${PWD}":"${PWD}":Z \
+         -t $1 $2
+}
+
+env
+
+if [ -d output-images ]; then
+	echo 'output-images already exists!';
+	exit 1;
+fi
+
+for distro in ubuntu1404 fedora23;
+do
+	base_dockerfile=ci/Dockerfile/$distro.`arch`
+	if [ ! -f $base_dockerfile ]; then
+	  echo '$distro not supported on `arch`.';
+	  continue
+	fi
+	if [[ -n "$HTTP_PROXY" ]]; then
+		http_proxy=$HTTP_PROXY
+	fi
+	if [[ -n "$http_proxy" ]]; then
+	  if [[ "$distro" == fedora23 ]]; then
+	    PROXY="RUN echo \"proxy=${http_proxy}\" >> /etc/dnf/dnf.conf"
+	  fi
+	  if [[ "$distro" == ubuntu1404 ]]; then
+	    PROXY="RUN echo \"Acquire::http::Proxy \\"\"${http_proxy}/\\"\";\" > /etc/apt/apt.conf.d/000apt-cacher-ng-proxy"
+	  fi
+        fi
+
+	Dockerfile=$(head -n1 $base_dockerfile; echo ${PROXY}; tail -n +2 $base_dockerfile; cat << EOF
+RUN groupadd -g ${GROUPS} ${USER} && useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} ${USER}
+${PROXY}
+USER ${USER}
+ENV HOME ${HOME}
+EOF
+)
+	$DOCKER_PREFIX docker build -t openpower/op-build-$distro - <<< "${Dockerfile}"
+	mkdir -p output-images/$distro
+	run_docker openpower/op-build-$distro "./ci/build-all-defconfigs.sh output-images/$distro"
+	if [ $? = 0 ]; then
+		mv *-images output-$distro/
+	else
+		exit $?;
+	fi
+done;
+
diff --git a/op-build-env b/op-build-env
index 9f2bfd2..9cd5cb5 100755
--- a/op-build-env
+++ b/op-build-env
@@ -8,4 +8,6 @@
 export BR2_EXTERNAL=${__PWD}/openpower
 export BR2_DL_DIR=${__PWD}/dl
 
-alias op-build="make --directory=${__PWD}/buildroot O=${__PWD}/output "
+op-build () {
+    make --directory=${__PWD}/buildroot O=${__PWD}/output $@
+}
diff --git a/openpower/configs/barreleye_defconfig b/openpower/configs/barreleye_defconfig
new file mode 100644
index 0000000..d3eda3a
--- /dev/null
+++ b/openpower/configs/barreleye_defconfig
@@ -0,0 +1,72 @@
+BR2_powerpc64le=y
+BR2_powerpc_power8=y
+BR2_OPENPOWER_PLATFORM=y
+
+BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
+BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+# BR2_TOOLCHAIN_BUILDROOT_LIBSTDCPP is not set
+BR2_GLIBC_VERSION_2_23=y
+
+BR2_OPENPOWER_CONFIG_NAME="barreleye"
+BR2_OPENPOWER_XML_PACKAGE="barreleye-xml"
+BR2_HOSTBOOT_CONFIG_FILE="barreleye.config"
+
+BR2_HOSTBOOT_BINARY_SBE_FILENAME="venice_sbe.img.ecc"
+BR2_HOSTBOOT_BINARY_SBEC_FILENAME="centaur_sbec_pad.img.ecc"
+BR2_HOSTBOOT_BINARY_WINK_FILENAME="p8.ref_image.hdr.bin.ecc"
+
+BR2_OCC_BIN_FILENAME="occ.bin"
+
+BR2_BARRELEYE_SYSTEM_XML_FILENAME="BARRELEYE_hb.system.xml"
+BR2_BARRELEYE_MRW_XML_FILENAME="BARRELEYE_hb.mrw.xml"
+BR2_BARRELEYE_BIOS_XML_FILENAME="BARRELEYE_bios.xml"
+
+BR2_OPENPOWER_TARGETING_BIN_FILENAME="BARRELEYE_HB.targeting.bin"
+BR2_OPENPOWER_TARGETING_ECC_FILENAME="BARRELEYE_HB.targeting.bin.ecc"
+BR2_CAPP_UCODE_BIN_FILENAME="cappucode.bin"
+
+BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME="defaultPnorLayoutWithGoldenSide.xml"
+BR2_OPENPOWER_PNOR_FILENAME="barreleye.pnor"
+BR2_OPENPOWER_PNOR_UPDATE_FILENAME="barreleye_update.pnor"
+
+# skiboot requirements
+BR2_TARGET_SKIBOOT=y
+BR2_TARGET_SKIBOOT_EMBED_PAYLOAD=n
+BR2_SKIBOOT_CUSTOM_VERSION=y
+BR2_SKIBOOT_CUSTOM_VERSION_VALUE="skiboot-5.2.0"
+
+# petitboot requirements
+BR2_ENABLE_LOCALE_PURGE=y
+BR2_ENABLE_LOCALE_WHITELIST="C de en es fr it ja ko pt_BR ru zh_CN zh_TW"
+BR2_GENERATE_LOCALE="en_US.UTF-8 de_DE.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 it_IT.UTF-8 ja_JP.UTF-8 ko_KR.UTF-8 pt_BR.UTF-8 ru_RU.UTF-8 zh_CN.UTF-8 zh_TW.UTF-8"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+BR2_TARGET_GENERIC_GETTY_PORT="hvc0"
+BR2_ROOTFS_OVERLAY="../openpower/overlay"
+BR2_ROOTFS_DEVICE_TABLE="../openpower/device_table.txt"
+BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_SAME_AS_HEADERS=y
+BR2_KERNEL_HEADERS_4_4=y
+BR2_DEFAULT_KERNEL_HEADERS="4.4.5"
+BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
+BR2_LINUX_KERNEL_ZIMAGE_EPAPR=y
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
+BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T4=y
+BR2_PACKAGE_I2C_TOOLS=y
+BR2_PACKAGE_NCURSES_WCHAR=y
+BR2_PACKAGE_DROPBEAR=y
+# BR2_PACKAGE_DROPBEAR_SERVER is not set
+BR2_PACKAGE_ETHTOOL=y
+BR2_PACKAGE_NETCAT=y
+BR2_PACKAGE_RSYNC=y
+BR2_PACKAGE_PETITBOOT=y
+BR2_PACKAGE_IPMITOOL=y
+BR2_PACKAGE_POWERPC_UTILS=y
+BR2_PACKAGE_MDADM=y
+BR2_TARGET_ROOTFS_CPIO_XZ=y
+BR2_TARGET_ROOTFS_INITRAMFS=y
diff --git a/openpower/configs/firestone_defconfig b/openpower/configs/firestone_defconfig
index 10835f2..2ba04a9 100644
--- a/openpower/configs/firestone_defconfig
+++ b/openpower/configs/firestone_defconfig
@@ -6,6 +6,7 @@
 BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 # BR2_TOOLCHAIN_BUILDROOT_LIBSTDCPP is not set
+BR2_GLIBC_VERSION_2_23=y
 
 BR2_OPENPOWER_CONFIG_NAME="firestone"
 BR2_OPENPOWER_XML_PACKAGE="firestone-xml"
@@ -43,8 +44,9 @@
 BR2_ROOTFS_DEVICE_TABLE="../openpower/device_table.txt"
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var"
 BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_VERSION="4.2.1"
-BR2_KERNEL_HEADERS_4_2=y
+BR2_LINUX_KERNEL_SAME_AS_HEADERS=y
+BR2_KERNEL_HEADERS_4_4=y
+BR2_DEFAULT_KERNEL_HEADERS="4.4.5"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
@@ -52,7 +54,7 @@
 BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
 BR2_PACKAGE_LINUX_FIRMWARE=y
 BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
-BR2_PACKAGE_LINUX_FIRMWARE_CXGB4=y
+BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T4=y
 BR2_PACKAGE_I2C_TOOLS=y
 BR2_PACKAGE_NCURSES_WCHAR=y
 BR2_PACKAGE_DROPBEAR=y
diff --git a/openpower/configs/garrison_defconfig b/openpower/configs/garrison_defconfig
index 7964493..4b2010a 100644
--- a/openpower/configs/garrison_defconfig
+++ b/openpower/configs/garrison_defconfig
@@ -6,6 +6,7 @@
 BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 # BR2_TOOLCHAIN_BUILDROOT_LIBSTDCPP is not set
+BR2_GLIBC_VERSION_2_23=y
 
 BR2_OPENPOWER_CONFIG_NAME="garrison"
 BR2_OPENPOWER_XML_PACKAGE="garrison-xml"
@@ -32,6 +33,8 @@
 # skiboot requirements
 BR2_TARGET_SKIBOOT=y
 BR2_TARGET_SKIBOOT_EMBED_PAYLOAD=n
+BR2_SKIBOOT_CUSTOM_VERSION=y
+BR2_SKIBOOT_CUSTOM_VERSION_VALUE="skiboot-5.2.0"
 
 # petitboot requirements
 BR2_ENABLE_LOCALE_PURGE=y
@@ -43,8 +46,9 @@
 BR2_ROOTFS_DEVICE_TABLE="../openpower/device_table.txt"
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var"
 BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_VERSION="4.2.1"
-BR2_KERNEL_HEADERS_4_2=y
+BR2_LINUX_KERNEL_SAME_AS_HEADERS=y
+BR2_KERNEL_HEADERS_4_4=y
+BR2_DEFAULT_KERNEL_HEADERS="4.4.5"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
@@ -52,7 +56,7 @@
 BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
 BR2_PACKAGE_LINUX_FIRMWARE=y
 BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
-BR2_PACKAGE_LINUX_FIRMWARE_CXGB4=y
+BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T4=y
 BR2_PACKAGE_I2C_TOOLS=y
 BR2_PACKAGE_NCURSES_WCHAR=y
 BR2_PACKAGE_DROPBEAR=y
diff --git a/openpower/configs/habanero_defconfig b/openpower/configs/habanero_defconfig
index 7d052e1..a936321 100644
--- a/openpower/configs/habanero_defconfig
+++ b/openpower/configs/habanero_defconfig
@@ -6,6 +6,7 @@
 BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 # BR2_TOOLCHAIN_BUILDROOT_LIBSTDCPP is not set
+BR2_GLIBC_VERSION_2_23=y
 
 BR2_OPENPOWER_CONFIG_NAME="habanero"
 BR2_OPENPOWER_XML_PACKAGE="habanero-xml"
@@ -43,8 +44,9 @@
 BR2_ROOTFS_DEVICE_TABLE="../openpower/device_table.txt"
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var"
 BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_VERSION="4.2.1"
-BR2_KERNEL_HEADERS_4_2=y
+BR2_LINUX_KERNEL_SAME_AS_HEADERS=y
+BR2_KERNEL_HEADERS_4_4=y
+BR2_DEFAULT_KERNEL_HEADERS="4.4.5"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
@@ -52,7 +54,7 @@
 BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
 BR2_PACKAGE_LINUX_FIRMWARE=y
 BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
-BR2_PACKAGE_LINUX_FIRMWARE_CXGB4=y
+BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T4=y
 BR2_PACKAGE_I2C_TOOLS=y
 BR2_PACKAGE_NCURSES_WCHAR=y
 BR2_PACKAGE_DROPBEAR=y
diff --git a/openpower/configs/hostboot/barreleye.config b/openpower/configs/hostboot/barreleye.config
new file mode 100755
index 0000000..8d25814
--- /dev/null
+++ b/openpower/configs/hostboot/barreleye.config
@@ -0,0 +1,66 @@
+# The Serial Flash Controller is the AST2400 BMC.
+set   SFC_IS_AST2400
+set   BMC_DOES_SFC_INIT
+unset SFC_IS_IBM_DPSS
+set   ALLOW_MICRON_PNOR
+set   ALLOW_MACRONIX_PNOR
+
+# VPD options.
+set MVPD_READ_FROM_HW
+set MVPD_WRITE_TO_HW
+set MVPD_READ_FROM_PNOR
+set MVPD_WRITE_FROM_PNOR
+set DJVPD_READ_FROM_HW
+set DJVPD_WRITE_TO_HW
+set DJVPD_READ_FROM_PNOR
+set DJVPD_WRITE_TO_PNOR
+set CVPD_READ_FROM_HW
+set CVPD_WRITE_TO_HW
+set CVPD_READ_FROM_PNOR
+set CVPD_WRITE_TO_PNOR
+set PVPD_READ_FROM_HW
+set PVPD_WRITE_TO_HW
+set PVPD_READ_FROM_PNOR
+set PVPD_WRITE_TO_PNOR
+set SKIP_RESTRICT_EX_UNITS
+unset CDIMM_FORMAT_FOR_CVPD
+
+# gpio config
+set GPIODD
+set PALMETTO_VDDR
+
+# Enable SBE updates
+set SBE_UPDATE_INDEPENDENT
+
+unset PCIE_HOTPLUG_CONTROLLER
+
+# turn on console output
+set CONSOLE
+set BMC_AST2400
+
+# Enable Kingston dimm voltage workaround
+set KINGSTON_1_35_VOLT
+
+# PCA95X config
+set PCA95X_8BIT
+
+unset DISABLE_HOSTBOOT_RUNTIME
+
+# Compile in hostboot runtime PRD
+set HBRT_PRD
+set HTMGT
+set START_OCC_DURING_BOOT
+
+#PNOR flags
+set PNOR_TWO_SIDE_SUPPORT
+set BMC_BT_LPC_IPMI
+
+# Enable Checktop Analysis
+set ENABLE_CHECKSTOP_ANALYSIS
+set IPLTIME_CHECKSTOP_ANALYSIS
+
+# Hostboot will detect hardware changes
+set HOST_HCDB_SUPPORT
+
+# set for trace debug to console
+unset CONSOLE_OUTPUT_TRACE
diff --git a/openpower/configs/hostboot/firestone.config b/openpower/configs/hostboot/firestone.config
index c435b4c..e8218cf 100755
--- a/openpower/configs/hostboot/firestone.config
+++ b/openpower/configs/hostboot/firestone.config
@@ -55,6 +55,7 @@
 
 # Enable Checktop Analysis
 set ENABLE_CHECKSTOP_ANALYSIS
+set IPLTIME_CHECKSTOP_ANALYSIS
 
 # Hostboot will detect hardware changes
 set HOST_HCDB_SUPPORT
diff --git a/openpower/configs/hostboot/garrison.config b/openpower/configs/hostboot/garrison.config
index 102c147..72fabe2 100755
--- a/openpower/configs/hostboot/garrison.config
+++ b/openpower/configs/hostboot/garrison.config
@@ -29,8 +29,8 @@
 set GPIODD
 set PALMETTO_VDDR
 
-# disable sbe updates
-set NO_SBE_UPDATES
+# Enable SBE updates
+set SBE_UPDATE_INDEPENDENT
 
 unset PCIE_HOTPLUG_CONTROLLER
 
@@ -55,6 +55,9 @@
 
 # Enable Checktop Analysis
 set ENABLE_CHECKSTOP_ANALYSIS
+# Turn off IPLTIME_CHECKSTOP_ANALYSIS for now until memory issue can be solved.
+# Seems to only be an issue for lager ddr4 configs.
+#set IPLTIME_CHECKSTOP_ANALYSIS
 
 # Hostboot will detect hardware changes
 set HOST_HCDB_SUPPORT
diff --git a/openpower/configs/hostboot/habanero.config b/openpower/configs/hostboot/habanero.config
index 1f2cedf..21d3ef8 100755
--- a/openpower/configs/hostboot/habanero.config
+++ b/openpower/configs/hostboot/habanero.config
@@ -58,6 +58,7 @@
 
 # Enable Checktop Analysis
 set ENABLE_CHECKSTOP_ANALYSIS
+set IPLTIME_CHECKSTOP_ANALYSIS
 
 # Hostboot will detect hardware changes
 set HOST_HCDB_SUPPORT
diff --git a/openpower/configs/hostboot/palmetto.config b/openpower/configs/hostboot/palmetto.config
index bebb858..a821159 100755
--- a/openpower/configs/hostboot/palmetto.config
+++ b/openpower/configs/hostboot/palmetto.config
@@ -54,6 +54,7 @@
 
 # Enable Checktop Analysis
 set ENABLE_CHECKSTOP_ANALYSIS
+set IPLTIME_CHECKSTOP_ANALYSIS
 
 # Hostboot will detect hardware changes
 set HOST_HCDB_SUPPORT
diff --git a/openpower/configs/linux/skiroot_defconfig b/openpower/configs/linux/skiroot_defconfig
index 1a80631..bdc692a 100644
--- a/openpower/configs/linux/skiroot_defconfig
+++ b/openpower/configs/linux/skiroot_defconfig
@@ -20,6 +20,7 @@
 CONFIG_LOG_BUF_SHIFT=20
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
+CONFIG_BLK_DEV_NVME=y
 # CONFIG_RD_GZIP is not set
 # CONFIG_RD_BZIP2 is not set
 # CONFIG_RD_LZMA is not set
@@ -35,7 +36,6 @@
 CONFIG_PARTITION_ADVANCED=y
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_PPC_PSERIES is not set
-# CONFIG_PPC_PMAC is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
 CONFIG_HZ_100=y
 CONFIG_KEXEC=y
@@ -80,6 +80,10 @@
 CONFIG_SCSI_BNX2_ISCSI=y
 CONFIG_BE2ISCSI=y
 CONFIG_SCSI_AACRAID=y
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=y
+CONFIG_MEGARAID_MAILBOX=y
+CONFIG_MEGARAID_SAS=y
 CONFIG_SCSI_MPT2SAS=y
 CONFIG_SCSI_SYM53C8XX_2=y
 CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
@@ -159,7 +163,6 @@
 CONFIG_FB_MATROX_MILLENIUM=y
 CONFIG_FB_MATROX_MYSTIQUE=y
 CONFIG_FB_MATROX_G=y
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
 # CONFIG_LCD_CLASS_DEVICE is not set
 # CONFIG_BACKLIGHT_GENERIC is not set
 # CONFIG_VGA_CONSOLE is not set
@@ -210,4 +213,8 @@
 # CONFIG_FTRACE is not set
 CONFIG_XMON=y
 CONFIG_XMON_DEFAULT=y
+# CONFIG_CRYPTO_ECHAINIV is not set
 # CONFIG_CRYPTO_HW is not set
+CONFIG_MTD=y
+CONFIG_MTD_POWERNV_FLASH=y
+CONFIG_PCI_MSI=y
diff --git a/openpower/configs/openpower_mambo_defconfig b/openpower/configs/openpower_mambo_defconfig
index befdae3..8a803d0 100644
--- a/openpower/configs/openpower_mambo_defconfig
+++ b/openpower/configs/openpower_mambo_defconfig
@@ -4,6 +4,7 @@
 
 BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
 BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
+BR2_GLIBC_VERSION_2_23=y
 
 # No HostBoot for Mambo
 BR2_PACKAGE_HOSTBOOT=n
@@ -31,8 +32,9 @@
 BR2_ROOTFS_DEVICE_TABLE="../openpower/device_table.txt"
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var"
 BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_VERSION="4.2.1"
-BR2_KERNEL_HEADERS_4_2=y
+BR2_LINUX_KERNEL_SAME_AS_HEADERS=y
+BR2_KERNEL_HEADERS_4_4=y
+BR2_DEFAULT_KERNEL_HEADERS="4.4.5"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
@@ -40,7 +42,7 @@
 BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
 BR2_PACKAGE_LINUX_FIRMWARE=y
 BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
-BR2_PACKAGE_LINUX_FIRMWARE_CXGB4=y
+BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T4=y
 BR2_PACKAGE_I2C_TOOLS=y
 BR2_PACKAGE_NCURSES_WCHAR=y
 BR2_PACKAGE_DROPBEAR=y
diff --git a/openpower/configs/palmetto_defconfig b/openpower/configs/palmetto_defconfig
index 5053bf0..67dcc1e 100644
--- a/openpower/configs/palmetto_defconfig
+++ b/openpower/configs/palmetto_defconfig
@@ -6,6 +6,7 @@
 BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 # BR2_TOOLCHAIN_BUILDROOT_LIBSTDCPP is not set
+BR2_GLIBC_VERSION_2_23=y
 
 BR2_OPENPOWER_CONFIG_NAME="palmetto"
 BR2_OPENPOWER_XML_PACKAGE="palmetto-xml"
@@ -42,8 +43,9 @@
 BR2_ROOTFS_DEVICE_TABLE="../openpower/device_table.txt"
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var"
 BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_VERSION="4.2.1"
-BR2_KERNEL_HEADERS_4_2=y
+BR2_LINUX_KERNEL_SAME_AS_HEADERS=y
+BR2_KERNEL_HEADERS_4_4=y
+BR2_DEFAULT_KERNEL_HEADERS="4.4.5"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
@@ -51,7 +53,7 @@
 BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
 BR2_PACKAGE_LINUX_FIRMWARE=y
 BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
-BR2_PACKAGE_LINUX_FIRMWARE_CXGB4=y
+BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T4=y
 BR2_PACKAGE_I2C_TOOLS=y
 BR2_PACKAGE_NCURSES_WCHAR=y
 BR2_PACKAGE_DROPBEAR=y
diff --git a/openpower/custom/patches/dtc/dtc-0001-sort-unit-addresses-by-number.patch b/openpower/custom/patches/dtc/dtc-0001-sort-unit-addresses-by-number.patch
new file mode 100644
index 0000000..6f49dbc
--- /dev/null
+++ b/openpower/custom/patches/dtc/dtc-0001-sort-unit-addresses-by-number.patch
@@ -0,0 +1,110 @@
+Date: Tue, 21 Jan 2014 13:49:35 +1100
+From: Anton Blanchard <anton@samba.org>
+Subject: [PATCH] dtc: Sort unit addresses by number
+
+The sort option in dtc treats unit addresses as strings. This causes
+cpu nodes to end up out of order:
+
+# dtc -s -I fs -O dts /proc/device-tree | grep PowerPC,POWER7
+
+		PowerPC,POWER7@30 {
+		PowerPC,POWER7@68 {
+		PowerPC,POWER7@70 {
+		PowerPC,POWER7@828 {
+		PowerPC,POWER7@860 {
+		PowerPC,POWER7@868 {
+		PowerPC,POWER7@8a0 {
+		PowerPC,POWER7@8b0 {
+		PowerPC,POWER7@8f0 {
+		PowerPC,POWER7@a0 {
+		PowerPC,POWER7@a8 {
+		PowerPC,POWER7@e0 {
+
+If we use this device tree for a kexec boot we end up with a confusing
+layout of logical CPUs:
+
+node 0 cpus: 0-23 72-95
+node 0 size: 32633 MB
+
+node 1 cpus: 24-71
+node 1 size: 32631 MB
+
+The reason for this is that we allocate logical CPU ids as we walk
+through the device tree.
+
+In cmp_subnode, if both nodes have a hex unit address and the
+basenames match, then compare by number.
+
+This fixes the issue:
+
+# dtc -s -I fs -O dts /proc/device-tree | grep PowerPC,POWER7
+		PowerPC,POWER7@30 {
+		PowerPC,POWER7@68 {
+		PowerPC,POWER7@70 {
+		PowerPC,POWER7@a0 {
+		PowerPC,POWER7@a8 {
+		PowerPC,POWER7@e0 {
+		PowerPC,POWER7@828 {
+		PowerPC,POWER7@860 {
+		PowerPC,POWER7@868 {
+		PowerPC,POWER7@8a0 {
+		PowerPC,POWER7@8b0 {
+		PowerPC,POWER7@8f0 {
+
+And the CPU layout is as expected:
+
+node 0 cpus: 0-47
+node 0 size: 32633 MB
+
+node 1 cpus: 48-95
+node 1 size: 32631 MB
+
+Signed-off-by: Anton Blanchard <anton@samba.org>
+--
+
+Index: b/livetree.c
+===================================================================
+--- a/livetree.c
++++ b/livetree.c
+@@ -656,12 +656,38 @@ static void sort_properties(struct node
+ 	free(tbl);
+ }
+ 
++static bool is_hex(const char *str)
++{
++	while (*str) {
++		if (!isxdigit(*str++))
++			return false;
++	}
++
++	return true;
++}
++
+ static int cmp_subnode(const void *ax, const void *bx)
+ {
+-	const struct node *a, *b;
++	struct node *a, *b;
++	const char *a_unit, *b_unit;
++
++	a = *((struct node * const *)ax);
++	b = *((struct node * const *)bx);
++
++	a_unit = get_unitname(a);
++	b_unit = get_unitname(b);
++
++	/* Sort hex unit addresses by number */
++	if (a_unit && b_unit && (a->basenamelen == b->basenamelen) &&
++	    !strncmp(a->name, b->name, a->basenamelen) &&
++	    is_hex(a_unit) && is_hex(b_unit)) {
++		unsigned long long a_num, b_num;
++
++		a_num = strtoull(a_unit, NULL, 16);
++		b_num = strtoull(b_unit, NULL, 16);
+ 
+-	a = *((const struct node * const *)ax);
+-	b = *((const struct node * const *)bx);
++		return (a_num > b_num) - (a_num < b_num);
++	}
+ 
+ 	return strcmp(a->name, b->name);
+ }
diff --git a/openpower/device_table.txt b/openpower/device_table.txt
index 450aab6..dc1af51 100644
--- a/openpower/device_table.txt
+++ b/openpower/device_table.txt
@@ -7,17 +7,15 @@
 #
 # <name>				<type>	<mode>	<uid>	<gid>	<major>	<minor>	<start>	<inc>	<count>
 /dev					d	755	0	0	-	-	-	-	-
+/tmp					d	1777	0	0	-	-	-	-	-
 /etc					d	755	0	0	-	-	-	-	-
 /root					d	700	0	0	-	-	-	-	-
 /var/www				d	755	33	33	-	-	-	-	-
-/etc/random-seed			f	600	0	0	-	-	-	-	-
 /etc/shadow				f	600	0	0	-	-	-	-	-
 /etc/passwd				f	644	0	0	-	-	-	-	-
 /etc/network/if-up.d			d	755	0	0	-	-	-	-	-
 /etc/network/if-pre-up.d		d	755	0	0	-	-	-	-	-
-/etc/network/if-post-up.d		d	755	0	0	-	-	-	-	-
 /etc/network/if-down.d			d	755	0	0	-	-	-	-	-
-/etc/network/if-pre-down.d		d	755	0	0	-	-	-	-	-
 /etc/network/if-post-down.d		d	755	0	0	-	-	-	-	-
 # uncomment this to allow starting x as non-root
 #/usr/X11R6/bin/Xfbdev		     	f	4755	0	0	-	-	-	-	-
diff --git a/openpower/linux/linux-0001-powerpc-Add-openpower_defconfig.patch b/openpower/linux/linux-0001-powerpc-Add-openpower_defconfig.patch
deleted file mode 100644
index 970a6dc..0000000
--- a/openpower/linux/linux-0001-powerpc-Add-openpower_defconfig.patch
+++ /dev/null
@@ -1,245 +0,0 @@
-From 359e321ac2e989d5a1b9810f3c1e54bc4971c331 Mon Sep 17 00:00:00 2001
-From: Jeremy Kerr <jk@ozlabs.org>
-Date: Fri, 12 Dec 2014 08:03:11 +0800
-Subject: [PATCH 01/18] powerpc: Add openpower_defconfig
-
-Simplifies building an openpower kernel a little. It is based on the
-configuration used by the op-build openpower buildroot overlay.
-
-Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
-
-add accraid
-
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- arch/powerpc/configs/openpower_defconfig | 217 +++++++++++++++++++++++++++++++
- 1 file changed, 217 insertions(+)
- create mode 100644 arch/powerpc/configs/openpower_defconfig
-
-diff --git a/arch/powerpc/configs/openpower_defconfig b/arch/powerpc/configs/openpower_defconfig
-new file mode 100644
-index 0000000..4d6779a
---- /dev/null
-+++ b/arch/powerpc/configs/openpower_defconfig
-@@ -0,0 +1,217 @@
-+CONFIG_PPC64=y
-+CONFIG_ALTIVEC=y
-+CONFIG_VSX=y
-+CONFIG_SMP=y
-+CONFIG_NR_CPUS=2048
-+CONFIG_CPU_LITTLE_ENDIAN=y
-+# CONFIG_SWAP is not set
-+CONFIG_SYSVIPC=y
-+CONFIG_POSIX_MQUEUE=y
-+# CONFIG_CROSS_MEMORY_ATTACH is not set
-+CONFIG_IRQ_DOMAIN_DEBUG=y
-+CONFIG_NO_HZ=y
-+CONFIG_HIGH_RES_TIMERS=y
-+CONFIG_TASKSTATS=y
-+CONFIG_TASK_DELAY_ACCT=y
-+CONFIG_TASK_XACCT=y
-+CONFIG_TASK_IO_ACCOUNTING=y
-+CONFIG_IKCONFIG=y
-+CONFIG_IKCONFIG_PROC=y
-+CONFIG_LOG_BUF_SHIFT=20
-+CONFIG_RELAY=y
-+CONFIG_BLK_DEV_INITRD=y
-+# CONFIG_RD_GZIP is not set
-+# CONFIG_RD_BZIP2 is not set
-+# CONFIG_RD_LZMA is not set
-+# CONFIG_RD_LZO is not set
-+# CONFIG_RD_LZ4 is not set
-+CONFIG_KALLSYMS_ALL=y
-+CONFIG_PERF_EVENTS=y
-+# CONFIG_COMPAT_BRK is not set
-+CONFIG_JUMP_LABEL=y
-+CONFIG_MODULES=y
-+CONFIG_MODULE_UNLOAD=y
-+CONFIG_PARTITION_ADVANCED=y
-+# CONFIG_IOSCHED_DEADLINE is not set
-+# CONFIG_PPC_PMAC is not set
-+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
-+CONFIG_HZ_100=y
-+CONFIG_KEXEC=y
-+CONFIG_IRQ_ALL_CPUS=y
-+# CONFIG_COMPACTION is not set
-+# CONFIG_MIGRATION is not set
-+# CONFIG_BOUNCE is not set
-+CONFIG_PPC_64K_PAGES=y
-+CONFIG_SCHED_SMT=y
-+# CONFIG_SUSPEND is not set
-+# CONFIG_SECCOMP is not set
-+CONFIG_NET=y
-+CONFIG_PACKET=y
-+CONFIG_UNIX=y
-+CONFIG_INET=y
-+CONFIG_IP_MULTICAST=y
-+CONFIG_NET_IPIP=y
-+CONFIG_SYN_COOKIES=y
-+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-+# CONFIG_INET_XFRM_MODE_BEET is not set
-+# CONFIG_IPV6 is not set
-+# CONFIG_WIRELESS is not set
-+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-+CONFIG_DEVTMPFS=y
-+CONFIG_DEVTMPFS_MOUNT=y
-+CONFIG_BLK_DEV_LOOP=y
-+CONFIG_BLK_DEV_RAM=y
-+CONFIG_BLK_DEV_RAM_SIZE=65536
-+CONFIG_ATA_OVER_ETH=y
-+CONFIG_VIRTIO_BLK=y
-+CONFIG_EEPROM_AT24=y
-+CONFIG_CXL=y
-+CONFIG_BLK_DEV_SD=y
-+CONFIG_CHR_DEV_ST=y
-+CONFIG_BLK_DEV_SR=y
-+CONFIG_BLK_DEV_SR_VENDOR=y
-+CONFIG_CHR_DEV_SG=y
-+CONFIG_SCSI_CONSTANTS=y
-+CONFIG_SCSI_SCAN_ASYNC=y
-+CONFIG_SCSI_FC_ATTRS=y
-+CONFIG_SCSI_CXGB3_ISCSI=y
-+CONFIG_SCSI_CXGB4_ISCSI=y
-+CONFIG_SCSI_BNX2_ISCSI=y
-+CONFIG_BE2ISCSI=y
-+CONFIG_SCSI_AACRAID=y
-+CONFIG_SCSI_MPT2SAS=y
-+CONFIG_SCSI_IBMVSCSI=y
-+CONFIG_SCSI_SYM53C8XX_2=y
-+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
-+CONFIG_SCSI_IPR=y
-+# CONFIG_SCSI_IPR_TRACE is not set
-+# CONFIG_SCSI_IPR_DUMP is not set
-+CONFIG_SCSI_QLA_FC=y
-+CONFIG_SCSI_QLA_ISCSI=y
-+CONFIG_SCSI_LPFC=y
-+CONFIG_SCSI_VIRTIO=y
-+CONFIG_SCSI_DH=y
-+CONFIG_SCSI_DH_ALUA=y
-+CONFIG_ATA=y
-+CONFIG_SATA_AHCI=y
-+# CONFIG_ATA_SFF is not set
-+CONFIG_MD=y
-+CONFIG_BLK_DEV_MD=y
-+CONFIG_MD_LINEAR=y
-+CONFIG_MD_RAID0=y
-+CONFIG_MD_RAID1=y
-+CONFIG_MD_RAID10=y
-+CONFIG_MD_RAID456=y
-+CONFIG_MD_MULTIPATH=y
-+CONFIG_MD_FAULTY=y
-+CONFIG_BLK_DEV_DM=y
-+CONFIG_DM_CRYPT=y
-+CONFIG_DM_SNAPSHOT=y
-+CONFIG_DM_MIRROR=y
-+CONFIG_DM_ZERO=y
-+CONFIG_DM_MULTIPATH=y
-+CONFIG_NETCONSOLE=y
-+CONFIG_TUN=y
-+CONFIG_VIRTIO_NET=y
-+CONFIG_VORTEX=y
-+CONFIG_ACENIC=y
-+CONFIG_ACENIC_OMIT_TIGON_I=y
-+CONFIG_PCNET32=y
-+CONFIG_TIGON3=y
-+CONFIG_BNX2X=y
-+CONFIG_CHELSIO_T1=y
-+CONFIG_BE2NET=y
-+CONFIG_S2IO=y
-+CONFIG_IBMVETH=y
-+CONFIG_E100=y
-+CONFIG_E1000=y
-+CONFIG_E1000E=y
-+CONFIG_IXGB=y
-+CONFIG_IXGBE=y
-+CONFIG_MLX4_EN=y
-+CONFIG_MYRI10GE=y
-+CONFIG_QLGE=y
-+CONFIG_NETXEN_NIC=y
-+CONFIG_SFC=y
-+# CONFIG_WLAN is not set
-+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-+CONFIG_INPUT_EVDEV=y
-+CONFIG_INPUT_MISC=y
-+# CONFIG_SERIO_SERPORT is not set
-+CONFIG_SERIAL_8250=y
-+CONFIG_SERIAL_8250_CONSOLE=y
-+CONFIG_HVC_CONSOLE=y
-+CONFIG_IPMI_HANDLER=y
-+CONFIG_IPMI_DEVICE_INTERFACE=y
-+CONFIG_IPMI_POWERNV=y
-+CONFIG_HW_RANDOM=y
-+CONFIG_GEN_RTC=y
-+CONFIG_RAW_DRIVER=y
-+CONFIG_MAX_RAW_DEVS=1024
-+# CONFIG_I2C_COMPAT is not set
-+CONFIG_I2C_CHARDEV=y
-+# CONFIG_I2C_HELPER_AUTO is not set
-+CONFIG_DRM=y
-+CONFIG_DRM_RADEON=y
-+CONFIG_DRM_AST=y
-+CONFIG_FIRMWARE_EDID=y
-+CONFIG_FB_MODE_HELPERS=y
-+CONFIG_FB_OF=y
-+CONFIG_FB_MATROX=y
-+CONFIG_FB_MATROX_MILLENIUM=y
-+CONFIG_FB_MATROX_MYSTIQUE=y
-+CONFIG_FB_MATROX_G=y
-+CONFIG_BACKLIGHT_LCD_SUPPORT=y
-+# CONFIG_LCD_CLASS_DEVICE is not set
-+# CONFIG_BACKLIGHT_GENERIC is not set
-+# CONFIG_VGA_CONSOLE is not set
-+CONFIG_LOGO=y
-+CONFIG_USB_HIDDEV=y
-+CONFIG_USB=y
-+CONFIG_USB_MON=y
-+CONFIG_USB_XHCI_HCD=y
-+CONFIG_USB_EHCI_HCD=y
-+# CONFIG_USB_EHCI_HCD_PPC_OF is not set
-+CONFIG_USB_OHCI_HCD=y
-+CONFIG_USB_STORAGE=y
-+CONFIG_VIRT_DRIVERS=y
-+CONFIG_VIRTIO_PCI=y
-+# CONFIG_IOMMU_SUPPORT is not set
-+CONFIG_EXT4_FS=y
-+CONFIG_EXT4_FS_POSIX_ACL=y
-+CONFIG_EXT4_FS_SECURITY=y
-+CONFIG_XFS_FS=y
-+CONFIG_XFS_POSIX_ACL=y
-+CONFIG_BTRFS_FS=y
-+CONFIG_BTRFS_FS_POSIX_ACL=y
-+CONFIG_AUTOFS4_FS=y
-+CONFIG_ISO9660_FS=y
-+CONFIG_UDF_FS=y
-+CONFIG_MSDOS_FS=y
-+CONFIG_VFAT_FS=y
-+CONFIG_PROC_KCORE=y
-+CONFIG_TMPFS=y
-+CONFIG_TMPFS_POSIX_ACL=y
-+CONFIG_NFS_FS=y
-+CONFIG_NFS_V3_ACL=y
-+CONFIG_NFS_V4=y
-+CONFIG_CIFS=y
-+# CONFIG_CIFS_DEBUG is not set
-+CONFIG_NLS_DEFAULT="utf8"
-+CONFIG_NLS_CODEPAGE_437=y
-+CONFIG_NLS_ASCII=y
-+CONFIG_NLS_ISO8859_1=y
-+CONFIG_NLS_UTF8=y
-+CONFIG_PRINTK_TIME=y
-+CONFIG_DEBUG_FS=y
-+CONFIG_MAGIC_SYSRQ=y
-+CONFIG_DEBUG_KERNEL=y
-+CONFIG_DEBUG_STACKOVERFLOW=y
-+CONFIG_LOCKUP_DETECTOR=y
-+CONFIG_SCHEDSTATS=y
-+# CONFIG_FTRACE is not set
-+CONFIG_XMON=y
-+CONFIG_XMON_DEFAULT=y
-+CONFIG_CRYPTO_ECHAINIV=y
-+# CONFIG_CRYPTO_HW is not set
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0004-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch b/openpower/linux/linux-0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
similarity index 72%
rename from openpower/linux/linux-0004-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
rename to openpower/linux/linux-0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
index 687622e..2c071b4 100644
--- a/openpower/linux/linux-0004-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
+++ b/openpower/linux/linux-0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
@@ -1,7 +1,7 @@
-From 179982a2b95c1151ecca72cbe3c74464d2852e10 Mon Sep 17 00:00:00 2001
+From 3f099329a4aa747c3cccb502bb3a671df6e76cfd Mon Sep 17 00:00:00 2001
 From: Thadeu Lima De Souza Cascardo <thadeul@br.ibm.com>
 Date: Tue, 25 Mar 2014 10:45:16 -0400
-Subject: [PATCH 04/18] xhci: Use xhci_pci_remove for xhci device shutdown
+Subject: [PATCH 1/7] xhci: Use xhci_pci_remove for xhci device shutdown
 
 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
 Signed-off-by: Joel Stanley <joel@jms.id.au>
@@ -10,10 +10,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
-index 5590eac..ed4cabd 100644
+index c2d65206ec6c..c2d33e274542 100644
 --- a/drivers/usb/host/xhci-pci.c
 +++ b/drivers/usb/host/xhci-pci.c
-@@ -419,7 +419,7 @@ static struct pci_driver xhci_pci_driver = {
+@@ -438,7 +438,7 @@ static struct pci_driver xhci_pci_driver = {
  	.remove =	xhci_pci_remove,
  	/* suspend and resume implemented later */
  
@@ -23,5 +23,5 @@
  	.driver = {
  		.pm = &usb_hcd_pci_pm_ops
 -- 
-2.5.0
+2.7.3
 
diff --git a/openpower/linux/linux-0002-Revert-usb-xhci-stop-everything-on-the-first-call-to.patch b/openpower/linux/linux-0002-Revert-usb-xhci-stop-everything-on-the-first-call-to.patch
new file mode 100644
index 0000000..9dcb6c3
--- /dev/null
+++ b/openpower/linux/linux-0002-Revert-usb-xhci-stop-everything-on-the-first-call-to.patch
@@ -0,0 +1,62 @@
+From 797d3fde5250abb4dedf00536282b8f93e4b66fe Mon Sep 17 00:00:00 2001
+From: Joel Stanley <joel@jms.id.au>
+Date: Thu, 28 Jan 2016 13:07:06 +1030
+Subject: [PATCH 2/7] Revert "usb: xhci: stop everything on the first call to
+ xhci_stop"
+
+This reverts commit 8c24d6d7b09deee3036ddc4f2b81b53b28c8f877.
+
+With this patch, the driver stops everything at the first call to
+xhci_stop, which is always for the secondary HCD when executing the
+.remove handler. We instead want to only stop when the primray HCD is
+shutting down.
+
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ drivers/usb/host/xhci.c | 20 +++++++++++++++-----
+ 1 file changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
+index 776d59c32bc5..cef80e930db9 100644
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -665,6 +665,15 @@ int xhci_run(struct usb_hcd *hcd)
+ }
+ EXPORT_SYMBOL_GPL(xhci_run);
+ 
++static void xhci_only_stop_hcd(struct usb_hcd *hcd)
++{
++	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
++
++	spin_lock_irq(&xhci->lock);
++	xhci_halt(xhci);
++	spin_unlock_irq(&xhci->lock);
++}
++
+ /*
+  * Stop xHCI driver.
+  *
+@@ -679,14 +688,15 @@ void xhci_stop(struct usb_hcd *hcd)
+ 	u32 temp;
+ 	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+ 
+-	if (xhci->xhc_state & XHCI_STATE_HALTED)
++	mutex_lock(&xhci->mutex);
++
++	if (!usb_hcd_is_primary_hcd(hcd)) {
++		xhci_only_stop_hcd(xhci->shared_hcd);
++		mutex_unlock(&xhci->mutex);
+ 		return;
++	}
+ 
+-	mutex_lock(&xhci->mutex);
+ 	spin_lock_irq(&xhci->lock);
+-	xhci->xhc_state |= XHCI_STATE_HALTED;
+-	xhci->cmd_ring_state = CMD_RING_STATE_STOPPED;
+-
+ 	/* Make sure the xHC is halted for a USB3 roothub
+ 	 * (xhci_stop() could be called as part of failed init).
+ 	 */
+-- 
+2.7.3
+
diff --git a/openpower/linux/linux-0002-net-bnx2x-Add-shutdown-handler.patch b/openpower/linux/linux-0002-net-bnx2x-Add-shutdown-handler.patch
deleted file mode 100644
index 8fbb009..0000000
--- a/openpower/linux/linux-0002-net-bnx2x-Add-shutdown-handler.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 1f3e4395adc3b9f1d2ec088dd18e88a6fc89330d Mon Sep 17 00:00:00 2001
-From: Jeremy Kerr <jk@ozlabs.org>
-Date: Fri, 7 Mar 2014 10:17:22 +0800
-Subject: [PATCH 02/18] net/bnx2x: Add shutdown handler
-
-This change uses the existing .remove handler for device shutdown.
-
-Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
-index c27af12..d08fd26 100644
---- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
-+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
-@@ -13906,6 +13906,7 @@ static struct pci_driver bnx2x_pci_driver = {
- 	.name        = DRV_MODULE_NAME,
- 	.id_table    = bnx2x_pci_tbl,
- 	.probe       = bnx2x_init_one,
-+	.shutdown    = bnx2x_remove_one,
- 	.remove      = bnx2x_remove_one,
- 	.suspend     = bnx2x_suspend,
- 	.resume      = bnx2x_resume,
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0003-xhci-do-not-halt-the-secondary-HCD.patch b/openpower/linux/linux-0003-xhci-do-not-halt-the-secondary-HCD.patch
index b8030c3..5e42d2f 100644
--- a/openpower/linux/linux-0003-xhci-do-not-halt-the-secondary-HCD.patch
+++ b/openpower/linux/linux-0003-xhci-do-not-halt-the-secondary-HCD.patch
@@ -1,7 +1,7 @@
-From a8538355237e20fe0a0b204ca67465350701f98c Mon Sep 17 00:00:00 2001
+From 05ac3b2476dd66ba26622d437c2517dd3ac389f1 Mon Sep 17 00:00:00 2001
 From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
 Date: Mon, 10 Mar 2014 13:02:13 -0300
-Subject: [PATCH 03/18] xhci: do not halt the secondary HCD
+Subject: [PATCH 3/7] xhci: do not halt the secondary HCD
 
 We can't halt the secondary HCD, because it's also the primary HCD,
 which will cause problems if we have devices attached to the primary
@@ -14,10 +14,10 @@
  1 file changed, 12 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
-index 526ebc0..07f9683 100644
+index cef80e930db9..90f48eb32d93 100644
 --- a/drivers/usb/host/xhci.c
 +++ b/drivers/usb/host/xhci.c
-@@ -659,7 +659,18 @@ static void xhci_only_stop_hcd(struct usb_hcd *hcd)
+@@ -670,7 +670,18 @@ static void xhci_only_stop_hcd(struct usb_hcd *hcd)
  	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
  
  	spin_lock_irq(&xhci->lock);
@@ -38,5 +38,5 @@
  }
  
 -- 
-2.5.0
+2.7.3
 
diff --git a/openpower/linux/linux-0004-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch b/openpower/linux/linux-0004-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch
new file mode 100644
index 0000000..f924468
--- /dev/null
+++ b/openpower/linux/linux-0004-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch
@@ -0,0 +1,72 @@
+From c12cb7a8c9c8d780ff454399bf4bbbffdd3941f4 Mon Sep 17 00:00:00 2001
+From: Jeremy Kerr <jk@ozlabs.org>
+Date: Wed, 2 Mar 2016 11:25:47 +0800
+Subject: [PATCH 4/7] drivers/drm/ast: Switch SCU to VGA output on POST
+
+On AST BMC platforms, the BMC may be using the VGA device for UART
+mirroring. In this case, we need to switch the DAC output to
+VGA mode.
+
+Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ drivers/gpu/drm/ast/ast_post.c | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c
+index 810c51d92b99..703dba2ba84b 100644
+--- a/drivers/gpu/drm/ast/ast_post.c
++++ b/drivers/gpu/drm/ast/ast_post.c
+@@ -32,6 +32,7 @@
+ #include "ast_dram_tables.h"
+ 
+ static void ast_init_dram_2300(struct drm_device *dev);
++static void ast_init_output_control(struct drm_device *dev);
+ 
+ void ast_enable_vga(struct drm_device *dev)
+ {
+@@ -384,6 +385,9 @@ void ast_post_gpu(struct drm_device *dev)
+ 	else
+ 		ast_init_dram_reg(dev);
+ 
++	if (ast->chip == AST2400)
++		ast_init_output_control(dev);
++
+ 	ast_init_3rdtx(dev);
+ }
+ 
+@@ -1655,3 +1659,31 @@ static void ast_init_dram_2300(struct drm_device *dev)
+ 	} while ((reg & 0x40) == 0);
+ }
+ 
++static void ast_init_output_control(struct drm_device *dev)
++{
++	struct ast_private *ast = dev->dev_private;
++	const uint32_t scu_addr = 0x1e6e2000;
++	const uint32_t scu_key = 0x1688a8a8;
++	uint32_t val;
++
++	/* unlock write access to SCUs */
++	val = ast_mindwm(ast, scu_addr);
++	ast_moutdwm(ast, scu_addr, scu_key);
++
++	/* configure SCU2C with the appropriate video output mode */
++	val = ast_mindwm(ast, scu_addr | 0x2c);
++
++	switch (ast->tx_chip_type) {
++	case AST_TX_SIL164:
++	case AST_TX_DP501:
++		/* Enable DVO output */
++		val &= ~0x40000;
++		break;
++	default:
++		/* VGA only: enable DAC output */
++		val &= ~0x30000;
++		break;
++	}
++
++	ast_moutdwm(ast, scu_addr | 0x2c, val);
++}
+-- 
+2.7.3
+
diff --git a/openpower/linux/linux-0005-drm-ast-Default-to-8bpp-on-big-endian.patch b/openpower/linux/linux-0005-drm-ast-Default-to-8bpp-on-big-endian.patch
deleted file mode 100644
index 205e1f6..0000000
--- a/openpower/linux/linux-0005-drm-ast-Default-to-8bpp-on-big-endian.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From bea892898f5fe11ac0c24404db59d3ade6981b9e Mon Sep 17 00:00:00 2001
-From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-Date: Fri, 31 Oct 2014 15:06:38 +1100
-Subject: [PATCH 05/18] drm/ast: Default to 8bpp on big endian
-
-This chip is LE only (some versions support HW swappers but not
-the latest and the driver doesn't anyway).
-
-I tried using the "foreign endian" fb flag but it appears to be
-busted, so instead, default to endian-neutral 8bpp for BE.
-
-Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/gpu/drm/ast/ast_fb.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
-index ff68eef..c532c69 100644
---- a/drivers/gpu/drm/ast/ast_fb.c
-+++ b/drivers/gpu/drm/ast/ast_fb.c
-@@ -345,7 +345,20 @@ int ast_fbdev_init(struct drm_device *dev)
- 	/* disable all the possible outputs/crtcs before entering KMS mode */
- 	drm_helper_disable_unused_functions(dev);
- 
-+	/*
-+	 * This chip is LE only (some versions support HW swappers but not
-+	 * the latest and the driver doesn't anyway).
-+	 *
-+	 * I tried using the "foreign endian" fb flag but it appears to be
-+	 * busted, so instead, default to endian-neutral 8bpp for BE.
-+	 *
-+	 * (and it's faster !)
-+	 */
-+#if defined(__BIG_ENDIAN)
-+	ret = drm_fb_helper_initial_config(&afbdev->helper, 8);
-+#else
- 	ret = drm_fb_helper_initial_config(&afbdev->helper, 32);
-+#endif
- 	if (ret)
- 		goto fini;
- 
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0005-scsi-ignore-errors-from-scsi_dh_add_device.patch b/openpower/linux/linux-0005-scsi-ignore-errors-from-scsi_dh_add_device.patch
new file mode 100644
index 0000000..f6dec62
--- /dev/null
+++ b/openpower/linux/linux-0005-scsi-ignore-errors-from-scsi_dh_add_device.patch
@@ -0,0 +1,42 @@
+From 9d3559f97bd5183d4f84bbef3ea445a2ef841080 Mon Sep 17 00:00:00 2001
+From: Hannes Reinecke <hare@suse.de>
+Date: Tue, 1 Mar 2016 13:57:59 +1100
+Subject: [PATCH 5/7] scsi: ignore errors from scsi_dh_add_device()
+
+device handler initialisation might fail due to a number of
+reasons. But as device_handlers are optional this shouldn't
+cause us to disable the device entirely.
+So just ignore errors from scsi_dh_add_device().
+
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Hannes Reinecke <hare@suse.de>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ drivers/scsi/scsi_sysfs.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
+index c8115b4fe474..750df9b9b11c 100644
+--- a/drivers/scsi/scsi_sysfs.c
++++ b/drivers/scsi/scsi_sysfs.c
+@@ -1058,11 +1058,12 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
+ 	}
+ 
+ 	error = scsi_dh_add_device(sdev);
+-	if (error) {
++	if (error)
++		/*
++		 * device_handler is optional, so any error can be ignored
++		 */
+ 		sdev_printk(KERN_INFO, sdev,
+ 				"failed to add device handler: %d\n", error);
+-		return error;
+-	}
+ 
+ 	device_enable_async_suspend(&sdev->sdev_dev);
+ 	error = device_add(&sdev->sdev_dev);
+-- 
+2.7.3
+
diff --git a/openpower/linux/linux-0006-net-mlx4_core-Set-UAR-page-size-to-4KB-regardless-of.patch b/openpower/linux/linux-0006-net-mlx4_core-Set-UAR-page-size-to-4KB-regardless-of.patch
new file mode 100644
index 0000000..11f9135
--- /dev/null
+++ b/openpower/linux/linux-0006-net-mlx4_core-Set-UAR-page-size-to-4KB-regardless-of.patch
@@ -0,0 +1,299 @@
+From 50d6158618c001b19967ab48aa9e25b2885b3374 Mon Sep 17 00:00:00 2001
+From: Huy Nguyen <huyn@mellanox.com>
+Date: Wed, 17 Feb 2016 17:24:26 +0200
+Subject: [PATCH 6/7] net/mlx4_core: Set UAR page size to 4KB regardless of
+ system page size
+
+problem description:
+
+The current code sets UAR page size equal to system page size.
+The ConnectX-3 and ConnectX-3 Pro HWs require minimum 128 UAR pages.
+The mlx4 kernel drivers are not loaded if there is less than 128 UAR pages.
+
+solution:
+
+Always set UAR page to 4KB. This allows more UAR pages if the OS
+has PAGE_SIZE larger than 4KB. For example, PowerPC kernel use 64KB
+system page size, with 4MB uar region, there are 4MB/2/64KB = 32
+uars (half for uar, half for blueflame). This does not meet minimum 128
+UAR pages requirement. With 4KB UAR page, there are 4MB/2/4KB = 512 uars
+which meet the minimum requirement.
+
+Note that only codes in mlx4_core that deal with firmware know that uar
+page size is 4KB. Codes that deal with usr page in cq and qp context
+(mlx4_ib, mlx4_en and part of mlx4_core) still have the same assumption
+that uar page size equals to system page size.
+
+Note that with this implementation, on 64KB system page size kernel, there
+are 16 uars per system page but only one uars is used. The other 15
+uars are ignored because of the above assumption.
+
+Regarding SR-IOV, mlx4_core in hypervisor will set the uar page size
+to 4KB and mlx4_core code in virtual OS will obtain the uar page size from
+firmware.
+
+Regarding backward compatibility in SR-IOV, if hypervisor has this new code,
+the virtual OS must be updated. If hypervisor has old code, and the virtual
+OS has this new code, the new code will be backward compatible with the
+old code. If the uar size is big enough, this new code in VF continues to
+work with 64 KB uar page size (on PowerPc kernel). If the uar size does not
+meet 128 uars requirement, this new code not loaded in VF and print the same
+error message as the old code in Hypervisor.
+
+Signed-off-by: Huy Nguyen <huyn@mellanox.com>
+Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit 85743f1eb34548ba4b056d2f184a3d107a3b8917)
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ drivers/infiniband/hw/mlx4/qp.c                   |  7 ++-
+ drivers/net/ethernet/mellanox/mlx4/cq.c           |  4 +-
+ drivers/net/ethernet/mellanox/mlx4/en_resources.c |  3 +-
+ drivers/net/ethernet/mellanox/mlx4/en_tx.c        |  4 +-
+ drivers/net/ethernet/mellanox/mlx4/eq.c           |  7 +--
+ drivers/net/ethernet/mellanox/mlx4/main.c         | 56 ++++++++++++++++++-----
+ drivers/net/ethernet/mellanox/mlx4/pd.c           | 12 +++--
+ include/linux/mlx4/device.h                       | 13 ++++++
+ 8 files changed, 84 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
+index 13eaaf45288f..c981fba11da8 100644
+--- a/drivers/infiniband/hw/mlx4/qp.c
++++ b/drivers/infiniband/hw/mlx4/qp.c
+@@ -1591,9 +1591,12 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
+ 	}
+ 
+ 	if (qp->ibqp.uobject)
+-		context->usr_page = cpu_to_be32(to_mucontext(ibqp->uobject->context)->uar.index);
++		context->usr_page = cpu_to_be32(
++			mlx4_to_hw_uar_index(dev->dev,
++					     to_mucontext(ibqp->uobject->context)->uar.index));
+ 	else
+-		context->usr_page = cpu_to_be32(dev->priv_uar.index);
++		context->usr_page = cpu_to_be32(
++			mlx4_to_hw_uar_index(dev->dev, dev->priv_uar.index));
+ 
+ 	if (attr_mask & IB_QP_DEST_QPN)
+ 		context->remote_qpn = cpu_to_be32(attr->dest_qp_num);
+diff --git a/drivers/net/ethernet/mellanox/mlx4/cq.c b/drivers/net/ethernet/mellanox/mlx4/cq.c
+index 3348e646db70..a849da92f857 100644
+--- a/drivers/net/ethernet/mellanox/mlx4/cq.c
++++ b/drivers/net/ethernet/mellanox/mlx4/cq.c
+@@ -318,7 +318,9 @@ int mlx4_cq_alloc(struct mlx4_dev *dev, int nent,
+ 	if (timestamp_en)
+ 		cq_context->flags  |= cpu_to_be32(1 << 19);
+ 
+-	cq_context->logsize_usrpage = cpu_to_be32((ilog2(nent) << 24) | uar->index);
++	cq_context->logsize_usrpage =
++		cpu_to_be32((ilog2(nent) << 24) |
++			    mlx4_to_hw_uar_index(dev, uar->index));
+ 	cq_context->comp_eqn	    = priv->eq_table.eq[MLX4_CQ_TO_EQ_VECTOR(vector)].eqn;
+ 	cq_context->log_page_size   = mtt->page_shift - MLX4_ICM_PAGE_SHIFT;
+ 
+diff --git a/drivers/net/ethernet/mellanox/mlx4/en_resources.c b/drivers/net/ethernet/mellanox/mlx4/en_resources.c
+index 12aab5a659d3..02e925d6f734 100644
+--- a/drivers/net/ethernet/mellanox/mlx4/en_resources.c
++++ b/drivers/net/ethernet/mellanox/mlx4/en_resources.c
+@@ -58,7 +58,8 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride,
+ 	} else {
+ 		context->sq_size_stride = ilog2(TXBB_SIZE) - 4;
+ 	}
+-	context->usr_page = cpu_to_be32(mdev->priv_uar.index);
++	context->usr_page = cpu_to_be32(mlx4_to_hw_uar_index(mdev->dev,
++					mdev->priv_uar.index));
+ 	context->local_qpn = cpu_to_be32(qpn);
+ 	context->pri_path.ackto = 1 & 0x07;
+ 	context->pri_path.sched_queue = 0x83 | (priv->port - 1) << 6;
+diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+index 4421bf5463f6..e0946ab22010 100644
+--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
++++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+@@ -213,7 +213,9 @@ int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv,
+ 	mlx4_en_fill_qp_context(priv, ring->size, ring->stride, 1, 0, ring->qpn,
+ 				ring->cqn, user_prio, &ring->context);
+ 	if (ring->bf_alloced)
+-		ring->context.usr_page = cpu_to_be32(ring->bf.uar->index);
++		ring->context.usr_page =
++			cpu_to_be32(mlx4_to_hw_uar_index(mdev->dev,
++							 ring->bf.uar->index));
+ 
+ 	err = mlx4_qp_to_ready(mdev->dev, &ring->wqres.mtt, &ring->context,
+ 			       &ring->qp, &ring->qp_state);
+diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c
+index 603d1c3d3b2e..ad6240e45441 100644
+--- a/drivers/net/ethernet/mellanox/mlx4/eq.c
++++ b/drivers/net/ethernet/mellanox/mlx4/eq.c
+@@ -924,9 +924,10 @@ static void __iomem *mlx4_get_eq_uar(struct mlx4_dev *dev, struct mlx4_eq *eq)
+ 
+ 	if (!priv->eq_table.uar_map[index]) {
+ 		priv->eq_table.uar_map[index] =
+-			ioremap(pci_resource_start(dev->persist->pdev, 2) +
+-				((eq->eqn / 4) << PAGE_SHIFT),
+-				PAGE_SIZE);
++			ioremap(
++				pci_resource_start(dev->persist->pdev, 2) +
++				((eq->eqn / 4) << (dev->uar_page_shift)),
++				(1 << (dev->uar_page_shift)));
+ 		if (!priv->eq_table.uar_map[index]) {
+ 			mlx4_err(dev, "Couldn't map EQ doorbell for EQN 0x%06x\n",
+ 				 eq->eqn);
+diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
+index 31c491e02e69..225551150442 100644
+--- a/drivers/net/ethernet/mellanox/mlx4/main.c
++++ b/drivers/net/ethernet/mellanox/mlx4/main.c
+@@ -168,6 +168,20 @@ struct mlx4_port_config {
+ 
+ static atomic_t pf_loading = ATOMIC_INIT(0);
+ 
++static inline void mlx4_set_num_reserved_uars(struct mlx4_dev *dev,
++					      struct mlx4_dev_cap *dev_cap)
++{
++	/* The reserved_uars is calculated by system page size unit.
++	 * Therefore, adjustment is added when the uar page size is less
++	 * than the system page size
++	 */
++	dev->caps.reserved_uars	=
++		max_t(int,
++		      mlx4_get_num_reserved_uar(dev),
++		      dev_cap->reserved_uars /
++			(1 << (PAGE_SHIFT - dev->uar_page_shift)));
++}
++
+ int mlx4_check_port_params(struct mlx4_dev *dev,
+ 			   enum mlx4_port_type *port_type)
+ {
+@@ -386,8 +400,6 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
+ 	dev->caps.reserved_mtts      = dev_cap->reserved_mtts;
+ 	dev->caps.reserved_mrws	     = dev_cap->reserved_mrws;
+ 
+-	/* The first 128 UARs are used for EQ doorbells */
+-	dev->caps.reserved_uars	     = max_t(int, 128, dev_cap->reserved_uars);
+ 	dev->caps.reserved_pds	     = dev_cap->reserved_pds;
+ 	dev->caps.reserved_xrcds     = (dev->caps.flags & MLX4_DEV_CAP_FLAG_XRC) ?
+ 					dev_cap->reserved_xrcds : 0;
+@@ -405,6 +417,15 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
+ 	dev->caps.max_gso_sz	     = dev_cap->max_gso_sz;
+ 	dev->caps.max_rss_tbl_sz     = dev_cap->max_rss_tbl_sz;
+ 
++	/* Save uar page shift */
++	if (!mlx4_is_slave(dev)) {
++		/* Virtual PCI function needs to determine UAR page size from
++		 * firmware. Only master PCI function can set the uar page size
++		 */
++		dev->uar_page_shift = DEFAULT_UAR_PAGE_SHIFT;
++		mlx4_set_num_reserved_uars(dev, dev_cap);
++	}
++
+ 	if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PHV_EN) {
+ 		struct mlx4_init_hca_param hca_param;
+ 
+@@ -815,16 +836,25 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)
+ 		return -ENODEV;
+ 	}
+ 
+-	/* slave gets uar page size from QUERY_HCA fw command */
+-	dev->caps.uar_page_size = 1 << (hca_param.uar_page_sz + 12);
++	/* Set uar_page_shift for VF */
++	dev->uar_page_shift = hca_param.uar_page_sz + 12;
+ 
+-	/* TODO: relax this assumption */
+-	if (dev->caps.uar_page_size != PAGE_SIZE) {
+-		mlx4_err(dev, "UAR size:%d != kernel PAGE_SIZE of %ld\n",
+-			 dev->caps.uar_page_size, PAGE_SIZE);
+-		return -ENODEV;
++	/* Make sure the master uar page size is valid */
++	if (dev->uar_page_shift > PAGE_SHIFT) {
++		mlx4_err(dev,
++			 "Invalid configuration: uar page size is larger than system page size\n");
++		return  -ENODEV;
+ 	}
+ 
++	/* Set reserved_uars based on the uar_page_shift */
++	mlx4_set_num_reserved_uars(dev, &dev_cap);
++
++	/* Although uar page size in FW differs from system page size,
++	 * upper software layers (mlx4_ib, mlx4_en and part of mlx4_core)
++	 * still works with assumption that uar page size == system page size
++	 */
++	dev->caps.uar_page_size = PAGE_SIZE;
++
+ 	memset(&func_cap, 0, sizeof(func_cap));
+ 	err = mlx4_QUERY_FUNC_CAP(dev, 0, &func_cap);
+ 	if (err) {
+@@ -2092,8 +2122,12 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
+ 
+ 		dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1;
+ 
+-		init_hca.log_uar_sz = ilog2(dev->caps.num_uars);
+-		init_hca.uar_page_sz = PAGE_SHIFT - 12;
++		/* Always set UAR page size 4KB, set log_uar_sz accordingly */
++		init_hca.log_uar_sz = ilog2(dev->caps.num_uars) +
++				      PAGE_SHIFT -
++				      DEFAULT_UAR_PAGE_SHIFT;
++		init_hca.uar_page_sz = DEFAULT_UAR_PAGE_SHIFT - 12;
++
+ 		init_hca.mw_enabled = 0;
+ 		if (dev->caps.flags & MLX4_DEV_CAP_FLAG_MEM_WINDOW ||
+ 		    dev->caps.bmme_flags & MLX4_BMME_FLAG_TYPE_2_WIN)
+diff --git a/drivers/net/ethernet/mellanox/mlx4/pd.c b/drivers/net/ethernet/mellanox/mlx4/pd.c
+index 609c59dc854e..b3cc3ab63799 100644
+--- a/drivers/net/ethernet/mellanox/mlx4/pd.c
++++ b/drivers/net/ethernet/mellanox/mlx4/pd.c
+@@ -269,9 +269,15 @@ EXPORT_SYMBOL_GPL(mlx4_bf_free);
+ 
+ int mlx4_init_uar_table(struct mlx4_dev *dev)
+ {
+-	if (dev->caps.num_uars <= 128) {
+-		mlx4_err(dev, "Only %d UAR pages (need more than 128)\n",
+-			 dev->caps.num_uars);
++	int num_reserved_uar = mlx4_get_num_reserved_uar(dev);
++
++	mlx4_dbg(dev, "uar_page_shift = %d", dev->uar_page_shift);
++	mlx4_dbg(dev, "Effective reserved_uars=%d", dev->caps.reserved_uars);
++
++	if (dev->caps.num_uars <= num_reserved_uar) {
++		mlx4_err(
++			dev, "Only %d UAR pages (need more than %d)\n",
++			dev->caps.num_uars, num_reserved_uar);
+ 		mlx4_err(dev, "Increase firmware log2_uar_bar_megabytes?\n");
+ 		return -ENODEV;
+ 	}
+diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
+index d3133be12d92..8bab38f8872a 100644
+--- a/include/linux/mlx4/device.h
++++ b/include/linux/mlx4/device.h
+@@ -44,6 +44,8 @@
+ 
+ #include <linux/timecounter.h>
+ 
++#define DEFAULT_UAR_PAGE_SHIFT  12
++
+ #define MAX_MSIX_P_PORT		17
+ #define MAX_MSIX		64
+ #define MIN_MSIX_P_PORT		5
+@@ -853,6 +855,7 @@ struct mlx4_dev {
+ 	u64			regid_promisc_array[MLX4_MAX_PORTS + 1];
+ 	u64			regid_allmulti_array[MLX4_MAX_PORTS + 1];
+ 	struct mlx4_vf_dev     *dev_vfs;
++	u8  uar_page_shift;
+ };
+ 
+ struct mlx4_clock_params {
+@@ -1527,4 +1530,14 @@ int mlx4_ACCESS_PTYS_REG(struct mlx4_dev *dev,
+ int mlx4_get_internal_clock_params(struct mlx4_dev *dev,
+ 				   struct mlx4_clock_params *params);
+ 
++static inline int mlx4_to_hw_uar_index(struct mlx4_dev *dev, int index)
++{
++	return (index << (PAGE_SHIFT - dev->uar_page_shift));
++}
++
++static inline int mlx4_get_num_reserved_uar(struct mlx4_dev *dev)
++{
++	/* The first 128 UARs are used for EQ doorbells */
++	return (128 >> (PAGE_SHIFT - dev->uar_page_shift));
++}
+ #endif /* MLX4_DEVICE_H */
+-- 
+2.7.3
+
diff --git a/openpower/linux/linux-0006-powerpc-kexec-Reset-secondary-cpu-endianess-before-k.patch b/openpower/linux/linux-0006-powerpc-kexec-Reset-secondary-cpu-endianess-before-k.patch
deleted file mode 100644
index 1754ea4..0000000
--- a/openpower/linux/linux-0006-powerpc-kexec-Reset-secondary-cpu-endianess-before-k.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 2d2ab23cbdbbb1907f1f34085c3904efe1979df0 Mon Sep 17 00:00:00 2001
-From: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
-Date: Mon, 29 Jun 2015 13:43:51 +1000
-Subject: [PATCH 06/18] powerpc/kexec: Reset secondary cpu endianess before
- kexec
-
-If the target kernel does not inlcude the FIXUP_ENDIAN check, coming
-from a different-endian kernel will cause the target kernel to panic.
-All ppc64 kernels can handle starting in big-endian mode, so return to
-big-endian before branching into the target kernel.
-
-This mainly affects pseries as secondaries on powernv are returned to
-OPAL.
-
-Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- arch/powerpc/kernel/misc_64.S | 13 +++++++++++--
- 1 file changed, 11 insertions(+), 2 deletions(-)
-
-diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
-index 4e314b9..6e4168c 100644
---- a/arch/powerpc/kernel/misc_64.S
-+++ b/arch/powerpc/kernel/misc_64.S
-@@ -475,9 +475,18 @@ _GLOBAL(kexec_wait)
- #ifdef CONFIG_KEXEC		/* use no memory without kexec */
- 	lwz	r4,0(r5)
- 	cmpwi	0,r4,0
--	bnea	0x60
-+	beq	99b
-+#ifdef CONFIG_PPC_BOOK3S_64
-+	li	r10,0x60
-+	mfmsr	r11
-+	clrrdi	r11,r11,1	/* Clear MSR_LE */
-+	mtsrr0	r10
-+	mtsrr1	r11
-+	rfid
-+#else
-+	ba	0x60
-+#endif
- #endif
--	b	99b
- 
- /* this can be in text because we won't change it until we are
-  * running in real anyways
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0007-Release-4.4.6-openpower1.patch b/openpower/linux/linux-0007-Release-4.4.6-openpower1.patch
new file mode 100644
index 0000000..b8c7e49
--- /dev/null
+++ b/openpower/linux/linux-0007-Release-4.4.6-openpower1.patch
@@ -0,0 +1,26 @@
+From 67b6cef1f1fe1801bbe015be2bccc5e3d9d32f2a Mon Sep 17 00:00:00 2001
+From: Joel Stanley <joel@jms.id.au>
+Date: Tue, 20 Oct 2015 15:01:06 +1030
+Subject: [PATCH 7/7] Release 4.4.6-openpower1
+
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 87d12b44ab66..9a78974bdab4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+ VERSION = 4
+ PATCHLEVEL = 4
+ SUBLEVEL = 6
+-EXTRAVERSION =
++EXTRAVERSION = -openpower1
+ NAME = Blurry Fish Butt
+ 
+ # *DOCUMENTATION*
+-- 
+2.7.3
+
diff --git a/openpower/linux/linux-0007-powerpc-kexec-Reset-HILE-before-kexec_sequence.patch b/openpower/linux/linux-0007-powerpc-kexec-Reset-HILE-before-kexec_sequence.patch
deleted file mode 100644
index 66f59b4..0000000
--- a/openpower/linux/linux-0007-powerpc-kexec-Reset-HILE-before-kexec_sequence.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From b7d553c5fce6888aa29a19627b20d9f34d0aee57 Mon Sep 17 00:00:00 2001
-From: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
-Date: Wed, 22 Jul 2015 11:09:15 +1000
-Subject: [PATCH 07/18] powerpc/kexec: Reset HILE before kexec_sequence
-
-On powernv secondary cpus are returned to OPAL, and will then enter
-the target kernel in big-endian. However if it is set the HILE bit
-will persist, causing the first exception in the target kernel to be
-delivered in litte-endian regardless of the current endianess.
-
-If running on top of OPAL make sure the HILE bit is reset once we've
-finished waiting for all of the secondaries to be returned to OPAL.
-
-Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- arch/powerpc/platforms/powernv/setup.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
-index 53737e0..59076db 100644
---- a/arch/powerpc/platforms/powernv/setup.c
-+++ b/arch/powerpc/platforms/powernv/setup.c
-@@ -243,6 +243,13 @@ static void pnv_kexec_cpu_down(int crash_shutdown, int secondary)
- 	} else {
- 		/* Primary waits for the secondaries to have reached OPAL */
- 		pnv_kexec_wait_secondaries_down();
-+
-+		/*
-+		 * We might be running as little-endian - now that interrupts
-+		 * are disabled, reset the HILE bit to big-endian so we don't
-+		 * take interrupts in the wrong endian later
-+		 */
-+		opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE);
- 	}
- }
- #endif /* CONFIG_KEXEC */
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0008-Revert-powerpc-Reject-binutils-2.24-when-building-li.patch b/openpower/linux/linux-0008-Revert-powerpc-Reject-binutils-2.24-when-building-li.patch
deleted file mode 100644
index 5dda631..0000000
--- a/openpower/linux/linux-0008-Revert-powerpc-Reject-binutils-2.24-when-building-li.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 6e423929667756362eec6155eb371843c6e65038 Mon Sep 17 00:00:00 2001
-From: Joel Stanley <joel@jms.id.au>
-Date: Fri, 11 Sep 2015 14:43:18 +0930
-Subject: [PATCH 08/18] Revert "powerpc: Reject binutils 2.24 when building
- little endian"
-
-This reverts commit 60e065f70bdb0b0e916389024922ad40f3270c96.
-
-We know better than Michael does; we carry a patch that fixes our
-binutils.
-
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- arch/powerpc/Makefile | 8 --------
- 1 file changed, 8 deletions(-)
-
-diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
-index 05f464e..b2ae85d 100644
---- a/arch/powerpc/Makefile
-+++ b/arch/powerpc/Makefile
-@@ -358,14 +358,6 @@ checkbin:
- 		echo 'disable kernel modules' ; \
- 		false ; \
- 	fi
--	@if test "x${CONFIG_CPU_LITTLE_ENDIAN}" = "xy" \
--	    && $(LD) --version | head -1 | grep ' 2\.24$$' >/dev/null ; then \
--		echo -n '*** binutils 2.24 miscompiles weak symbols ' ; \
--		echo 'in some circumstances.' ; \
--		echo -n '*** Please use a different binutils version.' ; \
--		false ; \
--	fi
--
- 
- CLEAN_FILES += $(TOUT)
- 
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0009-aacraid-Fix-for-LD-name-and-UID-not-exposed-to-OS.patch b/openpower/linux/linux-0009-aacraid-Fix-for-LD-name-and-UID-not-exposed-to-OS.patch
deleted file mode 100644
index e9950d5..0000000
--- a/openpower/linux/linux-0009-aacraid-Fix-for-LD-name-and-UID-not-exposed-to-OS.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 317f2be52fd70c80cc5e421f08d6e229552d096c Mon Sep 17 00:00:00 2001
-From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Date: Fri, 28 Aug 2015 06:38:33 -0400
-Subject: [PATCH 09/18] aacraid: Fix for LD name and UID not exposed to OS
-
-Driver sends the right size of the response buffer.
-
-Reviewed-by: Tomas Henzl <thenzl@redhat.com>
-Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
-Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
-Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/scsi/aacraid/aachba.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
-index 9b3dd6e..fe59b00 100644
---- a/drivers/scsi/aacraid/aachba.c
-+++ b/drivers/scsi/aacraid/aachba.c
-@@ -570,7 +570,7 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd)
- 
- 	status = aac_fib_send(ContainerCommand,
- 		  cmd_fibcontext,
--		  sizeof (struct aac_get_name),
-+		  sizeof(struct aac_get_name_resp),
- 		  FsaNormal,
- 		  0, 1,
- 		  (fib_callback)get_container_name_callback,
-@@ -1052,7 +1052,7 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd)
- 
- 	status = aac_fib_send(ContainerCommand,
- 		  cmd_fibcontext,
--		  sizeof (struct aac_get_serial),
-+		  sizeof(struct aac_get_serial_resp),
- 		  FsaNormal,
- 		  0, 1,
- 		  (fib_callback) get_container_serial_callback,
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0010-aacraid-Add-Power-Management-support.patch b/openpower/linux/linux-0010-aacraid-Add-Power-Management-support.patch
deleted file mode 100644
index 32e39f7..0000000
--- a/openpower/linux/linux-0010-aacraid-Add-Power-Management-support.patch
+++ /dev/null
@@ -1,441 +0,0 @@
-From b39c80fbb42cfca6766807c2f846c4d77dae0fa7 Mon Sep 17 00:00:00 2001
-From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Date: Fri, 28 Aug 2015 06:38:34 -0400
-Subject: [PATCH 10/18] aacraid: Add Power Management support
-
-* .suspend() and .resume() routines implemented in the driver
-* aac_release_resources() initiates firmware shutdown
-* aac_acquire_resources re-initializes the host interface
-
-Reviewed-by: Tomas Henzl <thenzl@redhat.com>
-Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
-Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
-Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/scsi/aacraid/aacraid.h  |   5 ++
- drivers/scsi/aacraid/comminit.c | 154 ++++++++++++++++++++--------------------
- drivers/scsi/aacraid/linit.c    | 147 ++++++++++++++++++++++++++++++++++++++
- drivers/scsi/aacraid/rx.c       |   1 +
- drivers/scsi/aacraid/sa.c       |   1 +
- drivers/scsi/aacraid/src.c      |   2 +
- 6 files changed, 232 insertions(+), 78 deletions(-)
-
-diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
-index 40fe65c..62b0999 100644
---- a/drivers/scsi/aacraid/aacraid.h
-+++ b/drivers/scsi/aacraid/aacraid.h
-@@ -547,6 +547,7 @@ struct adapter_ops
- 	int  (*adapter_sync_cmd)(struct aac_dev *dev, u32 command, u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6, u32 *status, u32 *r1, u32 *r2, u32 *r3, u32 *r4);
- 	int  (*adapter_check_health)(struct aac_dev *dev);
- 	int  (*adapter_restart)(struct aac_dev *dev, int bled);
-+	void (*adapter_start)(struct aac_dev *dev);
- 	/* Transport operations */
- 	int  (*adapter_ioremap)(struct aac_dev * dev, u32 size);
- 	irq_handler_t adapter_intr;
-@@ -1247,6 +1248,9 @@ struct aac_dev
- #define aac_adapter_restart(dev,bled) \
- 	(dev)->a_ops.adapter_restart(dev,bled)
- 
-+#define aac_adapter_start(dev) \
-+	((dev)->a_ops.adapter_start(dev))
-+
- #define aac_adapter_ioremap(dev, size) \
- 	(dev)->a_ops.adapter_ioremap(dev, size)
- 
-@@ -2127,6 +2131,7 @@ int aac_sa_init(struct aac_dev *dev);
- int aac_src_init(struct aac_dev *dev);
- int aac_srcv_init(struct aac_dev *dev);
- int aac_queue_get(struct aac_dev * dev, u32 * index, u32 qid, struct hw_fib * hw_fib, int wait, struct fib * fibptr, unsigned long *nonotify);
-+void aac_define_int_mode(struct aac_dev *dev);
- unsigned int aac_response_normal(struct aac_queue * q);
- unsigned int aac_command_normal(struct aac_queue * q);
- unsigned int aac_intr_normal(struct aac_dev *dev, u32 Index,
-diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
-index 45db84a..45a0a04 100644
---- a/drivers/scsi/aacraid/comminit.c
-+++ b/drivers/scsi/aacraid/comminit.c
-@@ -43,8 +43,6 @@
- 
- #include "aacraid.h"
- 
--static void aac_define_int_mode(struct aac_dev *dev);
--
- struct aac_common aac_config = {
- 	.irq_mod = 1
- };
-@@ -338,6 +336,82 @@ static int aac_comm_init(struct aac_dev * dev)
- 	return 0;
- }
- 
-+void aac_define_int_mode(struct aac_dev *dev)
-+{
-+	int i, msi_count;
-+
-+	msi_count = i = 0;
-+	/* max. vectors from GET_COMM_PREFERRED_SETTINGS */
-+	if (dev->max_msix == 0 ||
-+	    dev->pdev->device == PMC_DEVICE_S6 ||
-+	    dev->sync_mode) {
-+		dev->max_msix = 1;
-+		dev->vector_cap =
-+			dev->scsi_host_ptr->can_queue +
-+			AAC_NUM_MGT_FIB;
-+		return;
-+	}
-+
-+	/* Don't bother allocating more MSI-X vectors than cpus */
-+	msi_count = min(dev->max_msix,
-+		(unsigned int)num_online_cpus());
-+
-+	dev->max_msix = msi_count;
-+
-+	if (msi_count > AAC_MAX_MSIX)
-+		msi_count = AAC_MAX_MSIX;
-+
-+	for (i = 0; i < msi_count; i++)
-+		dev->msixentry[i].entry = i;
-+
-+	if (msi_count > 1 &&
-+	    pci_find_capability(dev->pdev, PCI_CAP_ID_MSIX)) {
-+		i = pci_enable_msix(dev->pdev,
-+				    dev->msixentry,
-+				    msi_count);
-+		 /* Check how many MSIX vectors are allocated */
-+		if (i >= 0) {
-+			dev->msi_enabled = 1;
-+			if (i) {
-+				msi_count = i;
-+				if (pci_enable_msix(dev->pdev,
-+				    dev->msixentry,
-+				    msi_count)) {
-+					dev->msi_enabled = 0;
-+					printk(KERN_ERR "%s%d: MSIX not supported!! Will try MSI 0x%x.\n",
-+							dev->name, dev->id, i);
-+				}
-+			}
-+		} else {
-+			dev->msi_enabled = 0;
-+			printk(KERN_ERR "%s%d: MSIX not supported!! Will try MSI 0x%x.\n",
-+					dev->name, dev->id, i);
-+		}
-+	}
-+
-+	if (!dev->msi_enabled) {
-+		msi_count = 1;
-+		i = pci_enable_msi(dev->pdev);
-+
-+		if (!i) {
-+			dev->msi_enabled = 1;
-+			dev->msi = 1;
-+		} else {
-+			printk(KERN_ERR "%s%d: MSI not supported!! Will try INTx 0x%x.\n",
-+					dev->name, dev->id, i);
-+		}
-+	}
-+
-+	if (!dev->msi_enabled)
-+		dev->max_msix = msi_count = 1;
-+	else {
-+		if (dev->max_msix > msi_count)
-+			dev->max_msix = msi_count;
-+	}
-+	dev->vector_cap =
-+		(dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB) /
-+		msi_count;
-+}
- struct aac_dev *aac_init_adapter(struct aac_dev *dev)
- {
- 	u32 status[5];
-@@ -508,79 +582,3 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
- 	return dev;
- }
- 
--static void aac_define_int_mode(struct aac_dev *dev)
--{
--
--	int i, msi_count;
--
--	msi_count = i = 0;
--	/* max. vectors from GET_COMM_PREFERRED_SETTINGS */
--	if (dev->max_msix == 0 ||
--	    dev->pdev->device == PMC_DEVICE_S6 ||
--	    dev->sync_mode) {
--		dev->max_msix = 1;
--		dev->vector_cap =
--			dev->scsi_host_ptr->can_queue +
--			AAC_NUM_MGT_FIB;
--		return;
--	}
--
--	msi_count = min(dev->max_msix,
--		(unsigned int)num_online_cpus());
--
--	dev->max_msix = msi_count;
--
--	if (msi_count > AAC_MAX_MSIX)
--		msi_count = AAC_MAX_MSIX;
--
--	for (i = 0; i < msi_count; i++)
--		dev->msixentry[i].entry = i;
--
--	if (msi_count > 1 &&
--	    pci_find_capability(dev->pdev, PCI_CAP_ID_MSIX)) {
--		i = pci_enable_msix(dev->pdev,
--				    dev->msixentry,
--				    msi_count);
--		 /* Check how many MSIX vectors are allocated */
--		if (i >= 0) {
--			dev->msi_enabled = 1;
--			if (i) {
--				msi_count = i;
--				if (pci_enable_msix(dev->pdev,
--				    dev->msixentry,
--				    msi_count)) {
--					dev->msi_enabled = 0;
--					printk(KERN_ERR "%s%d: MSIX not supported!! Will try MSI 0x%x.\n",
--							dev->name, dev->id, i);
--				}
--			}
--		} else {
--			dev->msi_enabled = 0;
--			printk(KERN_ERR "%s%d: MSIX not supported!! Will try MSI 0x%x.\n",
--					dev->name, dev->id, i);
--		}
--	}
--
--	if (!dev->msi_enabled) {
--		msi_count = 1;
--		i = pci_enable_msi(dev->pdev);
--
--		if (!i) {
--			dev->msi_enabled = 1;
--			dev->msi = 1;
--		} else {
--			printk(KERN_ERR "%s%d: MSI not supported!! Will try INTx 0x%x.\n",
--					dev->name, dev->id, i);
--		}
--	}
--
--	if (!dev->msi_enabled)
--		dev->max_msix = msi_count = 1;
--	else {
--		if (dev->max_msix > msi_count)
--			dev->max_msix = msi_count;
--	}
--	dev->vector_cap =
--		(dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB) /
--		msi_count;
--}
-diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
-index 9eec027..37375cf 100644
---- a/drivers/scsi/aacraid/linit.c
-+++ b/drivers/scsi/aacraid/linit.c
-@@ -1317,6 +1317,149 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
- 	return error;
- }
- 
-+#if (defined(CONFIG_PM))
-+void aac_release_resources(struct aac_dev *aac)
-+{
-+	int i;
-+
-+	aac_adapter_disable_int(aac);
-+	if (aac->pdev->device == PMC_DEVICE_S6 ||
-+	    aac->pdev->device == PMC_DEVICE_S7 ||
-+	    aac->pdev->device == PMC_DEVICE_S8 ||
-+	    aac->pdev->device == PMC_DEVICE_S9) {
-+		if (aac->max_msix > 1) {
-+			for (i = 0; i < aac->max_msix; i++)
-+				free_irq(aac->msixentry[i].vector,
-+					&(aac->aac_msix[i]));
-+		} else {
-+			free_irq(aac->pdev->irq, &(aac->aac_msix[0]));
-+		}
-+	} else {
-+		free_irq(aac->pdev->irq, aac);
-+	}
-+	if (aac->msi)
-+		pci_disable_msi(aac->pdev);
-+	else if (aac->max_msix > 1)
-+		pci_disable_msix(aac->pdev);
-+
-+}
-+
-+static int aac_acquire_resources(struct aac_dev *dev)
-+{
-+	int i, j;
-+	int instance = dev->id;
-+	const char *name = dev->name;
-+	unsigned long status;
-+	/*
-+	 *	First clear out all interrupts.  Then enable the one's that we
-+	 *	can handle.
-+	 */
-+	while (!((status = src_readl(dev, MUnit.OMR)) & KERNEL_UP_AND_RUNNING)
-+		|| status == 0xffffffff)
-+			msleep(20);
-+
-+	aac_adapter_disable_int(dev);
-+	aac_adapter_enable_int(dev);
-+
-+
-+	if ((dev->pdev->device == PMC_DEVICE_S7 ||
-+	     dev->pdev->device == PMC_DEVICE_S8 ||
-+	     dev->pdev->device == PMC_DEVICE_S9))
-+		aac_define_int_mode(dev);
-+
-+	if (dev->msi_enabled)
-+		aac_src_access_devreg(dev, AAC_ENABLE_MSIX);
-+
-+	if (!dev->sync_mode && dev->msi_enabled && dev->max_msix > 1) {
-+		for (i = 0; i < dev->max_msix; i++) {
-+			dev->aac_msix[i].vector_no = i;
-+			dev->aac_msix[i].dev = dev;
-+
-+			if (request_irq(dev->msixentry[i].vector,
-+					dev->a_ops.adapter_intr,
-+					0, "aacraid", &(dev->aac_msix[i]))) {
-+				printk(KERN_ERR "%s%d: Failed to register IRQ for vector %d.\n",
-+						name, instance, i);
-+				for (j = 0 ; j < i ; j++)
-+					free_irq(dev->msixentry[j].vector,
-+						 &(dev->aac_msix[j]));
-+				pci_disable_msix(dev->pdev);
-+				goto error_iounmap;
-+			}
-+		}
-+	} else {
-+		dev->aac_msix[0].vector_no = 0;
-+		dev->aac_msix[0].dev = dev;
-+
-+		if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
-+			IRQF_SHARED, "aacraid",
-+			&(dev->aac_msix[0])) < 0) {
-+			if (dev->msi)
-+				pci_disable_msi(dev->pdev);
-+			printk(KERN_ERR "%s%d: Interrupt unavailable.\n",
-+					name, instance);
-+			goto error_iounmap;
-+		}
-+	}
-+
-+	aac_adapter_enable_int(dev);
-+
-+	if (!dev->sync_mode)
-+		aac_adapter_start(dev);
-+	return 0;
-+
-+error_iounmap:
-+	return -1;
-+
-+}
-+static int aac_suspend(struct pci_dev *pdev, pm_message_t state)
-+{
-+
-+	struct Scsi_Host *shost = pci_get_drvdata(pdev);
-+	struct aac_dev *aac = (struct aac_dev *)shost->hostdata;
-+
-+	scsi_block_requests(shost);
-+	aac_send_shutdown(aac);
-+
-+	aac_release_resources(aac);
-+
-+	pci_set_drvdata(pdev, shost);
-+	pci_save_state(pdev);
-+	pci_disable_device(pdev);
-+	pci_set_power_state(pdev, pci_choose_state(pdev, state));
-+
-+	return 0;
-+}
-+
-+static int aac_resume(struct pci_dev *pdev)
-+{
-+	struct Scsi_Host *shost = pci_get_drvdata(pdev);
-+	struct aac_dev *aac = (struct aac_dev *)shost->hostdata;
-+	int r;
-+
-+	pci_set_power_state(pdev, PCI_D0);
-+	pci_enable_wake(pdev, PCI_D0, 0);
-+	pci_restore_state(pdev);
-+	r = pci_enable_device(pdev);
-+
-+	if (r)
-+		goto fail_device;
-+
-+	pci_set_master(pdev);
-+	if (aac_acquire_resources(aac))
-+		goto fail_device;
-+	scsi_unblock_requests(shost);
-+
-+	return 0;
-+
-+fail_device:
-+	printk(KERN_INFO "%s%d: resume failed.\n", aac->name, aac->id);
-+	scsi_host_put(shost);
-+	pci_disable_device(pdev);
-+	return -ENODEV;
-+}
-+#endif
-+
- static void aac_shutdown(struct pci_dev *dev)
- {
- 	struct Scsi_Host *shost = pci_get_drvdata(dev);
-@@ -1356,6 +1499,10 @@ static struct pci_driver aac_pci_driver = {
- 	.id_table	= aac_pci_tbl,
- 	.probe		= aac_probe_one,
- 	.remove		= aac_remove_one,
-+#if (defined(CONFIG_PM))
-+	.suspend	= aac_suspend,
-+	.resume		= aac_resume,
-+#endif
- 	.shutdown	= aac_shutdown,
- };
- 
-diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
-index 9570612..ac16380 100644
---- a/drivers/scsi/aacraid/rx.c
-+++ b/drivers/scsi/aacraid/rx.c
-@@ -623,6 +623,7 @@ int _aac_rx_init(struct aac_dev *dev)
- 	dev->a_ops.adapter_sync_cmd = rx_sync_cmd;
- 	dev->a_ops.adapter_check_health = aac_rx_check_health;
- 	dev->a_ops.adapter_restart = aac_rx_restart_adapter;
-+	dev->a_ops.adapter_start = aac_rx_start_adapter;
- 
- 	/*
- 	 *	First clear out all interrupts.  Then enable the one's that we
-diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
-index e66477c..869aea2 100644
---- a/drivers/scsi/aacraid/sa.c
-+++ b/drivers/scsi/aacraid/sa.c
-@@ -372,6 +372,7 @@ int aac_sa_init(struct aac_dev *dev)
- 	dev->a_ops.adapter_sync_cmd = sa_sync_cmd;
- 	dev->a_ops.adapter_check_health = aac_sa_check_health;
- 	dev->a_ops.adapter_restart = aac_sa_restart_adapter;
-+	dev->a_ops.adapter_start = aac_sa_start_adapter;
- 	dev->a_ops.adapter_intr = aac_sa_intr;
- 	dev->a_ops.adapter_deliver = aac_rx_deliver_producer;
- 	dev->a_ops.adapter_ioremap = aac_sa_ioremap;
-diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
-index e63cf9f..b147341 100644
---- a/drivers/scsi/aacraid/src.c
-+++ b/drivers/scsi/aacraid/src.c
-@@ -726,6 +726,7 @@ int aac_src_init(struct aac_dev *dev)
- 	dev->a_ops.adapter_sync_cmd = src_sync_cmd;
- 	dev->a_ops.adapter_check_health = aac_src_check_health;
- 	dev->a_ops.adapter_restart = aac_src_restart_adapter;
-+	dev->a_ops.adapter_start = aac_src_start_adapter;
- 
- 	/*
- 	 *	First clear out all interrupts.  Then enable the one's that we
-@@ -892,6 +893,7 @@ int aac_srcv_init(struct aac_dev *dev)
- 	dev->a_ops.adapter_sync_cmd = src_sync_cmd;
- 	dev->a_ops.adapter_check_health = aac_src_check_health;
- 	dev->a_ops.adapter_restart = aac_src_restart_adapter;
-+	dev->a_ops.adapter_start = aac_src_start_adapter;
- 
- 	/*
- 	 *	First clear out all interrupts.  Then enable the one's that we
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0011-aacraid-Change-interrupt-mode-to-MSI-for-Series-6.patch b/openpower/linux/linux-0011-aacraid-Change-interrupt-mode-to-MSI-for-Series-6.patch
deleted file mode 100644
index 1ed4ef9..0000000
--- a/openpower/linux/linux-0011-aacraid-Change-interrupt-mode-to-MSI-for-Series-6.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From d9ba7aa29b0b509f955fc699e2cc46586350cc70 Mon Sep 17 00:00:00 2001
-From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Date: Fri, 28 Aug 2015 06:38:35 -0400
-Subject: [PATCH 11/18] aacraid: Change interrupt mode to MSI for Series 6
-
-This change always sets MSI interrupt mode for series-6 controller.
-
-Reviewed-by: Tomas Henzl <thenzl@redhat.com>
-Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
-Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
-Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/scsi/aacraid/aachba.c | 2 +-
- drivers/scsi/aacraid/src.c    | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
-index fe59b00..05f2a02 100644
---- a/drivers/scsi/aacraid/aachba.c
-+++ b/drivers/scsi/aacraid/aachba.c
-@@ -259,7 +259,7 @@ MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the"
- 	" 0=off, 1=on");
- module_param_named(msi, aac_msi, int, S_IRUGO|S_IWUSR);
- MODULE_PARM_DESC(msi, "IRQ handling."
--	" 0=PIC(default), 1=MSI, 2=MSI-X(unsupported, uses MSI)");
-+	" 0=PIC(default), 1=MSI, 2=MSI-X)");
- module_param(startup_timeout, int, S_IRUGO|S_IWUSR);
- MODULE_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for"
- 	" adapter to have it's kernel up and\n"
-diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
-index b147341..eb07b3d 100644
---- a/drivers/scsi/aacraid/src.c
-+++ b/drivers/scsi/aacraid/src.c
-@@ -742,7 +742,7 @@ int aac_src_init(struct aac_dev *dev)
- 	if (dev->comm_interface != AAC_COMM_MESSAGE_TYPE1)
- 		goto error_iounmap;
- 
--	dev->msi = aac_msi && !pci_enable_msi(dev->pdev);
-+	dev->msi = !pci_enable_msi(dev->pdev);
- 
- 	dev->aac_msix[0].vector_no = 0;
- 	dev->aac_msix[0].dev = dev;
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0012-aacraid-Tune-response-path-if-IsFastPath-bit-set.patch b/openpower/linux/linux-0012-aacraid-Tune-response-path-if-IsFastPath-bit-set.patch
deleted file mode 100644
index f4069ac..0000000
--- a/openpower/linux/linux-0012-aacraid-Tune-response-path-if-IsFastPath-bit-set.patch
+++ /dev/null
@@ -1,319 +0,0 @@
-From 3347b9a251462899045c322ff17a8b6b69ec6bc2 Mon Sep 17 00:00:00 2001
-From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Date: Fri, 28 Aug 2015 06:38:37 -0400
-Subject: [PATCH 12/18] aacraid: Tune response path if IsFastPath bit set
-
-If 'IsFastPath' bit is set, then response path assumes no error and skips error check.
-
-Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
-Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
-Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/scsi/aacraid/aachba.c | 259 ++++++++++++++++++++++--------------------
- 1 file changed, 137 insertions(+), 122 deletions(-)
-
-diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
-index 05f2a02..e4c2437 100644
---- a/drivers/scsi/aacraid/aachba.c
-+++ b/drivers/scsi/aacraid/aachba.c
-@@ -2977,11 +2977,16 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
- 		return;
- 
- 	BUG_ON(fibptr == NULL);
--
- 	dev = fibptr->dev;
- 
--	srbreply = (struct aac_srb_reply *) fib_data(fibptr);
-+	scsi_dma_unmap(scsicmd);
- 
-+	/* expose physical device if expose_physicald flag is on */
-+	if (scsicmd->cmnd[0] == INQUIRY && !(scsicmd->cmnd[1] & 0x01)
-+	  && expose_physicals > 0)
-+		aac_expose_phy_device(scsicmd);
-+
-+	srbreply = (struct aac_srb_reply *) fib_data(fibptr);
- 	scsicmd->sense_buffer[0] = '\0';  /* Initialize sense valid flag to false */
- 
- 	if (fibptr->flags & FIB_CONTEXT_FLAG_FASTRESP) {
-@@ -2994,147 +2999,157 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
- 		 */
- 		scsi_set_resid(scsicmd, scsi_bufflen(scsicmd)
- 				   - le32_to_cpu(srbreply->data_xfer_length));
--	}
--
--	scsi_dma_unmap(scsicmd);
--
--	/* expose physical device if expose_physicald flag is on */
--	if (scsicmd->cmnd[0] == INQUIRY && !(scsicmd->cmnd[1] & 0x01)
--	  && expose_physicals > 0)
--		aac_expose_phy_device(scsicmd);
-+		/*
-+		 * First check the fib status
-+		 */
- 
--	/*
--	 * First check the fib status
--	 */
-+		if (le32_to_cpu(srbreply->status) != ST_OK) {
-+			int len;
- 
--	if (le32_to_cpu(srbreply->status) != ST_OK){
--		int len;
--		printk(KERN_WARNING "aac_srb_callback: srb failed, status = %d\n", le32_to_cpu(srbreply->status));
--		len = min_t(u32, le32_to_cpu(srbreply->sense_data_size),
--			    SCSI_SENSE_BUFFERSIZE);
--		scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION;
--		memcpy(scsicmd->sense_buffer, srbreply->sense_data, len);
--	}
-+			printk(KERN_WARNING "aac_srb_callback: srb failed, status = %d\n", le32_to_cpu(srbreply->status));
-+			len = min_t(u32, le32_to_cpu(srbreply->sense_data_size),
-+				    SCSI_SENSE_BUFFERSIZE);
-+			scsicmd->result = DID_ERROR << 16
-+						| COMMAND_COMPLETE << 8
-+						| SAM_STAT_CHECK_CONDITION;
-+			memcpy(scsicmd->sense_buffer,
-+					srbreply->sense_data, len);
-+		}
- 
--	/*
--	 * Next check the srb status
--	 */
--	switch( (le32_to_cpu(srbreply->srb_status))&0x3f){
--	case SRB_STATUS_ERROR_RECOVERY:
--	case SRB_STATUS_PENDING:
--	case SRB_STATUS_SUCCESS:
--		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
--		break;
--	case SRB_STATUS_DATA_OVERRUN:
--		switch(scsicmd->cmnd[0]){
--		case  READ_6:
--		case  WRITE_6:
--		case  READ_10:
--		case  WRITE_10:
--		case  READ_12:
--		case  WRITE_12:
--		case  READ_16:
--		case  WRITE_16:
--			if (le32_to_cpu(srbreply->data_xfer_length) < scsicmd->underflow) {
--				printk(KERN_WARNING"aacraid: SCSI CMD underflow\n");
--			} else {
--				printk(KERN_WARNING"aacraid: SCSI CMD Data Overrun\n");
-+		/*
-+		 * Next check the srb status
-+		 */
-+		switch ((le32_to_cpu(srbreply->srb_status))&0x3f) {
-+		case SRB_STATUS_ERROR_RECOVERY:
-+		case SRB_STATUS_PENDING:
-+		case SRB_STATUS_SUCCESS:
-+			scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
-+			break;
-+		case SRB_STATUS_DATA_OVERRUN:
-+			switch (scsicmd->cmnd[0]) {
-+			case  READ_6:
-+			case  WRITE_6:
-+			case  READ_10:
-+			case  WRITE_10:
-+			case  READ_12:
-+			case  WRITE_12:
-+			case  READ_16:
-+			case  WRITE_16:
-+				if (le32_to_cpu(srbreply->data_xfer_length)
-+							< scsicmd->underflow)
-+					printk(KERN_WARNING"aacraid: SCSI CMD underflow\n");
-+				else
-+					printk(KERN_WARNING"aacraid: SCSI CMD Data Overrun\n");
-+				scsicmd->result = DID_ERROR << 16
-+							| COMMAND_COMPLETE << 8;
-+				break;
-+			case INQUIRY: {
-+				scsicmd->result = DID_OK << 16
-+							| COMMAND_COMPLETE << 8;
-+				break;
-+			}
-+			default:
-+				scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
-+				break;
- 			}
--			scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8;
- 			break;
--		case INQUIRY: {
--			scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
-+		case SRB_STATUS_ABORTED:
-+			scsicmd->result = DID_ABORT << 16 | ABORT << 8;
- 			break;
--		}
--		default:
--			scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
-+		case SRB_STATUS_ABORT_FAILED:
-+			/*
-+			 * Not sure about this one - but assuming the
-+			 * hba was trying to abort for some reason
-+			 */
-+			scsicmd->result = DID_ERROR << 16 | ABORT << 8;
-+			break;
-+		case SRB_STATUS_PARITY_ERROR:
-+			scsicmd->result = DID_PARITY << 16
-+						| MSG_PARITY_ERROR << 8;
-+			break;
-+		case SRB_STATUS_NO_DEVICE:
-+		case SRB_STATUS_INVALID_PATH_ID:
-+		case SRB_STATUS_INVALID_TARGET_ID:
-+		case SRB_STATUS_INVALID_LUN:
-+		case SRB_STATUS_SELECTION_TIMEOUT:
-+			scsicmd->result = DID_NO_CONNECT << 16
-+						| COMMAND_COMPLETE << 8;
- 			break;
--		}
--		break;
--	case SRB_STATUS_ABORTED:
--		scsicmd->result = DID_ABORT << 16 | ABORT << 8;
--		break;
--	case SRB_STATUS_ABORT_FAILED:
--		// Not sure about this one - but assuming the hba was trying to abort for some reason
--		scsicmd->result = DID_ERROR << 16 | ABORT << 8;
--		break;
--	case SRB_STATUS_PARITY_ERROR:
--		scsicmd->result = DID_PARITY << 16 | MSG_PARITY_ERROR << 8;
--		break;
--	case SRB_STATUS_NO_DEVICE:
--	case SRB_STATUS_INVALID_PATH_ID:
--	case SRB_STATUS_INVALID_TARGET_ID:
--	case SRB_STATUS_INVALID_LUN:
--	case SRB_STATUS_SELECTION_TIMEOUT:
--		scsicmd->result = DID_NO_CONNECT << 16 | COMMAND_COMPLETE << 8;
--		break;
- 
--	case SRB_STATUS_COMMAND_TIMEOUT:
--	case SRB_STATUS_TIMEOUT:
--		scsicmd->result = DID_TIME_OUT << 16 | COMMAND_COMPLETE << 8;
--		break;
-+		case SRB_STATUS_COMMAND_TIMEOUT:
-+		case SRB_STATUS_TIMEOUT:
-+			scsicmd->result = DID_TIME_OUT << 16
-+						| COMMAND_COMPLETE << 8;
-+			break;
- 
--	case SRB_STATUS_BUSY:
--		scsicmd->result = DID_BUS_BUSY << 16 | COMMAND_COMPLETE << 8;
--		break;
-+		case SRB_STATUS_BUSY:
-+			scsicmd->result = DID_BUS_BUSY << 16
-+						| COMMAND_COMPLETE << 8;
-+			break;
- 
--	case SRB_STATUS_BUS_RESET:
--		scsicmd->result = DID_RESET << 16 | COMMAND_COMPLETE << 8;
--		break;
-+		case SRB_STATUS_BUS_RESET:
-+			scsicmd->result = DID_RESET << 16
-+						| COMMAND_COMPLETE << 8;
-+			break;
- 
--	case SRB_STATUS_MESSAGE_REJECTED:
--		scsicmd->result = DID_ERROR << 16 | MESSAGE_REJECT << 8;
--		break;
--	case SRB_STATUS_REQUEST_FLUSHED:
--	case SRB_STATUS_ERROR:
--	case SRB_STATUS_INVALID_REQUEST:
--	case SRB_STATUS_REQUEST_SENSE_FAILED:
--	case SRB_STATUS_NO_HBA:
--	case SRB_STATUS_UNEXPECTED_BUS_FREE:
--	case SRB_STATUS_PHASE_SEQUENCE_FAILURE:
--	case SRB_STATUS_BAD_SRB_BLOCK_LENGTH:
--	case SRB_STATUS_DELAYED_RETRY:
--	case SRB_STATUS_BAD_FUNCTION:
--	case SRB_STATUS_NOT_STARTED:
--	case SRB_STATUS_NOT_IN_USE:
--	case SRB_STATUS_FORCE_ABORT:
--	case SRB_STATUS_DOMAIN_VALIDATION_FAIL:
--	default:
-+		case SRB_STATUS_MESSAGE_REJECTED:
-+			scsicmd->result = DID_ERROR << 16
-+						| MESSAGE_REJECT << 8;
-+			break;
-+		case SRB_STATUS_REQUEST_FLUSHED:
-+		case SRB_STATUS_ERROR:
-+		case SRB_STATUS_INVALID_REQUEST:
-+		case SRB_STATUS_REQUEST_SENSE_FAILED:
-+		case SRB_STATUS_NO_HBA:
-+		case SRB_STATUS_UNEXPECTED_BUS_FREE:
-+		case SRB_STATUS_PHASE_SEQUENCE_FAILURE:
-+		case SRB_STATUS_BAD_SRB_BLOCK_LENGTH:
-+		case SRB_STATUS_DELAYED_RETRY:
-+		case SRB_STATUS_BAD_FUNCTION:
-+		case SRB_STATUS_NOT_STARTED:
-+		case SRB_STATUS_NOT_IN_USE:
-+		case SRB_STATUS_FORCE_ABORT:
-+		case SRB_STATUS_DOMAIN_VALIDATION_FAIL:
-+		default:
- #ifdef AAC_DETAILED_STATUS_INFO
--		printk("aacraid: SRB ERROR(%u) %s scsi cmd 0x%x - scsi status 0x%x\n",
--			le32_to_cpu(srbreply->srb_status) & 0x3F,
--			aac_get_status_string(
--				le32_to_cpu(srbreply->srb_status) & 0x3F),
--			scsicmd->cmnd[0],
--			le32_to_cpu(srbreply->scsi_status));
-+			printk(KERN_INFO "aacraid: SRB ERROR(%u) %s scsi cmd 0x%x - scsi status 0x%x\n",
-+				le32_to_cpu(srbreply->srb_status) & 0x3F,
-+				aac_get_status_string(
-+					le32_to_cpu(srbreply->srb_status) & 0x3F),
-+				scsicmd->cmnd[0],
-+				le32_to_cpu(srbreply->scsi_status));
- #endif
--		if ((scsicmd->cmnd[0] == ATA_12)
--		  || (scsicmd->cmnd[0] == ATA_16)) {
--			if (scsicmd->cmnd[2] & (0x01 << 5)) {
--				scsicmd->result = DID_OK << 16
--						| COMMAND_COMPLETE << 8;
-+			if ((scsicmd->cmnd[0] == ATA_12)
-+				|| (scsicmd->cmnd[0] == ATA_16)) {
-+					if (scsicmd->cmnd[2] & (0x01 << 5)) {
-+						scsicmd->result = DID_OK << 16
-+							| COMMAND_COMPLETE << 8;
- 				break;
-+				} else {
-+					scsicmd->result = DID_ERROR << 16
-+						| COMMAND_COMPLETE << 8;
-+					break;
-+				}
- 			} else {
- 				scsicmd->result = DID_ERROR << 16
--						| COMMAND_COMPLETE << 8;
-+					| COMMAND_COMPLETE << 8;
- 				break;
- 			}
--		} else {
--			scsicmd->result = DID_ERROR << 16
--					| COMMAND_COMPLETE << 8;
--			break;
- 		}
--	}
--	if (le32_to_cpu(srbreply->scsi_status) == SAM_STAT_CHECK_CONDITION) {
--		int len;
--		scsicmd->result |= SAM_STAT_CHECK_CONDITION;
--		len = min_t(u32, le32_to_cpu(srbreply->sense_data_size),
--			    SCSI_SENSE_BUFFERSIZE);
-+		if (le32_to_cpu(srbreply->scsi_status)
-+				== SAM_STAT_CHECK_CONDITION) {
-+			int len;
-+
-+			scsicmd->result |= SAM_STAT_CHECK_CONDITION;
-+			len = min_t(u32, le32_to_cpu(srbreply->sense_data_size),
-+				    SCSI_SENSE_BUFFERSIZE);
- #ifdef AAC_DETAILED_STATUS_INFO
--		printk(KERN_WARNING "aac_srb_callback: check condition, status = %d len=%d\n",
--					le32_to_cpu(srbreply->status), len);
-+			printk(KERN_WARNING "aac_srb_callback: check condition, status = %d len=%d\n",
-+						le32_to_cpu(srbreply->status), len);
- #endif
--		memcpy(scsicmd->sense_buffer, srbreply->sense_data, len);
-+			memcpy(scsicmd->sense_buffer,
-+					srbreply->sense_data, len);
-+		}
- 	}
- 	/*
- 	 * OR in the scsi status (already shifted up a bit)
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0013-aacraid-Enable-64bit-write-to-controller-register.patch b/openpower/linux/linux-0013-aacraid-Enable-64bit-write-to-controller-register.patch
deleted file mode 100644
index c0fb3d2..0000000
--- a/openpower/linux/linux-0013-aacraid-Enable-64bit-write-to-controller-register.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From e778c7f7ca05f9abad4d590e3979b3c3970cfd26 Mon Sep 17 00:00:00 2001
-From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Date: Fri, 28 Aug 2015 06:38:36 -0400
-Subject: [PATCH 13/18] aacraid: Enable 64bit write to controller register
-
-If writeq() not supported, then do atomic two 32bit write
-
-Reviewed-by: Tomas Henzl <thenzl@redhat.com>
-Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
-Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
-Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/scsi/aacraid/aacraid.h  |  9 +++++++++
- drivers/scsi/aacraid/comminit.c |  1 +
- drivers/scsi/aacraid/src.c      | 12 ++++++++++--
- 3 files changed, 20 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
-index 62b0999..e54f597 100644
---- a/drivers/scsi/aacraid/aacraid.h
-+++ b/drivers/scsi/aacraid/aacraid.h
-@@ -844,6 +844,10 @@ struct src_registers {
- 						&((AEP)->regs.src.bar0->CSR))
- #define src_writel(AEP, CSR, value)	writel(value, \
- 						&((AEP)->regs.src.bar0->CSR))
-+#if defined(writeq)
-+#define	src_writeq(AEP, CSR, value)	writeq(value, \
-+						&((AEP)->regs.src.bar0->CSR))
-+#endif
- 
- #define SRC_ODR_SHIFT		12
- #define SRC_IDR_SHIFT		9
-@@ -1163,6 +1167,11 @@ struct aac_dev
- 	struct fsa_dev_info	*fsa_dev;
- 	struct task_struct	*thread;
- 	int			cardtype;
-+	/*
-+	 *This lock will protect the two 32-bit
-+	 *writes to the Inbound Queue
-+	 */
-+	spinlock_t		iq_lock;
- 
- 	/*
- 	 *	The following is the device specific extension.
-diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
-index 45a0a04..b4b6088 100644
---- a/drivers/scsi/aacraid/comminit.c
-+++ b/drivers/scsi/aacraid/comminit.c
-@@ -424,6 +424,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
- 	dev->management_fib_count = 0;
- 	spin_lock_init(&dev->manage_lock);
- 	spin_lock_init(&dev->sync_lock);
-+	spin_lock_init(&dev->iq_lock);
- 	dev->max_fib_size = sizeof(struct hw_fib);
- 	dev->sg_tablesize = host->sg_tablesize = (dev->max_fib_size
- 		- sizeof(struct aac_fibhdr)
-diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
-index eb07b3d..1409a0b 100644
---- a/drivers/scsi/aacraid/src.c
-+++ b/drivers/scsi/aacraid/src.c
-@@ -447,6 +447,10 @@ static int aac_src_deliver_message(struct fib *fib)
- 	u32 fibsize;
- 	dma_addr_t address;
- 	struct aac_fib_xporthdr *pFibX;
-+#if !defined(writeq)
-+	unsigned long flags;
-+#endif
-+
- 	u16 hdr_size = le16_to_cpu(fib->hw_fib_va->header.Size);
- 
- 	atomic_inc(&q->numpending);
-@@ -511,10 +515,14 @@ static int aac_src_deliver_message(struct fib *fib)
- 			return -EINVAL;
- 		address |= fibsize;
- 	}
--
-+#if defined(writeq)
-+	src_writeq(dev, MUnit.IQ_L, (u64)address);
-+#else
-+	spin_lock_irqsave(&fib->dev->iq_lock, flags);
- 	src_writel(dev, MUnit.IQ_H, upper_32_bits(address) & 0xffffffff);
- 	src_writel(dev, MUnit.IQ_L, address & 0xffffffff);
--
-+	spin_unlock_irqrestore(&fib->dev->iq_lock, flags);
-+#endif
- 	return 0;
- }
- 
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0014-aacraid-IOCTL-fix.patch b/openpower/linux/linux-0014-aacraid-IOCTL-fix.patch
deleted file mode 100644
index 6faddc8..0000000
--- a/openpower/linux/linux-0014-aacraid-IOCTL-fix.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 892fadaa9806538ae2c419449c66f4c2838fff2d Mon Sep 17 00:00:00 2001
-From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Date: Fri, 28 Aug 2015 06:38:39 -0400
-Subject: [PATCH 14/18] aacraid: IOCTL fix
-
-Driver blocks ioctls once it received shutdown/suspend request during
-suspend/hybernation. This patch unblocks ioctls on resume path.
-
-Reviewed-by: Tomas Henzl <thenzl@redhat.com>
-Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
-Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
-Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/scsi/aacraid/linit.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
-index 37375cf..3b6e5c6 100644
---- a/drivers/scsi/aacraid/linit.c
-+++ b/drivers/scsi/aacraid/linit.c
-@@ -1448,6 +1448,11 @@ static int aac_resume(struct pci_dev *pdev)
- 	pci_set_master(pdev);
- 	if (aac_acquire_resources(aac))
- 		goto fail_device;
-+	/*
-+	* reset this flag to unblock ioctl() as it was set at
-+	* aac_send_shutdown() to block ioctls from upperlayer
-+	*/
-+	aac->adapter_shutdown = 0;
- 	scsi_unblock_requests(shost);
- 
- 	return 0;
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0015-aacraid-Reset-irq-affinity-hints.patch b/openpower/linux/linux-0015-aacraid-Reset-irq-affinity-hints.patch
deleted file mode 100644
index e9d6d9d..0000000
--- a/openpower/linux/linux-0015-aacraid-Reset-irq-affinity-hints.patch
+++ /dev/null
@@ -1,242 +0,0 @@
-From 81d42e7a457e420041f27b97efdfc6176647876a Mon Sep 17 00:00:00 2001
-From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Date: Fri, 28 Aug 2015 06:38:38 -0400
-Subject: [PATCH 15/18] aacraid: Reset irq affinity hints
-
-Reset irq affinity hints before releasing IRQ.
-Removed duplicate code of IRQ acquire/release.
-
-Reviewed-by: Tomas Henzl <thenzl@redhat.com>
-Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
-Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
-Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/scsi/aacraid/aacraid.h |   2 +
- drivers/scsi/aacraid/commsup.c | 113 ++++++++++++++++++++++++++++++-----------
- drivers/scsi/aacraid/src.c     |  48 ++---------------
- 3 files changed, 88 insertions(+), 75 deletions(-)
-
-diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
-index e54f597..7b95227 100644
---- a/drivers/scsi/aacraid/aacraid.h
-+++ b/drivers/scsi/aacraid/aacraid.h
-@@ -2110,6 +2110,8 @@ static inline unsigned int cap_to_cyls(sector_t capacity, unsigned divisor)
- #define AAC_OWNER_ERROR_HANDLER	0x103
- #define AAC_OWNER_FIRMWARE	0x106
- 
-+int aac_acquire_irq(struct aac_dev *dev);
-+void aac_free_irq(struct aac_dev *dev);
- const char *aac_driverinfo(struct Scsi_Host *);
- struct fib *aac_fib_alloc(struct aac_dev *dev);
- int aac_fib_setup(struct aac_dev *dev);
-diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
-index 4da5749..a1f90fe 100644
---- a/drivers/scsi/aacraid/commsup.c
-+++ b/drivers/scsi/aacraid/commsup.c
-@@ -1270,13 +1270,12 @@ retry_next:
- static int _aac_reset_adapter(struct aac_dev *aac, int forced)
- {
- 	int index, quirks;
--	int retval, i;
-+	int retval;
- 	struct Scsi_Host *host;
- 	struct scsi_device *dev;
- 	struct scsi_cmnd *command;
- 	struct scsi_cmnd *command_list;
- 	int jafo = 0;
--	int cpu;
- 
- 	/*
- 	 * Assumptions:
-@@ -1339,35 +1338,7 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced)
- 	aac->comm_phys = 0;
- 	kfree(aac->queues);
- 	aac->queues = NULL;
--	cpu = cpumask_first(cpu_online_mask);
--	if (aac->pdev->device == PMC_DEVICE_S6 ||
--	    aac->pdev->device == PMC_DEVICE_S7 ||
--	    aac->pdev->device == PMC_DEVICE_S8 ||
--	    aac->pdev->device == PMC_DEVICE_S9) {
--		if (aac->max_msix > 1) {
--			for (i = 0; i < aac->max_msix; i++) {
--				if (irq_set_affinity_hint(
--				    aac->msixentry[i].vector,
--				    NULL)) {
--					printk(KERN_ERR "%s%d: Failed to reset IRQ affinity for cpu %d\n",
--						aac->name,
--						aac->id,
--						cpu);
--				}
--				cpu = cpumask_next(cpu,
--						cpu_online_mask);
--				free_irq(aac->msixentry[i].vector,
--					 &(aac->aac_msix[i]));
--			}
--			pci_disable_msix(aac->pdev);
--		} else {
--			free_irq(aac->pdev->irq, &(aac->aac_msix[0]));
--		}
--	} else {
--		free_irq(aac->pdev->irq, aac);
--	}
--	if (aac->msi)
--		pci_disable_msi(aac->pdev);
-+	aac_free_irq(aac);
- 	kfree(aac->fsa_dev);
- 	aac->fsa_dev = NULL;
- 	quirks = aac_get_driver_ident(index)->quirks;
-@@ -1978,3 +1949,83 @@ int aac_command_thread(void *data)
- 	dev->aif_thread = 0;
- 	return 0;
- }
-+
-+int aac_acquire_irq(struct aac_dev *dev)
-+{
-+	int i;
-+	int j;
-+	int ret = 0;
-+	int cpu;
-+
-+	cpu = cpumask_first(cpu_online_mask);
-+	if (!dev->sync_mode && dev->msi_enabled && dev->max_msix > 1) {
-+		for (i = 0; i < dev->max_msix; i++) {
-+			dev->aac_msix[i].vector_no = i;
-+			dev->aac_msix[i].dev = dev;
-+			if (request_irq(dev->msixentry[i].vector,
-+					dev->a_ops.adapter_intr,
-+					0, "aacraid", &(dev->aac_msix[i]))) {
-+				printk(KERN_ERR "%s%d: Failed to register IRQ for vector %d.\n",
-+						dev->name, dev->id, i);
-+				for (j = 0 ; j < i ; j++)
-+					free_irq(dev->msixentry[j].vector,
-+						 &(dev->aac_msix[j]));
-+				pci_disable_msix(dev->pdev);
-+				ret = -1;
-+			}
-+			if (irq_set_affinity_hint(dev->msixentry[i].vector,
-+							get_cpu_mask(cpu))) {
-+				printk(KERN_ERR "%s%d: Failed to set IRQ affinity for cpu %d\n",
-+					    dev->name, dev->id, cpu);
-+			}
-+			cpu = cpumask_next(cpu, cpu_online_mask);
-+		}
-+	} else {
-+		dev->aac_msix[0].vector_no = 0;
-+		dev->aac_msix[0].dev = dev;
-+
-+		if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
-+			IRQF_SHARED, "aacraid",
-+			&(dev->aac_msix[0])) < 0) {
-+			if (dev->msi)
-+				pci_disable_msi(dev->pdev);
-+			printk(KERN_ERR "%s%d: Interrupt unavailable.\n",
-+					dev->name, dev->id);
-+			ret = -1;
-+		}
-+	}
-+	return ret;
-+}
-+
-+void aac_free_irq(struct aac_dev *dev)
-+{
-+	int i;
-+	int cpu;
-+
-+	cpu = cpumask_first(cpu_online_mask);
-+	if (dev->pdev->device == PMC_DEVICE_S6 ||
-+	    dev->pdev->device == PMC_DEVICE_S7 ||
-+	    dev->pdev->device == PMC_DEVICE_S8 ||
-+	    dev->pdev->device == PMC_DEVICE_S9) {
-+		if (dev->max_msix > 1) {
-+			for (i = 0; i < dev->max_msix; i++) {
-+				if (irq_set_affinity_hint(
-+					dev->msixentry[i].vector, NULL)) {
-+					printk(KERN_ERR "%s%d: Failed to reset IRQ affinity for cpu %d\n",
-+					    dev->name, dev->id, cpu);
-+				}
-+				cpu = cpumask_next(cpu, cpu_online_mask);
-+				free_irq(dev->msixentry[i].vector,
-+						&(dev->aac_msix[i]));
-+			}
-+		} else {
-+			free_irq(dev->pdev->irq, &(dev->aac_msix[0]));
-+		}
-+	} else {
-+		free_irq(dev->pdev->irq, dev);
-+	}
-+	if (dev->msi)
-+		pci_disable_msi(dev->pdev);
-+	else if (dev->max_msix > 1)
-+		pci_disable_msix(dev->pdev);
-+}
-diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
-index 1409a0b..2aa34ea 100644
---- a/drivers/scsi/aacraid/src.c
-+++ b/drivers/scsi/aacraid/src.c
-@@ -798,9 +798,7 @@ int aac_srcv_init(struct aac_dev *dev)
- 	unsigned long status;
- 	int restart = 0;
- 	int instance = dev->id;
--	int i, j;
- 	const char *name = dev->name;
--	int cpu;
- 
- 	dev->a_ops.adapter_ioremap = aac_srcv_ioremap;
- 	dev->a_ops.adapter_comm = aac_src_select_comm;
-@@ -918,48 +916,10 @@ int aac_srcv_init(struct aac_dev *dev)
- 		goto error_iounmap;
- 	if (dev->msi_enabled)
- 		aac_src_access_devreg(dev, AAC_ENABLE_MSIX);
--	if (!dev->sync_mode && dev->msi_enabled && dev->max_msix > 1) {
--		cpu = cpumask_first(cpu_online_mask);
--		for (i = 0; i < dev->max_msix; i++) {
--			dev->aac_msix[i].vector_no = i;
--			dev->aac_msix[i].dev = dev;
--
--			if (request_irq(dev->msixentry[i].vector,
--					dev->a_ops.adapter_intr,
--					0,
--					"aacraid",
--					&(dev->aac_msix[i]))) {
--				printk(KERN_ERR "%s%d: Failed to register IRQ for vector %d.\n",
--						name, instance, i);
--				for (j = 0 ; j < i ; j++)
--					free_irq(dev->msixentry[j].vector,
--						 &(dev->aac_msix[j]));
--				pci_disable_msix(dev->pdev);
--				goto error_iounmap;
--			}
--			if (irq_set_affinity_hint(
--			   dev->msixentry[i].vector,
--			   get_cpu_mask(cpu))) {
--				printk(KERN_ERR "%s%d: Failed to set IRQ affinity for cpu %d\n",
--						name, instance, cpu);
--			}
--			cpu = cpumask_next(cpu, cpu_online_mask);
--		}
--	} else {
--		dev->aac_msix[0].vector_no = 0;
--		dev->aac_msix[0].dev = dev;
--
--		if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
--				IRQF_SHARED,
--				"aacraid",
--				&(dev->aac_msix[0])) < 0) {
--			if (dev->msi)
--				pci_disable_msi(dev->pdev);
--			printk(KERN_ERR "%s%d: Interrupt unavailable.\n",
--					name, instance);
--			goto error_iounmap;
--		}
--	}
-+
-+	if (aac_acquire_irq(dev))
-+		goto error_iounmap;
-+
- 	dev->dbg_base = dev->base_start;
- 	dev->dbg_base_mapped = dev->base;
- 	dev->dbg_size = dev->base_size;
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0016-aacraid-Use-pci_enable_msix_range.patch b/openpower/linux/linux-0016-aacraid-Use-pci_enable_msix_range.patch
deleted file mode 100644
index b3ba206..0000000
--- a/openpower/linux/linux-0016-aacraid-Use-pci_enable_msix_range.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From e27d0ec1620e6c79a1cfe7286ad142f6c0701011 Mon Sep 17 00:00:00 2001
-From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Date: Fri, 28 Aug 2015 06:38:40 -0400
-Subject: [PATCH 16/18] aacraid: Use pci_enable_msix_range()
-
-As pci_enable_msix() deprecated, replaced with pci_enable_msix_range()
-
-Reviewed-by: Tomas Henzl <thenzl@redhat.com>
-Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
-Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
-Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/scsi/aacraid/aacraid.h  |  2 +-
- drivers/scsi/aacraid/comminit.c | 20 ++++++--------------
- 2 files changed, 7 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
-index 7b95227..2de5ebc 100644
---- a/drivers/scsi/aacraid/aacraid.h
-+++ b/drivers/scsi/aacraid/aacraid.h
-@@ -12,7 +12,7 @@
-  *              D E F I N E S
-  *----------------------------------------------------------------------------*/
- 
--#define AAC_MAX_MSIX		8	/* vectors */
-+#define AAC_MAX_MSIX		32	/* vectors */
- #define AAC_PCI_MSI_ENABLE	0x8000
- 
- enum {
-diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
-index b4b6088..0e954e3 100644
---- a/drivers/scsi/aacraid/comminit.c
-+++ b/drivers/scsi/aacraid/comminit.c
-@@ -338,7 +338,7 @@ static int aac_comm_init(struct aac_dev * dev)
- 
- void aac_define_int_mode(struct aac_dev *dev)
- {
--	int i, msi_count;
-+	int i, msi_count, min_msix;
- 
- 	msi_count = i = 0;
- 	/* max. vectors from GET_COMM_PREFERRED_SETTINGS */
-@@ -366,22 +366,14 @@ void aac_define_int_mode(struct aac_dev *dev)
- 
- 	if (msi_count > 1 &&
- 	    pci_find_capability(dev->pdev, PCI_CAP_ID_MSIX)) {
--		i = pci_enable_msix(dev->pdev,
-+		min_msix = 2;
-+		i = pci_enable_msix_range(dev->pdev,
- 				    dev->msixentry,
-+				    min_msix,
- 				    msi_count);
--		 /* Check how many MSIX vectors are allocated */
--		if (i >= 0) {
-+		if (i > 0) {
- 			dev->msi_enabled = 1;
--			if (i) {
--				msi_count = i;
--				if (pci_enable_msix(dev->pdev,
--				    dev->msixentry,
--				    msi_count)) {
--					dev->msi_enabled = 0;
--					printk(KERN_ERR "%s%d: MSIX not supported!! Will try MSI 0x%x.\n",
--							dev->name, dev->id, i);
--				}
--			}
-+			msi_count = i;
- 		} else {
- 			dev->msi_enabled = 0;
- 			printk(KERN_ERR "%s%d: MSIX not supported!! Will try MSI 0x%x.\n",
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0017-aacraid-Update-driver-version.patch b/openpower/linux/linux-0017-aacraid-Update-driver-version.patch
deleted file mode 100644
index 09345a3..0000000
--- a/openpower/linux/linux-0017-aacraid-Update-driver-version.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From f11a9348cf2abcc11bc1b98a9976d73107df88b0 Mon Sep 17 00:00:00 2001
-From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Date: Fri, 28 Aug 2015 06:38:41 -0400
-Subject: [PATCH 17/18] aacraid: Update driver version
-
-Reviewed-by: Tomas Henzl <thenzl@redhat.com>
-Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
-Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
-Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/scsi/aacraid/aacraid.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
-index 2de5ebc..074878b 100644
---- a/drivers/scsi/aacraid/aacraid.h
-+++ b/drivers/scsi/aacraid/aacraid.h
-@@ -62,7 +62,7 @@ enum {
- #define	PMC_GLOBAL_INT_BIT0		0x00000001
- 
- #ifndef AAC_DRIVER_BUILD
--# define AAC_DRIVER_BUILD 40709
-+# define AAC_DRIVER_BUILD 41010
- # define AAC_DRIVER_BRANCH "-ms"
- #endif
- #define MAXIMUM_NUM_CONTAINERS	32
--- 
-2.5.0
-
diff --git a/openpower/linux/linux-0018-Fix-crash-in-ast-fbcon-on-boot.patch b/openpower/linux/linux-0018-Fix-crash-in-ast-fbcon-on-boot.patch
deleted file mode 100644
index 5e55969..0000000
--- a/openpower/linux/linux-0018-Fix-crash-in-ast-fbcon-on-boot.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From d56cf122d12632a0015e19778a71c88f80799227 Mon Sep 17 00:00:00 2001
-From: Stewart Smith <stewart@linux.vnet.ibm.com>
-Date: Sat, 3 Oct 2015 11:02:31 +1000
-Subject: [PATCH 1/2] Fix crash in ast fbcon on boot
-
-theory is ops->cur_blink_jiffies is not getting initialised before adding
-the timer
-
-Reported-by: Stephanie M Swanson <swanman@us.ibm.com>
-Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
----
- drivers/video/console/fbcon.c |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
-
-diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
-index 1aaf893..45d2a0a 100644
---- a/drivers/video/console/fbcon.c
-+++ b/drivers/video/console/fbcon.c
-@@ -416,6 +416,8 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
- 			INIT_WORK(&info->queue, fb_flashcursor);
- 
- 		init_timer(&ops->cursor_timer);
-+		if (ops->cur_blink_jiffies < 1)
-+			ops->cur_blink_jiffies = msecs_to_jiffies(200);
- 		ops->cursor_timer.function = cursor_timer_handler;
- 		ops->cursor_timer.expires = jiffies + ops->cur_blink_jiffies;
- 		ops->cursor_timer.data = (unsigned long ) info;
--- 
-1.7.1
-
diff --git a/openpower/linux/linux-0019-Release-4.2.1-openpower2.patch b/openpower/linux/linux-0019-Release-4.2.1-openpower2.patch
deleted file mode 100644
index 2e0e847..0000000
--- a/openpower/linux/linux-0019-Release-4.2.1-openpower2.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 185b564ab788e84bb7b07482f7fdbb816b209b46 Mon Sep 17 00:00:00 2001
-From: Stewart Smith <stewart@linux.vnet.ibm.com>
-Date: Sat, 3 Oct 2015 11:07:20 +1000
-Subject: [PATCH 2/2] Release 4.2.1-openpower2
-
-Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
----
- Makefile |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index a03efc1..ca21a06 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1,7 +1,7 @@
- VERSION = 4
- PATCHLEVEL = 2
- SUBLEVEL = 1
--EXTRAVERSION =
-+EXTRAVERSION = -openpower2
- NAME = Hurr durr I'ma sheep
- 
- # *DOCUMENTATION*
--- 
-1.7.1
-
diff --git a/openpower/package/Config.in b/openpower/package/Config.in
old mode 100644
new mode 100755
index ab00242..e7e26fb
--- a/openpower/package/Config.in
+++ b/openpower/package/Config.in
@@ -5,9 +5,11 @@
 source "$BR2_EXTERNAL/package/habanero-xml/Config.in"
 source "$BR2_EXTERNAL/package/firestone-xml/Config.in"
 source "$BR2_EXTERNAL/package/garrison-xml/Config.in"
+source "$BR2_EXTERNAL/package/barreleye-xml/Config.in"
 source "$BR2_EXTERNAL/package/openpower-pnor/Config.in"
 source "$BR2_EXTERNAL/package/petitboot/Config.in"
 source "$BR2_EXTERNAL/package/p8-pore-binutils/Config.in"
 source "$BR2_EXTERNAL/package/occ/Config.in"
 source "$BR2_EXTERNAL/package/capp-ucode/Config.in"
 source "$BR2_EXTERNAL/package/skiboot/Config.in"
+source "$BR2_EXTERNAL/package/libflash/Config.in"
diff --git a/openpower/package/VERSION.readme b/openpower/package/VERSION.readme
index b9b43bb..9cd9943 100644
--- a/openpower/package/VERSION.readme
+++ b/openpower/package/VERSION.readme
@@ -72,10 +72,12 @@
 
     Current sub packages included in openpower-pnor.mk $(OPENPOWER_VERSIONED_SUBPACKAGES)
 
-    - hostboot
-    - occ
     - skiboot
+    - hostboot
+    - petitboot kernel
+    - petitboot
     - $(platform)-xml
+    - occ
     - hostboot-binaries
     - capp-ucode
 
diff --git a/openpower/package/barreleye-xml/Config.in b/openpower/package/barreleye-xml/Config.in
new file mode 100755
index 0000000..9187dac
--- /dev/null
+++ b/openpower/package/barreleye-xml/Config.in
@@ -0,0 +1,23 @@
+config BR2_PACKAGE_BARRELEYE_XML
+        bool "barreleye_xml"
+        default y if (BR2_OPENPOWER_CONFIG_NAME = "barreleye")
+        help
+            Utilites for building xml and the targeting binary image
+
+config BR2_BARRELEYE_SYSTEM_XML_FILENAME
+        string "Barreleye targeting system xml filename"
+        default ""
+        help
+            Defines the name of the system XML filename to be used when creating targeting binary image
+
+config BR2_BARRELEYE_MRW_XML_FILENAME
+        string "Barreleye targeting mrw xml filename"
+        default ""
+        help
+            Defines the name of the mrw XML filename to be used when creating targeting binary image
+
+config BR2_BARRELEYE_BIOS_XML_FILENAME
+        string "Barreleye BIOS metadata XML filename"
+        default ""
+        help
+            Defines the name of the BIOS XML filename to parse when generating BIOS metadata
diff --git a/openpower/package/barreleye-xml/barreleye-xml.mk b/openpower/package/barreleye-xml/barreleye-xml.mk
new file mode 100755
index 0000000..69600f3
--- /dev/null
+++ b/openpower/package/barreleye-xml/barreleye-xml.mk
@@ -0,0 +1,75 @@
+################################################################################
+#
+# barreleye_xml
+#
+################################################################################
+
+BARRELEYE_XML_VERSION ?= 1250f06d5b9693ac0e9609b0fa5dd6112b3dadf7
+BARRELEYE_XML_SITE = $(call github,open-power,barreleye-xml,$(BARRELEYE_XML_VERSION))
+
+BARRELEYE_XML_LICENSE = Apache-2.0
+BARRELEYE_XML_DEPENDENCIES = hostboot-install-images openpower-mrw-install-images common-p8-xml-install-images
+
+BARRELEYE_XML_INSTALL_IMAGES = YES
+BARRELEYE_XML_INSTALL_TARGET = YES
+
+MRW_SCRATCH=$(STAGING_DIR)/openpower_mrw_scratch
+MRW_HB_TOOLS=$(STAGING_DIR)/hostboot_build_images
+
+# Defines for BIOS metadata creation
+BIOS_SCHEMA_FILE = $(MRW_HB_TOOLS)/bios.xsd
+BARRELEYE_BIOS_XML_CONFIG_FILE = $(MRW_SCRATCH)/$(BR2_BARRELEYE_BIOS_XML_FILENAME)
+BIOS_XML_METADATA_FILE = \
+    $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_CONFIG_NAME)_bios_metadata.xml
+PETITBOOT_XSLT_FILE = $(MRW_HB_TOOLS)/bios_metadata_petitboot.xslt
+PETITBOOT_BIOS_XML_METADATA_FILE = \
+    $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_CONFIG_NAME)_bios_metadata_petitboot.xml
+PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE = \
+    $(TARGET_DIR)/usr/share/bios_metadata.xml
+
+define BARRELEYE_XML_BUILD_CMDS
+        # copy the barreleye xml where the common lives
+        bash -c 'mkdir -p $(MRW_SCRATCH) && cp -r $(@D)/* $(MRW_SCRATCH)'
+
+        # generate the system mrw xml
+        perl -I $(MRW_HB_TOOLS) \
+        $(MRW_HB_TOOLS)/processMrw.pl -x $(MRW_SCRATCH)/barreleye.xml
+        
+        # merge in any system specific attributes, hostboot attributes
+        $(MRW_HB_TOOLS)/mergexml.sh $(MRW_SCRATCH)/$(BR2_BARRELEYE_SYSTEM_XML_FILENAME) \
+            $(MRW_HB_TOOLS)/attribute_types.xml \
+            $(MRW_HB_TOOLS)/attribute_types_hb.xml \
+            $(MRW_HB_TOOLS)/target_types_merged.xml \
+            $(MRW_HB_TOOLS)/target_types_hb.xml \
+            $(MRW_SCRATCH)/$(BR2_BARRELEYE_MRW_XML_FILENAME) > $(MRW_HB_TOOLS)/temporary_hb.hb.xml;
+
+        # creating the targeting binary
+        $(MRW_HB_TOOLS)/xmltohb.pl  \
+            --hb-xml-file=$(MRW_HB_TOOLS)/temporary_hb.hb.xml \
+            --fapi-attributes-xml-file=$(MRW_HB_TOOLS)/fapiattrs.xml \
+            --src-output-dir=none \
+            --img-output-dir=$(MRW_HB_TOOLS)/ \
+            --vmm-consts-file=$(MRW_HB_TOOLS)/vmmconst.h --noshort-enums \
+            --bios-xml-file=$(BARRELEYE_BIOS_XML_CONFIG_FILE) \
+            --bios-schema-file=$(BIOS_SCHEMA_FILE) \
+            --bios-output-file=$(BIOS_XML_METADATA_FILE)
+
+        # Transform BIOS XML into Petitboot specific BIOS XML via the schema
+        xsltproc -o \
+            $(PETITBOOT_BIOS_XML_METADATA_FILE) \
+            $(PETITBOOT_XSLT_FILE) \
+            $(BIOS_XML_METADATA_FILE)
+endef
+
+define BARRELEYE_XML_INSTALL_IMAGES_CMDS
+        mv $(MRW_HB_TOOLS)/targeting.bin $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME)
+endef
+
+define BARRELEYE_XML_INSTALL_TARGET_CMDS
+        # Install Petitboot specific BIOS XML into initramfs's usr/share/ dir
+        $(INSTALL) -D -m 0644 \
+            $(PETITBOOT_BIOS_XML_METADATA_FILE) \
+            $(PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE)
+endef
+
+$(eval $(generic-package))
diff --git a/openpower/package/capp-ucode/capp-ucode.mk b/openpower/package/capp-ucode/capp-ucode.mk
index 028a80b..ba5acd4 100644
--- a/openpower/package/capp-ucode/capp-ucode.mk
+++ b/openpower/package/capp-ucode/capp-ucode.mk
@@ -5,7 +5,7 @@
 ################################################################################
 CAPP_UCODE_VERSION ?= 105cb8f69edb7e76c4d153bf2e5c9718811a3114
 CAPP_UCODE_SITE ?= $(call github,open-power,capp-ucode,$(CAPP_UCODE_VERSION))
-PETITBOOT_LICENSE = Apache-2.0
+CAPP_UCODE_LICENSE = Apache-2.0
 
 CAPP_UCODE_INSTALL_IMAGES = YES
 
diff --git a/openpower/package/firestone-xml/firestone.mk b/openpower/package/firestone-xml/firestone.mk
index 3210344..5f631fd 100644
--- a/openpower/package/firestone-xml/firestone.mk
+++ b/openpower/package/firestone-xml/firestone.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-FIRESTONE_XML_VERSION ?= 4db5666e5356fbc9d612fbedb93f95a93322dcd3
+FIRESTONE_XML_VERSION ?= 15e371874a8dec1d8ef279aef2d0a0fed3ded8dd
 FIRESTONE_XML_SITE ?= $(call github,open-power,firestone-xml,$(FIRESTONE_XML_VERSION))
 
 FIRESTONE_XML_LICENSE = Apache-2.0
diff --git a/openpower/package/garrison-xml/garrison.mk b/openpower/package/garrison-xml/garrison.mk
index 48e873f..3d4e4bb 100644
--- a/openpower/package/garrison-xml/garrison.mk
+++ b/openpower/package/garrison-xml/garrison.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-GARRISON_XML_VERSION ?= 7f55731b2777f2a1f52dabfb03b7512cc0d365f8
+GARRISON_XML_VERSION ?= b9af9c03a968d9f3238f93e18cd53a6f914a5de2
 GARRISON_XML_SITE ?= $(call github,open-power,garrison-xml,$(GARRISON_XML_VERSION))
 
 GARRISON_XML_LICENSE = Apache-2.0
diff --git a/openpower/package/habanero-xml/habanero-xml.mk b/openpower/package/habanero-xml/habanero-xml.mk
index a862044..b85a952 100644
--- a/openpower/package/habanero-xml/habanero-xml.mk
+++ b/openpower/package/habanero-xml/habanero-xml.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-HABANERO_XML_VERSION ?= a71550e65d7377d2aa5d50c21369c80409ee4edd
+HABANERO_XML_VERSION ?= 5a2a5413a6e2cd55f2e30342e898980a3d3a15d7
 HABANERO_XML_SITE ?= $(call github,open-power,habanero-xml,$(HABANERO_XML_VERSION))
 
 HABANERO_XML_LICENSE = Apache-2.0
diff --git a/openpower/package/hostboot-binaries/hostboot_binaries.mk b/openpower/package/hostboot-binaries/hostboot_binaries.mk
index bf8934b..766202a 100644
--- a/openpower/package/hostboot-binaries/hostboot_binaries.mk
+++ b/openpower/package/hostboot-binaries/hostboot_binaries.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-HOSTBOOT_BINARIES_VERSION ?= 43d5a59c0ed2dae44bceb6ebeb2a0d453ee91565
+HOSTBOOT_BINARIES_VERSION ?= 7f593a3545f47310132f67e0ba8f4d0c6350c9e7
 HOSTBOOT_BINARIES_SITE ?= $(call github,open-power,hostboot-binaries,$(HOSTBOOT_BINARIES_VERSION))
 HOSTBOOT_BINARIES_LICENSE = Apache-2.0
 
diff --git a/openpower/package/hostboot/hostboot.mk b/openpower/package/hostboot/hostboot.mk
index 25be4b6..1d099e4 100644
--- a/openpower/package/hostboot/hostboot.mk
+++ b/openpower/package/hostboot/hostboot.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-HOSTBOOT_VERSION ?= bc98d0b885dcfef970a2135c18ce7d55ab68b366
+HOSTBOOT_VERSION ?= c2236377ece011d405610d6cbc0796f6a948c0eb
 HOSTBOOT_SITE ?= $(call github,open-power,hostboot,$(HOSTBOOT_VERSION))
 
 HOSTBOOT_LICENSE = Apache-2.0
diff --git a/openpower/package/libflash/Config.in b/openpower/package/libflash/Config.in
new file mode 100644
index 0000000..eb6f56d
--- /dev/null
+++ b/openpower/package/libflash/Config.in
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_LIBFLASH
+	bool "libflash"
+	help
+	  Build libflash shared library
diff --git a/openpower/package/libflash/libflash.mk b/openpower/package/libflash/libflash.mk
new file mode 100644
index 0000000..f39e8c8
--- /dev/null
+++ b/openpower/package/libflash/libflash.mk
@@ -0,0 +1,36 @@
+################################################################################
+#
+# libflash - builds libflash libraries from skiboot source
+#
+################################################################################
+
+LIBFLASH_VERSION = b2649b822ab57ab06f0028d8343320ae6e11cc50
+
+LIBFLASH_SITE = $(call github,open-power,skiboot,$(LIBFLASH_VERSION))
+LIBFLASH_INSTALL_STAGING = YES
+LIBFLASH_INSTALL_TARGET = YES
+
+LIBFLASH_MAKE_OPTS += CC="$(TARGET_CC)" LD="$(TARGET_LD)" \
+		     AS="$(TARGET_AS)" AR="$(TARGET_AR)" NM="$(TARGET_NM)" \
+		     OBJCOPY="$(TARGET_OBJCOPY)" OBJDUMP="$(TARGET_OBJDUMP)" \
+		     SIZE="$(TARGET_CROSS)size"
+
+define LIBFLASH_BUILD_CMDS
+	PREFIX=$(STAGING_DIR)/usr SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
+	       $(MAKE1) $(LIBFLASH_MAKE_OPTS) CROSS_COMPILE=$(TARGET_CROSS) \
+	       -C $(@D)/external/shared
+endef
+
+define LIBFLASH_INSTALL_STAGING_CMDS
+	PREFIX=$(STAGING_DIR)/usr SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
+	       $(MAKE1) $(LIBFLASH_MAKE_OPTS) CROSS_COMPILE=$(TARGET_CROSS) \
+	       -C $(@D)/external/shared install
+endef
+
+define LIBFLASH_INSTALL_TARGET_CMDS
+	PREFIX=$(TARGET_DIR)/usr SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
+	       $(MAKE1) $(LIBFLASH_MAKE_OPTS) CROSS_COMPILE=$(TARGET_CROSS) \
+	       -C $(@D)/external/shared install-lib
+endef
+
+$(eval $(generic-package))
diff --git a/openpower/package/occ/occ.mk b/openpower/package/occ/occ.mk
index f0bf819..a09827c 100644
--- a/openpower/package/occ/occ.mk
+++ b/openpower/package/occ/occ.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-OCC_VERSION ?= 0362706b9b9eac5af36ba5b41c5d93a108ccd90d
+OCC_VERSION ?= 1093bf945e6c22650ca0b83da2347ee7d21cbe41
 OCC_SITE ?= $(call github,open-power,occ,$(OCC_VERSION))
 OCC_LICENSE = Apache-2.0
 OCC_DEPENDENCIES = host-binutils host-p8-pore-binutils
diff --git a/openpower/package/openpower-pnor/openpower-pnor.mk b/openpower/package/openpower-pnor/openpower-pnor.mk
index 1d11f14..2d7086c 100644
--- a/openpower/package/openpower-pnor/openpower-pnor.mk
+++ b/openpower/package/openpower-pnor/openpower-pnor.mk
@@ -8,7 +8,7 @@
 # make doesn't care for quotes in the dependencies.
 XML_PACKAGE=$(subst $\",,$(BR2_OPENPOWER_XML_PACKAGE))
 
-OPENPOWER_PNOR_VERSION ?= 40e407735b317d0174645b7543e0a72019709ce2
+OPENPOWER_PNOR_VERSION ?= 1e4410052a26acf4b439226860afae9507f0d94a
 OPENPOWER_PNOR_SITE ?= $(call github,open-power,pnor,$(OPENPOWER_PNOR_VERSION))
 
 OPENPOWER_PNOR_LICENSE = Apache-2.0
@@ -33,7 +33,7 @@
 OPENPOWER_VERSION_DIR = $(STAGING_DIR)/openpower_version
 
 # Subpackages we want to include in the version info (do not include openpower-pnor)
-OPENPOWER_VERSIONED_SUBPACKAGES = hostboot occ skiboot hostboot-binaries $(XML_PACKAGE) capp-ucode
+OPENPOWER_VERSIONED_SUBPACKAGES = skiboot hostboot linux petitboot $(XML_PACKAGE) occ hostboot-binaries capp-ucode
 OPENPOWER_PNOR = openpower-pnor
 
 define OPENPOWER_PNOR_INSTALL_IMAGES_CMDS
diff --git a/openpower/package/palmetto-xml/palmetto-xml.mk b/openpower/package/palmetto-xml/palmetto-xml.mk
index bcdee08..8130f4e 100644
--- a/openpower/package/palmetto-xml/palmetto-xml.mk
+++ b/openpower/package/palmetto-xml/palmetto-xml.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-PALMETTO_XML_VERSION = 8ce36f33a1b4f3467488a57bba733c16bfc161f8
+PALMETTO_XML_VERSION ?= 82818682f2c2009c30d700df6d5f8897a3096e4f
 PALMETTO_XML_SITE = $(call github,open-power,palmetto-xml,$(PALMETTO_XML_VERSION))
 
 PALMETTO_XML_LICENSE = Apache-2.0
diff --git a/openpower/package/petitboot/Config.in b/openpower/package/petitboot/Config.in
index a6021dd..08801ec 100644
--- a/openpower/package/petitboot/Config.in
+++ b/openpower/package/petitboot/Config.in
@@ -12,6 +12,8 @@
 	select BR2_PACKAGE_POWERPC_UTILS if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
 	# run-time dependency only
 	select BR2_PACKAGE_IPRUTILS if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
+	# run-time dependency only
+	select BR2_PACKAGE_NVME if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
 	help
 	  Petitboot is a small kexec-based bootloader
 
@@ -19,3 +21,12 @@
 
 comment "petitboot requires udev to be enabled"
 	depends on !BR2_PACKAGE_HAS_UDEV
+
+config BR2_PACKAGE_PETITBOOT_MTD
+	bool "petitboot-mtd"
+	depends on BR2_PACKAGE_PETITBOOT
+	select BR2_PACKAGE_LIBFLASH
+	help
+	  Adds Petitboot support for MTD devices
+
+comment "Add support for accessing MTD devices"
diff --git a/openpower/package/petitboot/petitboot.mk b/openpower/package/petitboot/petitboot.mk
index eec280d..1736435 100644
--- a/openpower/package/petitboot/petitboot.mk
+++ b/openpower/package/petitboot/petitboot.mk
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-PETITBOOT_VERSION = d171258160f7ed4756531f51e66fb116753bc990
-PETITBOOT_SITE = git://github.com/open-power/petitboot.git
+PETITBOOT_VERSION = 72928ed32ab3684be74e4a3b90329dee7cfa6bbb
+PETITBOOT_SITE ?= $(call github,open-power,petitboot,$(PETITBOOT_VERSION))
 PETITBOOT_DEPENDENCIES = ncurses udev host-bison host-flex lvm2
 PETITBOOT_LICENSE = GPLv2
 PETITBOOT_LICENSE_FILES = COPYING
@@ -23,6 +23,13 @@
 PETITBOOT_CONF_OPTS += --enable-debug
 endif
 
+ifeq ($(BR2_PACKAGE_PETITBOOT_MTD),y)
+PETITBOOT_CONF_OPTS += --enable-mtd
+PETITBOOT_DEPENDENCIES += libflash
+PETITBOOT_CPPFLAGS += -I$(STAGING_DIR)
+PETITBOOT_LDFLAGS += -L$(STAGING_DIR)
+endif
+
 ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
 PETITBOOT_CONF_OPTS += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
 endif
@@ -37,6 +44,10 @@
 		$(TARGET_DIR)/etc/petitboot/boot.d/
 	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/20-set-stdout \
 		$(TARGET_DIR)/etc/petitboot/boot.d/
+	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \
+		$(TARGET_DIR)/etc/petitboot/boot.d/
+	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/30-add-offb \
+		$(TARGET_DIR)/etc/petitboot/boot.d/
 
 	$(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/S14silence-console \
 		$(TARGET_DIR)/etc/init.d/
diff --git a/openpower/package/pkg-versions.mk b/openpower/package/pkg-versions.mk
index e2e3af0..474d455 100644
--- a/openpower/package/pkg-versions.mk
+++ b/openpower/package/pkg-versions.mk
@@ -39,6 +39,14 @@
 	fi; \
 fi
 
+# If this is for linux, also check openpower/linux
+if [ $(filter "LINUX", "$(2)") == "$(2)" ]; then \
+	if ls $$(BR2_EXTERNAL)/$(1)/*.patch 2>/dev/null; then sha512sum \
+		$$(BR2_EXTERNAL)/$(1)/*.patch | sha512sum | \
+		xargs echo >> $$(OPENPOWER_VERSION_DIR)/$(1).tmp_patch.txt; \
+	fi; \
+fi;
+
 # Combine all the patches found in the package and global package directories
 if [ -f $$(OPENPOWER_VERSION_DIR)/$(1).tmp_patch.txt ]; then \
 		cat $$(OPENPOWER_VERSION_DIR)/$(1).tmp_patch.txt | sha512sum | cut -c 1-7 | \
@@ -63,7 +71,7 @@
 # If site local
 # Add site local and user, local commit, if local is dirty
 # Else not local
-# Add package version, op-build is dirty, op-build patches
+# Add package version, extraversion if linux, op-build is dirty, op-build patches
 if [ "$$($(2)_SITE_METHOD)" == "local" ]; then \
 echo -n "site_local-" >> $$($(2)_VERSION_FILE); \
 whoami | xargs echo -n >> $$($(2)_VERSION_FILE); \
@@ -81,6 +89,14 @@
 	sed "s/^\([0-9a-f]\{7\}\).*/\1/;s/$(1)-//;" >> $$($(2)_VERSION_FILE)) \
 	|| echo -n $$($(2)_VERSION) | sed -e 's/$(1)-//' >> $$($(2)_VERSION_FILE); \
 \
+if [ $(filter "LINUX", "$(2)") == "$(2)" ]; then \
+	if ls $$(BUILD_DIR)/$(1)-$$($(2)_VERSION)/Makefile 1>/dev/null; then \
+		head $$(BUILD_DIR)/$(1)-$$($(2)_VERSION)/Makefile | grep EXTRAVERSION \
+		| cut -d ' ' -f 3 | \
+		xargs echo -n >> $$($(2)_VERSION_FILE); \
+	fi; \
+fi; \
+\
 cd "$$(BR2_EXTERNAL)"; git describe --all --dirty | \
 	if grep -e "-dirty"; then \
 	echo -n "-opdirty" >> $$($(2)_VERSION_FILE); \
@@ -166,6 +182,25 @@
 # Add new line to $$($$(UPPER_CASE_PKG)_VERSION_FILE)
 echo "" >> $$($$(UPPER_CASE_PKG)_VERSION_FILE);
 
+# Add a specific line for op-build if it has been overwritten
+if [ "$$(OPBUILD_VENDOR)" != '' ]; then \
+echo -n "	op-build-" >> $$($$(UPPER_CASE_PKG)_VERSION_FILE); \
+cd "$$(BR2_EXTERNAL)"; (git describe --tags || git log -n1 --pretty=format:'%h' || echo "unknown") \
+	| sed 's/\(.*\)-g\([0-9a-f]\{7\}\).*/\2/' | xargs echo -n \
+	>> $$($$(UPPER_CASE_PKG)_VERSION_FILE); \
+cd "$$(BR2_EXTERNAL)"; git describe --all --dirty | grep -e "-dirty" | sed 's/.*\(-dirty\)/\1/' | \
+	xargs echo >> $$($$(UPPER_CASE_PKG)_VERSION_FILE); \
+fi
+
+# Include the currently checked-out buildroot version
+echo -n "	buildroot-" >> $$($$(UPPER_CASE_PKG)_VERSION_FILE);
+cd "./buildroot"; (git describe --tags || git log -n1 --pretty=format:'%h' || echo "unknown") \
+	| sed 's/\(.*\)-g\([0-9a-f]\{7\}\).*/\2/' | xargs echo -n \
+	>> $$($$(UPPER_CASE_PKG)_VERSION_FILE); \
+git describe --all --dirty | grep -e "-dirty" | sed 's/.*\(-dirty\)/\1/' | \
+	xargs echo >> $$($$(UPPER_CASE_PKG)_VERSION_FILE);
+
+
 # Combing subpackage version files into $$($$(UPPER_CASE_PKG)_VERSION_FILE)
 $$(foreach verFile,$$(ALL_SUBPACKAGE_VERSIONS),
 	if [ -f $$(verFile) ]; then cat $$(verFile) \
diff --git a/openpower/package/skiboot/Config.in b/openpower/package/skiboot/Config.in
index e1f571d..796a513 100644
--- a/openpower/package/skiboot/Config.in
+++ b/openpower/package/skiboot/Config.in
@@ -1,3 +1,4 @@
+menu "Skiboot"
 
 config BR2_TARGET_SKIBOOT
 	bool "skiboot"
@@ -12,4 +13,28 @@
 	bool "Embed kernel payload in skiboot image"
 	depends on BR2_LINUX_KERNEL_ZIMAGE_EPAPR
 
+choice
+	prompt "Skiboot version"
+	default BR2_SKIBOOT_LATEST_VERSION
+
+config BR2_SKIBOOT_LATEST_VERSION
+	bool "Use skiboot stable"
+
+config BR2_SKIBOOT_CUSTOM_VERSION
+	bool "Custom version"
+
+endchoice
+
+config BR2_SKIBOOT_CUSTOM_VERSION_VALUE
+	string "skiboot version"
+	depends on BR2_SKIBOOT_CUSTOM_VERSION
+
+config BR2_SKIBOOT_VERSION
+	string
+	default "skiboot-5.1.15" if BR2_SKIBOOT_LATEST_VERSION
+	default BR2_SKIBOOT_CUSTOM_VERSION_VALUE \
+		if BR2_SKIBOOT_CUSTOM_VERSION
+
 endif
+
+endmenu
diff --git a/openpower/package/skiboot/skiboot-0002-libflash-Provide-an-internal-parity-implementation-t.patch b/openpower/package/skiboot/skiboot-0002-libflash-Provide-an-internal-parity-implementation-t.patch
deleted file mode 100644
index e377567..0000000
--- a/openpower/package/skiboot/skiboot-0002-libflash-Provide-an-internal-parity-implementation-t.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From de70ad43ccee4dd51e9d38325c7713f590323a47 Mon Sep 17 00:00:00 2001
-From: Jeremy Kerr <jk@ozlabs.org>
-Date: Mon, 23 Feb 2015 16:43:53 +0800
-Subject: [PATCH] libflash: Provide an internal parity implementation, to
- remove libgcc dependency
-
-In commit 8f5b8616, we introduced a dependency on libgcc, for the
-__builtin_parityl() function in commit 6cfaa3ba.
-
-However, if we're building with a biarch compiler, we may not have a
-libgcc available.
-
-This commit removes the __builtin_parityl() call, and replaces with the
-equivalent instructions, and removes the dependency on libgcc.
-
-Although this is untested, I have confirmed that the __builtin_parityl()
-functions emits the same instructions (on power7 and power8, with
-gcc-4.9) as we're using in the parity() function.
-
-Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
----
- Makefile.main  |  5 ++---
- libflash/ecc.c | 14 +++++++++++++-
- 2 files changed, 15 insertions(+), 4 deletions(-)
-
-diff --git a/Makefile.main b/Makefile.main
-index 665baf4..b5376fc 100644
---- a/Makefile.main
-+++ b/Makefile.main
-@@ -120,7 +120,6 @@ OBJS += $(LIBPORE)
- endif
- OBJS += $(LIBC) $(CCAN) $(DEVSRC_OBJ)
- OBJS_NO_VER = $(OBJS)
--EXTRA_LIBS = -Wl,-lgcc
- ALL_OBJS = $(OBJS) version.o
- 
- ALL_OBJS_1 = $(ALL_OBJS) asm/dummy_map.o
-@@ -130,12 +129,12 @@ $(TARGET).lid: $(TARGET).elf
- 	$(call Q,OBJCOPY, $(OBJCOPY) -O binary -S $^ $@, $@)
- 
- $(TARGET).tmp.elf: $(ALL_OBJS_1) $(TARGET).lds $(KERNEL)
--	$(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(ALL_OBJS_1) $(EXTRA_LIBS) -o $@, $@)
-+	$(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(ALL_OBJS_1) -o $@, $@)
- 
- asm/real_map.o : $(TARGET).tmp.map
- 
- $(TARGET).elf: $(ALL_OBJS_2) $(TARGET).lds $(KERNEL)
--	$(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(ALL_OBJS_2) $(EXTRA_LIBS) -o $@, $@)
-+	$(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(ALL_OBJS_2) -o $@, $@)
- 
- $(SUBDIRS):
- 	$(call Q,MKDIR,mkdir $@, $@)
-diff --git a/libflash/ecc.c b/libflash/ecc.c
-index 9293743..3d94594 100644
---- a/libflash/ecc.c
-+++ b/libflash/ecc.c
-@@ -88,6 +88,18 @@ static uint8_t syndromematrix[] = {
-         UE, UE, UE, UE,  4, UE, UE, UE, UE, UE, UE, UE, UE, UE, UE, UE,
- };
- 
-+static uint8_t parity(uint64_t data)
-+{
-+	uint8_t p;
-+
-+	asm volatile(
-+		"popcntb %1,%0\n"
-+		"prtyd   %1,%1\n"
-+		: "=r"(p) : "r"(data));
-+
-+	return p;
-+}
-+
- /**
-  * Create the ECC field corresponding to a 8-byte data field
-  *
-@@ -100,7 +112,7 @@ static uint8_t eccgenerate(uint64_t data)
- 	uint8_t result = 0;
- 
- 	for (i = 0; i < 8; i++)
--		result |= __builtin_parityl(eccmatrix[i] & data) << i;
-+		result |= parity(eccmatrix[i] & data) << i;
- 
- 	return result;
- }
--- 
-1.9.1
-
diff --git a/openpower/package/skiboot/skiboot.mk b/openpower/package/skiboot/skiboot.mk
index 2611f51..90b2110 100644
--- a/openpower/package/skiboot/skiboot.mk
+++ b/openpower/package/skiboot/skiboot.mk
@@ -4,7 +4,8 @@
 #
 ################################################################################
 
-SKIBOOT_VERSION = skiboot-5.1.5
+SKIBOOT_VERSION = $(call qstrip,$(BR2_SKIBOOT_VERSION))
+
 SKIBOOT_SITE = $(call github,open-power,skiboot,$(SKIBOOT_VERSION))
 SKIBOOT_INSTALL_IMAGES = YES
 SKIBOOT_INSTALL_TARGET = NO
diff --git a/openpower/scripts/fixup-target-var b/openpower/scripts/fixup-target-var
index 171b916..9c9bc5b 100755
--- a/openpower/scripts/fixup-target-var
+++ b/openpower/scripts/fixup-target-var
@@ -5,8 +5,7 @@
 find $TARGET_DIR/var/ -type l |
 while read path
 do
-    target=$(realpath $path)
-    [ -d "$target" ] || continue
-    rm $path
-    mkdir $path
+    [ -d "$path" ] || continue
+    rm -v $path
+    mkdir -v $path
 done