Use bus_space_map() to initialize a bus_handle.
This commit is contained in:
parent
33e38a2cc8
commit
81a11def25
@ -66,7 +66,8 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
||||
boothowto |= RB_SERIAL;
|
||||
di->ops = uart_ns8250_ops;
|
||||
di->bas.bst = busspace_isa_io;
|
||||
di->bas.bsh = 0x3f8;
|
||||
if (bus_space_map(di->bas.bst, 0x3f8, 8, 0, &di->bas.bsh) != 0)
|
||||
return (ENXIO);
|
||||
di->bas.regshft = 0;
|
||||
di->bas.rclk = 0;
|
||||
di->baudrate = 9600;
|
||||
@ -102,7 +103,8 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
||||
*/
|
||||
di->ops = uart_ns8250_ops;
|
||||
di->bas.bst = busspace_isa_io;
|
||||
di->bas.bsh = ivar;
|
||||
if (bus_space_map(di->bas.bst, ivar, 8, 0, &di->bas.bsh) != 0)
|
||||
return (ENXIO);
|
||||
di->bas.regshft = 0;
|
||||
di->bas.rclk = 0;
|
||||
if (resource_int_value("uart", i, "baud", &ivar) != 0)
|
||||
|
@ -83,7 +83,8 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
||||
*/
|
||||
di->ops = uart_ns8250_ops;
|
||||
di->bas.bst = AMD64_BUS_SPACE_IO;
|
||||
di->bas.bsh = ivar;
|
||||
if (bus_space_map(di->bas.bst, ivar, 8, 0, &di->bas.bsh) != 0)
|
||||
return (ENXIO);
|
||||
di->bas.regshft = 0;
|
||||
di->bas.rclk = 0;
|
||||
if (resource_int_value("uart", i, "baud", &ivar) != 0)
|
||||
|
@ -83,7 +83,8 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
||||
*/
|
||||
di->ops = uart_ns8250_ops;
|
||||
di->bas.bst = I386_BUS_SPACE_IO;
|
||||
di->bas.bsh = ivar;
|
||||
if (bus_space_map(di->bas.bst, ivar, 8, 0, &di->bas.bsh) != 0)
|
||||
return (ENXIO);
|
||||
di->bas.regshft = 0;
|
||||
di->bas.rclk = 0;
|
||||
if (resource_int_value("uart", i, "baud", &ivar) != 0)
|
||||
|
@ -85,9 +85,11 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
||||
di->bas.bst = IA64_BUS_SPACE_IO;
|
||||
di->bas.bst = (ent->address.addr_space == 0)
|
||||
? IA64_BUS_SPACE_MEM : IA64_BUS_SPACE_IO;
|
||||
di->bas.bsh = ent->address.addr_high;
|
||||
di->bas.bsh = (di->bas.bsh << 32) +
|
||||
ent->address.addr_low;
|
||||
if (bus_space_map(di->bas.bst,
|
||||
(ent->address.addr_high << 32) +
|
||||
ent->address.addr_low,
|
||||
8, 0, &di->bas.bsh) != 0)
|
||||
return (ENXIO);
|
||||
di->bas.regshft = 0;
|
||||
di->bas.rclk = ent->pclock << 4;
|
||||
/* We don't deal with 64-bit baud rates. */
|
||||
@ -130,7 +132,8 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
||||
*/
|
||||
di->ops = uart_ns8250_ops;
|
||||
di->bas.bst = IA64_BUS_SPACE_IO;
|
||||
di->bas.bsh = ivar;
|
||||
if (bus_space_map(di->bas.bst, ivar, 8, 0, &di->bas.bsh) != 0)
|
||||
return (ENXIO);
|
||||
di->bas.regshft = 0;
|
||||
di->bas.rclk = 0;
|
||||
if (resource_int_value("uart", i, "baud", &ivar) != 0)
|
||||
|
@ -88,7 +88,8 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
||||
else
|
||||
di->ops = uart_i8251_ops;
|
||||
di->bas.bst = I386_BUS_SPACE_IO;
|
||||
i386_bus_space_handle_alloc(di->bas.bst, ivar, 8, &di->bas.bsh);
|
||||
if (bus_space_map(di->bas.bst, ivar, 8, 0, &di->bas.bsh) != 0)
|
||||
return (ENXIO);
|
||||
di->bas.regshft = 0;
|
||||
di->bas.rclk = 0;
|
||||
if (resource_int_value("uart", i, "baud", &ivar) != 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user