Debian Codegraph @

src/soc/intel/snowridge/common/uart8250mem.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <console/uart.h>
4 #include <device/pci_def.h>
5 #include <device/pci_ops.h>
6 #include <soc/pci_devs.h>
7
8 #include "uart8250mem.h"
9
10 uintptr_t uart_platform_base(unsigned int idx)
11 {
12 uint32_t reg32 = pci_read_config32(PCH_DEV_UART(idx), UART_MEMBA);
13
14 reg32 &= ~PCI_BASE_ADDRESS_MEM_ATTR_MASK;
15
16 return reg32;
17 }
18
19 unsigned int uart_platform_refclk(void)
20 {
21 unsigned int ret = 115200 * 16;
22
23 /**
24 * Base uart clock is HIGH_SPEED_CLK_MULT (24) * 1.8432Mhz if using baudrates > 115200.
25 */
26 if (CONFIG_TTYS0_BAUD > 115200)
27 ret *= HIGH_SPEED_CLK_MULT;
28
29 return ret;
30 }