summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2007-03-28 18:26:12 +0000
committermarcel <marcel@FreeBSD.org>2007-03-28 18:26:12 +0000
commitc0fdcbb7ede752eb30ec72442cff0a7daf28e7e3 (patch)
treed5590c872bc9a2c8b5fcd8d4448e73fd6a67236d /sys/dev/uart
parente6adc1425e20c254baf90310d9023e1452c8ceec (diff)
downloadFreeBSD-src-c0fdcbb7ede752eb30ec72442cff0a7daf28e7e3.zip
FreeBSD-src-c0fdcbb7ede752eb30ec72442cff0a7daf28e7e3.tar.gz
When we match UARTs found during bus-enumeration with UARTs used for
system devices (i.e. console, debug port or keyboard), don't stop after the first match. Find them all and keep track of the last. The reason for this change is that the low-level console is always added to the list of system devices first, with other devices added later. Since new devices are added to the list at the head, we have the console always at the end. When a debug port is using the same UART as the console, we would previously mark the "newbus" UART as a debug port instead of as a console. This would later result in a panic because no "newbus" device was associated with the console. By matching all possible system devices we would mark the "newbus" UART as a console and not as a debug port. While it is arguably better to be able to mark a "newbus" UART as both console and debug port, this fix is lightweight and allows a single UART to be used as the console as well as a debug port with only the aesthetic bug of not telling the user about it also being a debug port. Now that we match all possible system devices, update the rclk of the system devices with the rclk that was obtained through the bus attachment. It is generally true that clock information is more reliable when obtained from the parent bus than by means of some hardcoded or assumed value used early in the boot. This by virtue of having more context information. MFC after: 1 month
Diffstat (limited to 'sys/dev/uart')
-rw-r--r--sys/dev/uart/uart_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c
index 07d87d0..6daf938 100644
--- a/sys/dev/uart/uart_core.c
+++ b/sys/dev/uart/uart_core.c
@@ -344,7 +344,7 @@ uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan)
uart_cpu_eqres(&sc->sc_bas, &sysdev->bas)) {
/* XXX check if ops matches class. */
sc->sc_sysdev = sysdev;
- break;
+ sysdev->bas.rclk = sc->sc_bas.rclk;
}
}
OpenPOWER on IntegriCloud