Nuke traces of PCI. Minor cosmetic clean ups.

This commit is contained in:
uwe 2007-06-03 01:52:54 +00:00
parent dcaa9bf80c
commit c75253c460
1 changed files with 18 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: igsfb_ofbus.c,v 1.3 2007/06/03 01:31:31 uwe Exp $ */
/* $NetBSD: igsfb_ofbus.c,v 1.4 2007/06/03 01:52:54 uwe Exp $ */
/*
* Copyright (c) 2006 Michael Lorenz
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.3 2007/06/03 01:31:31 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.4 2007/06/03 01:52:54 uwe Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -46,8 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.3 2007/06/03 01:31:31 uwe Exp $");
#include <machine/intr.h>
#include <machine/ofw.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcidevs.h>
#include <dev/isa/isavar.h>
#include <dev/wscons/wsdisplayvar.h>
@ -74,7 +72,7 @@ static int igsfb_setup_dc(struct igsfb_devconfig *);
CFATTACH_DECL(igsfb_ofbus, sizeof(struct igsfb_softc),
igsfb_ofbus_match, igsfb_ofbus_attach, NULL, NULL);
static const char *compat_strings[] = { "igs,cyperpro2010", 0 };
static const char const *compat_strings[] = { "igs,cyperpro2010", NULL };
vaddr_t igsfb_mem_vaddr = 0, igsfb_mmio_vaddr = 0;
paddr_t igsfb_mem_paddr;
@ -94,10 +92,12 @@ igsfb_ofbus_cnattach(bus_space_tag_t iot, bus_space_tag_t memt)
stdout_phandle = 0;
/* first find out if there's a CyberPro at all in this machine */
if ((igs_node = OF_finddevice("/vlbus/display")) == -1)
igs_node = OF_finddevice("/vlbus/display");
if (igs_node == -1)
return ENXIO;
if (of_compatible(igs_node, compat_strings) < 0)
return ENXIO;
/*
* now we know there's a CyberPro in this machine so map it into
* kernel space, even if it's not the console
@ -125,7 +125,7 @@ igsfb_ofbus_cnattach(bus_space_tag_t iot, bus_space_tag_t memt)
sizeof(stdout_ihandle)) != sizeof(stdout_ihandle)) {
return ENXIO;
}
stdout_ihandle = of_decode_int((unsigned char *)&stdout_ihandle);
stdout_ihandle = of_decode_int((void *)&stdout_ihandle);
stdout_phandle = OF_instance_to_package(stdout_ihandle);
if (stdout_phandle != igs_node)
@ -152,11 +152,11 @@ igsfb_setup_dc(struct igsfb_devconfig *dc)
{
int ret;
dc->dc_id = PCI_PRODUCT_INTEGRAPHICS_CYBERPRO2010;
dc->dc_id = 0x2010;
dc->dc_memt = &igsfb_memt;
dc->dc_memaddr = 0;
dc->dc_memsz= 0x00400000;
dc->dc_memflags = PCI_MAPREG_TYPE_MEM;
dc->dc_memflags = 0;
dc->dc_iot = &igsfb_iot;
dc->dc_iobase = 0;
@ -189,8 +189,9 @@ igsfb_ofbus_match(struct device *parent, struct cfdata *match, void *aux)
{
struct ofbus_attach_args *oba = aux;
if (of_compatible(oba->oba_phandle, compat_strings) == -1)
return (0);
if (of_compatible(oba->oba_phandle, compat_strings) < 0)
return 0;
return 10; /* beat vga etc. */
}
@ -203,18 +204,19 @@ igsfb_ofbus_attach(struct device *parent, struct device *self, void *aux)
uint32_t regs[16];
int isconsole, ret;
OF_getprop(oba->oba_phandle, "reg", regs, sizeof(regs));
isconsole = 0;
if (igsfb_ofbus_is_console(oba->oba_phandle)) {
sc->sc_dc = &igsfb_console_dc;
isconsole = 1;
sc->sc_dc = &igsfb_console_dc;
} else {
isconsole = 0;
sc->sc_dc = malloc(sizeof(struct igsfb_devconfig),
M_DEVBUF, M_NOWAIT | M_ZERO);
if (sc->sc_dc == NULL)
panic("unable to allocate igsfb_devconfig");
if (OF_getprop(oba->oba_phandle, "reg", regs, sizeof(regs)) <= 0) {
printf("Can't read 'reg' property\n");
if (OF_getprop(oba->oba_phandle, "reg",
regs, sizeof(regs)) <= 0)
{
printf(": unable to read 'reg' property\n");
return;
}
ret = igsfb_setup_dc(sc->sc_dc);