Skip to contentSkip to conversation

include/asm-arm/arch-omap/omap24xx.h

PATCH In review Luís Cargnini 4 participants 14 messages Oct 24, 2007 – Nov 7, 2007

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

PATCH 1/1 include/asm-arm/arch-omap/omap24xx.h

I are resubmitting this patch again, because even now this patch was not applied on main tree, I upgraded yesterday for the linux-2.6.23-omap1 (latest tag)
and it still not pushed into main tree, please someone add this patch.

Signed-off-by Luís Vitório Cargnini <lvcargnini at gmail.com>

Signed-off-by: Dirk Behme <dirk.behme at gmail.com
<http://linux.omap.com/mailman/listinfo/linux-omap-open-source>>
-------------- next part --------------

include/asm-arm/arch-omap/omap24xx.h +5 -0
Index: linux-osk/include/asm-arm/arch-omap/omap24xx.h
===================================================================
@@ -103,6 +103,11 @@
 
 #endif
 
+#if !defined(OMAP2_CTRL_BASE)
+/* If no one of the above configs is selected, use default */
+#define OMAP2_CTRL_BASE		L4_24XX_BASE
+#endif
+
 /* Control module */
 #define OMAP2_CONTROL_DEVCONF0	(OMAP2_CTRL_BASE + 0x274)
 #define OMAP2_CONTROL_DEVCONF1	(OMAP2_CTRL_BASE + 0x2e8)
Signature · 9 lines
------------------------------------------------------------------------------
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Electrical Engineer Faculty @ PUCRS
Ipiranga Avenue, 6681 – Building 30
P.O. Box: 90619-900 – Porto Alegre/RS
Phone: +55 51 3320 3500  extension: 7696
---------------------------------------------------------------------------------
#1 lore raw
Quoted 16 lines · Luís Cargnini

I are resubmitting this patch again, because even now this patch was not applied on main tree, I upgraded yesterday for the linux-2.6.23-omap1 (latest tag)
and it still not pushed into main tree, please someone add this patch.

Signed-off-by Luís Vitório Cargnini <lvcargnini at gmail.com>

Signed-off-by: Dirk Behme <dirk.behme at gmail.com
<http://linux.omap.com/mailman/listinfo/linux-omap-open-source>>
-------------- next part --------------
Index: linux-osk/include/asm-arm/arch-omap/omap24xx.h
===================================================================

include/asm-arm/arch-omap/omap24xx.h +0 -0
@@ -103,6 +103,11 @@
 

include/asm-arm/arch-omap/omap24xx.h line 113

Quoted 10 lines
include/asm-arm/arch-omap/omap24xx.h +5 -0
 #endif
 
+#if !defined(OMAP2_CTRL_BASE)
+/* If no one of the above configs is selected, use default */
+#define OMAP2_CTRL_BASE		L4_24XX_BASE
+#endif
+
 /* Control module */
 #define OMAP2_CONTROL_DEVCONF0	(OMAP2_CTRL_BASE + 0x274)
 #define OMAP2_CONTROL_DEVCONF1	(OMAP2_CTRL_BASE + 0x2e8)

Seems that this wasn't applied because Tony mentioned that this should not be needed any longer:

http://linux.omap.com/pipermail/linux-omap-open-source/2007-October/011525.html

I didn't check this that time. But checking today, it is still broken. Reproducable by using omap_osk_5912_defconfig with additional MMC enabled. So right, anything like this should be applied.

Cheers

Dirk

#2 lore raw

Hello Dirk, Luis,

how about the patch (following in the next message) instead? That way
we don't define OMAP2_CTRL_BASE for non-OMAP2 builds. Build-tested
with OSK5912 default config with MMC driver enabled.

- Paul

Quoted 1 line

From [email protected] Wed Oct 24 23:36:10 2007

Message-Id: <[email protected]>
User-Agent: quilt/0.46-1
Date: Wed, 24 Oct 2007 23:31:44 -0600
From: Paul Walmsley <[email protected]>
To: [email protected],
[email protected],
[email protected]
Cc: [email protected]
Bcc: <[email protected]>
Subject: fix undeclared OMAP2_CTRL_BASE for OMAP MMC driver in OMAP1 compiles
References: <[email protected]>

    <[email protected]>

<[email protected]>
Content-Disposition: inline; filename=fix_omap2_ctrl_base_mmc_compile_bug.patch
Replace-Subject: fix undeclared OMAP2_CTRL_BASE for OMAP MMC driver in OMAP1 compiles

Remove reference to OMAP2_CTRL_BASE in arch/arm/plat-omap/devices.c if we aren't building for an OMAP2 platform.

---
 arch/arm/plat-omap/devices.c |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/plat-omap/devices.c +2 -0
Index: linux-omap/arch/arm/plat-omap/devices.c
===================================================================
@@ -339,6 +339,7 @@
 				omap_cfg_reg(MMC_DAT3);
 			}
 		}
+#if defined(CONFIG_ARCH_OMAP24XX)
 		if (mmc->internal_clock) {
 			/*
 			 * Use internal loop-back in MMC/SDIO
@@ -350,6 +351,7 @@
 				omap_writel(v, OMAP2_CONTROL_DEVCONF);
 			}
 		}
+#endif
 		mmc1_conf = *mmc;
 		(void) platform_device_register(&mmc_omap_device1);
 	}
#3 lore raw

fix undeclared OMAP2_CTRL_BASE for OMAP MMC driver in OMAP1 compiles

Remove reference to OMAP2_CTRL_BASE in arch/arm/plat-omap/devices.c if we aren't building for an OMAP2 platform.

---
 arch/arm/plat-omap/devices.c |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/plat-omap/devices.c +2 -0
Index: linux-omap/arch/arm/plat-omap/devices.c
===================================================================
@@ -339,6 +339,7 @@
 				omap_cfg_reg(MMC_DAT3);
 			}
 		}
+#if defined(CONFIG_ARCH_OMAP24XX)
 		if (mmc->internal_clock) {
 			/*
 			 * Use internal loop-back in MMC/SDIO
@@ -350,6 +351,7 @@
 				omap_writel(v, OMAP2_CONTROL_DEVCONF);
 			}
 		}
+#endif
 		mmc1_conf = *mmc;
 		(void) platform_device_register(&mmc_omap_device1);
 	}
#4 lore raw
In reply to Paul Walmsley

Did you tested it ?

Quoted 58 lines · Paul Walmsley

Hello Dirk, Luis,

how about the patch (following in the next message) instead? That way
we don't define OMAP2_CTRL_BASE for non-OMAP2 builds. Build-tested
with OSK5912 default config with MMC driver enabled.

- Paul

Quoted 1 line

From [email protected] Wed Oct 24 23:36:10 2007

Message-Id: <[email protected]>
User-Agent: quilt/0.46-1
Date: Wed, 24 Oct 2007 23:31:44 -0600
From: Paul Walmsley <[email protected]>
To: [email protected],
[email protected],
[email protected]
Cc: [email protected]
Bcc: <[email protected]>
Subject: fix undeclared OMAP2_CTRL_BASE for OMAP MMC driver in OMAP1 compiles
References: <[email protected]>

    <[email protected]>

<[email protected]>
Content-Disposition: inline; filename=fix_omap2_ctrl_base_mmc_compile_bug.patch
Replace-Subject: fix undeclared OMAP2_CTRL_BASE for OMAP MMC driver in OMAP1 compiles

Remove reference to OMAP2_CTRL_BASE in arch/arm/plat-omap/devices.c if we aren't building for an OMAP2 platform.

---
 arch/arm/plat-omap/devices.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-omap/arch/arm/plat-omap/devices.c
===================================================================

arch/arm/plat-omap/devices.c 2007-10-24 23:29:51.000000000 -0600 renamed from arch/arm/plat-omap/devices.c 2007-08-29 13:53:47.000000000 -0600 +2 -1
@@ -339,6 +339,7 @@
                                omap_cfg_reg(MMC_DAT3);
                        }
                }
+#if defined(CONFIG_ARCH_OMAP24XX)
                if (mmc->internal_clock) {
                        /*
                         * Use internal loop-back in MMC/SDIO
@@ -350,6 +351,7 @@
                                omap_writel(v, OMAP2_CONTROL_DEVCONF);
                        }
                }
+#endif
                mmc1_conf = *mmc;
                (void) platform_device_register(&mmc_omap_device1);
        }
 
--
Signature · 9 lines
------------------------------------------------------------------------------
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Electrical Engineer Faculty @ PUCRS
Ipiranga Avenue, 6681 – Building 30
P.O. Box: 90619-900 – Porto Alegre/RS
Phone: +55 51 3320 3500  extension: 7696
---------------------------------------------------------------------------------
#5 lore raw
In reply to Paul Walmsley
Quoted 4 lines · Paul Walmsley

Hello Dirk, Luis,

how about the patch (following in the next message) instead? That way we don't define OMAP2_CTRL_BASE for non-OMAP2 builds.

Mmh, I like to fix it in include/asm-arm/arch-omap/omap24xx.h, so I prefer [1].

The issue was introduced by

http://linux.omap.com/pipermail/linux-omap-open-source/2007-August/011159.html

With [1] we

- fix it where it was introduced
- have an additional #ifdef only in a header file instead of plat-omap/devices.c, which is IMHO better
- fix it for everybody now and in the future who directly or indirectly includes omap24xx.h.

Regards

Dirk

[1] http://linux.omap.com/pipermail/linux-omap-open-source/2007-October/011720.html

Quoted 48 lines

- Paul

Quoted 1 line

From [email protected] Wed Oct 24 23:36:10 2007

Message-Id: <[email protected]>
User-Agent: quilt/0.46-1
Date: Wed, 24 Oct 2007 23:31:44 -0600
From: Paul Walmsley <[email protected]>
To: [email protected],
[email protected],
[email protected]
Cc: [email protected]
Bcc: <[email protected]>
Subject: fix undeclared OMAP2_CTRL_BASE for OMAP MMC driver in OMAP1 compiles
References: <[email protected]>

    <[email protected]>

<[email protected]>
Content-Disposition: inline; filename=fix_omap2_ctrl_base_mmc_compile_bug.patch
Replace-Subject: fix undeclared OMAP2_CTRL_BASE for OMAP MMC driver in OMAP1 compiles

Remove reference to OMAP2_CTRL_BASE in arch/arm/plat-omap/devices.c if we aren't building for an OMAP2 platform.

---
 arch/arm/plat-omap/devices.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-omap/arch/arm/plat-omap/devices.c
===================================================================

arch/arm/plat-omap/devices.c +2 -0
@@ -339,6 +339,7 @@
 				omap_cfg_reg(MMC_DAT3);
 			}
 		}
+#if defined(CONFIG_ARCH_OMAP24XX)
 		if (mmc->internal_clock) {
 			/*
 			 * Use internal loop-back in MMC/SDIO
@@ -350,6 +351,7 @@
 				omap_writel(v, OMAP2_CONTROL_DEVCONF);
 			}
 		}
+#endif
 		mmc1_conf = *mmc;
 		(void) platform_device_register(&mmc_omap_device1);
 	}
#6 lore raw

Hello Dirk,

Quoted 9 lines · Dirk Behme

Mmh, I like to fix it in include/asm-arm/arch-omap/omap24xx.h, so I prefer [1].

With [1] we

- fix it where it was introduced
- have an additional #ifdef only in a header file instead of plat-omap/devices.c, which is IMHO better
- fix it for everybody now and in the future who directly or indirectly includes omap24xx.h.

Hopefully this is just a workaround until we can get rid of these conditional defines for multiboot kernels. Generally speaking, would you propose doing the same thing for the other conditional defines in include/asm-arm/arch-omap/omap24xx.h, such as OMAP2_32KSYNCT_BASE, OMAP2_SDRC_BASE, etc.?

- Paul

#7 lore raw
Quoted 15 lines · Paul Walmsley

Hello Dirk,

Quoted 10 lines · Dirk Behme

Mmh, I like to fix it in include/asm-arm/arch-omap/omap24xx.h, so I prefer [1].

With [1] we

- fix it where it was introduced
- have an additional #ifdef only in a header file instead of plat-omap/devices.c, which is IMHO better
- fix it for everybody now and in the future who directly or indirectly includes omap24xx.h.

Quoted 5 lines

Hopefully this is just a workaround until we can get rid of these conditional defines for multiboot kernels. Generally speaking, would you propose doing the same thing for the other conditional defines in include/asm-arm/arch-omap/omap24xx.h, such as OMAP2_32KSYNCT_BASE, OMAP2_SDRC_BASE, etc.?

Sounds like the real fix is to set these addresses in the init code somewhere based on the omap type.

Tony

#8 lore raw
Quoted 17 lines · Tony Lindgren
Quoted 15 lines · Paul Walmsley

Hello Dirk,

Quoted 10 lines · Dirk Behme

Mmh, I like to fix it in include/asm-arm/arch-omap/omap24xx.h, so I prefer [1].

With [1] we

- fix it where it was introduced
- have an additional #ifdef only in a header file instead of plat-omap/devices.c, which is IMHO better
- fix it for everybody now and in the future who directly or indirectly includes omap24xx.h.

Quoted 8 lines
Quoted 5 lines

Hopefully this is just a workaround until we can get rid of these conditional defines for multiboot kernels. Generally speaking, would you propose doing the same thing for the other conditional defines in include/asm-arm/arch-omap/omap24xx.h, such as OMAP2_32KSYNCT_BASE, OMAP2_SDRC_BASE, etc.?

Sounds like the real fix is to set these addresses in the init code somewhere based on the omap type.

I'll push a temporary fix based on Luis' patch, see below.

Tony

include/asm-arm/arch-omap/omap24xx.h +3 -0
@@ -101,6 +101,9 @@
 #define OMAP2_VA_IC_BASE	IO_ADDRESS(OMAP24XX_IC_BASE)
 #define OMAP2_CTRL_BASE		OMAP243X_CTRL_BASE
 
+#else
+/* FIXME: These will go away soon */
+#define OMAP2_CTRL_BASE		L4_24XX_BASE
 #endif
 
 /* Control module */
#9 lore raw
Quoted 18 lines · Tony Lindgren
Quoted 17 lines · Tony Lindgren
Quoted 15 lines · Paul Walmsley

Hello Dirk,

Quoted 10 lines · Dirk Behme

Mmh, I like to fix it in include/asm-arm/arch-omap/omap24xx.h, so I prefer [1].

With [1] we

- fix it where it was introduced
- have an additional #ifdef only in a header file instead of plat-omap/devices.c, which is IMHO better
- fix it for everybody now and in the future who directly or indirectly includes omap24xx.h.

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

Hopefully this is just a workaround until we can get rid of these conditional defines for multiboot kernels. Generally speaking, would you propose doing the same thing for the other conditional defines in include/asm-arm/arch-omap/omap24xx.h, such as OMAP2_32KSYNCT_BASE, OMAP2_SDRC_BASE, etc.?

Sounds like the real fix is to set these addresses in the init code somewhere based on the omap type.

Yeah, agreed.

Quoted 1 line

I'll push a temporary fix based on Luis' patch, see below.

OMAP3430 builds now generate redefinition warnings for OMAP2_CTRL_BASE; patch to work around is below.

In file included from include/asm/arch/hardware.h:288,

                 from include/asm/hardware.h:16,
                 from include/asm/arch/irqs.h:341,
                 from include/asm/irq.h:4,
                 from include/asm/hardirq.h:6,
                 from include/linux/hardirq.h:7,
                 from include/asm-generic/local.h:5,
                 from include/asm/local.h:1,
                 from include/linux/module.h:19,
                 from init/main.c:13:
include/asm/arch/omap34xx.h:71:1: warning: "OMAP2_CTRL_BASE" redefined
In file included from include/asm/arch/hardware.h:287,
                 from include/asm/hardware.h:16,
                 from include/asm/arch/irqs.h:341,
                 from include/asm/irq.h:4,
                 from include/asm/hardirq.h:6,
                 from include/linux/hardirq.h:7,
                 from include/asm-generic/local.h:5,
                 from include/asm/local.h:1,
                 from include/linux/module.h:19,
                 from init/main.c:13:

include/asm/arch/omap24xx.h:106:1: warning: this is the location of the previous definition

- Paul

From: Paul Walmsley <[email protected]>
Subject: Work around OMAP2_CTRL_BASE warnings in 3430 build

Work around OMAP2_CTRL_BASE redefinition warnings for OMAP3430 builds.

---
 include/asm/arch/omap24xx.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm/arch/omap24xx.h +1 -1
Index: linux-omap/include/asm/arch/omap24xx.h
===================================================================
@@ -101,7 +101,7 @@
 #define OMAP2_VA_IC_BASE	IO_ADDRESS(OMAP24XX_IC_BASE)
 #define OMAP2_CTRL_BASE		OMAP243X_CTRL_BASE
 
-#else
+#elif !defined(CONFIG_ARCH_OMAP34XX)
 /* FIXME: These will go away soon */
 #define OMAP2_CTRL_BASE		L4_24XX_BASE
 #endif
#10 lore raw
Quoted 23 lines · Paul Walmsley
Quoted 20 lines · Tony Lindgren
Quoted 18 lines · Tony Lindgren
Quoted 15 lines · Paul Walmsley

Hello Dirk,

Quoted 9 lines · Dirk Behme

Mmh, I like to fix it in include/asm-arm/arch-omap/omap24xx.h, so I prefer [1].

With [1] we

- fix it where it was introduced
- have an additional #ifdef only in a header file instead of plat-omap/devices.c, which is IMHO better
- fix it for everybody now and in the future who directly or indirectly includes omap24xx.h.

Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

Hopefully this is just a workaround until we can get rid of these conditional defines for multiboot kernels. Generally speaking, would you propose doing the same thing for the other conditional defines in include/asm-arm/arch-omap/omap24xx.h, such as OMAP2_32KSYNCT_BASE, OMAP2_SDRC_BASE, etc.?

Sounds like the real fix is to set these addresses in the init code somewhere based on the omap type.

Yeah, agreed.

Me too.

Quoted 4 lines
Quoted 1 line

I'll push a temporary fix based on Luis' patch, see below.

OMAP3430 builds now generate redefinition warnings for OMAP2_CTRL_BASE; patch to work around is below.

...

Quoted 16 lines

From: Paul Walmsley <[email protected]>
Subject: Work around OMAP2_CTRL_BASE warnings in 3430 build

Work around OMAP2_CTRL_BASE redefinition warnings for OMAP3430 builds.

---
 include/asm/arch/omap24xx.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-omap/include/asm/arch/omap24xx.h
===================================================================

include/asm/arch/omap24xx.h line 107

Quoted 8 lines
include/asm/arch/omap24xx.h +1 -1
@@ -101,7 +101,7 @@
 #define OMAP2_VA_IC_BASE	IO_ADDRESS(OMAP24XX_IC_BASE)
 #define OMAP2_CTRL_BASE		OMAP243X_CTRL_BASE
 
-#else
+#elif !defined(CONFIG_ARCH_OMAP34XX)
 /* FIXME: These will go away soon */
 #define OMAP2_CTRL_BASE		L4_24XX_BASE
 #endif

Until we have real fix like above: Instead of now trying to cover all situations where OMAP2_CTRL_BASE is undefined or redefinded (maybe there are some more?), I wonder why not simply make it self-dependent?

#if !defined(OMAP2_CTRL_BASE)
/* FIXME: These will go away soon */
#define OMAP2_CTRL_BASE L4_24XX_BASE
#endif

Regards

Dirk

http://linux.omap.com/pipermail/linux-omap-open-source/2007-September/011393.html

#11 lore raw

Hello Dirk,

Quoted 8 lines · Dirk Behme

Until we have real fix like above: Instead of now trying to cover all situations where OMAP2_CTRL_BASE is undefined or redefinded (maybe there are some more?), I wonder why not simply make it self-dependent?

#if !defined(OMAP2_CTRL_BASE)
/* FIXME: These will go away soon */
#define OMAP2_CTRL_BASE L4_24XX_BASE
#endif

I don't think that will work. Consider the case of a file that includes both omap24xx.h and omap34xx.h during a 3430 build. When omap24xx.h is processed, OMAP2_CTRL_BASE will be defined by the above code; then omap34xx.h will redefine it, causing the same warning.

- Paul

#12 lore raw
Quoted 13 lines · Paul Walmsley

Hello Dirk,

Quoted 8 lines · Dirk Behme

Until we have real fix like above: Instead of now trying to cover all situations where OMAP2_CTRL_BASE is undefined or redefinded (maybe there are some more?), I wonder why not simply make it self-dependent?

#if !defined(OMAP2_CTRL_BASE)
/* FIXME: These will go away soon */
#define OMAP2_CTRL_BASE L4_24XX_BASE
#endif

Quoted 4 lines

I don't think that will work. Consider the case of a file that includes both omap24xx.h and omap34xx.h during a 3430 build. When omap24xx.h is processed, OMAP2_CTRL_BASE will be defined by the above code; then omap34xx.h will redefine it, causing the same warning.

Yup, pushed that fix.

Tony

#13 lore raw

In that time omap3 do not exist yet,
now we need to find a way, to fix this for all platforms.
I suggest to make code compilation base on define FLAGS (ifdef ARCH_OMAP_16XX for example), and remove the lines like
if (is_omap24xx())else i(is_omap3xxx) for example, one of the reasons is
performance, we take some machine cycle to test it (which CPU is), we will code more (a little bit), but we can use includes based on architecture like I suggested some time ago

#ifdedf OMAP16xxx
#include <omap16xx.h>
else if .....

They get the idea.
So we can fix this kind of problems for each family of OMAP CPU, and we can achieve (maybe) some performance.
my $0,02 of contribution in this discussion.

Quoted 28 lines · Tony Lindgren
Quoted 6 lines · Paul Walmsley

Hello Dirk,

Quoted 2 lines · Dirk Behme

Until we have real fix like above: Instead of now trying to cover all situations where OMAP2_CTRL_BASE is undefined or redefinded (maybe

there are

Quoted 11 lines
Quoted 6 lines

some more?), I wonder why not simply make it self-dependent?

#if !defined(OMAP2_CTRL_BASE)
/* FIXME: These will go away soon */
#define OMAP2_CTRL_BASE L4_24XX_BASE
#endif

I don't think that will work. Consider the case of a file that includes both omap24xx.h and omap34xx.h during a 3430 build. When omap24xx.h is processed, OMAP2_CTRL_BASE will be defined by the above code; then omap34xx.h will redefine it, causing the same warning.

Yup, pushed that fix.

Tony
_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

Signature · 9 lines
------------------------------------------------------------------------------
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Electrical Engineer Faculty @ PUCRS
Ipiranga Avenue, 6681 – Building 30
P.O. Box: 90619-900 – Porto Alegre/RS
Phone: +55 51 3320 3500  extension: 7696
---------------------------------------------------------------------------------