* [PATCH 20/23 v2] ARM: u300: add SPI PL022 to the device tree
@ 2013-05-02 9:12 Linus Walleij
[not found] ` <1367485952-6212-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2013-05-02 9:12 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown
From: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
This registers the PL022 PrimeCell from the U300 device
tree. We make a new copy of the platform data for the
device tree boot path, as the old platform data is in an
older file which will be going away.
Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
ChangeLog v1->v2:
- Add DMA channels.
---
arch/arm/boot/dts/ste-u300.dts | 11 +++++++++++
arch/arm/mach-u300/core.c | 19 +++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/arch/arm/boot/dts/ste-u300.dts b/arch/arm/boot/dts/ste-u300.dts
index 4dc9f26..46c0785 100644
--- a/arch/arm/boot/dts/ste-u300.dts
+++ b/arch/arm/boot/dts/ste-u300.dts
@@ -222,5 +222,16 @@
dmas = <&dmac 14>;
dma-names = "rx";
};
+
+ spi: ssp@c0006000 {
+ compatible = "arm,pl022", "arm,primecell";
+ reg = <0xc0006000 0x1000>;
+ interrupt-parent = <&vica>;
+ interrupts = <23>;
+ dmas = <&dmac 27 &dmac 28>;
+ dma-names = "tx", "rx";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
};
};
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 98d4dbe..9467ffe 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -19,6 +19,7 @@
#include <linux/dmaengine.h>
#include <linux/amba/bus.h>
#include <linux/amba/mmci.h>
+#include <linux/amba/pl022.h>
#include <linux/amba/serial.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
@@ -703,6 +704,22 @@ MACHINE_END
#ifdef CONFIG_OF
+static struct pl022_ssp_controller spi_plat_data = {
+ /* If you have several SPI buses this varies, we have only bus 0 */
+ .bus_id = 0,
+ /*
+ * On the APP CPU GPIO 4, 5 and 6 are connected as generic
+ * chip selects for SPI. (Same on U330, U335 and U365.)
+ * TODO: make sure the GPIO driver can select these properly
+ * and do padmuxing accordingly too.
+ */
+ .num_chipselect = 3,
+ .enable_dma = 1,
+ .dma_filter = coh901318_filter_id,
+ .dma_rx_param = (void *) U300_DMA_SPI_RX,
+ .dma_tx_param = (void *) U300_DMA_SPI_TX,
+};
+
/* These are mostly to get the right device names for the clock lookups */
static struct of_dev_auxdata u300_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("stericsson,pinctrl-u300", U300_SYSCON_BASE,
@@ -719,6 +736,8 @@ static struct of_dev_auxdata u300_auxdata_lookup[] __initdata = {
"uart0", &uart0_plat_data),
OF_DEV_AUXDATA("arm,primecell", U300_UART1_BASE,
"uart1", &uart1_plat_data),
+ OF_DEV_AUXDATA("arm,primecell", U300_SPI_BASE,
+ "pl022", &spi_plat_data),
OF_DEV_AUXDATA("st,ddci2c", U300_I2C0_BASE,
"stu300.0", NULL),
OF_DEV_AUXDATA("st,ddci2c", U300_I2C1_BASE,
--
1.7.11.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 20/23 v2] ARM: u300: add SPI PL022 to the device tree
[not found] ` <1367485952-6212-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
@ 2013-05-02 15:26 ` Arnd Bergmann
[not found] ` <201305021726.49729.arnd-r2nGTMty4D4@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2013-05-02 15:26 UTC (permalink / raw)
To: Linus Walleij
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
On Thursday 02 May 2013, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>
> This registers the PL022 PrimeCell from the U300 device
> tree. We make a new copy of the platform data for the
> device tree boot path, as the old platform data is in an
> older file which will be going away.
>
> Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Why do you need both the platform data and the DT description?
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 20/23 v2] ARM: u300: add SPI PL022 to the device tree
[not found] ` <201305021726.49729.arnd-r2nGTMty4D4@public.gmane.org>
@ 2013-05-02 16:21 ` Linus Walleij
0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2013-05-02 16:21 UTC (permalink / raw)
To: Arnd Bergmann
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Mark Brown, Linus Walleij,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
On Thu, May 2, 2013 at 5:26 PM, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
> On Thursday 02 May 2013, Linus Walleij wrote:
>> From: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>>
>> This registers the PL022 PrimeCell from the U300 device
>> tree. We make a new copy of the platform data for the
>> device tree boot path, as the old platform data is in an
>> older file which will be going away.
>>
>> Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>
> Why do you need both the platform data and the DT description?
This is because the device-tree DMA support for PL022 has
not yet been merged upstream, so it still has to come from
platform data instead.
If/when there is a branch in ARM SoC that has that patch in place
(and I remember reviewing and ACKing it) I can rebase on that
and drop the platform data.
The same goes for PL011 and MMCI platform data actually...
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-02 16:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-02 9:12 [PATCH 20/23 v2] ARM: u300: add SPI PL022 to the device tree Linus Walleij
[not found] ` <1367485952-6212-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2013-05-02 15:26 ` Arnd Bergmann
[not found] ` <201305021726.49729.arnd-r2nGTMty4D4@public.gmane.org>
2013-05-02 16:21 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).