diff mbox

[U-Boot,v2,5/5] dm: serial: Allow driver-model serial to be disabled for TPL

Message ID 20170402155032.27473-6-sjg@chromium.org
State Accepted
Commit 891f7ae63318293cd5807fb611f86f545080b1f6
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass April 2, 2017, 3:50 p.m. UTC
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>
---

Changes in v2:
- Add new patch to allow driver-model serial to be disabled for TPL

 drivers/serial/Kconfig  | 20 ++++++++++++++++++++
 drivers/serial/Makefile |  2 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

Comments

Tom Rini April 6, 2017, 4:26 p.m. UTC | #1
On Sun, Apr 02, 2017 at 09:50:32AM -0600, Simon Glass wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index ca56a7e604..0900cc8acb 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -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
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 84a22ce14c..87c5f145d1 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -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