/device/qemu/drivers/uart/ |
H A D | uart.c | 33 struct UartDriverData *udd = NULL; in Hi35xxRead() local 39 udd = (struct UartDriverData *)host->priv; in Hi35xxRead() 40 if (udd->state != UART_STATE_USEABLE) { in Hi35xxRead() 43 if ((udd->flags & UART_FLG_RD_BLOCK) && (PL011UartRxBufEmpty(udd))) { in Hi35xxRead() 44 (void)LOS_EventRead(&udd->wait.stEvent, 0x1, LOS_WAITMODE_OR, LOS_WAIT_FOREVER); in Hi35xxRead() 46 ret = Pl011Read(udd, (char *)data, size); in Hi35xxRead() 47 if ((udd->flags & UART_FLG_RD_BLOCK) && (PL011UartRxBufEmpty(udd))) { in Hi35xxRead() 48 (void)LOS_EventClear(&udd in Hi35xxRead() 56 struct UartDriverData *udd = NULL; Hi35xxWrite() local 77 struct UartDriverData *udd = NULL; Hi35xxGetBaud() local 94 struct UartDriverData *udd = NULL; Hi35xxSetBaud() local 124 struct UartDriverData *udd = NULL; Hi35xxGetAttribute() local 146 struct UartDriverData *udd = NULL; Hi35xxSetAttribute() local 176 struct UartDriverData *udd = NULL; Hi35xxSetTransMode() local 198 struct UartDriverData *udd = NULL; Hi35xxInit() local 241 struct UartDriverData *udd = NULL; Hi35xxDeinit() local 277 struct UartDriverData *udd = NULL; Hi35xxPollEvent() local 312 struct UartDriverData *udd = port->udd; UartGetConfigFromHcs() local 359 struct UartDriverData *udd = NULL; Hi35xxAttach() local 396 struct UartDriverData *udd = NULL; Hi35xxDetach() local [all...] |
H A D | uart_pl011.c | 38 struct UartDriverData *udd = (struct UartDriverData *)data; in Pl011Irq() local 41 if (udd == NULL || udd->private == NULL) { in Pl011Irq() 45 port = (struct UartPl011Port *)udd->private; in Pl011Irq() 54 if (udd->num != CONSOLE_UART) { in Pl011Irq() 61 udd->recv(udd, buf, count); in Pl011Irq() 69 static void Pl011ConfigBaudrate(const struct UartDriverData *udd, const struct UartPl011Port *port) in Pl011ConfigBaudrate() argument 77 tmp = (uint64_t)IBRD_COEFFICIENTS * (uint64_t)udd->baudrate; in Pl011ConfigBaudrate() 79 HDF_LOGE("%s: err, baudrate %u is invalid", __func__, udd in Pl011ConfigBaudrate() 92 Pl011ConfigDataBits(const struct UartDriverData *udd, uint32_t *lcrh) Pl011ConfigDataBits() argument 112 Pl011ConfigParity(const struct UartDriverData *udd, uint32_t *lcrh) Pl011ConfigParity() argument 145 Pl011ConfigStopBits(const struct UartDriverData *udd, uint32_t *lcrh) Pl011ConfigStopBits() argument 158 Pl011ConfigLCRH(const struct UartDriverData *udd, const struct UartPl011Port *port, uint32_t lcrh) Pl011ConfigLCRH() argument 172 Pl011ConfigIn(struct UartDriverData *udd) Pl011ConfigIn() argument 218 Pl011StartUp(struct UartDriverData *udd) Pl011StartUp() argument 263 Pl011ShutDown(struct UartDriverData *udd) Pl011ShutDown() argument 303 Pl011StartTx(struct UartDriverData *udd, const char *buf, size_t count) Pl011StartTx() argument 321 Pl011Config(struct UartDriverData *udd) Pl011Config() argument 355 Pl011Read(struct UartDriverData *udd, char *buf, size_t count) Pl011Read() argument 410 PL011UartRecvNotify(struct UartDriverData *udd, const char *buf, size_t count) PL011UartRecvNotify() argument 456 PL011UartRxBufEmpty(struct UartDriverData *udd) PL011UartRxBufEmpty() argument [all...] |
H A D | uart_pl011.h | 112 int32_t (*StartUp)(struct UartDriverData *udd); 113 int32_t (*ShutDown)(struct UartDriverData *udd); 114 int32_t (*DmaStartUp)(struct UartDriverData *udd, int32_t dir); 115 int32_t (*DmaShutDown)(struct UartDriverData *udd, int32_t dir); 118 int32_t (*StartTx)(struct UartDriverData *udd, const char *buf, size_t count); 119 int32_t (*Config)(struct UartDriverData *udd); 121 int32_t (*PrivOperator)(struct UartDriverData *udd, void *data); 134 typedef int32_t (*RecvNotify)(struct UartDriverData *udd, const char *buf, size_t count); 183 struct UartDriverData *udd; member 187 int32_t Pl011Read(struct UartDriverData *udd, cha [all...] |
/device/soc/hisilicon/hi3861v100/sdk_liteos/platform/drivers/uart/ |
H A D | uart_drv.c | 39 hi_u32 uart_init_circ_buf(uart_driver_data_t *udd, unsigned int rx_buf_size, unsigned int tx_buf_size) in uart_init_circ_buf() argument 45 udd->rx_transfer = (uart_circ_buf *) hi_malloc(HI_MOD_ID_UART, sizeof(uart_circ_buf)); in uart_init_circ_buf() 46 if (udd->rx_transfer == NULL) { in uart_init_circ_buf() 50 memset_s((hi_void *) udd->rx_transfer, sizeof(uart_circ_buf), 0, sizeof(uart_circ_buf)); in uart_init_circ_buf() 51 udd->rx_transfer->data = (char *) hi_malloc(HI_MOD_ID_UART, rx_buf_size); in uart_init_circ_buf() 52 if (udd->rx_transfer->data == NULL) { in uart_init_circ_buf() 56 udd->rx_transfer->size = rx_buf_size; in uart_init_circ_buf() 57 udd->tx_transfer = (uart_circ_buf *) hi_malloc(HI_MOD_ID_UART, sizeof(uart_circ_buf)); in uart_init_circ_buf() 58 if (udd->tx_transfer == NULL) { in uart_init_circ_buf() 62 memset_s((hi_void *) udd in uart_init_circ_buf() 85 uart_deinit_circ_buf(uart_driver_data_t *udd) uart_deinit_circ_buf() argument 217 uart_tx_interrupt_disable(uart_driver_data_t *udd) uart_tx_interrupt_disable() argument 224 uart_tx_interrupt_enable(const uart_driver_data_t *udd) uart_tx_interrupt_enable() argument 230 uart_tx_interrupt_clear(const uart_driver_data_t *udd) uart_tx_interrupt_clear() argument 236 uart_rx_interrupt_disable(const uart_driver_data_t *udd) uart_rx_interrupt_disable() argument 242 uart_rx_interrupt_enable(const uart_driver_data_t *udd) uart_rx_interrupt_enable() argument 267 uart_get_tx_fifo_available_cnt(const uart_driver_data_t *udd) uart_get_tx_fifo_available_cnt() argument 294 uart_get_rx_fifo_cnt(const uart_driver_data_t *udd) uart_get_rx_fifo_cnt() argument 353 uart_dma_para_cfg(const uart_driver_data_t *udd, hi_dma_para *dma_para, const hi_char *buf) uart_dma_para_cfg() argument 379 uart_dma_recv_irq(uart_driver_data_t *udd, hi_u32 status, hi_char *buf) uart_dma_recv_irq() argument 432 uart_nodma_recv_irq(uart_driver_data_t *udd, hi_u32 status, hi_char *buf) uart_nodma_recv_irq() argument 480 uart_send_irq(uart_driver_data_t *udd, hi_char *buf) uart_send_irq() argument 508 uart_driver_data_t *udd = (uart_driver_data_t *) data; uart_drv_irq() local 539 uart_buf_empty(const uart_driver_data_t *udd) uart_buf_empty() argument 548 uart_drv_set_attr(uart_driver_data_t *udd) uart_drv_set_attr() argument 574 uart_drv_startup(uart_driver_data_t *udd) uart_drv_startup() argument 596 uart_drv_shutdown(struct uart_driver_data *udd) uart_drv_shutdown() argument 607 uart_drv_dma_start_tx_cfg(struct uart_driver_data *udd, const hi_char *buf, hi_u32 count) uart_drv_dma_start_tx_cfg() argument 653 uart_drv_dma_start_tx(struct uart_driver_data *udd, const hi_char *buf, hi_u32 count) uart_drv_dma_start_tx() argument 689 uart_drv_irq_start_tx(struct uart_driver_data *udd, const hi_char *buf, hi_u32 count) uart_drv_irq_start_tx() argument 722 uart_drv_start_tx(struct uart_driver_data *udd, const hi_char *buf, hi_u32 count) global() argument 756 uart_drv_ioctl(uart_driver_data_t *udd) global() argument [all...] |
H A D | uart.c | 74 uart_driver_data_t *udd = HI_NULL; in uart_open() local 80 udd = (uart_driver_data_t *) g_udd_g[uart_index]; in uart_open() 82 if (udd->state == UART_STATE_NOT_OPENED) { in uart_open() 83 ret = uart_init_circ_buf(udd, udd->act.tx_buffer_size, udd->act.rx_buffer_size); in uart_open() 88 ret = hi_event_create(&udd->event_id); in uart_open() 90 uart_deinit_circ_buf(udd); in uart_open() 93 udd->type = mode; in uart_open() 95 if (!udd in uart_open() 115 uart_read(uart_driver_data_t *udd, hi_char *buf, hi_u32 count) uart_read() argument 151 uart_write(uart_driver_data_t *udd, const hi_char *buf, hi_u32 send_count) uart_write() argument 202 uart_write_immediately(uart_driver_data_t *udd, const hi_char *buf, hi_u32 send_count) uart_write_immediately() argument 250 uart_ioctl(uart_driver_data_t *udd, hi_u32 cmd, uintptr_t arg) uart_ioctl() argument 300 uart_close(uart_driver_data_t *udd) uart_close() argument [all...] |
H A D | hi_uart.c | 73 static hi_u32 get_uart_param(const uart_driver_data_t *udd, hi_uart_attribute *attr, hi_uart_extra_attr *extra_attr) in get_uart_param() argument 75 if (udd == HI_NULL) { in get_uart_param() 79 if (udd->state != UART_STATE_USEABLE) { in get_uart_param() 85 extra_attr->tx_fifo_line = (hi_uart_fifo_line)(udd->attr.tx_fifo_line + 1); in get_uart_param() 86 extra_attr->rx_fifo_line = (hi_uart_fifo_line)(udd->attr.rx_fifo_line + 1); in get_uart_param() 87 extra_attr->flow_fifo_line = (hi_uart_fifo_line)(udd->attr.flow_fifo_line + 1); in get_uart_param() 89 extra_attr->tx_block = (hi_uart_block_state)udd->act.tx_block; in get_uart_param() 90 extra_attr->rx_block = (hi_uart_block_state)udd->act.rx_block; in get_uart_param() 91 extra_attr->tx_buf_size = udd->act.tx_buffer_size; in get_uart_param() 92 extra_attr->rx_buf_size = udd in get_uart_param() 109 uart_driver_data_t *udd = HI_NULL; hi_uart_is_busy() local 127 uart_driver_data_t *udd = HI_NULL; hi_uart_is_buf_empty() local 165 uart_driver_data_t *udd = HI_NULL; init_uart_extra_param() local 216 uart_attribute_ioctl(uart_driver_data_t *udd, const hi_uart_attribute *attr) uart_attribute_ioctl() argument 234 uart_driver_data_t *udd = HI_NULL; hi_uart_init() local 281 uart_driver_data_t *udd = HI_NULL; hi_uart_set_flow_ctrl() local 350 uart_driver_data_t *udd = HI_NULL; hi_uart_write() local 367 uart_driver_data_t *udd = HI_NULL; hi_uart_write_immediately() local 430 uart_driver_data_t *udd = (uart_driver_data_t *) g_udd_g[id]; hi_uart_quit_read() local 448 uart_driver_data_t *udd = HI_NULL; hi_uart_lp_save() local [all...] |
H A D | uart_drv.h | 114 hi_u32(*startup) (uart_driver_data_t *udd); 115 hi_void(*shutdown) (uart_driver_data_t *udd); 116 hi_s32(*start_tx) (uart_driver_data_t *udd, const hi_char *buf, hi_u32 count); 117 hi_u32(*ioctl) (uart_driver_data_t *udd); 124 #define uart_set_errno(err) ((udd->uart_stat_info.uart_errno) = (err)) 189 hi_void uart_tx_interrupt_enable(const uart_driver_data_t *udd); 191 hi_u32 uart_init_circ_buf(uart_driver_data_t *udd, hi_u32 rx_fifo_size, hi_u32 tx_fifo_size); 192 hi_void uart_deinit_circ_buf(uart_driver_data_t *udd); 195 hi_void uart_set_tx_mode(uart_driver_data_t *udd); 196 hi_u32 uart_buf_empty(const uart_driver_data_t *udd); [all...] |
H A D | uart.h | 57 hi_s32 uart_read(uart_driver_data_t *udd, hi_char *buf, hi_u32 count); 58 hi_s32 uart_write(uart_driver_data_t *udd, const hi_char *buf, hi_u32 count); 59 hi_s32 uart_write_immediately(uart_driver_data_t *udd, const hi_char *buf, hi_u32 count); 60 hi_u32 uart_ioctl(uart_driver_data_t *udd, hi_u32 cmd, uintptr_t arg); 61 hi_u32 uart_close(uart_driver_data_t *udd);
|
/device/soc/hisilicon/common/platform/uart/ |
H A D | uart_hi35xx.c | 76 UART_DUMPER_NAME_PREFIX, port->udd->num) < 0) { in UartDumperCreate() 104 struct UartDriverData *udd = NULL; in Hi35xxRead() local 110 udd = (struct UartDriverData *)host->priv; in Hi35xxRead() 111 if (udd->state != UART_STATE_USEABLE) { in Hi35xxRead() 114 if ((udd->flags & UART_FLG_RD_BLOCK) && (PL011UartRxBufEmpty(udd))) { in Hi35xxRead() 115 (void)LOS_EventRead(&udd->wait.stEvent, 0x1, LOS_WAITMODE_OR, LOS_WAIT_FOREVER); in Hi35xxRead() 117 ret = Pl011Read(udd, (char *)data, size); in Hi35xxRead() 118 if ((udd->flags & UART_FLG_RD_BLOCK) && (PL011UartRxBufEmpty(udd))) { in Hi35xxRead() 127 struct UartDriverData *udd = NULL; Hi35xxWrite() local 148 struct UartDriverData *udd = NULL; Hi35xxGetBaud() local 165 struct UartDriverData *udd = NULL; Hi35xxSetBaud() local 199 struct UartDriverData *udd = NULL; Hi35xxGetAttribute() local 221 struct UartDriverData *udd = NULL; Hi35xxSetAttribute() local 255 struct UartDriverData *udd = NULL; Hi35xxSetTransMode() local 277 struct UartDriverData *udd = NULL; Hi35xxInit() local 329 struct UartDriverData *udd = NULL; Hi35xxDeinit() local 366 struct UartDriverData *udd = NULL; Hi35xxPollEvent() local 401 struct UartDriverData *udd = port->udd; UartGetConfigFromHcs() local 448 struct UartDriverData *udd = NULL; Hi35xxAttach() local 493 struct UartDriverData *udd = NULL; Hi35xxDetach() local [all...] |
H A D | uart_pl011.c | 37 struct UartDriverData *udd = (struct UartDriverData *)data; in Pl011Irq() local 40 if (udd == NULL || udd->private == NULL) { in Pl011Irq() 44 port = (struct UartPl011Port *)udd->private; in Pl011Irq() 53 if (udd->num != CONSOLE_UART) { in Pl011Irq() 60 udd->recv(udd, buf, count); in Pl011Irq() 68 static void Pl011ConfigBaudrate(const struct UartDriverData *udd, const struct UartPl011Port *port) in Pl011ConfigBaudrate() argument 76 tmp = (uint64_t)IBRD_COEFFICIENTS * (uint64_t)udd->baudrate; in Pl011ConfigBaudrate() 78 HDF_LOGE("%s: err, baudrate %u is invalid", __func__, udd in Pl011ConfigBaudrate() 91 Pl011ConfigDataBits(const struct UartDriverData *udd, uint32_t *lcrh) Pl011ConfigDataBits() argument 111 Pl011ConfigParity(const struct UartDriverData *udd, uint32_t *lcrh) Pl011ConfigParity() argument 144 Pl011ConfigStopBits(const struct UartDriverData *udd, uint32_t *lcrh) Pl011ConfigStopBits() argument 157 Pl011ConfigLCRH(const struct UartDriverData *udd, const struct UartPl011Port *port, uint32_t lcrh) Pl011ConfigLCRH() argument 171 Pl011ConfigIn(struct UartDriverData *udd) Pl011ConfigIn() argument 217 Pl011StartUp(struct UartDriverData *udd) Pl011StartUp() argument 262 Pl011ShutDown(struct UartDriverData *udd) Pl011ShutDown() argument 302 Pl011StartTx(struct UartDriverData *udd, const char *buf, size_t count) Pl011StartTx() argument 320 Pl011Config(struct UartDriverData *udd) Pl011Config() argument 354 Pl011Read(struct UartDriverData *udd, char *buf, size_t count) Pl011Read() argument 409 PL011UartRecvNotify(struct UartDriverData *udd, const char *buf, size_t count) PL011UartRecvNotify() argument 455 PL011UartRxBufEmpty(struct UartDriverData *udd) PL011UartRxBufEmpty() argument [all...] |
H A D | uart_pl011.h | 112 int32_t (*StartUp)(struct UartDriverData *udd); 113 int32_t (*ShutDown)(struct UartDriverData *udd); 114 int32_t (*DmaStartUp)(struct UartDriverData *udd, int32_t dir); 115 int32_t (*DmaShutDown)(struct UartDriverData *udd, int32_t dir); 118 int32_t (*StartTx)(struct UartDriverData *udd, const char *buf, size_t count); 119 int32_t (*Config)(struct UartDriverData *udd); 121 int32_t (*PrivOperator)(struct UartDriverData *udd, void *data); 134 typedef int32_t (*RecvNotify)(struct UartDriverData *udd, const char *buf, size_t count); 183 struct UartDriverData *udd; member 189 int32_t Pl011Read(struct UartDriverData *udd, cha [all...] |