Add a bunch of devices to GENERIC. Fix interrupts on the PegasosII with

a nasty little hack.  Getting closer to a working system.
This commit is contained in:
garbled 2007-11-06 19:22:59 +00:00
parent 1af253e4c7
commit 8c63679baf
3 changed files with 160 additions and 26 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.105 2007/11/05 15:49:02 garbled Exp $
# $NetBSD: GENERIC,v 1.106 2007/11/06 19:22:59 garbled Exp $
#
# GENERIC machine description file
#
@ -22,12 +22,13 @@ include "arch/ofppc/conf/std.ofppc"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
#ident "GENERIC-$Revision: 1.105 $"
#ident "GENERIC-$Revision: 1.106 $"
maxusers 32
options PIC_OPENPIC
options PIC_I8259
#options PIC_PREPIVR
# various hacks due to bugs in Openfirmware implementation
options FIRMWORKSBUGS
@ -170,39 +171,138 @@ config netbsd root on ? type ?
mainbus* at root
# Generic OpenFirmware console support
rtas* at mainbus?
# CPUs
cpu* at mainbus?
# Generic OpenFirmware console support
rtas* at mainbus?
# PCI root nodes
ofwpci* at mainbus?
pci* at ofwpci? bus ?
pegasospci* at mainbus?
pci* at pegasospci? bus ?
# PCI devices
# PCI bridges
pchb* at pci? dev ? function ?
ppb* at pci? dev ? function ?
pcn* at pci? dev ? function ?
siop* at pci? dev ? function ?
pcib* at pci? dev ? function ?
#genfb* at pci? dev ? function ?
# make sure the console display is always wsdisplay0
# ISA bus support
isa* at pcib?
# Console Devices
#genfb* at pci? dev ? function ?
#pckbc0 at isa? # pc keyboard controller
#pckbd* at pckbc? # PC keyboard
#pms* at pckbc? # PS/2 mouse for wsmouse
#wscons stuff
#wskbd* at pckbd? console ?
#wsmouse* at pms? mux 0
# make sure the console display is always wsdisplay0 XXX Why?
#wsdisplay0 at wsemuldisplaydev? console 1
#wsdisplay* at wsemuldisplaydev?
isa* at pcib?
attimer0 at isa? # AT Timer
pcppi0 at isa? # PC prog. periph. interface
# FIX ISABEEP LATER
# Serial Devices
# ISA serial interfaces
com0 at isa? port 0x3f8 irq 4 # standard PC serial ports
com1 at isa? port 0x2f8 irq 3
# Parallel Printer Interfaces
# ISA parallel printer interfaces
lpt0 at isa? port 0x3bc irq 7 # standard PC parallel ports
scsibus* at scsi?
sd* at scsibus? target ? lun ?
# SCSI Controllers and Devices
siop* at pci? dev ? function ? # Symbios 53c8xx SCSI
esiop* at pci? dev ? function ? # Symbios 53c875 SCSI and newer
# SCSI bus support
scsibus* at siop?
scsibus* at esiop?
# SCSI devices
sd* at scsibus? target ? lun ? # SCSI disk drives
st* at scsibus? target ? lun ? # SCSI tape drives
cd* at scsibus? target ? lun ? # SCSI CD-ROM drives
#ch* at scsibus? target ? lun ? # SCSI autochangers
#ss* at scsibus? target ? lun ? # SCSI scanners
#uk* at scsibus? target ? lun ? # SCSI unknown
# IDE and related devices
# PCI IDE controllers
pciide* at pci? dev ? function ? flags 0x0000
viaide* at pci? dev ? function ? # VIA/AMD/Nvidia IDE controllers
# ATA (IDE) bus support
atabus* at ata?
# IDE drives
# Flags are used only with controllers that support DMA operations
# and mode settings (e.g. some pciide controllers)
# The lowest order four bits (rightmost digit) of the flags define the PIO
# mode to use, the next set of four bits the DMA mode and the third set the
# UltraDMA mode. For each set of four bits, the 3 lower bits define the mode
# to use, and the last bit must be 1 for this setting to be used.
# For DMA and UDMA, 0xf (1111) means 'disable'.
# 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'.
# (0xc=1100, 0xa=1010, 0xf=1111)
# 0x0000 means "use whatever the drive claims to support".
wd* at atabus? drive ? flags 0x0000
# ATAPI bus support
atapibus* at atapi?
# ATAPI devices
# flags have the same meaning as for IDE drives.
cd* at atapibus? drive ? flags 0x0000 # ATAPI CD-ROM drives
sd* at atapibus? drive ? flags 0x0000 # ATAPI disk drives
uk* at atapibus? drive ? flags 0x0000 # ATAPI unknown
# Network Interfaces
ep* at pci? dev ? function ? # 3Com 3c59x
ex* at pci? dev ? function ? # 3Com 3c90x[BC]
fxp* at pci? dev ? function ? # Intel EtherExpress PRO 10+/100B
ne* at pci? dev ? function ? # NE2000-compatible Ethernet
pcn* at pci? dev ? function ? # AMD PCnet-PCI Ethernet
rtk* at pci? dev ? function ? # Realtek 8129/8139
sip* at pci? dev ? function ? # SiS 900/DP83815 Ethernet
tlp* at pci? dev ? function ? # DECchip 21x4x and clones
vr* at pci? dev ? function ? # VIA Rhine Fast Ethernet
# MII/PHY support
acphy* at mii? phy ? # Altima AC101 and AMD Am79c874 PHYs
amhphy* at mii? phy ? # AMD 79c901 Ethernet PHYs
bmtphy* at mii? phy ? # Broadcom BCM5201 and BCM5202 PHYs
brgphy* at mii? phy ? # Broadcom BCM5400-family PHYs
ciphy* at mii? phy ? # Cicada CS8201 Gig-E PHYs
dmphy* at mii? phy ? # Davicom DM9101 PHYs
exphy* at mii? phy ? # 3Com internal PHYs
gentbi* at mii? phy ? # Generic Ten-Bit 1000BASE-[CLS]X PHYs
glxtphy* at mii? phy ? # Level One LXT-1000 PHYs
gphyter* at mii? phy ? # NS83861 Gig-E PHY
icsphy* at mii? phy ? # Integrated Circuit Systems ICS189x
igphy* at mii? phy ? # Intel IGP01E1000
ikphy* at mii? phy ? # Intel 82563 PHYs
inphy* at mii? phy ? # Intel 82555 PHYs
iophy* at mii? phy ? # Intel 82553 PHYs
lxtphy* at mii? phy ? # Level One LXT-970 PHYs
makphy* at mii? phy ? # Marvell Semiconductor 88E1000 PHYs
nsphy* at mii? phy ? # NS83840 PHYs
nsphyter* at mii? phy ? # NS83843 PHYs
pnaphy* at mii? phy ? # generic HomePNA PHYs
qsphy* at mii? phy ? # Quality Semiconductor QS6612 PHYs
rgephy* at mii? phy ? # Realtek 8169S/8110S internal PHYs
rlphy* at mii? phy ? # Realtek 8139/8201L PHYs
sqphy* at mii? phy ? # Seeq 80220/80221/80223 PHYs
tlphy* at mii? phy ? # ThunderLAN PHYs
tqphy* at mii? phy ? # TDK Semiconductor PHYs
ukphy* at mii? phy ? # generic unknown PHYs
urlphy* at mii? phy ? # Realtek RTL8150L internal PHYs
pseudo-device vnd # disk-like interface to files
#options VND_COMPRESSION # compressed vnd(4)

View File

@ -1,4 +1,4 @@
# $NetBSD: files.ofppc,v 1.31 2007/11/05 15:49:03 garbled Exp $
# $NetBSD: files.ofppc,v 1.32 2007/11/06 19:22:59 garbled Exp $
#
# NetBSD/ofppc configuration info
#
@ -123,6 +123,8 @@ file arch/powerpc/isa/isa_machdep_common.c isa
file arch/ofppc/isa/isa_machdep.c isa
file arch/powerpc/isa/isadma_machdep.c isa
include "dev/pckbport/files.pckbport"
device cpu
attach cpu at mainbus
file arch/ofppc/ofppc/cpu.c cpu

View File

@ -1,4 +1,4 @@
/* $NetBSD: mainbus.c,v 1.15 2007/10/25 16:55:50 garbled Exp $ */
/* $NetBSD: mainbus.c,v 1.16 2007/11/06 19:22:59 garbled Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.15 2007/10/25 16:55:50 garbled Exp $");
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.16 2007/11/06 19:22:59 garbled Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -48,12 +48,17 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.15 2007/10/25 16:55:50 garbled Exp $")
#include <dev/ofw/ofw_pci.h>
#include <arch/powerpc/pic/picvar.h>
#include <machine/pci_machdep.h>
#include <machine/autoconf.h>
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
int mainbus_match(struct device *, struct cfdata *, void *);
void mainbus_attach(struct device *, struct device *, void *);
static int pegasos_get_irq(struct pic_ops *);
CFATTACH_DECL(mainbus, sizeof(struct device),
mainbus_match, mainbus_attach, NULL, NULL);
@ -153,23 +158,22 @@ mainbus_attach(struct device *parent, struct device *self, void *aux)
ca.ca_reg = reg;
config_found(self, &ca, NULL);
}
#ifdef MAMBO
ca.ca_name="com";
config_found(self, &ca, NULL);
#endif
}
void
ofppc_setup_pics(void)
{
int i, isa_cascade = 0;
int node, i, isa_cascade = 0;
char name[32];
/* Now setup the PIC's */
genofw_find_ofpics(OF_finddevice("/"));
node = OF_finddevice("/");
if (node <= 0)
panic("Can't find root OFW device node\n");
genofw_find_ofpics(node);
genofw_fixup_picnode_offsets();
pic_init();
/* find ISA first */
for (i = 0; i < nrofpics; i++)
if (picnodes[i].type == PICNODE_TYPE_8259)
@ -191,4 +195,32 @@ ofppc_setup_pics(void)
intr_establish(16, IST_LEVEL, IPL_NONE, pic_handle_intr,
isa_pic);
}
/* The PegasosII is wierd (surprise!) and needs a prepivr style
* get_irq routine. yay.
*/
memset(name, 0, sizeof(name));
OF_getprop(node, "name", name, sizeof(name));
if (strcmp(name, "bplan,Pegasos2") == 0)
isa_pic->pic_get_irq = pegasos_get_irq;
}
static int
pegasos_get_irq(struct pic_ops *pic)
{
static int lirq;
int irq;
irq = i8259_get_irq(pic);
if (lirq == 7 && irq == lirq) {
lirq = -1;
return 255;
}
lirq = irq;
if (irq == 0)
return 255;
return irq;
}