FreeBSD Bugzilla – Attachment 219562 Details for
Bug 251053
[patch] Add support of UART_DEV_DBGPORT to uart_bus_fdt.c
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Changes to sys/dev/uart to support UART_DEV_DBGPORT in uart_bus_fdt.c
uart.diff (text/plain), 2.96 KB, created by
Dmitry Salychev
on 2020-11-11 16:34:30 UTC
(
hide
)
Description:
Changes to sys/dev/uart to support UART_DEV_DBGPORT in uart_bus_fdt.c
Filename:
MIME Type:
Creator:
Dmitry Salychev
Created:
2020-11-11 16:34:30 UTC
Size:
2.96 KB
patch
obsolete
>Index: sys/dev/uart/uart_cpu_fdt.h >=================================================================== >--- sys/dev/uart/uart_cpu_fdt.h (revision 367528) >+++ sys/dev/uart/uart_cpu_fdt.h (working copy) >@@ -51,7 +51,7 @@ > DATA_SET(uart_fdt_class_set, data) > > int uart_cpu_fdt_probe(struct uart_class **, bus_space_tag_t *, >- bus_space_handle_t *, int *, u_int *, u_int *, u_int *); >+ bus_space_handle_t *, int *, u_int *, u_int *, u_int *, const int); > int uart_fdt_get_clock(phandle_t node, pcell_t *cell); > int uart_fdt_get_shift(phandle_t node, pcell_t *cell); > int uart_fdt_get_io_width(phandle_t node, pcell_t *cell); >Index: sys/dev/uart/uart_cpu_fdt.c >=================================================================== >--- sys/dev/uart/uart_cpu_fdt.c (revision 367528) >+++ sys/dev/uart/uart_cpu_fdt.c (working copy) >@@ -87,10 +87,12 @@ > if (!err) > return (0); > >- if (devtype != UART_DEV_CONSOLE) >+ if ((devtype != UART_DEV_CONSOLE) && >+ (devtype != UART_DEV_DBGPORT)) > return (ENXIO); > >- err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk, &shift, &iowidth); >+ err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk, >+ &shift, &iowidth, devtype); > if (err != 0) > return (err); > >Index: sys/dev/uart/uart_cpu_arm64.c >=================================================================== >--- sys/dev/uart/uart_cpu_arm64.c (revision 367528) >+++ sys/dev/uart/uart_cpu_arm64.c (working copy) >@@ -108,7 +108,7 @@ > #ifdef FDT > if (err != 0) { > err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk, >- &shift, &iowidth); >+ &shift, &iowidth, devtype); > } > #endif > if (err != 0) >Index: sys/dev/uart/uart_bus_fdt.c >=================================================================== >--- sys/dev/uart/uart_bus_fdt.c (revision 367528) >+++ sys/dev/uart/uart_bus_fdt.c (working copy) >@@ -175,26 +175,37 @@ > int > uart_cpu_fdt_probe(struct uart_class **classp, bus_space_tag_t *bst, > bus_space_handle_t *bsh, int *baud, u_int *rclk, u_int *shiftp, >- u_int *iowidthp) >+ u_int *iowidthp, const int devtype) > { > const char *propnames[] = {"stdout-path", "linux,stdout-path", "stdout", > "stdin-path", "stdin", NULL}; >+ const char *propname_dbg[] = {"freebsd,debug-path", NULL}; > const char **name; > struct uart_class *class; > phandle_t node, chosen; > pcell_t br, clk, shift, iowidth; >- char *cp; >+ char *cp = NULL; > int err; > > /* Has the user forced a specific device node? */ >- cp = kern_getenv("hw.fdt.console"); >+ switch (devtype) { >+ case UART_DEV_DBGPORT: >+ cp = kern_getenv("hw.fdt.debug"); >+ name = propname_dbg; >+ break; >+ default: /* UART_DEV_CONSOLE */ >+ cp = kern_getenv("hw.fdt.console"); >+ name = propnames; >+ break; >+ } >+ > if (cp == NULL) { > /* >- * Retrieve /chosen/std{in,out}. >+ * Retrieve a node from /chosen. > */ > node = -1; > if ((chosen = OF_finddevice("/chosen")) != -1) { >- for (name = propnames; *name != NULL; name++) { >+ for (; *name != NULL; name++) { > if (phandle_chosen_propdev(chosen, *name, > &node) == 0) > break;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 251053
: 219562