summaryrefslogtreecommitdiff
path: root/target/linux/atheros/patches-3.10/120-spiflash.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-06-24 18:13:27 +0000
committerJohn Crispin <john@openwrt.org>2014-06-24 18:13:27 +0000
commit08a9fcb0ef3c36102916b1d7d37d67230aa9f74e (patch)
treee814c50126380f997a188ba05d78d910696626ba /target/linux/atheros/patches-3.10/120-spiflash.patch
parent1dab970e8b30d077a9a35d0b98702e910f7cf4d7 (diff)
downloadmtk-20170518-08a9fcb0ef3c36102916b1d7d37d67230aa9f74e.zip
mtk-20170518-08a9fcb0ef3c36102916b1d7d37d67230aa9f74e.tar.gz
mtk-20170518-08a9fcb0ef3c36102916b1d7d37d67230aa9f74e.tar.bz2
atheros[ar2315-spiflash]: pass I/O mem regions via resources
Pass I/O memory regions (flash read and MMR) via platform device resources array and use them inside spiflash driver. Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> SVN-Revision: 41320
Diffstat (limited to 'target/linux/atheros/patches-3.10/120-spiflash.patch')
-rw-r--r--target/linux/atheros/patches-3.10/120-spiflash.patch19
1 files changed, 16 insertions, 3 deletions
diff --git a/target/linux/atheros/patches-3.10/120-spiflash.patch b/target/linux/atheros/patches-3.10/120-spiflash.patch
index 262af60..8630a3a 100644
--- a/target/linux/atheros/patches-3.10/120-spiflash.patch
+++ b/target/linux/atheros/patches-3.10/120-spiflash.patch
@@ -23,7 +23,7 @@
--- /dev/null
+++ b/drivers/mtd/devices/ar2315.c
-@@ -0,0 +1,527 @@
+@@ -0,0 +1,540 @@
+
+/*
+ * MTD driver for the SPI Flash Memory support on Atheros AR2315
@@ -452,6 +452,7 @@
+{
+ struct spiflash_priv *priv;
+ struct mtd_info *mtd;
++ struct resource *res;
+ int index;
+ int result = 0;
+
@@ -461,7 +462,13 @@
+ priv->state = FL_READY;
+ mtd = &priv->mtd;
+
-+ priv->mmraddr = ioremap_nocache(SPI_FLASH_MMR, SPI_FLASH_MMR_SIZE);
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
++ if (!res) {
++ dev_err(&pdev->dev, "No MMR resource found\n");
++ goto error;
++ }
++
++ priv->mmraddr = ioremap_nocache(res->start, resource_size(res));
+ if (!priv->mmraddr) {
+ dev_warn(&pdev->dev, SPIFLASH "Failed to map flash device\n");
+ goto error;
@@ -473,7 +480,13 @@
+ goto error;
+ }
+
-+ priv->readaddr = ioremap_nocache(SPI_FLASH_READ,
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_err(&pdev->dev, "No flash readmem resource found\n");
++ goto error;
++ }
++
++ priv->readaddr = ioremap_nocache(res->start,
+ flashconfig_tbl[index].byte_cnt);
+ if (!priv->readaddr) {
+ dev_warn(&pdev->dev, SPIFLASH "Failed to map flash device\n");