]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
dm: serial: Allow driver-model serial to be disabled for TPL
authorSimon Glass <sjg@chromium.org>
Sun, 2 Apr 2017 15:50:32 +0000 (09:50 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 5 Apr 2017 20:36:59 +0000 (16:36 -0400)
Add separate enable/disable controls for driver-model serial. While this
is generally enabled in SPL it may not be in TPL, since serial output can
be obtained with the debug UART with minimal code size.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/serial/Kconfig
drivers/serial/Makefile

index ca56a7e60428fa2b54b3abb0be1f89a12ac2e2ab..0900cc8acb7f681d49bce1a0e016443ee5fff51c 100644 (file)
@@ -53,6 +53,26 @@ config DM_SERIAL
          implements serial_putc() etc. The uclass interface is
          defined in include/serial.h.
 
+config SPL_DM_SERIAL
+       bool "Enable Driver Model for serial drivers"
+       depends on DM_SERIAL
+       default y if SPL && DM_SERIAL
+       help
+         Enable driver model for serial in SPL. This replaces
+         drivers/serial/serial.c with the serial uclass, which
+         implements serial_putc() etc. The uclass interface is
+         defined in include/serial.h.
+
+config TPL_DM_SERIAL
+       bool "Enable Driver Model for serial drivers"
+       depends on DM_SERIAL
+       default y if TPL && DM_SERIAL
+       help
+         Enable driver model for serial in TPL. This replaces
+         drivers/serial/serial.c with the serial uclass, which
+         implements serial_putc() etc. The uclass interface is
+         defined in include/serial.h.
+
 config DEBUG_UART
        bool "Enable an early debug UART for debugging"
        help
index 4ed4bba1bb60961b33b2f05b833e2fd234fd01b0..8ba15ce028e87e9d9e979440d0640cc388d35844 100644 (file)
@@ -6,7 +6,7 @@
 #
 
 ifdef CONFIG_DM_SERIAL
-obj-y += serial-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)DM_SERIAL) += serial-uclass.o
 obj-$(CONFIG_PL01X_SERIAL) += serial_pl01x.o
 else
 obj-y += serial.o