coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
uart_debug.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <stdint.h>
4 #include <console/uart.h>
5 #include <device/pci_def.h>
6 #include <device/pci_ops.h>
7 #include <soc/uart.h>
8 
9 #define MY_PCI_DEV(SEGBUS, DEV, FN) \
10  ((((SEGBUS)&0xFFF) << 20) | (((DEV)&0x1F) << 15) | (((FN)&0x07) << 12))
11 
12 uintptr_t uart_platform_base(unsigned int idx)
13 {
15  MY_PCI_DEV(0, CONFIG_HSUART_DEV, idx),
17  SIZE_OF_HSUART_RES * idx;
18 }
#define PCI_BASE_ADDRESS_1
Definition: pci_def.h:64
static __always_inline uint32_t pci_io_read_config32(pci_devfn_t dev, uint16_t reg)
Definition: pci_io_cfg.h:41
#define SIZE_OF_HSUART_RES
Definition: uart.h:6
unsigned long uintptr_t
Definition: stdint.h:21
uintptr_t uart_platform_base(unsigned int idx)
Definition: uart_debug.c:12
#define MY_PCI_DEV(SEGBUS, DEV, FN)
Definition: uart_debug.c:9