summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_cpu_sparc64.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2004-11-17 14:44:10 +0000
committermarius <marius@FreeBSD.org>2004-11-17 14:44:10 +0000
commit5883c14f1923ca06d15a97fc066f4feebe813c13 (patch)
treeb6d767a1183f0f860850dffb303fe2350b399664 /sys/dev/uart/uart_cpu_sparc64.c
parent9c6e87707dddea69a7ee17dacad295f77dd80d94 (diff)
downloadFreeBSD-src-5883c14f1923ca06d15a97fc066f4feebe813c13.zip
FreeBSD-src-5883c14f1923ca06d15a97fc066f4feebe813c13.tar.gz
o sparc64/isa/isa.c:
- The claim in the commit log of rev. 1.11 of dev/uart/uart_cpu_sparc64.c etc. that UARTs are the only relevant ISA devices on sparc64 turned out to be false. While there are sparc64 models where UARTs are the only devices on the ISA bus there are in fact also low-cost models where all devices traditionally found on the EBus are hooked up to the ISA bus. There are also models that use a mix between EBus and ISA devices with things like an AT keyboard controller and other rather interesting devices that we might want to support in the futute hook up to the ISA bus. In order to not need to add sparc64 specific device_identify methods to all of the respective ISA drivers and also not add OFW specific code to the common ISA code make the sparc64 ISA bus code fake up PnP devices so most ISA drivers probe their devices without further changes. Unfortunately Sun doesn't adhere to the ISA bindings defined in IEEE 1275-1994 for the properties of most of the ISA devices which would allow to obtain the vendor and logical IDs from their properties. So we we just use a simple table which maps the name properties to PnP IDs. This could be done in a more sophisticated way but I courrently don't see the need for this. [1] - Add the children with fully mapped and specified resources (in the OFW sense) similar to what is done in the EBus code for the IRQ resources of the children as adjusting the resources and the resource list entries respectively in isa_alloc_resource() as done perviously causes trouble with drivers which use rman_get_start(), pass-through or allocate and release resources multiple times, etc. Adjusting the resources might be better off in a bus_activate_resource method but the common ISA code currently doesn't allow for an isa_activate_resource(). [2] With this change: - ppbus(4) and lpt(4) attach and work (modulo ECP mode, which requires real ISADMA code but it currently only consists of stubs on sparc64). - atkbdc(4) and atkbdc(4) attach, no further testing done. - fdc(4) itself attaches but causes a hang while attaching fd0 also when is DMA disabled, further work in fdc(4) is required here as e.g. fd0 uses the address of fd1 on sparc64 (not sure if sparc64 supports more than one floppy drive at all). All of these drivers previously caused panics in the sparc64 ISA code. - Minor changes, e.g. use __FBSDID, remove a dupe word in a comment and declare one global variable which isn't used outside of isa.c static. o dev/uart/uart_cpu_sparc64.c and modules/uart/Makefile: - Remove the code for registering the UARTs on the ISA bus from the sparc64 uart_cpu_identify() again and rely on probing them via PnP. Original idea by: tmm [1] No objections by: tmm [1], [2]
Diffstat (limited to 'sys/dev/uart/uart_cpu_sparc64.c')
-rw-r--r--sys/dev/uart/uart_cpu_sparc64.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/sys/dev/uart/uart_cpu_sparc64.c b/sys/dev/uart/uart_cpu_sparc64.c
index 1496faa..7474301 100644
--- a/sys/dev/uart/uart_cpu_sparc64.c
+++ b/sys/dev/uart/uart_cpu_sparc64.c
@@ -27,28 +27,18 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "opt_isa.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <machine/bus.h>
#include <machine/bus_private.h>
-#include <machine/resource.h>
-#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/openfirm.h>
#include <machine/ofw_machdep.h>
-#include <isa/isavar.h>
-
#include <dev/uart/uart.h>
-#include <dev/uart/uart_bus.h>
#include <dev/uart/uart_cpu.h>
-#include <sparc64/pci/ofw_pci.h>
-#include <sparc64/isa/ofw_isa.h>
-
bus_space_tag_t uart_bus_space_io;
bus_space_tag_t uart_bus_space_mem;
@@ -252,35 +242,5 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
void
uart_cpu_identify(driver_t *driver, device_t parent)
{
-#ifdef DEV_ISA
- char buf[32];
- struct isa_regs reg;
- device_t child;
- phandle_t node;
- ofw_isa_intr_t intr;
-#endif
-#ifdef DEV_ISA
- if (strcmp(device_get_name(parent), "isa") == 0) {
- if ((node = ofw_bus_get_node(device_get_parent(parent))) == 0)
- return;
- for (node = OF_child(node); node != 0; node = OF_peer(node)) {
- if (OF_getprop(node, "name", buf, sizeof(buf)) == -1)
- continue;
- if (strcmp(buf, "serial") != 0)
- continue;
- if ((OF_getprop(node, "reg", &reg,
- sizeof(reg)) == -1) ||
- (OF_getprop(node, "interrupts", &intr,
- sizeof(intr)) == -1))
- continue;
- if ((child = BUS_ADD_CHILD(parent, ISA_ORDER_SENSITIVE,
- uart_driver_name, -1)) == NULL)
- return;
- bus_set_resource(child, SYS_RES_IOPORT, 0,
- ISA_REG_PHYS(&reg), reg.size);
- bus_set_resource(child, SYS_RES_IRQ, 0, intr, 1);
- }
- }
-#endif
}
OpenPOWER on IntegriCloud