Samsung/serial: move the decision about an improved UART into Kconfig
More or less just cosmetic (removing ifdefs!). Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
4b2dfa8188
commit
c5066ad4cd
|
@ -45,5 +45,3 @@
|
|||
#define S3C_UART2_SIZE 0x400
|
||||
#define S3C_UART3_BASE (S3C_UART_BASE + 0x800)
|
||||
#define S3C_UART3_SIZE 0x400
|
||||
#define S3C_UART_HAS_UBRDIVSLOT
|
||||
#define S3C_UART_HAS_UINTM
|
||||
|
|
|
@ -78,9 +78,13 @@ config DRIVER_SERIAL_PL010
|
|||
help
|
||||
Enable this to get support for AMBA PL010 based serial devices
|
||||
|
||||
config DRIVER_SERIAL_S3C_IMPROVED
|
||||
bool
|
||||
|
||||
config DRIVER_SERIAL_S3C
|
||||
bool "Samsung S3C serial driver"
|
||||
depends on ARCH_SAMSUNG
|
||||
select DRIVER_SERIAL_S3C_IMPROVED if (CPU_S5PC110 || CPU_S5PV210)
|
||||
default y
|
||||
help
|
||||
Say Y here if you want to use the CONS on a Samsung S3C CPU
|
||||
|
|
|
@ -79,10 +79,11 @@ static int s3c_serial_setbaudrate(struct console_device *cdev, int baudrate)
|
|||
void __iomem *base = priv->regs;
|
||||
unsigned val;
|
||||
|
||||
#ifdef S3C_UART_HAS_UBRDIVSLOT
|
||||
val = s3c_get_arch_uart_input_clock(base) / baudrate;
|
||||
writew(udivslot_table[val & 15], base + UBRDIVSLOT);
|
||||
#endif
|
||||
if (IS_ENABLED(CONFIG_DRIVER_SERIAL_S3C_IMPROVED)) {
|
||||
val = s3c_get_arch_uart_input_clock(base) / baudrate;
|
||||
writew(udivslot_table[val & 15], base + UBRDIVSLOT);
|
||||
}
|
||||
|
||||
val = s3c_get_arch_uart_input_clock(base) / (16 * baudrate) - 1;
|
||||
writew(val, base + UBRDIV);
|
||||
|
||||
|
@ -106,10 +107,9 @@ static int s3c_serial_init_port(struct console_device *cdev)
|
|||
writew(0x0245 | UCON_SET_CLK_SRC(S3C_UART_CLKSEL),
|
||||
base + UCON);
|
||||
|
||||
#ifdef S3C_UART_HAS_UINTM
|
||||
/* 'interrupt or polling mode' for both directions */
|
||||
writeb(0xf, base + UINTM);
|
||||
#endif
|
||||
if (IS_ENABLED(CONFIG_DRIVER_SERIAL_S3C_IMPROVED))
|
||||
/* 'interrupt or polling mode' for both directions */
|
||||
writeb(0xf, base + UINTM);
|
||||
|
||||
if (IS_ENABLED(CONFIG_DRIVER_SERIAL_S3C_AUTOSYNC))
|
||||
writeb(0x10, base + UMCON); /* enable auto flow control */
|
||||
|
|
Loading…
Reference in New Issue