Apply selected patches to 4.4 kernel

Some patches are desired but still in the kernel review process.

Apply the patches to instantate the adm1275 sensor with its
scaled value, and a SCU pinmux update based on the patch from
Adi but seperated into Palmetto and Barreleye functions for
non-shared inits.

Signed-off-by: Milton Miller <miltonm@us.ibm.com>
diff --git a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0001-arm-boot-Build-all-apseed-dtbs.patch b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0001-arm-boot-Build-all-apseed-dtbs.patch
new file mode 100644
index 0000000..d47ed57
--- /dev/null
+++ b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0001-arm-boot-Build-all-apseed-dtbs.patch
@@ -0,0 +1,29 @@
+From 60748dffe945b03ac2cc3034895ce1ace3b53073 Mon Sep 17 00:00:00 2001
+From: Joel Stanley <joel@jms.id.au>
+Date: Mon, 21 Mar 2016 22:04:14 +1030
+Subject: [PATCH 1/5] arm/boot: Build all apseed dtbs
+
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ arch/arm/boot/dts/Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
+index b4bae62..aa4daf2 100644
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -777,7 +777,10 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+ 	mt8127-moose.dtb \
+ 	mt8135-evbp1.dtb
+ dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb
+-dtb-$(CONFIG_MACH_OPP_PALMETTO_BMC) += aspeed-bmc-opp-palmetto.dtb
++dtb-$(CONFIG_MACH_OPP_PALMETTO_BMC) += \
++	aspeed-bmc-opp-palmetto.dtb \
++	aspeed-bmc-opp-barreleye.dtb \
++	aspeed-bmc-opp-firestone.dtb
+ endif
+ 
+ dtstree		:= $(srctree)/$(src)
+-- 
+1.8.2.2
+
diff --git a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0002-hwmon-adm1275-Add-device-tree-support.patch b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0002-hwmon-adm1275-Add-device-tree-support.patch
new file mode 100644
index 0000000..b713916
--- /dev/null
+++ b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0002-hwmon-adm1275-Add-device-tree-support.patch
@@ -0,0 +1,56 @@
+From 5fbf374af9fc88bc15a21cde9055f2503c43ab50 Mon Sep 17 00:00:00 2001
+From: Joel Stanley <joel@jms.id.au>
+Date: Mon, 21 Mar 2016 18:31:48 +1030
+Subject: [PATCH 2/5] hwmon/adm1275: Add device tree support
+
+This adds a of_device_id table so we can probe the driver using the
+device tree.
+
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ drivers/hwmon/pmbus/adm1275.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c
+index 3baa4f4a..1476a12 100644
+--- a/drivers/hwmon/pmbus/adm1275.c
++++ b/drivers/hwmon/pmbus/adm1275.c
+@@ -22,6 +22,7 @@
+ #include <linux/slab.h>
+ #include <linux/i2c.h>
+ #include <linux/bitops.h>
++#include <linux/of.h>
+ #include "pmbus.h"
+ 
+ enum chips { adm1075, adm1275, adm1276, adm1278, adm1293, adm1294 };
+@@ -344,6 +345,19 @@ static const struct i2c_device_id adm1275_id[] = {
+ };
+ MODULE_DEVICE_TABLE(i2c, adm1275_id);
+ 
++#ifdef CONFIG_OF
++static const struct of_device_id adm1275_of_match[] = {
++	{ .compatible = "adi,adm1075" },
++	{ .compatible = "adi,adm1275" },
++	{ .compatible = "adi,adm1276" },
++	{ .compatible = "adi,adm1278" },
++	{ .compatible = "adi,adm1293" },
++	{ .compatible = "adi,adm1294" },
++	{ }
++};
++MODULE_DEVICE_TABLE(of, adm1275_of_match);
++#endif
++
+ static int adm1275_probe(struct i2c_client *client,
+ 			 const struct i2c_device_id *id)
+ {
+@@ -598,6 +612,7 @@ static int adm1275_probe(struct i2c_client *client,
+ static struct i2c_driver adm1275_driver = {
+ 	.driver = {
+ 		   .name = "adm1275",
++		   .of_match_table = of_match_ptr(adm1275_of_match),
+ 		   },
+ 	.probe = adm1275_probe,
+ 	.remove = pmbus_do_remove,
+-- 
+1.8.2.2
+
diff --git a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0003-hwmon-adm1275-Support-sense-resistor-parameter-from-.patch b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0003-hwmon-adm1275-Support-sense-resistor-parameter-from-.patch
new file mode 100644
index 0000000..c447728
--- /dev/null
+++ b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0003-hwmon-adm1275-Support-sense-resistor-parameter-from-.patch
@@ -0,0 +1,83 @@
+From dd13a2c59d1221f8dd7ca3eb61b587a652c32d8f Mon Sep 17 00:00:00 2001
+From: Joel Stanley <joel@jms.id.au>
+Date: Mon, 21 Mar 2016 21:31:08 +1030
+Subject: [PATCH 3/5] hwmon/adm1275: Support sense resistor parameter from dt
+
+Allow a system to specify the value of an external sense resistor in the
+device tree.
+
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ Documentation/devicetree/bindings/hwmon/adm1275.txt | 19 +++++++++++++++++++
+ drivers/hwmon/pmbus/adm1275.c                       | 11 +++++++++--
+ 2 files changed, 28 insertions(+), 2 deletions(-)
+ create mode 100644 Documentation/devicetree/bindings/hwmon/adm1275.txt
+
+diff --git a/Documentation/devicetree/bindings/hwmon/adm1275.txt b/Documentation/devicetree/bindings/hwmon/adm1275.txt
+new file mode 100644
+index 0000000..abfba34
+--- /dev/null
++++ b/Documentation/devicetree/bindings/hwmon/adm1275.txt
+@@ -0,0 +1,19 @@
++adm1275 temperature sensor
++--------------------------
++
++Required property:
++
++ - compatible: "adi,adm1278"
++ - reg: i2c device address 
++
++Optional property:
++
++- sense-resistor: external sense resistor value in milliOhms
++
++Example:
++
++sensor { 
++	reg = <0x11>;
++	compatible = "adi,adm1278";
++	sense-resistor = < 100 >
++}
+diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c
+index 1476a12..a5534e4 100644
+--- a/drivers/hwmon/pmbus/adm1275.c
++++ b/drivers/hwmon/pmbus/adm1275.c
+@@ -364,6 +364,7 @@ static int adm1275_probe(struct i2c_client *client,
+ 	u8 block_buffer[I2C_SMBUS_BLOCK_MAX + 1];
+ 	int config, device_config;
+ 	int ret;
++	u32 r_sense = 1;
+ 	struct pmbus_driver_info *info;
+ 	struct adm1275_data *data;
+ 	const struct i2c_device_id *mid;
+@@ -418,6 +419,12 @@ static int adm1275_probe(struct i2c_client *client,
+ 	if (!data)
+ 		return -ENOMEM;
+ 
++	ret = of_property_read_u32(client->dev.of_node, "sense-resistor",
++			&r_sense);
++	if (!ret)
++		dev_notice(&client->dev, "using r_sense from dt %d\n",
++				r_sense);
++
+ 	data->id = mid->driver_data;
+ 
+ 	info = &data->info;
+@@ -591,12 +598,12 @@ static int adm1275_probe(struct i2c_client *client,
+ 		info->R[PSC_VOLTAGE_OUT] = coefficients[voindex].R;
+ 	}
+ 	if (cindex >= 0) {
+-		info->m[PSC_CURRENT_OUT] = coefficients[cindex].m;
++		info->m[PSC_CURRENT_OUT] = coefficients[cindex].m * r_sense;
+ 		info->b[PSC_CURRENT_OUT] = coefficients[cindex].b;
+ 		info->R[PSC_CURRENT_OUT] = coefficients[cindex].R;
+ 	}
+ 	if (pindex >= 0) {
+-		info->m[PSC_POWER] = coefficients[pindex].m;
++		info->m[PSC_POWER] = coefficients[pindex].m * r_sense;
+ 		info->b[PSC_POWER] = coefficients[pindex].b;
+ 		info->R[PSC_POWER] = coefficients[pindex].R;
+ 	}
+-- 
+1.8.2.2
+
diff --git a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0004-arm-dts-add-adm1278-for-barreleye.patch b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0004-arm-dts-add-adm1278-for-barreleye.patch
new file mode 100644
index 0000000..5b66797
--- /dev/null
+++ b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0004-arm-dts-add-adm1278-for-barreleye.patch
@@ -0,0 +1,54 @@
+From f24385a1c35f94da042c0b75046efce983df0f38 Mon Sep 17 00:00:00 2001
+From: Joel Stanley <joel@jms.id.au>
+Date: Mon, 21 Mar 2016 21:59:28 +1030
+Subject: [PATCH 4/5] arm/dts: add adm1278 for barreleye
+
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts | 23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts b/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts
+index 8a7347b..143292b6 100644
+--- a/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts
++++ b/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts
+@@ -70,7 +70,22 @@
+ 						reg = <0x51>;
+ 					};
+ 				};
+-
++				i2c4: i2c-bus@140 {
++					adm1278@10 {
++						// P12V_a for CPU0
++						compatible = "adi,adm1278";
++						reg = <0x10>;
++						sense-resistor = <500>;
++					};
++				};
++				i2c5: i2c-bus@180 {
++					adm1278@10 {
++						// P12V_b for CPU1
++						compatible = "adi,adm1278";
++						reg = <0x10>;
++						sense-resistor = <500>;
++					};
++				};
+ 				i2c6: i2c-bus@1c0 {
+ 					nct7904@2d {
+ 						compatible = "nuvoton,nct7904";
+@@ -90,6 +105,12 @@
+ 						reg = <0x55>;
+ 						pagesize = <8>;
+ 					};
++					adm1278@10 {
++						// P12V_c for HDD and IO board
++						compatible = "adi,adm1278";
++						reg = <0x10>;
++						sense-resistor = <500>;
++					};
+ 				};
+ 			};
+ 		};
+-- 
+1.8.2.2
+
diff --git a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0005-Updated-SCU88-register-and-SCU90-init-values.patch b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0005-Updated-SCU88-register-and-SCU90-init-values.patch
new file mode 100644
index 0000000..55af3bd
--- /dev/null
+++ b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc/0005-Updated-SCU88-register-and-SCU90-init-values.patch
@@ -0,0 +1,73 @@
+From ff221583a7dbfcc8aad2302e216306cc48eabdda Mon Sep 17 00:00:00 2001
+From: Adi Gangidi <adi.gangidi@rackspace.com>
+Date: Thu, 17 Mar 2016 10:01:10 -0500
+Subject: [PATCH 5/5] Updated SCU88 register and SCU90 init values
+
+From:    Adi Gangidi <adi.gangidi@rackspace.com>
+
+Before This change:
+a) SCU90[0]=1, function pin Incorrectly defined. It must be pull down internally.
+b) For SCU88, bits 7:0 were set to 1. That is: We were reading : PWMx or VPIGx instead of GPIONx (GPIONx gives us the PCIe inventory status, where x is bit number). Because of this PCIe inventory was showing up wrong.
+
+After This Change:
+a) SCU90[0]=0
+b) Bits (7:0) of SCU 88 are set to 0 . (According to Page 111 of data sheet these have to be set to 0 for us to to read GPION0 to GPIO N7 which indicate if PCIe device is present ).
+
+Description of pins 0 of SCU 90:
+Enable SD1 Function Pin
+
+Description of pins 7:0 of SCU 88:
+7 RW Enable PWM7 or VPIG7 function pin  (SCU90[5:4]=0x2 select Video pin)
+6 RW Enable PWM6 or VPIG6 function pin   (SCU90[5:4]=0x2 select Video pin)
+5 RW Enable PWM5 or VPIG5 function pin    (SCU90[5:4]!=0 select Video pin)
+4 RW Enable PWM4 or VPIG4 function pin     (SCU90[5:4]!=0 select Video pin)
+3 RW Enable PWM3 or VPIG3 function pin      (SCU90[5:4]!=0 select Video pin)
+2 RW Enable PWM2 or VPIG2 function pin        (SCU90[5:4]!=0 select Video pin)
+1 RW Enable PWM1 or VPIG1 function pin        (SCU90[5:4]=0x3 select Video pin)
+0 RW Enable PWM0 or VPIG0 function pin         (SCU90[5:4]=0x3 select Video pin)
+
+[ miltonm: move 88 to barreleye and palmetto with different values ]
+Signed-off-by: Milton Miller <miltonm@us.ibm.com>
+---
+ arch/arm/mach-aspeed/aspeed.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/mach-aspeed/aspeed.c b/arch/arm/mach-aspeed/aspeed.c
+index f3180fc..d9d89e2 100644
+--- a/arch/arm/mach-aspeed/aspeed.c
++++ b/arch/arm/mach-aspeed/aspeed.c
+@@ -116,10 +116,8 @@ static void __init do_common_setup(void)
+ 	writel(0x00000000, AST_IO(AST_BASE_LPC | 0x9c));
+ 
+ 	/* SCU setup */
+-	writel(0x01C000FF, AST_IO(AST_BASE_SCU | 0x88));
+ 	writel(0xC1C000FF, AST_IO(AST_BASE_SCU | 0x8c));
+-	writel(0x01C0007F, AST_IO(AST_BASE_SCU | 0x88));
+-	writel(0x003FA009, AST_IO(AST_BASE_SCU | 0x90));
++	writel(0x003FA008, AST_IO(AST_BASE_SCU | 0x90));
+ 
+ 	/* Setup scratch registers */
+ 	writel(0x00000042, AST_IO(AST_BASE_LPC | 0x170));
+@@ -132,6 +130,9 @@ static void __init do_barreleye_setup(void)
+ 
+ 	do_common_setup();
+ 
++	/* More SCU setup */
++	writel(0x01C00000, AST_IO(AST_BASE_SCU | 0x88));    
++
+ 	/* Setup PNOR address mapping for 64M flash */
+ 	writel(0x30000C00, AST_IO(AST_BASE_LPC | 0x88));
+ 	writel(0xFC0003FF, AST_IO(AST_BASE_LPC | 0x8C));
+@@ -155,6 +156,9 @@ static void __init do_palmetto_setup(void)
+ {
+ 	do_common_setup();
+ 
++	/* More SCU setup */
++	writel(0x01C0007F, AST_IO(AST_BASE_SCU | 0x88));
++
+ 	/* Setup PNOR address mapping for 32M flash */
+ 	writel(0x30000E00, AST_IO(AST_BASE_LPC | 0x88));
+ 	writel(0xFE0001FF, AST_IO(AST_BASE_LPC | 0x8C));
+-- 
+1.8.2.2
+
diff --git a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc_%.bbappend b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc_%.bbappend
index bb6f06c..7b002a1 100644
--- a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc_%.bbappend
+++ b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-kernel/linux/linux-obmc_%.bbappend
@@ -1,2 +1,8 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 SRC_URI += "file://defconfig file://hwmon.cfg"
+SRC_URI += " \
+ file://0002-hwmon-adm1275-Add-device-tree-support.patch \
+ file://0003-hwmon-adm1275-Support-sense-resistor-parameter-from-.patch \
+ file://0004-arm-dts-add-adm1278-for-barreleye.patch \
+ file://0005-Updated-SCU88-register-and-SCU90-init-values.patch \
+ "