powerpc/boot: Only build CPM code when necessary
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 8 Nov 2017 11:05:29 +0000 (22:05 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 11 Dec 2017 02:03:31 +0000 (13:03 +1100)
As far as I can tell CONFIG_CPM is the right symbol to use to
conditionally compile the cpm-serial.c code.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/boot/Makefile
arch/powerpc/boot/serial.c

index 650be8300fda2e6fe09f61b97a936cf5024a2009..ef6549e5715717003bf3fe9fc3a3c869e1fd5b2f 100644 (file)
@@ -108,7 +108,7 @@ src-wlib-y := string.S crt0.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 cpm-serial.c
+               oflib.c ofconsole.c cuboot.c
 
 src-wlib-$(CONFIG_PPC_MPC52XX) += mpc52xx-psc.c
 src-wlib-$(CONFIG_PPC64_BOOT_WRAPPER) += opal-calls.S opal.c
@@ -121,6 +121,7 @@ src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c
 src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c
 src-wlib-$(CONFIG_EMBEDDED6xx) += mpsc.c mv64x60.c mv64x60_i2c.c ugecon.c fsl-soc.c
 src-wlib-$(CONFIG_XILINX_VIRTEX) += uartlite.c
+src-wlib-$(CONFIG_CPM) += cpm-serial.c
 
 src-plat-y := of.c epapr.c
 src-plat-$(CONFIG_40x) += fixed-head.S ep405.c cuboot-hotfoot.c \
index 6f2b2ecf10bd5e068cbbc462d3a3d17261573833..88955095ec07d0cc46d4074ef6b9b6c61e7c4863 100644 (file)
@@ -124,11 +124,13 @@ int serial_console_init(void)
        else if (dt_is_compatible(devp, "marvell,mv64360-mpsc"))
                rc = mpsc_console_init(devp, &serial_cd);
 #endif
+#ifdef CONFIG_CPM
        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);
+#endif
 #ifdef CONFIG_PPC_MPC52XX
        else if (dt_is_compatible(devp, "fsl,mpc5200-psc-uart"))
                rc = mpc5200_psc_console_init(devp, &serial_cd);