Skip to contentSkip to conversation

ARM: mach-shmobile: r8a7790: add SATA support

PATCH New Simon Horman 4 participants 10 messages May 24, 2013 – May 26, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: mach-shmobile: r8a7790: add SATA support

Add SATA clock for r8a7790 SoC (for both device tree and usual cases). Register SATA controller as a "late" platform device on r8a7790 SoC.

Based on "ARM: mach-shmobile: r8a7779: add SATA support" by Vladimir Barinov.

---
 arch/arm/mach-shmobile/clock-r8a7790.c |  4 ++++
 arch/arm/mach-shmobile/setup-r8a7790.c | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)
arch/arm/mach-shmobile/clock-r8a7790.c +4 -0
index b393592..3619a52 100644
@@ -50,6 +50,7 @@
 #define SMSTPCR2 0xe6150138
 #define SMSTPCR3 0xe615013c
 #define SMSTPCR7 0xe615014c
+#define SMSTPCR8 0xe6150990
 
 #define MODEMR		0xE6160060
 #define SDCKCR		0xE6150074
@@ -180,6 +181,7 @@ static struct clk div6_clks[DIV6_NR] = {
 
 /* MSTP */
 enum {
+	MSTP814,
 	MSTP721, MSTP720,
 	MSTP304,
 	MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202,
@@ -187,6 +189,7 @@ enum {
 };
 
 static struct clk mstp_clks[MSTP_NR] = {
+	[MSTP814] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 15, 0), /* SATA1 */
 	[MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */
 	[MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
 	[MSTP304] = SH_CLK_MSTP32(&cp_clk, SMSTPCR3, 4, 0), /* TPU0 */
@@ -249,6 +252,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP202]),
 	CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP721]),
 	CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
+	CLKDEV_DEV_ID("sata_rcar.1", &mstp_clks[MSTP814]),
 };
 
 #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31)		\
arch/arm/mach-shmobile/setup-r8a7790.c +21 -0
index ed7ee24..5a2a073 100644
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <linux/dma-mapping.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
@@ -118,6 +119,25 @@ static inline void r8a7790_register_scif(int idx)
 				      sizeof(struct plat_sci_port));
 }
 
+static __init void r8a7790_register_sata1(void)
+{
+
+	struct resource res[] = {
+		DEFINE_RES_MEM_NAMED(0xee300000, 0x200000, "rcar-sata"),
+		DEFINE_RES_IRQ(gic_iid(106)),
+	};
+
+	struct platform_device_info pdevinfo = {
+		.name = "sata_rcar",
+		.id = 1,
+		.res = res,
+		.num_res = ARRAY_SIZE(res),
+		.dma_mask = DMA_BIT_MASK(32),
+	};
+
+	platform_device_register_full(&pdevinfo);
+}
+
 static struct renesas_irqc_config irqc0_data = {
 	.irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
 };
@@ -148,6 +168,7 @@ void __init r8a7790_add_standard_devices(void)
 	r8a7790_register_scif(SCIF0);
 	r8a7790_register_scif(SCIF1);
 	r8a7790_register_irqc(0);
+	r8a7790_register_sata1();
 }
 
 void __init r8a7790_timer_init(void)
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH 1/1 ARM: mach-shmobile: r8a7790: add SATA support

Hi Simon

Quoted 10 lines

Add SATA clock for r8a7790 SoC (for both device tree and usual cases). Register SATA controller as a "late" platform device on r8a7790 SoC.

Based on "ARM: mach-shmobile: r8a7779: add SATA support" by Vladimir Barinov.

---

arch/arm/mach-shmobile/clock-r8a7790.c +1 -0
+	CLKDEV_DEV_ID("sata_rcar.1", &mstp_clks[MSTP814]),

(snip)

Quoted 8 lines
arch/arm/mach-shmobile/setup-r8a7790.c +8 -0
+static __init void r8a7790_register_sata1(void)
+{
+
+	struct resource res[] = {
+		DEFINE_RES_MEM_NAMED(0xee300000, 0x200000, "rcar-sata"),
+		DEFINE_RES_IRQ(gic_iid(106)),
+	};
+

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 139

Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7790.c +10 -0
+	struct platform_device_info pdevinfo = {
+		.name = "sata_rcar",
+		.id = 1,
+		.res = res,
+		.num_res = ARRAY_SIZE(res),
+		.dma_mask = DMA_BIT_MASK(32),
+	};
+
+	platform_device_register_full(&pdevinfo);
+}

This is a little bit strange for me.
Why you don't care SATA0 ?

Can you use like this ?

static __init void r8a7790_register_sata(int id);

BTW, we need to decide "driver registration function naming" ? In r8a7778 case, it is using

	r8a7778_add_xxx_device()
	r8a7778_add_xxx_devices()

but r8a7778_register_xxx seems nice naming :)

Best regards
---
Kuninori Morimoto

#2 lore raw

PATCH 1/1 ARM: mach-shmobile: r8a7790: add SATA support

Hi Simon

Quoted 10 lines
Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7790.c +10 -0
+static __init void r8a7790_register_sata1(void)
+{
+
+	struct resource res[] = {
+		DEFINE_RES_MEM_NAMED(0xee300000, 0x200000, "rcar-sata"),
+		DEFINE_RES_IRQ(gic_iid(106)),
+	};
+
+	struct platform_device_info pdevinfo = {
+		.name = "sata_rcar",
Quoted 8 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 139

Quoted 8 lines
arch/arm/mach-shmobile/setup-r8a7790.c +8 -0
+		.id = 1,
+		.res = res,
+		.num_res = ARRAY_SIZE(res),
+		.dma_mask = DMA_BIT_MASK(32),
+	};
+
+	platform_device_register_full(&pdevinfo);
+}

This "using local variable" make sense.
It don't need "__initdata"

Best regards
---
Kuninori Morimoto

#3 lore raw

PATCH 1/1 ARM: mach-shmobile: r8a7790: add SATA support

In reply to Kuninori Morimoto
Quoted 27 lines · Kuninori Morimoto

Hi Simon

Quoted 10 lines

Add SATA clock for r8a7790 SoC (for both device tree and usual cases). Register SATA controller as a "late" platform device on r8a7790 SoC.

Based on "ARM: mach-shmobile: r8a7779: add SATA support" by Vladimir Barinov.

---

arch/arm/mach-shmobile/clock-r8a7790.c +1 -0
+	CLKDEV_DEV_ID("sata_rcar.1", &mstp_clks[MSTP814]),

(snip)

Quoted 13 lines
arch/arm/mach-shmobile/setup-r8a7790.c +13 -0
+static __init void r8a7790_register_sata1(void)
+{
+
+	struct resource res[] = {
+		DEFINE_RES_MEM_NAMED(0xee300000, 0x200000, "rcar-sata"),
+		DEFINE_RES_IRQ(gic_iid(106)),
+	};
+
+	struct platform_device_info pdevinfo = {
+		.name = "sata_rcar",
+		.id = 1,
+		.res = res,
+		.num_res = ARRAY_SIZE(res),
Quoted 8 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 139

Quoted 5 lines
arch/arm/mach-shmobile/setup-r8a7790.c +5 -0
+		.dma_mask = DMA_BIT_MASK(32),
+	};
+
+	platform_device_register_full(&pdevinfo);
+}

This is a little bit strange for me.
Why you don't care SATA0 ?

Because the lager board only seems to expose SATA1 and I was interested in something I could test.

I am happy to start caring about SATA0 if you think it is a good idea.

Quoted 3 lines

Can you use like this ?

static __init void r8a7790_register_sata(int id);

Sure, but I'm unsure how you want r8a7790_register_sata to handle id.

Is it just for the id field of struct platform_device_info pdevinfo? Or also to switch between resources somehow?

Quoted 7 lines

BTW, we need to decide "driver registration function naming" ? In r8a7778 case, it is using

	r8a7778_add_xxx_device()
	r8a7778_add_xxx_devices()

but r8a7778_register_xxx seems nice naming :)

I chose register as it seemed to be consistent with the existing contents of r8a7790_add_standard_devices().

#4 lore raw

PATCH 1/1 ARM: mach-shmobile: r8a7790: add SATA support

Hi Simon

Quoted 5 lines

Because the lager board only seems to expose SATA1 and I was interested in something I could test.

I am happy to start caring about SATA0 if you think it is a good idea.

Caring both SATA0/1 are nice IMO :)

Quoted 8 lines
Quoted 3 lines

Can you use like this ?

static __init void r8a7790_register_sata(int id);

Sure, but I'm unsure how you want r8a7790_register_sata to handle id.

Is it just for the id field of struct platform_device_info pdevinfo? Or also to switch between resources somehow?

can you check r8a7778_sdhi_init(int id, xxx) ?
It is caring both id field and resources.

Quoted 10 lines
Quoted 7 lines

BTW, we need to decide "driver registration function naming" ? In r8a7778 case, it is using

	r8a7778_add_xxx_device()
	r8a7778_add_xxx_devices()

but r8a7778_register_xxx seems nice naming :)

I chose register as it seemed to be consistent with the existing contents of r8a7790_add_standard_devices().

OK, nice.

Do you think other chip (= r8a7778) should follow same naming?

Best regards
---
Kuninori Morimoto

#5 lore raw

PATCH 1/1 ARM: mach-shmobile: r8a7790: add SATA support

Quoted 15 lines · Kuninori Morimoto

Hi Simon

Quoted 5 lines

Because the lager board only seems to expose SATA1 and I was interested in something I could test.

I am happy to start caring about SATA0 if you think it is a good idea.

Caring both SATA0/1 are nice IMO :)

Quoted 4 lines
Quoted 3 lines

Can you use like this ?

static __init void r8a7790_register_sata(int id);

Quoted 7 lines
Quoted 4 lines

Sure, but I'm unsure how you want r8a7790_register_sata to handle id.

Is it just for the id field of struct platform_device_info pdevinfo? Or also to switch between resources somehow?

can you check r8a7778_sdhi_init(int id, xxx) ?
It is caring both id field and resources.

Thanks, I will look at that.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

BTW, we need to decide "driver registration function naming" ? In r8a7778 case, it is using

	r8a7778_add_xxx_device()
	r8a7778_add_xxx_devices()
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

but r8a7778_register_xxx seems nice naming :)

I chose register as it seemed to be consistent with the existing contents of r8a7790_add_standard_devices().

OK, nice.

Do you think other chip (= r8a7778) should follow same naming?

I think it is not so important.

#6 lore raw

PATCH 1/1 ARM: mach-shmobile: r8a7790: add SATA support

In reply to Simon Horman

Hello.

Quoted 1 line · Simon Horman

Add SATA clock for r8a7790 SoC (for both device tree and usual cases).

I don't see where you are adding clock for device tree case.

Quoted 1 line

Register SATA controller as a "late" platform device on r8a7790 SoC.

Does R8A7790 have these "early" and "late" lists? I guess not.

Quoted 13 lines

Based on "ARM: mach-shmobile: r8a7779: add SATA support" by Vladimir Barinov.

---
  arch/arm/mach-shmobile/clock-r8a7790.c |  4 ++++
  arch/arm/mach-shmobile/setup-r8a7790.c | 21 +++++++++++++++++++++
  2 files changed, 25 insertions(+)
arch/arm/mach-shmobile/clock-r8a7790.c +0 -0
index b393592..3619a52 100644

[...]

Quoted 12 lines
arch/arm/mach-shmobile/clock-r8a7790.c +1 -0
@@ -249,6 +252,7 @@ static struct clk_lookup lookups[] = {
  	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP202]),
  	CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP721]),
  	CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
+	CLKDEV_DEV_ID("sata_rcar.1", &mstp_clks[MSTP814]),
  };
 
  #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31)		\
arch/arm/mach-shmobile/setup-r8a7790.c +0 -0
index ed7ee24..5a2a073 100644

[...]

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 122

Quoted 5 lines
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
@@ -118,6 +119,25 @@ static inline void r8a7790_register_scif(int idx)
  				      sizeof(struct plat_sci_port));
  }
 
+static __init void r8a7790_register_sata1(void)

What's with SATA0?

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 125

Quoted 3 lines
arch/arm/mach-shmobile/setup-r8a7790.c +3 -0
+{
+
+	struct resource res[] = {

Non-static variable with an intializer? Won't this be a waste of
code? Wouldn't it be better to have it static __initdata?

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 126

Quoted 1 line
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
+		DEFINE_RES_MEM_NAMED(0xee300000, 0x200000, "rcar-sata"),

2 megabytes? Won't it be a waste of memory?

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 130

Quoted 4 lines
arch/arm/mach-shmobile/setup-r8a7790.c +4 -0
+		DEFINE_RES_IRQ(gic_iid(106)),
+	};
+
+	struct platform_device_info pdevinfo = {

Same comment about non-static initialized structure...

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 140

Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7790.c +10 -0
+		.name = "sata_rcar",
+		.id = 1,
+		.res = res,
+		.num_res = ARRAY_SIZE(res),
+		.dma_mask = DMA_BIT_MASK(32),
+	};
+
+	platform_device_register_full(&pdevinfo);
+}
+

WBR, Sergei

#7 lore raw

PATCH 1/1 ARM: mach-shmobile: r8a7790: add SATA support

Quoted 47 lines · Sergei Shtylyov

Hello.

Quoted 1 line · Simon Horman

Add SATA clock for r8a7790 SoC (for both device tree and usual cases).

I don't see where you are adding clock for device tree case.

Quoted 1 line

Register SATA controller as a "late" platform device on r8a7790 SoC.

Does R8A7790 have these "early" and "late" lists? I guess not.

Quoted 13 lines

Based on "ARM: mach-shmobile: r8a7779: add SATA support" by Vladimir Barinov.

---
 arch/arm/mach-shmobile/clock-r8a7790.c |  4 ++++
 arch/arm/mach-shmobile/setup-r8a7790.c | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)
arch/arm/mach-shmobile/clock-r8a7790.c +0 -0
index b393592..3619a52 100644

[...]

Quoted 12 lines
arch/arm/mach-shmobile/clock-r8a7790.c +1 -0
@@ -249,6 +252,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP202]),
 	CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP721]),
 	CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
+	CLKDEV_DEV_ID("sata_rcar.1", &mstp_clks[MSTP814]),
 };
 
 #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31)		\
arch/arm/mach-shmobile/setup-r8a7790.c +0 -0
index ed7ee24..5a2a073 100644

[...]

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 122

Quoted 5 lines
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
@@ -118,6 +119,25 @@ static inline void r8a7790_register_scif(int idx)
 				      sizeof(struct plat_sci_port));
 }
 
+static __init void r8a7790_register_sata1(void)

What's with SATA0?

Quoted 6 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 125

Quoted 3 lines
arch/arm/mach-shmobile/setup-r8a7790.c +3 -0
+{
+
+	struct resource res[] = {

Non-static variable with an intializer? Won't this be a waste of
code? Wouldn't it be better to have it static __initdata?

Sure, if you prefer that.

Quoted 4 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 126

Quoted 2 lines
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
+		DEFINE_RES_MEM_NAMED(0xee300000, 0x200000, "rcar-sata"),

2 megabytes? Won't it be a waste of memory?

2 megabytes is specified in the data sheet. Do you think it is reasonable to use a smaller value?

Quoted 21 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 130

Quoted 5 lines
arch/arm/mach-shmobile/setup-r8a7790.c +4 -0
+		DEFINE_RES_IRQ(gic_iid(106)),
+	};
+
+	struct platform_device_info pdevinfo = {

Same comment about non-static initialized structure...

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 140

Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7790.c +10 -0
+		.name = "sata_rcar",
+		.id = 1,
+		.res = res,
+		.num_res = ARRAY_SIZE(res),
+		.dma_mask = DMA_BIT_MASK(32),
+	};
+
+	platform_device_register_full(&pdevinfo);
+}
+

WBR, Sergei

#8 lore raw

PATCH 1/1 ARM: mach-shmobile: r8a7790: add SATA support

Hello.

Quoted 43 lines · Simon Horman
Quoted 42 lines
Quoted 1 line

Add SATA clock for r8a7790 SoC (for both device tree and usual cases).

I don't see where you are adding clock for device tree case.

Quoted 1 line

Register SATA controller as a "late" platform device on r8a7790 SoC.

Does R8A7790 have these "early" and "late" lists? I guess not.

Quoted 13 lines

Based on "ARM: mach-shmobile: r8a7779: add SATA support" by Vladimir Barinov.

---
  arch/arm/mach-shmobile/clock-r8a7790.c |  4 ++++
  arch/arm/mach-shmobile/setup-r8a7790.c | 21 +++++++++++++++++++++
  2 files changed, 25 insertions(+)
arch/arm/mach-shmobile/clock-r8a7790.c +0 -0
index b393592..3619a52 100644

[...]

Quoted 12 lines
arch/arm/mach-shmobile/clock-r8a7790.c +1 -0
@@ -249,6 +252,7 @@ static struct clk_lookup lookups[] = {
  	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP202]),
  	CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP721]),
  	CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
+	CLKDEV_DEV_ID("sata_rcar.1", &mstp_clks[MSTP814]),
  };
 
  #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31)		\
arch/arm/mach-shmobile/setup-r8a7790.c +0 -0
index ed7ee24..5a2a073 100644

[...]

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 122

Quoted 5 lines
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
@@ -118,6 +119,25 @@ static inline void r8a7790_register_scif(int idx)
  				      sizeof(struct plat_sci_port));
  }
 
+static __init void r8a7790_register_sata1(void)

What's with SATA0?

Quoted 8 lines
Quoted 6 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 125

Quoted 3 lines
arch/arm/mach-shmobile/setup-r8a7790.c +3 -0
+{
+
+	struct resource res[] = {

Non-static variable with an intializer? Won't this be a waste of
code? Wouldn't it be better to have it static __initdata?

Sure, if you prefer that.

I don't know exactly what gcc will generate for the intializers but
expect nothing particularly good. The static intialized data should definitely take up less space.

Quoted 7 lines
Quoted 4 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 126

Quoted 2 lines
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
+		DEFINE_RES_MEM_NAMED(0xee300000, 0x200000, "rcar-sata"),

2 megabytes? Won't it be a waste of memory?

2 megabytes is specified in the data sheet. Do you think it is reasonable to use a smaller value?

    We used 0x2000 for R8A7779 SATA device -- it should be enough to 

cover all the registers.

Quoted 7 lines
Quoted 6 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 130

Quoted 4 lines
arch/arm/mach-shmobile/setup-r8a7790.c +4 -0
+		DEFINE_RES_IRQ(gic_iid(106)),
+	};
+
+	struct platform_device_info pdevinfo = {

Same comment about non-static initialized structure...

Quoted 10 lines
Quoted 10 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 140

Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7790.c +10 -0
+		.name = "sata_rcar",
+		.id = 1,
+		.res = res,
+		.num_res = ARRAY_SIZE(res),
+		.dma_mask = DMA_BIT_MASK(32),
+	};
+
+	platform_device_register_full(&pdevinfo);
+}
+

WBR, Sergei

#9 lore raw

PATCH 1/1 ARM: mach-shmobile: r8a7790: add SATA support

Quoted 65 lines · Sergei Shtylyov

Hello.

Quoted 43 lines · Simon Horman
Quoted 42 lines
Quoted 1 line

Add SATA clock for r8a7790 SoC (for both device tree and usual cases).

I don't see where you are adding clock for device tree case.

Quoted 1 line

Register SATA controller as a "late" platform device on r8a7790 SoC.

Does R8A7790 have these "early" and "late" lists? I guess not.

Quoted 13 lines

Based on "ARM: mach-shmobile: r8a7779: add SATA support" by Vladimir Barinov.

---
 arch/arm/mach-shmobile/clock-r8a7790.c |  4 ++++
 arch/arm/mach-shmobile/setup-r8a7790.c | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)
arch/arm/mach-shmobile/clock-r8a7790.c +0 -0
index b393592..3619a52 100644

[...]

Quoted 12 lines
arch/arm/mach-shmobile/clock-r8a7790.c +1 -0
@@ -249,6 +252,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP202]),
 	CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP721]),
 	CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
+	CLKDEV_DEV_ID("sata_rcar.1", &mstp_clks[MSTP814]),
 };
 
 #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31)		\
arch/arm/mach-shmobile/setup-r8a7790.c +0 -0
index ed7ee24..5a2a073 100644

[...]

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 122

Quoted 5 lines
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
@@ -118,6 +119,25 @@ static inline void r8a7790_register_scif(int idx)
 				      sizeof(struct plat_sci_port));
 }
 
+static __init void r8a7790_register_sata1(void)

What's with SATA0?

Quoted 8 lines
Quoted 6 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 125

Quoted 3 lines
arch/arm/mach-shmobile/setup-r8a7790.c +3 -0
+{
+
+	struct resource res[] = {

Non-static variable with an intializer? Won't this be a waste of
code? Wouldn't it be better to have it static __initdata?

Sure, if you prefer that.

I don't know exactly what gcc will generate for the intializers
but expect nothing particularly good. The static intialized data should definitely take up less space.

Quoted 4 lines
Quoted 4 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 126

Quoted 2 lines
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
+		DEFINE_RES_MEM_NAMED(0xee300000, 0x200000, "rcar-sata"),

2 megabytes? Won't it be a waste of memory?

Quoted 5 lines
Quoted 2 lines

2 megabytes is specified in the data sheet. Do you think it is reasonable to use a smaller value?

We used 0x2000 for R8A7779 SATA device -- it should be enough to
cover all the registers.

Thanks for your advice, I'll see about doing the same for r8a7790.

Quoted 25 lines
Quoted 7 lines
Quoted 6 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 130

Quoted 4 lines
arch/arm/mach-shmobile/setup-r8a7790.c +4 -0
+		DEFINE_RES_IRQ(gic_iid(106)),
+	};
+
+	struct platform_device_info pdevinfo = {

Same comment about non-static initialized structure...

Quoted 10 lines
Quoted 10 lines

arch/arm/mach-shmobile/setup-r8a7790.c static inline void r8a7790_register_scif(int idx) · line 140

Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7790.c +10 -0
+		.name = "sata_rcar",
+		.id = 1,
+		.res = res,
+		.num_res = ARRAY_SIZE(res),
+		.dma_mask = DMA_BIT_MASK(32),
+	};
+
+	platform_device_register_full(&pdevinfo);
+}
+

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html