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; |