1 /* SPDX-License-Identifier: GPL-2.0-only */
7 void sio1007_setreg(u16 lpc_port
, u8 reg
, u8 value
, u8 mask
)
12 reg_value
= inb(lpc_port
+ 1);
14 reg_value
|= (value
& mask
);
15 outb(reg_value
, lpc_port
+ 1);
18 int sio1007_enable_uart_at(u16 port
)
20 /* Enable config mode. */
22 if (inb(port
) != 0x55)
23 return 0; /* There is no LPC device at this address. */
25 /* Registers 12 and 13 hold config address, look for a match. */
27 if (inb(port
+ 1) != (port
& 0xff))
31 if (inb(port
+ 1) != (port
>> 8))
34 /* This must be the sio1007, enable the UART. */
36 sio1007_setreg(port
, 0x2, 1 << 3, 1 << 3);
37 /* enable high speed */
38 sio1007_setreg(port
, 0xc, 1 << 6, 1 << 6);
39 /* set the base address */
40 sio1007_setreg(port
, 0x24, CONFIG_TTYS0_BASE
>> 2, 0xff);
42 /* Disable config mode. */