Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110201348
D19896.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D19896.diff
View Options
Index: sys/dev/uart/uart_bus_pci.c
===================================================================
--- sys/dev/uart/uart_bus_pci.c
+++ sys/dev/uart/uart_bus_pci.c
@@ -43,6 +43,7 @@
#include <dev/uart/uart.h>
#include <dev/uart/uart_bus.h>
+#include <dev/uart/uart_cpu.h>
#define DEFAULT_RCLK 1843200
@@ -190,10 +191,13 @@
return ((id->vendor == vendor && id->device == device) ? id : NULL);
}
+extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
+
static int
uart_pci_probe(device_t dev)
{
struct uart_softc *sc;
+ struct uart_devinfo *sysdev;
const struct pci_id *id;
int result;
@@ -208,6 +212,16 @@
return (ENXIO);
match:
+ SLIST_FOREACH(sysdev, &uart_sysdevs, next) {
+ if (sysdev->pci_info.vendor == pci_get_vendor(dev)
+ && sysdev->pci_info.device == pci_get_device(dev)
+ && sysdev->pci_info.bus == pci_get_bus(dev)
+ && sysdev->pci_info.slot == pci_get_slot(dev)) {
+ sc->sc_sysdev = sysdev;
+ sysdev->bas.rclk = sc->sc_bas.rclk;
+ }
+ }
+
result = uart_bus_probe(dev, id->regshft, 0, id->rclk, id->rid, 0, 0);
/* Bail out on error. */
if (result > 0)
Index: sys/dev/uart/uart_cpu.h
===================================================================
--- sys/dev/uart/uart_cpu.h
+++ sys/dev/uart/uart_cpu.h
@@ -52,6 +52,16 @@
extern bus_space_tag_t uart_bus_space_io;
extern bus_space_tag_t uart_bus_space_mem;
+/*
+ * PCI bus address from the ACPI SPCR table.
+ */
+struct uart_pci_info {
+ uint16_t vendor;
+ uint16_t device;
+ uint8_t bus;
+ uint8_t slot;
+};
+
/*
* Console and debug port device info.
*/
@@ -72,6 +82,7 @@
void *cookie; /* Type dependent use. */
struct mtx *hwmtx;
struct uart_softc *sc; /* valid only from start of attach */
+ struct uart_pci_info pci_info;
};
int uart_cpu_eqres(struct uart_bas *, struct uart_bas *);
Index: sys/dev/uart/uart_cpu_acpi.c
===================================================================
--- sys/dev/uart/uart_cpu_acpi.c
+++ sys/dev/uart/uart_cpu_acpi.c
@@ -147,6 +147,10 @@
(int)spcr->BaudRate);
goto out;
}
+ di->pci_info.vendor = spcr->PciVendorId;
+ di->pci_info.device = spcr->PciDeviceId;
+ di->pci_info.bus = spcr->PciBus;
+ di->pci_info.slot = spcr->PciDevice;
/* Apply device tweaks. */
if ((cd->cd_quirks & UART_F_IGNORE_SPCR_REGSHFT) ==
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 16, 12:49 AM (13 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16667180
Default Alt Text
D19896.diff (2 KB)
Attached To
Mode
D19896: Match PCI UART devices using PCI data from the ACPI SPCR table
Attached
Detach File
Event Timeline
Log In to Comment