mirror of
https://github.com/apache/nuttx.git
synced 2025-05-09 06:42:10 +08:00
serial/uart_pci_16550.c: fix multiport ax99100
ax99100 export each serial port as a separate PCI device function so we have to handle this properly. Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
parent
af6c33e010
commit
33a6e70077
@ -142,11 +142,13 @@ static const struct pci_u16550_type_s g_pci_u16550_qemu_x4 =
|
|||||||
.portincr = 8,
|
.portincr = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* NOTE: AX99100 export each serial port as a separate PCI function */
|
||||||
|
|
||||||
static const struct pci_u16550_type_s g_pci_u16550_ax99100_x2 =
|
static const struct pci_u16550_type_s g_pci_u16550_ax99100_x2 =
|
||||||
{
|
{
|
||||||
.ports = 2,
|
.ports = 1,
|
||||||
.regincr = 1,
|
.regincr = 1,
|
||||||
.portincr = 8,
|
.portincr = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct pci_device_id_s g_pci_u16550_id_table[] =
|
static const struct pci_device_id_s g_pci_u16550_id_table[] =
|
||||||
@ -659,6 +661,7 @@ static int pci_u16550_probe(FAR struct pci_device_s *dev)
|
|||||||
uintptr_t base = 0;
|
uintptr_t base = 0;
|
||||||
size_t i;
|
size_t i;
|
||||||
uint8_t port;
|
uint8_t port;
|
||||||
|
uint8_t ports;
|
||||||
bool mmio = false;
|
bool mmio = false;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -692,7 +695,14 @@ static int pci_u16550_probe(FAR struct pci_device_s *dev)
|
|||||||
mmio = true;
|
mmio = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (port = 0; port < type->ports; port++)
|
/* Get available ports for this device */
|
||||||
|
|
||||||
|
ports = type->ports * (PCI_FUNC(dev->devfn) + 1);
|
||||||
|
port = type->ports * PCI_FUNC(dev->devfn);
|
||||||
|
|
||||||
|
/* Register all ports for this device */
|
||||||
|
|
||||||
|
for (; port < ports; port++)
|
||||||
{
|
{
|
||||||
/* Get port address */
|
/* Get port address */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user