Skip to contentSkip to conversation

Cleanup legacy OMAP mailbox support

PATCH New Suman Anna 3 participants 7 messages Sep 14, 2015 – Jan 21, 2016

Subsystems (4)
lore
Share & tools
lore

Suman Anna

author
#0 lore raw

cover Cleanup legacy OMAP mailbox support

Hi Tony,

The following series removes the legacy platform device creation for OMAP mailbox devices. I will remove the platform data file alongside the non-DT support cleanup in the driver.

Patches based on 4.3-rc1 + the patch on mach-omap2/devices.c that removes the OMAP3 ISP instantiation in legacy-mode [1]. The hwmod cleanup patch can be picked up independently if needed - it will just fail to create the legacy devices in omap_init_mbox(). These are only build tested and boot tested on OMAP3 in DT-mode, as I do not have any platforms where I can still perform a legacy-style boot.

regards
Suman

[1] https://patchwork.kernel.org/patch/6806891/

Suman Anna (2):
ARM: OMAP2+: Remove legacy mailbox device instantiation
ARM: OMAP3: hwmod data: Remove legacy mailbox data and addrs

 arch/arm/mach-omap2/devices.c              | 28 ----------------------------
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 29 -----------------------------
 2 files changed, 57 deletions(-)
Signature · 1 line
2.5.0
author
#1 lore raw

PATCH 1/2 ARM: OMAP2+: Remove legacy mailbox device instantiation

The legacy-style mailbox device creation is supported currently only for OMAP3, as all other SoCs are DT-boot only. Even on this SoC, there are no client drivers that utilize these mailbox devices. So, clean up the legacy-style mailbox device instantiation logic. The mailbox devices are already present and supported for the DT boot on OMAP3.

---
 arch/arm/mach-omap2/devices.c | 28 ----------------------------
 1 file changed, 28 deletions(-)
arch/arm/mach-omap2/devices.c +0 -28
index 9374da313e8e..f0f9901d90b0 100644
@@ -18,7 +18,6 @@
 #include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/pinctrl/machine.h>
-#include <linux/platform_data/mailbox-omap.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -66,32 +65,6 @@ static int __init omap3_l3_init(void)
 }
 omap_postcore_initcall(omap3_l3_init);
 
-#if defined(CONFIG_OMAP2PLUS_MBOX) || defined(CONFIG_OMAP2PLUS_MBOX_MODULE)
-static inline void __init omap_init_mbox(void)
-{
-	struct omap_hwmod *oh;
-	struct platform_device *pdev;
-	struct omap_mbox_pdata *pdata;
-
-	oh = omap_hwmod_lookup("mailbox");
-	if (!oh) {
-		pr_err("%s: unable to find hwmod\n", __func__);
-		return;
-	}
-	if (!oh->dev_attr) {
-		pr_err("%s: hwmod doesn't have valid attrs\n", __func__);
-		return;
-	}
-
-	pdata = (struct omap_mbox_pdata *)oh->dev_attr;
-	pdev = omap_device_build("omap-mailbox", -1, oh, pdata, sizeof(*pdata));
-	WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
-						__func__, PTR_ERR(pdev));
-}
-#else
-static inline void omap_init_mbox(void) { }
-#endif /* CONFIG_OMAP2PLUS_MBOX */
-
 static inline void omap_init_sti(void) {}
 
 #if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
@@ -246,7 +219,6 @@ static int __init omap2_init_devices(void)
 	omap_init_audio();
 	/* If dtb is there, the devices will be created dynamically */
 	if (!of_have_populated_dt()) {
-		omap_init_mbox();
 		omap_init_mcspi();
 		omap_init_sham();
 		omap_init_aes();
Signature · 1 line
2.5.0
author
#2 lore raw

PATCH 1/2 ARM: OMAP2+: Remove legacy mailbox device instantiation

Hi Tony,

Quoted 7 lines · Suman Anna

The legacy-style mailbox device creation is supported currently only for OMAP3, as all other SoCs are DT-boot only. Even on this SoC, there are no client drivers that utilize these mailbox devices. So, clean up the legacy-style mailbox device instantiation logic. The mailbox devices are already present and supported for the DT boot on OMAP3.

Quoted 5 lines
---
 arch/arm/mach-omap2/devices.c | 28 ----------------------------
 1 file changed, 28 deletions(-)

Ping, can you pick up this patch for your cleanup branch? FYI, Paul is queueing Patch 2.

regards
Suman

author
#3 lore raw

PATCH 1/2 ARM: OMAP2+: Remove legacy mailbox device instantiation

Hi Tony,

Quoted 10 lines · Suman Anna

Hi Tony,

Quoted 7 lines · Suman Anna

The legacy-style mailbox device creation is supported currently only for OMAP3, as all other SoCs are DT-boot only. Even on this SoC, there are no client drivers that utilize these mailbox devices. So, clean up the legacy-style mailbox device instantiation logic. The mailbox devices are already present and supported for the DT boot on OMAP3.

Quoted 8 lines
Quoted 5 lines
---
 arch/arm/mach-omap2/devices.c | 28 ----------------------------
 1 file changed, 28 deletions(-)

Ping, can you pick up this patch for your cleanup branch? FYI, Paul is queueing Patch 2.

Just checking your staged branches and linux-next, looks like this was missed. Let me know if you want me to repost this patch.

regards
Suman

maintainer
#4 lore raw

PATCH 1/2 ARM: OMAP2+: Remove legacy mailbox device instantiation

Quoted 19 lines · Suman Anna

Hi Tony,

Quoted 16 lines · Suman Anna

Hi Tony,

Quoted 12 lines · Suman Anna

The legacy-style mailbox device creation is supported currently only for OMAP3, as all other SoCs are DT-boot only. Even on this SoC, there are no client drivers that utilize these mailbox devices. So, clean up the legacy-style mailbox device instantiation logic. The mailbox devices are already present and supported for the DT boot on OMAP3.

---
 arch/arm/mach-omap2/devices.c | 28 ----------------------------
 1 file changed, 28 deletions(-)
Quoted 5 lines
Quoted 2 lines

Ping, can you pick up this patch for your cleanup branch? FYI, Paul is queueing Patch 2.

Just checking your staged branches and linux-next, looks like this was missed. Let me know if you want me to repost this patch.

OK thanks applying into omap-for-v4.5/fixes.

Tony

author
#5 lore raw

PATCH 2/2 ARM: OMAP3: hwmod data: Remove legacy mailbox data and addrs

In reply to Suman Anna

Remove the mailbox attribute data, irq info and hwmod addr space data that are used for creating the legacy-style mailbox devices, there is no need for these as the support for legacy-mode for this IP is being dropped.

---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 29 -----------------------------
 1 file changed, 29 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 -29
index dc55f8dedf2c..aff78d5198d2 100644
@@ -26,7 +26,6 @@
 #include <linux/platform_data/asoc-ti-mcbsp.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/platform_data/iommu-omap.h>
-#include <linux/platform_data/mailbox-omap.h>
 #include <plat/dmtimer.h>
 
 #include "soc.h"
@@ -1506,26 +1505,9 @@ static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = {
 	.sysc = &omap3xxx_mailbox_sysc,
 };
 
-static struct omap_mbox_dev_info omap3xxx_mailbox_info[] = {
-	{ .name = "dsp", .tx_id = 0, .rx_id = 1 },
-};
-
-static struct omap_mbox_pdata omap3xxx_mailbox_attrs = {
-	.num_users	= 2,
-	.num_fifos	= 2,
-	.info_cnt	= ARRAY_SIZE(omap3xxx_mailbox_info),
-	.info		= omap3xxx_mailbox_info,
-};
-
-static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = {
-	{ .irq = 26 + OMAP_INTC_START, },
-	{ .irq = -1 },
-};
-
 static struct omap_hwmod omap3xxx_mailbox_hwmod = {
 	.name		= "mailbox",
 	.class		= &omap3xxx_mailbox_hwmod_class,
-	.mpu_irqs	= omap3xxx_mailbox_irqs,
 	.main_clk	= "mailboxes_ick",
 	.prcm		= {
 		.omap2 = {
@@ -1536,7 +1518,6 @@ static struct omap_hwmod omap3xxx_mailbox_hwmod = {
 			.idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT,
 		},
 	},
-	.dev_attr	= &omap3xxx_mailbox_attrs,
 };
 
 /*
@@ -3276,20 +3257,10 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3_sidetone = {
 	.user		= OCP_USER_MPU,
 };
 
-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,
-	.addr		= omap3xxx_mailbox_addrs,
 	.user		= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
Signature · 1 line
2.5.0
maintainer
#6 lore raw

PATCH 2/2 ARM: OMAP3: hwmod data: Remove legacy mailbox data and addrs

Quoted 6 lines · Suman Anna

Remove the mailbox attribute data, irq info and hwmod addr space data that are used for creating the legacy-style mailbox devices, there is no need for these as the support for legacy-mode for this IP is being dropped.

Thanks, queued.

- Paul