All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: conditionally compile platform-specific serial drivers
@ 2017-06-27 14:29 Hannes Reinecke
  2017-06-28  9:52 ` Torsten Duwe
  2017-08-31 11:36 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Hannes Reinecke @ 2017-06-27 14:29 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Torsten Duwe, linuxppc-dev, Hannes Reinecke, Hannes Reinecke

mpsc.c and mpc52xx-psc.c are platform-specific serial drivers, and
should be compiled for the respective platforms only.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 arch/powerpc/boot/Makefile | 7 ++++---
 arch/powerpc/boot/serial.c | 4 ++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index e82f333..1a4609c 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -99,14 +99,15 @@ src-wlib-y := string.S crt0.S crtsavres.S stdio.c decompress.c main.c \
 		$(libfdt) libfdt-wrapper.c \
 		ns16550.c serial.c simple_alloc.c div64.S util.S \
 		elf_util.c $(zlib-y) devtree.c stdlib.c \
-		oflib.c ofconsole.c cuboot.c mpsc.c cpm-serial.c \
-		uartlite.c mpc52xx-psc.c opal.c
+		oflib.c ofconsole.c cuboot.c cpm-serial.c \
+		uartlite.c opal.c
+src-wlib-$(CONFIG_PPC_MPC52XX) += mpc52xx-psc.c
 src-wlib-$(CONFIG_PPC64_BOOT_WRAPPER) +=  opal-calls.S
 src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c
 src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
 src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c fsl-soc.c
 src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c
-src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c fsl-soc.c
+src-wlib-$(CONFIG_EMBEDDED6xx) += mpsc.c mv64x60.c mv64x60_i2c.c ugecon.c fsl-soc.c
 
 src-plat-y := of.c epapr.c
 src-plat-$(CONFIG_40x) += fixed-head.S ep405.c cuboot-hotfoot.c \
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
index e04c1e4..7b5c02b 100644
--- a/arch/powerpc/boot/serial.c
+++ b/arch/powerpc/boot/serial.c
@@ -120,15 +120,19 @@ int serial_console_init(void)
 	if (dt_is_compatible(devp, "ns16550") ||
 	    dt_is_compatible(devp, "pnpPNP,501"))
 		rc = ns16550_console_init(devp, &serial_cd);
+#ifdef CONFIG_EMBEDDED6xx
 	else if (dt_is_compatible(devp, "marvell,mv64360-mpsc"))
 		rc = mpsc_console_init(devp, &serial_cd);
+#endif
 	else if (dt_is_compatible(devp, "fsl,cpm1-scc-uart") ||
 	         dt_is_compatible(devp, "fsl,cpm1-smc-uart") ||
 	         dt_is_compatible(devp, "fsl,cpm2-scc-uart") ||
 	         dt_is_compatible(devp, "fsl,cpm2-smc-uart"))
 		rc = cpm_console_init(devp, &serial_cd);
+#ifdef CONFIG_PPC_MPC52XX
 	else if (dt_is_compatible(devp, "fsl,mpc5200-psc-uart"))
 		rc = mpc5200_psc_console_init(devp, &serial_cd);
+#endif
 	else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
 		 dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
 		rc = uartlite_console_init(devp, &serial_cd);
-- 
1.8.5.6

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

* Re: [PATCH] powerpc: conditionally compile platform-specific serial drivers
  2017-06-27 14:29 [PATCH] powerpc: conditionally compile platform-specific serial drivers Hannes Reinecke
@ 2017-06-28  9:52 ` Torsten Duwe
  2017-08-31 11:36 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Torsten Duwe @ 2017-06-28  9:52 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: Benjamin Herrenschmidt, Hannes Reinecke, linuxppc-dev

On Tue, Jun 27, 2017 at 04:29:51PM +0200, Hannes Reinecke wrote:
> mpsc.c and mpc52xx-psc.c are platform-specific serial drivers, and
> should be compiled for the respective platforms only.

Yes, this is really dead code that gets compiled and copied needlessly,
on all PPCs apart from those embedded platforms.

> Signed-off-by: Hannes Reinecke <hare@suse.com>

Reviewed-by: Torsten Duwe <duwe@suse.de>

> ---
>  arch/powerpc/boot/Makefile | 7 ++++---
>  arch/powerpc/boot/serial.c | 4 ++++
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index e82f333..1a4609c 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -99,14 +99,15 @@ src-wlib-y := string.S crt0.S crtsavres.S stdio.c decompress.c main.c \
>  		$(libfdt) libfdt-wrapper.c \
>  		ns16550.c serial.c simple_alloc.c div64.S util.S \
>  		elf_util.c $(zlib-y) devtree.c stdlib.c \
> -		oflib.c ofconsole.c cuboot.c mpsc.c cpm-serial.c \
> -		uartlite.c mpc52xx-psc.c opal.c
> +		oflib.c ofconsole.c cuboot.c cpm-serial.c \
> +		uartlite.c opal.c
> +src-wlib-$(CONFIG_PPC_MPC52XX) += mpc52xx-psc.c
>  src-wlib-$(CONFIG_PPC64_BOOT_WRAPPER) +=  opal-calls.S
>  src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c
>  src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
>  src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c fsl-soc.c
>  src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c
> -src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c fsl-soc.c
> +src-wlib-$(CONFIG_EMBEDDED6xx) += mpsc.c mv64x60.c mv64x60_i2c.c ugecon.c fsl-soc.c
>  
>  src-plat-y := of.c epapr.c
>  src-plat-$(CONFIG_40x) += fixed-head.S ep405.c cuboot-hotfoot.c \
> diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
> index e04c1e4..7b5c02b 100644
> --- a/arch/powerpc/boot/serial.c
> +++ b/arch/powerpc/boot/serial.c
> @@ -120,15 +120,19 @@ int serial_console_init(void)
>  	if (dt_is_compatible(devp, "ns16550") ||
>  	    dt_is_compatible(devp, "pnpPNP,501"))
>  		rc = ns16550_console_init(devp, &serial_cd);
> +#ifdef CONFIG_EMBEDDED6xx
>  	else if (dt_is_compatible(devp, "marvell,mv64360-mpsc"))
>  		rc = mpsc_console_init(devp, &serial_cd);
> +#endif
>  	else if (dt_is_compatible(devp, "fsl,cpm1-scc-uart") ||
>  	         dt_is_compatible(devp, "fsl,cpm1-smc-uart") ||
>  	         dt_is_compatible(devp, "fsl,cpm2-scc-uart") ||
>  	         dt_is_compatible(devp, "fsl,cpm2-smc-uart"))
>  		rc = cpm_console_init(devp, &serial_cd);
> +#ifdef CONFIG_PPC_MPC52XX
>  	else if (dt_is_compatible(devp, "fsl,mpc5200-psc-uart"))
>  		rc = mpc5200_psc_console_init(devp, &serial_cd);
> +#endif
>  	else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
>  		 dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
>  		rc = uartlite_console_init(devp, &serial_cd);
> -- 
> 1.8.5.6
> 

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

* Re: powerpc: conditionally compile platform-specific serial drivers
  2017-06-27 14:29 [PATCH] powerpc: conditionally compile platform-specific serial drivers Hannes Reinecke
  2017-06-28  9:52 ` Torsten Duwe
@ 2017-08-31 11:36 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2017-08-31 11:36 UTC (permalink / raw)
  To: Hannes Reinecke, Benjamin Herrenschmidt
  Cc: Hannes Reinecke, linuxppc-dev, Hannes Reinecke, Torsten Duwe

On Tue, 2017-06-27 at 14:29:51 UTC, Hannes Reinecke wrote:
> mpsc.c and mpc52xx-psc.c are platform-specific serial drivers, and
> should be compiled for the respective platforms only.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> Reviewed-by: Torsten Duwe <duwe@suse.de>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/866bfc75f40e4f8a00d268f73f3a02

cheers

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

end of thread, other threads:[~2017-08-31 11:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-27 14:29 [PATCH] powerpc: conditionally compile platform-specific serial drivers Hannes Reinecke
2017-06-28  9:52 ` Torsten Duwe
2017-08-31 11:36 ` Michael Ellerman

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.