All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vz@mleia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/3] arm: lpc32xx: switch SPL builds to driver model
Date: Sat, 19 Dec 2015 23:29:26 +0200	[thread overview]
Message-ID: <1450560566-31734-4-git-send-email-vz@mleia.com> (raw)
In-Reply-To: <1450560566-31734-1-git-send-email-vz@mleia.com>

For NXP LPC32xx boards the change enables SPL_DM option, this allows
to use any driver model UART driver in SPL images, hence a restriction
on HSUART in SPL image is removed and well as definitions for non-DM
NS16550 driver, its DM version is used instead.

Because SPL_DM requires malloc(), enable CONFIG_SPL_SYS_MALLOC_SIMPLE
for LPC32xx boards.

The change adds about 5KB to the resulting SPL image (for devkit3250
board SPL image is increased from 10672 to 15608 bytes).

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
Changes from v1 to v2:
* added CONFIG_SPL_SYS_MALLOC_SIMPLE to defconfigs
* removed ambiguity from a commit message

 arch/arm/cpu/arm926ejs/lpc32xx/devices.c   |  2 +-
 arch/arm/include/asm/arch-lpc32xx/config.h | 19 +------------------
 configs/devkit3250_defconfig               |  2 ++
 configs/work_92105_defconfig               |  2 ++
 4 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/devices.c b/arch/arm/cpu/arm926ejs/lpc32xx/devices.c
index 6f10186..b6db23e 100644
--- a/arch/arm/cpu/arm926ejs/lpc32xx/devices.c
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/devices.c
@@ -43,7 +43,7 @@ void lpc32xx_uart_init(unsigned int uart_id)
 	       &clk->u3clk + (uart_id - 3));
 }
 
-#if !CONFIG_IS_ENABLED(OF_CONTROL) && !defined(CONFIG_SPL_BUILD)
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct ns16550_platdata lpc32xx_uart[] = {
 	{ UART3_BASE, 2, CONFIG_SYS_NS16550_CLK },
 	{ UART4_BASE, 2, CONFIG_SYS_NS16550_CLK },
diff --git a/arch/arm/include/asm/arch-lpc32xx/config.h b/arch/arm/include/asm/arch-lpc32xx/config.h
index 27e60e1..3b7f6bd 100644
--- a/arch/arm/include/asm/arch-lpc32xx/config.h
+++ b/arch/arm/include/asm/arch-lpc32xx/config.h
@@ -18,33 +18,16 @@
 /* UART configuration */
 #if	(CONFIG_SYS_LPC32XX_UART == 1) || (CONFIG_SYS_LPC32XX_UART == 2) || \
 	(CONFIG_SYS_LPC32XX_UART == 7)
-#if defined(CONFIG_SPL_BUILD)
-/* SPL images do not support LPC32xx HSUART, UART5 is selected for SPL */
-#undef CONFIG_SYS_LPC32XX_UART
-#define CONFIG_SYS_LPC32XX_UART		5
-#endif
-
 #if !defined(CONFIG_LPC32XX_HSUART)
 #define CONFIG_LPC32XX_HSUART
 #endif
 #endif
 
-#if defined(CONFIG_SPL_BUILD)
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE	-4
-#define CONFIG_SYS_NS16550_CLK		get_serial_clock()
-
-#define CONFIG_SYS_NS16550_COM1		UART3_BASE
-#define CONFIG_SYS_NS16550_COM2		UART4_BASE
-#define CONFIG_SYS_NS16550_COM3		UART5_BASE
-#define CONFIG_SYS_NS16550_COM4		UART6_BASE
-#endif
-
 #if !defined(CONFIG_SYS_NS16550_CLK)
 #define CONFIG_SYS_NS16550_CLK		13000000
 #endif
 
-#if !defined(CONFIG_LPC32XX_HSUART) || defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_LPC32XX_HSUART)
 #define CONFIG_CONS_INDEX		(CONFIG_SYS_LPC32XX_UART - 2)
 #else
 #define CONFIG_CONS_INDEX		CONFIG_SYS_LPC32XX_UART
diff --git a/configs/devkit3250_defconfig b/configs/devkit3250_defconfig
index 0abb8e0..ddf09fe 100644
--- a/configs/devkit3250_defconfig
+++ b/configs/devkit3250_defconfig
@@ -1,5 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_DEVKIT3250=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_DM=y
 CONFIG_DM_SERIAL=y
 CONFIG_DM_GPIO=y
 CONFIG_SPL=y
diff --git a/configs/work_92105_defconfig b/configs/work_92105_defconfig
index a5a108e..1a9097a 100644
--- a/configs/work_92105_defconfig
+++ b/configs/work_92105_defconfig
@@ -1,5 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_WORK_92105=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_DM=y
 CONFIG_DM_SERIAL=y
 CONFIG_DM_GPIO=y
 CONFIG_SPL=y
-- 
2.1.4

  parent reply	other threads:[~2015-12-19 21:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19 21:29 [U-Boot] [PATCH v2 0/3] arm: lpc32xx: use driver model serial console drivers Vladimir Zapolskiy
2015-12-19 21:29 ` [U-Boot] [PATCH v2 1/3] serial: lpc32xx hsuart: port driver to driver model Vladimir Zapolskiy
2016-01-14 13:21   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-12-19 21:29 ` [U-Boot] [PATCH v2 2/3] arm: lpc32xx: switch serial console " Vladimir Zapolskiy
2016-01-14 13:21   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-12-19 21:29 ` Vladimir Zapolskiy [this message]
2015-12-28  4:22   ` [U-Boot] [PATCH v2 3/3] arm: lpc32xx: switch SPL builds " Simon Glass
2016-01-14 13:21   ` [U-Boot] [U-Boot, v2, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450560566-31734-4-git-send-email-vz@mleia.com \
    --to=vz@mleia.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.