15 #include <soc/pci_devs.h>
16 #include <soc/iomap.h>
20 #define UART_PCI_ENABLE (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER)
35 CONFIG_SOC_INTEL_COMMON_LPSS_UART_CLK_N_VAL);
38 #if CONFIG(INTEL_LPSS_UART_FOR_CONSOLE)
41 if (idx == CONFIG_UART_FOR_CONSOLE)
42 return CONFIG_CONSOLE_UART_BASE_ADDRESS;
56 if (!
CONFIG(INTEL_LPSS_UART_FOR_CONSOLE))
99 const uint32_t baseaddr = CONFIG_CONSOLE_UART_BASE_ADDRESS;
121 if (
CONFIG(INTEL_LPSS_UART_FOR_CONSOLE) &&
125 res->
base = CONFIG_CONSOLE_UART_BASE_ADDRESS;
144 static bool pch_uart_init_debug_controller_on_resume(
void)
168 static bool uart_controller_needs_init(
struct device *dev)
174 if (
CONFIG(CONSOLE_SERIAL))
188 return pch_uart_init_debug_controller_on_resume();
191 static void uart_common_enable_resources(
struct device *dev)
195 if (uart_controller_needs_init(dev)) {
204 static void uart_acpi_write_irq(
const struct device *dev)
206 if (
CONFIG(SOC_INTEL_COMMON_BLOCK_IRQ)) {
220 static void uart_fill_ssdt(
const struct device *dev)
247 if (
strcmp(hid,
"INT34B8") == 0)
249 else if (
strcmp(hid,
"INT34B9") == 0)
251 else if (
strcmp(hid,
"INT34BA") == 0)
262 uart_acpi_write_irq(dev);
271 static const char *uart_acpi_hid(
const struct device *dev)
339 .enable_resources = uart_common_enable_resources,
341 .acpi_fill_ssdt = uart_fill_ssdt,
342 .acpi_hid = uart_acpi_hid,
416 static const struct pci_driver pch_uart
__pci_driver = {
void acpi_device_write_uid(const struct device *dev)
void acpi_device_write_interrupt(const struct acpi_irq *irq)
const char * acpi_device_hid(const struct device *dev)
int acpi_device_status(const struct device *dev)
const char * acpi_device_name(const struct device *dev)
const char * acpi_device_scope(const struct device *dev)
void * acpi_get_gnvs(void)
#define ACPI_IRQ_LEVEL_LOW(x)
void acpigen_pop_len(void)
void acpigen_write_scope(const char *name)
void acpigen_write_resourcetemplate_footer(void)
void acpigen_write_STA(uint8_t status)
void acpigen_write_resourcetemplate_header(void)
void acpigen_write_mem32fixed(int readwrite, u32 base, u32 size)
void acpigen_write_device(const char *name)
void acpigen_write_name(const char *name)
void acpigen_write_name_string(const char *name, const char *string)
static int acpi_is_wakeup_s3(void)
static const unsigned short pci_device_ids[]
int get_pci_devfn_irq(unsigned int devfn)
DEVTREE_CONST struct device * pcidev_path_on_root(pci_devfn_t devfn)
struct resource * probe_resource(const struct device *dev, unsigned int index)
See if a resource structure already exists for a given index.
struct resource * find_resource(const struct device *dev, unsigned int index)
Return an existing resource structure for a given index.
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
struct device_operations device_ops
void lpss_set_power_state(pci_devfn_t devfn, enum lpss_pwr_state state)
void lpss_reset_release(uintptr_t base)
bool lpss_is_controller_in_reset(uintptr_t base)
void lpss_clk_update(uintptr_t base, uint32_t clk_m_val, uint32_t clk_n_val)
uintptr_t uart_platform_base(unsigned int idx)
#define PCI_DEV2DEVFN(sdev)
#define PCI_BASE_ADDRESS_0
void pci_dev_enable_resources(struct device *dev)
void pci_dev_read_resources(struct device *dev)
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
void pci_dev_set_resources(struct device *dev)
#define PCI_DID_INTEL_GLK_UART0
#define PCI_DID_INTEL_TGP_UART0
#define PCI_DID_INTEL_ADP_P_UART4
#define PCI_DID_INTEL_ICP_UART1
#define PCI_DID_INTEL_MCC_UART1
#define PCI_DID_INTEL_SPT_H_UART0
#define PCI_DID_INTEL_ADP_M_N_UART2
#define PCI_DID_INTEL_APL_UART2
#define PCI_DID_INTEL_ADP_M_N_UART3
#define PCI_DID_INTEL_ADP_P_UART3
#define PCI_DID_INTEL_ADP_P_UART6
#define PCI_DID_INTEL_ADP_S_UART4
#define PCI_DID_INTEL_JSP_UART1
#define PCI_DID_INTEL_CMP_H_UART0
#define PCI_DID_INTEL_SPT_H_UART1
#define PCI_DID_INTEL_TGP_H_UART3
#define PCI_DID_INTEL_TGP_H_UART2
#define PCI_DID_INTEL_APL_UART1
#define PCI_DID_INTEL_JSP_UART0
#define PCI_DID_INTEL_ADP_P_UART1
#define PCI_DID_INTEL_CNL_UART1
#define PCI_DID_INTEL_TGP_UART2
#define PCI_DID_INTEL_UPT_H_UART0
#define PCI_DID_INTEL_ICP_UART2
#define PCI_DID_INTEL_CMP_UART1
#define PCI_DID_INTEL_UPT_H_UART1
#define PCI_DID_INTEL_ADP_P_UART5
#define PCI_DID_INTEL_ADP_S_UART2
#define PCI_DID_INTEL_ADP_S_UART0
#define PCI_DID_INTEL_GLK_UART2
#define PCI_DID_INTEL_MTL_UART1
#define PCI_DID_INTEL_ADP_M_N_UART0
#define PCI_DID_INTEL_SPT_UART1
#define PCI_DID_INTEL_APL_UART3
#define PCI_DID_INTEL_SPT_UART0
#define PCI_DID_INTEL_CMP_H_UART2
#define PCI_DID_INTEL_CMP_H_UART1
#define PCI_DID_INTEL_CNP_H_UART1
#define PCI_DID_INTEL_ADP_S_UART3
#define PCI_DID_INTEL_SPT_H_UART2
#define PCI_DID_INTEL_TGP_UART1
#define PCI_DID_INTEL_SPT_UART2
#define PCI_DID_INTEL_CNP_H_UART0
#define PCI_DID_INTEL_TGP_H_UART0
#define PCI_DID_INTEL_GLK_UART1
#define PCI_DID_INTEL_ADP_M_N_UART1
#define PCI_DID_INTEL_MCC_UART2
#define PCI_DID_INTEL_GLK_UART3
#define PCI_DID_INTEL_UPT_H_UART2
#define PCI_DID_INTEL_JSP_UART2
#define PCI_DID_INTEL_MTL_UART2
#define PCI_DID_INTEL_ADP_P_UART2
#define PCI_DID_INTEL_ADP_S_UART5
#define PCI_DID_INTEL_MTL_UART0
#define PCI_DID_INTEL_MCC_UART0
#define PCI_DID_INTEL_CNP_H_UART2
#define PCI_DID_INTEL_CNL_UART0
#define PCI_DID_INTEL_ADP_S_UART6
#define PCI_DID_INTEL_CNL_UART2
#define PCI_DID_INTEL_ICP_UART0
#define PCI_DID_INTEL_TGP_H_UART1
#define PCI_DID_INTEL_ADP_P_UART0
#define PCI_DID_INTEL_ADP_S_UART1
#define PCI_DID_INTEL_CMP_UART2
#define PCI_DID_INTEL_CMP_UART0
#define PCI_DID_INTEL_APL_UART0
static __always_inline uint32_t pci_s_read_config32(pci_devfn_t dev, uint16_t reg)
static __always_inline uint16_t pci_s_read_config16(pci_devfn_t dev, uint16_t reg)
static __always_inline void pci_s_write_config16(pci_devfn_t dev, uint16_t reg, uint16_t value)
static __always_inline void pci_s_write_config32(pci_devfn_t dev, uint16_t reg, uint32_t value)
#define PCI_DEV(SEGBUS, DEV, FN)
#define PCI_DEVFN_INVALID
#define IORESOURCE_RESERVE
#define IORESOURCE_ASSIGNED
static void uart_enable(struct device *dev)
static void uart_read_resources(struct device *dev)
static const char * uart_acpi_name(const struct device *dev)
static const struct pci_driver soc_cavium_uart __pci_driver
const int uart_devices_size
const unsigned int uart_devices[]
bool uart_is_debug_controller(struct device *dev)
static void uart_lpss_init(pci_devfn_t dev, uintptr_t baseaddr)
const struct device * uart_get_device(void)
bool uart_is_controller_initialized(void)
void uart_bootblock_init(void)
static pci_devfn_t uart_console_get_pci_bdf(void)
int strcmp(const char *s1, const char *s2)
void(* read_resources)(struct device *dev)
struct device_operations * ops
DEVTREE_CONST void * chip_info