void serial_setbrg(void) { #ifdef CONFIG_ALLWINNER _serial_setbrg(gd->uart_console+1); #else _serial_setbrg(CONFIG_CONS_INDEX); #endif }
/* Initialise the serial port. The settings are always 8 data bits, no parity, * 1 stop bit, no start bits. */ static int serial_init_dev(const int dev_index) { struct s3c24x0_uart *uart = s3c24x0_get_base_uart(dev_index); #ifdef CONFIG_HWFLOW hwflow = 0; /* turned off by default */ #endif /* FIFO enable, Tx/Rx FIFO clear */ writel(0x07, &uart->UFCON); writel(0x0, &uart->UMCON); /* Normal,No parity,1 stop,8 bit */ writel(0x3, &uart->ULCON); /* * tx=level,rx=edge,disable timeout int.,enable rx error int., * normal,interrupt or polling */ writel(0x245, &uart->UCON); #ifdef CONFIG_HWFLOW writel(0x1, &uart->UMCON); /* RTS up */ #endif /* FIXME: This is sooooooooooooooooooo ugly */ #if defined(CONFIG_ARCH_GTA02_v1) || defined(CONFIG_ARCH_GTA02_v2) /* we need auto hw flow control on the gsm and gps port */ if (dev_index == 0 || dev_index == 1) writel(0x10, &uart->UMCON); #endif _serial_setbrg(dev_index); return (0); }
/* Initialise the serial port. The settings are always 8 data bits, no parity, * 1 stop bit, no start bits. */ static int serial_init_dev(const int dev_index) { S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index); /* FIFO enable, Tx/Rx FIFO clear */ uart->UFCON = 0x07; uart->UMCON = 0x0; /* Normal,No parity,1 stop,8 bit */ uart->ULCON = 0x3; /* * tx=level,rx=edge,disable timeout int.,enable rx error int., * normal,interrupt or polling */ uart->UCON = 0x245; #ifdef CONFIG_HWFLOW uart->UMCON = 0x1; /* RTS up */ #endif /* FIXME: This is sooooooooooooooooooo ugly */ #if defined(CONFIG_ARCH_GTA02_v1) || defined(CONFIG_ARCH_GTA02_v2) /* we need auto hw flow control on the gsm and gps port */ if (dev_index == 0 || dev_index == 1) uart->UMCON = 0x10; #endif _serial_setbrg(dev_index); return (0); }
void serial_setbrg(void) { _serial_setbrg(UART_NR); }
static inline void serial_setbrg_dev(unsigned int dev_index) { _serial_setbrg(dev_index); }
extern void serial_setbrg(void) { _serial_setbrg(CONFIG_CONS_INDEX); }