Skip to contentSkip to conversation

ARM: OMAP2+: am33xx: Change cpu_is_am33xx to soc_is_am33xx

PATCH RESEND New Vaibhav Hiremath 2 participants 8 messages Jul 3, 2012 – Jul 10, 2012

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

PATCH RESEND 1/1 ARM: OMAP2+: am33xx: Change cpu_is_am33xx to soc_is_am33xx

As per recent discussion on the linux-omap list, we are moving in the direction where, we will have only architecture, ARCH_OMAP2PLUS and all devices/platforms will be treated as a SoC underneath.

So the first step in this direction is to adopt this change for all new devices getting in, converting cpu_is_am33xx/335x() ==> soc_is_am33xx/335x()

Cc Tony Lindgren <[email protected]>t status

---

Rebasing and resubmitting on top of devel-am33xx branch.

 arch/arm/mach-omap2/clock3xxx_data.c  |    2 +-
 arch/arm/mach-omap2/id.c              |    4 ++--
 arch/arm/plat-omap/include/plat/cpu.h |   12 ++++++------
 arch/arm/plat-omap/sram.c             |    4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)
arch/arm/mach-omap2/clock3xxx_data.c +1 -1
index 4e1a3b0..452b613 100644
@@ -3523,7 +3523,7 @@ int __init omap3xxx_clk_init(void)
 	} else if (cpu_is_ti816x()) {
 		cpu_mask = RATE_IN_TI816X;
 		cpu_clkflg = CK_TI816X;
-	} else if (cpu_is_am33xx()) {
+	} else if (soc_is_am33xx()) {
 		cpu_mask = RATE_IN_AM33XX;
 	} else if (cpu_is_ti814x()) {
 		cpu_mask = RATE_IN_TI814X;
arch/arm/mach-omap2/id.c +2 -2
index 0389b32..c962a10 100644
@@ -44,7 +44,7 @@ int omap_type(void)
 
 	if (cpu_is_omap24xx()) {
 		val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
-	} else if (cpu_is_am33xx()) {
+	} else if (soc_is_am33xx()) {
 		val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
 	} else if (cpu_is_omap34xx()) {
 		val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
@@ -189,7 +189,7 @@ static void __init omap3_cpuinfo(void)
 		cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505";
 	} else if (cpu_is_ti816x()) {
 		cpu_name = "TI816X";
-	} else if (cpu_is_am335x()) {
+	} else if (soc_is_am335x()) {
 		cpu_name =  "AM335X";
 	} else if (cpu_is_ti814x()) {
 		cpu_name = "TI814X";
arch/arm/plat-omap/include/plat/cpu.h +6 -6
index 75e1319..f9a6ac0 100644
@@ -150,8 +150,8 @@ IS_AM_SUBCLASS(335x, 0x335)
 #define cpu_is_ti816x()			0
 #define cpu_is_ti814x()			0
 #define soc_is_am35xx()			0
-#define cpu_is_am33xx()			0
-#define cpu_is_am335x()			0
+#define soc_is_am33xx()			0
+#define soc_is_am335x()			0
 #define cpu_is_omap44xx()		0
 #define cpu_is_omap443x()		0
 #define cpu_is_omap446x()		0
@@ -383,10 +383,10 @@ IS_OMAP_TYPE(3517, 0x3517)
 #endif
 
 # if defined(CONFIG_SOC_AM33XX)
-# undef cpu_is_am33xx
-# undef cpu_is_am335x
-# define cpu_is_am33xx()		is_am33xx()
-# define cpu_is_am335x()		is_am335x()
+# undef soc_is_am33xx
+# undef soc_is_am335x
+# define soc_is_am33xx()		is_am33xx()
+# define soc_is_am335x()		is_am335x()
 #endif
 
 # if defined(CONFIG_ARCH_OMAP4)
arch/arm/plat-omap/sram.c +2 -2
index 564cb4c..70cf825 100644
@@ -123,7 +123,7 @@ static void __init omap_detect_sram(void)
 				omap_sram_size = 0x800; /* 2K */
 			}
 		} else {
-			if (cpu_is_am33xx()) {
+			if (soc_is_am33xx()) {
 				omap_sram_start = AM33XX_SRAM_PA;
 				omap_sram_size = 0x10000; /* 64K */
 			} else if (cpu_is_omap34xx()) {
@@ -386,7 +386,7 @@ int __init omap_sram_init(void)
 		omap242x_sram_init();
 	else if (cpu_is_omap2430())
 		omap243x_sram_init();
-	else if (cpu_is_am33xx())
+	else if (soc_is_am33xx())
 		am33xx_sram_init();
 	else if (cpu_is_omap34xx())
 		omap34xx_sram_init();

--
1.7.0.4

#1 lore raw

PATCH RESEND 1/1 ARM: OMAP2+: am33xx: Make am33xx as a separate class

Initially, we decided to make am33xx family of device to fall under omap3 class (cpu_is_omap34xx() = true), since it carries Cortex-A8 core. But while adding complete baseport support (like, clock, power and hwmod) support, it is observed that, we are creating more and more problems by treating am33xx device as omap3 family, as nothing matches between them (except cortex-A8 mpu).

So, after long discussion we have came to the conclusion that, we should not consider am33xx device as omap3 family, instead create separate class (SOC_AM33XX) under OMAP2PLUS.
This means, for am33xx device, cpu_is_omap34xx() will return false, and only cpu_is_am33xx() will be true.

Please refer to the link below, for mailing-list discussion on this -

http://www.spinics.net/lists/linux-omap/msg69439.html

Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>
[tony at atomide.com: fixed typo, updated for soc_is changes]

---

Rebasing and resubmitting on top of devel-am33xx branch.

 arch/arm/mach-omap2/Kconfig           |    4 +++-
 arch/arm/mach-omap2/Makefile          |    5 +++++
 arch/arm/mach-omap2/common.c          |    2 ++
 arch/arm/plat-omap/include/plat/cpu.h |    9 ++++++---
 arch/arm/plat-omap/sram.c             |    2 +-
 5 files changed, 17 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/Kconfig +3 -1
index 4cf5142..0ab4c5e 100644
@@ -85,8 +85,10 @@ config SOC_TI81XX
 
 config SOC_AM33XX
 	bool "AM33XX support"
-	depends on ARCH_OMAP3
 	default y
+	select CPU_V7
+	select ARM_CPU_SUSPEND if PM
+	select MULTI_IRQ_HANDLER
 
 config OMAP_PACKAGE_ZAF
        bool
arch/arm/mach-omap2/Makefile +5 -0
index a4cf932..ef2585b 100644
@@ -16,6 +16,7 @@ secure-common				= omap-smc.o omap-secure.o
 obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
 obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common)
+obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common)
 
 ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
 obj-y += mcbsp.o
@@ -100,6 +101,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= $(voltagedomain-common)
 obj-$(CONFIG_ARCH_OMAP3)		+= voltagedomains3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= $(voltagedomain-common)
 obj-$(CONFIG_ARCH_OMAP4)		+= voltagedomains44xx_data.o
+obj-$(CONFIG_SOC_AM33XX)		+= $(voltagedomain-common)
 obj-$(CONFIG_SOC_AM33XX)                += voltagedomains33xx_data.o
 
 # OMAP powerdomain framework
@@ -115,6 +117,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= powerdomains2xxx_3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= $(powerdomain-common)
 obj-$(CONFIG_ARCH_OMAP4)		+= powerdomain44xx.o
 obj-$(CONFIG_ARCH_OMAP4)		+= powerdomains44xx_data.o
+obj-$(CONFIG_SOC_AM33XX)		+= $(powerdomain-common)
 obj-$(CONFIG_SOC_AM33XX)		+= powerdomain33xx.o
 obj-$(CONFIG_SOC_AM33XX)		+= powerdomains33xx_data.o
 
@@ -133,6 +136,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= clockdomains3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= $(clockdomain-common)
 obj-$(CONFIG_ARCH_OMAP4)		+= clockdomain44xx.o
 obj-$(CONFIG_ARCH_OMAP4)		+= clockdomains44xx_data.o
+obj-$(CONFIG_SOC_AM33XX)		+= $(clockdomain-common)
 obj-$(CONFIG_SOC_AM33XX)		+= clockdomain33xx.o
 obj-$(CONFIG_SOC_AM33XX)		+= clockdomains33xx_data.o
 
@@ -152,6 +156,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= dpll3xxx.o clock3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP3)		+= clkt_iclk.o
 obj-$(CONFIG_ARCH_OMAP4)		+= $(clock-common) clock44xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= dpll3xxx.o dpll44xx.o
+obj-$(CONFIG_SOC_AM33XX)		+= $(clock-common) dpll3xxx.o
 
 # OMAP2 clock rate set data (old "OPP" data)
 obj-$(CONFIG_SOC_OMAP2420)		+= opp2420_data.o
arch/arm/mach-omap2/common.c +2 -0
index 8a6953a..a7aa538 100644
@@ -134,7 +134,9 @@ void __init ti81xx_map_io(void)
 {
 	omapti81xx_map_common_io();
 }
+#endif
 
+#if defined(CONFIG_SOC_AM33XX)
 #define AM33XX_TAP_BASE		(AM33XX_CTRL_BASE + \
 				TI81XX_CONTROL_DEVICE_ID - 0x204)
 
arch/arm/plat-omap/include/plat/cpu.h +6 -3
index 297245d..75e1319 100644
@@ -360,8 +360,6 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_ti816x
 # undef cpu_is_ti814x
 # undef soc_is_am35xx
-# undef cpu_is_am33xx
-# undef cpu_is_am335x
 # define cpu_is_omap3430()		is_omap3430()
 # define cpu_is_omap3503()		(cpu_is_omap3430() &&		\
 						(!omap3_has_iva()) &&	\
@@ -382,6 +380,11 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_ti816x()		is_ti816x()
 # define cpu_is_ti814x()		is_ti814x()
 # define soc_is_am35xx()		is_am35xx()
+#endif
+
+# if defined(CONFIG_SOC_AM33XX)
+# undef cpu_is_am33xx
+# undef cpu_is_am335x
 # define cpu_is_am33xx()		is_am33xx()
 # define cpu_is_am335x()		is_am335x()
 #endif
@@ -441,7 +444,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define AM35XX_REV_ES1_0	AM35XX_CLASS
 #define AM35XX_REV_ES1_1	(AM35XX_CLASS | (0x1 << 8))
 
-#define AM335X_CLASS		0x33500034
+#define AM335X_CLASS		0x33500033
 #define AM335X_REV_ES1_0	AM335X_CLASS
 
 #define OMAP443X_CLASS		0x44300044
arch/arm/plat-omap/sram.c +1 -1
index 477363c..564cb4c 100644
@@ -85,7 +85,7 @@ static int is_sram_locked(void)
 			__raw_writel(0xCFDE, OMAP24XX_VA_READPERM0);  /* all i-read */
 			__raw_writel(0xCFDE, OMAP24XX_VA_WRITEPERM0); /* all i-write */
 		}
-		if (cpu_is_omap34xx() && !cpu_is_am33xx()) {
+		if (cpu_is_omap34xx()) {
 			__raw_writel(0xFFFF, OMAP34XX_VA_REQINFOPERM0); /* all q-vects */
 			__raw_writel(0xFFFF, OMAP34XX_VA_READPERM0);  /* all i-read */
 			__raw_writel(0xFFFF, OMAP34XX_VA_WRITEPERM0); /* all i-write */

--
1.7.0.4

maintainer
#2 lore raw

PATCH RESEND 1/1 ARM: OMAP2+: am33xx: Make am33xx as a separate class

Quoted 8 lines · Vaibhav Hiremath

Initially, we decided to make am33xx family of device to fall under omap3 class (cpu_is_omap34xx() = true), since it carries Cortex-A8 core. But while adding complete baseport support (like, clock, power and hwmod) support, it is observed that, we are creating more and more problems by treating am33xx device as omap3 family, as nothing matches between them (except cortex-A8 mpu).

Quoted 5 lines

So, after long discussion we have came to the conclusion that, we should not consider am33xx device as omap3 family, instead create separate class (SOC_AM33XX) under OMAP2PLUS.
This means, for am33xx device, cpu_is_omap34xx() will return false, and only cpu_is_am33xx() will be true.

Thanks applying both.

Regards,

Tony

maintainer
#3 lore raw

PATCH RESEND 1/1 ARM: OMAP2+: am33xx: Make am33xx as a separate class

Quoted 9 lines · Tony Lindgren
Quoted 8 lines · Vaibhav Hiremath

Initially, we decided to make am33xx family of device to fall under omap3 class (cpu_is_omap34xx() = true), since it carries Cortex-A8 core. But while adding complete baseport support (like, clock, power and hwmod) support, it is observed that, we are creating more and more problems by treating am33xx device as omap3 family, as nothing matches between them (except cortex-A8 mpu).

Quoted 7 lines
Quoted 5 lines

So, after long discussion we have came to the conclusion that, we should not consider am33xx device as omap3 family, instead create separate class (SOC_AM33XX) under OMAP2PLUS.
This means, for am33xx device, cpu_is_omap34xx() will return false, and only cpu_is_am33xx() will be true.

Thanks applying both.

I believe all your patches are now applied. I've pushed them out into devel-am33xx-part2 branch. Can you please check and send additional patches as needed?

Regards,

Tony

maintainer
#4 lore raw

PATCH RESEND 1/1 ARM: OMAP2+: am33xx: Make am33xx as a separate class

Quoted 16 lines · Tony Lindgren
Quoted 15 lines · Tony Lindgren
Quoted 13 lines · Vaibhav Hiremath

Initially, we decided to make am33xx family of device to fall under omap3 class (cpu_is_omap34xx() = true), since it carries Cortex-A8 core. But while adding complete baseport support (like, clock, power and hwmod) support, it is observed that, we are creating more and more problems by treating am33xx device as omap3 family, as nothing matches between them (except cortex-A8 mpu).

So, after long discussion we have came to the conclusion that, we should not consider am33xx device as omap3 family, instead create separate class (SOC_AM33XX) under OMAP2PLUS.
This means, for am33xx device, cpu_is_omap34xx() will return false, and only cpu_is_am33xx() will be true.

Quoted 5 lines
Quoted 1 line

Thanks applying both.

I believe all your patches are now applied. I've pushed them out into devel-am33xx-part2 branch. Can you please check and send additional patches as needed?

I ended up moving some patches into cleanup-part2 branch as omap5 patches also need those. So the new branch for am33xx is called devel-am33xx-data at commit 79ab2664. The old devel-am33xx-part2 branch should be ignored now.

Regards,

Tony

#5 lore raw

PATCH RESEND 1/1 ARM: OMAP2+: am33xx: Make am33xx as a separate class

Quoted 19 lines · Tony Lindgren
Quoted 18 lines · Tony Lindgren
Quoted 16 lines · Tony Lindgren
Quoted 8 lines · Vaibhav Hiremath

Initially, we decided to make am33xx family of device to fall under omap3 class (cpu_is_omap34xx() = true), since it carries Cortex-A8 core. But while adding complete baseport support (like, clock, power and hwmod) support, it is observed that, we are creating more and more problems by treating am33xx device as omap3 family, as nothing matches between them (except cortex-A8 mpu).

Quoted 5 lines

So, after long discussion we have came to the conclusion that, we should not consider am33xx device as omap3 family, instead create separate class (SOC_AM33XX) under OMAP2PLUS.
This means, for am33xx device, cpu_is_omap34xx() will return false, and only cpu_is_am33xx() will be true.

Thanks applying both.

Quoted 9 lines
Quoted 3 lines

I believe all your patches are now applied. I've pushed them out into devel-am33xx-part2 branch. Can you please check and send additional patches as needed?

I ended up moving some patches into cleanup-part2 branch as omap5 patches also need those. So the new branch for am33xx is called devel-am33xx-data at commit 79ab2664. The old devel-am33xx-part2 branch should be ignored now.

Tony,

Can we clean these branches; it is very confusing to track with so many multiple versions?

Also, One patch still has not merged is,

[PATCH-V2] ARM: OMAP: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Do you have any comments on this? If not, can you merge it?

Thanks,
Vaibhav

maintainer
#6 lore raw

PATCH RESEND 1/1 ARM: OMAP2+: am33xx: Make am33xx as a separate class

Quoted 3 lines · Hiremath, Vaibhav

Can we clean these branches; it is very confusing to track with so many multiple versions?

Yeah I'll drop some after the merge window..

Quoted 5 lines

Also, One patch still has not merged is,

[PATCH-V2] ARM: OMAP: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Do you have any comments on this? If not, can you merge it?

Posted some comments on it, we need to fix that properly for v3.7 merge window.

Tony

#7 lore raw

PATCH RESEND 1/1 ARM: OMAP2+: am33xx: Make am33xx as a separate class

In reply to Tony Lindgren
Quoted 9 lines · Tony Lindgren
Quoted 8 lines · Vaibhav Hiremath

Initially, we decided to make am33xx family of device to fall under omap3 class (cpu_is_omap34xx() = true), since it carries Cortex-A8 core. But while adding complete baseport support (like, clock, power and hwmod) support, it is observed that, we are creating more and more problems by treating am33xx device as omap3 family, as nothing matches between them (except cortex-A8 mpu).

Quoted 8 lines
Quoted 5 lines

So, after long discussion we have came to the conclusion that, we should not consider am33xx device as omap3 family, instead create separate class (SOC_AM33XX) under OMAP2PLUS.
This means, for am33xx device, cpu_is_omap34xx() will return false, and only cpu_is_am33xx() will be true.

Thanks applying both.

Thanks Tony,

Thanks,
Vaibhav