All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] m68knommu: include SDHC support only when hardware has it
@ 2020-09-21  3:08 Greg Ungerer
  2020-09-21  7:23 ` Geert Uytterhoeven
  2020-09-21  7:38 ` Angelo Dureghello
  0 siblings, 2 replies; 5+ messages in thread
From: Greg Ungerer @ 2020-09-21  3:08 UTC (permalink / raw)
  To: linux-m68k; +Cc: angelo.dureghello, Greg Ungerer

The mere fact that the kernel has the MMC subsystem enabled (CONFIG_MMC
enabled) does not mean that the underlying hardware platform has the
SDHC hardware present. Within the ColdFire hardware defines that is
signified by MCFSDHC_BASE being defined with an address.

The platform data for the ColdFire parts is including the SDHC hardware
if CONFIG_MMC is enabled, instead of MCFSDHC_BASE. This means that if
you are compiling for a ColdFire target that does not support SDHC but
enable CONFIG_MMC you will fail to compile with errors like this:

    arch/m68k/coldfire/device.c:565:12: error: ‘MCFSDHC_BASE’ undeclared here (not in a function)
       .start = MCFSDHC_BASE,
            ^
    arch/m68k/coldfire/device.c:566:25: error: ‘MCFSDHC_SIZE’ undeclared here (not in a function)
       .end = MCFSDHC_BASE + MCFSDHC_SIZE - 1,
                         ^
    arch/m68k/coldfire/device.c:569:12: error: ‘MCF_IRQ_SDHC’ undeclared here (not in a function)
       .start = MCF_IRQ_SDHC,
            ^

Make the SDHC platform support depend on MCFSDHC_BASE, that is only
include it if the specific ColdFire SoC has that hardware module.

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 arch/m68k/coldfire/device.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/coldfire/device.c b/arch/m68k/coldfire/device.c
index 9ef4ec0aea00..59f7dfe50a4d 100644
--- a/arch/m68k/coldfire/device.c
+++ b/arch/m68k/coldfire/device.c
@@ -554,7 +554,7 @@ static struct platform_device mcf_edma = {
 };
 #endif /* IS_ENABLED(CONFIG_MCF_EDMA) */
 
-#if IS_ENABLED(CONFIG_MMC)
+#ifdef MCFSDHC_BASE
 static struct mcf_esdhc_platform_data mcf_esdhc_data = {
 	.max_bus_width = 4,
 	.cd_type = ESDHC_CD_NONE,
@@ -579,7 +579,7 @@ static struct platform_device mcf_esdhc = {
 	.resource		= mcf_esdhc_resources,
 	.dev.platform_data	= &mcf_esdhc_data,
 };
-#endif /* IS_ENABLED(CONFIG_MMC) */
+#endif /* MCFSDHC_BASE */
 
 static struct platform_device *mcf_devices[] __initdata = {
 	&mcf_uart,
@@ -613,7 +613,7 @@ static struct platform_device *mcf_devices[] __initdata = {
 #if IS_ENABLED(CONFIG_MCF_EDMA)
 	&mcf_edma,
 #endif
-#if IS_ENABLED(CONFIG_MMC)
+#ifdef MCFSDHC_BASE
 	&mcf_esdhc,
 #endif
 };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68knommu: include SDHC support only when hardware has it
  2020-09-21  3:08 [PATCH] m68knommu: include SDHC support only when hardware has it Greg Ungerer
@ 2020-09-21  7:23 ` Geert Uytterhoeven
  2020-09-21 12:22   ` Greg Ungerer
  2020-09-21  7:38 ` Angelo Dureghello
  1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2020-09-21  7:23 UTC (permalink / raw)
  To: Greg Ungerer; +Cc: Linux/m68k, Angelo Dureghello

On Mon, Sep 21, 2020 at 5:09 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> The mere fact that the kernel has the MMC subsystem enabled (CONFIG_MMC
> enabled) does not mean that the underlying hardware platform has the
> SDHC hardware present. Within the ColdFire hardware defines that is
> signified by MCFSDHC_BASE being defined with an address.
>
> The platform data for the ColdFire parts is including the SDHC hardware
> if CONFIG_MMC is enabled, instead of MCFSDHC_BASE. This means that if
> you are compiling for a ColdFire target that does not support SDHC but
> enable CONFIG_MMC you will fail to compile with errors like this:
>
>     arch/m68k/coldfire/device.c:565:12: error: ‘MCFSDHC_BASE’ undeclared here (not in a function)
>        .start = MCFSDHC_BASE,
>             ^
>     arch/m68k/coldfire/device.c:566:25: error: ‘MCFSDHC_SIZE’ undeclared here (not in a function)
>        .end = MCFSDHC_BASE + MCFSDHC_SIZE - 1,
>                          ^
>     arch/m68k/coldfire/device.c:569:12: error: ‘MCF_IRQ_SDHC’ undeclared here (not in a function)
>        .start = MCF_IRQ_SDHC,
>             ^
>
> Make the SDHC platform support depend on MCFSDHC_BASE, that is only
> include it if the specific ColdFire SoC has that hardware module.
>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

Fixes: 991f5c4dd2422881 ("m68k: mcf5441x: add support for esdhc mmc controller")
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68knommu: include SDHC support only when hardware has it
  2020-09-21  3:08 [PATCH] m68knommu: include SDHC support only when hardware has it Greg Ungerer
  2020-09-21  7:23 ` Geert Uytterhoeven
@ 2020-09-21  7:38 ` Angelo Dureghello
  2020-09-21 12:22   ` Greg Ungerer
  1 sibling, 1 reply; 5+ messages in thread
From: Angelo Dureghello @ 2020-09-21  7:38 UTC (permalink / raw)
  To: Greg Ungerer; +Cc: Linux/m68k

Hi Greg,

thanks a lot for the fix.

On Mon, Sep 21, 2020 at 5:09 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
>
> The mere fact that the kernel has the MMC subsystem enabled (CONFIG_MMC
> enabled) does not mean that the underlying hardware platform has the
> SDHC hardware present. Within the ColdFire hardware defines that is
> signified by MCFSDHC_BASE being defined with an address.
>
> The platform data for the ColdFire parts is including the SDHC hardware
> if CONFIG_MMC is enabled, instead of MCFSDHC_BASE. This means that if
> you are compiling for a ColdFire target that does not support SDHC but
> enable CONFIG_MMC you will fail to compile with errors like this:
>
>     arch/m68k/coldfire/device.c:565:12: error: ‘MCFSDHC_BASE’ undeclared here (not in a function)
>        .start = MCFSDHC_BASE,
>             ^
>     arch/m68k/coldfire/device.c:566:25: error: ‘MCFSDHC_SIZE’ undeclared here (not in a function)
>        .end = MCFSDHC_BASE + MCFSDHC_SIZE - 1,
>                          ^
>     arch/m68k/coldfire/device.c:569:12: error: ‘MCF_IRQ_SDHC’ undeclared here (not in a function)
>        .start = MCF_IRQ_SDHC,
>             ^
>
> Make the SDHC platform support depend on MCFSDHC_BASE, that is only
> include it if the specific ColdFire SoC has that hardware module.
>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> ---
>  arch/m68k/coldfire/device.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/m68k/coldfire/device.c b/arch/m68k/coldfire/device.c
> index 9ef4ec0aea00..59f7dfe50a4d 100644
> --- a/arch/m68k/coldfire/device.c
> +++ b/arch/m68k/coldfire/device.c
> @@ -554,7 +554,7 @@ static struct platform_device mcf_edma = {
>  };
>  #endif /* IS_ENABLED(CONFIG_MCF_EDMA) */
>
> -#if IS_ENABLED(CONFIG_MMC)
> +#ifdef MCFSDHC_BASE
>  static struct mcf_esdhc_platform_data mcf_esdhc_data = {
>         .max_bus_width = 4,
>         .cd_type = ESDHC_CD_NONE,
> @@ -579,7 +579,7 @@ static struct platform_device mcf_esdhc = {
>         .resource               = mcf_esdhc_resources,
>         .dev.platform_data      = &mcf_esdhc_data,
>  };
> -#endif /* IS_ENABLED(CONFIG_MMC) */
> +#endif /* MCFSDHC_BASE */
>
>  static struct platform_device *mcf_devices[] __initdata = {
>         &mcf_uart,
> @@ -613,7 +613,7 @@ static struct platform_device *mcf_devices[] __initdata = {
>  #if IS_ENABLED(CONFIG_MCF_EDMA)
>         &mcf_edma,
>  #endif
> -#if IS_ENABLED(CONFIG_MMC)
> +#ifdef MCFSDHC_BASE
>         &mcf_esdhc,
>  #endif
>  };
> --
> 2.25.1
>

Tested on mcf54418 stmark2.

Reviewed-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Tested-by: Angelo Dureghello <angelo.dureghello@timesys.com>


Regards,
angelo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68knommu: include SDHC support only when hardware has it
  2020-09-21  7:23 ` Geert Uytterhoeven
@ 2020-09-21 12:22   ` Greg Ungerer
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Ungerer @ 2020-09-21 12:22 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k, Angelo Dureghello


On 21/9/20 5:23 pm, Geert Uytterhoeven wrote:
> On Mon, Sep 21, 2020 at 5:09 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
>> The mere fact that the kernel has the MMC subsystem enabled (CONFIG_MMC
>> enabled) does not mean that the underlying hardware platform has the
>> SDHC hardware present. Within the ColdFire hardware defines that is
>> signified by MCFSDHC_BASE being defined with an address.
>>
>> The platform data for the ColdFire parts is including the SDHC hardware
>> if CONFIG_MMC is enabled, instead of MCFSDHC_BASE. This means that if
>> you are compiling for a ColdFire target that does not support SDHC but
>> enable CONFIG_MMC you will fail to compile with errors like this:
>>
>>      arch/m68k/coldfire/device.c:565:12: error: ‘MCFSDHC_BASE’ undeclared here (not in a function)
>>         .start = MCFSDHC_BASE,
>>              ^
>>      arch/m68k/coldfire/device.c:566:25: error: ‘MCFSDHC_SIZE’ undeclared here (not in a function)
>>         .end = MCFSDHC_BASE + MCFSDHC_SIZE - 1,
>>                           ^
>>      arch/m68k/coldfire/device.c:569:12: error: ‘MCF_IRQ_SDHC’ undeclared here (not in a function)
>>         .start = MCF_IRQ_SDHC,
>>              ^
>>
>> Make the SDHC platform support depend on MCFSDHC_BASE, that is only
>> include it if the specific ColdFire SoC has that hardware module.
>>
>> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> 
> Fixes: 991f5c4dd2422881 ("m68k: mcf5441x: add support for esdhc mmc controller")
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Yep, will add, thanks Geert.

Regards
Greg


> Gr{oetje,eeting}s,
> 
>                          Geert
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68knommu: include SDHC support only when hardware has it
  2020-09-21  7:38 ` Angelo Dureghello
@ 2020-09-21 12:22   ` Greg Ungerer
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Ungerer @ 2020-09-21 12:22 UTC (permalink / raw)
  To: Angelo Dureghello; +Cc: Linux/m68k

Hi Angelo,

On 21/9/20 5:38 pm, Angelo Dureghello wrote:
> Hi Greg,
> 
> thanks a lot for the fix.
> 
> On Mon, Sep 21, 2020 at 5:09 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
>>
>> The mere fact that the kernel has the MMC subsystem enabled (CONFIG_MMC
>> enabled) does not mean that the underlying hardware platform has the
>> SDHC hardware present. Within the ColdFire hardware defines that is
>> signified by MCFSDHC_BASE being defined with an address.
>>
>> The platform data for the ColdFire parts is including the SDHC hardware
>> if CONFIG_MMC is enabled, instead of MCFSDHC_BASE. This means that if
>> you are compiling for a ColdFire target that does not support SDHC but
>> enable CONFIG_MMC you will fail to compile with errors like this:
>>
>>      arch/m68k/coldfire/device.c:565:12: error: ‘MCFSDHC_BASE’ undeclared here (not in a function)
>>         .start = MCFSDHC_BASE,
>>              ^
>>      arch/m68k/coldfire/device.c:566:25: error: ‘MCFSDHC_SIZE’ undeclared here (not in a function)
>>         .end = MCFSDHC_BASE + MCFSDHC_SIZE - 1,
>>                           ^
>>      arch/m68k/coldfire/device.c:569:12: error: ‘MCF_IRQ_SDHC’ undeclared here (not in a function)
>>         .start = MCF_IRQ_SDHC,
>>              ^
>>
>> Make the SDHC platform support depend on MCFSDHC_BASE, that is only
>> include it if the specific ColdFire SoC has that hardware module.
>>
>> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
>> ---
>>   arch/m68k/coldfire/device.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/m68k/coldfire/device.c b/arch/m68k/coldfire/device.c
>> index 9ef4ec0aea00..59f7dfe50a4d 100644
>> --- a/arch/m68k/coldfire/device.c
>> +++ b/arch/m68k/coldfire/device.c
>> @@ -554,7 +554,7 @@ static struct platform_device mcf_edma = {
>>   };
>>   #endif /* IS_ENABLED(CONFIG_MCF_EDMA) */
>>
>> -#if IS_ENABLED(CONFIG_MMC)
>> +#ifdef MCFSDHC_BASE
>>   static struct mcf_esdhc_platform_data mcf_esdhc_data = {
>>          .max_bus_width = 4,
>>          .cd_type = ESDHC_CD_NONE,
>> @@ -579,7 +579,7 @@ static struct platform_device mcf_esdhc = {
>>          .resource               = mcf_esdhc_resources,
>>          .dev.platform_data      = &mcf_esdhc_data,
>>   };
>> -#endif /* IS_ENABLED(CONFIG_MMC) */
>> +#endif /* MCFSDHC_BASE */
>>
>>   static struct platform_device *mcf_devices[] __initdata = {
>>          &mcf_uart,
>> @@ -613,7 +613,7 @@ static struct platform_device *mcf_devices[] __initdata = {
>>   #if IS_ENABLED(CONFIG_MCF_EDMA)
>>          &mcf_edma,
>>   #endif
>> -#if IS_ENABLED(CONFIG_MMC)
>> +#ifdef MCFSDHC_BASE
>>          &mcf_esdhc,
>>   #endif
>>   };
>> --
>> 2.25.1
>>
> 
> Tested on mcf54418 stmark2.
> 
> Reviewed-by: Angelo Dureghello <angelo.dureghello@timesys.com>
> Tested-by: Angelo Dureghello <angelo.dureghello@timesys.com>

Thanks, will add those.

Regards
Greg


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-21 12:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21  3:08 [PATCH] m68knommu: include SDHC support only when hardware has it Greg Ungerer
2020-09-21  7:23 ` Geert Uytterhoeven
2020-09-21 12:22   ` Greg Ungerer
2020-09-21  7:38 ` Angelo Dureghello
2020-09-21 12:22   ` Greg Ungerer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.