m68k: tweak coldfire/device.c for COMPILE_TEST
Subsystems (2)
PATCH 1/1 m68k: tweak coldfire/device.c for COMPILE_TEST
When CONFIG_MCF_EDMA is set (due to COMPILE_TEST, not due to CONFIG_M5441x), coldfire/device.c has compile errors due to missing MCFEDMA_* symbols. In the .config file that was provided, CONFIG_M5206=y, not CONFIG_M5441x, so <asm/m5441xsim.h> is not included in coldfire/device.c.
Only build the MCF_EDMA code in coldfire/device.c if both MCF_EDMA and M5441x are enabled.
Fixes these build errors:
../arch/m68k/coldfire/device.c:512:35: error: 'MCFEDMA_BASE' undeclared here (not in a function); did you mean 'MCFDMA_BASE1'?
512 | .start = MCFEDMA_BASE,../arch/m68k/coldfire/device.c:513:50: error: 'MCFEDMA_SIZE' undeclared here (not in a function)
513 | .end = MCFEDMA_BASE + MCFEDMA_SIZE - 1,../arch/m68k/coldfire/device.c:517:35: error: 'MCFEDMA_IRQ_INTR0' undeclared here (not in a function)
517 | .start = MCFEDMA_IRQ_INTR0,../arch/m68k/coldfire/device.c:523:35: error: 'MCFEDMA_IRQ_INTR16' undeclared here (not in a function)
523 | .start = MCFEDMA_IRQ_INTR16,../arch/m68k/coldfire/device.c:529:35: error: 'MCFEDMA_IRQ_INTR56' undeclared here (not in a function)
529 | .start = MCFEDMA_IRQ_INTR56,../arch/m68k/coldfire/device.c:535:35: error: 'MCFEDMA_IRQ_ERR' undeclared here (not in a function)
535 | .start = MCFEDMA_IRQ_ERR,
--- arch/m68k/coldfire/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/m68k/coldfire/device.c +3 -3
@@ -480,7 +480,7 @@ static struct platform_device mcf_i2c5 =#endif /* MCFI2C_BASE5 */ #endif /* IS_ENABLED(CONFIG_I2C_IMX) */ -#if IS_ENABLED (CONFIG_MCF_EDMA ) +#if IS_ENABLED (CONFIG_MCF_EDMA ) &&IS_ENABLED (CONFIG_M5441x)static const struct dma_slave_map mcf_edma_map[] = { { "dreq0", "rx-tx", MCF_EDMA_FILTER_PARAM(0) },
@@ -552,7 +552,7 @@ static struct platform_device mcf_edma = .platform_data = &mcf_edma_data, } }; -#endif /* IS_ENABLED(CONFIG_MCF_EDMA) */ +#endif /* IS_ENABLED(CONFIG_MCF_EDMA) && IS_ENABLED(CONFIG_M5441x) */ #ifdef MCFSDHC_BASE static struct mcf_esdhc_platform_data mcf_esdhc_data = {
@@ -651,7 +651,7 @@ static struct platform_device *mcf_devic &mcf_i2c5,#endif #endif -#if IS_ENABLED (CONFIG_MCF_EDMA ) +#if IS_ENABLED (CONFIG_MCF_EDMA ) &&IS_ENABLED (CONFIG_M5441x) &mcf_edma,#endif #ifdef MCFSDHC_BASE
Geert Uytterhoeven
maintainerHi Randy,
Quoted 24 lines · Randy Dunlap
When
CONFIG_MCF_EDMAis set (due toCOMPILE_TEST, not due toCONFIG_M5441x),coldfire/device.chas compile errors due to missing MCFEDMA_* symbols. In the .config file that was provided,CONFIG_M5206=y, notCONFIG_M5441x, so <asm/m5441xsim.h> is not included incoldfire/device.c.Only build the
MCF_EDMAcode incoldfire/device.cif bothMCF_EDMAand M5441x are enabled.Fixes these build errors:
../arch/m68k/coldfire/device.c:512:35: error: 'MCFEDMA_BASE' undeclared here (not in a function); did you mean 'MCFDMA_BASE1'?
512 | .start =MCFEDMA_BASE,../arch/m68k/coldfire/device.c:513:50: error: 'MCFEDMA_SIZE' undeclared here (not in a function)
513 | .end =MCFEDMA_BASE+MCFEDMA_SIZE- 1,../arch/m68k/coldfire/device.c:517:35: error: 'MCFEDMA_IRQ_INTR0' undeclared here (not in a function)
517 | .start =MCFEDMA_IRQ_INTR0,../arch/m68k/coldfire/device.c:523:35: error: 'MCFEDMA_IRQ_INTR16' undeclared here (not in a function)
523 | .start =MCFEDMA_IRQ_INTR16,../arch/m68k/coldfire/device.c:529:35: error: 'MCFEDMA_IRQ_INTR56' undeclared here (not in a function)
529 | .start =MCFEDMA_IRQ_INTR56,../arch/m68k/coldfire/device.c:535:35: error: 'MCFEDMA_IRQ_ERR' undeclared here (not in a function)
535 | .start =MCFEDMA_IRQ_ERR,
Quoted 2 lines
Fixes d7e9d01ac292 ("m68k: add ColdFire mcf5441x eDMA platform support")Signed-off-by Randy Dunlap <[email protected]>
Thanks for your patch!
arch/m68k/coldfire/device.c static struct platform_device mcf_i2c5 = · line 483
Quoted 8 lines
arch/m68k/coldfire/device.c +1
-1@@ -480,7 +480,7 @@ static struct platform_device mcf_i2c5 =#endif /* MCFI2C_BASE5 */ #endif /* IS_ENABLED(CONFIG_I2C_IMX) */ -#if IS_ENABLED (CONFIG_MCF_EDMA ) +#if IS_ENABLED (CONFIG_MCF_EDMA ) &&IS_ENABLED (CONFIG_M5441x)
As this protects hardware description, I'm wondering if this and below shouldn't just be"#ifdef CONFIG_M5441x"?
See also commit 322c512f476f07e9 ("m68knommu: include SDHC support only when hardware has it")
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Greg Ungerer
maintainerHi Randy,
Quoted 41 lines · Randy Dunlap
When
CONFIG_MCF_EDMAis set (due toCOMPILE_TEST, not due toCONFIG_M5441x),coldfire/device.chas compile errors due to missing MCFEDMA_* symbols. In the .config file that was provided,CONFIG_M5206=y, notCONFIG_M5441x, so <asm/m5441xsim.h> is not included incoldfire/device.c.Only build the
MCF_EDMAcode incoldfire/device.cif bothMCF_EDMAand M5441x are enabled.Fixes these build errors:
../arch/m68k/coldfire/device.c:512:35: error: 'MCFEDMA_BASE' undeclared here (not in a function); did you mean 'MCFDMA_BASE1'?
512 | .start =MCFEDMA_BASE,../arch/m68k/coldfire/device.c:513:50: error: 'MCFEDMA_SIZE' undeclared here (not in a function)
513 | .end =MCFEDMA_BASE+MCFEDMA_SIZE- 1,../arch/m68k/coldfire/device.c:517:35: error: 'MCFEDMA_IRQ_INTR0' undeclared here (not in a function)
517 | .start =MCFEDMA_IRQ_INTR0,../arch/m68k/coldfire/device.c:523:35: error: 'MCFEDMA_IRQ_INTR16' undeclared here (not in a function)
523 | .start =MCFEDMA_IRQ_INTR16,../arch/m68k/coldfire/device.c:529:35: error: 'MCFEDMA_IRQ_INTR56' undeclared here (not in a function)
529 | .start =MCFEDMA_IRQ_INTR56,../arch/m68k/coldfire/device.c:535:35: error: 'MCFEDMA_IRQ_ERR' undeclared here (not in a function)
535 | .start =MCFEDMA_IRQ_ERR,Fixes d7e9d01ac292 ("m68k: add ColdFire mcf5441x eDMA platform support")Signed-off-by Randy Dunlap <[email protected]>Reported-by kernel test robot <[email protected]>Link lore.kernel.org/r/[email protected]Cc Angelo Dureghello <[email protected]>Cc Greg Ungerer <[email protected]>Cc Greg Ungerer <[email protected]>Cc Geert Uytterhoeven <[email protected]>--- arch/m68k/coldfire/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/m68k/coldfire/device.c static struct platform_device mcf_i2c5 = · line 483
Quoted 5 lines
arch/m68k/coldfire/device.c +1
-1@@ -480,7 +480,7 @@ static struct platform_device mcf_i2c5 =#endif /* MCFI2C_BASE5 */ #endif /* IS_ENABLED(CONFIG_I2C_IMX) */ -#if IS_ENABLED (CONFIG_MCF_EDMA ) +#if IS_ENABLED (CONFIG_MCF_EDMA ) &&IS_ENABLED (CONFIG_M5441x)
I really try to avoid making these ColdFire SoC specific. Freescale has a habit of using the same hardware blocks across a number of parts. The model so far has been to let the Kconfig select these out as required (and so not having to conditionally duplicate that here).
I would prefer it to be conditional on !COMPILE_TEST if that is what is ultimately causing the problem.
Regards
Greg
Quoted 21 lines
arch/m68k/coldfire/device.c +2
-2static const struct dma_slave_map mcf_edma_map[] = { {"dreq0" ,"rx-tx" ,MCF_EDMA_FILTER_PARAM (0 ) },@@ -552,7 +552,7 @@ static struct platform_device mcf_edma = .platform_data = &mcf_edma_data, } }; -#endif /* IS_ENABLED(CONFIG_MCF_EDMA) */ +#endif /* IS_ENABLED(CONFIG_MCF_EDMA) && IS_ENABLED(CONFIG_M5441x) */ #ifdef MCFSDHC_BASE static struct mcf_esdhc_platform_data mcf_esdhc_data = {@@ -651,7 +651,7 @@ static struct platform_device *mcf_devic &mcf_i2c5,#endif #endif -#if IS_ENABLED (CONFIG_MCF_EDMA ) +#if IS_ENABLED (CONFIG_MCF_EDMA ) &&IS_ENABLED (CONFIG_M5441x) &mcf_edma,#endif #ifdef MCFSDHC_BASE
Quoted 54 lines · Greg Ungerer
Hi Randy,
Quoted 41 lines · Randy Dunlap
When
CONFIG_MCF_EDMAis set (due toCOMPILE_TEST, not due toCONFIG_M5441x),coldfire/device.chas compile errors due to missing MCFEDMA_* symbols. In the .config file that was provided,CONFIG_M5206=y, notCONFIG_M5441x, so <asm/m5441xsim.h> is not included incoldfire/device.c.Only build the
MCF_EDMAcode incoldfire/device.cif bothMCF_EDMAand M5441x are enabled.Fixes these build errors:
../arch/m68k/coldfire/device.c:512:35: error: 'MCFEDMA_BASE' undeclared here (not in a function); did you mean 'MCFDMA_BASE1'? 512 | .start =MCFEDMA_BASE,../arch/m68k/coldfire/device.c:513:50: error: 'MCFEDMA_SIZE' undeclared here (not in a function)
513 | .end =MCFEDMA_BASE+MCFEDMA_SIZE- 1,../arch/m68k/coldfire/device.c:517:35: error: 'MCFEDMA_IRQ_INTR0' undeclared here (not in a function)
517 | .start =MCFEDMA_IRQ_INTR0,../arch/m68k/coldfire/device.c:523:35: error: 'MCFEDMA_IRQ_INTR16' undeclared here (not in a function) 523 | .start =MCFEDMA_IRQ_INTR16,../arch/m68k/coldfire/device.c:529:35: error: 'MCFEDMA_IRQ_INTR56' undeclared here (not in a function) 529 | .start =MCFEDMA_IRQ_INTR56,../arch/m68k/coldfire/device.c:535:35: error: 'MCFEDMA_IRQ_ERR' undeclared here (not in a function)
535 | .start =MCFEDMA_IRQ_ERR,Fixes d7e9d01ac292 ("m68k: add ColdFire mcf5441x eDMA platform support")Signed-off-by Randy Dunlap <[email protected]>Reported-by kernel test robot <[email protected]>Link lore.kernel.org/r/[email protected]Cc Angelo Dureghello <[email protected]>Cc Greg Ungerer <[email protected]>Cc Greg Ungerer <[email protected]>Cc Geert Uytterhoeven <[email protected]>---
arch/m68k/coldfire/device.c| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)arch/m68k/coldfire/device.c static struct platform_device mcf_i2c5 = · line 483
Quoted 4 lines
arch/m68k/coldfire/device.c +1
-0@@ -480,7 +480,7 @@ static struct platform_device mcf_i2c5 = #endif /* MCFI2C_BASE5 */ #endif /* IS_ENABLED(CONFIG_I2C_IMX) */ -#if IS_ENABLED(CONFIG_MCF_EDMA) +#if IS_ENABLED (CONFIG_MCF_EDMA ) &&IS_ENABLED (CONFIG_M5441x)I really try to avoid making these ColdFire SoC specific. Freescale has a habit of using the same hardware blocks across a number of parts. The model so far has been to let the
Kconfigselect these out as required (and so not having to conditionally duplicate that here).
Quoted 2 lines
I would prefer it to be conditional on !COMPILE_TEST if that is what is ultimately causing the problem.
What is ultimately causing the problem is drivers/dma/Kconfig:
config MCF_EDMA
tristate "Freescale eDMA engine support, ColdFire mcf5441x SoCs" depends on M5441x || COMPILE_TEST
Would you prefer to just remove that COMPILE_TEST?
Or do like Geert suggested -- see your previous patch:
commit 322c512f476f07e9 ("m68knommu: include SDHC support only when hardware has it")
thanks.
Signature · 1 line
~Randy
Greg Ungerer
maintainerQuoted 61 lines · Randy Dunlap
Quoted 54 lines · Greg Ungerer
Hi Randy,
Quoted 41 lines · Randy Dunlap
When
CONFIG_MCF_EDMAis set (due toCOMPILE_TEST, not due toCONFIG_M5441x),coldfire/device.chas compile errors due to missing MCFEDMA_* symbols. In the .config file that was provided,CONFIG_M5206=y, notCONFIG_M5441x, so <asm/m5441xsim.h> is not included incoldfire/device.c.Only build the
MCF_EDMAcode incoldfire/device.cif bothMCF_EDMAand M5441x are enabled.Fixes these build errors:
../arch/m68k/coldfire/device.c:512:35: error: 'MCFEDMA_BASE' undeclared here (not in a function); did you mean 'MCFDMA_BASE1'?
512 | .start =MCFEDMA_BASE,../arch/m68k/coldfire/device.c:513:50: error: 'MCFEDMA_SIZE' undeclared here (not in a function)
513 | .end =MCFEDMA_BASE+MCFEDMA_SIZE- 1,../arch/m68k/coldfire/device.c:517:35: error: 'MCFEDMA_IRQ_INTR0' undeclared here (not in a function)
517 | .start =MCFEDMA_IRQ_INTR0,../arch/m68k/coldfire/device.c:523:35: error: 'MCFEDMA_IRQ_INTR16' undeclared here (not in a function)
523 | .start =MCFEDMA_IRQ_INTR16,../arch/m68k/coldfire/device.c:529:35: error: 'MCFEDMA_IRQ_INTR56' undeclared here (not in a function)
529 | .start =MCFEDMA_IRQ_INTR56,../arch/m68k/coldfire/device.c:535:35: error: 'MCFEDMA_IRQ_ERR' undeclared here (not in a function)
535 | .start =MCFEDMA_IRQ_ERR,Fixes d7e9d01ac292 ("m68k: add ColdFire mcf5441x eDMA platform support")Signed-off-by Randy Dunlap <[email protected]>Reported-by kernel test robot <[email protected]>Link lore.kernel.org/r/[email protected]Cc Angelo Dureghello <[email protected]>Cc Greg Ungerer <[email protected]>Cc Greg Ungerer <[email protected]>Cc Geert Uytterhoeven <[email protected]>--- arch/m68k/coldfire/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/m68k/coldfire/device.c static struct platform_device mcf_i2c5 = · line 483
Quoted 4 lines
arch/m68k/coldfire/device.c +1
-0@@ -480,7 +480,7 @@ static struct platform_device mcf_i2c5 = #endif /* MCFI2C_BASE5 */ #endif /* IS_ENABLED(CONFIG_I2C_IMX) */ -#if IS_ENABLED(CONFIG_MCF_EDMA) +#if IS_ENABLED (CONFIG_MCF_EDMA ) &&IS_ENABLED (CONFIG_M5441x)I really try to avoid making these ColdFire SoC specific. Freescale has a habit of using the same hardware blocks across a number of parts. The model so far has been to let the
Kconfigselect these out as required (and so not having to conditionally duplicate that here).Quoted 2 lines
I would prefer it to be conditional on !COMPILE_TEST if that is what is ultimately causing the problem.
What is ultimately causing the problem is
drivers/dma/Kconfig:config
MCF_EDMA
Quoted 8 lines
tristate "Freescale eDMA engine support, ColdFire mcf5441x SoCs" depends on M5441x || COMPILE_TESTWould you prefer to just remove that
COMPILE_TEST?Or do like Geert suggested -- see your previous patch:
commit322c512f476f07e9("m68knommu: include SDHC support only when hardware has it")
No need to remove COMPILE_TEST, so lets leave that in place.
I should have thought about what I had done here in the past before I replied :-) As Geert pointed out the strategy we used before is to just make it conditional on the address definitions. So lets do that. The presence of an address definition is the real indicator that we have this hardware block.
Regards
Greg