summaryrefslogtreecommitdiff
path: root/arch/x86/cpu/slimbootloader/serial.c
diff options
context:
space:
mode:
authorPark, Aiden <aiden.park@intel.com>2019-12-18 08:56:23 +0300
committerBin Meng <bmeng.cn@gmail.com>2020-02-03 20:19:26 +0300
commit18416ba1198afaae10b91552e8b0024cb84de2fa (patch)
tree2465b6b1f1ce7200a785d7c55421ddc8db165f35 /arch/x86/cpu/slimbootloader/serial.c
parentb7c1e67a70b13fb8dbcb3b00532c2d2236afff49 (diff)
downloadu-boot-18416ba1198afaae10b91552e8b0024cb84de2fa.tar.xz
x86: serial: Use NS16550_DYNAMIC in Slim Bootloader
Slim Bootloader provides serial port info in its HOB to support both IO or MMIO serial ports, but it's controlled by SYS_NS16550_MEM32 or SYS_NS16550_PORT_MAPPED in U-Boot. To support both serial port configurations dynamically at runtime, Slim Bootloader serial driver leverages NS16550_DYNAMIC. Signed-off-by: Aiden Park <aiden.park@intel.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: remove the obsolete comments for data->type] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/cpu/slimbootloader/serial.c')
-rw-r--r--arch/x86/cpu/slimbootloader/serial.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/x86/cpu/slimbootloader/serial.c b/arch/x86/cpu/slimbootloader/serial.c
index 7b44a59bff..bab54b18df 100644
--- a/arch/x86/cpu/slimbootloader/serial.c
+++ b/arch/x86/cpu/slimbootloader/serial.c
@@ -34,18 +34,15 @@ static int slimbootloader_serial_ofdata_to_platdata(struct udevice *dev)
data->stride,
data->clk);
- /*
- * The data->type provides port io or mmio access type info,
- * but the access type will be controlled by
- * CONFIG_SYS_NS16550_PORT_MAPPED or CONFIG_SYS_NS16550_MEM32.
- *
- * TBD: ns16550 access type configuration in runtime.
- * ex) plat->access_type = data->type
- */
plat->base = data->base;
/* ns16550 uses reg_shift, then covert stride to shift */
plat->reg_shift = data->stride >> 1;
+ plat->reg_width = data->stride;
plat->clock = data->clk;
+ plat->fcr = UART_FCR_DEFVAL;
+ plat->flags = 0;
+ if (data->type == 1)
+ plat->flags |= NS16550_FLAG_IO;
return 0;
}