All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/5] omap: mailbox: hwmod support
@ 2011-02-02 19:27 ` Omar Ramirez Luna
  0 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: Tony Lindgren, Benoit Cousson; +Cc: Russell King, lo, lak, Omar Ramirez Luna

Mailbox hwmod support for OMAP 2,3,4.

This was tested on OMAP3 (3430, 3630), minor testing
was made on OMAP4.

No testing on OMAP2 since I don't have the hardware.

Highlights from v5 include the comments received from
previous version v4[1].

Benoit Cousson (1):
  OMAP4: hwmod data: add mailbox data

Felipe Contreras (2):
  OMAP3: hwmod data: add mailbox data
  OMAP: mailbox: build device using omap_device/omap_hwmod

Omar Ramirez Luna (1):
  OMAP: mailbox: use runtime pm for clk and sysc handling

omar ramirez (1):
  OMAP2: hwmod data: add mailbox data

 arch/arm/mach-omap2/devices.c              |   98 +++++-----------------------
 arch/arm/mach-omap2/mailbox.c              |   67 ++-----------------
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   74 +++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   73 +++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   72 ++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   67 +++++++++++++++++++
 6 files changed, 308 insertions(+), 143 deletions(-)

---
[1] http://bit.ly/gfLaIs

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

* [PATCH v5 0/5] omap: mailbox: hwmod support
@ 2011-02-02 19:27 ` Omar Ramirez Luna
  0 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: linux-arm-kernel

Mailbox hwmod support for OMAP 2,3,4.

This was tested on OMAP3 (3430, 3630), minor testing
was made on OMAP4.

No testing on OMAP2 since I don't have the hardware.

Highlights from v5 include the comments received from
previous version v4[1].

Benoit Cousson (1):
  OMAP4: hwmod data: add mailbox data

Felipe Contreras (2):
  OMAP3: hwmod data: add mailbox data
  OMAP: mailbox: build device using omap_device/omap_hwmod

Omar Ramirez Luna (1):
  OMAP: mailbox: use runtime pm for clk and sysc handling

omar ramirez (1):
  OMAP2: hwmod data: add mailbox data

 arch/arm/mach-omap2/devices.c              |   98 +++++-----------------------
 arch/arm/mach-omap2/mailbox.c              |   67 ++-----------------
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   74 +++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   73 +++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   72 ++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   67 +++++++++++++++++++
 6 files changed, 308 insertions(+), 143 deletions(-)

---
[1] http://bit.ly/gfLaIs

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

* [PATCH v5 1/5] OMAP2: hwmod data: add mailbox data
  2011-02-02 19:27 ` Omar Ramirez Luna
@ 2011-02-02 19:27   ` Omar Ramirez Luna
  -1 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: Tony Lindgren, Benoit Cousson; +Cc: Russell King, lo, lak, omar ramirez

From: omar ramirez <omar.ramirez@ti.com>

Mailbox hwmod data for omap2430 and 2420.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   74 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   73 +++++++++++++++++++++++++++
 2 files changed, 147 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b85c630..3f54c20 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -779,6 +779,76 @@ static struct omap_hwmod omap2420_gpio4_hwmod = {
 	.slaves_cnt	= ARRAY_SIZE(omap2420_gpio4_slaves),
 	.class		= &omap242x_gpio_hwmod_class,
 	.dev_attr	= &gpio_dev_attr,
+	.omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/*
+ * 'mailbox' class
+ * mailbox module allowing communication between the on-chip processors
+ * using a queued mailbox-interrupt mechanism.
+ */
+
+static struct omap_hwmod_class_sysconfig omap2420_mailbox_sysc = {
+	.rev_offs	= 0x000,
+	.sysc_offs	= 0x010,
+	.syss_offs	= 0x014,
+	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+				SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2420_mailbox_hwmod_class = {
+	.name = "mailbox",
+	.sysc = &omap2420_mailbox_sysc,
+};
+
+/* mailbox */
+static struct omap_hwmod omap2420_mailbox_hwmod;
+static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
+	{ .name = "dsp", .irq = 26, },
+	{ .name = "iva", .irq = 34, },
+};
+
+static struct omap_hwmod_addr_space omap2420_mailbox_addrs[] = {
+	{
+		.pa_start	= 0x48094000,
+		.pa_end		= 0x480941ff,
+		.flags		= ADDR_TYPE_RT,
+	},
+};
+
+/* l4_core -> mailbox */
+static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = {
+	.master		= &omap2420_l4_core_hwmod,
+	.slave		= &omap2420_mailbox_hwmod,
+	.clk		= "mailboxes_ick",
+	.addr		= omap2420_mailbox_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap2420_mailbox_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap2420_mailbox_slaves[] = {
+	&omap2420_l4_core__mailbox,
+};
+
+static struct omap_hwmod omap2420_mailbox_hwmod = {
+	.name		= "mailbox",
+	.class		= &omap2420_mailbox_hwmod_class,
+	.mpu_irqs	= omap2420_mailbox_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap2420_mailbox_irqs),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
+			.module_offs = CORE_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
+		},
+	},
+	.slaves		= omap2420_mailbox_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap2420_mailbox_slaves),
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
 };
 
@@ -885,6 +955,10 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = {
 
 	/* dma_system class*/
 	&omap2420_dma_system_hwmod,
+
+	/* mailbox class */
+	&omap2420_mailbox_hwmod,
+
 	NULL,
 };
 
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 8ecfbcd..d591aaf 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -834,6 +834,75 @@ static struct omap_hwmod omap2430_gpio5_hwmod = {
 	.slaves_cnt	= ARRAY_SIZE(omap2430_gpio5_slaves),
 	.class		= &omap243x_gpio_hwmod_class,
 	.dev_attr	= &gpio_dev_attr,
+	.omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/*
+ * 'mailbox' class
+ * mailbox module allowing communication between the on-chip processors
+ * using a queued mailbox-interrupt mechanism.
+ */
+
+static struct omap_hwmod_class_sysconfig omap2430_mailbox_sysc = {
+	.rev_offs	= 0x000,
+	.sysc_offs	= 0x010,
+	.syss_offs	= 0x014,
+	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+				SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2430_mailbox_hwmod_class = {
+	.name = "mailbox",
+	.sysc = &omap2430_mailbox_sysc,
+};
+
+/* mailbox */
+static struct omap_hwmod omap2430_mailbox_hwmod;
+static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = {
+	{ .name = "dsp", .irq = 26, },
+};
+
+static struct omap_hwmod_addr_space omap2430_mailbox_addrs[] = {
+	{
+		.pa_start	= 0x48094000,
+		.pa_end		= 0x480941ff,
+		.flags		= ADDR_TYPE_RT,
+	},
+};
+
+/* l4_core -> mailbox */
+static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = {
+	.master		= &omap2430_l4_core_hwmod,
+	.slave		= &omap2430_mailbox_hwmod,
+	.clk		= "mailboxes_ick",
+	.addr		= omap2430_mailbox_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap2430_mailbox_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap2430_mailbox_slaves[] = {
+	&omap2430_l4_core__mailbox,
+};
+
+static struct omap_hwmod omap2430_mailbox_hwmod = {
+	.name		= "mailbox",
+	.class		= &omap2430_mailbox_hwmod_class,
+	.mpu_irqs	= omap2430_mailbox_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap2430_mailbox_irqs),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
+			.module_offs = CORE_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
+		},
+	},
+	.slaves		= omap2430_mailbox_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap2430_mailbox_slaves),
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
 };
 
@@ -941,6 +1010,10 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {
 
 	/* dma_system class*/
 	&omap2430_dma_system_hwmod,
+
+	/* mailbox class */
+	&omap2430_mailbox_hwmod,
+
 	NULL,
 };
 
-- 
1.7.1


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

* [PATCH v5 1/5] OMAP2: hwmod data: add mailbox data
@ 2011-02-02 19:27   ` Omar Ramirez Luna
  0 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: omar ramirez <omar.ramirez@ti.com>

Mailbox hwmod data for omap2430 and 2420.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   74 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   73 +++++++++++++++++++++++++++
 2 files changed, 147 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b85c630..3f54c20 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -779,6 +779,76 @@ static struct omap_hwmod omap2420_gpio4_hwmod = {
 	.slaves_cnt	= ARRAY_SIZE(omap2420_gpio4_slaves),
 	.class		= &omap242x_gpio_hwmod_class,
 	.dev_attr	= &gpio_dev_attr,
+	.omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/*
+ * 'mailbox' class
+ * mailbox module allowing communication between the on-chip processors
+ * using a queued mailbox-interrupt mechanism.
+ */
+
+static struct omap_hwmod_class_sysconfig omap2420_mailbox_sysc = {
+	.rev_offs	= 0x000,
+	.sysc_offs	= 0x010,
+	.syss_offs	= 0x014,
+	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+				SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2420_mailbox_hwmod_class = {
+	.name = "mailbox",
+	.sysc = &omap2420_mailbox_sysc,
+};
+
+/* mailbox */
+static struct omap_hwmod omap2420_mailbox_hwmod;
+static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
+	{ .name = "dsp", .irq = 26, },
+	{ .name = "iva", .irq = 34, },
+};
+
+static struct omap_hwmod_addr_space omap2420_mailbox_addrs[] = {
+	{
+		.pa_start	= 0x48094000,
+		.pa_end		= 0x480941ff,
+		.flags		= ADDR_TYPE_RT,
+	},
+};
+
+/* l4_core -> mailbox */
+static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = {
+	.master		= &omap2420_l4_core_hwmod,
+	.slave		= &omap2420_mailbox_hwmod,
+	.clk		= "mailboxes_ick",
+	.addr		= omap2420_mailbox_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap2420_mailbox_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap2420_mailbox_slaves[] = {
+	&omap2420_l4_core__mailbox,
+};
+
+static struct omap_hwmod omap2420_mailbox_hwmod = {
+	.name		= "mailbox",
+	.class		= &omap2420_mailbox_hwmod_class,
+	.mpu_irqs	= omap2420_mailbox_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap2420_mailbox_irqs),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
+			.module_offs = CORE_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
+		},
+	},
+	.slaves		= omap2420_mailbox_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap2420_mailbox_slaves),
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
 };
 
@@ -885,6 +955,10 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = {
 
 	/* dma_system class*/
 	&omap2420_dma_system_hwmod,
+
+	/* mailbox class */
+	&omap2420_mailbox_hwmod,
+
 	NULL,
 };
 
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 8ecfbcd..d591aaf 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -834,6 +834,75 @@ static struct omap_hwmod omap2430_gpio5_hwmod = {
 	.slaves_cnt	= ARRAY_SIZE(omap2430_gpio5_slaves),
 	.class		= &omap243x_gpio_hwmod_class,
 	.dev_attr	= &gpio_dev_attr,
+	.omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/*
+ * 'mailbox' class
+ * mailbox module allowing communication between the on-chip processors
+ * using a queued mailbox-interrupt mechanism.
+ */
+
+static struct omap_hwmod_class_sysconfig omap2430_mailbox_sysc = {
+	.rev_offs	= 0x000,
+	.sysc_offs	= 0x010,
+	.syss_offs	= 0x014,
+	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+				SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2430_mailbox_hwmod_class = {
+	.name = "mailbox",
+	.sysc = &omap2430_mailbox_sysc,
+};
+
+/* mailbox */
+static struct omap_hwmod omap2430_mailbox_hwmod;
+static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = {
+	{ .name = "dsp", .irq = 26, },
+};
+
+static struct omap_hwmod_addr_space omap2430_mailbox_addrs[] = {
+	{
+		.pa_start	= 0x48094000,
+		.pa_end		= 0x480941ff,
+		.flags		= ADDR_TYPE_RT,
+	},
+};
+
+/* l4_core -> mailbox */
+static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = {
+	.master		= &omap2430_l4_core_hwmod,
+	.slave		= &omap2430_mailbox_hwmod,
+	.clk		= "mailboxes_ick",
+	.addr		= omap2430_mailbox_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap2430_mailbox_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap2430_mailbox_slaves[] = {
+	&omap2430_l4_core__mailbox,
+};
+
+static struct omap_hwmod omap2430_mailbox_hwmod = {
+	.name		= "mailbox",
+	.class		= &omap2430_mailbox_hwmod_class,
+	.mpu_irqs	= omap2430_mailbox_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap2430_mailbox_irqs),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
+			.module_offs = CORE_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
+		},
+	},
+	.slaves		= omap2430_mailbox_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap2430_mailbox_slaves),
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
 };
 
@@ -941,6 +1010,10 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {
 
 	/* dma_system class*/
 	&omap2430_dma_system_hwmod,
+
+	/* mailbox class */
+	&omap2430_mailbox_hwmod,
+
 	NULL,
 };
 
-- 
1.7.1

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

* [PATCH v5 2/5] OMAP3: hwmod data: add mailbox data
  2011-02-02 19:27 ` Omar Ramirez Luna
@ 2011-02-02 19:27   ` Omar Ramirez Luna
  -1 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: Tony Lindgren, Benoit Cousson
  Cc: Russell King, lo, lak, Felipe Contreras, Omar Ramirez Luna

From: Felipe Contreras <felipe.contreras@gmail.com>

Mailbox hwmod data for omap3.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   72 ++++++++++++++++++++++++++++
 1 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 8d81813..5960d5e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1132,6 +1132,74 @@ static struct omap_hwmod omap3xxx_gpio6_hwmod = {
 	.slaves_cnt	= ARRAY_SIZE(omap3xxx_gpio6_slaves),
 	.class		= &omap3xxx_gpio_hwmod_class,
 	.dev_attr	= &gpio_dev_attr,
+	.omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * 'mailbox' class
+ * mailbox module allowing communication between the on-chip processors
+ * using a queued mailbox-interrupt mechanism.
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_mailbox_sysc = {
+	.rev_offs	= 0x000,
+	.sysc_offs	= 0x010,
+	.syss_offs	= 0x014,
+	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+				SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = {
+	.name = "mailbox",
+	.sysc = &omap3xxx_mailbox_sysc,
+};
+
+static struct omap_hwmod omap3xxx_mailbox_hwmod;
+static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = {
+	{ .name = "dsp", .irq = 26, },
+};
+
+static struct omap_hwmod_addr_space omap3xxx_mailbox_addrs[] = {
+	{
+		.pa_start	= 0x48094000,
+		.pa_end		= 0x480941ff,
+		.flags		= ADDR_TYPE_RT,
+	},
+};
+
+/* l4_core -> mailbox */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__mailbox = {
+	.master		= &omap3xxx_l4_core_hwmod,
+	.slave		= &omap3xxx_mailbox_hwmod,
+	.clk		= "mailboxes_ick",
+	.addr		= omap3xxx_mailbox_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap3xxx_mailbox_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_mailbox_slaves[] = {
+	&omap3xxx_l4_core__mailbox,
+};
+
+static struct omap_hwmod omap3xxx_mailbox_hwmod = {
+	.name		= "mailbox",
+	.class		= &omap3xxx_mailbox_hwmod_class,
+	.mpu_irqs	= omap3xxx_mailbox_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_mailbox_irqs),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_MAILBOXES_SHIFT,
+			.module_offs = CORE_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT,
+		},
+	},
+	.slaves		= omap3xxx_mailbox_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3xxx_mailbox_slaves),
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
@@ -1387,6 +1455,10 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 
 	/* dma_system class*/
 	&omap3xxx_dma_system_hwmod,
+
+	/* mailbox class */
+	&omap3xxx_mailbox_hwmod,
+
 	NULL,
 };
 
-- 
1.7.1


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

* [PATCH v5 2/5] OMAP3: hwmod data: add mailbox data
@ 2011-02-02 19:27   ` Omar Ramirez Luna
  0 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Felipe Contreras <felipe.contreras@gmail.com>

Mailbox hwmod data for omap3.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   72 ++++++++++++++++++++++++++++
 1 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 8d81813..5960d5e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1132,6 +1132,74 @@ static struct omap_hwmod omap3xxx_gpio6_hwmod = {
 	.slaves_cnt	= ARRAY_SIZE(omap3xxx_gpio6_slaves),
 	.class		= &omap3xxx_gpio_hwmod_class,
 	.dev_attr	= &gpio_dev_attr,
+	.omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * 'mailbox' class
+ * mailbox module allowing communication between the on-chip processors
+ * using a queued mailbox-interrupt mechanism.
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_mailbox_sysc = {
+	.rev_offs	= 0x000,
+	.sysc_offs	= 0x010,
+	.syss_offs	= 0x014,
+	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+				SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = {
+	.name = "mailbox",
+	.sysc = &omap3xxx_mailbox_sysc,
+};
+
+static struct omap_hwmod omap3xxx_mailbox_hwmod;
+static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = {
+	{ .name = "dsp", .irq = 26, },
+};
+
+static struct omap_hwmod_addr_space omap3xxx_mailbox_addrs[] = {
+	{
+		.pa_start	= 0x48094000,
+		.pa_end		= 0x480941ff,
+		.flags		= ADDR_TYPE_RT,
+	},
+};
+
+/* l4_core -> mailbox */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__mailbox = {
+	.master		= &omap3xxx_l4_core_hwmod,
+	.slave		= &omap3xxx_mailbox_hwmod,
+	.clk		= "mailboxes_ick",
+	.addr		= omap3xxx_mailbox_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap3xxx_mailbox_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_mailbox_slaves[] = {
+	&omap3xxx_l4_core__mailbox,
+};
+
+static struct omap_hwmod omap3xxx_mailbox_hwmod = {
+	.name		= "mailbox",
+	.class		= &omap3xxx_mailbox_hwmod_class,
+	.mpu_irqs	= omap3xxx_mailbox_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_mailbox_irqs),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_MAILBOXES_SHIFT,
+			.module_offs = CORE_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT,
+		},
+	},
+	.slaves		= omap3xxx_mailbox_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3xxx_mailbox_slaves),
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
@@ -1387,6 +1455,10 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 
 	/* dma_system class*/
 	&omap3xxx_dma_system_hwmod,
+
+	/* mailbox class */
+	&omap3xxx_mailbox_hwmod,
+
 	NULL,
 };
 
-- 
1.7.1

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

* [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
  2011-02-02 19:27 ` Omar Ramirez Luna
@ 2011-02-02 19:27   ` Omar Ramirez Luna
  -1 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Russell King, lo, lak, Benoit Cousson, Omar Ramirez Luna

From: Benoit Cousson <b-cousson@ti.com>

Mailbox hwmod data for omap4.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   67 ++++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index c2806bd..c495669 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -2001,6 +2001,70 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/*
+ * 'mailbox' class
+ * mailbox module allowing communication between the on-chip processors
+ * using a queued mailbox-interrupt mechanism.
+ */
+
+static struct omap_hwmod_class_sysconfig omap44xx_mailbox_sysc = {
+	.rev_offs	= 0x0000,
+	.sysc_offs	= 0x0010,
+	.sysc_flags	= (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
+			   SYSC_HAS_SOFTRESET),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class omap44xx_mailbox_hwmod_class = {
+	.name = "mailbox",
+	.sysc = &omap44xx_mailbox_sysc,
+};
+
+/* mailbox */
+static struct omap_hwmod omap44xx_mailbox_hwmod;
+static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
+	{ .name = "mbox", .irq = 26 + OMAP44XX_IRQ_GIC_START, },
+};
+
+static struct omap_hwmod_addr_space omap44xx_mailbox_addrs[] = {
+	{
+		.pa_start	= 0x4a0f4000,
+		.pa_end		= 0x4a0f41ff,
+		.flags		= ADDR_TYPE_RT,
+	},
+};
+
+/* l4_cfg -> mailbox */
+static struct omap_hwmod_ocp_if omap44xx_l4_cfg__mailbox = {
+	.master		= &omap44xx_l4_cfg_hwmod,
+	.slave		= &omap44xx_mailbox_hwmod,
+	.clk		= "l4_div_ck",
+	.addr		= omap44xx_mailbox_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap44xx_mailbox_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap44xx_mailbox_slaves[] = {
+	&omap44xx_l4_cfg__mailbox,
+};
+
+static struct omap_hwmod omap44xx_mailbox_hwmod = {
+	.name		= "mailbox",
+	.class		= &omap44xx_mailbox_hwmod_class,
+	.mpu_irqs	= omap44xx_mailbox_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap44xx_mailbox_irqs),
+	.prcm		= {
+		.omap4 = {
+			.clkctrl_reg = OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL,
+		},
+	},
+	.slaves		= omap44xx_mailbox_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap44xx_mailbox_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
 static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
 
 	/* dmm class */
@@ -2068,6 +2132,9 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
 	&omap44xx_wd_timer2_hwmod,
 	&omap44xx_wd_timer3_hwmod,
 
+	/* mailbox class */
+	&omap44xx_mailbox_hwmod,
+
 	NULL,
 };
 
-- 
1.7.1


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

* [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
@ 2011-02-02 19:27   ` Omar Ramirez Luna
  0 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Benoit Cousson <b-cousson@ti.com>

Mailbox hwmod data for omap4.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   67 ++++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index c2806bd..c495669 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -2001,6 +2001,70 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/*
+ * 'mailbox' class
+ * mailbox module allowing communication between the on-chip processors
+ * using a queued mailbox-interrupt mechanism.
+ */
+
+static struct omap_hwmod_class_sysconfig omap44xx_mailbox_sysc = {
+	.rev_offs	= 0x0000,
+	.sysc_offs	= 0x0010,
+	.sysc_flags	= (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
+			   SYSC_HAS_SOFTRESET),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class omap44xx_mailbox_hwmod_class = {
+	.name = "mailbox",
+	.sysc = &omap44xx_mailbox_sysc,
+};
+
+/* mailbox */
+static struct omap_hwmod omap44xx_mailbox_hwmod;
+static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
+	{ .name = "mbox", .irq = 26 + OMAP44XX_IRQ_GIC_START, },
+};
+
+static struct omap_hwmod_addr_space omap44xx_mailbox_addrs[] = {
+	{
+		.pa_start	= 0x4a0f4000,
+		.pa_end		= 0x4a0f41ff,
+		.flags		= ADDR_TYPE_RT,
+	},
+};
+
+/* l4_cfg -> mailbox */
+static struct omap_hwmod_ocp_if omap44xx_l4_cfg__mailbox = {
+	.master		= &omap44xx_l4_cfg_hwmod,
+	.slave		= &omap44xx_mailbox_hwmod,
+	.clk		= "l4_div_ck",
+	.addr		= omap44xx_mailbox_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap44xx_mailbox_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap44xx_mailbox_slaves[] = {
+	&omap44xx_l4_cfg__mailbox,
+};
+
+static struct omap_hwmod omap44xx_mailbox_hwmod = {
+	.name		= "mailbox",
+	.class		= &omap44xx_mailbox_hwmod_class,
+	.mpu_irqs	= omap44xx_mailbox_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap44xx_mailbox_irqs),
+	.prcm		= {
+		.omap4 = {
+			.clkctrl_reg = OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL,
+		},
+	},
+	.slaves		= omap44xx_mailbox_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap44xx_mailbox_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
 static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
 
 	/* dmm class */
@@ -2068,6 +2132,9 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
 	&omap44xx_wd_timer2_hwmod,
 	&omap44xx_wd_timer3_hwmod,
 
+	/* mailbox class */
+	&omap44xx_mailbox_hwmod,
+
 	NULL,
 };
 
-- 
1.7.1

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

* [PATCH v5 4/5] OMAP: mailbox: build device using omap_device/omap_hwmod
  2011-02-02 19:27 ` Omar Ramirez Luna
@ 2011-02-02 19:27   ` Omar Ramirez Luna
  -1 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: Tony Lindgren, Benoit Cousson
  Cc: Russell King, lo, lak, Felipe Contreras, Omar Ramirez Luna

From: Felipe Contreras <felipe.contreras@gmail.com>

Remove static platform_device and resource data within
omap mailbox driver; use the one defined in the hwmod
database along with omap_device framework for device
build and registration.

Add device latency functions to be used, so clock can be
enabled and sysconfig is configured.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 arch/arm/mach-omap2/devices.c |   98 +++++++----------------------------------
 1 files changed, 16 insertions(+), 82 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 2c9c912..826bea0 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -142,95 +142,29 @@ static inline void omap_init_camera(void)
 #endif
 
 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
-
-#define MBOX_REG_SIZE   0x120
-
-#ifdef CONFIG_ARCH_OMAP2
-static struct resource omap2_mbox_resources[] = {
-	{
-		.start		= OMAP24XX_MAILBOX_BASE,
-		.end		= OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
-		.flags		= IORESOURCE_MEM,
-	},
-	{
-		.start		= INT_24XX_MAIL_U0_MPU,
-		.flags		= IORESOURCE_IRQ,
-		.name		= "dsp",
-	},
-	{
-		.start		= INT_24XX_MAIL_U3_MPU,
-		.flags		= IORESOURCE_IRQ,
-		.name		= "iva",
-	},
-};
-static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources);
-#else
-#define omap2_mbox_resources		NULL
-#define omap2_mbox_resources_sz		0
-#endif
-
-#ifdef CONFIG_ARCH_OMAP3
-static struct resource omap3_mbox_resources[] = {
-	{
-		.start		= OMAP34XX_MAILBOX_BASE,
-		.end		= OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
-		.flags		= IORESOURCE_MEM,
-	},
-	{
-		.start		= INT_24XX_MAIL_U0_MPU,
-		.flags		= IORESOURCE_IRQ,
-		.name		= "dsp",
-	},
-};
-static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources);
-#else
-#define omap3_mbox_resources		NULL
-#define omap3_mbox_resources_sz		0
-#endif
-
-#ifdef CONFIG_ARCH_OMAP4
-
-#define OMAP4_MBOX_REG_SIZE	0x130
-static struct resource omap4_mbox_resources[] = {
-	{
-		.start          = OMAP44XX_MAILBOX_BASE,
-		.end            = OMAP44XX_MAILBOX_BASE +
-					OMAP4_MBOX_REG_SIZE - 1,
-		.flags          = IORESOURCE_MEM,
-	},
-	{
-		.start          = OMAP44XX_IRQ_MAIL_U0,
-		.flags          = IORESOURCE_IRQ,
-		.name		= "mbox",
+static struct omap_device_pm_latency mbox_latencies[] = {
+	[0] = {
+		.activate_func = omap_device_enable_hwmods,
+		.deactivate_func = omap_device_idle_hwmods,
+		.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
 	},
 };
-static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources);
-#else
-#define omap4_mbox_resources		NULL
-#define omap4_mbox_resources_sz		0
-#endif
-
-static struct platform_device mbox_device = {
-	.name		= "omap-mailbox",
-	.id		= -1,
-};
 
 static inline void omap_init_mbox(void)
 {
-	if (cpu_is_omap24xx()) {
-		mbox_device.resource = omap2_mbox_resources;
-		mbox_device.num_resources = omap2_mbox_resources_sz;
-	} else if (cpu_is_omap34xx()) {
-		mbox_device.resource = omap3_mbox_resources;
-		mbox_device.num_resources = omap3_mbox_resources_sz;
-	} else if (cpu_is_omap44xx()) {
-		mbox_device.resource = omap4_mbox_resources;
-		mbox_device.num_resources = omap4_mbox_resources_sz;
-	} else {
-		pr_err("%s: platform not supported\n", __func__);
+	struct omap_hwmod *oh;
+	struct omap_device *od;
+
+	oh = omap_hwmod_lookup("mailbox");
+	if (!oh) {
+		pr_err("%s: unable to find hwmod\n", __func__);
 		return;
 	}
-	platform_device_register(&mbox_device);
+
+	od = omap_device_build("omap-mailbox", -1, oh, NULL, 0,
+				mbox_latencies, ARRAY_SIZE(mbox_latencies), 0);
+	WARN(IS_ERR(od), "%s: could not build device, err %ld\n",
+						__func__, PTR_ERR(od));
 }
 #else
 static inline void omap_init_mbox(void) { }
-- 
1.7.1


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

* [PATCH v5 4/5] OMAP: mailbox: build device using omap_device/omap_hwmod
@ 2011-02-02 19:27   ` Omar Ramirez Luna
  0 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Felipe Contreras <felipe.contreras@gmail.com>

Remove static platform_device and resource data within
omap mailbox driver; use the one defined in the hwmod
database along with omap_device framework for device
build and registration.

Add device latency functions to be used, so clock can be
enabled and sysconfig is configured.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 arch/arm/mach-omap2/devices.c |   98 +++++++----------------------------------
 1 files changed, 16 insertions(+), 82 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 2c9c912..826bea0 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -142,95 +142,29 @@ static inline void omap_init_camera(void)
 #endif
 
 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
-
-#define MBOX_REG_SIZE   0x120
-
-#ifdef CONFIG_ARCH_OMAP2
-static struct resource omap2_mbox_resources[] = {
-	{
-		.start		= OMAP24XX_MAILBOX_BASE,
-		.end		= OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
-		.flags		= IORESOURCE_MEM,
-	},
-	{
-		.start		= INT_24XX_MAIL_U0_MPU,
-		.flags		= IORESOURCE_IRQ,
-		.name		= "dsp",
-	},
-	{
-		.start		= INT_24XX_MAIL_U3_MPU,
-		.flags		= IORESOURCE_IRQ,
-		.name		= "iva",
-	},
-};
-static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources);
-#else
-#define omap2_mbox_resources		NULL
-#define omap2_mbox_resources_sz		0
-#endif
-
-#ifdef CONFIG_ARCH_OMAP3
-static struct resource omap3_mbox_resources[] = {
-	{
-		.start		= OMAP34XX_MAILBOX_BASE,
-		.end		= OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
-		.flags		= IORESOURCE_MEM,
-	},
-	{
-		.start		= INT_24XX_MAIL_U0_MPU,
-		.flags		= IORESOURCE_IRQ,
-		.name		= "dsp",
-	},
-};
-static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources);
-#else
-#define omap3_mbox_resources		NULL
-#define omap3_mbox_resources_sz		0
-#endif
-
-#ifdef CONFIG_ARCH_OMAP4
-
-#define OMAP4_MBOX_REG_SIZE	0x130
-static struct resource omap4_mbox_resources[] = {
-	{
-		.start          = OMAP44XX_MAILBOX_BASE,
-		.end            = OMAP44XX_MAILBOX_BASE +
-					OMAP4_MBOX_REG_SIZE - 1,
-		.flags          = IORESOURCE_MEM,
-	},
-	{
-		.start          = OMAP44XX_IRQ_MAIL_U0,
-		.flags          = IORESOURCE_IRQ,
-		.name		= "mbox",
+static struct omap_device_pm_latency mbox_latencies[] = {
+	[0] = {
+		.activate_func = omap_device_enable_hwmods,
+		.deactivate_func = omap_device_idle_hwmods,
+		.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
 	},
 };
-static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources);
-#else
-#define omap4_mbox_resources		NULL
-#define omap4_mbox_resources_sz		0
-#endif
-
-static struct platform_device mbox_device = {
-	.name		= "omap-mailbox",
-	.id		= -1,
-};
 
 static inline void omap_init_mbox(void)
 {
-	if (cpu_is_omap24xx()) {
-		mbox_device.resource = omap2_mbox_resources;
-		mbox_device.num_resources = omap2_mbox_resources_sz;
-	} else if (cpu_is_omap34xx()) {
-		mbox_device.resource = omap3_mbox_resources;
-		mbox_device.num_resources = omap3_mbox_resources_sz;
-	} else if (cpu_is_omap44xx()) {
-		mbox_device.resource = omap4_mbox_resources;
-		mbox_device.num_resources = omap4_mbox_resources_sz;
-	} else {
-		pr_err("%s: platform not supported\n", __func__);
+	struct omap_hwmod *oh;
+	struct omap_device *od;
+
+	oh = omap_hwmod_lookup("mailbox");
+	if (!oh) {
+		pr_err("%s: unable to find hwmod\n", __func__);
 		return;
 	}
-	platform_device_register(&mbox_device);
+
+	od = omap_device_build("omap-mailbox", -1, oh, NULL, 0,
+				mbox_latencies, ARRAY_SIZE(mbox_latencies), 0);
+	WARN(IS_ERR(od), "%s: could not build device, err %ld\n",
+						__func__, PTR_ERR(od));
 }
 #else
 static inline void omap_init_mbox(void) { }
-- 
1.7.1

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

* [PATCH v5 5/5] OMAP: mailbox: use runtime pm for clk and sysc handling
  2011-02-02 19:27 ` Omar Ramirez Luna
@ 2011-02-02 19:27   ` Omar Ramirez Luna
  -1 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: Tony Lindgren, Benoit Cousson; +Cc: Russell King, lo, lak, Omar Ramirez Luna

Use runtime pm APIs to enable/disable mailbox clocks and
to configure SYSC register.

Based on the patch sent by Felipe Contreras:
https://patchwork.kernel.org/patch/101662/

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 arch/arm/mach-omap2/mailbox.c |   67 ++++-------------------------------------
 1 files changed, 6 insertions(+), 61 deletions(-)

diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 394413d..4a387e2 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -14,12 +14,11 @@
 #include <linux/err.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/pm_runtime.h>
 #include <plat/mailbox.h>
 #include <mach/irqs.h>
 
 #define MAILBOX_REVISION		0x000
-#define MAILBOX_SYSCONFIG		0x010
-#define MAILBOX_SYSSTATUS		0x014
 #define MAILBOX_MESSAGE(m)		(0x040 + 4 * (m))
 #define MAILBOX_FIFOSTATUS(m)		(0x080 + 4 * (m))
 #define MAILBOX_MSGSTATUS(m)		(0x0c0 + 4 * (m))
@@ -33,17 +32,6 @@
 #define MAILBOX_IRQ_NEWMSG(m)		(1 << (2 * (m)))
 #define MAILBOX_IRQ_NOTFULL(m)		(1 << (2 * (m) + 1))
 
-/* SYSCONFIG: register bit definition */
-#define AUTOIDLE	(1 << 0)
-#define SOFTRESET	(1 << 1)
-#define SMARTIDLE	(2 << 3)
-#define OMAP4_SOFTRESET	(1 << 0)
-#define OMAP4_NOIDLE	(1 << 2)
-#define OMAP4_SMARTIDLE	(2 << 2)
-
-/* SYSSTATUS: register bit definition */
-#define RESETDONE	(1 << 0)
-
 #define MBOX_REG_SIZE			0x120
 
 #define OMAP4_MBOX_REG_SIZE		0x130
@@ -70,8 +58,6 @@ struct omap_mbox2_priv {
 	unsigned long irqdisable;
 };
 
-static struct clk *mbox_ick_handle;
-
 static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
 				  omap_mbox_type_t irq);
 
@@ -89,53 +75,13 @@ static inline void mbox_write_reg(u32 val, size_t ofs)
 static int omap2_mbox_startup(struct omap_mbox *mbox)
 {
 	u32 l;
-	unsigned long timeout;
 
-	mbox_ick_handle = clk_get(NULL, "mailboxes_ick");
-	if (IS_ERR(mbox_ick_handle)) {
-		printk(KERN_ERR "Could not get mailboxes_ick: %ld\n",
-			PTR_ERR(mbox_ick_handle));
-		return PTR_ERR(mbox_ick_handle);
-	}
-	clk_enable(mbox_ick_handle);
-
-	if (cpu_is_omap44xx()) {
-		mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG);
-		timeout = jiffies + msecs_to_jiffies(20);
-		do {
-			l = mbox_read_reg(MAILBOX_SYSCONFIG);
-			if (!(l & OMAP4_SOFTRESET))
-				break;
-		} while (!time_after(jiffies, timeout));
-
-		if (l & OMAP4_SOFTRESET) {
-			pr_err("Can't take mailbox out of reset\n");
-			return -ENODEV;
-		}
-	} else {
-		mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG);
-		timeout = jiffies + msecs_to_jiffies(20);
-		do {
-			l = mbox_read_reg(MAILBOX_SYSSTATUS);
-			if (l & RESETDONE)
-				break;
-		} while (!time_after(jiffies, timeout));
-
-		if (!(l & RESETDONE)) {
-			pr_err("Can't take mailbox out of reset\n");
-			return -ENODEV;
-		}
-	}
+	pm_runtime_enable(mbox->dev->parent);
+	pm_runtime_get_sync(mbox->dev->parent);
 
 	l = mbox_read_reg(MAILBOX_REVISION);
 	pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f));
 
-	if (cpu_is_omap44xx())
-		l = OMAP4_SMARTIDLE;
-	else
-		l = SMARTIDLE | AUTOIDLE;
-	mbox_write_reg(l, MAILBOX_SYSCONFIG);
-
 	omap2_mbox_enable_irq(mbox, IRQ_RX);
 
 	return 0;
@@ -143,9 +89,8 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
 
 static void omap2_mbox_shutdown(struct omap_mbox *mbox)
 {
-	clk_disable(mbox_ick_handle);
-	clk_put(mbox_ick_handle);
-	mbox_ick_handle = NULL;
+	pm_runtime_put_sync(mbox->dev->parent);
+	pm_runtime_disable(mbox->dev->parent);
 }
 
 /* Mailbox FIFO handle functions */
-- 
1.7.1


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

* [PATCH v5 5/5] OMAP: mailbox: use runtime pm for clk and sysc handling
@ 2011-02-02 19:27   ` Omar Ramirez Luna
  0 siblings, 0 replies; 40+ messages in thread
From: Omar Ramirez Luna @ 2011-02-02 19:27 UTC (permalink / raw)
  To: linux-arm-kernel

Use runtime pm APIs to enable/disable mailbox clocks and
to configure SYSC register.

Based on the patch sent by Felipe Contreras:
https://patchwork.kernel.org/patch/101662/

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 arch/arm/mach-omap2/mailbox.c |   67 ++++-------------------------------------
 1 files changed, 6 insertions(+), 61 deletions(-)

diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 394413d..4a387e2 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -14,12 +14,11 @@
 #include <linux/err.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/pm_runtime.h>
 #include <plat/mailbox.h>
 #include <mach/irqs.h>
 
 #define MAILBOX_REVISION		0x000
-#define MAILBOX_SYSCONFIG		0x010
-#define MAILBOX_SYSSTATUS		0x014
 #define MAILBOX_MESSAGE(m)		(0x040 + 4 * (m))
 #define MAILBOX_FIFOSTATUS(m)		(0x080 + 4 * (m))
 #define MAILBOX_MSGSTATUS(m)		(0x0c0 + 4 * (m))
@@ -33,17 +32,6 @@
 #define MAILBOX_IRQ_NEWMSG(m)		(1 << (2 * (m)))
 #define MAILBOX_IRQ_NOTFULL(m)		(1 << (2 * (m) + 1))
 
-/* SYSCONFIG: register bit definition */
-#define AUTOIDLE	(1 << 0)
-#define SOFTRESET	(1 << 1)
-#define SMARTIDLE	(2 << 3)
-#define OMAP4_SOFTRESET	(1 << 0)
-#define OMAP4_NOIDLE	(1 << 2)
-#define OMAP4_SMARTIDLE	(2 << 2)
-
-/* SYSSTATUS: register bit definition */
-#define RESETDONE	(1 << 0)
-
 #define MBOX_REG_SIZE			0x120
 
 #define OMAP4_MBOX_REG_SIZE		0x130
@@ -70,8 +58,6 @@ struct omap_mbox2_priv {
 	unsigned long irqdisable;
 };
 
-static struct clk *mbox_ick_handle;
-
 static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
 				  omap_mbox_type_t irq);
 
@@ -89,53 +75,13 @@ static inline void mbox_write_reg(u32 val, size_t ofs)
 static int omap2_mbox_startup(struct omap_mbox *mbox)
 {
 	u32 l;
-	unsigned long timeout;
 
-	mbox_ick_handle = clk_get(NULL, "mailboxes_ick");
-	if (IS_ERR(mbox_ick_handle)) {
-		printk(KERN_ERR "Could not get mailboxes_ick: %ld\n",
-			PTR_ERR(mbox_ick_handle));
-		return PTR_ERR(mbox_ick_handle);
-	}
-	clk_enable(mbox_ick_handle);
-
-	if (cpu_is_omap44xx()) {
-		mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG);
-		timeout = jiffies + msecs_to_jiffies(20);
-		do {
-			l = mbox_read_reg(MAILBOX_SYSCONFIG);
-			if (!(l & OMAP4_SOFTRESET))
-				break;
-		} while (!time_after(jiffies, timeout));
-
-		if (l & OMAP4_SOFTRESET) {
-			pr_err("Can't take mailbox out of reset\n");
-			return -ENODEV;
-		}
-	} else {
-		mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG);
-		timeout = jiffies + msecs_to_jiffies(20);
-		do {
-			l = mbox_read_reg(MAILBOX_SYSSTATUS);
-			if (l & RESETDONE)
-				break;
-		} while (!time_after(jiffies, timeout));
-
-		if (!(l & RESETDONE)) {
-			pr_err("Can't take mailbox out of reset\n");
-			return -ENODEV;
-		}
-	}
+	pm_runtime_enable(mbox->dev->parent);
+	pm_runtime_get_sync(mbox->dev->parent);
 
 	l = mbox_read_reg(MAILBOX_REVISION);
 	pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f));
 
-	if (cpu_is_omap44xx())
-		l = OMAP4_SMARTIDLE;
-	else
-		l = SMARTIDLE | AUTOIDLE;
-	mbox_write_reg(l, MAILBOX_SYSCONFIG);
-
 	omap2_mbox_enable_irq(mbox, IRQ_RX);
 
 	return 0;
@@ -143,9 +89,8 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
 
 static void omap2_mbox_shutdown(struct omap_mbox *mbox)
 {
-	clk_disable(mbox_ick_handle);
-	clk_put(mbox_ick_handle);
-	mbox_ick_handle = NULL;
+	pm_runtime_put_sync(mbox->dev->parent);
+	pm_runtime_disable(mbox->dev->parent);
 }
 
 /* Mailbox FIFO handle functions */
-- 
1.7.1

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

* Re: [PATCH v5 0/5] omap: mailbox: hwmod support
  2011-02-02 19:27 ` Omar Ramirez Luna
@ 2011-02-08 23:44   ` Kevin Hilman
  -1 siblings, 0 replies; 40+ messages in thread
From: Kevin Hilman @ 2011-02-08 23:44 UTC (permalink / raw)
  To: Omar Ramirez Luna; +Cc: Tony Lindgren, Benoit Cousson, Russell King, lo, lak

Omar Ramirez Luna <omar.ramirez@ti.com> writes:

> Mailbox hwmod support for OMAP 2,3,4.
>
> This was tested on OMAP3 (3430, 3630), minor testing
> was made on OMAP4.
>
> No testing on OMAP2 since I don't have the hardware.

Reviewed-by: Kevin Hilman <khilman@ti.com>

But still needs sanity testing on OMAP2.

Kevin

> Highlights from v5 include the comments received from
> previous version v4[1].
>
> Benoit Cousson (1):
>   OMAP4: hwmod data: add mailbox data
>
> Felipe Contreras (2):
>   OMAP3: hwmod data: add mailbox data
>   OMAP: mailbox: build device using omap_device/omap_hwmod
>
> Omar Ramirez Luna (1):
>   OMAP: mailbox: use runtime pm for clk and sysc handling
>
> omar ramirez (1):
>   OMAP2: hwmod data: add mailbox data
>
>  arch/arm/mach-omap2/devices.c              |   98 +++++-----------------------
>  arch/arm/mach-omap2/mailbox.c              |   67 ++-----------------
>  arch/arm/mach-omap2/omap_hwmod_2420_data.c |   74 +++++++++++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_2430_data.c |   73 +++++++++++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   72 ++++++++++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   67 +++++++++++++++++++
>  6 files changed, 308 insertions(+), 143 deletions(-)
>
> ---
> [1] http://bit.ly/gfLaIs
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 0/5] omap: mailbox: hwmod support
@ 2011-02-08 23:44   ` Kevin Hilman
  0 siblings, 0 replies; 40+ messages in thread
From: Kevin Hilman @ 2011-02-08 23:44 UTC (permalink / raw)
  To: linux-arm-kernel

Omar Ramirez Luna <omar.ramirez@ti.com> writes:

> Mailbox hwmod support for OMAP 2,3,4.
>
> This was tested on OMAP3 (3430, 3630), minor testing
> was made on OMAP4.
>
> No testing on OMAP2 since I don't have the hardware.

Reviewed-by: Kevin Hilman <khilman@ti.com>

But still needs sanity testing on OMAP2.

Kevin

> Highlights from v5 include the comments received from
> previous version v4[1].
>
> Benoit Cousson (1):
>   OMAP4: hwmod data: add mailbox data
>
> Felipe Contreras (2):
>   OMAP3: hwmod data: add mailbox data
>   OMAP: mailbox: build device using omap_device/omap_hwmod
>
> Omar Ramirez Luna (1):
>   OMAP: mailbox: use runtime pm for clk and sysc handling
>
> omar ramirez (1):
>   OMAP2: hwmod data: add mailbox data
>
>  arch/arm/mach-omap2/devices.c              |   98 +++++-----------------------
>  arch/arm/mach-omap2/mailbox.c              |   67 ++-----------------
>  arch/arm/mach-omap2/omap_hwmod_2420_data.c |   74 +++++++++++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_2430_data.c |   73 +++++++++++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   72 ++++++++++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   67 +++++++++++++++++++
>  6 files changed, 308 insertions(+), 143 deletions(-)
>
> ---
> [1] http://bit.ly/gfLaIs
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v5 0/5] omap: mailbox: hwmod support
  2011-02-02 19:27 ` Omar Ramirez Luna
@ 2011-02-09 18:32   ` Tony Lindgren
  -1 siblings, 0 replies; 40+ messages in thread
From: Tony Lindgren @ 2011-02-09 18:32 UTC (permalink / raw)
  To: Hiroshi DOYU; +Cc: Benoit Cousson, Russell King, lo, lak, Omar Ramirez Luna

* Omar Ramirez Luna <omar.ramirez@ti.com> [110202 11:37]:
> Mailbox hwmod support for OMAP 2,3,4.

Hiroshi, any comments on these?

Regards,

Tony

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

* [PATCH v5 0/5] omap: mailbox: hwmod support
@ 2011-02-09 18:32   ` Tony Lindgren
  0 siblings, 0 replies; 40+ messages in thread
From: Tony Lindgren @ 2011-02-09 18:32 UTC (permalink / raw)
  To: linux-arm-kernel

* Omar Ramirez Luna <omar.ramirez@ti.com> [110202 11:37]:
> Mailbox hwmod support for OMAP 2,3,4.

Hiroshi, any comments on these?

Regards,

Tony

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

* Re: [PATCH v5 0/5] omap: mailbox: hwmod support
  2011-02-02 19:27 ` Omar Ramirez Luna
@ 2011-02-10  5:34   ` Poddar, Sourav
  -1 siblings, 0 replies; 40+ messages in thread
From: Poddar, Sourav @ 2011-02-10  5:34 UTC (permalink / raw)
  To: Omar Ramirez Luna; +Cc: Tony Lindgren, Benoit Cousson, lo, Russell King, lak

On Thu, Feb 3, 2011 at 12:57 AM, Omar Ramirez Luna <omar.ramirez@ti.com> wrote:
> Mailbox hwmod support for OMAP 2,3,4.
>
> This was tested on OMAP3 (3430, 3630), minor testing
> was made on OMAP4.
>
> No testing on OMAP2 since I don't have the hardware.
>
> Highlights from v5 include the comments received from
> previous version v4[1].
>
> Benoit Cousson (1):
>  OMAP4: hwmod data: add mailbox data
>
> Felipe Contreras (2):
>  OMAP3: hwmod data: add mailbox data
>  OMAP: mailbox: build device using omap_device/omap_hwmod
>
> Omar Ramirez Luna (1):
>  OMAP: mailbox: use runtime pm for clk and sysc handling
>
> omar ramirez (1):
>  OMAP2: hwmod data: add mailbox data
>
>  arch/arm/mach-omap2/devices.c              |   98 +++++-----------------------
>  arch/arm/mach-omap2/mailbox.c              |   67 ++-----------------
>  arch/arm/mach-omap2/omap_hwmod_2420_data.c |   74 +++++++++++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_2430_data.c |   73 +++++++++++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   72 ++++++++++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   67 +++++++++++++++++++
>  6 files changed, 308 insertions(+), 143 deletions(-)

Boot tested mainline v2.6.38-rc4 along with this 5 patch series on
Omap 2420,2430 SDPs.

Tested-by: Sourav Poddar<sourav.poddar@ti.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 0/5] omap: mailbox: hwmod support
@ 2011-02-10  5:34   ` Poddar, Sourav
  0 siblings, 0 replies; 40+ messages in thread
From: Poddar, Sourav @ 2011-02-10  5:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 3, 2011 at 12:57 AM, Omar Ramirez Luna <omar.ramirez@ti.com> wrote:
> Mailbox hwmod support for OMAP 2,3,4.
>
> This was tested on OMAP3 (3430, 3630), minor testing
> was made on OMAP4.
>
> No testing on OMAP2 since I don't have the hardware.
>
> Highlights from v5 include the comments received from
> previous version v4[1].
>
> Benoit Cousson (1):
> ?OMAP4: hwmod data: add mailbox data
>
> Felipe Contreras (2):
> ?OMAP3: hwmod data: add mailbox data
> ?OMAP: mailbox: build device using omap_device/omap_hwmod
>
> Omar Ramirez Luna (1):
> ?OMAP: mailbox: use runtime pm for clk and sysc handling
>
> omar ramirez (1):
> ?OMAP2: hwmod data: add mailbox data
>
> ?arch/arm/mach-omap2/devices.c ? ? ? ? ? ? ?| ? 98 +++++-----------------------
> ?arch/arm/mach-omap2/mailbox.c ? ? ? ? ? ? ?| ? 67 ++-----------------
> ?arch/arm/mach-omap2/omap_hwmod_2420_data.c | ? 74 +++++++++++++++++++++
> ?arch/arm/mach-omap2/omap_hwmod_2430_data.c | ? 73 +++++++++++++++++++++
> ?arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | ? 72 ++++++++++++++++++++
> ?arch/arm/mach-omap2/omap_hwmod_44xx_data.c | ? 67 +++++++++++++++++++
> ?6 files changed, 308 insertions(+), 143 deletions(-)

Boot tested mainline v2.6.38-rc4 along with this 5 patch series on
Omap 2420,2430 SDPs.

Tested-by: Sourav Poddar<sourav.poddar@ti.com>

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

* Re: [PATCH v5 0/5] omap: mailbox: hwmod support
  2011-02-09 18:32   ` Tony Lindgren
@ 2011-02-10  6:01     ` Hiroshi DOYU
  -1 siblings, 0 replies; 40+ messages in thread
From: Hiroshi DOYU @ 2011-02-10  6:01 UTC (permalink / raw)
  To: tony; +Cc: b-cousson, linux, linux-omap, linux-arm-kernel, omar.ramirez

From: ext Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH v5 0/5] omap: mailbox: hwmod support
Date: Wed, 9 Feb 2011 10:32:19 -0800

> * Omar Ramirez Luna <omar.ramirez@ti.com> [110202 11:37]:
>> Mailbox hwmod support for OMAP 2,3,4.
> 
> Hiroshi, any comments on these?

Well, I haven't followed hwmod much. If Kevin is ok, ok for me.

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

* [PATCH v5 0/5] omap: mailbox: hwmod support
@ 2011-02-10  6:01     ` Hiroshi DOYU
  0 siblings, 0 replies; 40+ messages in thread
From: Hiroshi DOYU @ 2011-02-10  6:01 UTC (permalink / raw)
  To: linux-arm-kernel

From: ext Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH v5 0/5] omap: mailbox: hwmod support
Date: Wed, 9 Feb 2011 10:32:19 -0800

> * Omar Ramirez Luna <omar.ramirez@ti.com> [110202 11:37]:
>> Mailbox hwmod support for OMAP 2,3,4.
> 
> Hiroshi, any comments on these?

Well, I haven't followed hwmod much. If Kevin is ok, ok for me.

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

* Re: [PATCH v5 0/5] omap: mailbox: hwmod support
  2011-02-10  5:34   ` Poddar, Sourav
@ 2011-02-10 21:12     ` Kevin Hilman
  -1 siblings, 0 replies; 40+ messages in thread
From: Kevin Hilman @ 2011-02-10 21:12 UTC (permalink / raw)
  To: Poddar, Sourav
  Cc: Omar Ramirez Luna, Tony Lindgren, Benoit Cousson, lo, Russell King, lak

"Poddar, Sourav" <sourav.poddar@ti.com> writes:

> On Thu, Feb 3, 2011 at 12:57 AM, Omar Ramirez Luna <omar.ramirez@ti.com> wrote:
>> Mailbox hwmod support for OMAP 2,3,4.
>>
>> This was tested on OMAP3 (3430, 3630), minor testing
>> was made on OMAP4.
>>
>> No testing on OMAP2 since I don't have the hardware.
>>
>> Highlights from v5 include the comments received from
>> previous version v4[1].
>>
>> Benoit Cousson (1):
>>  OMAP4: hwmod data: add mailbox data
>>
>> Felipe Contreras (2):
>>  OMAP3: hwmod data: add mailbox data
>>  OMAP: mailbox: build device using omap_device/omap_hwmod
>>
>> Omar Ramirez Luna (1):
>>  OMAP: mailbox: use runtime pm for clk and sysc handling
>>
>> omar ramirez (1):
>>  OMAP2: hwmod data: add mailbox data
>>
>>  arch/arm/mach-omap2/devices.c              |   98 +++++-----------------------
>>  arch/arm/mach-omap2/mailbox.c              |   67 ++-----------------
>>  arch/arm/mach-omap2/omap_hwmod_2420_data.c |   74 +++++++++++++++++++++
>>  arch/arm/mach-omap2/omap_hwmod_2430_data.c |   73 +++++++++++++++++++++
>>  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   72 ++++++++++++++++++++
>>  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   67 +++++++++++++++++++
>>  6 files changed, 308 insertions(+), 143 deletions(-)
>
> Boot tested mainline v2.6.38-rc4 along with this 5 patch series on
> Omap 2420,2430 SDPs.
>
> Tested-by: Sourav Poddar<sourav.poddar@ti.com>

Boot testing is a start, but I'm pretty sure that bootup does not use
the mailbox on any of these platforms.  This needs to be tested with
something that actually uses the mailbox.

Kevin




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

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

* [PATCH v5 0/5] omap: mailbox: hwmod support
@ 2011-02-10 21:12     ` Kevin Hilman
  0 siblings, 0 replies; 40+ messages in thread
From: Kevin Hilman @ 2011-02-10 21:12 UTC (permalink / raw)
  To: linux-arm-kernel

"Poddar, Sourav" <sourav.poddar@ti.com> writes:

> On Thu, Feb 3, 2011 at 12:57 AM, Omar Ramirez Luna <omar.ramirez@ti.com> wrote:
>> Mailbox hwmod support for OMAP 2,3,4.
>>
>> This was tested on OMAP3 (3430, 3630), minor testing
>> was made on OMAP4.
>>
>> No testing on OMAP2 since I don't have the hardware.
>>
>> Highlights from v5 include the comments received from
>> previous version v4[1].
>>
>> Benoit Cousson (1):
>> ?OMAP4: hwmod data: add mailbox data
>>
>> Felipe Contreras (2):
>> ?OMAP3: hwmod data: add mailbox data
>> ?OMAP: mailbox: build device using omap_device/omap_hwmod
>>
>> Omar Ramirez Luna (1):
>> ?OMAP: mailbox: use runtime pm for clk and sysc handling
>>
>> omar ramirez (1):
>> ?OMAP2: hwmod data: add mailbox data
>>
>> ?arch/arm/mach-omap2/devices.c ? ? ? ? ? ? ?| ? 98 +++++-----------------------
>> ?arch/arm/mach-omap2/mailbox.c ? ? ? ? ? ? ?| ? 67 ++-----------------
>> ?arch/arm/mach-omap2/omap_hwmod_2420_data.c | ? 74 +++++++++++++++++++++
>> ?arch/arm/mach-omap2/omap_hwmod_2430_data.c | ? 73 +++++++++++++++++++++
>> ?arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | ? 72 ++++++++++++++++++++
>> ?arch/arm/mach-omap2/omap_hwmod_44xx_data.c | ? 67 +++++++++++++++++++
>> ?6 files changed, 308 insertions(+), 143 deletions(-)
>
> Boot tested mainline v2.6.38-rc4 along with this 5 patch series on
> Omap 2420,2430 SDPs.
>
> Tested-by: Sourav Poddar<sourav.poddar@ti.com>

Boot testing is a start, but I'm pretty sure that bootup does not use
the mailbox on any of these platforms.  This needs to be tested with
something that actually uses the mailbox.

Kevin

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

* Re: [PATCH v5 0/5] omap: mailbox: hwmod support
  2011-02-10  6:01     ` Hiroshi DOYU
@ 2011-02-11 16:37       ` Kevin Hilman
  -1 siblings, 0 replies; 40+ messages in thread
From: Kevin Hilman @ 2011-02-11 16:37 UTC (permalink / raw)
  To: Hiroshi DOYU
  Cc: tony, b-cousson, linux, linux-omap, linux-arm-kernel, omar.ramirez

Hi Hiroshi,

Hiroshi DOYU <Hiroshi.DOYU@nokia.com> writes:

> From: ext Tony Lindgren <tony@atomide.com>
> Subject: Re: [PATCH v5 0/5] omap: mailbox: hwmod support
> Date: Wed, 9 Feb 2011 10:32:19 -0800
>
>> * Omar Ramirez Luna <omar.ramirez@ti.com> [110202 11:37]:
>>> Mailbox hwmod support for OMAP 2,3,4.
>> 
>> Hiroshi, any comments on these?
>
> Well, I haven't followed hwmod much. If Kevin is ok, ok for me.

Do you have any simple standalone tests for mailbox (e.g. without
bridge/syslink) that can be used to so some sanity checking on these
driver changes?

Thanks,

Kevin

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

* [PATCH v5 0/5] omap: mailbox: hwmod support
@ 2011-02-11 16:37       ` Kevin Hilman
  0 siblings, 0 replies; 40+ messages in thread
From: Kevin Hilman @ 2011-02-11 16:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Hiroshi,

Hiroshi DOYU <Hiroshi.DOYU@nokia.com> writes:

> From: ext Tony Lindgren <tony@atomide.com>
> Subject: Re: [PATCH v5 0/5] omap: mailbox: hwmod support
> Date: Wed, 9 Feb 2011 10:32:19 -0800
>
>> * Omar Ramirez Luna <omar.ramirez@ti.com> [110202 11:37]:
>>> Mailbox hwmod support for OMAP 2,3,4.
>> 
>> Hiroshi, any comments on these?
>
> Well, I haven't followed hwmod much. If Kevin is ok, ok for me.

Do you have any simple standalone tests for mailbox (e.g. without
bridge/syslink) that can be used to so some sanity checking on these
driver changes?

Thanks,

Kevin

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

* Re: [PATCH v5 0/5] omap: mailbox: hwmod support
  2011-02-02 19:27 ` Omar Ramirez Luna
@ 2011-02-11 23:01   ` Kevin Hilman
  -1 siblings, 0 replies; 40+ messages in thread
From: Kevin Hilman @ 2011-02-11 23:01 UTC (permalink / raw)
  To: Omar Ramirez Luna; +Cc: Tony Lindgren, Benoit Cousson, Russell King, lo, lak

Omar Ramirez Luna <omar.ramirez@ti.com> writes:

> Mailbox hwmod support for OMAP 2,3,4.
>
> This was tested on OMAP3 (3430, 3630), minor testing
> was made on OMAP4.
>
> No testing on OMAP2 since I don't have the hardware.

To help in testing, I wrote a simple mailbox loopback test module for
OMAP2/3/4 that I used to do send and receive messages on the MPU.  This
can be used to test the mailbox without any DSP software.

I tested it against l-o master branch and found a couple bugs in the
mailbox driver (patches posted earlier today.)  

With those patches plus my test I can send & receieve a series of
messages on the MPU, which is enough to sanity test the basic sending
and receiving messages on the MPU.

I've tested the master branch, now it's your turn to use this test
module to validate this hmod conversion series.

The test module is available here:

    git://gitorious.org/omap-test/mailbox.git

Note that the current mailbox driver has hard-coded settings for the
receiver of messages.  While this should be configurable at runtime, I'm
not an expert on the mailbox IP so my test module includes a kernel
patch that changes these hard-coded settings of the first mbox (dsp on
OMAP2/3, mailbox-1 on OMAP4) so that my loopback tester will work.

Kevin


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

* [PATCH v5 0/5] omap: mailbox: hwmod support
@ 2011-02-11 23:01   ` Kevin Hilman
  0 siblings, 0 replies; 40+ messages in thread
From: Kevin Hilman @ 2011-02-11 23:01 UTC (permalink / raw)
  To: linux-arm-kernel

Omar Ramirez Luna <omar.ramirez@ti.com> writes:

> Mailbox hwmod support for OMAP 2,3,4.
>
> This was tested on OMAP3 (3430, 3630), minor testing
> was made on OMAP4.
>
> No testing on OMAP2 since I don't have the hardware.

To help in testing, I wrote a simple mailbox loopback test module for
OMAP2/3/4 that I used to do send and receive messages on the MPU.  This
can be used to test the mailbox without any DSP software.

I tested it against l-o master branch and found a couple bugs in the
mailbox driver (patches posted earlier today.)  

With those patches plus my test I can send & receieve a series of
messages on the MPU, which is enough to sanity test the basic sending
and receiving messages on the MPU.

I've tested the master branch, now it's your turn to use this test
module to validate this hmod conversion series.

The test module is available here:

    git://gitorious.org/omap-test/mailbox.git

Note that the current mailbox driver has hard-coded settings for the
receiver of messages.  While this should be configurable at runtime, I'm
not an expert on the mailbox IP so my test module includes a kernel
patch that changes these hard-coded settings of the first mbox (dsp on
OMAP2/3, mailbox-1 on OMAP4) so that my loopback tester will work.

Kevin

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

* Re: [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
  2011-02-02 19:27   ` Omar Ramirez Luna
@ 2011-02-14 15:00     ` Cousson, Benoit
  -1 siblings, 0 replies; 40+ messages in thread
From: Cousson, Benoit @ 2011-02-14 15:00 UTC (permalink / raw)
  To: Ramirez Luna, Omar; +Cc: Tony Lindgren, Russell King, lo, lak

Hi Omar,

I found one minor change wrt to the original that I'd like to understand 
better.

On 2/2/2011 8:27 PM, Ramirez Luna, Omar wrote:
> From: Benoit Cousson<b-cousson@ti.com>
>
> Mailbox hwmod data for omap4.
>
> Signed-off-by: Benoit Cousson<b-cousson@ti.com>
> Signed-off-by: Omar Ramirez Luna<omar.ramirez@ti.com>
> ---
>   arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   67 ++++++++++++++++++++++++++++
>   1 files changed, 67 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> index c2806bd..c495669 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> @@ -2001,6 +2001,70 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
>   	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
>   };
>
> +/*
> + * 'mailbox' class
> + * mailbox module allowing communication between the on-chip processors
> + * using a queued mailbox-interrupt mechanism.
> + */
> +
> +static struct omap_hwmod_class_sysconfig omap44xx_mailbox_sysc = {
> +	.rev_offs	= 0x0000,
> +	.sysc_offs	= 0x0010,
> +	.sysc_flags	= (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
> +			   SYSC_HAS_SOFTRESET),
> +	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
> +	.sysc_fields	=&omap_hwmod_sysc_type2,
> +};
> +
> +static struct omap_hwmod_class omap44xx_mailbox_hwmod_class = {
> +	.name = "mailbox",
> +	.sysc =&omap44xx_mailbox_sysc,
> +};
> +
> +/* mailbox */
> +static struct omap_hwmod omap44xx_mailbox_hwmod;
> +static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
> +	{ .name = "mbox", .irq = 26 + OMAP44XX_IRQ_GIC_START, },

The original entry was unnamed since it is an unique entry and thus does 
not need to be differentiate on this platform.

	{ .irq = 26 + OMAP44XX_IRQ_GIC_START },

Do you really need to have a name here? The strategy being to provide a 
name only if more than one entry exist.
It is perfectibility doable, I'm just trying to understand your rational.

Thanks,
Benoit

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

* [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
@ 2011-02-14 15:00     ` Cousson, Benoit
  0 siblings, 0 replies; 40+ messages in thread
From: Cousson, Benoit @ 2011-02-14 15:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Omar,

I found one minor change wrt to the original that I'd like to understand 
better.

On 2/2/2011 8:27 PM, Ramirez Luna, Omar wrote:
> From: Benoit Cousson<b-cousson@ti.com>
>
> Mailbox hwmod data for omap4.
>
> Signed-off-by: Benoit Cousson<b-cousson@ti.com>
> Signed-off-by: Omar Ramirez Luna<omar.ramirez@ti.com>
> ---
>   arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   67 ++++++++++++++++++++++++++++
>   1 files changed, 67 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> index c2806bd..c495669 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> @@ -2001,6 +2001,70 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
>   	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
>   };
>
> +/*
> + * 'mailbox' class
> + * mailbox module allowing communication between the on-chip processors
> + * using a queued mailbox-interrupt mechanism.
> + */
> +
> +static struct omap_hwmod_class_sysconfig omap44xx_mailbox_sysc = {
> +	.rev_offs	= 0x0000,
> +	.sysc_offs	= 0x0010,
> +	.sysc_flags	= (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
> +			   SYSC_HAS_SOFTRESET),
> +	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
> +	.sysc_fields	=&omap_hwmod_sysc_type2,
> +};
> +
> +static struct omap_hwmod_class omap44xx_mailbox_hwmod_class = {
> +	.name = "mailbox",
> +	.sysc =&omap44xx_mailbox_sysc,
> +};
> +
> +/* mailbox */
> +static struct omap_hwmod omap44xx_mailbox_hwmod;
> +static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
> +	{ .name = "mbox", .irq = 26 + OMAP44XX_IRQ_GIC_START, },

The original entry was unnamed since it is an unique entry and thus does 
not need to be differentiate on this platform.

	{ .irq = 26 + OMAP44XX_IRQ_GIC_START },

Do you really need to have a name here? The strategy being to provide a 
name only if more than one entry exist.
It is perfectibility doable, I'm just trying to understand your rational.

Thanks,
Benoit

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

* Re: [PATCH v5 0/5] omap: mailbox: hwmod support
  2011-02-11 23:01   ` Kevin Hilman
@ 2011-02-15 20:56     ` Ramirez Luna, Omar
  -1 siblings, 0 replies; 40+ messages in thread
From: Ramirez Luna, Omar @ 2011-02-15 20:56 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Tony Lindgren, Benoit Cousson, Russell King, lo, lak

Hi Kevin, Benoit,

On Fri, Feb 11, 2011 at 5:01 PM, Kevin Hilman <khilman@ti.com> wrote:
> Omar Ramirez Luna <omar.ramirez@ti.com> writes:
>
>> Mailbox hwmod support for OMAP 2,3,4.
>>
>> This was tested on OMAP3 (3430, 3630), minor testing
>> was made on OMAP4.
>>
>> No testing on OMAP2 since I don't have the hardware.
>
> To help in testing, I wrote a simple mailbox loopback test module for
> OMAP2/3/4 that I used to do send and receive messages on the MPU.  This
> can be used to test the mailbox without any DSP software.
>
> I tested it against l-o master branch and found a couple bugs in the
> mailbox driver (patches posted earlier today.)
>
> With those patches plus my test I can send & receieve a series of
> messages on the MPU, which is enough to sanity test the basic sending
> and receiving messages on the MPU.
>
> I've tested the master branch, now it's your turn to use this test
> module to validate this hmod conversion series.
>
> The test module is available here:
>
>    git://gitorious.org/omap-test/mailbox.git

I rechecked on OMAP3 (zoom2, zoom3) and OMAP4 (blaze), and
functionality hasn't changed with the hwmod support + Kevin's mbox
test.

On OMAP3, although functionality is ok with this patch set, I noticed
that the interface clock is not being disabled with its corresponding
pm_runtime_disable call. Previously, the driver enabled/disabled the
ick clock on demand, but now the clock stays enabled always (only
affected by the smart-idle feature, I presume).

Should this clock be placed in the main_clk field of omap_hwmod struct
instead of omap_hwmod_ocp_if, I moved it to ocp_if because of the ick
thing, any comment?

Regards,

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

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

* [PATCH v5 0/5] omap: mailbox: hwmod support
@ 2011-02-15 20:56     ` Ramirez Luna, Omar
  0 siblings, 0 replies; 40+ messages in thread
From: Ramirez Luna, Omar @ 2011-02-15 20:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kevin, Benoit,

On Fri, Feb 11, 2011 at 5:01 PM, Kevin Hilman <khilman@ti.com> wrote:
> Omar Ramirez Luna <omar.ramirez@ti.com> writes:
>
>> Mailbox hwmod support for OMAP 2,3,4.
>>
>> This was tested on OMAP3 (3430, 3630), minor testing
>> was made on OMAP4.
>>
>> No testing on OMAP2 since I don't have the hardware.
>
> To help in testing, I wrote a simple mailbox loopback test module for
> OMAP2/3/4 that I used to do send and receive messages on the MPU. ?This
> can be used to test the mailbox without any DSP software.
>
> I tested it against l-o master branch and found a couple bugs in the
> mailbox driver (patches posted earlier today.)
>
> With those patches plus my test I can send & receieve a series of
> messages on the MPU, which is enough to sanity test the basic sending
> and receiving messages on the MPU.
>
> I've tested the master branch, now it's your turn to use this test
> module to validate this hmod conversion series.
>
> The test module is available here:
>
> ? ?git://gitorious.org/omap-test/mailbox.git

I rechecked on OMAP3 (zoom2, zoom3) and OMAP4 (blaze), and
functionality hasn't changed with the hwmod support + Kevin's mbox
test.

On OMAP3, although functionality is ok with this patch set, I noticed
that the interface clock is not being disabled with its corresponding
pm_runtime_disable call. Previously, the driver enabled/disabled the
ick clock on demand, but now the clock stays enabled always (only
affected by the smart-idle feature, I presume).

Should this clock be placed in the main_clk field of omap_hwmod struct
instead of omap_hwmod_ocp_if, I moved it to ocp_if because of the ick
thing, any comment?

Regards,

Omar

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

* Re: [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
  2011-02-14 15:00     ` Cousson, Benoit
@ 2011-02-15 21:55       ` Ramirez Luna, Omar
  -1 siblings, 0 replies; 40+ messages in thread
From: Ramirez Luna, Omar @ 2011-02-15 21:55 UTC (permalink / raw)
  To: Cousson, Benoit; +Cc: Tony Lindgren, Russell King, lo, lak

Hi Benoit,

On Mon, Feb 14, 2011 at 9:00 AM, Cousson, Benoit <b-cousson@ti.com> wrote:
>> +static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
>> +       { .name = "mbox", .irq = 26 + OMAP44XX_IRQ_GIC_START, },
>
> The original entry was unnamed since it is an unique entry and thus does not
> need to be differentiate on this platform.
>
>        { .irq = 26 + OMAP44XX_IRQ_GIC_START },
>
> Do you really need to have a name here? The strategy being to provide a name
> only if more than one entry exist.
> It is perfectibility doable, I'm just trying to understand your rational.

It is this way instead of plain platform_get_irq because omap2420 has
two interrupt sources to MPU and mailbox driver uses
platform_get_irq_byname to get the irq number.

Regards,

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

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

* [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
@ 2011-02-15 21:55       ` Ramirez Luna, Omar
  0 siblings, 0 replies; 40+ messages in thread
From: Ramirez Luna, Omar @ 2011-02-15 21:55 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Benoit,

On Mon, Feb 14, 2011 at 9:00 AM, Cousson, Benoit <b-cousson@ti.com> wrote:
>> +static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
>> + ? ? ? { .name = "mbox", .irq = 26 + OMAP44XX_IRQ_GIC_START, },
>
> The original entry was unnamed since it is an unique entry and thus does not
> need to be differentiate on this platform.
>
> ? ? ? ?{ .irq = 26 + OMAP44XX_IRQ_GIC_START },
>
> Do you really need to have a name here? The strategy being to provide a name
> only if more than one entry exist.
> It is perfectibility doable, I'm just trying to understand your rational.

It is this way instead of plain platform_get_irq because omap2420 has
two interrupt sources to MPU and mailbox driver uses
platform_get_irq_byname to get the irq number.

Regards,

Omar

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

* Re: [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
  2011-02-15 21:55       ` Ramirez Luna, Omar
@ 2011-02-15 22:05         ` Cousson, Benoit
  -1 siblings, 0 replies; 40+ messages in thread
From: Cousson, Benoit @ 2011-02-15 22:05 UTC (permalink / raw)
  To: Ramirez Luna, Omar; +Cc: Tony Lindgren, Russell King, lo, lak

Hi Omar,

On 2/15/2011 10:55 PM, Ramirez Luna, Omar wrote:
> Hi Benoit,
>
> On Mon, Feb 14, 2011 at 9:00 AM, Cousson, Benoit<b-cousson@ti.com>  wrote:
>>> +static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
>>> +       { .name = "mbox", .irq = 26 + OMAP44XX_IRQ_GIC_START, },
>>
>> The original entry was unnamed since it is an unique entry and thus does not
>> need to be differentiate on this platform.
>>
>>         { .irq = 26 + OMAP44XX_IRQ_GIC_START },
>>
>> Do you really need to have a name here? The strategy being to provide a name
>> only if more than one entry exist.
>> It is perfectibility doable, I'm just trying to understand your rational.
>
> It is this way instead of plain platform_get_irq because omap2420 has
> two interrupt sources to MPU and mailbox driver uses
> platform_get_irq_byname to get the irq number.

This is what I was thinking, except that on OMAP2420 the names are:
+	{ .name = "dsp", .irq = 26, },
+	{ .name = "iva", .irq = 34, },

and on OMAP2430 and OMAP3
+	{ .name = "dsp", .irq = 26, },

so why is it named "mbox" on OMAP4?

If you have to do several platform_get_irq_byname to get this one, I'd 
prefer to get rid of that name for OMAP4. It will make mailbox irq 
consistent with the other hwmods.

Thanks,
Benoit


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

* [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
@ 2011-02-15 22:05         ` Cousson, Benoit
  0 siblings, 0 replies; 40+ messages in thread
From: Cousson, Benoit @ 2011-02-15 22:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Omar,

On 2/15/2011 10:55 PM, Ramirez Luna, Omar wrote:
> Hi Benoit,
>
> On Mon, Feb 14, 2011 at 9:00 AM, Cousson, Benoit<b-cousson@ti.com>  wrote:
>>> +static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
>>> +       { .name = "mbox", .irq = 26 + OMAP44XX_IRQ_GIC_START, },
>>
>> The original entry was unnamed since it is an unique entry and thus does not
>> need to be differentiate on this platform.
>>
>>         { .irq = 26 + OMAP44XX_IRQ_GIC_START },
>>
>> Do you really need to have a name here? The strategy being to provide a name
>> only if more than one entry exist.
>> It is perfectibility doable, I'm just trying to understand your rational.
>
> It is this way instead of plain platform_get_irq because omap2420 has
> two interrupt sources to MPU and mailbox driver uses
> platform_get_irq_byname to get the irq number.

This is what I was thinking, except that on OMAP2420 the names are:
+	{ .name = "dsp", .irq = 26, },
+	{ .name = "iva", .irq = 34, },

and on OMAP2430 and OMAP3
+	{ .name = "dsp", .irq = 26, },

so why is it named "mbox" on OMAP4?

If you have to do several platform_get_irq_byname to get this one, I'd 
prefer to get rid of that name for OMAP4. It will make mailbox irq 
consistent with the other hwmods.

Thanks,
Benoit

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

* Re: [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
  2011-02-15 22:05         ` Cousson, Benoit
@ 2011-02-16  0:13           ` Ramirez Luna, Omar
  -1 siblings, 0 replies; 40+ messages in thread
From: Ramirez Luna, Omar @ 2011-02-16  0:13 UTC (permalink / raw)
  To: Cousson, Benoit; +Cc: Tony Lindgren, lo, Russell King, lak

Hi,

On Tue, Feb 15, 2011 at 4:05 PM, Cousson, Benoit <b-cousson@ti.com> wrote:
>> It is this way instead of plain platform_get_irq because omap2420 has
>> two interrupt sources to MPU and mailbox driver uses
>> platform_get_irq_byname to get the irq number.
>
> This is what I was thinking, except that on OMAP2420 the names are:
> +       { .name = "dsp", .irq = 26, },
> +       { .name = "iva", .irq = 34, },
>
> and on OMAP2430 and OMAP3
> +       { .name = "dsp", .irq = 26, },
>
> so why is it named "mbox" on OMAP4?

I'm not very familiar with OMAP4 terminology... but IMHO, I guess
naming it dsp, would imply that this is a mailbox for the dsp, when
the interrupt can be generated by either the M3, dsp, I think even the
IVA can write into it.

> If you have to do several platform_get_irq_byname to get this one, I'd
> prefer to get rid of that name for OMAP4. It will make mailbox irq
> consistent with the other hwmods.

I was thinking to standardize the names to be mbox0..mboxN across all
the platforms, reason being that the mailbox also has capabilities to
be used not only by dsp or iva, by using a polling method.

So even if the mailbox in OMAP3 is called "dsp", it has 4 more queues
apart from the 2 used for messaging between arm and dsp, that could be
used even if tidspbridge wasn't there.

Did I get you correctly?

Regards,

Omar

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

* [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
@ 2011-02-16  0:13           ` Ramirez Luna, Omar
  0 siblings, 0 replies; 40+ messages in thread
From: Ramirez Luna, Omar @ 2011-02-16  0:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Tue, Feb 15, 2011 at 4:05 PM, Cousson, Benoit <b-cousson@ti.com> wrote:
>> It is this way instead of plain platform_get_irq because omap2420 has
>> two interrupt sources to MPU and mailbox driver uses
>> platform_get_irq_byname to get the irq number.
>
> This is what I was thinking, except that on OMAP2420 the names are:
> + ? ? ? { .name = "dsp", .irq = 26, },
> + ? ? ? { .name = "iva", .irq = 34, },
>
> and on OMAP2430 and OMAP3
> + ? ? ? { .name = "dsp", .irq = 26, },
>
> so why is it named "mbox" on OMAP4?

I'm not very familiar with OMAP4 terminology... but IMHO, I guess
naming it dsp, would imply that this is a mailbox for the dsp, when
the interrupt can be generated by either the M3, dsp, I think even the
IVA can write into it.

> If you have to do several platform_get_irq_byname to get this one, I'd
> prefer to get rid of that name for OMAP4. It will make mailbox irq
> consistent with the other hwmods.

I was thinking to standardize the names to be mbox0..mboxN across all
the platforms, reason being that the mailbox also has capabilities to
be used not only by dsp or iva, by using a polling method.

So even if the mailbox in OMAP3 is called "dsp", it has 4 more queues
apart from the 2 used for messaging between arm and dsp, that could be
used even if tidspbridge wasn't there.

Did I get you correctly?

Regards,

Omar

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

* Re: [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
  2011-02-16  0:13           ` Ramirez Luna, Omar
@ 2011-02-17 23:39             ` Tony Lindgren
  -1 siblings, 0 replies; 40+ messages in thread
From: Tony Lindgren @ 2011-02-17 23:39 UTC (permalink / raw)
  To: Ramirez Luna, Omar; +Cc: Cousson, Benoit, Russell King, lo, lak

* Ramirez Luna, Omar <omar.ramirez@ti.com> [110215 16:11]:
> 
> > If you have to do several platform_get_irq_byname to get this one, I'd
> > prefer to get rid of that name for OMAP4. It will make mailbox irq
> > consistent with the other hwmods.
> 
> I was thinking to standardize the names to be mbox0..mboxN across all
> the platforms, reason being that the mailbox also has capabilities to
> be used not only by dsp or iva, by using a polling method.
> 
> So even if the mailbox in OMAP3 is called "dsp", it has 4 more queues
> apart from the 2 used for messaging between arm and dsp, that could be
> used even if tidspbridge wasn't there.

So what's the status of this series? Can the rest of the patches
now be applied on top of the current omap-for-linus or do the names
still need fixing?

Tony

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

* [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
@ 2011-02-17 23:39             ` Tony Lindgren
  0 siblings, 0 replies; 40+ messages in thread
From: Tony Lindgren @ 2011-02-17 23:39 UTC (permalink / raw)
  To: linux-arm-kernel

* Ramirez Luna, Omar <omar.ramirez@ti.com> [110215 16:11]:
> 
> > If you have to do several platform_get_irq_byname to get this one, I'd
> > prefer to get rid of that name for OMAP4. It will make mailbox irq
> > consistent with the other hwmods.
> 
> I was thinking to standardize the names to be mbox0..mboxN across all
> the platforms, reason being that the mailbox also has capabilities to
> be used not only by dsp or iva, by using a polling method.
> 
> So even if the mailbox in OMAP3 is called "dsp", it has 4 more queues
> apart from the 2 used for messaging between arm and dsp, that could be
> used even if tidspbridge wasn't there.

So what's the status of this series? Can the rest of the patches
now be applied on top of the current omap-for-linus or do the names
still need fixing?

Tony

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

* Re: [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
  2011-02-17 23:39             ` Tony Lindgren
@ 2011-02-18  0:24               ` Ramirez Luna, Omar
  -1 siblings, 0 replies; 40+ messages in thread
From: Ramirez Luna, Omar @ 2011-02-18  0:24 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Cousson, Benoit, Russell King, lo, lak

Hi Tony,

On Thu, Feb 17, 2011 at 5:39 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Ramirez Luna, Omar <omar.ramirez@ti.com> [110215 16:11]:
>>
>> > If you have to do several platform_get_irq_byname to get this one, I'd
>> > prefer to get rid of that name for OMAP4. It will make mailbox irq
>> > consistent with the other hwmods.
>>
>> I was thinking to standardize the names to be mbox0..mboxN across all
>> the platforms, reason being that the mailbox also has capabilities to
>> be used not only by dsp or iva, by using a polling method.
>>
>> So even if the mailbox in OMAP3 is called "dsp", it has 4 more queues
>> apart from the 2 used for messaging between arm and dsp, that could be
>> used even if tidspbridge wasn't there.
>
> So what's the status of this series? Can the rest of the patches
> now be applied on top of the current omap-for-linus or do the names
> still need fixing?

I'm going to remove the names for the hwmods with a single irq. And
change the interface clock to be the main_clk, so it can be disabled
when runtime pm is disabled.

I won't resend the patch for OMAP4 hwmod data, as this was send
earlier by Benoit.

Regards,

Omar

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

* [PATCH v5 3/5] OMAP4: hwmod data: add mailbox data
@ 2011-02-18  0:24               ` Ramirez Luna, Omar
  0 siblings, 0 replies; 40+ messages in thread
From: Ramirez Luna, Omar @ 2011-02-18  0:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tony,

On Thu, Feb 17, 2011 at 5:39 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Ramirez Luna, Omar <omar.ramirez@ti.com> [110215 16:11]:
>>
>> > If you have to do several platform_get_irq_byname to get this one, I'd
>> > prefer to get rid of that name for OMAP4. It will make mailbox irq
>> > consistent with the other hwmods.
>>
>> I was thinking to standardize the names to be mbox0..mboxN across all
>> the platforms, reason being that the mailbox also has capabilities to
>> be used not only by dsp or iva, by using a polling method.
>>
>> So even if the mailbox in OMAP3 is called "dsp", it has 4 more queues
>> apart from the 2 used for messaging between arm and dsp, that could be
>> used even if tidspbridge wasn't there.
>
> So what's the status of this series? Can the rest of the patches
> now be applied on top of the current omap-for-linus or do the names
> still need fixing?

I'm going to remove the names for the hwmods with a single irq. And
change the interface clock to be the main_clk, so it can be disabled
when runtime pm is disabled.

I won't resend the patch for OMAP4 hwmod data, as this was send
earlier by Benoit.

Regards,

Omar

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

end of thread, other threads:[~2011-02-18  0:25 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 19:27 [PATCH v5 0/5] omap: mailbox: hwmod support Omar Ramirez Luna
2011-02-02 19:27 ` Omar Ramirez Luna
2011-02-02 19:27 ` [PATCH v5 1/5] OMAP2: hwmod data: add mailbox data Omar Ramirez Luna
2011-02-02 19:27   ` Omar Ramirez Luna
2011-02-02 19:27 ` [PATCH v5 2/5] OMAP3: " Omar Ramirez Luna
2011-02-02 19:27   ` Omar Ramirez Luna
2011-02-02 19:27 ` [PATCH v5 3/5] OMAP4: " Omar Ramirez Luna
2011-02-02 19:27   ` Omar Ramirez Luna
2011-02-14 15:00   ` Cousson, Benoit
2011-02-14 15:00     ` Cousson, Benoit
2011-02-15 21:55     ` Ramirez Luna, Omar
2011-02-15 21:55       ` Ramirez Luna, Omar
2011-02-15 22:05       ` Cousson, Benoit
2011-02-15 22:05         ` Cousson, Benoit
2011-02-16  0:13         ` Ramirez Luna, Omar
2011-02-16  0:13           ` Ramirez Luna, Omar
2011-02-17 23:39           ` Tony Lindgren
2011-02-17 23:39             ` Tony Lindgren
2011-02-18  0:24             ` Ramirez Luna, Omar
2011-02-18  0:24               ` Ramirez Luna, Omar
2011-02-02 19:27 ` [PATCH v5 4/5] OMAP: mailbox: build device using omap_device/omap_hwmod Omar Ramirez Luna
2011-02-02 19:27   ` Omar Ramirez Luna
2011-02-02 19:27 ` [PATCH v5 5/5] OMAP: mailbox: use runtime pm for clk and sysc handling Omar Ramirez Luna
2011-02-02 19:27   ` Omar Ramirez Luna
2011-02-08 23:44 ` [PATCH v5 0/5] omap: mailbox: hwmod support Kevin Hilman
2011-02-08 23:44   ` Kevin Hilman
2011-02-09 18:32 ` Tony Lindgren
2011-02-09 18:32   ` Tony Lindgren
2011-02-10  6:01   ` Hiroshi DOYU
2011-02-10  6:01     ` Hiroshi DOYU
2011-02-11 16:37     ` Kevin Hilman
2011-02-11 16:37       ` Kevin Hilman
2011-02-10  5:34 ` Poddar, Sourav
2011-02-10  5:34   ` Poddar, Sourav
2011-02-10 21:12   ` Kevin Hilman
2011-02-10 21:12     ` Kevin Hilman
2011-02-11 23:01 ` Kevin Hilman
2011-02-11 23:01   ` Kevin Hilman
2011-02-15 20:56   ` Ramirez Luna, Omar
2011-02-15 20:56     ` Ramirez Luna, Omar

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.