aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/apm821xx
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/apm821xx')
-rw-r--r--target/linux/apm821xx/patches-4.4/001-crypto4xx-integrate-ppc4xx-rng-into-crypto4xx.patch38
-rw-r--r--target/linux/apm821xx/patches-4.4/002-powerpc_ibm_phy_add_ar8035.patch7
-rw-r--r--target/linux/apm821xx/patches-4.4/010-dmaengine-Add-transfer-termination-synchronization-s.patch13
-rw-r--r--target/linux/apm821xx/patches-4.4/011-dmaengine-core-Introduce-new-universal-API-to-reques.patch26
-rw-r--r--target/linux/apm821xx/patches-4.4/012-dmaengine-Add-transfer-termination-synchronization-s.patch27
-rw-r--r--target/linux/apm821xx/patches-4.4/015-dmaengine-dw-fixed.patch21
-rw-r--r--target/linux/apm821xx/patches-4.4/020-sata-dwc.patch77
-rw-r--r--target/linux/apm821xx/patches-4.4/030-usb-dwc2-endian-fix.patch95
-rw-r--r--target/linux/apm821xx/patches-4.4/200-add-meraki-mr24-ikarem-support.patch3
-rw-r--r--target/linux/apm821xx/patches-4.4/201-add-amcc-apollo3g-support.patch8
-rw-r--r--target/linux/apm821xx/patches-4.4/202-add-netgear-wndr4700-support.patch8
-rw-r--r--target/linux/apm821xx/patches-4.4/300-fix-atheros-nics-on-apm82181.patch4
-rw-r--r--target/linux/apm821xx/patches-4.4/301-fix-memory-map-wndr4700.patch4
-rw-r--r--target/linux/apm821xx/patches-4.4/701-powerpc_ibm_apm82181_phyclk_fix.patch12
-rw-r--r--target/linux/apm821xx/patches-4.4/702-powerpc_ibm_phy_add_dt_parser.patch17
-rw-r--r--target/linux/apm821xx/patches-4.4/800-usb-dwc2-add-wndr4700-otg.patch4
-rw-r--r--target/linux/apm821xx/patches-4.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch11
-rw-r--r--target/linux/apm821xx/patches-4.4/802-usb-xhci-force-msi-renesas-xhci.patch21
-rw-r--r--target/linux/apm821xx/patches-4.4/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch14
-rw-r--r--target/linux/apm821xx/patches-4.4/911-hwmon-lm90-split-set-and-show-temp-as-common-codes.patch142
-rw-r--r--target/linux/apm821xx/patches-4.4/912-hwmon-lm90-expose-to-thermal-fw-via-DT.patch32
21 files changed, 191 insertions, 393 deletions
diff --git a/target/linux/apm821xx/patches-4.4/001-crypto4xx-integrate-ppc4xx-rng-into-crypto4xx.patch b/target/linux/apm821xx/patches-4.4/001-crypto4xx-integrate-ppc4xx-rng-into-crypto4xx.patch
index b395f0f7a3..324c695d05 100644
--- a/target/linux/apm821xx/patches-4.4/001-crypto4xx-integrate-ppc4xx-rng-into-crypto4xx.patch
+++ b/target/linux/apm821xx/patches-4.4/001-crypto4xx-integrate-ppc4xx-rng-into-crypto4xx.patch
@@ -25,8 +25,6 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
create mode 100644 drivers/crypto/amcc/crypto4xx_trng.c
create mode 100644 drivers/crypto/amcc/crypto4xx_trng.h
-diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
-index c76a88d..ac51149 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -268,19 +268,6 @@ config HW_RANDOM_NOMADIK
@@ -49,11 +47,9 @@ index c76a88d..ac51149 100644
config HW_RANDOM_PSERIES
tristate "pSeries HW Random Number Generator support"
depends on PPC64 && IBMVIO
-diff --git a/drivers/char/hw_random/Makefile b/drivers/char/hw_random/Makefile
-index e09305b..63022b4 100644
--- a/drivers/char/hw_random/Makefile
+++ b/drivers/char/hw_random/Makefile
-@@ -22,7 +22,6 @@ obj-$(CONFIG_HW_RANDOM_TX4939) += tx4939-rng.o
+@@ -22,7 +22,6 @@ obj-$(CONFIG_HW_RANDOM_TX4939) += tx4939
obj-$(CONFIG_HW_RANDOM_MXC_RNGA) += mxc-rnga.o
obj-$(CONFIG_HW_RANDOM_OCTEON) += octeon-rng.o
obj-$(CONFIG_HW_RANDOM_NOMADIK) += nomadik-rng.o
@@ -61,9 +57,6 @@ index e09305b..63022b4 100644
obj-$(CONFIG_HW_RANDOM_PSERIES) += pseries-rng.o
obj-$(CONFIG_HW_RANDOM_POWERNV) += powernv-rng.o
obj-$(CONFIG_HW_RANDOM_EXYNOS) += exynos-rng.o
-diff --git a/drivers/char/hw_random/ppc4xx-rng.c b/drivers/char/hw_random/ppc4xx-rng.c
-deleted file mode 100644
-index c0db438..0000000
--- a/drivers/char/hw_random/ppc4xx-rng.c
+++ /dev/null
@@ -1,147 +0,0 @@
@@ -214,11 +207,9 @@ index c0db438..0000000
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Josh Boyer <jwboyer@linux.vnet.ibm.com>");
-MODULE_DESCRIPTION("HW RNG driver for PPC 4xx processors");
-diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
-index 0a22ac7..12fd499 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
-@@ -279,6 +279,14 @@ config CRYPTO_DEV_PPC4XX
+@@ -277,6 +277,14 @@ config CRYPTO_DEV_PPC4XX
help
This option allows you to have support for AMCC crypto acceleration.
@@ -233,16 +224,12 @@ index 0a22ac7..12fd499 100644
config CRYPTO_DEV_OMAP_SHAM
tristate "Support for OMAP MD5/SHA1/SHA2 hw accelerator"
depends on ARCH_OMAP2PLUS
-diff --git a/drivers/crypto/amcc/Makefile b/drivers/crypto/amcc/Makefile
-index 5c0c62b..b955399 100644
--- a/drivers/crypto/amcc/Makefile
+++ b/drivers/crypto/amcc/Makefile
@@ -1,2 +1,3 @@
obj-$(CONFIG_CRYPTO_DEV_PPC4XX) += crypto4xx.o
crypto4xx-y := crypto4xx_core.o crypto4xx_alg.o crypto4xx_sa.o
+crypto4xx-$(CONFIG_HW_RANDOM_PPC4XX) += crypto4xx_trng.o
-diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
-index 62134c8..dae1e39 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -40,6 +40,7 @@
@@ -253,7 +240,7 @@ index 62134c8..dae1e39 100644
#define PPC4XX_SEC_VERSION_STR "0.5"
-@@ -1225,6 +1226,7 @@ static int crypto4xx_probe(struct platform_device *ofdev)
+@@ -1221,6 +1222,7 @@ static int crypto4xx_probe(struct platfo
if (rc)
goto err_start_dev;
@@ -261,7 +248,7 @@ index 62134c8..dae1e39 100644
return 0;
err_start_dev:
-@@ -1252,6 +1254,8 @@ static int crypto4xx_remove(struct platform_device *ofdev)
+@@ -1248,6 +1250,8 @@ static int crypto4xx_remove(struct platf
struct device *dev = &ofdev->dev;
struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
@@ -270,7 +257,7 @@ index 62134c8..dae1e39 100644
free_irq(core_dev->irq, dev);
irq_dispose_mapping(core_dev->irq);
-@@ -1272,7 +1276,7 @@ MODULE_DEVICE_TABLE(of, crypto4xx_match);
+@@ -1268,7 +1272,7 @@ MODULE_DEVICE_TABLE(of, crypto4xx_match)
static struct platform_driver crypto4xx_driver = {
.driver = {
@@ -279,13 +266,11 @@ index 62134c8..dae1e39 100644
.of_match_table = crypto4xx_match,
},
.probe = crypto4xx_probe,
-@@ -1284,4 +1288,3 @@ module_platform_driver(crypto4xx_driver);
+@@ -1280,4 +1284,3 @@ module_platform_driver(crypto4xx_driver)
MODULE_LICENSE("GPL");
MODULE_AUTHOR("James Hsiao <jhsiao@amcc.com>");
MODULE_DESCRIPTION("Driver for AMCC PPC4xx crypto accelerator");
-
-diff --git a/drivers/crypto/amcc/crypto4xx_core.h b/drivers/crypto/amcc/crypto4xx_core.h
-index bac0bde..ecfdcfe 100644
--- a/drivers/crypto/amcc/crypto4xx_core.h
+++ b/drivers/crypto/amcc/crypto4xx_core.h
@@ -24,6 +24,8 @@
@@ -313,8 +298,6 @@ index bac0bde..ecfdcfe 100644
u32 int_status;
u32 irq;
struct tasklet_struct tasklet;
-diff --git a/drivers/crypto/amcc/crypto4xx_reg_def.h b/drivers/crypto/amcc/crypto4xx_reg_def.h
-index 5f5fbc0..46fe57c 100644
--- a/drivers/crypto/amcc/crypto4xx_reg_def.h
+++ b/drivers/crypto/amcc/crypto4xx_reg_def.h
@@ -125,6 +125,7 @@
@@ -325,9 +308,6 @@ index 5f5fbc0..46fe57c 100644
#define PPC4XX_INT_DESCR_CNT 4
#define PPC4XX_INT_TIMEOUT_CNT 0
#define PPC4XX_INT_CFG 1
-diff --git a/drivers/crypto/amcc/crypto4xx_trng.c b/drivers/crypto/amcc/crypto4xx_trng.c
-new file mode 100644
-index 0000000..677ca17
--- /dev/null
+++ b/drivers/crypto/amcc/crypto4xx_trng.c
@@ -0,0 +1,131 @@
@@ -462,9 +442,6 @@ index 0000000..677ca17
+}
+
+MODULE_ALIAS("ppc4xx_rng");
-diff --git a/drivers/crypto/amcc/crypto4xx_trng.h b/drivers/crypto/amcc/crypto4xx_trng.h
-new file mode 100644
-index 0000000..931d225
--- /dev/null
+++ b/drivers/crypto/amcc/crypto4xx_trng.h
@@ -0,0 +1,34 @@
@@ -502,6 +479,3 @@ index 0000000..931d225
+#endif
+
+#endif
---
-2.8.1
-
diff --git a/target/linux/apm821xx/patches-4.4/002-powerpc_ibm_phy_add_ar8035.patch b/target/linux/apm821xx/patches-4.4/002-powerpc_ibm_phy_add_ar8035.patch
index b7316e15b3..f885167e04 100644
--- a/target/linux/apm821xx/patches-4.4/002-powerpc_ibm_phy_add_ar8035.patch
+++ b/target/linux/apm821xx/patches-4.4/002-powerpc_ibm_phy_add_ar8035.patch
@@ -14,11 +14,9 @@ Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
drivers/net/ethernet/ibm/emac/phy.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
-diff --git a/drivers/net/ethernet/ibm/emac/phy.c b/drivers/net/ethernet/ibm/emac/phy.c
-index d3b9d10..5b88cc6 100644
--- a/drivers/net/ethernet/ibm/emac/phy.c
+++ b/drivers/net/ethernet/ibm/emac/phy.c
-@@ -470,12 +470,38 @@ static struct mii_phy_def m88e1112_phy_def = {
+@@ -470,12 +470,38 @@ static struct mii_phy_def m88e1112_phy_d
.ops = &m88e1112_phy_ops,
};
@@ -57,6 +55,3 @@ index d3b9d10..5b88cc6 100644
&genmii_phy_def,
NULL
};
---
-2.8.1
-
diff --git a/target/linux/apm821xx/patches-4.4/010-dmaengine-Add-transfer-termination-synchronization-s.patch b/target/linux/apm821xx/patches-4.4/010-dmaengine-Add-transfer-termination-synchronization-s.patch
index 924f7970a8..89bdd49d2b 100644
--- a/target/linux/apm821xx/patches-4.4/010-dmaengine-Add-transfer-termination-synchronization-s.patch
+++ b/target/linux/apm821xx/patches-4.4/010-dmaengine-Add-transfer-termination-synchronization-s.patch
@@ -17,11 +17,9 @@ Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/dmaengine.c | 81 +++++++++++++++++++++++++------------------------
1 file changed, 42 insertions(+), 39 deletions(-)
-diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
-index f2cbff9..81a36fc 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
-@@ -542,6 +542,42 @@ static struct dma_chan *private_candidate(const dma_cap_mask_t *mask,
+@@ -542,6 +542,42 @@ static struct dma_chan *private_candidat
return NULL;
}
@@ -64,7 +62,7 @@ index f2cbff9..81a36fc 100644
/**
* dma_get_slave_channel - try to get specific channel exclusively
* @chan: target channel
-@@ -580,7 +616,6 @@ struct dma_chan *dma_get_any_slave_channel(struct dma_device *device)
+@@ -580,7 +616,6 @@ struct dma_chan *dma_get_any_slave_chann
{
dma_cap_mask_t mask;
struct dma_chan *chan;
@@ -72,7 +70,7 @@ index f2cbff9..81a36fc 100644
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
-@@ -588,23 +623,11 @@ struct dma_chan *dma_get_any_slave_channel(struct dma_device *device)
+@@ -588,23 +623,11 @@ struct dma_chan *dma_get_any_slave_chann
/* lock against __dma_request_channel */
mutex_lock(&dma_list_mutex);
@@ -98,7 +96,7 @@ index f2cbff9..81a36fc 100644
}
EXPORT_SYMBOL_GPL(dma_get_any_slave_channel);
-@@ -621,35 +644,15 @@ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
+@@ -621,35 +644,15 @@ struct dma_chan *__dma_request_channel(c
{
struct dma_device *device, *_d;
struct dma_chan *chan = NULL;
@@ -138,6 +136,3 @@ index f2cbff9..81a36fc 100644
}
mutex_unlock(&dma_list_mutex);
---
-2.8.1
-
diff --git a/target/linux/apm821xx/patches-4.4/011-dmaengine-core-Introduce-new-universal-API-to-reques.patch b/target/linux/apm821xx/patches-4.4/011-dmaengine-core-Introduce-new-universal-API-to-reques.patch
index 0296714639..7a0e26f6a3 100644
--- a/target/linux/apm821xx/patches-4.4/011-dmaengine-core-Introduce-new-universal-API-to-reques.patch
+++ b/target/linux/apm821xx/patches-4.4/011-dmaengine-core-Introduce-new-universal-API-to-reques.patch
@@ -69,11 +69,9 @@ Signed-off-by: Vinod Koul <vinod.koul@intel.com>
include/linux/dmaengine.h | 51 +++++++++++++++++++---
3 files changed, 127 insertions(+), 36 deletions(-)
-diff --git a/Documentation/dmaengine/client.txt b/Documentation/dmaengine/client.txt
-index 11fb87f..4b04d89 100644
--- a/Documentation/dmaengine/client.txt
+++ b/Documentation/dmaengine/client.txt
-@@ -22,25 +22,14 @@ The slave DMA usage consists of following steps:
+@@ -22,25 +22,14 @@ The slave DMA usage consists of followin
Channel allocation is slightly different in the slave DMA context,
client drivers typically need a channel from a particular DMA
controller only and even in some cases a specific channel is desired.
@@ -86,7 +84,8 @@ index 11fb87f..4b04d89 100644
- void *filter_param);
- where dma_filter_fn is defined as:
- typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
--
++ struct dma_chan *dma_request_chan(struct device *dev, const char *name);
+
- The 'filter_fn' parameter is optional, but highly recommended for
- slave and cyclic channels as they typically need to obtain a specific
- DMA channel.
@@ -97,16 +96,12 @@ index 11fb87f..4b04d89 100644
- Otherwise, the 'filter_fn' routine will be called once for each free
- channel which has a capability in 'mask'. 'filter_fn' is expected to
- return 'true' when the desired DMA channel is found.
-+ struct dma_chan *dma_request_chan(struct device *dev, const char *name);
-+
+ Which will find and return the 'name' DMA channel associated with the 'dev'
+ device. The association is done via DT, ACPI or board file based
+ dma_slave_map matching table.
A channel allocated via this interface is exclusive to the caller,
until dma_release_channel() is called.
-diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
-index 81a36fc..a094dbb 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -43,6 +43,7 @@
@@ -117,7 +112,7 @@ index 81a36fc..a094dbb 100644
#include <linux/dma-mapping.h>
#include <linux/init.h>
#include <linux/module.h>
-@@ -665,27 +666,73 @@ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
+@@ -665,27 +666,73 @@ struct dma_chan *__dma_request_channel(c
}
EXPORT_SYMBOL_GPL(__dma_request_channel);
@@ -199,7 +194,7 @@ index 81a36fc..a094dbb 100644
/**
* dma_request_slave_channel - try to allocate an exclusive slave channel
-@@ -697,17 +744,35 @@ EXPORT_SYMBOL_GPL(dma_request_slave_channel_reason);
+@@ -697,17 +744,35 @@ EXPORT_SYMBOL_GPL(dma_request_slave_chan
struct dma_chan *dma_request_slave_channel(struct device *dev,
const char *name)
{
@@ -239,8 +234,6 @@ index 81a36fc..a094dbb 100644
void dma_release_channel(struct dma_chan *chan)
{
mutex_lock(&dma_list_mutex);
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index c47c68e..d50a6b51 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -607,11 +607,38 @@ enum dmaengine_alignment {
@@ -290,7 +283,7 @@ index c47c68e..d50a6b51 100644
dma_cap_mask_t cap_mask;
unsigned short max_xor;
unsigned short max_pq;
-@@ -1140,9 +1168,11 @@ enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
+@@ -1140,9 +1168,11 @@ enum dma_status dma_wait_for_async_tx(st
void dma_issue_pending_all(void);
struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
dma_filter_fn fn, void *fn_param);
@@ -304,7 +297,7 @@ index c47c68e..d50a6b51 100644
void dma_release_channel(struct dma_chan *chan);
int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps);
#else
-@@ -1166,16 +1196,21 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
+@@ -1166,16 +1196,21 @@ static inline struct dma_chan *__dma_req
{
return NULL;
}
@@ -331,7 +324,7 @@ index c47c68e..d50a6b51 100644
static inline void dma_release_channel(struct dma_chan *chan)
{
}
-@@ -1186,6 +1221,8 @@ static inline int dma_get_slave_caps(struct dma_chan *chan,
+@@ -1186,6 +1221,8 @@ static inline int dma_get_slave_caps(str
}
#endif
@@ -340,6 +333,3 @@ index c47c68e..d50a6b51 100644
static inline int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx)
{
struct dma_slave_caps caps;
---
-2.8.1
-
diff --git a/target/linux/apm821xx/patches-4.4/012-dmaengine-Add-transfer-termination-synchronization-s.patch b/target/linux/apm821xx/patches-4.4/012-dmaengine-Add-transfer-termination-synchronization-s.patch
index 8fcf8caa8a..21efb046c2 100644
--- a/target/linux/apm821xx/patches-4.4/012-dmaengine-Add-transfer-termination-synchronization-s.patch
+++ b/target/linux/apm821xx/patches-4.4/012-dmaengine-Add-transfer-termination-synchronization-s.patch
@@ -53,11 +53,9 @@ Signed-off-by: Vinod Koul <vinod.koul@intel.com>
include/linux/dmaengine.h | 90 ++++++++++++++++++++++++++++++++++++
4 files changed, 148 insertions(+), 5 deletions(-)
-diff --git a/Documentation/dmaengine/client.txt b/Documentation/dmaengine/client.txt
-index 11fb87f..d9f9f46 100644
--- a/Documentation/dmaengine/client.txt
+++ b/Documentation/dmaengine/client.txt
-@@ -128,7 +128,7 @@ The slave DMA usage consists of following steps:
+@@ -117,7 +117,7 @@ The slave DMA usage consists of followin
transaction.
For cyclic DMA, a callback function may wish to terminate the
@@ -66,7 +64,7 @@ index 11fb87f..d9f9f46 100644
Therefore, it is important that DMA engine drivers drop any
locks before calling the callback function which may cause a
-@@ -166,12 +166,29 @@ The slave DMA usage consists of following steps:
+@@ -155,12 +155,29 @@ The slave DMA usage consists of followin
Further APIs:
@@ -97,7 +95,7 @@ index 11fb87f..d9f9f46 100644
2. int dmaengine_pause(struct dma_chan *chan)
This pauses activity on the DMA channel without data loss.
-@@ -197,3 +214,20 @@ Further APIs:
+@@ -186,3 +203,20 @@ Further APIs:
a running DMA channel. It is recommended that DMA engine users
pause or stop (via dmaengine_terminate_all()) the channel before
using this API.
@@ -118,8 +116,6 @@ index 11fb87f..d9f9f46 100644
+
+ The behavior of this function is undefined if dma_async_issue_pending() has
+ been called between dmaengine_terminate_async() and this function.
-diff --git a/Documentation/dmaengine/provider.txt b/Documentation/dmaengine/provider.txt
-index 67d4ce4..122b7f4 100644
--- a/Documentation/dmaengine/provider.txt
+++ b/Documentation/dmaengine/provider.txt
@@ -327,8 +327,24 @@ supported.
@@ -149,11 +145,9 @@ index 67d4ce4..122b7f4 100644
Misc notes (stuff that should be documented, but don't really know
where to put them)
-diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
-index 3ecec14..d6fc82e 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
-@@ -265,8 +265,11 @@ static void dma_chan_put(struct dma_chan *chan)
+@@ -266,8 +266,11 @@ static void dma_chan_put(struct dma_chan
module_put(dma_chan_to_owner(chan));
/* This channel is not in use anymore, free it */
@@ -166,11 +160,9 @@ index 3ecec14..d6fc82e 100644
/* If the channel is used via a DMA request router, free the mapping */
if (chan->router && chan->router->route_free) {
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index c47c68e..4662d9a 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
-@@ -654,6 +654,8 @@ enum dmaengine_alignment {
+@@ -681,6 +681,8 @@ struct dma_filter {
* paused. Returns 0 or an error code
* @device_terminate_all: Aborts all transfers on a channel. Returns 0
* or an error code
@@ -179,7 +171,7 @@ index c47c68e..4662d9a 100644
* @device_tx_status: poll for transaction completion, the optional
* txstate parameter can be supplied with a pointer to get a
* struct with auxiliary transfer status information, otherwise the call
-@@ -737,6 +739,7 @@ struct dma_device {
+@@ -765,6 +767,7 @@ struct dma_device {
int (*device_pause)(struct dma_chan *chan);
int (*device_resume)(struct dma_chan *chan);
int (*device_terminate_all)(struct dma_chan *chan);
@@ -187,7 +179,7 @@ index c47c68e..4662d9a 100644
enum dma_status (*device_tx_status)(struct dma_chan *chan,
dma_cookie_t cookie,
-@@ -828,6 +831,13 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_sg(
+@@ -856,6 +859,13 @@ static inline struct dma_async_tx_descri
src_sg, src_nents, flags);
}
@@ -201,7 +193,7 @@ index c47c68e..4662d9a 100644
static inline int dmaengine_terminate_all(struct dma_chan *chan)
{
if (chan->device->device_terminate_all)
-@@ -836,6 +846,86 @@ static inline int dmaengine_terminate_all(struct dma_chan *chan)
+@@ -864,6 +874,86 @@ static inline int dmaengine_terminate_al
return -ENOSYS;
}
@@ -288,6 +280,3 @@ index c47c68e..4662d9a 100644
static inline int dmaengine_pause(struct dma_chan *chan)
{
if (chan->device->device_pause)
---
-2.8.1
-
diff --git a/target/linux/apm821xx/patches-4.4/015-dmaengine-dw-fixed.patch b/target/linux/apm821xx/patches-4.4/015-dmaengine-dw-fixed.patch
index 96b11a82b6..0380088547 100644
--- a/target/linux/apm821xx/patches-4.4/015-dmaengine-dw-fixed.patch
+++ b/target/linux/apm821xx/patches-4.4/015-dmaengine-dw-fixed.patch
@@ -65,8 +65,8 @@ Andy Shevchenko (4):
sound/soc/intel/common/sst-firmware.c | 2 +-
11 files changed, 64 insertions(+), 78 deletions(-)
---- a/drivers/dma/dw/core.c 2016-05-21 23:13:19.964478443 +0200
-+++ b/drivers/dma/dw/core.c 2016-05-21 22:47:08.665465180 +0200
+--- a/drivers/dma/dw/core.c
++++ b/drivers/dma/dw/core.c
@@ -45,22 +45,19 @@
DW_DMA_MSIZE_16; \
u8 _dmsize = _is_slave ? _sconfig->dst_maxburst : \
@@ -1116,8 +1116,8 @@ Andy Shevchenko (4):
channel_writel(dwc, LLP, 0);
}
}
---- a/drivers/dma/dw/pci.c 2016-05-21 23:13:19.964478443 +0200
-+++ b/drivers/dma/dw/pci.c 2016-05-21 22:47:08.665465180 +0200
+--- a/drivers/dma/dw/pci.c
++++ b/drivers/dma/dw/pci.c
@@ -17,8 +17,8 @@
static int dw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
@@ -1150,8 +1150,8 @@ Andy Shevchenko (4):
{ }
};
MODULE_DEVICE_TABLE(pci, dw_pci_id_table);
---- a/drivers/dma/dw/platform.c 2016-05-21 23:13:19.964478443 +0200
-+++ b/drivers/dma/dw/platform.c 2016-05-21 22:47:08.665465180 +0200
+--- a/drivers/dma/dw/platform.c
++++ b/drivers/dma/dw/platform.c
@@ -42,13 +42,13 @@ static struct dma_chan *dw_dma_of_xlate(
slave.src_id = dma_spec->args[0];
@@ -1309,8 +1309,8 @@ Andy Shevchenko (4):
{ }
};
MODULE_DEVICE_TABLE(acpi, dw_dma_acpi_id_table);
---- a/drivers/dma/dw/regs.h 2016-05-21 23:13:19.964478443 +0200
-+++ b/drivers/dma/dw/regs.h 2016-05-21 22:47:08.665465180 +0200
+--- a/drivers/dma/dw/regs.h
++++ b/drivers/dma/dw/regs.h
@@ -114,10 +114,6 @@ struct dw_dma_regs {
#define dma_writel_native writel
#endif
@@ -1475,8 +1475,6 @@ Andy Shevchenko (4):
int dw_dma_remove(struct dw_dma_chip *chip);
/* DMA API extensions */
-diff --git a/include/linux/platform_data/dma-dw.h b/include/linux/platform_data/dma-dw.h
-index 03b6095..d15d8ba 100644
--- a/include/linux/platform_data/dma-dw.h
+++ b/include/linux/platform_data/dma-dw.h
@@ -21,15 +21,15 @@
@@ -1517,6 +1515,3 @@ index 03b6095..d15d8ba 100644
unsigned char nr_masters;
unsigned char data_width[DW_DMA_MAX_NR_MASTERS];
};
---
-2.8.1
-
diff --git a/target/linux/apm821xx/patches-4.4/020-sata-dwc.patch b/target/linux/apm821xx/patches-4.4/020-sata-dwc.patch
index 772c0dcf9b..1a6ce05624 100644
--- a/target/linux/apm821xx/patches-4.4/020-sata-dwc.patch
+++ b/target/linux/apm821xx/patches-4.4/020-sata-dwc.patch
@@ -66,8 +66,6 @@ Mans Rullgard (11):
drivers/ata/sata_dwc_460ex.c | 552 ++++++++++++++++++++++---------------------
1 file changed, 283 insertions(+), 269 deletions(-)
-diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
-index 9020349..00c2af1 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -30,10 +30,12 @@
@@ -197,7 +195,7 @@ index 9020349..00c2af1 100644
/*
* Prototypes
*/
-@@ -215,6 +192,93 @@ static void sata_dwc_dma_xfer_complete(struct ata_port *ap, u32 check_status);
+@@ -215,6 +192,93 @@ static void sata_dwc_dma_xfer_complete(s
static void sata_dwc_port_stop(struct ata_port *ap);
static void sata_dwc_clear_dmacr(struct sata_dwc_device_port *hsdevp, u8 tag);
@@ -291,7 +289,7 @@ index 9020349..00c2af1 100644
static const char *get_prot_descript(u8 protocol)
{
switch ((enum ata_tf_protocols)protocol) {
-@@ -305,21 +369,20 @@ static struct dma_async_tx_descriptor *dma_dwc_xfer_setup(struct ata_queued_cmd
+@@ -305,21 +369,20 @@ static struct dma_async_tx_descriptor *d
struct ata_port *ap = qc->ap;
struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
@@ -318,7 +316,7 @@ index 9020349..00c2af1 100644
sconf.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
sconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
-@@ -336,8 +399,8 @@ static struct dma_async_tx_descriptor *dma_dwc_xfer_setup(struct ata_queued_cmd
+@@ -336,8 +399,8 @@ static struct dma_async_tx_descriptor *d
desc->callback = dma_dwc_xfer_done;
desc->callback_param = hsdev;
@@ -329,7 +327,7 @@ index 9020349..00c2af1 100644
return desc;
}
-@@ -350,48 +413,38 @@ static int sata_dwc_scr_read(struct ata_link *link, unsigned int scr, u32 *val)
+@@ -350,48 +413,38 @@ static int sata_dwc_scr_read(struct ata_
return -EINVAL;
}
@@ -389,7 +387,7 @@ index 9020349..00c2af1 100644
}
static u32 qcmd_tag_to_mask(u8 tag)
-@@ -412,7 +465,7 @@ static void sata_dwc_error_intr(struct ata_port *ap,
+@@ -412,7 +465,7 @@ static void sata_dwc_error_intr(struct a
ata_ehi_clear_desc(ehi);
@@ -398,7 +396,7 @@ index 9020349..00c2af1 100644
status = ap->ops->sff_check_status(ap);
tag = ap->link.active_tag;
-@@ -423,7 +476,7 @@ static void sata_dwc_error_intr(struct ata_port *ap,
+@@ -423,7 +476,7 @@ static void sata_dwc_error_intr(struct a
hsdevp->dma_pending[tag], hsdevp->cmd_issued[tag]);
/* Clear error register and interrupt bit */
@@ -407,7 +405,7 @@ index 9020349..00c2af1 100644
clear_interrupt_bit(hsdev, SATA_DWC_INTPR_ERR);
/* This is the only error happening now. TODO check for exact error */
-@@ -462,12 +515,12 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance)
+@@ -462,12 +515,12 @@ static irqreturn_t sata_dwc_isr(int irq,
int handled, num_processed, port = 0;
uint intpr, sactive, sactive2, tag_mask;
struct sata_dwc_device_port *hsdevp;
@@ -422,7 +420,7 @@ index 9020349..00c2af1 100644
ap = host->ports[port];
hsdevp = HSDEVP_FROM_AP(ap);
-@@ -486,12 +539,12 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance)
+@@ -486,12 +539,12 @@ static irqreturn_t sata_dwc_isr(int irq,
if (intpr & SATA_DWC_INTPR_NEWFP) {
clear_interrupt_bit(hsdev, SATA_DWC_INTPR_NEWFP);
@@ -437,7 +435,7 @@ index 9020349..00c2af1 100644
qc = ata_qc_from_tag(ap, tag);
/*
-@@ -505,11 +558,11 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance)
+@@ -505,11 +558,11 @@ static irqreturn_t sata_dwc_isr(int irq,
handled = 1;
goto DONE;
}
@@ -512,7 +510,7 @@ index 9020349..00c2af1 100644
} else {
/*
* This should not happen, it indicates the driver is out of
-@@ -688,10 +737,9 @@ static void sata_dwc_clear_dmacr(struct sata_dwc_device_port *hsdevp, u8 tag)
+@@ -688,10 +737,9 @@ static void sata_dwc_clear_dmacr(struct
*/
dev_err(hsdev->dev,
"%s DMA protocol RX and TX DMA not pending tag=0x%02x pending=%d dmacr: 0x%08x\n",
@@ -526,7 +524,7 @@ index 9020349..00c2af1 100644
}
}
-@@ -716,7 +764,7 @@ static void sata_dwc_dma_xfer_complete(struct ata_port *ap, u32 check_status)
+@@ -716,7 +764,7 @@ static void sata_dwc_dma_xfer_complete(s
__func__, qc->tag, qc->tf.command,
get_dma_dir_descript(qc->dma_dir),
get_prot_descript(qc->tf.protocol),
@@ -535,7 +533,7 @@ index 9020349..00c2af1 100644
}
#endif
-@@ -725,7 +773,7 @@ static void sata_dwc_dma_xfer_complete(struct ata_port *ap, u32 check_status)
+@@ -725,7 +773,7 @@ static void sata_dwc_dma_xfer_complete(s
dev_err(ap->dev,
"%s DMA protocol RX and TX DMA not pending dmacr: 0x%08x\n",
__func__,
@@ -544,7 +542,7 @@ index 9020349..00c2af1 100644
}
hsdevp->dma_pending[tag] = SATA_DWC_DMA_PENDING_NONE;
-@@ -742,8 +790,9 @@ static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc,
+@@ -742,8 +790,9 @@ static int sata_dwc_qc_complete(struct a
u8 status = 0;
u32 mask = 0x0;
u8 tag = qc->tag;
@@ -555,7 +553,7 @@ index 9020349..00c2af1 100644
dev_dbg(ap->dev, "%s checkstatus? %x\n", __func__, check_status);
if (hsdevp->dma_pending[tag] == SATA_DWC_DMA_PENDING_TX)
-@@ -756,10 +805,8 @@ static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc,
+@@ -756,10 +805,8 @@ static int sata_dwc_qc_complete(struct a
/* clear active bit */
mask = (~(qcmd_tag_to_mask(tag)));
@@ -568,7 +566,7 @@ index 9020349..00c2af1 100644
ata_qc_complete(qc);
return 0;
}
-@@ -767,54 +814,62 @@ static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc,
+@@ -767,54 +814,62 @@ static int sata_dwc_qc_complete(struct a
static void sata_dwc_enable_interrupts(struct sata_dwc_device *hsdev)
{
/* Enable selective interrupts by setting the interrupt maskregister*/
@@ -621,18 +619,18 @@ index 9020349..00c2af1 100644
+ port->lbal_addr = base + 0x0c;
+ port->lbam_addr = base + 0x10;
+ port->lbah_addr = base + 0x14;
-
-- port->error_addr = (void __iomem *)base + 0x04;
-- port->feature_addr = (void __iomem *)base + 0x04;
++
+ port->device_addr = base + 0x18;
+ port->command_addr = base + 0x1c;
+ port->status_addr = base + 0x1c;
-- port->nsect_addr = (void __iomem *)base + 0x08;
+- port->error_addr = (void __iomem *)base + 0x04;
+- port->feature_addr = (void __iomem *)base + 0x04;
+ port->altstatus_addr = base + 0x20;
+ port->ctl_addr = base + 0x20;
+}
-+
+
+- port->nsect_addr = (void __iomem *)base + 0x08;
+static int sata_dwc_dma_get_channel(struct sata_dwc_device_port *hsdevp)
+{
+ struct sata_dwc_device *hsdev = hsdevp->hsdev;
@@ -662,7 +660,7 @@ index 9020349..00c2af1 100644
}
/*
-@@ -829,7 +884,6 @@ static int sata_dwc_port_start(struct ata_port *ap)
+@@ -829,7 +884,6 @@ static int sata_dwc_port_start(struct at
struct sata_dwc_device *hsdev;
struct sata_dwc_device_port *hsdevp = NULL;
struct device *pdev;
@@ -670,7 +668,7 @@ index 9020349..00c2af1 100644
int i;
hsdev = HSDEV_FROM_AP(ap);
-@@ -853,20 +907,13 @@ static int sata_dwc_port_start(struct ata_port *ap)
+@@ -853,20 +907,13 @@ static int sata_dwc_port_start(struct at
}
hsdevp->hsdev = hsdev;
@@ -696,7 +694,7 @@ index 9020349..00c2af1 100644
for (i = 0; i < SATA_DWC_QCMD_MAX; i++)
hsdevp->cmd_issued[i] = SATA_DWC_CMD_ISSUED_NOT;
-@@ -877,18 +924,18 @@ static int sata_dwc_port_start(struct ata_port *ap)
+@@ -877,18 +924,18 @@ static int sata_dwc_port_start(struct at
if (ap->port_no == 0) {
dev_dbg(ap->dev, "%s: clearing TXCHEN, RXCHEN in DMAC\n",
__func__);
@@ -736,7 +734,7 @@ index 9020349..00c2af1 100644
kfree(hsdevp);
ap->private_data = NULL;
-@@ -924,22 +973,20 @@ static void sata_dwc_exec_command_by_tag(struct ata_port *ap,
+@@ -924,22 +973,20 @@ static void sata_dwc_exec_command_by_tag
struct ata_taskfile *tf,
u8 tag, u32 cmd_issued)
{
@@ -761,7 +759,7 @@ index 9020349..00c2af1 100644
ata_sff_exec_command(ap, tf);
}
-@@ -992,18 +1039,18 @@ static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag)
+@@ -992,18 +1039,18 @@ static void sata_dwc_bmdma_start_by_tag(
sata_dwc_tf_dump(ap, &qc->tf);
if (start_dma) {
@@ -785,7 +783,7 @@ index 9020349..00c2af1 100644
/* Enable AHB DMA transfer on the specified channel */
dmaengine_submit(desc);
-@@ -1025,36 +1072,12 @@ static void sata_dwc_bmdma_start(struct ata_queued_cmd *qc)
+@@ -1025,36 +1072,12 @@ static void sata_dwc_bmdma_start(struct
sata_dwc_bmdma_start_by_tag(qc, tag);
}
@@ -823,7 +821,7 @@ index 9020349..00c2af1 100644
#ifdef DEBUG_NCQ
if (qc->tag > 0 || ap->link.sactive > 1)
-@@ -1068,47 +1091,33 @@ static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc)
+@@ -1068,47 +1091,33 @@ static unsigned int sata_dwc_qc_issue(st
if (!ata_is_ncq(qc->tf.protocol))
tag = 0;
@@ -883,7 +881,7 @@ index 9020349..00c2af1 100644
static void sata_dwc_error_handler(struct ata_port *ap)
{
ata_sff_error_handler(ap);
-@@ -1125,17 +1134,22 @@ static int sata_dwc_hardreset(struct ata_link *link, unsigned int *class,
+@@ -1125,17 +1134,22 @@ static int sata_dwc_hardreset(struct ata
sata_dwc_enable_interrupts(hsdev);
/* Reconfigure the DMA control register */
@@ -911,7 +909,7 @@ index 9020349..00c2af1 100644
/*
* scsi mid-layer and libata interface structures
*/
-@@ -1148,7 +1162,13 @@ static struct scsi_host_template sata_dwc_sht = {
+@@ -1148,7 +1162,13 @@ static struct scsi_host_template sata_dw
*/
.sg_tablesize = LIBATA_MAX_PRD,
/* .can_queue = ATA_MAX_QUEUE, */
@@ -926,7 +924,7 @@ index 9020349..00c2af1 100644
};
static struct ata_port_operations sata_dwc_ops = {
-@@ -1157,7 +1177,6 @@ static struct ata_port_operations sata_dwc_ops = {
+@@ -1157,7 +1177,6 @@ static struct ata_port_operations sata_d
.error_handler = sata_dwc_error_handler,
.hardreset = sata_dwc_hardreset,
@@ -934,7 +932,7 @@ index 9020349..00c2af1 100644
.qc_issue = sata_dwc_qc_issue,
.scr_read = sata_dwc_scr_read,
-@@ -1166,6 +1185,8 @@ static struct ata_port_operations sata_dwc_ops = {
+@@ -1166,6 +1185,8 @@ static struct ata_port_operations sata_d
.port_start = sata_dwc_port_start,
.port_stop = sata_dwc_port_stop,
@@ -943,7 +941,7 @@ index 9020349..00c2af1 100644
.bmdma_setup = sata_dwc_bmdma_setup,
.bmdma_start = sata_dwc_bmdma_start,
};
-@@ -1184,13 +1205,14 @@ static int sata_dwc_probe(struct platform_device *ofdev)
+@@ -1184,13 +1205,14 @@ static int sata_dwc_probe(struct platfor
struct sata_dwc_device *hsdev;
u32 idr, versionr;
char *ver = (char *)&versionr;
@@ -959,7 +957,7 @@ index 9020349..00c2af1 100644
/* Allocate DWC SATA device */
host = ata_host_alloc_pinfo(&ofdev->dev, ppi, SATA_DWC_MAX_PORTS);
-@@ -1201,57 +1223,33 @@ static int sata_dwc_probe(struct platform_device *ofdev)
+@@ -1201,57 +1223,33 @@ static int sata_dwc_probe(struct platfor
host->private_data = hsdev;
/* Ioremap SATA registers */
@@ -1026,7 +1024,7 @@ index 9020349..00c2af1 100644
/* Enable SATA Interrupts */
sata_dwc_enable_interrupts(hsdev);
-@@ -1263,6 +1261,25 @@ static int sata_dwc_probe(struct platform_device *ofdev)
+@@ -1263,6 +1261,25 @@ static int sata_dwc_probe(struct platfor
goto error_out;
}
@@ -1052,7 +1050,7 @@ index 9020349..00c2af1 100644
/*
* Now, register with libATA core, this will also initiate the
* device discovery process, invoking our port_start() handler &
-@@ -1276,12 +1293,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
+@@ -1276,12 +1293,7 @@ static int sata_dwc_probe(struct platfor
return 0;
error_out:
@@ -1066,7 +1064,7 @@ index 9020349..00c2af1 100644
return err;
}
-@@ -1293,11 +1305,13 @@ static int sata_dwc_remove(struct platform_device *ofdev)
+@@ -1293,11 +1305,13 @@ static int sata_dwc_remove(struct platfo
ata_host_detach(host);
@@ -1083,6 +1081,3 @@ index 9020349..00c2af1 100644
dev_dbg(&ofdev->dev, "done\n");
return 0;
}
---
-2.8.1
-
diff --git a/target/linux/apm821xx/patches-4.4/030-usb-dwc2-endian-fix.patch b/target/linux/apm821xx/patches-4.4/030-usb-dwc2-endian-fix.patch
deleted file mode 100644
index 9078b6c351..0000000000
--- a/target/linux/apm821xx/patches-4.4/030-usb-dwc2-endian-fix.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From: Arnd Bergmann <arnd@arndb.de>
-Subject: [PATCH v4] usb: dwc2: fix regression on big-endian PowerPC/ARM systems
-Date: Fri, 13 May 2016 15:52:27 +0200
-Message-Id: <1463147559-544140-1-git-send-email-arnd@arndb.de>
-
-A patch that went into Linux-4.4 to fix big-endian mode on a Lantiq
-MIPS system unfortunately broke big-endian operation on PowerPC
-APM82181 as reported by Christian Lamparter, and likely other
-systems.
-
-It actually introduced multiple issues:
-
-- it broke big-endian ARM kernels: any machine that was working
- correctly with a little-endian kernel is no longer using byteswaps
- on big-endian kernels, which clearly breaks them.
-- On PowerPC the same thing must be true: if it was working before,
- using big-endian kernels is now broken. Unlike ARM, 32-bit PowerPC
- usually uses big-endian kernels, so they are likely all broken.
-- The barrier for dwc2_writel is on the wrong side of the __raw_writel(),
- so the MMIO no longer synchronizes with DMA operations.
-- On architectures that require specific CPU instructions for MMIO
- access, using the __raw_ variant may turn this into a pointer
- dereference that does not have the same effect as the readl/writel.
-
-This patch is a simple revert for all architectures other than MIPS,
-in the hope that we can more easily backport it to fix the regression
-on PowerPC and ARM systems without breaking the Lantiq system again.
-
-We should follow this up with a more elaborate change to add runtime
-detection of endianness, to make sure it also works on all other
-combinations of architectures and implementations of the usb-dwc2
-device. That patch however will be fairly large and not appropriate
-for backports to stable kernels.
-
-Felipe suggested a different approach, using an endianness switching
-register to always put the device into LE mode, but unfortunately
-the dwc2 hardware does not provide a generic way to do that. Also,
-I see no practical way of addressing the problem more generally by
-patching architecture specific code on MIPS.
-
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Fixes: 95c8bc360944 ("usb: dwc2: Use platform endianness when accessing registers")
----
- drivers/usb/dwc2/core.h | 27 +++++++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
-
-diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
-index 3c58d633ce80..dec0b21fc626 100644
---- a/drivers/usb/dwc2/core.h
-+++ b/drivers/usb/dwc2/core.h
-@@ -64,6 +64,17 @@
- DWC2_TRACE_SCHEDULER_VB(pr_fmt("%s: SCH: " fmt), \
- dev_name(hsotg->dev), ##__VA_ARGS__)
-
-+#ifdef CONFIG_MIPS
-+/*
-+ * There are some MIPS machines that can run in either big-endian
-+ * or little-endian mode and that use the dwc2 register without
-+ * a byteswap in both ways.
-+ * Unlike other architectures, MIPS apparently does not require a
-+ * barrier before the __raw_writel() to synchronize with DMA but does
-+ * require the barrier after the __raw_writel() to serialize a set of
-+ * writes. This set of operations was added specifically for MIPS and
-+ * should only be used there.
-+ */
- static inline u32 dwc2_readl(const void __iomem *addr)
- {
- u32 value = __raw_readl(addr);
-@@ -90,6 +101,22 @@ static inline void dwc2_writel(u32 value, void __iomem *addr)
- pr_info("INFO:: wrote %08x to %p\n", value, addr);
- #endif
- }
-+#else
-+/* Normal architectures just use readl/write */
-+static inline u32 dwc2_readl(const void __iomem *addr)
-+{
-+ return readl(addr);
-+}
-+
-+static inline void dwc2_writel(u32 value, void __iomem *addr)
-+{
-+ writel(value, addr);
-+
-+#ifdef DWC2_LOG_WRITES
-+ pr_info("info:: wrote %08x to %p\n", value, addr);
-+#endif
-+}
-+#endif
-
- /* Maximum number of Endpoints/HostChannels */
- #define MAX_EPS_CHANNELS 16
---
-2.7.0
-
-
diff --git a/target/linux/apm821xx/patches-4.4/200-add-meraki-mr24-ikarem-support.patch b/target/linux/apm821xx/patches-4.4/200-add-meraki-mr24-ikarem-support.patch
index 45892f272f..018bcf21a0 100644
--- a/target/linux/apm821xx/patches-4.4/200-add-meraki-mr24-ikarem-support.patch
+++ b/target/linux/apm821xx/patches-4.4/200-add-meraki-mr24-ikarem-support.patch
@@ -3,7 +3,7 @@
@@ -40,6 +40,19 @@ config EBONY
help
This option enables support for the IBM PPC440GP evaluation board.
-
+
+config IKAREM
+ bool "Ikarem"
+ depends on 44x
@@ -29,3 +29,4 @@
+ "meraki,ikarem",
"mosaixtech,icon"
};
+
diff --git a/target/linux/apm821xx/patches-4.4/201-add-amcc-apollo3g-support.patch b/target/linux/apm821xx/patches-4.4/201-add-amcc-apollo3g-support.patch
index 8dc09243bf..0581a43e33 100644
--- a/target/linux/apm821xx/patches-4.4/201-add-amcc-apollo3g-support.patch
+++ b/target/linux/apm821xx/patches-4.4/201-add-amcc-apollo3g-support.patch
@@ -1,5 +1,5 @@
---- a/arch/powerpc/platforms/44x/Kconfig 2016-05-21 23:02:29.933525903 +0200
-+++ b/arch/powerpc/platforms/44x/Kconfig 2016-05-21 23:06:50.843908233 +0200
+--- a/arch/powerpc/platforms/44x/Kconfig
++++ b/arch/powerpc/platforms/44x/Kconfig
@@ -143,6 +143,17 @@ config CANYONLANDS
help
This option enables support for the AMCC PPC460EX evaluation board.
@@ -18,8 +18,8 @@
config GLACIER
bool "Glacier"
depends on 44x
---- a/arch/powerpc/platforms/44x/ppc44x_simple.c 2016-05-21 23:02:29.933525903 +0200
-+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c 2016-05-21 23:06:01.130502053 +0200
+--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
++++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
@@ -50,6 +50,7 @@ machine_device_initcall(ppc44x_simple, p
* board.c file for it rather than adding it to this list.
*/
diff --git a/target/linux/apm821xx/patches-4.4/202-add-netgear-wndr4700-support.patch b/target/linux/apm821xx/patches-4.4/202-add-netgear-wndr4700-support.patch
index 81531915ba..6b6db1dddb 100644
--- a/target/linux/apm821xx/patches-4.4/202-add-netgear-wndr4700-support.patch
+++ b/target/linux/apm821xx/patches-4.4/202-add-netgear-wndr4700-support.patch
@@ -1,5 +1,5 @@
---- a/arch/powerpc/platforms/44x/Makefile 2016-05-31 19:28:28.825973250 +0200
-+++ b/arch/powerpc/platforms/44x/Makefile 2016-05-31 19:28:22.135960329 +0200
+--- a/arch/powerpc/platforms/44x/Makefile
++++ b/arch/powerpc/platforms/44x/Makefile
@@ -3,6 +3,7 @@ ifneq ($(CONFIG_PPC4xx_CPM),y)
obj-$(CONFIG_44x) += idle.o
endif
@@ -8,8 +8,8 @@
obj-$(CONFIG_EBONY) += ebony.o
obj-$(CONFIG_SAM440EP) += sam440ep.o
obj-$(CONFIG_WARP) += warp.o
---- a/arch/powerpc/platforms/44x/Kconfig 2016-05-31 19:33:57.049940191 +0200
-+++ b/arch/powerpc/platforms/44x/Kconfig 2016-05-31 19:30:01.699485861 +0200
+--- a/arch/powerpc/platforms/44x/Kconfig
++++ b/arch/powerpc/platforms/44x/Kconfig
@@ -260,6 +260,19 @@ config ICON
help
This option enables support for the AMCC PPC440SPe evaluation board.
diff --git a/target/linux/apm821xx/patches-4.4/300-fix-atheros-nics-on-apm82181.patch b/target/linux/apm821xx/patches-4.4/300-fix-atheros-nics-on-apm82181.patch
index b9e5fb07c6..0b1affcfe7 100644
--- a/target/linux/apm821xx/patches-4.4/300-fix-atheros-nics-on-apm82181.patch
+++ b/target/linux/apm821xx/patches-4.4/300-fix-atheros-nics-on-apm82181.patch
@@ -1,5 +1,5 @@
---- a/arch/powerpc/sysdev/ppc4xx_pci.c 2016-05-30 17:23:34.543707092 +0200
-+++ b/arch/powerpc/sysdev/ppc4xx_pci.c 2016-05-30 17:31:02.497707885 +0200
+--- a/arch/powerpc/sysdev/ppc4xx_pci.c
++++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1066,15 +1066,24 @@ static int __init apm821xx_pciex_init_po
u32 val;
diff --git a/target/linux/apm821xx/patches-4.4/301-fix-memory-map-wndr4700.patch b/target/linux/apm821xx/patches-4.4/301-fix-memory-map-wndr4700.patch
index b44f8bba8a..d6a1006177 100644
--- a/target/linux/apm821xx/patches-4.4/301-fix-memory-map-wndr4700.patch
+++ b/target/linux/apm821xx/patches-4.4/301-fix-memory-map-wndr4700.patch
@@ -1,5 +1,5 @@
---- a/arch/powerpc/sysdev/ppc4xx_pci.c 2016-05-30 17:57:30.125498459 +0200
-+++ b/arch/powerpc/sysdev/ppc4xx_pci.c 2016-05-30 18:00:39.236007798 +0200
+--- a/arch/powerpc/sysdev/ppc4xx_pci.c
++++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1913,9 +1913,9 @@ static void __init ppc4xx_configure_pcie
* if it works
*/
diff --git a/target/linux/apm821xx/patches-4.4/701-powerpc_ibm_apm82181_phyclk_fix.patch b/target/linux/apm821xx/patches-4.4/701-powerpc_ibm_apm82181_phyclk_fix.patch
index ec9de179a4..011e785e99 100644
--- a/target/linux/apm821xx/patches-4.4/701-powerpc_ibm_apm82181_phyclk_fix.patch
+++ b/target/linux/apm821xx/patches-4.4/701-powerpc_ibm_apm82181_phyclk_fix.patch
@@ -1,8 +1,6 @@
-diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
-index 5d7db6c..01bed2e 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
-@@ -129,6 +129,7 @@ static inline void emac_report_timeout_error(struct emac_instance *dev,
+@@ -129,6 +129,7 @@ static inline void emac_report_timeout_e
{
if (emac_has_feature(dev, EMAC_FTR_440GX_PHY_CLK_FIX |
EMAC_FTR_460EX_PHY_CLK_FIX |
@@ -10,7 +8,7 @@ index 5d7db6c..01bed2e 100644
EMAC_FTR_440EP_PHY_CLK_FIX))
DBG(dev, "%s" NL, error);
else if (net_ratelimit())
-@@ -146,6 +147,10 @@ static inline void emac_rx_clk_tx(struct emac_instance *dev)
+@@ -146,6 +147,10 @@ static inline void emac_rx_clk_tx(struct
if (emac_has_feature(dev, EMAC_FTR_440EP_PHY_CLK_FIX))
dcri_clrset(SDR0, SDR0_MFR,
0, SDR0_MFR_ECS >> dev->cell_index);
@@ -21,7 +19,7 @@ index 5d7db6c..01bed2e 100644
#endif
}
-@@ -155,6 +160,10 @@ static inline void emac_rx_clk_default(struct emac_instance *dev)
+@@ -155,6 +160,10 @@ static inline void emac_rx_clk_default(s
if (emac_has_feature(dev, EMAC_FTR_440EP_PHY_CLK_FIX))
dcri_clrset(SDR0, SDR0_MFR,
SDR0_MFR_ECS >> dev->cell_index, 0);
@@ -32,7 +30,7 @@ index 5d7db6c..01bed2e 100644
#endif
}
-@@ -2587,7 +2596,7 @@ static int emac_init_config(struct emac_instance *dev)
+@@ -2587,7 +2596,7 @@ static int emac_init_config(struct emac_
if (of_device_is_compatible(np, "ibm,emac-apm821xx")) {
dev->features |= (EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE |
EMAC_FTR_APM821XX_NO_HALF_DUPLEX |
@@ -41,8 +39,6 @@ index 5d7db6c..01bed2e 100644
}
} else if (of_device_is_compatible(np, "ibm,emac4")) {
dev->features |= EMAC_FTR_EMAC4;
-diff --git a/drivers/net/ethernet/ibm/emac/core.h b/drivers/net/ethernet/ibm/emac/core.h
-index 93ae114..072176a 100644
--- a/drivers/net/ethernet/ibm/emac/core.h
+++ b/drivers/net/ethernet/ibm/emac/core.h
@@ -333,6 +333,8 @@ struct emac_instance {
diff --git a/target/linux/apm821xx/patches-4.4/702-powerpc_ibm_phy_add_dt_parser.patch b/target/linux/apm821xx/patches-4.4/702-powerpc_ibm_phy_add_dt_parser.patch
index a1ca7c610e..c84e761ed0 100644
--- a/target/linux/apm821xx/patches-4.4/702-powerpc_ibm_phy_add_dt_parser.patch
+++ b/target/linux/apm821xx/patches-4.4/702-powerpc_ibm_phy_add_dt_parser.patch
@@ -8,8 +8,6 @@ Subject: [PATCH] phy device tree support for emac
drivers/net/ethernet/ibm/emac/core.h | 4 +
2 files changed, 265 insertions(+)
-diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
-index 4c9771d..5a8a26c 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -42,6 +42,7 @@
@@ -20,7 +18,7 @@ index 4c9771d..5a8a26c 100644
#include <linux/slab.h>
#include <asm/processor.h>
-@@ -2383,6 +2384,246 @@ static int emac_read_uint_prop(struct device_node *np, const char *name,
+@@ -2392,6 +2393,246 @@ static int emac_read_uint_prop(struct de
return 0;
}
@@ -267,7 +265,7 @@ index 4c9771d..5a8a26c 100644
static int emac_init_phy(struct emac_instance *dev)
{
struct device_node *np = dev->ofdev->dev.of_node;
-@@ -2453,6 +2694,18 @@ static int emac_init_phy(struct emac_instance *dev)
+@@ -2462,6 +2703,18 @@ static int emac_init_phy(struct emac_ins
emac_configure(dev);
@@ -286,7 +284,7 @@ index 4c9771d..5a8a26c 100644
if (dev->phy_address != 0xffffffff)
phy_map = ~(1 << dev->phy_address);
-@@ -2480,6 +2733,7 @@ static int emac_init_phy(struct emac_instance *dev)
+@@ -2489,6 +2742,7 @@ static int emac_init_phy(struct emac_ins
return -ENXIO;
}
@@ -294,7 +292,7 @@ index 4c9771d..5a8a26c 100644
/* Init PHY */
if (dev->phy.def->ops->init)
dev->phy.def->ops->init(&dev->phy);
-@@ -2898,6 +3152,8 @@ static int emac_probe(struct platform_device *ofdev)
+@@ -2907,6 +3161,8 @@ static int emac_probe(struct platform_de
/* I have a bad feeling about this ... */
err_detach_tah:
@@ -303,7 +301,7 @@ index 4c9771d..5a8a26c 100644
if (emac_has_feature(dev, EMAC_FTR_HAS_TAH))
tah_detach(dev->tah_dev, dev->tah_port);
err_detach_rgmii:
-@@ -2948,6 +3204,11 @@ static int emac_remove(struct platform_device *ofdev)
+@@ -2957,6 +3213,11 @@ static int emac_remove(struct platform_d
if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII))
zmii_detach(dev->zmii_dev, dev->zmii_port);
@@ -315,8 +313,6 @@ index 4c9771d..5a8a26c 100644
busy_phy_map &= ~(1 << dev->phy.address);
DBG(dev, "busy_phy_map now %#x" NL, busy_phy_map);
-diff --git a/drivers/net/ethernet/ibm/emac/core.h b/drivers/net/ethernet/ibm/emac/core.h
-index 93ae114..0710a66 100644
--- a/drivers/net/ethernet/ibm/emac/core.h
+++ b/drivers/net/ethernet/ibm/emac/core.h
@@ -199,6 +199,10 @@ struct emac_instance {
@@ -330,6 +326,3 @@ index 93ae114..0710a66 100644
/* ZMII infos if any */
u32 zmii_ph;
u32 zmii_port;
---
-2.1.4
-
diff --git a/target/linux/apm821xx/patches-4.4/800-usb-dwc2-add-wndr4700-otg.patch b/target/linux/apm821xx/patches-4.4/800-usb-dwc2-add-wndr4700-otg.patch
index 24d267ef4a..eee3fd06ec 100644
--- a/target/linux/apm821xx/patches-4.4/800-usb-dwc2-add-wndr4700-otg.patch
+++ b/target/linux/apm821xx/patches-4.4/800-usb-dwc2-add-wndr4700-otg.patch
@@ -1,5 +1,5 @@
---- a/drivers/usb/dwc2/platform.c 2016-05-26 21:39:41.347838639 +0200
-+++ b/drivers/usb/dwc2/platform.c 2016-05-26 21:44:01.554907417 +0200
+--- a/drivers/usb/dwc2/platform.c
++++ b/drivers/usb/dwc2/platform.c
@@ -115,6 +115,37 @@ static const struct dwc2_core_params par
.hibernation = -1,
};
diff --git a/target/linux/apm821xx/patches-4.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
index e56e95576d..dec3da3e07 100644
--- a/target/linux/apm821xx/patches-4.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
+++ b/target/linux/apm821xx/patches-4.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
@@ -33,8 +33,6 @@ Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
drivers/usb/host/xhci-pci.c | 492 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 492 insertions(+)
-diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
-index 48672fa..328c891 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -24,6 +24,8 @@
@@ -46,7 +44,7 @@ index 48672fa..328c891 100644
#include "xhci.h"
#include "xhci-trace.h"
-@@ -207,6 +209,458 @@ static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev)
+@@ -209,6 +211,458 @@ static void xhci_pme_acpi_rtd3_enable(st
static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
#endif /* CONFIG_ACPI */
@@ -505,7 +503,7 @@ index 48672fa..328c891 100644
/* called during probe() after chip reset completes */
static int xhci_pci_setup(struct usb_hcd *hcd)
{
-@@ -246,6 +700,22 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+@@ -248,6 +702,22 @@ static int xhci_pci_probe(struct pci_dev
struct hc_driver *driver;
struct usb_hcd *hcd;
@@ -528,7 +526,7 @@ index 48672fa..328c891 100644
driver = (struct hc_driver *)id->driver_data;
/* Prevent runtime suspending between USB-2 and USB-3 initialization */
-@@ -303,6 +773,16 @@ static void xhci_pci_remove(struct pci_dev *dev)
+@@ -305,6 +775,16 @@ static void xhci_pci_remove(struct pci_d
{
struct xhci_hcd *xhci;
@@ -545,6 +543,3 @@ index 48672fa..328c891 100644
xhci = hcd_to_xhci(pci_get_drvdata(dev));
xhci->xhc_state |= XHCI_STATE_REMOVING;
if (xhci->shared_hcd) {
---
-2.8.1
-
diff --git a/target/linux/apm821xx/patches-4.4/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.4/802-usb-xhci-force-msi-renesas-xhci.patch
index a09e9dc41c..465faef2dc 100644
--- a/target/linux/apm821xx/patches-4.4/802-usb-xhci-force-msi-renesas-xhci.patch
+++ b/target/linux/apm821xx/patches-4.4/802-usb-xhci-force-msi-renesas-xhci.patch
@@ -11,11 +11,9 @@ produce a noisy warning.
drivers/usb/host/pci-quirks.c | 362 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 362 insertions(+)
-diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
-index 1c4d89e..555bd3f 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
-@@ -172,7 +172,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
+@@ -176,7 +176,7 @@ static void xhci_pci_quirks(struct devic
}
if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
pdev->device == 0x0015)
@@ -24,11 +22,9 @@ index 1c4d89e..555bd3f 100644
if (pdev->vendor == PCI_VENDOR_ID_VIA)
xhci->quirks |= XHCI_RESET_ON_RESUME;
-diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
-index 9e71c96..27cfcb9 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
-@@ -389,10 +389,14 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
+@@ -388,10 +388,14 @@ static int xhci_try_enable_msi(struct us
free_irq(hcd->irq, hcd);
hcd->irq = 0;
@@ -46,12 +42,13 @@ index 9e71c96..27cfcb9 100644
if (!ret)
/* hcd->irq is 0, we have MSI */
-diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
-index 6b085aa..514dc3f 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
-@@ -1649,3 +1649,4 @@ struct xhci_hcd {
- #define XHCI_BROKEN_STREAMS (1 << 19)
- #define XHCI_PME_STUCK_QUIRK (1 << 20)
+@@ -1648,6 +1648,7 @@ struct xhci_hcd {
+ /* support xHCI 0.96 spec USB2 software LPM */
+ unsigned sw_lpm_support:1;
+ /* support xHCI 1.0 spec USB2 hardware LPM */
+#define XHCI_FORCE_MSI (1 << 24)
- unsigned int num_active_eps;
+ unsigned hw_lpm_support:1;
+ /* cached usb2 extened protocol capabilites */
+ u32 *ext_caps;
diff --git a/target/linux/apm821xx/patches-4.4/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch b/target/linux/apm821xx/patches-4.4/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch
index 53b9bdbc17..8c27dd13fb 100644
--- a/target/linux/apm821xx/patches-4.4/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch
+++ b/target/linux/apm821xx/patches-4.4/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch
@@ -24,11 +24,9 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 files changed, 980 insertions(+)
create mode 100644 drivers/hwmon/tc654.c
-diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
-index ff94007..941fe4951 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
-@@ -1514,6 +1514,16 @@ config SENSORS_INA2XX
+@@ -1493,6 +1493,16 @@ config SENSORS_INA2XX
This driver can also be built as a module. If so, the module
will be called ina2xx.
@@ -45,11 +43,9 @@ index ff94007..941fe4951 100644
config SENSORS_TC74
tristate "Microchip TC74"
depends on I2C
-diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
-index 2ef5b7c..04270c7 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
-@@ -145,6 +145,7 @@ obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
+@@ -143,6 +143,7 @@ obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc4
obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o
obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o
obj-$(CONFIG_SENSORS_AMC6821) += amc6821.o
@@ -57,9 +53,6 @@ index 2ef5b7c..04270c7 100644
obj-$(CONFIG_SENSORS_TC74) += tc74.o
obj-$(CONFIG_SENSORS_THMC50) += thmc50.o
obj-$(CONFIG_SENSORS_TMP102) += tmp102.o
-diff --git a/drivers/hwmon/tc654.c b/drivers/hwmon/tc654.c
-new file mode 100644
-index 0000000..d584baf
--- /dev/null
+++ b/drivers/hwmon/tc654.c
@@ -0,0 +1,969 @@
@@ -1032,6 +1025,3 @@ index 0000000..d584baf
+MODULE_AUTHOR("Christian Lamparter <chunkeey@gmail.com>");
+MODULE_DESCRIPTION("Microchip TC654/TC655 hwmon driver");
+MODULE_LICENSE("GPL");
---
-2.8.1
-
diff --git a/target/linux/apm821xx/patches-4.4/911-hwmon-lm90-split-set-and-show-temp-as-common-codes.patch b/target/linux/apm821xx/patches-4.4/911-hwmon-lm90-split-set-and-show-temp-as-common-codes.patch
index a2e38c5c74..e450f9045f 100644
--- a/target/linux/apm821xx/patches-4.4/911-hwmon-lm90-split-set-and-show-temp-as-common-codes.patch
+++ b/target/linux/apm821xx/patches-4.4/911-hwmon-lm90-split-set-and-show-temp-as-common-codes.patch
@@ -26,11 +26,9 @@ Reviewed-on: https://chromium-review.googlesource.com/212413
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Queue: Olof Johansson <olofj@chromium.org>
---
-diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
-index c9ff08d..fb9e224 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
-@@ -473,20 +473,29 @@
+@@ -473,20 +473,29 @@ static int lm90_read16(struct i2c_client
* various registers have different meanings as a result of selecting a
* non-default remote channel.
*/
@@ -65,7 +63,7 @@ index c9ff08d..fb9e224 100644
}
/*
-@@ -759,29 +768,34 @@
+@@ -759,29 +768,34 @@ static u16 temp_to_u16_adt7461(struct lm
* Sysfs stuff
*/
@@ -110,7 +108,7 @@ index c9ff08d..fb9e224 100644
{
static const u8 reg[TEMP8_REG_NUM] = {
LM90_REG_W_LOCAL_LOW,
-@@ -794,10 +808,37 @@
+@@ -794,60 +808,79 @@ static ssize_t set_temp8(struct device *
MAX6659_REG_W_REMOTE_EMERG,
};
@@ -118,26 +116,39 @@ index c9ff08d..fb9e224 100644
struct lm90_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
- int nr = attr->index;
-+ int err;
-+
-+ /* +16 degrees offset for temp2 for the LM99 */
+- long val;
+ int err;
+
+- err = kstrtol(buf, 10, &val);
+- if (err < 0)
+- return err;
+-
+ /* +16 degrees offset for temp2 for the LM99 */
+- if (data->kind == lm99 && attr->index == 3)
+ if (data->kind == lm99 && index == 3)
-+ val -= 16000;
-+
-+ mutex_lock(&data->update_lock);
-+ if (data->kind == adt7461 || data->kind == tmp451)
+ val -= 16000;
+
+ mutex_lock(&data->update_lock);
+ if (data->kind == adt7461 || data->kind == tmp451)
+- data->temp8[nr] = temp_to_u8_adt7461(data, val);
+ data->temp8[index] = temp_to_u8_adt7461(data, val);
-+ else if (data->kind == max6646)
+ else if (data->kind == max6646)
+- data->temp8[nr] = temp_to_u8(val);
+ data->temp8[index] = temp_to_u8(val);
-+ else
+ else
+- data->temp8[nr] = temp_to_s8(val);
+-
+- lm90_select_remote_channel(client, data, nr >= 6);
+- i2c_smbus_write_byte_data(client, reg[nr], data->temp8[nr]);
+- lm90_select_remote_channel(client, data, 0);
+ data->temp8[index] = temp_to_s8(val);
-+
+
+ if ((err = lm90_select_remote_channel(client, data, index >= 6)) ||
+ (err = i2c_smbus_write_byte_data(client, reg[index],
+ data->temp8[index])) ||
+ (err = lm90_select_remote_channel(client, data, 0)))
+ dev_err(dev, "write_temp8 failed, err %d\n", err);
-+ mutex_unlock(&data->update_lock);
+ mutex_unlock(&data->update_lock);
+
+ return err;
+}
@@ -147,84 +158,62 @@ index c9ff08d..fb9e224 100644
+{
+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+ int index = attr->index;
- long val;
- int err;
-
-@@ -805,49 +846,41 @@
- if (err < 0)
- return err;
-
-- /* +16 degrees offset for temp2 for the LM99 */
-- if (data->kind == lm99 && attr->index == 3)
-- val -= 16000;
-+ err = write_temp8(dev, index, val);
++ long val;
++ int err;
++
++ err = kstrtol(buf, 10, &val);
+ if (err < 0)
+ return err;
-
-- mutex_lock(&data->update_lock);
-- if (data->kind == adt7461 || data->kind == tmp451)
-- data->temp8[nr] = temp_to_u8_adt7461(data, val);
-- else if (data->kind == max6646)
-- data->temp8[nr] = temp_to_u8(val);
-- else
-- data->temp8[nr] = temp_to_s8(val);
--
-- lm90_select_remote_channel(client, data, nr >= 6);
-- i2c_smbus_write_byte_data(client, reg[nr], data->temp8[nr]);
-- lm90_select_remote_channel(client, data, 0);
--
-- mutex_unlock(&data->update_lock);
- return count;
-+}
-+
-+static int read_temp11(struct device *dev, int index)
-+{
-+ struct lm90_data *data = lm90_update_device(dev);
-+ int temp;
+
-+ if (data->kind == adt7461 || data->kind == tmp451)
-+ temp = temp_from_u16_adt7461(data, data->temp11[index]);
-+ else if (data->kind == max6646)
-+ temp = temp_from_u16(data->temp11[index]);
-+ else
-+ temp = temp_from_s16(data->temp11[index]);
-+
-+ /* +16 degrees offset for temp2 for the LM99 */
-+ if (data->kind == lm99 && index <= 2)
-+ temp += 16000;
++ err = write_temp8(dev, index, val);
++ if (err < 0)
++ return err;
+
-+ return temp;
+ return count;
}
- static ssize_t show_temp11(struct device *dev, struct device_attribute *devattr,
- char *buf)
+-static ssize_t show_temp11(struct device *dev, struct device_attribute *devattr,
+- char *buf)
++static int read_temp11(struct device *dev, int index)
{
- struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(devattr);
-- struct lm90_data *data = lm90_update_device(dev);
-- int temp;
+- struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(devattr);
+ struct lm90_data *data = lm90_update_device(dev);
+ int temp;
-- if (data->kind == adt7461 || data->kind == tmp451)
+ if (data->kind == adt7461 || data->kind == tmp451)
- temp = temp_from_u16_adt7461(data, data->temp11[attr->index]);
-- else if (data->kind == max6646)
++ temp = temp_from_u16_adt7461(data, data->temp11[index]);
+ else if (data->kind == max6646)
- temp = temp_from_u16(data->temp11[attr->index]);
-- else
++ temp = temp_from_u16(data->temp11[index]);
+ else
- temp = temp_from_s16(data->temp11[attr->index]);
--
-- /* +16 degrees offset for temp2 for the LM99 */
++ temp = temp_from_s16(data->temp11[index]);
+
+ /* +16 degrees offset for temp2 for the LM99 */
- if (data->kind == lm99 && attr->index <= 2)
-- temp += 16000;
--
++ if (data->kind == lm99 && index <= 2)
+ temp += 16000;
+
- return sprintf(buf, "%d\n", temp);
-+ return sprintf(buf, "%d\n", read_temp11(dev, attr->index));
++ return temp;
}
-static ssize_t set_temp11(struct device *dev, struct device_attribute *devattr,
- const char *buf, size_t count)
++static ssize_t show_temp11(struct device *dev, struct device_attribute *devattr,
++ char *buf)
++{
++ struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(devattr);
++
++ return sprintf(buf, "%d\n", read_temp11(dev, attr->index));
++}
++
+static int write_temp11(struct device *dev, int nr, int index, long val)
{
struct {
u8 high;
-@@ -861,17 +894,9 @@
+@@ -861,18 +894,10 @@ static ssize_t set_temp11(struct device
{ LM90_REG_W_REMOTE_HIGHH, LM90_REG_W_REMOTE_HIGHL, 1 }
};
@@ -235,14 +224,15 @@ index c9ff08d..fb9e224 100644
- int index = attr->index;
- long val;
int err;
--
+
- err = kstrtol(buf, 10, &val);
- if (err < 0)
- return err;
-
+-
/* +16 degrees offset for temp2 for the LM99 */
if (data->kind == lm99 && index <= 2)
-@@ -887,15 +912,50 @@
+ val -= 16000;
+@@ -887,15 +912,50 @@ static ssize_t set_temp11(struct device
else
data->temp11[index] = temp_to_s8(val) << 8;
diff --git a/target/linux/apm821xx/patches-4.4/912-hwmon-lm90-expose-to-thermal-fw-via-DT.patch b/target/linux/apm821xx/patches-4.4/912-hwmon-lm90-expose-to-thermal-fw-via-DT.patch
index fe7337b530..9eb9ceeaac 100644
--- a/target/linux/apm821xx/patches-4.4/912-hwmon-lm90-expose-to-thermal-fw-via-DT.patch
+++ b/target/linux/apm821xx/patches-4.4/912-hwmon-lm90-expose-to-thermal-fw-via-DT.patch
@@ -27,8 +27,6 @@ Tested-by: Wei Ni <wni.nvidia@gmail.com>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Queue: Olof Johansson <olofj@chromium.org>
---
-diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
-index fb9e224..c54d3c8 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -96,6 +96,8 @@
@@ -40,21 +38,21 @@ index fb9e224..c54d3c8 100644
/*
* Addresses to scan
-@@ -118,6 +120,13 @@
-
+@@ -119,6 +121,13 @@ static const unsigned short normal_i2c[]
enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680,
max6646, w83l771, max6696, sa56004, g781, tmp451 };
-+
+
+enum sensor_id {
+ LOCAL = 0,
+ REMOTE,
+ REMOTE2,
+ SENSOR_ID_END,
+};
-
++
/*
* The LM90 registers
-@@ -368,6 +377,7 @@
+ */
+@@ -368,6 +377,7 @@ struct lm90_data {
struct i2c_client *client;
struct device *hwmon_dev;
const struct attribute_group *groups[6];
@@ -62,12 +60,10 @@ index fb9e224..c54d3c8 100644
struct mutex update_lock;
struct regulator *regulator;
char valid; /* zero until following fields are valid */
-@@ -878,6 +888,24 @@
- struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(devattr);
-
+@@ -880,6 +890,24 @@ static ssize_t show_temp11(struct device
return sprintf(buf, "%d\n", read_temp11(dev, attr->index));
-+}
-+
+ }
+
+static int lm90_read_local_temp(void *dev, int *temp)
+{
+ *temp = read_temp11(dev, 4);
@@ -84,10 +80,12 @@ index fb9e224..c54d3c8 100644
+{
+ *temp = read_temp11(dev, 5);
+ return 0;
- }
-
++}
++
static int write_temp11(struct device *dev, int nr, int index, long val)
-@@ -1150,6 +1238,18 @@
+ {
+ struct {
+@@ -1210,6 +1238,18 @@ static const struct attribute_group lm90
.attrs = lm90_temp3_attributes,
};
@@ -106,7 +104,7 @@ index fb9e224..c54d3c8 100644
/* pec used for ADM1032 only */
static ssize_t show_pec(struct device *dev, struct device_attribute *dummy,
char *buf)
-@@ -1599,6 +1699,30 @@
+@@ -1659,6 +1699,30 @@ static int lm90_probe(struct i2c_client
}
}
@@ -137,7 +135,7 @@ index fb9e224..c54d3c8 100644
return 0;
exit_unregister:
-@@ -1674,8 +1726,11 @@
+@@ -1674,8 +1738,11 @@ exit_restore:
static int lm90_remove(struct i2c_client *client)
{