drivers: add UART 16550 compatible PCI device support

add support for UART 16550 compatible PCI device.
For now we support qemu serial PCI devices and AX99100 based cards.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
p-szafonimateusz
2024-09-15 03:37:58 +08:00
committed by Xiang Xiao
parent ceb2921d79
commit 8ab0785d71
6 changed files with 1204 additions and 0 deletions
+6
View File
@@ -63,4 +63,10 @@ if(CONFIG_UART_BTH4)
list(APPEND SRCS uart_bth4.c)
endif()
# UART PCI drivers
if(CONFIG_16550_PCI_UART)
list(APPEND SRCS uart_pci_16550.c)
endif()
target_sources(drivers PRIVATE ${SRCS})
+4
View File
@@ -79,6 +79,10 @@ if 16550_UART
source "drivers/serial/Kconfig-16550"
endif
if PCI
source "drivers/serial/Kconfig-pci"
endif
#
# MCU serial peripheral driver?
#
File diff suppressed because it is too large Load Diff
+6
View File
@@ -75,6 +75,12 @@ ifeq ($(CONFIG_RAM_UART),y)
CSRCS += uart_ram.c
endif
# UART PCI drivers
ifeq ($(CONFIG_16550_PCI_UART),y)
CSRCS += uart_pci_16550.c
endif
# Include serial build support
DEPPATH += --dep-path serial
File diff suppressed because it is too large Load Diff
+51
View File
@@ -0,0 +1,51 @@
/****************************************************************************
* include/nuttx/serial/uart_pci_16550.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_SERIAL_UART_PCI_16550_H
#define __INCLUDE_NUTTX_SERIAL_UART_PCI_16550_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
#ifdef CONFIG_16550_PCI_UART
int pci_u16550_init(void);
#endif
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __INCLUDE_NUTTX_SERIAL_UART_PCI_16550_H */