Page MenuHomeFreeBSD

D3559.diff
No OneTemporary

D3559.diff

Index: head/sys/dev/uart/uart_cpu_fdt.c
===================================================================
--- head/sys/dev/uart/uart_cpu_fdt.c
+++ head/sys/dev/uart/uart_cpu_fdt.c
@@ -134,6 +134,7 @@
phandle_t node, chosen;
pcell_t shift, br, rclk;
u_long start, size, pbase, psize;
+ char *cp;
int err;
uart_bus_space_mem = fdtbus_bs_tag;
@@ -148,18 +149,25 @@
if (devtype != UART_DEV_CONSOLE)
return (ENXIO);
- /*
- * Retrieve /chosen/std{in,out}.
- */
- node = -1;
- if ((chosen = OF_finddevice("/chosen")) != -1) {
- for (name = propnames; *name != NULL; name++) {
- if (phandle_chosen_propdev(chosen, *name, &node) == 0)
- break;
+ /* Has the user forced a specific device node? */
+ cp = kern_getenv("hw.fdt.console");
+ if (cp == NULL) {
+ /*
+ * Retrieve /chosen/std{in,out}.
+ */
+ node = -1;
+ if ((chosen = OF_finddevice("/chosen")) != -1) {
+ for (name = propnames; *name != NULL; name++) {
+ if (phandle_chosen_propdev(chosen, *name,
+ &node) == 0)
+ break;
+ }
}
+ if (chosen == -1 || *name == NULL)
+ node = OF_finddevice("serial0"); /* Last ditch */
+ } else {
+ node = OF_finddevice(cp);
}
- if (chosen == -1 || *name == NULL)
- node = OF_finddevice("serial0"); /* Last ditch */
if (node == -1) /* Can't find anything */
return (ENXIO);

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 10:21 AM (14 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15540365
Default Alt Text
D3559.diff (1 KB)

Event Timeline