Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 35873master
parent
c28cdfab31
commit
0ad50b0bec
@ -1,19 +1,23 @@ |
|||||||
From cbb3ade4765bc715b5c2eae4a7b6eaf3ff7ad958 Mon Sep 17 00:00:00 2001
|
From 486c150478777ef53cfef6f0d46840b9406b0612 Mon Sep 17 00:00:00 2001
|
||||||
From: Gabor Juhos <juhosg@openwrt.org>
|
From: Gabor Juhos <juhosg@openwrt.org>
|
||||||
Date: Wed, 11 Jan 2012 20:06:35 +0100
|
Date: Thu, 27 Dec 2012 10:42:24 +0100
|
||||||
Subject: [PATCH 28/34] spi/ath79: add delay between SCK changes
|
Subject: [PATCH] spi/ath79: add delay between SCK changes
|
||||||
|
|
||||||
|
commit 440114fdb13cbc53ea734bcc05b86bcf5b1e430c upstream.
|
||||||
|
|
||||||
The driver uses the "as fast as it can" approach
|
The driver uses the "as fast as it can" approach
|
||||||
to drive the SCK signal. However this does not
|
to drive the SCK signal. However this does not
|
||||||
work with certain low speed SPI chips (e.g. the
|
work with certain low speed SPI chips (e.g. the
|
||||||
PCF2123 RTC chip). Add per-bit slowdowns in order
|
PCF2123 RTC chip).
|
||||||
to be able to use the driver with such chips as
|
|
||||||
well.
|
The patch adds per-bit slowdowns in order to be
|
||||||
|
able to use the driver with such chips as well.
|
||||||
|
|
||||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||||
|
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
|
||||||
---
|
---
|
||||||
drivers/spi/spi-ath79.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
|
drivers/spi/spi-ath79.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
|
||||||
1 files changed, 43 insertions(+), 1 deletions(-)
|
1 file changed, 43 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
--- a/drivers/spi/spi-ath79.c
|
--- a/drivers/spi/spi-ath79.c
|
||||||
+++ b/drivers/spi/spi-ath79.c
|
+++ b/drivers/spi/spi-ath79.c
|
@ -0,0 +1,31 @@ |
|||||||
|
From c7c943b1e3813ff5764ee6417a14530cb7cd6f57 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Gabor Juhos <juhosg@openwrt.org>
|
||||||
|
Date: Thu, 27 Dec 2012 10:42:25 +0100
|
||||||
|
Subject: [PATCH] spi/ath79: add missing HIGH->LOW SCK transition
|
||||||
|
|
||||||
|
commit 72611db0eef21f4456d79ba302af4b34ea384f30 upstream.
|
||||||
|
|
||||||
|
The 'ath79_spi_txrx_mode0' function does not
|
||||||
|
set the SCK signal to LOW at the end of a word
|
||||||
|
transfer. This causes communications errors with
|
||||||
|
certain devices (e.g. the PCF2123 RTC chip).
|
||||||
|
|
||||||
|
The patch ensures that the SCK signal will be LOW.
|
||||||
|
|
||||||
|
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||||
|
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
|
||||||
|
---
|
||||||
|
drivers/spi/spi-ath79.c | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
--- a/drivers/spi/spi-ath79.c
|
||||||
|
+++ b/drivers/spi/spi-ath79.c
|
||||||
|
@@ -200,6 +200,8 @@ static u32 ath79_spi_txrx_mode0(struct s
|
||||||
|
ath79_spi_delay(sp, nsecs);
|
||||||
|
ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, out | AR71XX_SPI_IOC_CLK);
|
||||||
|
ath79_spi_delay(sp, nsecs);
|
||||||
|
+ if (bits == 1)
|
||||||
|
+ ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, out);
|
||||||
|
|
||||||
|
word <<= 1;
|
||||||
|
}
|
@ -1,14 +1,17 @@ |
|||||||
From 6bd876a46b977643f27d2cc63f49e1bc84b78134 Mon Sep 17 00:00:00 2001
|
From f0b166c931c9971f2ae9614881565d23f58b3178 Mon Sep 17 00:00:00 2001
|
||||||
From: Gabor Juhos <juhosg@openwrt.org>
|
From: Gabor Juhos <juhosg@openwrt.org>
|
||||||
Date: Mon, 9 Jan 2012 15:04:21 +0100
|
Date: Thu, 27 Dec 2012 10:42:27 +0100
|
||||||
Subject: [PATCH 31/34] spi/ath79: use gpio_request_one
|
Subject: [PATCH] spi/ath79: use gpio_request_one
|
||||||
|
|
||||||
|
commit 95d79419feffb326a3d5cb50e2248129dec06bb0 upstream.
|
||||||
|
|
||||||
Use gpio_request_one() instead of multiple gpiolib calls.
|
Use gpio_request_one() instead of multiple gpiolib calls.
|
||||||
|
|
||||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||||
|
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
|
||||||
---
|
---
|
||||||
drivers/spi/spi-ath79.c | 26 +++++++++++++-------------
|
drivers/spi/spi-ath79.c | 22 +++++++++++-----------
|
||||||
1 files changed, 13 insertions(+), 13 deletions(-)
|
1 file changed, 11 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
--- a/drivers/spi/spi-ath79.c
|
--- a/drivers/spi/spi-ath79.c
|
||||||
+++ b/drivers/spi/spi-ath79.c
|
+++ b/drivers/spi/spi-ath79.c
|
@ -0,0 +1,54 @@ |
|||||||
|
From a32b0e7851320cba0144d20e87e5326ee81e1063 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Gabor Juhos <juhosg@openwrt.org>
|
||||||
|
Date: Tue, 5 Feb 2013 20:57:55 +0100
|
||||||
|
Subject: [PATCH] spi/ath79: add shutdown handler
|
||||||
|
|
||||||
|
commit 7410e848583f9120dd5f9414629f01bb76b5ee5f upstream.
|
||||||
|
|
||||||
|
The SPI controller of the AR7xxx/AR9xxx SoCs
|
||||||
|
have a special mode which allows the SoC to
|
||||||
|
directly read data from SPI flash chips. In
|
||||||
|
this mode, the content of the SPI flash chip
|
||||||
|
can be accessed via a memory mapped region.
|
||||||
|
|
||||||
|
During early init time, the kernel expects
|
||||||
|
that the flash chip is accessible through
|
||||||
|
that memory region because it reads board
|
||||||
|
specific values (e.g. MAC address, WiFi
|
||||||
|
calibration data) from the flash on various
|
||||||
|
boards.
|
||||||
|
|
||||||
|
This is working if the kernel is loaded
|
||||||
|
directly by the bootloader because that
|
||||||
|
leaves the SPI controller in the special
|
||||||
|
mode. However it is not working in a kexec'd
|
||||||
|
kernel because the SPI driver does not restore
|
||||||
|
the special mode during shutdown.
|
||||||
|
|
||||||
|
The patch adds a shutdown handler to fix this
|
||||||
|
issue.
|
||||||
|
|
||||||
|
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||||
|
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
|
||||||
|
---
|
||||||
|
drivers/spi/spi-ath79.c | 6 ++++++
|
||||||
|
1 file changed, 6 insertions(+)
|
||||||
|
|
||||||
|
--- a/drivers/spi/spi-ath79.c
|
||||||
|
+++ b/drivers/spi/spi-ath79.c
|
||||||
|
@@ -308,9 +308,15 @@ static int ath79_spi_remove(struct platf
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void ath79_spi_shutdown(struct platform_device *pdev)
|
||||||
|
+{
|
||||||
|
+ ath79_spi_remove(pdev);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static struct platform_driver ath79_spi_driver = {
|
||||||
|
.probe = ath79_spi_probe,
|
||||||
|
.remove = ath79_spi_remove,
|
||||||
|
+ .shutdown = ath79_spi_shutdown,
|
||||||
|
.driver = {
|
||||||
|
.name = DRV_NAME,
|
||||||
|
.owner = THIS_MODULE,
|
@ -1,21 +0,0 @@ |
|||||||
From bcb0fdebc08f828b54d0a2eb74a9d1378701a8e0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Gabor Juhos <juhosg@openwrt.org>
|
|
||||||
Date: Wed, 11 Jan 2012 20:33:41 +0100
|
|
||||||
Subject: [PATCH 29/34] spi/ath79: add missing HIGH->LOW SCK transition
|
|
||||||
|
|
||||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
||||||
---
|
|
||||||
drivers/spi/spi-ath79.c | 2 ++
|
|
||||||
1 files changed, 2 insertions(+), 0 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/spi/spi-ath79.c
|
|
||||||
+++ b/drivers/spi/spi-ath79.c
|
|
||||||
@@ -200,6 +200,8 @@ static u32 ath79_spi_txrx_mode0(struct s
|
|
||||||
ath79_spi_delay(sp, nsecs);
|
|
||||||
ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, out | AR71XX_SPI_IOC_CLK);
|
|
||||||
ath79_spi_delay(sp, nsecs);
|
|
||||||
+ if (bits == 1)
|
|
||||||
+ ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, out);
|
|
||||||
|
|
||||||
word <<= 1;
|
|
||||||
}
|
|
@ -1,28 +0,0 @@ |
|||||||
From dab305def68a9ea28c1c0ca2fc20bba645944914 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Gabor Juhos <juhosg@openwrt.org>
|
|
||||||
Date: Wed, 11 Jan 2012 22:19:32 +0100
|
|
||||||
Subject: [PATCH 33/34] spi/ath79: add shutdown handler
|
|
||||||
|
|
||||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
||||||
---
|
|
||||||
drivers/spi/spi-ath79.c | 12 +++++++++++-
|
|
||||||
1 files changed, 11 insertions(+), 1 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/spi/spi-ath79.c
|
|
||||||
+++ b/drivers/spi/spi-ath79.c
|
|
||||||
@@ -308,9 +308,15 @@ static int ath79_spi_remove(struct platf
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void ath79_spi_shutdown(struct platform_device *pdev)
|
|
||||||
+{
|
|
||||||
+ ath79_spi_remove(pdev);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static struct platform_driver ath79_spi_driver = {
|
|
||||||
.probe = ath79_spi_probe,
|
|
||||||
.remove = ath79_spi_remove,
|
|
||||||
+ .shutdown = ath79_spi_shutdown,
|
|
||||||
.driver = {
|
|
||||||
.name = DRV_NAME,
|
|
||||||
.owner = THIS_MODULE,
|
|
Loading…
Reference in new issue