diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2016-11-08 11:34:38 +0100 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2016-11-08 11:36:39 +0100 |
commit | 28955d9707345d9a684ec81c711c6914c2135c42 (patch) | |
tree | 3fa1544de402a2f77ef80f524ce8e1cc2dfd0cc0 /target/linux/generic/patches-4.4/143-mtd-bcm47xxsflash-use-uncached-MMIO-access-for-BCM53.patch | |
parent | 113544dccf113a8ed47e0a91ab2f6e02343c3e82 (diff) | |
download | upstream-28955d9707345d9a684ec81c711c6914c2135c42.tar.gz upstream-28955d9707345d9a684ec81c711c6914c2135c42.tar.bz2 upstream-28955d9707345d9a684ec81c711c6914c2135c42.zip |
kernel: use upstreamed patch for BCM53573 support in bcm47xxsflash
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/patches-4.4/143-mtd-bcm47xxsflash-use-uncached-MMIO-access-for-BCM53.patch')
-rw-r--r-- | target/linux/generic/patches-4.4/143-mtd-bcm47xxsflash-use-uncached-MMIO-access-for-BCM53.patch | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/target/linux/generic/patches-4.4/143-mtd-bcm47xxsflash-use-uncached-MMIO-access-for-BCM53.patch b/target/linux/generic/patches-4.4/143-mtd-bcm47xxsflash-use-uncached-MMIO-access-for-BCM53.patch deleted file mode 100644 index 98c62caf5f..0000000000 --- a/target/linux/generic/patches-4.4/143-mtd-bcm47xxsflash-use-uncached-MMIO-access-for-BCM53.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 77fab8f7dc756ba65f37145c493cc04f17e36bea Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> -Date: Mon, 15 Aug 2016 14:13:09 +0200 -Subject: [PATCH] mtd: bcm47xxsflash: use uncached MMIO access for BCM53573 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -BCM53573 is a new series of Broadcom's SoCs. It's based on ARM and uses -this old ChipCommon-based flash access. Early tests resulted in flash -corruptions that were tracked down to using cached MMIO for flash read -access. Switch to ioremap_nocache conditionally to support BCM53573 and -don't break performance on old MIPS devices. - -Signed-off-by: Rafał Miłecki <rafal@milecki.pl> ---- - drivers/mtd/devices/bcm47xxsflash.c | 24 +++++++++++++++++++----- - 1 file changed, 19 insertions(+), 5 deletions(-) - ---- a/drivers/mtd/devices/bcm47xxsflash.c -+++ b/drivers/mtd/devices/bcm47xxsflash.c -@@ -296,16 +296,30 @@ static int bcm47xxsflash_bcma_probe(stru - dev_err(dev, "can't request region for resource %pR\n", res); - return -EBUSY; - } -- b47s->window = ioremap_cache(res->start, resource_size(res)); -- if (!b47s->window) { -- dev_err(dev, "ioremap failed for resource %pR\n", res); -- return -ENOMEM; -- } - - b47s->bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash); - b47s->cc_read = bcm47xxsflash_bcma_cc_read; - b47s->cc_write = bcm47xxsflash_bcma_cc_write; - -+ /* -+ * On old MIPS devices cache was magically invalidated when needed, -+ * allowing us to use cached access and gain some performance. Trying -+ * the same on ARM based BCM53573 results in flash corruptions, we need -+ * to use uncached access for it. -+ * -+ * It may be arch specific, but right now there is only 1 ARM SoC using -+ * this driver, so let's follow Broadcom's reference code and check -+ * ChipCommon revision. -+ */ -+ if (b47s->bcma_cc->core->id.rev == 54) -+ b47s->window = ioremap_nocache(res->start, resource_size(res)); -+ else -+ b47s->window = ioremap_cache(res->start, resource_size(res)); -+ if (!b47s->window) { -+ dev_err(dev, "ioremap failed for resource %pR\n", res); -+ return -ENOMEM; -+ } -+ - switch (b47s->bcma_cc->capabilities & BCMA_CC_CAP_FLASHT) { - case BCMA_CC_FLASHT_STSER: - b47s->type = BCM47XXSFLASH_TYPE_ST; |