From: Thomas Chou <thomas@wytron.com.tw>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] dm: serial: Allow the UART driver to be dropped from the image
Date: Mon, 14 Dec 2015 20:53:26 +0800 [thread overview]
Message-ID: <566EBBC6.3090002@wytron.com.tw> (raw)
In-Reply-To: <1450067820-17357-2-git-send-email-sjg@chromium.org>
Hi Simon,
On 2015?12?14? 12:36, Simon Glass wrote:
> In very very space-constrained devices even the full UART driver is too
> large. In this case the debug UART can still be used in some cases.
>
> Add options to enable the UART driver in SPL and U-Boot proper. Enable both
> options by default.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> drivers/serial/Kconfig | 20 ++++++++++++++++++++
> drivers/serial/serial-uclass.c | 2 ++
> 2 files changed, 22 insertions(+)
>
> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> index 1fc287e..04541c9 100644
> --- a/drivers/serial/Kconfig
> +++ b/drivers/serial/Kconfig
> @@ -15,6 +15,26 @@ config REQUIRE_SERIAL_CONSOLE
> during serial port initialization (default y). Set this to n on
> boards which have no debug serial port whatsoever.
>
> +config SERIAL_PRESENT
> + bool "Provide a serial driver"
> + depends on DM_SERIAL
> + default y
> + help
> + In very space-constrained devices even the full UART driver is too
> + large. In this case the debug UART can still be used in some cases.
> + This option enables the full UART in U-Boot, so if is it disabled,
> + the full UART driver will be omitted, thus saving space.
> +
> +config SPL_SERIAL_PRESENT
> + bool "Provide a serial driver in SPL"
> + depends on DM_SERIAL
> + default y
> + help
> + In very space-constrained devices even the full UART driver is too
> + large. In this case the debug UART can still be used in some cases.
> + This option enables the full UART in SPL, so if is it disabled,
> + the full UART driver will be omitted, thus saving space.
> +
> config DM_SERIAL
> bool "Enable Driver Model for serial drivers"
> depends on DM
> diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
> index 4bf9a5c..95c3b91 100644
> --- a/drivers/serial/serial-uclass.c
> +++ b/drivers/serial/serial-uclass.c
> @@ -287,6 +287,7 @@ static int on_baudrate(const char *name, const char *value, enum env_op op,
> }
> U_BOOT_ENV_CALLBACK(baudrate, on_baudrate);
>
> +#if CONFIG_IS_ENABLED(SERIAL_PRESENT)
> static int serial_post_probe(struct udevice *dev)
> {
> struct dm_serial_ops *ops = serial_get_ops(dev);
> @@ -356,3 +357,4 @@ UCLASS_DRIVER(serial) = {
> .pre_remove = serial_pre_remove,
> .per_device_auto_alloc_size = sizeof(struct serial_dev_priv),
> };
> +#endif
>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
next prev parent reply other threads:[~2015-12-14 12:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-14 4:36 [U-Boot] [PATCH 0/3] rockchip: Use the standard debug UART on rockchip Simon Glass
2015-12-14 4:36 ` [U-Boot] [PATCH 1/3] dm: serial: Allow the UART driver to be dropped from the image Simon Glass
2015-12-14 12:53 ` Thomas Chou [this message]
2015-12-19 22:23 ` Simon Glass
2015-12-14 4:36 ` [U-Boot] [PATCH 2/3] dm: ns16550: Allow the driver to be omitted if requested Simon Glass
2015-12-14 12:53 ` Thomas Chou
2015-12-19 22:23 ` Simon Glass
2015-12-14 4:37 ` [U-Boot] [PATCH 3/3] rockchip: Use the debug UART on rk3036 Simon Glass
2015-12-14 12:53 ` Thomas Chou
2015-12-19 22:23 ` Simon Glass
2015-12-14 6:26 ` [U-Boot] [PATCH 0/3] rockchip: Use the standard debug UART on rockchip hl
2015-12-14 22:14 ` Simon Glass
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=566EBBC6.3090002@wytron.com.tw \
--to=thomas@wytron.com.tw \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox