serial: ns16550: optimise

- set default clock rate 24000000;
- pre-loader param only applied on target serial debug;
- no special workarund when kernel dtb is enabled since
  we have solved phandle miss match issue.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic10e1f4120e7e2458773e3fcc5925ba69d062d61
This commit is contained in:
Joseph Chen 2019-12-16 11:51:58 +08:00
parent 369e944c84
commit 02c954e505
1 changed files with 3 additions and 7 deletions

View File

@ -88,7 +88,7 @@ static inline int serial_in_shift(void *addr, int shift)
#ifdef CONFIG_DM_SERIAL
#ifndef CONFIG_SYS_NS16550_CLK
#define CONFIG_SYS_NS16550_CLK 0
#define CONFIG_SYS_NS16550_CLK 24000000
#endif
static void ns16550_writeb(NS16550_t port, int offset, int value)
@ -481,7 +481,7 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
plat->base = addr;
#else
if (gd && gd->serial.using_pre_serial && !gd->cur_serial_dev)
if (gd && gd->serial.using_pre_serial && gd->serial.id == dev->req_seq)
addr = gd->serial.addr;
plat->base = (unsigned long)map_physmem(addr, 0, MAP_NOCACHE);
@ -496,11 +496,7 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
if (!IS_ERR_VALUE(err))
plat->clock = err;
} else if (err != -ENOENT && err != -ENODEV && err != -ENOSYS) {
debug("ns16550 failed to get clock\n");
#ifdef CONFIG_USING_KERNEL_DTB
/* With kernel dtb support, serial ofnode not able to get cru phandle */
if(err != -EINVAL)
#endif
printf("ns16550 failed to get clock, err=%d\n", err);
return err;
}