| .. | .. |
|---|
| 80 | 80 | void dw8250_setup_port(struct uart_port *p) |
|---|
| 81 | 81 | { |
|---|
| 82 | 82 | struct uart_8250_port *up = up_to_u8250p(p); |
|---|
| 83 | | - u32 reg; |
|---|
| 83 | + u32 reg, old_dlf; |
|---|
| 84 | 84 | |
|---|
| 85 | 85 | /* |
|---|
| 86 | 86 | * If the Component Version Register returns zero, we know that |
|---|
| .. | .. |
|---|
| 93 | 93 | dev_dbg(p->dev, "Designware UART version %c.%c%c\n", |
|---|
| 94 | 94 | (reg >> 24) & 0xff, (reg >> 16) & 0xff, (reg >> 8) & 0xff); |
|---|
| 95 | 95 | |
|---|
| 96 | + /* Preserve value written by firmware or bootloader */ |
|---|
| 97 | + old_dlf = dw8250_readl_ext(p, DW_UART_DLF); |
|---|
| 96 | 98 | dw8250_writel_ext(p, DW_UART_DLF, ~0U); |
|---|
| 97 | 99 | reg = dw8250_readl_ext(p, DW_UART_DLF); |
|---|
| 98 | | - dw8250_writel_ext(p, DW_UART_DLF, 0); |
|---|
| 100 | + dw8250_writel_ext(p, DW_UART_DLF, old_dlf); |
|---|
| 99 | 101 | |
|---|
| 100 | 102 | if (reg) { |
|---|
| 101 | 103 | struct dw8250_port_data *d = p->private_data; |
|---|