All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 07/17 v2] ARM: shmobile: r8a7778: add HSPI support
@ 2013-05-23  3:19 Kuninori Morimoto
  2013-05-23 12:50 ` Sergei Shtylyov
  2013-05-23 12:54 ` Sergei Shtylyov
  0 siblings, 2 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2013-05-23  3:19 UTC (permalink / raw)
  To: linux-sh

Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

 - no change

 arch/arm/mach-shmobile/clock-r8a7778.c        |    6 ++++++
 arch/arm/mach-shmobile/include/mach/r8a7778.h |    1 +
 arch/arm/mach-shmobile/setup-r8a7778.c        |   23 +++++++++++++++++++++++
 3 files changed, 30 insertions(+)

diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
index 1386c59..c2c1895 100644
--- a/arch/arm/mach-shmobile/clock-r8a7778.c
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -108,6 +108,7 @@ enum {
 	MSTP030,
 	MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
 	MSTP016, MSTP015,
+	MSTP007,
 	MSTP_NR };
 
 static struct clk mstp_clks[MSTP_NR] = {
@@ -127,10 +128,12 @@ static struct clk mstp_clks[MSTP_NR] = {
 	[MSTP021] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 21, 0), /* SCIF5 */
 	[MSTP016] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 16, 0), /* TMU0 */
 	[MSTP015] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 15, 0), /* TMU1 */
+	[MSTP007] = SH_CLK_MSTP32(&p_clk, MSTPCR0,  7, 0), /* HSPI */
 };
 
 static struct clk_lookup lookups[] = {
 	/* main */
+	CLKDEV_CON_ID("shyway_clk",	&s_clk),
 	CLKDEV_CON_ID("peripheral_clk",	&p_clk),
 
 	/* MSTP32 clocks */
@@ -150,6 +153,9 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
 	CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
 	CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */
+	CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
+	CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
+	CLKDEV_DEV_ID("sh-hspi.2", &mstp_clks[MSTP007]), /* HSPI2 */
 };
 
 void __init r8a7778_clock_init(void)
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h
index a428bc6..ca8bc14 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7778.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h
@@ -25,6 +25,7 @@ extern void r8a7778_add_standard_devices(void);
 extern void r8a7778_add_standard_devices_dt(void);
 extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata);
 extern void r8a7778_add_i2c_device(int id);
+extern void r8a7778_add_hspi_device(int id);
 
 extern void r8a7778_init_delay(void);
 extern void r8a7778_init_irq(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 87b74a5..8f011cb 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -198,6 +198,29 @@ void __init r8a7778_add_i2c_device(int id)
 		i2c_resources + (2 * id), 2);
 }
 
+/* HSPI */
+static struct resource hspi_resources[] = {
+	/* HSPI0 */
+	DEFINE_RES_MEM(0xfffc7000, 0x18),
+	DEFINE_RES_IRQ(gic_iid(0x5f)),
+	/* HSPI1 */
+	DEFINE_RES_MEM(0xfffc8000, 0x18),
+	DEFINE_RES_IRQ(gic_iid(0x74)),
+	/* HSPI2 */
+	DEFINE_RES_MEM(0xfffc6000, 0x18),
+	DEFINE_RES_IRQ(gic_iid(0x75)),
+};
+
+void __init r8a7778_add_hspi_device(int id)
+{
+	BUG_ON(id < 0 || id > 2);
+
+	platform_device_register_simple(
+		"sh-hspi", id,
+		hspi_resources + (2 * id), 2);
+}
+
+
 void __init r8a7778_add_standard_devices(void)
 {
 	int i;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 07/17 v2] ARM: shmobile: r8a7778: add HSPI support
  2013-05-23  3:19 [PATCH 07/17 v2] ARM: shmobile: r8a7778: add HSPI support Kuninori Morimoto
@ 2013-05-23 12:50 ` Sergei Shtylyov
  2013-05-23 12:54 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2013-05-23 12:50 UTC (permalink / raw)
  To: linux-sh

On 23-05-2013 7:19, Kuninori Morimoto wrote:

     I would like to see a proper changelog here. The patch is not as 
trivial as to only have the subject.

> Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[...]

> diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
> index 87b74a5..8f011cb 100644
> --- a/arch/arm/mach-shmobile/setup-r8a7778.c
> +++ b/arch/arm/mach-shmobile/setup-r8a7778.c
> @@ -198,6 +198,29 @@ void __init r8a7778_add_i2c_device(int id)
[...]
> +void __init r8a7778_add_hspi_device(int id)
> +{
> +	BUG_ON(id < 0 || id > 2);
> +
> +	platform_device_register_simple(
> +		"sh-hspi", id,
> +		hspi_resources + (2 * id), 2);

    () not needed.

WBR, Sergei


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 07/17 v2] ARM: shmobile: r8a7778: add HSPI support
  2013-05-23  3:19 [PATCH 07/17 v2] ARM: shmobile: r8a7778: add HSPI support Kuninori Morimoto
  2013-05-23 12:50 ` Sergei Shtylyov
@ 2013-05-23 12:54 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2013-05-23 12:54 UTC (permalink / raw)
  To: linux-sh

On 23-05-2013 7:19, Kuninori Morimoto wrote:

> Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[...]

> diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
> index 87b74a5..8f011cb 100644
> --- a/arch/arm/mach-shmobile/setup-r8a7778.c
> +++ b/arch/arm/mach-shmobile/setup-r8a7778.c
> @@ -198,6 +198,29 @@ void __init r8a7778_add_i2c_device(int id)
>   		i2c_resources + (2 * id), 2);
>   }
>
> +/* HSPI */
> +static struct resource hspi_resources[] = {

    You forgot to specify __initdata here -- you're just wasting memory.

> +	/* HSPI0 */
> +	DEFINE_RES_MEM(0xfffc7000, 0x18),
> +	DEFINE_RES_IRQ(gic_iid(0x5f)),
> +	/* HSPI1 */
> +	DEFINE_RES_MEM(0xfffc8000, 0x18),
> +	DEFINE_RES_IRQ(gic_iid(0x74)),
> +	/* HSPI2 */
> +	DEFINE_RES_MEM(0xfffc6000, 0x18),
> +	DEFINE_RES_IRQ(gic_iid(0x75)),
> +};

WBR, Sergei


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-23 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-23  3:19 [PATCH 07/17 v2] ARM: shmobile: r8a7778: add HSPI support Kuninori Morimoto
2013-05-23 12:50 ` Sergei Shtylyov
2013-05-23 12:54 ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.