diff options
author | Simon Glass <sjg@chromium.org> | 2019-12-20 03:58:18 +0300 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-02-03 20:19:13 +0300 |
commit | 62cbde4c4e462e5147d07cf1424492bb39e7bf94 (patch) | |
tree | 2faa4e220f1f8102f815c99eb573073484cc68d0 /drivers/serial/Kconfig | |
parent | 31a790bee939e227dfc7e6a6a323b2b13180707f (diff) | |
download | u-boot-62cbde4c4e462e5147d07cf1424492bb39e7bf94.tar.xz |
serial: ns16550: Support run-time configuration
At present this driver uses an assortment of CONFIG options to control
how it accesses the hardware. This is painful for platforms that are
supposed to be controlled by a device tree or a previous-stage bootloader.
Add a new CONFIG option to enable fully dynamic configuration. This
controls register spacing, size, offset and endianness.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Aiden Park <aiden.park@intel.com>
Tested-by: Aiden Park <aiden.park@intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: squashed in http://patchwork.ozlabs.org/patch/1232929/]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/serial/Kconfig')
-rw-r--r-- | drivers/serial/Kconfig | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index bd95f70b61..1147654082 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -601,6 +601,27 @@ config SYS_NS16550 be used. It can be a constant or a function to get clock, eg, get_serial_clock(). +config NS16550_DYNAMIC + bool "Allow NS16550 to be configured at runtime" + default y if SYS_COREBOOT || SYS_SLIMBOOTLOADER + help + Enable this option to allow device-tree control of the driver. + + Normally this driver is controlled by the following options: + + CONFIG_SYS_NS16550_PORT_MAPPED - indicates that port I/O is used for + access. If not enabled, then the UART is memory-mapped. + CONFIG_SYS_NS16550_MEM32 - if memory-mapped, indicates that 32-bit + access should be used (instead of 8-bit) + CONFIG_SYS_NS16550_REG_SIZE - indicates register width and also + endianness. If positive, big-endian access is used. If negative, + little-endian is used. + + It is not a good practice for a driver to be statically configured, + since it prevents the same driver being used for different types of + UARTs in a system. This option avoids this problem at the cost of a + slightly increased code size. + config INTEL_MID_SERIAL bool "Intel MID platform UART support" depends on DM_SERIAL && OF_CONTROL |