Release Linux 4.9.2-openpower1

This moves from the 4.4 based kernel series to the newer long term
support kernel, Linux 4.9.

To make the move we regenerate the kernel defconfig for the new kernel.

We still have three out of tree patches. This commit makes the following
changes:

  * Drops 5 of our out of tree patches
  * Two remain for XHCI kexec issues
  * One remains for VGA handover

We also update bnx2x firmware version for newer kernel driver, which
means modify the firmware whitelist.

Signed-off-by: Joel Stanley <joel@jms.id.au>
diff --git a/openpower/configs/barreleye_defconfig b/openpower/configs/barreleye_defconfig
index 72a96da..a544cec 100644
--- a/openpower/configs/barreleye_defconfig
+++ b/openpower/configs/barreleye_defconfig
@@ -17,7 +17,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.39"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.2"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/firenze_defconfig b/openpower/configs/firenze_defconfig
index 86e5290..4236edf 100644
--- a/openpower/configs/firenze_defconfig
+++ b/openpower/configs/firenze_defconfig
@@ -16,7 +16,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.39"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.2"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/firestone_defconfig b/openpower/configs/firestone_defconfig
index e01514f..9fe3a3a 100644
--- a/openpower/configs/firestone_defconfig
+++ b/openpower/configs/firestone_defconfig
@@ -17,7 +17,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.39"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.2"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/garrison_defconfig b/openpower/configs/garrison_defconfig
index c19fb19..54e605d 100644
--- a/openpower/configs/garrison_defconfig
+++ b/openpower/configs/garrison_defconfig
@@ -17,7 +17,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.39"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.2"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/habanero_defconfig b/openpower/configs/habanero_defconfig
index 1403d04..2a97f88 100644
--- a/openpower/configs/habanero_defconfig
+++ b/openpower/configs/habanero_defconfig
@@ -17,7 +17,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.39"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.2"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/linux/skiroot_defconfig b/openpower/configs/linux/skiroot_defconfig
index 8d0bd35..114eb00 100644
--- a/openpower/configs/linux/skiroot_defconfig
+++ b/openpower/configs/linux/skiroot_defconfig
@@ -1,5 +1,4 @@
 CONFIG_PPC64=y
-CONFIG_POWER8_CPU=y
 CONFIG_ALTIVEC=y
 CONFIG_VSX=y
 CONFIG_SMP=y
@@ -37,6 +36,7 @@
 # CONFIG_PPC_PSERIES is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
 CONFIG_CPU_IDLE=y
+CONFIG_GEN_RTC=y
 CONFIG_HZ_100=y
 CONFIG_KEXEC=y
 CONFIG_IRQ_ALL_CPUS=y
@@ -157,7 +157,6 @@
 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_TCG_TIS_I2C_NUVOTON=y
diff --git a/openpower/configs/openpower_mambo_defconfig b/openpower/configs/openpower_mambo_defconfig
index 99fe3c7..e13ecdd 100644
--- a/openpower/configs/openpower_mambo_defconfig
+++ b/openpower/configs/openpower_mambo_defconfig
@@ -15,7 +15,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.39"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.2"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/openpower_p9_mambo_defconfig b/openpower/configs/openpower_p9_mambo_defconfig
index a76fb12..6096976 100644
--- a/openpower/configs/openpower_p9_mambo_defconfig
+++ b/openpower/configs/openpower_p9_mambo_defconfig
@@ -15,7 +15,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.2"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
 BR2_LINUX_KERNEL_ZIMAGE_EPAPR=y
diff --git a/openpower/configs/palmetto_defconfig b/openpower/configs/palmetto_defconfig
index c02eab9..d819ac5 100644
--- a/openpower/configs/palmetto_defconfig
+++ b/openpower/configs/palmetto_defconfig
@@ -16,7 +16,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.39"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.2"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/witherspoon_defconfig b/openpower/configs/witherspoon_defconfig
index c2654c7..b10ab3c 100644
--- a/openpower/configs/witherspoon_defconfig
+++ b/openpower/configs/witherspoon_defconfig
@@ -17,7 +17,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.2"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
 BR2_LINUX_KERNEL_ZIMAGE_EPAPR=y
diff --git a/openpower/linux/0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch b/openpower/linux/0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
index 3f528e9..ce24199 100644
--- a/openpower/linux/0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
+++ b/openpower/linux/0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
@@ -1,7 +1,7 @@
 From 0000000000000000000000000000000000000000 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 01/13] xhci: Use xhci_pci_remove for xhci device shutdown
+Subject: [PATCH 1/4] 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 cf147ccac7d3..af1f7f01bc7a 100644
+index e96ae80d107e..bbec9f434df4 100644
 --- a/drivers/usb/host/xhci-pci.c
 +++ b/drivers/usb/host/xhci-pci.c
-@@ -449,7 +449,7 @@ static struct pci_driver xhci_pci_driver = {
+@@ -470,7 +470,7 @@ static struct pci_driver xhci_pci_driver = {
  	.remove =	xhci_pci_remove,
  	/* suspend and resume implemented later */
  
diff --git a/openpower/linux/0002-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch b/openpower/linux/0002-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch
index 1284572..c1a82ba 100644
--- a/openpower/linux/0002-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch
+++ b/openpower/linux/0002-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch
@@ -1,7 +1,7 @@
 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Jeremy Kerr <jk@ozlabs.org>
 Date: Wed, 2 Mar 2016 11:25:47 +0800
-Subject: [PATCH 02/13] drivers/drm/ast: Switch SCU to VGA output on POST
+Subject: [PATCH 2/4] 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
diff --git a/openpower/linux/0003-net-mlx4_core-Set-UAR-page-size-to-4KB-regardless-of.patch b/openpower/linux/0003-net-mlx4_core-Set-UAR-page-size-to-4KB-regardless-of.patch
deleted file mode 100644
index 083bf93..0000000
--- a/openpower/linux/0003-net-mlx4_core-Set-UAR-page-size-to-4KB-regardless-of.patch
+++ /dev/null
@@ -1,299 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Huy Nguyen <huyn@mellanox.com>
-Date: Wed, 17 Feb 2016 17:24:26 +0200
-Subject: [PATCH 03/13] 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 f350f2d61c15..d1a9858566eb 100644
---- a/drivers/infiniband/hw/mlx4/qp.c
-+++ b/drivers/infiniband/hw/mlx4/qp.c
-@@ -1593,9 +1593,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 e4019a803a9c..0debb611da8b 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.11.0
-
diff --git a/openpower/linux/0004-xhci-do-not-halt-the-secondary-HCD.patch b/openpower/linux/0003-xhci-do-not-halt-the-secondary-HCD.patch
similarity index 87%
rename from openpower/linux/0004-xhci-do-not-halt-the-secondary-HCD.patch
rename to openpower/linux/0003-xhci-do-not-halt-the-secondary-HCD.patch
index 38a24b7..6adfeb9 100644
--- a/openpower/linux/0004-xhci-do-not-halt-the-secondary-HCD.patch
+++ b/openpower/linux/0003-xhci-do-not-halt-the-secondary-HCD.patch
@@ -1,7 +1,7 @@
 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Joel Stanley <joel@jms.id.au>
 Date: Tue, 19 Jul 2016 22:43:26 +0930
-Subject: [PATCH 04/13] xhci: do not halt the secondary HCD
+Subject: [PATCH 3/4] 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, 15 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
-index adc169d2fd76..ec92a843325b 100644
+index 1a4ca02729c2..6f80130db955 100644
 --- a/drivers/usb/host/xhci.c
 +++ b/drivers/usb/host/xhci.c
-@@ -682,6 +682,21 @@ void xhci_stop(struct usb_hcd *hcd)
+@@ -683,6 +683,21 @@ void xhci_stop(struct usb_hcd *hcd)
  
  	mutex_lock(&xhci->mutex);
  
@@ -39,7 +39,7 @@
  	if (!(xhci->xhc_state & XHCI_STATE_HALTED)) {
  		spin_lock_irq(&xhci->lock);
  
-@@ -693,11 +708,6 @@ void xhci_stop(struct usb_hcd *hcd)
+@@ -694,11 +709,6 @@ void xhci_stop(struct usb_hcd *hcd)
  		spin_unlock_irq(&xhci->lock);
  	}
  
diff --git a/openpower/linux/0004-Release-4.9.2-openpower1.patch b/openpower/linux/0004-Release-4.9.2-openpower1.patch
new file mode 100644
index 0000000..b116bab
--- /dev/null
+++ b/openpower/linux/0004-Release-4.9.2-openpower1.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Joel Stanley <joel@jms.id.au>
+Date: Tue, 16 Aug 2016 23:00:23 +0930
+Subject: [PATCH 4/4] Release 4.9.2-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 c9ce897465c5..b3a37105d984 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+ VERSION = 4
+ PATCHLEVEL = 9
+ SUBLEVEL = 2
+-EXTRAVERSION =
++EXTRAVERSION = -openpower1
+ NAME = Roaring Lionus
+ 
+ # *DOCUMENTATION*
+-- 
+2.11.0
+
diff --git a/openpower/linux/0005-net-mlx5-Add-pci-shutdown-callback.patch b/openpower/linux/0005-net-mlx5-Add-pci-shutdown-callback.patch
deleted file mode 100644
index ef75ac4..0000000
--- a/openpower/linux/0005-net-mlx5-Add-pci-shutdown-callback.patch
+++ /dev/null
@@ -1,161 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Carol L Soto <clsoto@linux.vnet.ibm.com>
-Date: Tue, 12 Jul 2016 17:04:07 -0500
-Subject: [PATCH 05/13] net/mlx5: Add pci shutdown callback
-
-Backport of commit 5fc7197d3a256 ("net/mlx5: Add pci shutdown callback")
-so we can use for the OpenPower kernel.
-
-This patch introduces kexec support for mlx5.
-When switching kernels, kexec() calls shutdown, which unloads
-the driver and cleans its resources.
-
-In addition, remove unregister netdev from shutdown flow. This will
-allow a clean shutdown, even if some netdev clients did not release their
-reference from this netdev. Releasing The HW resources only is enough as
-the kernel is shutting down
-
-Signed-off-by: Majd Dibbiny <majd@mellanox.com>
-Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
-Signed-off-by: Haggai Abramovsky <hagaya@mellanox.com>
-Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com>
-(cherry picked from commit 5fc7197d3a256d9c5de3134870304b24892a4908)
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 15 +++++++++++++--
- drivers/net/ethernet/mellanox/mlx5/core/main.c    | 23 +++++++++++++++++++----
- include/linux/mlx5/driver.h                       |  7 ++++---
- 3 files changed, 36 insertions(+), 9 deletions(-)
-
-diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
-index 90e876ecc720..984668ec8a0b 100644
---- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
-+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
-@@ -2241,7 +2241,16 @@ static void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, void *vpriv)
- 	schedule_work(&priv->set_rx_mode_work);
- 	mlx5e_disable_async_events(priv);
- 	flush_scheduled_work();
--	unregister_netdev(netdev);
-+	if (test_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &mdev->intf_state)) {
-+		netif_device_detach(netdev);
-+		mutex_lock(&priv->state_lock);
-+		if (test_bit(MLX5E_STATE_OPENED, &priv->state))
-+			mlx5e_close_locked(netdev);
-+		mutex_unlock(&priv->state_lock);
-+	} else {
-+		unregister_netdev(netdev);
-+	}
-+
- 	mlx5e_destroy_flow_tables(priv);
- 	mlx5e_destroy_tirs(priv);
- 	mlx5e_destroy_rqt(priv, MLX5E_SINGLE_RQ_RQT);
-@@ -2252,7 +2261,9 @@ static void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, void *vpriv)
- 	mlx5_dealloc_transport_domain(priv->mdev, priv->tdn);
- 	mlx5_core_dealloc_pd(priv->mdev, priv->pdn);
- 	mlx5_unmap_free_uar(priv->mdev, &priv->cq_uar);
--	free_netdev(netdev);
-+
-+	if (!test_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &mdev->intf_state))
-+		free_netdev(netdev);
- }
- 
- static void *mlx5e_get_netdev(void *vpriv)
-diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
-index 6cf6d93d8831..8a371bdb823e 100644
---- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
-+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
-@@ -914,7 +914,7 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
- 	int err;
- 
- 	mutex_lock(&dev->intf_state_mutex);
--	if (dev->interface_state == MLX5_INTERFACE_STATE_UP) {
-+	if (test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) {
- 		dev_warn(&dev->pdev->dev, "%s: interface is up, NOP\n",
- 			 __func__);
- 		goto out;
-@@ -1063,7 +1063,8 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
- 	if (err)
- 		pr_info("failed request module on %s\n", MLX5_IB_MOD);
- 
--	dev->interface_state = MLX5_INTERFACE_STATE_UP;
-+	clear_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state);
-+	set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
- out:
- 	mutex_unlock(&dev->intf_state_mutex);
- 
-@@ -1125,7 +1126,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
- 	int err = 0;
- 
- 	mutex_lock(&dev->intf_state_mutex);
--	if (dev->interface_state == MLX5_INTERFACE_STATE_DOWN) {
-+	if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) {
- 		dev_warn(&dev->pdev->dev, "%s: interface is down, NOP\n",
- 			 __func__);
- 		goto out;
-@@ -1155,7 +1156,8 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
- 	mlx5_cmd_cleanup(dev);
- 
- out:
--	dev->interface_state = MLX5_INTERFACE_STATE_DOWN;
-+	clear_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
-+	set_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state);
- 	mutex_unlock(&dev->intf_state_mutex);
- 	return err;
- }
-@@ -1365,6 +1367,18 @@ static const struct pci_error_handlers mlx5_err_handler = {
- 	.resume		= mlx5_pci_resume
- };
- 
-+static void shutdown(struct pci_dev *pdev)
-+{
-+	struct mlx5_core_dev *dev  = pci_get_drvdata(pdev);
-+	struct mlx5_priv *priv = &dev->priv;
-+
-+	dev_info(&pdev->dev, "Shutdown was called\n");
-+	/* Notify mlx5 clients that the kernel is being shut down */
-+	set_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &dev->intf_state);
-+	mlx5_unload_one(dev, priv);
-+	mlx5_pci_disable_device(dev);
-+}
-+
- static const struct pci_device_id mlx5_core_pci_table[] = {
- 	{ PCI_VDEVICE(MELLANOX, 0x1011) }, /* Connect-IB */
- 	{ PCI_VDEVICE(MELLANOX, 0x1012) }, /* Connect-IB VF */
-@@ -1382,6 +1396,7 @@ static struct pci_driver mlx5_core_driver = {
- 	.id_table       = mlx5_core_pci_table,
- 	.probe          = init_one,
- 	.remove         = remove_one,
-+	.shutdown       = shutdown,
- 	.err_handler	= &mlx5_err_handler
- };
- 
-diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
-index 412aa988c6ad..dc26d9942120 100644
---- a/include/linux/mlx5/driver.h
-+++ b/include/linux/mlx5/driver.h
-@@ -493,8 +493,9 @@ enum mlx5_device_state {
- };
- 
- enum mlx5_interface_state {
--	MLX5_INTERFACE_STATE_DOWN,
--	MLX5_INTERFACE_STATE_UP,
-+	MLX5_INTERFACE_STATE_DOWN = BIT(0),
-+	MLX5_INTERFACE_STATE_UP = BIT(1),
-+	MLX5_INTERFACE_STATE_SHUTDOWN = BIT(2),
- };
- 
- enum mlx5_pci_status {
-@@ -518,7 +519,7 @@ struct mlx5_core_dev {
- 	enum mlx5_device_state	state;
- 	/* sync interface state */
- 	struct mutex		intf_state_mutex;
--	enum mlx5_interface_state interface_state;
-+	unsigned long		intf_state;
- 	void			(*event) (struct mlx5_core_dev *dev,
- 					  enum mlx5_dev_event event,
- 					  unsigned long param);
--- 
-2.11.0
-
diff --git a/openpower/linux/0006-powerpc-boot-Add-OPAL-console-to-epapr-wrappers.patch b/openpower/linux/0006-powerpc-boot-Add-OPAL-console-to-epapr-wrappers.patch
deleted file mode 100644
index e1a6f5d..0000000
--- a/openpower/linux/0006-powerpc-boot-Add-OPAL-console-to-epapr-wrappers.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Oliver O'Halloran <oohall@gmail.com>
-Date: Fri, 24 Jun 2016 17:28:43 +1000
-Subject: [PATCH 06/13] powerpc/boot: Add OPAL console to epapr wrappers
-
-This patch adds an OPAL console backend to the powerpc boot wrapper so
-that decompression failures inside the wrapper can be reported to the
-user. This is important since it typically indicates data corruption in
-the firmware and other nasty things.
-
-Currently this only works when building a little endian kernel. When
-compiling a 64 bit BE kernel the wrapper is always build 32 bit to be
-compatible with some 32 bit firmwares. BE support will be added at a
-later date. Another limitation of this is that only the "raw" type of
-OPAL console is supported, however machines that provide a hvsi console
-also provide a raw console so this is not an issue in practice.
-
-Actually-written-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
-Cc: Stewart Smith <stewart@linux.vnet.ibm.com>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- arch/powerpc/boot/Makefile     |  4 +-
- arch/powerpc/boot/opal-calls.S | 58 +++++++++++++++++++++++++
- arch/powerpc/boot/opal.c       | 97 ++++++++++++++++++++++++++++++++++++++++++
- arch/powerpc/boot/ops.h        |  1 +
- arch/powerpc/boot/ppc_asm.h    |  4 ++
- arch/powerpc/boot/serial.c     |  2 +
- arch/powerpc/boot/types.h      | 10 +++++
- 7 files changed, 174 insertions(+), 2 deletions(-)
- create mode 100644 arch/powerpc/boot/opal-calls.S
- create mode 100644 arch/powerpc/boot/opal.c
-
-diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
-index 99e4487248ff..321a603f6ae3 100644
---- a/arch/powerpc/boot/Makefile
-+++ b/arch/powerpc/boot/Makefile
-@@ -70,7 +70,7 @@ $(addprefix $(obj)/,$(zlib) cuboot-c2k.o gunzip_util.o main.o): \
- libfdt       := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
- libfdtheader := fdt.h libfdt.h libfdt_internal.h
- 
--$(addprefix $(obj)/,$(libfdt) libfdt-wrapper.o simpleboot.o epapr.o): \
-+$(addprefix $(obj)/,$(libfdt) libfdt-wrapper.o simpleboot.o epapr.o opal.o): \
- 	$(addprefix $(obj)/,$(libfdtheader))
- 
- src-wlib-y := string.S crt0.S crtsavres.S stdio.c main.c \
-@@ -78,7 +78,7 @@ src-wlib-y := string.S crt0.S crtsavres.S stdio.c main.c \
- 		ns16550.c serial.c simple_alloc.c div64.S util.S \
- 		gunzip_util.c elf_util.c $(zlib) devtree.c stdlib.c \
- 		oflib.c ofconsole.c cuboot.c mpsc.c cpm-serial.c \
--		uartlite.c mpc52xx-psc.c
-+		uartlite.c mpc52xx-psc.c opal.c opal-calls.S
- src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c
- src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
- src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c fsl-soc.c
-diff --git a/arch/powerpc/boot/opal-calls.S b/arch/powerpc/boot/opal-calls.S
-new file mode 100644
-index 000000000000..ff2f1b97bc53
---- /dev/null
-+++ b/arch/powerpc/boot/opal-calls.S
-@@ -0,0 +1,58 @@
-+/*
-+ * Copyright (c) 2016 IBM Corporation.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version
-+ * 2 of the License, or (at your option) any later version.
-+ */
-+
-+#include "ppc_asm.h"
-+#include "../include/asm/opal-api.h"
-+
-+	.text
-+
-+#define OPAL_CALL(name, token)				\
-+	.globl name;					\
-+name:							\
-+	li	r0, token;				\
-+	b	opal_call;
-+
-+opal_call:
-+	mflr	r11
-+	std	r11,16(r1)
-+	mfcr	r12
-+	stw	r12,8(r1)
-+	mr	r13,r2
-+
-+	/* Set opal return address */
-+	ld	r11,opal_return@got(r2)
-+	mtlr	r11
-+	mfmsr	r12
-+
-+	/* switch to BE when we enter OPAL */
-+	li	r11,MSR_LE
-+	andc	r12,r12,r11
-+	mtspr	SPRN_HSRR1,r12
-+
-+	/* load the opal call entry point and base */
-+	ld	r11,opal@got(r2)
-+	ld	r12,8(r11)
-+	ld	r2,0(r11)
-+	mtspr	SPRN_HSRR0,r12
-+	hrfid
-+
-+opal_return:
-+	FIXUP_ENDIAN
-+	mr	r2,r13;
-+	lwz	r11,8(r1);
-+	ld	r12,16(r1)
-+	mtcr	r11;
-+	mtlr	r12
-+	blr
-+
-+OPAL_CALL(opal_console_write,			OPAL_CONSOLE_WRITE);
-+OPAL_CALL(opal_console_read,			OPAL_CONSOLE_READ);
-+OPAL_CALL(opal_console_write_buffer_space,	OPAL_CONSOLE_WRITE_BUFFER_SPACE);
-+OPAL_CALL(opal_poll_events,			OPAL_POLL_EVENTS);
-+OPAL_CALL(opal_console_flush,			OPAL_CONSOLE_FLUSH);
-diff --git a/arch/powerpc/boot/opal.c b/arch/powerpc/boot/opal.c
-new file mode 100644
-index 000000000000..3a2ce1e1f048
---- /dev/null
-+++ b/arch/powerpc/boot/opal.c
-@@ -0,0 +1,97 @@
-+/*
-+ * Copyright (c) 2016 IBM Corporation.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version
-+ * 2 of the License, or (at your option) any later version.
-+ */
-+
-+#include "ops.h"
-+#include "stdio.h"
-+#include "io.h"
-+#include <libfdt.h>
-+#include "../include/asm/opal-api.h"
-+
-+/* Global OPAL struct used by opal-call.S */
-+struct opal {
-+	u64 base;
-+	u64 entry;
-+} opal;
-+
-+static u32 opal_con_id;
-+
-+int64_t opal_console_write(int64_t term_number, u64 *length, const u8 *buffer);
-+int64_t opal_console_read(int64_t term_number, uint64_t *length, u8 *buffer);
-+int64_t opal_console_write_buffer_space(uint64_t term_number, uint64_t *length);
-+int64_t opal_console_flush(uint64_t term_number);
-+int64_t opal_poll_events(uint64_t *outstanding_event_mask);
-+
-+static int opal_con_open(void)
-+{
-+	return 0;
-+}
-+
-+static void opal_con_putc(unsigned char c)
-+{
-+	int64_t rc;
-+	uint64_t olen, len;
-+
-+	do {
-+		rc = opal_console_write_buffer_space(opal_con_id, &olen);
-+		len = be64_to_cpu(olen);
-+		if (rc)
-+			return;
-+		opal_poll_events(NULL);
-+	} while (len < 1);
-+
-+
-+	olen = cpu_to_be64(1);
-+	opal_console_write(opal_con_id, &olen, &c);
-+}
-+
-+static void opal_con_close(void)
-+{
-+	opal_console_flush(opal_con_id);
-+}
-+
-+static void opal_init(void)
-+{
-+	void *opal_node;
-+
-+	opal_node = finddevice("/ibm,opal");
-+	if (!opal_node)
-+		return;
-+	if (getprop(opal_node, "opal-base-address", &opal.base, sizeof(u64)) < 0)
-+		return;
-+	opal.base = be64_to_cpu(opal.base);
-+	if (getprop(opal_node, "opal-entry-address", &opal.entry, sizeof(u64)) < 0)
-+		return;
-+	opal.entry = be64_to_cpu(opal.entry);
-+}
-+
-+#ifdef __powerpc64__
-+int opal_console_init(void *devp, struct serial_console_data *scdp)
-+{
-+	opal_init();
-+
-+	if (devp) {
-+		int n = getprop(devp, "reg", &opal_con_id, sizeof(u32));
-+		if (n != sizeof(u32))
-+			return -1;
-+		opal_con_id = be32_to_cpu(opal_con_id);
-+	} else
-+		opal_con_id = 0;
-+
-+	scdp->open = opal_con_open;
-+	scdp->putc = opal_con_putc;
-+	scdp->close = opal_con_close;
-+
-+	return 0;
-+}
-+#else
-+int opal_console_init(void *devp, struct serial_console_data *scdp)
-+{
-+	return -1;
-+}
-+#endif
-diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
-index 5e75e1c5518e..e19b64ef977a 100644
---- a/arch/powerpc/boot/ops.h
-+++ b/arch/powerpc/boot/ops.h
-@@ -89,6 +89,7 @@ int mpsc_console_init(void *devp, struct serial_console_data *scdp);
- int cpm_console_init(void *devp, struct serial_console_data *scdp);
- int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp);
- int uartlite_console_init(void *devp, struct serial_console_data *scdp);
-+int opal_console_init(void *devp, struct serial_console_data *scdp);
- void *simple_alloc_init(char *base, unsigned long heap_size,
- 			unsigned long granularity, unsigned long max_allocs);
- extern void flush_cache(void *, unsigned long);
-diff --git a/arch/powerpc/boot/ppc_asm.h b/arch/powerpc/boot/ppc_asm.h
-index 35ea60c1f070..b03373d8b386 100644
---- a/arch/powerpc/boot/ppc_asm.h
-+++ b/arch/powerpc/boot/ppc_asm.h
-@@ -61,6 +61,10 @@
- 
- #define SPRN_TBRL	268
- #define SPRN_TBRU	269
-+#define SPRN_HSRR0	0x13A	/* Hypervisor Save/Restore 0 */
-+#define SPRN_HSRR1	0x13B	/* Hypervisor Save/Restore 1 */
-+
-+#define MSR_LE		0x0000000000000001
- 
- #define FIXUP_ENDIAN						   \
- 	tdi   0, 0, 0x48; /* Reverse endian of b . + 8		*/ \
-diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
-index 167ee9433de6..e04c1e4063ae 100644
---- a/arch/powerpc/boot/serial.c
-+++ b/arch/powerpc/boot/serial.c
-@@ -132,6 +132,8 @@ int serial_console_init(void)
- 	else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
- 		 dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
- 		rc = uartlite_console_init(devp, &serial_cd);
-+	else if (dt_is_compatible(devp, "ibm,opal-console-raw"))
-+		rc = opal_console_init(devp, &serial_cd);
- 
- 	/* Add other serial console driver calls here */
- 
-diff --git a/arch/powerpc/boot/types.h b/arch/powerpc/boot/types.h
-index 31393d17a9c1..85565a89bcc2 100644
---- a/arch/powerpc/boot/types.h
-+++ b/arch/powerpc/boot/types.h
-@@ -12,6 +12,16 @@ typedef short			s16;
- typedef int			s32;
- typedef long long		s64;
- 
-+/* required for opal-api.h */
-+typedef u8  uint8_t;
-+typedef u16 uint16_t;
-+typedef u32 uint32_t;
-+typedef u64 uint64_t;
-+typedef s8  int8_t;
-+typedef s16 int16_t;
-+typedef s32 int32_t;
-+typedef s64 int64_t;
-+
- #define min(x,y) ({ \
- 	typeof(x) _x = (x);	\
- 	typeof(y) _y = (y);	\
--- 
-2.11.0
-
diff --git a/openpower/linux/0007-tty-hvc-Use-opal-irqchip-interface-if-available.patch b/openpower/linux/0007-tty-hvc-Use-opal-irqchip-interface-if-available.patch
deleted file mode 100644
index 0ddb72f..0000000
--- a/openpower/linux/0007-tty-hvc-Use-opal-irqchip-interface-if-available.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-Date: Wed, 13 Jul 2016 11:15:42 +1000
-Subject: [PATCH 07/13] tty/hvc: Use opal irqchip interface if available
-
-Update the hvc driver to use the OPAL irqchip if made available by the
-running firmware. If it is not present, the driver falls back to the
-existing OPAL event number.
-
-Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-Cc: <stable@vger.kernel.org> # 4.1.x-
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/tty/hvc/hvc_opal.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
-index 47b54c6aefd2..276b796b24e4 100644
---- a/drivers/tty/hvc/hvc_opal.c
-+++ b/drivers/tty/hvc/hvc_opal.c
-@@ -214,7 +214,13 @@ static int hvc_opal_probe(struct platform_device *dev)
- 		dev->dev.of_node->full_name,
- 		boot ? " (boot console)" : "");
- 
--	irq = opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT));
-+	irq = irq_of_parse_and_map(dev->dev.of_node, 0);
-+	if (!irq) {
-+		pr_info("hvc%d: No interrupts property, using OPAL event\n",
-+				termno);
-+		irq = opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT));
-+	}
-+
- 	if (!irq) {
- 		pr_err("hvc_opal: Unable to map interrupt for device %s\n",
- 			dev->dev.of_node->full_name);
--- 
-2.11.0
-
diff --git a/openpower/linux/0008-tty-hvc-Use-IRQF_SHARED-for-OPAL-hvc-consoles.patch b/openpower/linux/0008-tty-hvc-Use-IRQF_SHARED-for-OPAL-hvc-consoles.patch
deleted file mode 100644
index d84418e..0000000
--- a/openpower/linux/0008-tty-hvc-Use-IRQF_SHARED-for-OPAL-hvc-consoles.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-Date: Wed, 13 Jul 2016 11:15:41 +1000
-Subject: [PATCH 08/13] tty/hvc: Use IRQF_SHARED for OPAL hvc consoles
-
-Commit 2def86a7200c
-("hvc: Convert to using interrupts instead of opal events")
-enabled the use of interrupts in the hvc_driver for OPAL platforms.
-However on machines with more than one hvc console, any console after
-the first will fail to register an interrupt handler in
-notifier_add_irq() since all consoles share the same IRQ number but do
-not set the IRQF_SHARED flag:
-
-[   51.179907] genirq: Flags mismatch irq 31. 00000000 (hvc_console) vs.
-00000000 (hvc_console)
-[   51.180010] hvc_open: request_irq failed with rc -16.
-
-This error propagates up to hvc_open() and the console is closed, but
-OPAL will still generate interrupts that are not handled, leading to
-rcu_sched stall warnings.
-
-Set IRQF_SHARED when calling request_irq, allowing additional consoles
-to start properly. This is only set for consoles handled by
-hvc_opal_probe(), leaving other types unaffected.
-
-Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-Cc: <stable@vger.kernel.org> # 4.1.x-
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/tty/hvc/hvc_console.h | 1 +
- drivers/tty/hvc/hvc_irq.c     | 7 +++++--
- drivers/tty/hvc/hvc_opal.c    | 3 +++
- 3 files changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/tty/hvc/hvc_console.h b/drivers/tty/hvc/hvc_console.h
-index 913101980827..798c48d0d32c 100644
---- a/drivers/tty/hvc/hvc_console.h
-+++ b/drivers/tty/hvc/hvc_console.h
-@@ -60,6 +60,7 @@ struct hvc_struct {
- 	struct winsize ws;
- 	struct work_struct tty_resize;
- 	struct list_head next;
-+	unsigned long flags;
- };
- 
- /* implemented by a low level driver */
-diff --git a/drivers/tty/hvc/hvc_irq.c b/drivers/tty/hvc/hvc_irq.c
-index c9adb0559f61..57d9df7ee1c9 100644
---- a/drivers/tty/hvc/hvc_irq.c
-+++ b/drivers/tty/hvc/hvc_irq.c
-@@ -14,6 +14,9 @@ static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance)
- 	/* if hvc_poll request a repoll, then kick the hvcd thread */
- 	if (hvc_poll(dev_instance))
- 		hvc_kick();
-+	/* We're safe to always return IRQ_HANDLED as the hvcd thread will
-+	 * iterate through each hvc_struct
-+	 */
- 	return IRQ_HANDLED;
- }
- 
-@@ -28,8 +31,8 @@ int notifier_add_irq(struct hvc_struct *hp, int irq)
- 		hp->irq_requested = 0;
- 		return 0;
- 	}
--	rc = request_irq(irq, hvc_handle_interrupt, 0,
--			   "hvc_console", hp);
-+	rc = request_irq(irq, hvc_handle_interrupt, hp->flags,
-+			"hvc_console", hp);
- 	if (!rc)
- 		hp->irq_requested = 1;
- 	return rc;
-diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
-index 276b796b24e4..510799311099 100644
---- a/drivers/tty/hvc/hvc_opal.c
-+++ b/drivers/tty/hvc/hvc_opal.c
-@@ -230,6 +230,9 @@ static int hvc_opal_probe(struct platform_device *dev)
- 	hp = hvc_alloc(termno, irq, ops, MAX_VIO_PUT_CHARS);
- 	if (IS_ERR(hp))
- 		return PTR_ERR(hp);
-+
-+	/* hvc consoles on powernv may need to share a single irq */
-+	hp->flags = IRQF_SHARED;
- 	dev_set_drvdata(&dev->dev, hp);
- 
- 	return 0;
--- 
-2.11.0
-
diff --git a/openpower/linux/0009-usb-xhci-allow-xhci_check_bandwith-in-XHCI_STATE_REM.patch b/openpower/linux/0009-usb-xhci-allow-xhci_check_bandwith-in-XHCI_STATE_REM.patch
deleted file mode 100644
index e4a5ff1..0000000
--- a/openpower/linux/0009-usb-xhci-allow-xhci_check_bandwith-in-XHCI_STATE_REM.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Jeremy Kerr <jk@ozlabs.org>
-Date: Thu, 1 Dec 2016 18:15:59 +0800
-Subject: [PATCH 09/13] usb/xhci: allow xhci_check_bandwith in
- XHCI_STATE_REMOVING
-
-Change 98d74f9ce (and backported as 0eb1e16bf9) introduced
-XHCI_STATE_REMOVING, where PCI XHCI HCDs are flagged as removing dring
-pci->remove. This included a check in xhci_check_bandwith to supress any
-configuration changes while the hcd is in this state.
-
-However, it looks like some controllers hang during halt if we haven't
-set configration 0 (via usb_hcd_alloc_bandwidth()).
-
-This change allows the configuration 0 update while removing.
-
-[This may be specific to our XHCI hacks for kexec...]
-
-From Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>:
-
- > What concerned me about 0004-xhci-do-not-halt-the-secondary-HCD.patch
- > was that I'd still see eventual halt failures , though they seemed to
- > occur on the shutdown hook, instead of the distro probe path. But since
- > the probe goes ok, the bind continues and the device doesn't disappear.
- > With JK's patch applied, I ran a bind-unbind stress test and couldn't
- > reproduce the halt failure anymore. further probe and enumeration seems
- > to work ok.
- >
- > I don't understand why the change fixes the hang but as JK said, it may
- > be a particularity of this TI device not handling halts correctly . I
- > don't think it will be accepted upstream as is, though, so we might want
- > to make it a hardware quirk for this specific device if we confirm the
- > TI device requires it for proper halting.
- >
- > Other than that, i think it's safe to make the change, and I don't think
- > xhci spec forbids reconfiguration prior to halt.
- >
- > In short, this seems to work but I don't fully understand why. It
- > doesn't seem harmful and if it fixes the issue, we can make it a quirk.
-
-Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/usb/host/xhci.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
-index ec92a843325b..db557113cf3d 100644
---- a/drivers/usb/host/xhci.c
-+++ b/drivers/usb/host/xhci.c
-@@ -2770,8 +2770,7 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
- 	if (ret <= 0)
- 		return ret;
- 	xhci = hcd_to_xhci(hcd);
--	if ((xhci->xhc_state & XHCI_STATE_DYING) ||
--		(xhci->xhc_state & XHCI_STATE_REMOVING))
-+	if (xhci->xhc_state & XHCI_STATE_DYING)
- 		return -ENODEV;
- 
- 	xhci_dbg(xhci, "%s called for udev %p\n", __func__, udev);
--- 
-2.11.0
-
diff --git a/openpower/linux/0010-powerpc-boot-Request-no-dynamic-linker-for-boot-wrap.patch b/openpower/linux/0010-powerpc-boot-Request-no-dynamic-linker-for-boot-wrap.patch
deleted file mode 100644
index 1773d17..0000000
--- a/openpower/linux/0010-powerpc-boot-Request-no-dynamic-linker-for-boot-wrap.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Nicholas Piggin <npiggin@gmail.com>
-Date: Mon, 28 Nov 2016 12:42:26 +1100
-Subject: [PATCH 10/13] powerpc/boot: Request no dynamic linker for boot
- wrapper
-
-The boot wrapper performs its own relocations and does not require
-PT_INTERP segment. However currently we don't tell the linker that.
-
-Prior to binutils 2.28 that works OK. But since binutils commit
-1a9ccd70f9a7 ("Fix the linker so that it will not silently generate ELF
-binaries with invalid program headers. Fix readelf to report such
-invalid binaries.") binutils tries to create a program header segment
-due to PT_INTERP, and the link fails because there is no space for it:
-
-  ld: arch/powerpc/boot/zImage.pseries: Not enough room for program headers, try linking with -N
-  ld: final link failed: Bad value
-
-So tell the linker not to do that, by passing --no-dynamic-linker.
-
-Cc: stable@vger.kernel.org
-Reported-by: Anton Blanchard <anton@samba.org>
-Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
-[mpe: Drop dependency on ld-version.sh and massage change log]
-Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-(cherry picked from commit ff45000fcb56b5b0f1a14a865d3541746d838a0a)
-Signed-off-by: Joel Stanley <joel@jms.id.au>
-
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- arch/powerpc/boot/wrapper | 25 ++++++++++++++++++++++++-
- 1 file changed, 24 insertions(+), 1 deletion(-)
-
-diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
-index ceaa75d5a684..8c8394e4e164 100755
---- a/arch/powerpc/boot/wrapper
-+++ b/arch/powerpc/boot/wrapper
-@@ -161,6 +161,28 @@ case "$elfformat" in
-     elf32-powerpc)	format=elf32ppc	;;
- esac
- 
-+ld_version()
-+{
-+    # Poached from scripts/ld-version.sh, but we don't want to call that because
-+    # this script (wrapper) is distributed separately from the kernel source.
-+    # Extract linker version number from stdin and turn into single number.
-+    awk '{
-+	gsub(".*\\)", "");
-+	gsub(".*version ", "");
-+	gsub("-.*", "");
-+	split($1,a, ".");
-+	print a[1]*100000000 + a[2]*1000000 + a[3]*10000;
-+	exit
-+    }'
-+}
-+
-+# Do not include PT_INTERP segment when linking pie. Non-pie linking
-+# just ignores this option.
-+LD_VERSION=$(${CROSS}ld --version | ld_version)
-+LD_NO_DL_MIN_VERSION=$(echo 2.26 | ld_version)
-+if [ "$LD_VERSION" -ge "$LD_NO_DL_MIN_VERSION" ] ; then
-+	nodl="--no-dynamic-linker"
-+fi
- 
- platformo=$object/"$platform".o
- lds=$object/zImage.lds
-@@ -412,7 +434,8 @@ if [ "$platform" != "miboot" ]; then
-     if [ -n "$link_address" ] ; then
-         text_start="-Ttext $link_address"
-     fi
--    ${CROSS}ld -m $format -T $lds $text_start $pie -o "$ofile" \
-+#link everything
-+    ${CROSS}ld -m $format -T $lds $text_start $pie $nodl -o "$ofile" \
- 	$platformo $tmp $object/wrapper.a
-     rm $tmp
- fi
--- 
-2.11.0
-
diff --git a/openpower/linux/0011-powerpc-Convert-cmp-to-cmpd-in-idle-enter-sequence.patch b/openpower/linux/0011-powerpc-Convert-cmp-to-cmpd-in-idle-enter-sequence.patch
deleted file mode 100644
index 4f0edfa..0000000
--- a/openpower/linux/0011-powerpc-Convert-cmp-to-cmpd-in-idle-enter-sequence.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Segher Boessenkool <segher@kernel.crashing.org>
-Date: Thu, 6 Oct 2016 13:42:19 +0000
-Subject: [PATCH 11/13] powerpc: Convert cmp to cmpd in idle enter sequence
-
-PowerPC's "cmp" instruction has four operands. Normally people write
-"cmpw" or "cmpd" for the second cmp operand 0 or 1. But, frequently
-people forget, and write "cmp" with just three operands.
-
-With older binutils this is silently accepted as if this was "cmpw",
-while often "cmpd" is wanted. With newer binutils GAS will complain
-about this for 64-bit code. For 32-bit code it still silently assumes
-"cmpw" is what is meant.
-
-In this instance the code comes directly from ISA v2.07, including the
-cmp, but cmpd is correct. Backport to stable so that new toolchains can
-build old kernels.
-
-Fixes: 948cf67c4726 ("powerpc: Add NAP mode support on Power7 in HV mode")
-Cc: stable@vger.kernel.org # v3.0
-Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
-Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org>
-Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-(cherry picked from commit 80f23935cadb1c654e81951f5a8b7ceae0acc1b4)
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- arch/powerpc/kernel/idle_power7.S | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S
-index 112ccf497562..73f638789a38 100644
---- a/arch/powerpc/kernel/idle_power7.S
-+++ b/arch/powerpc/kernel/idle_power7.S
-@@ -44,7 +44,7 @@
- 	std	r0,0(r1);					\
- 	ptesync;						\
- 	ld	r0,0(r1);					\
--1:	cmp	cr0,r0,r0;					\
-+1:	cmpd	cr0,r0,r0;					\
- 	bne	1b;						\
- 	IDLE_INST;						\
- 	b	.
--- 
-2.11.0
-
diff --git a/openpower/linux/0012-drivers-gpu-drm-ast-Fix-infinite-loop-if-read-fails.patch b/openpower/linux/0012-drivers-gpu-drm-ast-Fix-infinite-loop-if-read-fails.patch
deleted file mode 100644
index b6011c7..0000000
--- a/openpower/linux/0012-drivers-gpu-drm-ast-Fix-infinite-loop-if-read-fails.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Russell Currey <ruscur@russell.cc>
-Date: Thu, 15 Dec 2016 16:12:41 +1100
-Subject: [PATCH 12/13] drivers/gpu/drm/ast: Fix infinite loop if read fails
-
-ast_get_dram_info() configures a window in order to access BMC memory.
-A BMC register can be configured to disallow this, and if so, causes
-an infinite loop in the ast driver which renders the system unusable.
-
-Fix this by erroring out if an error is detected.  On powerpc systems with
-EEH, this leads to the device being fenced and the system continuing to
-operate.
-
-Cc: <stable@vger.kernel.org> # 3.10+
-Signed-off-by: Russell Currey <ruscur@russell.cc>
-Reviewed-by: Joel Stanley <joel@jms.id.au>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- drivers/gpu/drm/ast/ast_main.c | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
-index e0b4586a26fd..9b8f0b975ca6 100644
---- a/drivers/gpu/drm/ast/ast_main.c
-+++ b/drivers/gpu/drm/ast/ast_main.c
-@@ -223,7 +223,8 @@ static int ast_get_dram_info(struct drm_device *dev)
- 	ast_write32(ast, 0x10000, 0xfc600309);
- 
- 	do {
--		;
-+		if (pci_channel_offline(dev->pdev))
-+			return -EIO;
- 	} while (ast_read32(ast, 0x10000) != 0x01);
- 	data = ast_read32(ast, 0x10004);
- 
-@@ -429,7 +430,9 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
- 	ast_detect_chip(dev, &need_post);
- 
- 	if (ast->chip != AST1180) {
--		ast_get_dram_info(dev);
-+		ret = ast_get_dram_info(dev);
-+		if (ret)
-+			goto out_free;
- 		ast->vram_size = ast_get_vram_info(dev);
- 		DRM_INFO("dram %d %d %d %08x\n", ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size);
- 	}
--- 
-2.11.0
-
diff --git a/openpower/linux/0013-Release-4.4.39-openpower1.patch b/openpower/linux/0013-Release-4.4.39-openpower1.patch
deleted file mode 100644
index 1ae0420..0000000
--- a/openpower/linux/0013-Release-4.4.39-openpower1.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Joel Stanley <joel@jms.id.au>
-Date: Wed, 14 Dec 2016 13:20:09 +1030
-Subject: [PATCH 13/13] Release 4.4.39-openpower1
-
- - Add "drivers/gpu/drm/ast: Fix infinite loop if read fails" to avoid
-   hanging when probing the the Aspeed graphics device. This is queued in
-   drm-misc-fixes[1]
-
- - Move to latest upstream stable release 4.4.39
-
-[1] https://patchwork.kernel.org/patch/9477147/
-
-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 88d26a632bef..f10041067025 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1,7 +1,7 @@
- VERSION = 4
- PATCHLEVEL = 4
- SUBLEVEL = 39
--EXTRAVERSION =
-+EXTRAVERSION = -openpower1
- NAME = Blurry Fish Butt
- 
- # *DOCUMENTATION*
--- 
-2.11.0
-
diff --git a/openpower/scripts/firmware-whitelist b/openpower/scripts/firmware-whitelist
index e4e4bd2..2d0fc05 100755
--- a/openpower/scripts/firmware-whitelist
+++ b/openpower/scripts/firmware-whitelist
@@ -6,7 +6,7 @@
 # slash is required.
 whitelist=(     'acenic/'
                 'bnx2/'
-                'bnx2x/bnx2x-e2-7.12.30.0.fw'
+                'bnx2x/bnx2x-e2-7.13.1.0.fw'
                 'cxgb4/'
                 'cxgb3/'
                 'e100/'