Skip to contentSkip to conversation

ARM: OMAP: Fix 1510 compilation with DSP != m

PATCH In review Jonathan McDowell 2 participants 6 messages Oct 8, 2006 – Oct 23, 2006

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

PATCH 1/1 ARM: OMAP: Fix 1510 compilation with DSP != m

Looks like recent changes have broken OMAP1510 compilation; I hit this because I'm not using the DSP at present but during testing my fix discovered that setting CONFIG_OMAP_DSP to Y didn't compile either; only M worked. Patch below makes all 3 compile.

-----

arch/arm/mach-omap1/devices.c +1 -1
index 992a17d..adae4f8 100644
@@ -63,7 +63,7 @@ #endif
 
 #if defined(CONFIG_OMAP_DSP)
 
-#if defined(CONFIG_ARCH_OMAP1510)
+#if defined(CONFIG_ARCH_OMAP15XX)
 #  define OMAP1_MBOX_SIZE	0x23
 #  define INT_DSP_MAILBOX1	INT_1510_DSP_MAILBOX1
 #elif defined(CONFIG_ARCH_OMAP16XX)
arch/arm/plat-omap/mcbsp.c +3 -3
index 9d9d456..12ece9d 100644
@@ -193,7 +193,7 @@ static int omap_mcbsp_check(unsigned int
 	return -1;
 }
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 static void omap_mcbsp_dsp_request(void)
 {
 	if (cpu_is_omap15xx() || cpu_is_omap16xx()) {
@@ -266,7 +266,7 @@ int omap_mcbsp_request(unsigned int id)
 	if (omap_mcbsp_check(id) < 0)
 		return -EINVAL;
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 	/*
 	 * On 1510, 1610 and 1710, McBSP1 and McBSP3
 	 * are DSP public peripherals.
@@ -333,7 +333,7 @@ void omap_mcbsp_free(unsigned int id)
 	if (omap_mcbsp_check(id) < 0)
 		return;
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 	if (cpu_class_is_omap1()) {
 		if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3)
 			omap_mcbsp_dsp_free();

-----

J.

Signature · 3 lines
                                            jid: [email protected]
101 things you can't have too much of : 44
                                            - Fame.
reviewer
#1 lore raw

Hi,

Quoted 44 lines · Jonathan McDowell

Looks like recent changes have broken OMAP1510 compilation; I hit this because I'm not using the DSP at present but during testing my fix discovered that setting CONFIG_OMAP_DSP to Y didn't compile either; only M worked. Patch below makes all 3 compile.

-----

arch/arm/mach-omap1/devices.c +1 -1
index 992a17d..adae4f8 100644
@@ -63,7 +63,7 @@ #endif
 
 #if defined(CONFIG_OMAP_DSP)
 
-#if defined(CONFIG_ARCH_OMAP1510)
+#if defined(CONFIG_ARCH_OMAP15XX)
 #  define OMAP1_MBOX_SIZE	0x23
 #  define INT_DSP_MAILBOX1	INT_1510_DSP_MAILBOX1
 #elif defined(CONFIG_ARCH_OMAP16XX)
arch/arm/plat-omap/mcbsp.c +2 -2
index 9d9d456..12ece9d 100644
@@ -193,7 +193,7 @@ static int omap_mcbsp_check(unsigned int
 	return -1;
 }
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 static void omap_mcbsp_dsp_request(void)
 {
 	if (cpu_is_omap15xx() || cpu_is_omap16xx()) {
@@ -266,7 +266,7 @@ int omap_mcbsp_request(unsigned int id)
 	if (omap_mcbsp_check(id) < 0)
 		return -EINVAL;
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 	/*
 	 * On 1510, 1610 and 1710, McBSP1 and McBSP3
 	 * are DSP public peripherals.

arch/arm/plat-omap/mcbsp.c void omap_mcbsp_free(unsigned int id)

Quoted 9 lines
arch/arm/plat-omap/mcbsp.c +1 -2
@@ -333,7 +333,7 @@ void omap_mcbsp_free(unsigned int id)
 	if (omap_mcbsp_check(id) < 0)
 		return;
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 	if (cpu_class_is_omap1()) {
 		if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3)
 			omap_mcbsp_dsp_free();
-----

I guess originally the idea was that McBSP would work even without CONFIG_OMAP_DSP.

Note that arch/arm/plat_omap/dsp/dsp_common.c is compiled even without CONFIG_OMAP_DSP. Maybe the compilation problem really is some other issue?

Regards,

Tony

#2 lore raw
Quoted 60 lines · Tony Lindgren

Hi,

Quoted 44 lines · Jonathan McDowell

Looks like recent changes have broken OMAP1510 compilation; I hit this because I'm not using the DSP at present but during testing my fix discovered that setting CONFIG_OMAP_DSP to Y didn't compile either; only M worked. Patch below makes all 3 compile.

-----

arch/arm/mach-omap1/devices.c +1 -1
index 992a17d..adae4f8 100644
@@ -63,7 +63,7 @@ #endif
 
 #if defined(CONFIG_OMAP_DSP)
 
-#if defined(CONFIG_ARCH_OMAP1510)
+#if defined(CONFIG_ARCH_OMAP15XX)
 #  define OMAP1_MBOX_SIZE	0x23
 #  define INT_DSP_MAILBOX1	INT_1510_DSP_MAILBOX1
 #elif defined(CONFIG_ARCH_OMAP16XX)
arch/arm/plat-omap/mcbsp.c +2 -2
index 9d9d456..12ece9d 100644
@@ -193,7 +193,7 @@ static int omap_mcbsp_check(unsigned int
 	return -1;
 }
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 static void omap_mcbsp_dsp_request(void)
 {
 	if (cpu_is_omap15xx() || cpu_is_omap16xx()) {
@@ -266,7 +266,7 @@ int omap_mcbsp_request(unsigned int id)
 	if (omap_mcbsp_check(id) < 0)
 		return -EINVAL;
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 	/*
 	 * On 1510, 1610 and 1710, McBSP1 and McBSP3
 	 * are DSP public peripherals.

arch/arm/plat-omap/mcbsp.c void omap_mcbsp_free(unsigned int id)

Quoted 9 lines
arch/arm/plat-omap/mcbsp.c +1 -2
@@ -333,7 +333,7 @@ void omap_mcbsp_free(unsigned int id)
 	if (omap_mcbsp_check(id) < 0)
 		return;
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 	if (cpu_class_is_omap1()) {
 		if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3)
 			omap_mcbsp_dsp_free();
-----

I guess originally the idea was that McBSP would work even without CONFIG_OMAP_DSP.

Quoted 2 lines

Note that arch/arm/plat_omap/dsp/dsp_common.c is compiled even without CONFIG_OMAP_DSP.

dsp_common.c will always be compiled if dsp/ is entered.

However arch/arm/plat-omap/dsp is only entered when CONFIG_OMAP_DSP is set; arch/arm/plat-omap/Makefile has:

# DSP subsystem
obj-$(CONFIG_OMAP_DSP) += dsp/ mailbox.o

J.

Signature · 4 lines
                 /------------------------------------\
                 | noodles is to go out and eat them  |
                 | http://www.blackcatnetworks.co.uk/ |
                 \------------------------------------/
reviewer
#3 lore raw
Quoted 64 lines · Jonathan McDowell
Quoted 60 lines · Tony Lindgren

Hi,

Quoted 44 lines · Jonathan McDowell

Looks like recent changes have broken OMAP1510 compilation; I hit this because I'm not using the DSP at present but during testing my fix discovered that setting CONFIG_OMAP_DSP to Y didn't compile either; only M worked. Patch below makes all 3 compile.

-----

arch/arm/mach-omap1/devices.c +1 -1
index 992a17d..adae4f8 100644
@@ -63,7 +63,7 @@ #endif
 
 #if defined(CONFIG_OMAP_DSP)
 
-#if defined(CONFIG_ARCH_OMAP1510)
+#if defined(CONFIG_ARCH_OMAP15XX)
 #  define OMAP1_MBOX_SIZE	0x23
 #  define INT_DSP_MAILBOX1	INT_1510_DSP_MAILBOX1
 #elif defined(CONFIG_ARCH_OMAP16XX)
arch/arm/plat-omap/mcbsp.c +2 -2
index 9d9d456..12ece9d 100644
@@ -193,7 +193,7 @@ static int omap_mcbsp_check(unsigned int
 	return -1;
 }
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 static void omap_mcbsp_dsp_request(void)
 {
 	if (cpu_is_omap15xx() || cpu_is_omap16xx()) {
@@ -266,7 +266,7 @@ int omap_mcbsp_request(unsigned int id)
 	if (omap_mcbsp_check(id) < 0)
 		return -EINVAL;
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 	/*
 	 * On 1510, 1610 and 1710, McBSP1 and McBSP3
 	 * are DSP public peripherals.

arch/arm/plat-omap/mcbsp.c void omap_mcbsp_free(unsigned int id)

Quoted 9 lines
arch/arm/plat-omap/mcbsp.c +1 -2
@@ -333,7 +333,7 @@ void omap_mcbsp_free(unsigned int id)
 	if (omap_mcbsp_check(id) < 0)
 		return;
 
-#ifdef CONFIG_ARCH_OMAP1
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_DSP)
 	if (cpu_class_is_omap1()) {
 		if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3)
 			omap_mcbsp_dsp_free();
-----

I guess originally the idea was that McBSP would work even without CONFIG_OMAP_DSP.

Quoted 2 lines

Note that arch/arm/plat_omap/dsp/dsp_common.c is compiled even without CONFIG_OMAP_DSP.

Quoted 7 lines

dsp_common.c will always be compiled if dsp/ is entered.

However arch/arm/plat-omap/dsp is only entered when CONFIG_OMAP_DSP is set; arch/arm/plat-omap/Makefile has:

# DSP subsystem
obj-$(CONFIG_OMAP_DSP) += dsp/ mailbox.o

Oh yeah, that's true. Does the attached patch work for you?

I guess the right solution would be to move dsp_common.c out of dsp directory to plat-omap and always have it compile. Toshihiro & Hiroshi, do you have any better ideas?

Tony

arch/arm/plat-omap/Makefile +2 -1
@@ -26,4 +26,5 @@ obj-$(CONFIG_OMAP_COMPONENT_VERSION) += 
 obj-$(CONFIG_OMAP_GPIO_SWITCH) += gpio-switch.o
 
 # DSP subsystem
-obj-$(CONFIG_OMAP_DSP) += dsp/ mailbox.o
+obj-y += dsp/
+obj-$(CONFIG_OMAP_DSP) += mailbox.o
arch/arm/plat-omap/dsp/dsp_common.c +6 -2
@@ -43,6 +43,8 @@ #elif defined(CONFIG_ARCH_OMAP2)
 #define dsp_boot_config(mode)	writel((mode), DSP_IPI_DSPBOOTCONFIG)
 #endif
 
+struct omap_dsp *omap_dsp;
+
 #if defined(CONFIG_ARCH_OMAP1)
 struct clk *dsp_ck_handle;
 struct clk *api_ck_handle;
@@ -371,7 +373,8 @@ #elif defined(CONFIG_ARCH_OMAP2)
 			__dsp_core_enable();
 #endif
 			cpustat.stat = CPUSTAT_RUN;
-			enable_irq(omap_dsp->mmu_irq);
+			if (omap_dsp != NULL)
+				enable_irq(omap_dsp->mmu_irq);
 		}
 		return;
 	}
@@ -379,7 +382,8 @@ #endif
 	/* cpustat.req < CPUSTAT_RUN */
 
 	if (cpustat.stat == CPUSTAT_RUN) {
-		disable_irq(omap_dsp->mmu_irq);
+		if (omap_dsp != NULL)
+			disable_irq(omap_dsp->mmu_irq);
 #ifdef CONFIG_ARCH_OMAP1
 		clk_disable(api_ck_handle);
 #endif
arch/arm/plat-omap/dsp/dsp_core.c +0 -1
@@ -40,7 +40,6 @@ MODULE_AUTHOR("Toshihiro Kobayashi <tosh
 MODULE_DESCRIPTION("OMAP DSP driver module");
 MODULE_LICENSE("GPL");
 
-struct omap_dsp *omap_dsp;
 static struct sync_seq *mbseq;
 static u16 mbseq_expect_tmp;
 static u16 *mbseq_expect = &mbseq_expect_tmp;
#4 lore raw
Quoted 26 lines · Tony Lindgren
Quoted 25 lines · Jonathan McDowell
Quoted 24 lines · Tony Lindgren

Hi,

Quoted 21 lines · Jonathan McDowell

Looks like recent changes have broken OMAP1510 compilation; I hit this because I'm not using the DSP at present but during testing my fix discovered that setting CONFIG_OMAP_DSP to Y didn't compile either; only M worked. Patch below makes all 3 compile.

-----

arch/arm/mach-omap1/devices.c +1 -1
index 992a17d..adae4f8 100644
@@ -63,7 +63,7 @@ #endif
 
 #if defined(CONFIG_OMAP_DSP)
 
-#if defined(CONFIG_ARCH_OMAP1510)
+#if defined(CONFIG_ARCH_OMAP15XX)
 #  define OMAP1_MBOX_SIZE	0x23
 #  define INT_DSP_MAILBOX1	INT_1510_DSP_MAILBOX1
 #elif defined(CONFIG_ARCH_OMAP16XX)

...

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

I guess originally the idea was that McBSP would work even without CONFIG_OMAP_DSP.

Note that arch/arm/plat_omap/dsp/dsp_common.c is compiled even without CONFIG_OMAP_DSP.

dsp_common.c will always be compiled if dsp/ is entered.

Quoted 7 lines
Quoted 5 lines

However arch/arm/plat-omap/dsp is only entered when CONFIG_OMAP_DSP is set; arch/arm/plat-omap/Makefile has:

# DSP subsystem
obj-$(CONFIG_OMAP_DSP) += dsp/ mailbox.o

Oh yeah, that's true. Does the attached patch work for you?

Confirmed as compiling and booting on the Amstrad Delta (OMAP1510) with CONFIG_OMAP_DSP=n.

The first part of my patch (against arch/arm/mach-omap1/devices.c) is still needed for CONFIG_OMAP_DSP=y to compile.

J.

Signature · 1 line
"Bother," said Pooh, as Piglet stamped on his bollocks.
reviewer
#5 lore raw
Quoted 42 lines · Jonathan McDowell
Quoted 26 lines · Tony Lindgren
Quoted 25 lines · Jonathan McDowell
Quoted 24 lines · Tony Lindgren

Hi,

Quoted 21 lines · Jonathan McDowell

Looks like recent changes have broken OMAP1510 compilation; I hit this because I'm not using the DSP at present but during testing my fix discovered that setting CONFIG_OMAP_DSP to Y didn't compile either; only M worked. Patch below makes all 3 compile.

-----

arch/arm/mach-omap1/devices.c +1 -1
index 992a17d..adae4f8 100644
@@ -63,7 +63,7 @@ #endif
 
 #if defined(CONFIG_OMAP_DSP)
 
-#if defined(CONFIG_ARCH_OMAP1510)
+#if defined(CONFIG_ARCH_OMAP15XX)
 #  define OMAP1_MBOX_SIZE	0x23
 #  define INT_DSP_MAILBOX1	INT_1510_DSP_MAILBOX1
 #elif defined(CONFIG_ARCH_OMAP16XX)

...

Quoted 14 lines
Quoted 13 lines
Quoted 5 lines

I guess originally the idea was that McBSP would work even without CONFIG_OMAP_DSP.

Note that arch/arm/plat_omap/dsp/dsp_common.c is compiled even without CONFIG_OMAP_DSP.

dsp_common.c will always be compiled if dsp/ is entered.

However arch/arm/plat-omap/dsp is only entered when CONFIG_OMAP_DSP is set; arch/arm/plat-omap/Makefile has:

# DSP subsystem
obj-$(CONFIG_OMAP_DSP) += dsp/ mailbox.o

Quoted 7 lines
Quoted 1 line

Oh yeah, that's true. Does the attached patch work for you?

Confirmed as compiling and booting on the Amstrad Delta (OMAP1510) with CONFIG_OMAP_DSP=n.

The first part of my patch (against arch/arm/mach-omap1/devices.c) is still needed for CONFIG_OMAP_DSP=y to compile.

OK, I've pushed that part too and tagged 2.6.18-omap1.

Tony