diff mbox

[1/2] ARM: mach-shmobile: r8a7779: add SATA support

Message ID 201305120125.51117.sergei.shtylyov@cogentembedded.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sergei Shtylyov May 11, 2013, 9:25 p.m. UTC
From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>

Add SATA clock for r8a7779 SoC (for both device tree and usual cases). 
Register SATA controller as a "late" platform device on r8a7779 SoC.
 
Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit a7b9837c7749bf3333151a7d060d239caff1569d)

---
This patch (already merged by Linus) is intended for the Marzen patch series.

Changes from the upstream version:
- added SATA platform device to the "early" device table instead of "late"; 
- resolved 4 rejects due to missing interim patches.

 arch/arm/mach-shmobile/clock-r8a7779.c |    6 +++++-
 arch/arm/mach-shmobile/setup-r8a7779.c |   26 ++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

Comments

Greg KH May 21, 2013, 7:49 p.m. UTC | #1
On Sun, May 12, 2013 at 01:25:50AM +0400, Sergei Shtylyov wrote:
> From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> 
> Add SATA clock for r8a7779 SoC (for both device tree and usual cases). 
> Register SATA controller as a "late" platform device on r8a7779 SoC.
>  
> Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> (cherry picked from commit a7b9837c7749bf3333151a7d060d239caff1569d)
> 
> ---
> This patch (already merged by Linus) is intended for the Marzen patch series.
> 
> Changes from the upstream version:
> - added SATA platform device to the "early" device table instead of "late"; 
> - resolved 4 rejects due to missing interim patches.
> 
>  arch/arm/mach-shmobile/clock-r8a7779.c |    6 +++++-
>  arch/arm/mach-shmobile/setup-r8a7779.c |   26 ++++++++++++++++++++++++++
>  2 files changed, 31 insertions(+), 1 deletion(-)

I've applied both of these patches to the ltsi tree, thanks.

greg k-h
diff mbox

Patch

Index: linux-3.4.39/arch/arm/mach-shmobile/clock-r8a7779.c
===================================================================
--- linux-3.4.39.orig/arch/arm/mach-shmobile/clock-r8a7779.c
+++ linux-3.4.39/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -86,11 +86,13 @@  static struct clk div4_clks[DIV4_NR] = {
 				      0x0300, CLK_ENABLE_ON_INIT),
 };
 
-enum { MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
+enum {	MSTP115,
+	MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
 	MSTP016, MSTP015, MSTP014,
 	MSTP_NR };
 
 static struct clk mstp_clks[MSTP_NR] = {
+	[MSTP115] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 15, 0), /* SATA */
 	[MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0), /* SCIF0 */
 	[MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0), /* SCIF1 */
 	[MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0), /* SCIF2 */
@@ -141,6 +143,8 @@  static struct clk_lookup lookups[] = {
 	CLKDEV_CON_ID("peripheral_clk",	&div4_clks[DIV4_P]),
 
 	/* MSTP32 clocks */
+	CLKDEV_DEV_ID("sata_rcar", &mstp_clks[MSTP115]), /* SATA */
+	CLKDEV_DEV_ID("fc600000.sata", &mstp_clks[MSTP115]), /* SATA w/DT */
 	CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
 	CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP016]), /* TMU01 */
 	CLKDEV_DEV_ID("sh_tmu.2", &mstp_clks[MSTP016]), /* TMU02 */
Index: linux-3.4.39/arch/arm/mach-shmobile/setup-r8a7779.c
===================================================================
--- linux-3.4.39.orig/arch/arm/mach-shmobile/setup-r8a7779.c
+++ linux-3.4.39/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -28,6 +28,7 @@ 
 #include <linux/serial_sci.h>
 #include <linux/sh_intc.h>
 #include <linux/sh_timer.h>
+#include <linux/dma-mapping.h>
 #include <mach/hardware.h>
 #include <mach/irqs.h>
 #include <mach/r8a7779.h>
@@ -302,6 +303,30 @@  static struct platform_device i2c3_devic
 	.num_resources	= ARRAY_SIZE(rcar_i2c3_res),
 };
 
+static struct resource sata_resources[] = {
+	[0] = {
+		.name	= "rcar-sata",
+		.start	= 0xfc600000,
+		.end	= 0xfc601fff,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_spi(100),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device sata_device = {
+	.name		= "sata_rcar",
+	.id		= -1,
+	.resource	= sata_resources,
+	.num_resources	= ARRAY_SIZE(sata_resources),
+	.dev		= {
+		.dma_mask		= &sata_device.dev.coherent_dma_mask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+	},
+};
+
 static struct platform_device *r8a7779_early_devices[] __initdata = {
 	&scif0_device,
 	&scif1_device,
@@ -315,6 +340,7 @@  static struct platform_device *r8a7779_e
 	&i2c1_device,
 	&i2c2_device,
 	&i2c3_device,
+	&sata_device,
 };
 
 static struct platform_device *r8a7779_late_devices[] __initdata = {