Index: arch/sparc64/dev/com_ebus.c =================================================================== RCS file: /cvsroot/src/sys/arch/sparc64/dev/com_ebus.c,v retrieving revision 1.31 diff -p -r1.31 com_ebus.c *** arch/sparc64/dev/com_ebus.c 15 Mar 2011 11:22:18 -0000 1.31 --- arch/sparc64/dev/com_ebus.c 24 May 2011 10:08:53 -0000 *************** com_ebus_match(device_t parent, cfdata_t *** 84,90 **** compat = prom_getpropstring(ea->ea_node, "compatible"); if (strcmp(compat, "su16550") == 0 || strcmp(compat, "su16552") == 0 || ! strcmp(compat, "su") == 0) { return (1); } } --- 84,91 ---- compat = prom_getpropstring(ea->ea_node, "compatible"); if (strcmp(compat, "su16550") == 0 || strcmp(compat, "su16552") == 0 || ! strcmp(compat, "su") == 0 || ! strcmp(compat, "FJSV,su") == 0) { return (1); } } *************** com_ebus_attach(device_t parent, device_ *** 109,114 **** --- 110,117 ---- bus_space_handle_t ioh; bus_space_tag_t iot; bus_addr_t iobase; + int node, port; + char buf[32]; sc->sc_dev = self; iot = ea->ea_bustag; *************** com_ebus_attach(device_t parent, device_ *** 145,153 **** kma.kmta_consdev = NULL; ! /* Figure out if we're the console. */ ! com_is_input = (ea->ea_node == prom_instance_to_package(prom_stdin())); ! com_is_output = (ea->ea_node == prom_instance_to_package(prom_stdout())); if (com_is_input || com_is_output) { struct consdev *cn_orig; --- 148,181 ---- kma.kmta_consdev = NULL; ! /* ! * Figure out if we're the console. ! * ! * The Fujitsu SPARC Enterprise M4000/M5000/M8000/M9000 has a ! * serial port on each I/O board and a pseudo console that is ! * redirected to one of these serial ports. The board number ! * of the serial port in question is encoded in the "tty-port#" ! * property of the pseudo console, so we figure out what our ! * board number is by walking up the device tree, and check ! * for a match. ! */ ! node = prom_instance_to_package(prom_stdin()); ! com_is_input = (ea->ea_node == node); ! if (OF_getprop(node, "name", buf, sizeof(buf)) > 0 && ! strcmp(buf, "pseudo-console") == 0) { ! port = prom_getpropint(node, "tty-port#", -1); ! node = OF_parent(OF_parent(ea->ea_node)); ! com_is_input = (prom_getpropint(node, "board#", -2) == port); ! } ! ! node = prom_instance_to_package(prom_stdout()); ! com_is_output = (ea->ea_node == node); ! if (OF_getprop(node, "name", buf, sizeof(buf)) > 0 && ! strcmp(buf, "pseudo-console") == 0) { ! port = prom_getpropint(node, "tty-port#", -1); ! node = OF_parent(OF_parent(ea->ea_node)); ! com_is_output = (prom_getpropint(node, "board#", -2) == port); ! } if (com_is_input || com_is_output) { struct consdev *cn_orig; *************** com_ebus_attach(device_t parent, device_ *** 178,183 **** --- 206,223 ---- cn_tab = cn_orig; kma.kmta_consdev = cn_tab; } + + /* + * Apparently shoving too much data down the TX FIFO on the + * Fujitsu SPARC Enterprise M4000/M5000 causes a hardware + * fault. Avoid this issue by setting the FIFO depth to 1. + * This will effectively disable the TX FIFO, but will still + * enable the RX FIFO, which is what we really care about. + */ + if (OF_getprop(ea->ea_node, "compatible", buf, sizeof(buf)) > 0 && + strcmp(buf, "FJSV,su") == 0) + sc->sc_fifolen = 1; + /* Now attach the driver */ com_attach_subr(sc);