Move config_console() out of the grf-layer. This allows for more than just

grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).
This commit is contained in:
leo 2000-09-28 07:26:48 +00:00
parent 8e1cd4f341
commit 670b06c6e0
4 changed files with 42 additions and 23 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.34 2000/06/06 11:09:46 leo Exp $ */ /* $NetBSD: autoconf.c,v 1.35 2000/09/28 07:26:48 leo Exp $ */
/* /*
* Copyright (c) 1995 Leo Weppelman * Copyright (c) 1995 Leo Weppelman
@ -132,6 +132,14 @@ config_console()
cf = config_rootsearch(NULL, "mainbus", "mainbus"); cf = config_rootsearch(NULL, "mainbus", "mainbus");
if (cf == NULL) if (cf == NULL)
panic("no mainbus"); panic("no mainbus");
/*
* Note: The order of the 'atari_config_found()' calls is
* important! On the Hades, the 'pci-side' of the config does
* some setup for the 'grf-side'. This make it possible to use
* a PCI card for both wscons and grfabs.
*/
atari_config_found(cf, NULL, "pcibus", NULL);
atari_config_found(cf, NULL, "grfbus", NULL); atari_config_found(cf, NULL, "grfbus", NULL);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.100 2000/09/13 15:00:17 thorpej Exp $ */ /* $NetBSD: machdep.c,v 1.101 2000/09/28 07:26:48 leo Exp $ */
/* /*
* Copyright (c) 1988 University of Utah. * Copyright (c) 1988 University of Utah.
@ -142,7 +142,13 @@ consinit()
initmsgbuf(msgbufaddr, m68k_round_page(MSGBUFSIZE)); initmsgbuf(msgbufaddr, m68k_round_page(MSGBUFSIZE));
/* /*
* Initialize the console before we print anything out. * Initialize hardware that support various console types like
* the grf and PCI busses.
*/
config_console();
/*
* Now pick the best console candidate.
*/ */
cninit(); cninit();

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite.c,v 1.29 2000/03/23 06:36:04 thorpej Exp $ */ /* $NetBSD: ite.c,v 1.30 2000/09/28 07:26:49 leo Exp $ */
/* /*
* Copyright (c) 1988 University of Utah. * Copyright (c) 1988 University of Utah.
@ -261,11 +261,6 @@ void
itecnprobe(cd) itecnprobe(cd)
struct consdev *cd; struct consdev *cd;
{ {
/*
* bring graphics layer up.
*/
config_console();
/* /*
* return priority of the best ite (already picked from attach) * return priority of the best ite (already picked from attach)
* or CN_DEAD. * or CN_DEAD.

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_machdep.c,v 1.26 2000/09/28 06:39:52 leo Exp $ */ /* $NetBSD: pci_machdep.c,v 1.27 2000/09/28 07:26:49 leo Exp $ */
/* /*
* Copyright (c) 1996 Leo Weppelman. All rights reserved. * Copyright (c) 1996 Leo Weppelman. All rights reserved.
@ -106,6 +106,12 @@ struct cfattach pcibus_ca = {
sizeof(struct device), pcibusmatch, pcibusattach sizeof(struct device), pcibusmatch, pcibusattach
}; };
/*
* We need some static storage to probe pci-busses for VGA cards during
* early console init.
*/
static struct atari_bus_space bs_storage[2]; /* 1 iot, 1 memt */
int int
pcibusmatch(pdp, cfp, auxp) pcibusmatch(pdp, cfp, auxp)
struct device *pdp; struct device *pdp;
@ -114,12 +120,12 @@ void *auxp;
{ {
static int nmatched = 0; static int nmatched = 0;
if(atari_realconfig == 0)
return (0);
if (strcmp((char *)auxp, "pcibus")) if (strcmp((char *)auxp, "pcibus"))
return (0); /* Wrong number... */ return (0); /* Wrong number... */
if(atari_realconfig == 0)
return (1);
if (machineid & ATARI_HADES) { if (machineid & ATARI_HADES) {
/* /*
* The Hades has only one pci bus * The Hades has only one pci bus
@ -139,15 +145,13 @@ void *auxp;
{ {
struct pcibus_attach_args pba; struct pcibus_attach_args pba;
enable_pci_devices();
pba.pba_busname = "pci"; pba.pba_busname = "pci";
pba.pba_pc = NULL; pba.pba_pc = NULL;
pba.pba_bus = 0; pba.pba_bus = 0;
pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
pba.pba_dmat = BUS_PCI_DMA_TAG; pba.pba_dmat = BUS_PCI_DMA_TAG;
pba.pba_iot = leb_alloc_bus_space_tag(NULL); pba.pba_iot = leb_alloc_bus_space_tag(&bs_storage[0]);
pba.pba_memt = leb_alloc_bus_space_tag(NULL); pba.pba_memt = leb_alloc_bus_space_tag(&bs_storage[0]);
if ((pba.pba_iot == NULL) || (pba.pba_memt == NULL)) { if ((pba.pba_iot == NULL) || (pba.pba_memt == NULL)) {
printf("leb_alloc_bus_space_tag failed!\n"); printf("leb_alloc_bus_space_tag failed!\n");
return; return;
@ -155,6 +159,18 @@ void *auxp;
pba.pba_iot->base = PCI_IO_PHYS; pba.pba_iot->base = PCI_IO_PHYS;
pba.pba_memt->base = PCI_MEM_PHYS; pba.pba_memt->base = PCI_MEM_PHYS;
if (dp == NULL) {
/*
* Scan the bus for a VGA-card that we support. If we
* find one, try to initialize it to a 'standard' text
* mode (80x25).
*/
check_for_vga();
return;
}
enable_pci_devices();
MFP2->mf_aer &= ~(0x27); /* PCI interrupts: HIGH -> LOW */ MFP2->mf_aer &= ~(0x27); /* PCI interrupts: HIGH -> LOW */
printf("\n"); printf("\n");
@ -209,12 +225,6 @@ init_pci_bus()
csr &= ~PCI_COMMAND_MASTER_ENABLE; csr &= ~PCI_COMMAND_MASTER_ENABLE;
pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr); pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr);
} }
/*
* Scan the bus for a VGA-card that we support. If we find
* one, try to initialize it to a 'standard' text mode (80x25).
*/
check_for_vga();
} }
/* /*