Lines Matching +full:- +full:uart

1 // SPDX-License-Identifier: GPL-2.0
3 * Driver for FPGA UART
45 return -EINVAL; in dfh_get_u64_param_val()
52 static int dfl_uart_get_params(struct dfl_device *dfl_dev, struct uart_8250_port *uart) in dfl_uart_get_params() argument
54 struct device *dev = &dfl_dev->dev; in dfl_uart_get_params()
63 uart->port.uartclk = clk_freq; in dfl_uart_get_params()
71 uart->port.type = PORT_ALTR_16550_F32; in dfl_uart_get_params()
75 uart->port.type = PORT_ALTR_16550_F64; in dfl_uart_get_params()
79 uart->port.type = PORT_ALTR_16550_F128; in dfl_uart_get_params()
83 return dev_err_probe(dev, -EINVAL, "unsupported FIFO_LEN %llu\n", fifo_len); in dfl_uart_get_params()
90 uart->port.regshift = FIELD_GET(DFHv1_PARAM_REG_LAYOUT_SHIFT, reg_layout); in dfl_uart_get_params()
94 uart->port.iotype = UPIO_MEM32; in dfl_uart_get_params()
98 uart->port.iotype = UPIO_MEM16; in dfl_uart_get_params()
102 return dev_err_probe(dev, -EINVAL, "unsupported reg-width %u\n", reg_width); in dfl_uart_get_params()
111 struct device *dev = &dfl_dev->dev; in dfl_uart_probe()
112 struct uart_8250_port uart = { }; in dfl_uart_probe() local
116 uart.port.flags = UPF_IOREMAP; in dfl_uart_probe()
117 uart.port.mapbase = dfl_dev->mmio_res.start; in dfl_uart_probe()
118 uart.port.mapsize = resource_size(&dfl_dev->mmio_res); in dfl_uart_probe()
120 ret = dfl_uart_get_params(dfl_dev, &uart); in dfl_uart_probe()
122 return dev_err_probe(dev, ret, "failed uart feature walk\n"); in dfl_uart_probe()
124 if (dfl_dev->num_irqs == 1) in dfl_uart_probe()
125 uart.port.irq = dfl_dev->irqs[0]; in dfl_uart_probe()
129 return -ENOMEM; in dfl_uart_probe()
131 dfluart->line = serial8250_register_8250_port(&uart); in dfl_uart_probe()
132 if (dfluart->line < 0) in dfl_uart_probe()
133 return dev_err_probe(dev, dfluart->line, "unable to register 8250 port.\n"); in dfl_uart_probe()
142 struct dfl_uart *dfluart = dev_get_drvdata(&dfl_dev->dev); in dfl_uart_remove()
144 serial8250_unregister_port(dfluart->line); in dfl_uart_remove()
157 .name = "dfl-uart",
165 MODULE_DESCRIPTION("DFL Intel UART driver");