View | Details | Raw Unified | Return to bug 251053
Collapse All | Expand All

(-)sys/dev/uart/uart_cpu_fdt.h (-1 / +1 lines)
Lines 51-57 Link Here
51
	DATA_SET(uart_fdt_class_set, data)
51
	DATA_SET(uart_fdt_class_set, data)
52
52
53
int uart_cpu_fdt_probe(struct uart_class **, bus_space_tag_t *,
53
int uart_cpu_fdt_probe(struct uart_class **, bus_space_tag_t *,
54
    bus_space_handle_t *, int *, u_int *, u_int *, u_int *);
54
    bus_space_handle_t *, int *, u_int *, u_int *, u_int *, const int);
55
int uart_fdt_get_clock(phandle_t node, pcell_t *cell);
55
int uart_fdt_get_clock(phandle_t node, pcell_t *cell);
56
int uart_fdt_get_shift(phandle_t node, pcell_t *cell);
56
int uart_fdt_get_shift(phandle_t node, pcell_t *cell);
57
int uart_fdt_get_io_width(phandle_t node, pcell_t *cell);
57
int uart_fdt_get_io_width(phandle_t node, pcell_t *cell);
(-)sys/dev/uart/uart_cpu_fdt.c (-2 / +4 lines)
Lines 87-96 Link Here
87
	if (!err)
87
	if (!err)
88
		return (0);
88
		return (0);
89
89
90
	if (devtype != UART_DEV_CONSOLE)
90
	if ((devtype != UART_DEV_CONSOLE) &&
91
	    (devtype != UART_DEV_DBGPORT))
91
		return (ENXIO);
92
		return (ENXIO);
92
93
93
	err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk, &shift, &iowidth);
94
	err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk,
95
	    &shift, &iowidth, devtype);
94
	if (err != 0)
96
	if (err != 0)
95
		return (err);
97
		return (err);
96
98
(-)sys/dev/uart/uart_cpu_arm64.c (-1 / +1 lines)
Lines 108-114 Link Here
108
#ifdef FDT
108
#ifdef FDT
109
	if (err != 0) {
109
	if (err != 0) {
110
		err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk,
110
		err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk,
111
		    &shift, &iowidth);
111
		    &shift, &iowidth, devtype);
112
	}
112
	}
113
#endif
113
#endif
114
	if (err != 0)
114
	if (err != 0)
(-)sys/dev/uart/uart_bus_fdt.c (-5 / +16 lines)
Lines 175-200 Link Here
175
int
175
int
176
uart_cpu_fdt_probe(struct uart_class **classp, bus_space_tag_t *bst,
176
uart_cpu_fdt_probe(struct uart_class **classp, bus_space_tag_t *bst,
177
    bus_space_handle_t *bsh, int *baud, u_int *rclk, u_int *shiftp,
177
    bus_space_handle_t *bsh, int *baud, u_int *rclk, u_int *shiftp,
178
    u_int *iowidthp)
178
    u_int *iowidthp, const int devtype)
179
{
179
{
180
	const char *propnames[] = {"stdout-path", "linux,stdout-path", "stdout",
180
	const char *propnames[] = {"stdout-path", "linux,stdout-path", "stdout",
181
	    "stdin-path", "stdin", NULL};
181
	    "stdin-path", "stdin", NULL};
182
	const char *propname_dbg[] = {"freebsd,debug-path", NULL};
182
	const char **name;
183
	const char **name;
183
	struct uart_class *class;
184
	struct uart_class *class;
184
	phandle_t node, chosen;
185
	phandle_t node, chosen;
185
	pcell_t br, clk, shift, iowidth;
186
	pcell_t br, clk, shift, iowidth;
186
	char *cp;
187
	char *cp = NULL;
187
	int err;
188
	int err;
188
189
189
	/* Has the user forced a specific device node? */
190
	/* Has the user forced a specific device node? */
190
	cp = kern_getenv("hw.fdt.console");
191
	switch (devtype) {
192
	case UART_DEV_DBGPORT:
193
		cp = kern_getenv("hw.fdt.debug");
194
		name = propname_dbg;
195
		break;
196
	default: /* UART_DEV_CONSOLE */
197
		cp = kern_getenv("hw.fdt.console");
198
		name = propnames;
199
		break;
200
	}
201
191
	if (cp == NULL) {
202
	if (cp == NULL) {
192
		/*
203
		/*
193
		 * Retrieve /chosen/std{in,out}.
204
		 * Retrieve a node from /chosen.
194
		 */
205
		 */
195
		node = -1;
206
		node = -1;
196
		if ((chosen = OF_finddevice("/chosen")) != -1) {
207
		if ((chosen = OF_finddevice("/chosen")) != -1) {
197
			for (name = propnames; *name != NULL; name++) {
208
			for (; *name != NULL; name++) {
198
				if (phandle_chosen_propdev(chosen, *name,
209
				if (phandle_chosen_propdev(chosen, *name,
199
				    &node) == 0)
210
				    &node) == 0)
200
					break;
211
					break;

Return to bug 251053