code:
#	$OpenBSD: GENERIC-IP22,v 1.16 2014/08/22 20:03:56 deraadt Exp $
#
# THIS KERNEL IS FOR INDIGO (IP20), INDY (IP22) AND INDIGO2 (IP24) SYSTEMS ONLY.
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
#
# For further information on hardware support for this architecture, see
# the intro(4) man page.  For further information about kernel options
# for this architecture, see the options(4) man page.  For an explanation
# of each device driver in this file see the section 4 man page for the
# device.

machine		sgi mips64
include		"../../../conf/GENERIC"
maxusers	32		# Estimated number of users

# Make options
makeoption	LINK_ADDRESS="0xffffffff88800000"
# Force use of 16KB pages. The R5000 Indy, which has the infamous XKPHYS
# coherency bug wrt ll/sc instructions, can not have more than 256MB of
# physical memory, all of it fitting within CKSEG0.
option		PAGE_SHIFT="14"

option	WSDISPLAY_COMPAT_RAWKBD	# Provide raw scancodes; needed for X11

option		EISAVERBOSE
option		PCIVERBOSE
option		USER_PCICONF	# User-space PCI configuration

# Define what targets to support
option		TGT_INDIGO	# R4x00 Indigo (IP20)
option		TGT_INDIGO2	# Indigo2, Challenge M (IP22)
option		TGT_INDY	# Indy, Challenge S (IP24)
option		ARCBIOS		# mandatory
option		CPU_R4000	# R4000/R4400 support (IP20/IP22/IP24)
option		CPU_R4600	# R4600 support (IP22/IP24)
option		CPU_R5000	# R5000 support (IP24)

config		bsd	swap generic

#
# Definition of system
#
mainbus0	at root
cpu*		at mainbus0
clock0		at mainbus0	# scheduling clock on Indy

int0		at mainbus0	# Interrupt Controller and scheduling clock
imc0		at mainbus0	# Memory Controller
gio0		at imc0
eisa0		at imc0

hpc0		at gio? addr 0x1fb80000
hpc1		at gio? addr 0x1fb00000
hpc2		at gio? addr 0x1f980000

dpclock0	at hpc0		# IP20
dsclock0	at hpc0		# IP22/24
sq*		at hpc?		# On-board Ethernet or E++ adapter
wdsc*		at hpc?		# On-board SCSI or GIO32 SCSI adapter
#haltwo*		at hpc0		# Indy/Indigo2 Audio
panel*		at hpc0		# Indy front panel buttons
pckbc*		at hpc0		# Indy/Indigo2 keyboard and mouse

zs0		at hpc0
zs1		at hpc0
zstty*		at zs0		# Serial ports
zskbd*		at zs1 channel 0
wskbd*		at zskbd? mux 1
zsms*		at zs1 channel 1
wsmouse*	at zsms? mux 0

pckbd*		at pckbc?
wskbd*		at pckbd? mux 1
pms*		at pckbc?
wsmouse*	at pms? mux 0

grtwo*		at gio?		# Express (GR2/GR3) graphics
wsdisplay*	at grtwo?
impact*		at gio?		# Impact graphics
wsdisplay*	at impact?
light*		at gio?		# Light/Starter/Entry (LG1/LG2) graphics
wsdisplay*	at light?
newport*	at gio?		# Indy Newport and Indigo2 XL graphics
wsdisplay*	at newport?

giopci*		at gio?
pci*		at giopci?

#dc*		at pci?		# Phobos G100/G130/G160 Fast Ethernet
#lxtphy*		at mii?		# Level1 LXT970 PHYs
#ukphy*		at mii?		# "unknown" PHYs

#audio*		at haltwo?

scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?
ch*		at scsibus?
safte*		at scsibus?
ses*		at scsibus?
uk*		at scsibus?

#pseudo-device	hotplug	1	# devices hot plugging
pseudo-device	wsmux	2       # Mouse and keyboard multiplexor


code:
#	$OpenBSD: GENERIC-IP26,v 1.2 2014/08/22 20:03:56 deraadt Exp $
#
# THIS KERNEL IS FOR POWER INDIGO2 R8000 (IP26) SYSTEMS ONLY.
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
#
# For further information on hardware support for this architecture, see
# the intro(4) man page.  For further information about kernel options
# for this architecture, see the options(4) man page.  For an explanation
# of each device driver in this file see the section 4 man page for the
# device.

machine		sgi mips64
include		"../../../conf/GENERIC"
maxusers	32		# Estimated number of users

# Make options
makeoption	LINK_ADDRESS="0xa800000008010000"

option	WSDISPLAY_COMPAT_RAWKBD	# Provide raw scancodes; needed for X11

option		EISAVERBOSE
option		PCIVERBOSE
option		USER_PCICONF	# User-space PCI configuration

# Define what targets to support
option		TGT_INDIGO2	# Indigo2
option		ARCBIOS		# mandatory
option		CPU_R8000	# R8000 support

config		bsd	swap generic

#
# Definition of system
#
mainbus0	at root
cpu*		at mainbus0

tcc0		at mainbus0	# Streaming Cache Controller
int0		at mainbus0	# Interrupt Controller and scheduling clock
imc0		at mainbus0	# Memory Controller
gio0		at imc0
eisa0		at imc0

hpc0		at gio? addr 0x1fb80000

dsclock0	at hpc0
sq*		at hpc?		# On-board Ethernet
wdsc*		at hpc?		# On-board SCSI
#haltwo*		at hpc0		# Audio
panel*		at hpc0		# front panel buttons
pckbc*		at hpc0		# keyboard and mouse

zs0		at hpc0
zstty*		at zs0		# Serial ports

pckbd*		at pckbc?
wskbd*		at pckbd? mux 1
pms*		at pckbc?
wsmouse*	at pms? mux 0

grtwo*		at gio?		# Express (GR2/GR3) graphics
wsdisplay*	at grtwo?
#impact*		at gio?		# Impact graphics
#wsdisplay*	at impact?
newport*	at gio?		# XL graphics
wsdisplay*	at newport?

giopci*		at gio?
pci*		at giopci?

#dc*		at pci?		# Phobos G100/G130/G160 Fast Ethernet
#lxtphy*		at mii?		# Level1 LXT970 PHYs
#ukphy*		at mii?		# "unknown" PHYs

#audio*		at haltwo?

scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?
ch*		at scsibus?
safte*		at scsibus?
ses*		at scsibus?
uk*		at scsibus?

#pseudo-device	hotplug	1	# devices hot plugging
pseudo-device	wsmux	2       # Mouse and keyboard multiplexor

license: unknown


code:
#	$OpenBSD: GENERIC-IP27,v 1.60 2015/04/16 09:09:49 mpi Exp $
#
# THIS KERNEL IS FOR Origin, Onyx, Fuel, Tezro (IP27, IP35) SYSTEMS ONLY.
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
#
# For further information on hardware support for this architecture, see
# the intro(4) man page.  For further information about kernel options
# for this architecture, see the options(4) man page.  For an explanation
# of each device driver in this file see the section 4 man page for the
# device.

machine		sgi mips64
include		"../../../conf/GENERIC"
maxusers	32		# Estimated number of users

# Make options
makeoption	LINK_ADDRESS="0xa800000000040000"

option		PCIVERBOSE
option		USER_PCICONF	# User-space PCI configuration
option		USBVERBOSE

# Define what targets to support
option		TGT_ORIGIN	# IP27/IP35
option		TGT_COHERENT	# mandatory
option		ARCBIOS		# mandatory
option		CPU_R10000	# R10000/R12000/R14000/R16000 support
option		MIPS_PTE64

config		bsd	swap generic

#
# Definition of system
#
mainbus0	at root
cpu*		at mainbus0
spdmem*		at mainbus0			# SPD memory eeproms
clock0		at mainbus0

#### Main local buses
xbow*		at mainbus0

# XBow devices
xbridge*	at xbow?
xbpci*		at xbridge?
pci*		at xbpci?
impact*		at xbow?
wsdisplay*	at impact?
odyssey*	at xbow?
wsdisplay*	at odyssey?

# IOC3
ioc*		at pci?
com0		at ioc? base 0x00020178
com1		at ioc? base 0x00020170
com*		at ioc?
dsrtc0		at ioc?
iec*		at ioc?
iockbc*		at ioc?

onewire*	at ioc?
option		ONEWIREVERBOSE
owmac*		at onewire?
owserial*	at onewire?

# IOC4
iof*		at pci?
com0		at iof? base 0x380
com1		at iof? base 0x388
com2		at iof? base 0x390
com3		at iof? base 0x398
com*		at iof?
dsrtc0		at iof?
iockbc*		at iof?

#### SCSI
ahc*		at pci?
qlw*		at pci?
qla*		at pci?
qle*		at pci?
mpi*		at pci?
siop*		at pci?

# CardBus bus support
cbb*		at pci?
cardslot*	at cbb?
cardbus*	at cardslot?
pcmcia*		at cardslot?

# USB Controllers
ohci*		at pci?		# Open Host Controller
ohci*		at cardbus?
uhci*		at pci?		# Universal Host Controller
uhci*		at cardbus?
ehci*		at pci?		# Enhanced Host Controller
ehci*		at cardbus?

# USB bus support
usb*		at ohci?
usb*		at uhci?
usb*		at ehci?

# USB devices
uhub*		at usb?		# USB Hubs
uhub*		at uhub?	# USB Hubs
ualea*		at uhub?	# Araneus Alea II TRNG
umodem*		at uhub?	# USB Modems/Serial
ucom*		at umodem?
uvscom*		at uhub?	# SUNTAC Slipper U VS-10U serial
ucom*		at uvscom?
ubsa*		at uhub?	# Belkin serial adapter
ucom*		at ubsa?
uaudio*		at uhub?	# USB Audio
audio*		at uaudio?
ulpt*		at uhub?	# USB Printers
umass*		at uhub?	# USB Mass Storage devices
uhidev*		at uhub?	# Human Interface Devices
ums*		at uhidev?	# USB mouse
wsmouse*	at ums? mux 0
ukbd*		at uhidev?	# USB keyboard
wskbd*		at ukbd? mux 1
uslhcom*	at uhidev?	# Silicon Labs CP2110 USB HID UART
ucom*		at uslhcom?
uhid*		at uhidev?	# USB generic HID support
atu*		at uhub?	# Atmel AT76c50x based 802.11b
aue*		at uhub?	# ADMtek AN986 Pegasus Ethernet
axe*		at uhub?	# ASIX Electronics AX88172 USB Ethernet
axen*		at uhub?	# ASIX Electronics AX88179 USB Ethernet
cdce*		at uhub?	# CDC Ethernet
cue*		at uhub?	# CATC USB-EL1201A based Ethernet
kue*		at uhub?	# Kawasaki KL5KUSB101B based Ethernet
mos*		at uhub?	# MOSCHIP MCS7730/7830 10/100 Ethernet
otus*		at uhub?	# Atheros AR9001U
rsu*		at uhub?	# Realtek RTL8188SU/RTL8191SU/RTL8192SU
rum*		at uhub?	# Ralink RT2501USB/RT2601USB
run*		at uhub?	# Ralink RT2700U/RT2800U/RT3000U
smsc*		at uhub?	# SMSC LAN95xx Ethernet
uath*		at uhub?	# Atheros AR5005UG/AR5005UX
udav*		at uhub?	# Davicom DM9601 based Ethernet
upgt*		at uhub?	# Conexant/Intersil PrismGT SoftMAC USB
upl*		at uhub?	# Prolific PL2301/PL2302 host-to-host `network'
ugl*		at uhub?	# Genesys Logic GL620USB-A host-to-host `network'
ural*		at uhub?	# Ralink RT2500USB
url*		at uhub?	# Realtek RTL8150L based adapters
urtw*		at uhub?	# Realtek 8187
urtwn*		at uhub?	# Realtek RTL8188CU/RTL8192CU
wi*		at uhub?	# WaveLAN IEEE 802.11DS
zyd*		at uhub?	# Zydas ZD1211
ugen*		at uhub?	# USB Generic driver
uthum*		at uhidev?	# TEMPerHUM sensor
ugold*		at uhidev?	# gold TEMPer sensor
utwitch*	at uhidev?	# YUREX BBU sensor

# USB Video
uvideo*		at uhub?
video*		at uvideo?

udl*		at uhub?
wsdisplay*	at udl?

ppb*		at pci?		# PCI-PCI bridges
pci*		at ppb?

#### NICs
pcn*		at pci?		# AMD PCnet-PCI Ethernet
epic*		at pci?		# SMC EPIC/100 ethernet
de*		at pci?		# DC21X4X-based ethernet
dc*		at pci?		# 21143, "tulip" clone ethernet
dc*		at cardbus?
sf*		at pci?		# Adaptec AIC-6915 ethernet
em*		at pci?		# Intel Pro/1000 ethernet
ep*		at pci?		# 3Com 3c59x
ep*		at pcmcia?
fxp*		at pci?		# EtherExpress 10/100B ethernet
fxp*		at cardbus?
mtd*		at pci?		# Myson MTD803 3-in-1 Ethernet
ne*		at pci?		# NE2000-compatible Ethernet
ne*		at pcmcia?
ti*		at pci?		# Alteon ACEnic gigabit Ethernet
stge*		at pci?		# Sundance TC9021 GigE
vr*		at pci?		# VIA Rhine Fast Ethernet
xl*		at pci?		# 3C9xx ethernet
xl*		at cardbus?
re*		at pci?		# Realtek 8169/8169S/8110S
re*		at cardbus?
rl*		at pci?		# Realtek 81[23]9 ethernet
rl*		at cardbus?
hme*		at pci?		# Sun Happy Meal
gem*		at pci?		# Sun 'gem' ethernet
cas*		at pci?		# Sun Cassini 100/Gigabit
skc*		at pci?		# SysKonnect GEnesis 984x
sk*		at skc?		#  each port of above
mskc*		at pci?		# Marvell Yukon-2
msk*		at mskc?	#  each port of above
bge*		at pci?		# Broadcom BCM570x (aka Tigon3)
vge*		at pci?		# VIA VT612x
bnx*		at pci?		# Broadcom BCM5706/5708 GigE
sis*		at pci?		# SiS 900/7016 ethernet

##### Media Independent Interface (mii) drivers
exphy*		at mii?		# 3Com internal PHYs
inphy*		at mii?		# Intel 82555 PHYs
iophy*		at mii?		# Intel 82553 PHYs
icsphy*		at mii?		# ICS 1890 PHYs
lxtphy*		at mii?		# Level1 LXT970 PHYs
nsphy*		at mii?		# NS and compatible PHYs
nsphyter*	at mii?		# NS and compatible PHYs
qsphy*		at mii?		# Quality Semi QS6612 PHYs
sqphy*		at mii?		# Seeq 8x220 PHYs
luphy*		at mii?		# Lucent LU6612 PHY
rlphy*		at mii?		# Realtek 8139 internal PHYs
mtdphy*		at mii?		# Myson MTD972 PHYs
dcphy*		at mii?		# Digital Clone PHYs
acphy*		at mii?		# Altima AC101 PHYs
amphy*		at mii?		# AMD 79C873 PHYs
tqphy*		at mii?		# TDK 78Q212x PHYs
bmtphy*		at mii?		# Broadcom 10/100 PHYs
brgphy*		at mii?		# Broadcom Gigabit PHYs
ciphy*		at mii?		# Cicada CS8201 10/100/1000 copper PHY
eephy*		at mii?		# Marvell 88E1000 series PHY
xmphy*		at mii?		# XaQti XMAC-II PHYs
nsgphy*		at mii?		# NS gigabit PHYs
urlphy*		at mii?		# Realtek RTL8150L internal PHY
rgephy*		at mii?		# Realtek 8169S/8110S PHY
ipgphy*		at mii?		# IC Plus IP1000A PHYs
gentbi*		at mii?		# Generic 1000BASE-X ten-bit PHY
ukphy*		at mii?		# "unknown" PHYs

#### Wireless
acx*		at pci?		# TI ACX100/ACX111 (802.11b/g)
acx*		at cardbus?
malo*		at pci?		# Marvell Libertas
wi*		at pci?		# WaveLAN IEEE 802.11DS
wi*		at pcmcia?

#### Audio
cmpci*		at pci?		# C-Media CMI8338/8738
eap*		at pci?		# Ensoniq AudioPCI S5016
emu*		at pci?		# SB Live!
envy*		at pci?		# VIA Envy24 (aka ICE1712)

audio*		at cmpci?
audio*		at eap?
audio*		at emu?
audio*		at envy?

# MIDI support
midi*		at eap?

#### Keyboard and Mouse
pckbd*		at iockbc?
pms*		at iockbc?
wskbd*		at pckbd? mux 1
wsmouse*	at pms? mux 0

#### SCSI Bus devices
scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?
ch*		at scsibus?
safte*		at scsibus?
ses*		at scsibus?
uk*		at scsibus?

#### Crypto devices
hifn*		at pci?		# Hifn7751/7811/7951
ubsec*		at pci?		# Broadcom 58xx

# PCI "universal" communication device
puc*		at pci?
com*		at puc?
#lpt*		at puc?

com*		at pcmcia?
com*		at cardbus?

pseudo-device	hotplug	1		# devices hot plugging
pseudo-device	wsmux	2       	# Mouse and keyboard multiplexor


code:
#	$OpenBSD: GENERIC-IP28,v 1.4 2014/08/22 20:03:56 deraadt Exp $
#
# THIS KERNEL IS FOR POWER INDIGO2 R10000 (IP28) SYSTEMS ONLY.
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
#
# For further information on hardware support for this architecture, see
# the intro(4) man page.  For further information about kernel options
# for this architecture, see the options(4) man page.  For an explanation
# of each device driver in this file see the section 4 man page for the
# device.

machine		sgi mips64
include		"../../../conf/GENERIC"
maxusers	32		# Estimated number of users

# Make options
makeoption	LINK_ADDRESS="0xa800000020020000"

option	WSDISPLAY_COMPAT_RAWKBD	# Provide raw scancodes; needed for X11

option		EISAVERBOSE
option		PCIVERBOSE
option		USER_PCICONF	# User-space PCI configuration

# Define what targets to support
option		TGT_INDIGO2	# Indigo2
option		ARCBIOS		# mandatory
option		CPU_R10000	# R10000 support

config		bsd	swap generic

#
# Definition of system
#
mainbus0	at root
cpu*		at mainbus0

int0		at mainbus0	# Interrupt Controller and scheduling clock
imc0		at mainbus0	# Memory Controller
gio0		at imc0
eisa0		at imc0

hpc0		at gio? addr 0x1fb80000

dsclock0	at hpc0
sq*		at hpc?		# On-board Ethernet
wdsc*		at hpc?		# On-board SCSI
#haltwo*		at hpc0		# Audio
panel*		at hpc0		# front panel buttons
pckbc*		at hpc0		# keyboard and mouse

zs0		at hpc0
zstty*		at zs0		# Serial ports

pckbd*		at pckbc?
wskbd*		at pckbd? mux 1
pms*		at pckbc?
wsmouse*	at pms? mux 0

grtwo*		at gio?		# Express (GR2/GR3) graphics
wsdisplay*	at grtwo?
impact*		at gio?		# Impact graphics
wsdisplay*	at impact?
newport*	at gio?		# XL graphics
wsdisplay*	at newport?

giopci*		at gio?
pci*		at giopci?

#dc*		at pci?		# Phobos G100/G130/G160 Fast Ethernet
#lxtphy*		at mii?		# Level1 LXT970 PHYs
#ukphy*		at mii?		# "unknown" PHYs

#audio*		at haltwo?

scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?
ch*		at scsibus?
safte*		at scsibus?
ses*		at scsibus?
uk*		at scsibus?

#pseudo-device	hotplug	1	# devices hot plugging
pseudo-device	wsmux	2       # Mouse and keyboard multiplexor


code:
#	$OpenBSD: GENERIC-IP30,v 1.53 2015/04/16 09:09:49 mpi Exp $
#
# THIS KERNEL IS FOR Octane and Octane 2 (IP30) SYSTEMS ONLY.
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
#
# For further information on hardware support for this architecture, see
# the intro(4) man page.  For further information about kernel options
# for this architecture, see the options(4) man page.  For an explanation
# of each device driver in this file see the section 4 man page for the
# device.

machine		sgi mips64
include		"../../../conf/GENERIC"
maxusers	32		# Estimated number of users

# Make options
makeoption	LINK_ADDRESS="0xa800000020020000"

option		PCIVERBOSE
option		USER_PCICONF	# User-space PCI configuration
option		USBVERBOSE

# Define what targets to support
option		TGT_OCTANE	# Octane, Octane 2
option		TGT_COHERENT	# mandatory
option		ARCBIOS		# mandatory
option		CPU_R10000	# R10000/R12000/R14000/R16000 support

config		bsd	swap generic

#
# Definition of system
#
mainbus0	at root
cpu*		at mainbus0
clock0		at mainbus0
power0		at mainbus0

#### Main local buses
xbow0		at mainbus0

# XBow devices
xheart*		at xbow?
onewire*	at xheart?
xbridge*	at xbow?
xbpci*		at xbridge?
pci*		at xbpci?
impact*		at xbow?
wsdisplay*	at impact?
odyssey*	at xbow?
wsdisplay*	at odyssey?

# IOC3
ioc*		at pci?
com0		at ioc? base 0x00020178
com1		at ioc? base 0x00020170
com*		at ioc?
dsrtc0		at ioc?
iec*		at ioc?
iockbc*		at ioc?

onewire*	at ioc?
option		ONEWIREVERBOSE
owmac*		at onewire?
owserial*	at onewire?

#### SCSI
ahc*		at pci?
qlw*		at pci?
qla*		at pci?
qle*		at pci?
mpi*		at pci?
siop*		at pci?

# CardBus bus support
cbb*		at pci?
cardslot*	at cbb?
cardbus*	at cardslot?
pcmcia*		at cardslot?

# USB Controllers
ohci*		at pci?		# Open Host Controller
ohci*		at cardbus?
uhci*		at pci?		# Universal Host Controller
uhci*		at cardbus?
ehci*		at pci?		# Enhanced Host Controller
ehci*		at cardbus?

# USB bus support
usb*		at ohci?
usb*		at uhci?
usb*		at ehci?

# USB devices
uhub*		at usb?		# USB Hubs
uhub*		at uhub?	# USB Hubs
ualea*		at uhub?	# Araneus Alea II TRNG
umodem*		at uhub?	# USB Modems/Serial
ucom*		at umodem?
uvscom*		at uhub?	# SUNTAC Slipper U VS-10U serial
ucom*		at uvscom?
ubsa*		at uhub?	# Belkin serial adapter
ucom*		at ubsa?
uaudio*		at uhub?	# USB Audio
audio*		at uaudio?
ulpt*		at uhub?	# USB Printers
umass*		at uhub?	# USB Mass Storage devices
uhidev*		at uhub?	# Human Interface Devices
ums*		at uhidev?	# USB mouse
wsmouse*	at ums? mux 0
ukbd*		at uhidev?	# USB keyboard
wskbd*		at ukbd? mux 1
uslhcom*	at uhidev?	# Silicon Labs CP2110 USB HID UART
ucom*		at uslhcom?
uhid*		at uhidev?	# USB generic HID support
atu*		at uhub?	# Atmel AT76c50x based 802.11b
aue*		at uhub?	# ADMtek AN986 Pegasus Ethernet
axe*		at uhub?	# ASIX Electronics AX88172 USB Ethernet
axen*		at uhub?	# ASIX Electronics AX88179 USB Ethernet
cdce*		at uhub?	# CDC Ethernet
cue*		at uhub?	# CATC USB-EL1201A based Ethernet
kue*		at uhub?	# Kawasaki KL5KUSB101B based Ethernet
mos*		at uhub?	# MOSCHIP MCS7730/7830 10/100 Ethernet
otus*		at uhub?	# Atheros AR9001U
rsu*		at uhub?	# Realtek RTL8188SU/RTL8191SU/RTL8192SU
rum*		at uhub?	# Ralink RT2501USB/RT2601USB
run*		at uhub?	# Ralink RT2700U/RT2800U/RT3000U
smsc*		at uhub?	# SMSC LAN95xx Ethernet
uath*		at uhub?	# Atheros AR5005UG/AR5005UX
udav*		at uhub?	# Davicom DM9601 based Ethernet
upgt*		at uhub?	# Conexant/Intersil PrismGT SoftMAC USB
upl*		at uhub?	# Prolific PL2301/PL2302 host-to-host `network'
ugl*		at uhub?	# Genesys Logic GL620USB-A host-to-host `network'
ural*		at uhub?	# Ralink RT2500USB
url*		at uhub?	# Realtek RTL8150L based adapters
urtw*		at uhub?	# Realtek 8187
urtwn*		at uhub?	# Realtek RTL8188CU/RTL8192CU
wi*		at uhub?	# WaveLAN IEEE 802.11DS
zyd*		at uhub?	# Zydas ZD1211
ugen*		at uhub?	# USB Generic driver
uthum*		at uhidev?	# TEMPerHUM sensor
ugold*		at uhidev?	# gold TEMPer sensor
utwitch*	at uhidev?	# YUREX BBU sensor

# USB Video
uvideo*		at uhub?
video*		at uvideo?

udl*		at uhub?
wsdisplay*	at udl?

ppb*		at pci?		# PCI-PCI bridges
pci*		at ppb?

#### NICs
pcn*		at pci?		# AMD PCnet-PCI Ethernet
epic*		at pci?		# SMC EPIC/100 ethernet
de*		at pci?		# DC21X4X-based ethernet
dc*		at pci?		# 21143, "tulip" clone ethernet
dc*		at cardbus?
sf*		at pci?		# Adaptec AIC-6915 ethernet
em*		at pci?		# Intel Pro/1000 ethernet
ep*		at pci?		# 3Com 3c59x
ep*		at pcmcia?
fxp*		at pci?		# EtherExpress 10/100B ethernet
fxp*		at cardbus?
mtd*		at pci?		# Myson MTD803 3-in-1 Ethernet
ne*		at pci?		# NE2000-compatible Ethernet
ne*		at pcmcia?
ti*		at pci?		# Alteon ACEnic gigabit Ethernet
stge*		at pci?		# Sundance TC9021 GigE
vr*		at pci?		# VIA Rhine Fast Ethernet
xl*		at pci?		# 3C9xx ethernet
xl*		at cardbus?
re*		at pci?		# Realtek 8169/8169S/8110S
re*		at cardbus?
rl*		at pci?		# Realtek 81[23]9 ethernet
rl*		at cardbus?
hme*		at pci?		# Sun Happy Meal
gem*		at pci?		# Sun 'gem' ethernet
cas*		at pci?		# Sun Cassini 100/Gigabit
skc*		at pci?		# SysKonnect GEnesis 984x
sk*		at skc?		#  each port of above
mskc*		at pci?		# Marvell Yukon-2
msk*		at mskc?	#  each port of above
bge*		at pci?		# Broadcom BCM570x (aka Tigon3)
vge*		at pci?		# VIA VT612x
bnx*		at pci?		# Broadcom BCM5706/5708 GigE
sis*		at pci?		# SiS 900/7016 ethernet

##### Media Independent Interface (mii) drivers
exphy*		at mii?		# 3Com internal PHYs
inphy*		at mii?		# Intel 82555 PHYs
iophy*		at mii?		# Intel 82553 PHYs
icsphy*		at mii?		# ICS 1890 PHYs
lxtphy*		at mii?		# Level1 LXT970 PHYs
nsphy*		at mii?		# NS and compatible PHYs
nsphyter*	at mii?		# NS and compatible PHYs
qsphy*		at mii?		# Quality Semi QS6612 PHYs
sqphy*		at mii?		# Seeq 8x220 PHYs
luphy*		at mii?		# Lucent LU6612 PHY
rlphy*		at mii?		# Realtek 8139 internal PHYs
mtdphy*		at mii?		# Myson MTD972 PHYs
dcphy*		at mii?		# Digital Clone PHYs
acphy*		at mii?		# Altima AC101 PHYs
amphy*		at mii?		# AMD 79C873 PHYs
tqphy*		at mii?		# TDK 78Q212x PHYs
bmtphy*		at mii?		# Broadcom 10/100 PHYs
brgphy*		at mii?		# Broadcom Gigabit PHYs
ciphy*		at mii?		# Cicada CS8201 10/100/1000 copper PHY
eephy*		at mii?		# Marvell 88E1000 series PHY
xmphy*		at mii?		# XaQti XMAC-II PHYs
nsgphy*		at mii?		# NS gigabit PHYs
urlphy*		at mii?		# Realtek RTL8150L internal PHY
rgephy*		at mii?		# Realtek 8169S/8110S PHY
ipgphy*		at mii?		# IC Plus IP1000A PHYs
gentbi*		at mii?		# Generic 1000BASE-X ten-bit PHY
ukphy*		at mii?		# "unknown" PHYs

#### Wireless
acx*		at pci?		# TI ACX100/ACX111 (802.11b/g)
acx*		at cardbus?
malo*		at pci?		# Marvell Libertas
wi*		at pci?		# WaveLAN IEEE 802.11DS
wi*		at pcmcia?

#### Audio
cmpci*		at pci?		# C-Media CMI8338/8738
eap*		at pci?		# Ensoniq AudioPCI S5016
emu*		at pci?		# SB Live!
envy*		at pci?		# VIA Envy24 (aka ICE1712)

audio*		at cmpci?
audio*		at eap?
audio*		at emu?
audio*		at envy?

# MIDI support
midi*		at eap?

#### Keyboard and Mouse
pckbd*		at iockbc?
pms*		at iockbc?
wskbd*		at pckbd? mux 1
wsmouse*	at pms? mux 0

#### SCSI Bus devices
scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?
ch*		at scsibus?
safte*		at scsibus?
ses*		at scsibus?
uk*		at scsibus?

#### Crypto devices
hifn*		at pci?		# Hifn7751/7811/7951
ubsec*		at pci?		# Broadcom 58xx

# PCI "universal" communication device
puc*		at pci?
com*		at puc?
#lpt*		at puc?

com*		at pcmcia?
com*		at cardbus?

pseudo-device	hotplug	1		# devices hot plugging
pseudo-device	wsmux	2       	# Mouse and keyboard multiplexor


code:
#	$OpenBSD: GENERIC-IP30.MP,v 1.1 2010/01/18 17:05:52 miod Exp $

include "arch/sgi/conf/GENERIC-IP30"

option	MULTIPROCESSOR
#option	MP_LOCKDEBUG

cpu*	at mainbus?


code:
#	$OpenBSD: GENERIC-IP32,v 1.44 2015/04/16 09:09:49 mpi Exp $
#
# THIS KERNEL IS FOR O2 (IP32) SYSTEMS ONLY.
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
#
# For further information on hardware support for this architecture, see
# the intro(4) man page.  For further information about kernel options
# for this architecture, see the options(4) man page.  For an explanation
# of each device driver in this file see the section 4 man page for the
# device.

machine		sgi mips64
include		"../../../conf/GENERIC"
maxusers	32		# Estimated number of users

# Make options
makeoption	LINK_ADDRESS="0xffffffff80100000"

option	WSDISPLAY_COMPAT_RAWKBD	# Provide raw scancodes; needed for X11

option		PCIVERBOSE
option		USER_PCICONF	# User-space PCI configuration

# Define what targets to support
option		TGT_O2		# O2, O2+
option		ARCBIOS		# mandatory
option		CPU_R5000	# R5000/RM5200 support
option		CPU_RM7000	# RM7000 support
option		CPU_R10000	# R10000/R12000/R14000/R16000 support

config		bsd	swap generic

#
# Definition of system
#
mainbus0	at root
cpu*		at mainbus0
clock0		at mainbus0

#### Main local buses
macebus0	at mainbus0	# MACE controller localbus.

# GBE Framebuffer
gbe0		at mainbus0

# Localbus devices
mec0		at macebus0
mavb0		at macebus0
mkbc0		at macebus0
com0		at macebus0 base 0x00390000
com1		at macebus0 base 0x00398000
dsrtc0		at macebus0
power0		at macebus0

#### PCI Bus
macepcibr0	at macebus0	# MACE controller PCI Bus bridge.
pci*		at macepcibr?

#### SCSI
ahc*		at pci?
qlw*		at pci?
qla*		at pci?
qle*		at pci?
mpi*		at pci?
siop*		at pci?

# CardBus bus support
cbb*		at pci?
cardslot*	at cbb?
cardbus*	at cardslot?
pcmcia*		at cardslot?

# USB Controllers
ohci*		at pci?		# Open Host Controller
ohci*		at cardbus?
uhci*		at pci?		# Universal Host Controller
uhci*		at cardbus?
ehci*		at pci?		# Enhanced Host Controller
ehci*		at cardbus?

# USB bus support
usb*		at ohci?
usb*		at uhci?
usb*		at ehci?

# USB devices
uhub*		at usb?		# USB Hubs
uhub*		at uhub?	# USB Hubs
ualea*		at uhub?	# Araneus Alea II TRNG
umodem*		at uhub?	# USB Modems/Serial
ucom*		at umodem?
uvscom*		at uhub?	# SUNTAC Slipper U VS-10U serial
ucom*		at uvscom?
ubsa*		at uhub?	# Belkin serial adapter
ucom*		at ubsa?
uaudio*		at uhub?	# USB Audio
audio*		at uaudio?
ulpt*		at uhub?	# USB Printers
umass*		at uhub?	# USB Mass Storage devices
uhidev*		at uhub?	# Human Interface Devices
ums*		at uhidev?	# USB mouse
wsmouse*	at ums? mux 0
ukbd*		at uhidev?	# USB keyboard
wskbd*		at ukbd? mux 1
uslhcom*	at uhidev?	# Silicon Labs CP2110 USB HID UART
ucom*		at uslhcom?
uhid*		at uhidev?	# USB generic HID support
atu*		at uhub?	# Atmel AT76c50x based 802.11b
aue*		at uhub?	# ADMtek AN986 Pegasus Ethernet
axe*		at uhub?	# ASIX Electronics AX88172 USB Ethernet
axen*		at uhub?	# ASIX Electronics AX88179 USB Ethernet
cdce*		at uhub?	# CDC Ethernet
cue*		at uhub?	# CATC USB-EL1201A based Ethernet
kue*		at uhub?	# Kawasaki KL5KUSB101B based Ethernet
mos*		at uhub?	# MOSCHIP MCS7730/7830 10/100 Ethernet
otus*		at uhub?	# Atheros AR9001U
rsu*		at uhub?	# Realtek RTL8188SU/RTL8191SU/RTL8192SU
rum*		at uhub?	# Ralink RT2501USB/RT2601USB
run*		at uhub?	# Ralink RT2700U/RT2800U/RT3000U
smsc*		at uhub?	# SMSC LAN95xx Ethernet
uath*		at uhub?	# Atheros AR5005UG/AR5005UX
udav*		at uhub?	# Davicom DM9601 based Ethernet
upgt*		at uhub?	# Conexant/Intersil PrismGT SoftMAC USB
upl*		at uhub?	# Prolific PL2301/PL2302 host-to-host `network'
ugl*		at uhub?	# Genesys Logic GL620USB-A host-to-host `network'
ural*		at uhub?	# Ralink RT2500USB
url*		at uhub?	# Realtek RTL8150L based adapters
urtw*		at uhub?	# Realtek 8187
urtwn*		at uhub?	# Realtek RTL8188CU/RTL8192CU
wi*		at uhub?	# WaveLAN IEEE 802.11DS
zyd*		at uhub?	# Zydas ZD1211
ugen*		at uhub?	# USB Generic driver
uthum*		at uhidev?	# TEMPerHUM sensor
ugold*		at uhidev?	# gold TEMPer sensor
utwitch*	at uhidev?	# YUREX BBU sensor

# USB Video
uvideo*		at uhub?
video*		at uvideo?

udl*		at uhub?
wsdisplay*	at udl?

ppb*		at pci?		# PCI-PCI bridges
pci*		at ppb?

#### NICs
pcn*		at pci?		# AMD PCnet-PCI Ethernet
epic*		at pci?		# SMC EPIC/100 ethernet
de*		at pci?		# DC21X4X-based ethernet
dc*		at pci?		# 21143, "tulip" clone ethernet
dc*		at cardbus?
sf*		at pci?		# Adaptec AIC-6915 ethernet
em*		at pci?		# Intel Pro/1000 ethernet
ep*		at pci?		# 3Com 3c59x
ep*		at pcmcia?
fxp*		at pci?		# EtherExpress 10/100B ethernet
fxp*		at cardbus?
mtd*		at pci?		# Myson MTD803 3-in-1 Ethernet
ne*		at pci?		# NE2000-compatible Ethernet
ne*		at pcmcia?
ti*		at pci?		# Alteon ACEnic gigabit Ethernet
stge*		at pci?		# Sundance TC9021 GigE
vr*		at pci?		# VIA Rhine Fast Ethernet
xl*		at pci?		# 3C9xx ethernet
xl*		at cardbus?
re*		at pci?		# Realtek 8169/8169S/8110S
re*		at cardbus?
rl*		at pci?		# Realtek 81[23]9 ethernet
rl*		at cardbus?
hme*		at pci?		# Sun Happy Meal
gem*		at pci?		# Sun 'gem' ethernet
cas*		at pci?		# Sun Cassini 100/Gigabit
skc*		at pci?		# SysKonnect GEnesis 984x
sk*		at skc?		#  each port of above
mskc*		at pci?		# Marvell Yukon-2
msk*		at mskc?	#  each port of above
bge*		at pci?		# Broadcom BCM570x (aka Tigon3)
vge*		at pci?		# VIA VT612x
bnx*		at pci?		# Broadcom BCM5706/5708 GigE
sis*		at pci?		# SiS 900/7016 ethernet

##### Media Independent Interface (mii) drivers
exphy*		at mii?		# 3Com internal PHYs
inphy*		at mii?		# Intel 82555 PHYs
iophy*		at mii?		# Intel 82553 PHYs
icsphy*		at mii?		# ICS 1890 PHYs
lxtphy*		at mii?		# Level1 LXT970 PHYs
nsphy*		at mii?		# NS and compatible PHYs
nsphyter*	at mii?		# NS and compatible PHYs
qsphy*		at mii?		# Quality Semi QS6612 PHYs
sqphy*		at mii?		# Seeq 8x220 PHYs
luphy*		at mii?		# Lucent LU6612 PHY
rlphy*		at mii?		# Realtek 8139 internal PHYs
mtdphy*		at mii?		# Myson MTD972 PHYs
dcphy*		at mii?		# Digital Clone PHYs
acphy*		at mii?		# Altima AC101 PHYs
amphy*		at mii?		# AMD 79C873 PHYs
tqphy*		at mii?		# TDK 78Q212x PHYs
bmtphy*		at mii?		# Broadcom 10/100 PHYs
brgphy*		at mii?		# Broadcom Gigabit PHYs
ciphy*		at mii?		# Cicada CS8201 10/100/1000 copper PHY
eephy*		at mii?		# Marvell 88E1000 series PHY
xmphy*		at mii?		# XaQti XMAC-II PHYs
nsgphy*		at mii?		# NS gigabit PHYs
urlphy*		at mii?		# Realtek RTL8150L internal PHY
rgephy*		at mii?		# Realtek 8169S/8110S PHY
ipgphy*		at mii?		# IC Plus IP1000A PHYs
gentbi*		at mii?		# Generic 1000BASE-X ten-bit PHY
ukphy*		at mii?		# "unknown" PHYs

#### Wireless
acx*		at pci?		# TI ACX100/ACX111 (802.11b/g)
acx*		at cardbus?
malo*		at pci?
wi*		at pci?		# WaveLAN IEEE 802.11DS
wi*		at pcmcia?

#### Audio
cmpci*		at pci?		# C-Media CMI8338/8738
eap*		at pci?		# Ensoniq AudioPCI S5016
emu*		at pci?		# SB Live!
envy*		at pci?		# VIA Envy24 (aka ICE1712)

audio*		at cmpci?
audio*		at eap?
audio*		at emu?
audio*		at envy?
audio*		at mavb?

# MIDI support
midi*		at eap?

#### WS Console
wsdisplay*	at gbe?

#### Keyboard and Mouse
pckbd*		at mkbc?
pms*		at mkbc?
wskbd*		at pckbd? mux 1
wsmouse*	at pms? mux 0

#### SCSI Bus devices
scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?
ch*		at scsibus?
safte*		at scsibus?
ses*		at scsibus?
uk*		at scsibus?

#### Crypto devices
hifn*		at pci?		# Hifn7751/7811/7951
ubsec*		at pci?		# Broadcom 58xx

# PCI "universal" communication device
puc*		at pci?
com*		at puc?
#lpt*		at puc?

com*		at pcmcia?
com*		at cardbus?

pseudo-device	hotplug	1	# devices hot plugging
pseudo-device	wsmux	2       # Mouse and keyboard multiplexor


code:
#	$OpenBSD: Makefile.sgi,v 1.69 2015/01/13 01:12:50 deraadt Exp $

# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
#
# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
# DEBUG is set to -g by config if debugging is requested (config -g).
# PROF is set to -pg by config if profiling is requested (config -p).

.include <bsd.own.mk>

SIZE?=	size
STRIP?=	strip
AS?=	as
CC?=	cc
LD?=	ld ${ENDIAN}

AS+=${ENDIAN}
CC+=${ENDIAN}
LD+=${ENDIAN}

# source tree is located via $S relative to the compilation directory
.ifndef S
S!=	cd ../../../..; pwd
.endif

_machdir?=	$S/arch/${_mach}
_archdir?=	$S/arch/${_arch}

INCLUDES=	-nostdinc -I$S -I. -I$S/arch
CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP
CWARNFLAGS=	-Werror -Wall -Wimplicit-function-declaration \
		-Wno-main -Wno-uninitialized \
		-Wframe-larger-than=2047

CMACHFLAGS=	-mno-abicalls ${ABI} -msoft-float -G 0
CMACHFLAGS+=	-fno-builtin-printf -fno-builtin-snprintf \
		-fno-builtin-vsnprintf -fno-builtin-log \
		-fno-builtin-log2 -fno-builtin-malloc ${NOPIE_FLAGS}
.if ${IDENT:M-DNO_PROPOLICE}
CMACHFLAGS+=	-fno-stack-protector
.endif

COPTS?=		-O2
CFLAGS=		${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS=		-D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LDSCRIPT=	${_machdir}/conf/ld.script
LINKFLAGS=	-e start -T ${LDSCRIPT} -Ttext=${LINK_ADDRESS} --warn-common -nopie

.if ${IDENT:M-DDDB_STRUCT}
DB_STRUCTINFO=	db_structinfo.h
.else
DB_STRUCTINFO=
.endif

HOSTCC?=	${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS=	${CFLAGS}
HOSTED_C=	${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<

NORMAL_C_NOP=	${CC} ${CFLAGS} ${CPPFLAGS} -c $<
NORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<

%OBJS

%CFILES

%SFILES

# load lines for config "xxx" will be emitted as:
# xxx: ${SYSTEM_DEP} swapxxx.o
#	${SYSTEM_LD_HEAD}
#	${SYSTEM_LD} swapxxx.o
#	${SYSTEM_LD_TAIL}
SYSTEM_HEAD=	locore.o param.o ioconf.o
SYSTEM_OBJ=	${SYSTEM_HEAD} ${OBJS}
SYSTEM_DEP=	Makefile ${SYSTEM_OBJ} ${LDSCRIPT}
SYSTEM_LD_HEAD=	@rm -f $@
SYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \
		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS}
SYSTEM_LD_TAIL=	@${SIZE} $@; chmod 755 $@

DEBUG?=
.if ${DEBUG} == "-g"
LINKFLAGS+=	-X
STRIPFLAGS=	-g -x
SYSTEM_LD_TAIL+=; \
		echo mv $@ $@.gdb; rm -f $@.gdb; mv $@ $@.gdb; \
		echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
		${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
.else
LINKFLAGS+=	-x
.endif

%LOAD

# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up.  It also
# puts the file in /tmp, so we use -MF to put it in the current
# directory as assym.P and then generate assym.d from it with a
# good target name
assym.h: $S/kern/genassym.sh Makefile \
	 ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf
	cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \
	    sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp
	sed '1s/.*/assym.h: \\/' assym.P > assym.d
	sort -u assym.h.tmp > assym.h

param.c: $S/conf/param.c
	rm -f param.c
	cp $S/conf/param.c .

param.o: param.c Makefile
	${NORMAL_C}

mcount.o: $S/lib/libkern/mcount.c Makefile
	${NORMAL_C_NOP}

ioconf.o: ioconf.c
	${NORMAL_C}

vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
	sh $S/conf/newvers.sh
	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c

clean::
	rm -f eddep *bsd *bsd.gdb tags *.[dio] [a-z]*.s \
	    [Ee]rrs linterrs assym.h ${DB_STRUCTINFO}

lint:
	@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
	    ${CFILES} ioconf.c param.c | \
	    grep -v 'static function .* unused'

symbols.sort: ${_machdir}/${_mach}/symbols.raw
	grep -v '^#' ${_machdir}/${_mach}/symbols.raw \
	    | sed 's/^	//' | sort -u > symbols.sort

depend:
	@touch $@

tags:
	@echo "see $S/kern/Makefile for tags"

db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
	${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
	objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
	rm -f db_structinfo.o

locore.o: ${_machdir}/${_mach}/locore.S assym.h
context.o cp0access.o exception.o exception_tfp.o: assym.h
lcore_access.o lcore_ddb.o lcore_float.o tlb_tfp.o tlbhandler.o: assym.h
cache_tfp_subr.o ip30_nmi.o: assym.h

# The install target can be redefined by putting a
# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
MACHINE_NAME!=  uname -n
install: install-kernel-${MACHINE_NAME}
.if !target(install-kernel-${MACHINE_NAME}})
install-kernel-${MACHINE_NAME}:
	cmp -s bsd /bsd || ln -f /bsd /obsd
	cp bsd /nbsd
	mv /nbsd /bsd
.endif

# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
 ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
.endif
.ifnmake clean
. for o in ${SYSTEM_OBJ} assym.h ${DB_STRUCTINFO}
.  if exists(${o:R}.d)
.   include "${o:R}.d"
.  elif exists($o)
    .PHONY: $o
.  endif
. endfor
.endif

%RULES


code:
#	$OpenBSD: RAMDISK-IP22,v 1.14 2015/07/17 22:52:29 tedu Exp $
#
# THIS KERNEL IS FOR INDIGO (IP20), INDY (IP22) AND INDIGO2 (IP24) SYSTEMS ONLY.

machine		sgi mips64
maxusers	4

option		TIMEZONE=0
option		DST=0
option		SMALL_KERNEL
option		NO_PROPOLICE
option		BOOT_CONFIG

option		MINIROOTSIZE=10240
option		RAMDISK_HOOKS

option		EISAVERBOSE
option		PCIVERBOSE

option		FFS
option		CD9660
option		NFSCLIENT
option		INET6

makeoption	LINK_ADDRESS="0xffffffff88800000"
# Force use of 16KB pages. The R5000 Indy, which has the infamous XKPHYS
# coherency bug wrt ll/sc instructions, can not have more than 256MB of
# physical memory, all of it fitting within CKSEG0.
option		PAGE_SHIFT="14"
option		TGT_INDIGO		# R4x00 Indigo (IP20)
option		TGT_INDIGO2		# Indigo2, Challenge M (IP22)
option		TGT_INDY		# Indy, Challenge S (IP24)
option		ARCBIOS			# mandatory
option		CPU_R4000		# R4000/R4400 support (IP20/IP22/IP24)
option		CPU_R4600		# R4600 support (IP22/IP24)
option		CPU_R5000		# R5000 support (IP24)

config		bsd root on rd0a swap on rd0b

mainbus0	at root
cpu*		at mainbus0
clock0		at mainbus0		# scheduling clock on Indy

int0		at mainbus0		# Interrupt Controller and scheduling clock
imc0		at mainbus0		# Memory Controller
gio0		at imc0
eisa0		at imc0

hpc0		at gio? addr 0x1fb80000
hpc1		at gio? addr 0x1fb00000
hpc2		at gio? addr 0x1f980000

dpclock0	at hpc0			# IP20
dsclock0	at hpc0			# IP22/24
sq*		at hpc?			# On-board Ethernet or E++ adapter
wdsc*		at hpc?			# On-board SCSI or GIO32 SCSI adapter
pckbc*		at hpc0			# Indy/Indigo2 keyboard and mouse

zs0		at hpc0
zs1		at hpc0
zstty*		at zs0			# Serial ports
zskbd*		at zs1 channel 0
wskbd*		at zskbd? mux 1

pckbd*		at pckbc?
wskbd*		at pckbd? mux 1

grtwo*		at gio?			# Express (GR2/GR3) graphics
wsdisplay*	at grtwo?
impact*		at gio?			# Impact graphics
wsdisplay*	at impact?
light*		at gio?			# Light/Starter/Entry (LG1/LG2) graphics
wsdisplay*	at light?
newport*	at gio?			# Indy Newport and Indigo2 XL graphics
wsdisplay*	at newport?

giopci*		at gio?
pci*		at giopci?

scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?

pseudo-device	loop 1
pseudo-device	bpfilter 1
pseudo-device	rd 1
pseudo-device	bio 1


code:
#	$OpenBSD: RAMDISK-IP26,v 1.3 2015/07/17 22:52:29 tedu Exp $
#
# THIS KERNEL IS FOR POWER INDIGO2 R8000 (IP26) SYSTEMS ONLY.

machine		sgi mips64
maxusers	4

option		TIMEZONE=0
option		DST=0
option		SMALL_KERNEL
option		NO_PROPOLICE
option		BOOT_CONFIG

option		MINIROOTSIZE=10240
option		RAMDISK_HOOKS

option		EISAVERBOSE
option		PCIVERBOSE

option		FFS
option		CD9660
option		NFSCLIENT
option		INET6

makeoption	LINK_ADDRESS="0xa800000008010000"
option		TGT_INDIGO2		# Indigo2
option		ARCBIOS			# mandatory
option		CPU_R8000		# R8000 support

config		bsd root on rd0a swap on rd0b

mainbus0	at root
cpu*		at mainbus0

tcc0		at mainbus0		# Streaming Cache Controller
int0		at mainbus0		# Interrupt Controller and scheduling clock
imc0		at mainbus0		# Memory Controller
gio0		at imc0
eisa0		at imc0

hpc0		at gio? addr 0x1fb80000

dsclock0	at hpc0
sq*		at hpc?			# On-board Ethernet
wdsc*		at hpc?			# On-board SCSI
pckbc*		at hpc0			# keyboard and mouse

zs0		at hpc0
zstty*		at zs0			# Serial ports

pckbd*		at pckbc?
wskbd*		at pckbd? mux 1

grtwo*		at gio?			# Express (GR2/GR3) graphics
wsdisplay*	at grtwo?
newport*	at gio?			# XL graphics
wsdisplay*	at newport?

giopci*		at gio?
pci*		at giopci?

scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?

pseudo-device	loop 1
pseudo-device	bpfilter 1
pseudo-device	rd 1
pseudo-device	bio 1


code:
#	$OpenBSD: RAMDISK-IP27,v 1.37 2015/07/17 22:52:29 tedu Exp $
#
# THIS KERNEL IS FOR Origin, Onyx, Fuel, Tezro (IP27, IP35) SYSTEMS ONLY.

machine		sgi mips64
maxusers	4

option		TIMEZONE=0
option		DST=0
option		SMALL_KERNEL
option		NO_PROPOLICE
option		BOOT_CONFIG

option		MINIROOTSIZE=10240
option		RAMDISK_HOOKS

option		PCIVERBOSE
option		USBVERBOSE
option		ONEWIREVERBOSE

option		FFS
option		CD9660
option		NFSCLIENT
option		INET6

makeoption	LINK_ADDRESS="0xa800000000040000"
option		TGT_ORIGIN		# IP27/IP35
option		TGT_COHERENT
option		ARCBIOS
option		CPU_R10000		# R10000/R12000/R14000/R16000 support
option		MIPS_PTE64

config		bsd root on rd0a swap on rd0b

mainbus0	at root
cpu*		at mainbus0
clock0		at mainbus0

xbow*		at mainbus0
xbridge*	at xbow?
xbpci*		at xbridge?
pci*		at xbpci?
impact*		at xbow?
wsdisplay*	at impact?
odyssey*	at xbow?
wsdisplay*	at odyssey?

ioc*		at pci?
com0		at ioc? base 0x00020178
com1		at ioc? base 0x00020170
dsrtc0		at ioc?
iec*		at ioc?
iockbc*		at ioc?

onewire*	at ioc?
owmac*		at onewire?
owserial*	at onewire?

iof*		at pci?
com0		at iof? base 0x380
com1		at iof? base 0x388
com2		at iof? base 0x390
com3		at iof? base 0x398
com*		at iof?
dsrtc0		at iof?
iockbc*		at iof?

ahc*		at pci?
qlw*		at pci?
qla*		at pci?
qle*		at pci?
mpi*		at pci?
siop*		at pci?

ohci*		at pci?
uhci*		at pci?
ehci*		at pci?
usb*		at ohci?
usb*		at uhci?
usb*		at ehci?

uhub*		at usb?
uhub*		at uhub?
umodem*		at uhub?		# USB Modems/Serial
ucom*		at umodem?
uvscom*		at uhub?		# SUNTAC Slipper U VS-10U serial
ucom*		at uvscom?
ubsa*		at uhub?		# Belkin serial adapter
ucom*		at ubsa?
umass*		at uhub?
uhidev*		at uhub?		# Human Interface Devices
ukbd*		at uhidev?		# USB keyboard
wskbd*		at ukbd? mux 1
uhid*		at uhidev?		# USB generic HID support
atu*		at uhub?		# Atmel AT76c50x based 802.11b
aue*		at uhub?		# ADMtek AN986 Pegasus Ethernet
axe*		at uhub?		# ASIX Electronics AX88172 USB Ethernet
axen*		at uhub?		# ASIX Electronics AX88179 USB Ethernet
cdce*		at uhub?		# CDC Ethernet
cue*		at uhub?		# CATC USB-EL1201A based Ethernet
kue*		at uhub?		# Kawasaki KL5KUSB101B based Ethernet
mos*		at uhub?		# MOSCHIP MCS7730/7830 10/100 Ethernet
otus*		at uhub?		# Atheros AR9001U
rum*		at uhub?		# Ralink RT2501USB/RT2601USB
run*		at uhub?		# Ralink RT2700U/RT2800U/RT3000U
smsc*		at uhub?		# SMSC LAN95xx Ethernet
uath*		at uhub?		# Atheros AR5005UG/AR5005UX
udav*		at uhub?		# Davicom DM9601 based Ethernet
upgt*		at uhub?		# Conexant/Intersil PrismGT SoftMAC USB
upl*		at uhub?		# Prolific PL2301/PL2302 host-to-host
ugl*		at uhub?		# Genesys Logic GL620USB-A host-to-host
ural*		at uhub?		# Ralink RT2500USB
url*		at uhub?		# Realtek RTL8150L based adapters
urtw*		at uhub?		# Realtek 8187
wi*		at uhub?		# WaveLAN IEEE 802.11DS
zyd*		at uhub?		# Zydas ZD1211
ugen*		at uhub?		# USB Generic driver

ppb*		at pci?			# PCI-PCI bridges
pci*		at ppb?

pcn*		at pci?			# AMD PCnet-PCI Ethernet
epic*		at pci?			# SMC EPIC/100 ethernet
de*		at pci?			# DC21X4X-based ethernet
dc*		at pci?			# 21143, "tulip" clone ethernet
sf*		at pci?			# Adaptec AIC-6915 ethernet
em*		at pci?			# Intel Pro/1000 ethernet
ep*		at pci?			# 3Com 3c59x
fxp*		at pci?			# EtherExpress 10/100B ethernet
mtd*		at pci?			# Myson MTD803 3-in-1 Ethernet
ne*		at pci?			# NE2000-compatible Ethernet
ti*		at pci?			# Alteon ACEnic gigabit Ethernet
stge*		at pci?			# Sundance TC9021 GigE
vr*		at pci?			# VIA Rhine Fast Ethernet
xl*		at pci?			# 3C9xx ethernet
re*		at pci?			# Realtek 8169/8169S/8110S
rl*		at pci?			# Realtek 81[23]9 ethernet
hme*		at pci?			# Sun Happy Meal
gem*		at pci?			# Sun 'gem' ethernet
cas*		at pci?			# Sun Cassini 100/Gigabit
skc*		at pci?			# SysKonnect GEnesis 984x
sk*		at skc?			#  each port of above
mskc*		at pci?			# Marvell Yukon-2
msk*		at mskc?		#  each port of above
bge*		at pci?			# Broadcom BCM570x (aka Tigon3)
vge*		at pci?			# VIA VT612x
bnx*		at pci?			# Broadcom BCM5706/5708 GigE
sis*		at pci?			# SiS 900/7016 ethernet

exphy*		at mii?			# 3Com internal PHYs
inphy*		at mii?			# Intel 82555 PHYs
iophy*		at mii?			# Intel 82553 PHYs
icsphy*		at mii?			# ICS 1890 PHYs
lxtphy*		at mii?			# Level1 LXT970 PHYs
nsphy*		at mii?			# NS and compatible PHYs
nsphyter*	at mii?			# NS and compatible PHYs
qsphy*		at mii?			# Quality Semi QS6612 PHYs
sqphy*		at mii?			# Seeq 8x220 PHYs
luphy*		at mii?			# Lucent LU6612 PHY
rlphy*		at mii?			# Realtek 8139 internal PHYs
mtdphy*		at mii?			# Myson MTD972 PHYs
dcphy*		at mii?			# Digital Clone PHYs
acphy*		at mii?			# Altima AC101 PHYs
amphy*		at mii?			# AMD 79C873 PHYs
tqphy*		at mii?			# TDK 78Q212x PHYs
bmtphy*		at mii?			# Broadcom 10/100 PHYs
brgphy*		at mii?			# Broadcom Gigabit PHYs
ciphy*		at mii?			# Cicada CS8201 10/100/1000 copper PHY
eephy*		at mii?			# Marvell 88E1000 series PHY
xmphy*		at mii?			# XaQti XMAC-II PHYs
nsgphy*		at mii?			# NS gigabit PHYs
urlphy*		at mii?			# Realtek RTL8150L internal PHY
rgephy*		at mii?			# Realtek 8169S/8110S PHY
ipgphy*		at mii?			# IC Plus IP1000A PHYs
gentbi*		at mii?			# Generic 1000BASE-X ten-bit PHY
ukphy*		at mii?			# "unknown" PHYs

pckbd*		at iockbc?
wskbd*		at pckbd? mux 1

scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?

pseudo-device	loop 1
pseudo-device	bpfilter 1
pseudo-device	rd 1
pseudo-device	bio 1


code:
#	$OpenBSD: RAMDISK-IP28,v 1.5 2015/07/17 22:52:29 tedu Exp $
#
# THIS KERNEL IS FOR POWER INDIGO2 R10000 (IP28) SYSTEMS ONLY.

machine		sgi mips64
maxusers	4

option		TIMEZONE=0
option		DST=0
option		SMALL_KERNEL
option		NO_PROPOLICE
option		BOOT_CONFIG

option		MINIROOTSIZE=10240
option		RAMDISK_HOOKS

option		PCIVERBOSE
option		EISAVERBOSE

option		FFS
option		CD9660
option		NFSCLIENT
option		INET6

makeoption	LINK_ADDRESS="0xa800000020020000"
option		TGT_INDIGO2		# Indigo2
option		ARCBIOS			# mandatory
option		CPU_R10000		# R10000 support

config		bsd root on rd0a swap on rd0b

mainbus0	at root
cpu*		at mainbus0

int0		at mainbus0		# Interrupt Controller and scheduling clock
imc0		at mainbus0		# Memory Controller
gio0		at imc0
eisa0		at imc0

hpc0		at gio? addr 0x1fb80000

dsclock0	at hpc0
sq*		at hpc?			# On-board Ethernet
wdsc*		at hpc?			# On-board SCSI
pckbc*		at hpc0			# keyboard and mouse

zs0		at hpc0
zstty*		at zs0			# Serial ports

pckbd*		at pckbc?
wskbd*		at pckbd? mux 1

grtwo*		at gio?			# Express (GR2/GR3) graphics
wsdisplay*	at grtwo?
impact*		at gio?			# Impact graphics
wsdisplay*	at impact?
newport*	at gio?			# XL graphics
wsdisplay*	at newport?

giopci*		at gio?
pci*		at giopci?

scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?

pseudo-device	loop 1
pseudo-device	bpfilter 1
pseudo-device	rd 1
pseudo-device	bio 1


code:
#	$OpenBSD: RAMDISK-IP30,v 1.32 2015/07/17 22:52:29 tedu Exp $
#
# THIS KERNEL IS FOR Octane and Octane 2 (IP30) SYSTEMS ONLY.

machine		sgi mips64
maxusers	4

option		TIMEZONE=0
option		DST=0
option		SMALL_KERNEL
option		NO_PROPOLICE
option		BOOT_CONFIG

option		MINIROOTSIZE=10240
option		RAMDISK_HOOKS

option		PCIVERBOSE
option		USBVERBOSE
option		ONEWIREVERBOSE

option		FFS
option		CD9660
option		NFSCLIENT
option		INET6

makeoption	LINK_ADDRESS="0xa800000020020000"

option		TGT_OCTANE		# Octane, Octane 2
option		TGT_COHERENT
option		ARCBIOS
option		CPU_R10000		# R10000/R12000/R14000/R16000 support

config		bsd root on rd0a swap on rd0b

mainbus0	at root
cpu*		at mainbus0
clock0		at mainbus0
xbow0		at mainbus0
xheart*		at xbow?
onewire*	at xheart?
xbridge*	at xbow?
xbpci*		at xbridge?
pci*		at xbpci?
impact*		at xbow?
wsdisplay*	at impact?
odyssey*	at xbow?
wsdisplay*	at odyssey?

ioc*		at pci?
com0		at ioc? base 0x00020178
com1		at ioc? base 0x00020170
com*		at ioc?
dsrtc0		at ioc?
iec*		at ioc?
iockbc*		at ioc?

onewire*	at ioc?
owmac*		at onewire?
owserial*	at onewire?

ahc*		at pci?
qlw*		at pci?
qla*		at pci?
qle*		at pci?
mpi*		at pci?
siop*		at pci?

ohci*		at pci?
uhci*		at pci?
ehci*		at pci?
usb*		at ohci?
usb*		at uhci?
usb*		at ehci?

uhub*		at usb?
uhub*		at uhub?
umodem*		at uhub?		# USB Modems/Serial
ucom*		at umodem?
uvscom*		at uhub?		# SUNTAC Slipper U VS-10U serial
ucom*		at uvscom?
ubsa*		at uhub?		# Belkin serial adapter
ucom*		at ubsa?
umass*		at uhub?
uhidev*		at uhub?		# Human Interface Devices
ukbd*		at uhidev?		# USB keyboard
wskbd*		at ukbd? mux 1
uhid*		at uhidev?		# USB generic HID support
atu*		at uhub?		# Atmel AT76c50x based 802.11b
aue*		at uhub?		# ADMtek AN986 Pegasus Ethernet
axe*		at uhub?		# ASIX Electronics AX88172 USB Ethernet
axen*		at uhub?		# ASIX Electronics AX88179 USB Ethernet
cdce*		at uhub?		# CDC Ethernet
cue*		at uhub?		# CATC USB-EL1201A based Ethernet
kue*		at uhub?		# Kawasaki KL5KUSB101B based Ethernet
mos*		at uhub?		# MOSCHIP MCS7730/7830 10/100 Ethernet
otus*		at uhub?		# Atheros AR9001U
rum*		at uhub?		# Ralink RT2501USB/RT2601USB
run*		at uhub?		# Ralink RT2700U/RT2800U/RT3000U
smsc*		at uhub?		# SMSC LAN95xx Ethernet
uath*		at uhub?		# Atheros AR5005UG/AR5005UX
udav*		at uhub?		# Davicom DM9601 based Ethernet
upgt*		at uhub?		# Conexant/Intersil PrismGT SoftMAC USB
upl*		at uhub?		# Prolific PL2301/PL2302 host-to-host
ugl*		at uhub?		# Genesys Logic GL620USB-A host-to-host
ural*		at uhub?		# Ralink RT2500USB
url*		at uhub?		# Realtek RTL8150L based adapters
urtw*		at uhub?		# Realtek 8187
wi*		at uhub?		# WaveLAN IEEE 802.11DS
zyd*		at uhub?		# Zydas ZD1211
ugen*		at uhub?		# USB Generic driver

ppb*		at pci?			# PCI-PCI bridges
pci*		at ppb?

pcn*		at pci?			# AMD PCnet-PCI Ethernet
epic*		at pci?			# SMC EPIC/100 ethernet
de*		at pci?			# DC21X4X-based ethernet
dc*		at pci?			# 21143, "tulip" clone ethernet
sf*		at pci?			# Adaptec AIC-6915 ethernet
em*		at pci?			# Intel Pro/1000 ethernet
ep*		at pci?			# 3Com 3c59x
fxp*		at pci?			# EtherExpress 10/100B ethernet
mtd*		at pci?			# Myson MTD803 3-in-1 Ethernet
ne*		at pci?			# NE2000-compatible Ethernet
ti*		at pci?			# Alteon ACEnic gigabit Ethernet
stge*		at pci?			# Sundance TC9021 GigE
vr*		at pci?			# VIA Rhine Fast Ethernet
xl*		at pci?			# 3C9xx ethernet
re*		at pci?			# Realtek 8169/8169S/8110S
rl*		at pci?			# Realtek 81[23]9 ethernet
hme*		at pci?			# Sun Happy Meal
gem*		at pci?			# Sun 'gem' ethernet
cas*		at pci?			# Sun Cassini 100/Gigabit
skc*		at pci?			# SysKonnect GEnesis 984x
sk*		at skc?			#  each port of above
mskc*		at pci?			# Marvell Yukon-2
msk*		at mskc?		#  each port of above
bge*		at pci?			# Broadcom BCM570x (aka Tigon3)
vge*		at pci?			# VIA VT612x
bnx*		at pci?			# Broadcom BCM5706/5708 GigE
sis*		at pci?			# SiS 900/7016 ethernet

exphy*		at mii?			# 3Com internal PHYs
inphy*		at mii?			# Intel 82555 PHYs
iophy*		at mii?			# Intel 82553 PHYs
icsphy*		at mii?			# ICS 1890 PHYs
lxtphy*		at mii?			# Level1 LXT970 PHYs
nsphy*		at mii?			# NS and compatible PHYs
nsphyter*	at mii?			# NS and compatible PHYs
qsphy*		at mii?			# Quality Semi QS6612 PHYs
sqphy*		at mii?			# Seeq 8x220 PHYs
luphy*		at mii?			# Lucent LU6612 PHY
rlphy*		at mii?			# Realtek 8139 internal PHYs
mtdphy*		at mii?			# Myson MTD972 PHYs
dcphy*		at mii?			# Digital Clone PHYs
acphy*		at mii?			# Altima AC101 PHYs
amphy*		at mii?			# AMD 79C873 PHYs
tqphy*		at mii?			# TDK 78Q212x PHYs
bmtphy*		at mii?			# Broadcom 10/100 PHYs
brgphy*		at mii?			# Broadcom Gigabit PHYs
ciphy*		at mii?			# Cicada CS8201 10/100/1000 copper PHY
eephy*		at mii?			# Marvell 88E1000 series PHY
xmphy*		at mii?			# XaQti XMAC-II PHYs
nsgphy*		at mii?			# NS gigabit PHYs
urlphy*		at mii?			# Realtek RTL8150L internal PHY
rgephy*		at mii?			# Realtek 8169S/8110S PHY
ipgphy*		at mii?			# IC Plus IP1000A PHYs
gentbi*		at mii?			# Generic 1000BASE-X ten-bit PHY
ukphy*		at mii?			# "unknown" PHYs

pckbd*		at iockbc?
wskbd*		at pckbd? mux 1

scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?

pseudo-device	loop 1
pseudo-device	bpfilter 1
pseudo-device	rd 1
pseudo-device	bio 1


code:
#	$OpenBSD: RAMDISK-IP32,v 1.28 2015/07/17 22:52:29 tedu Exp $
#
# THIS KERNEL IS FOR O2 (IP32) SYSTEMS ONLY.

machine		sgi mips64
maxusers	4

option		TIMEZONE=0
option		DST=0
option		SMALL_KERNEL
option		NO_PROPOLICE
option		BOOT_CONFIG

option		MINIROOTSIZE=10240
option		RAMDISK_HOOKS

makeoption	LINK_ADDRESS="0xffffffff80100000"

option		PCIVERBOSE
option		USBVERBOSE

option		CD9660
option		FFS
option		FFS2
option		NFSCLIENT
option		INET6

option		TGT_O2			# O2, O2+
option		ARCBIOS
option		CPU_R5000		# R5000/RM5200 support
option		CPU_RM7000		# RM7000 support
option		CPU_R10000		# R10000/R12000/R14000/R16000 support

config		bsd root on rd0a swap on rd0b

mainbus0	at root
cpu*		at mainbus0
clock0		at mainbus0
macebus0	at mainbus0		# MACE controller localbus.
gbe0		at mainbus0		# GBE Framebuffer
mec0		at macebus0
mkbc0		at macebus0
com0		at macebus0 base 0x00390000
com1		at macebus0 base 0x00398000
dsrtc0		at macebus0
macepcibr0	at macebus0		# MACE controller PCI Bus bridge.
pci*		at macepcibr?		# PCI is on pci bridge

ahc*		at pci?
qlw*		at pci?
qla*		at pci?
qle*		at pci?
mpi*		at pci?
siop*		at pci?

ohci*		at pci?
uhci*		at pci?
ehci*		at pci?
usb*		at ohci?
usb*		at uhci?
usb*		at ehci?

uhub*		at usb?
uhub*		at uhub?
umodem*		at uhub?		# USB Modems/Serial
ucom*		at umodem?
uvscom*		at uhub?		# SUNTAC Slipper U VS-10U serial
ucom*		at uvscom?
ubsa*		at uhub?		# Belkin serial adapter
ucom*		at ubsa?
umass*		at uhub?
uhidev*		at uhub?		# Human Interface Devices
ukbd*		at uhidev?		# USB keyboard
wskbd*		at ukbd? mux 1
uhid*		at uhidev?		# USB generic HID support
atu*		at uhub?		# Atmel AT76c50x based 802.11b
aue*		at uhub?		# ADMtek AN986 Pegasus Ethernet
axe*		at uhub?		# ASIX Electronics AX88172 USB Ethernet
axen*		at uhub?		# ASIX Electronics AX88179 USB Ethernet
cdce*		at uhub?		# CDC Ethernet
cue*		at uhub?		# CATC USB-EL1201A based Ethernet
kue*		at uhub?		# Kawasaki KL5KUSB101B based Ethernet
mos*		at uhub?		# MOSCHIP MCS7730/7830 10/100 Ethernet
otus*		at uhub?		# Atheros AR9001U
rum*		at uhub?		# Ralink RT2501USB/RT2601USB
run*		at uhub?		# Ralink RT2700U/RT2800U/RT3000U
smsc*		at uhub?		# SMSC LAN95xx Ethernet
uath*		at uhub?		# Atheros AR5005UG/AR5005UX
udav*		at uhub?		# Davicom DM9601 based Ethernet
upgt*		at uhub?		# Conexant/Intersil PrismGT SoftMAC USB
upl*		at uhub?		# Prolific PL2301/PL2302 host-to-host
ugl*		at uhub?		# Genesys Logic GL620USB-A host-to-host
ural*		at uhub?		# Ralink RT2500USB
url*		at uhub?		# Realtek RTL8150L based adapters
urtw*		at uhub?		# Realtek 8187
wi*		at uhub?		# WaveLAN IEEE 802.11DS
zyd*		at uhub?		# Zydas ZD1211
ugen*		at uhub?		# USB Generic driver

ppb*		at pci?
pci*		at ppb?

pcn*		at pci?			# AMD PCnet-PCI Ethernet
epic*		at pci?			# SMC EPIC/100 ethernet
de*		at pci?			# DC21X4X-based ethernet
dc*		at pci?			# 21143, "tulip" clone ethernet
sf*		at pci?			# Adaptec AIC-6915 ethernet
em*		at pci?			# Intel Pro/1000 ethernet
ep*		at pci?			# 3Com 3c59x
fxp*		at pci?			# EtherExpress 10/100B ethernet
mtd*		at pci?			# Myson MTD803 3-in-1 Ethernet
ne*		at pci?			# NE2000-compatible Ethernet
ti*		at pci?			# Alteon ACEnic gigabit Ethernet
stge*		at pci?			# Sundance TC9021 GigE
vr*		at pci?			# VIA Rhine Fast Ethernet
xl*		at pci?			# 3C9xx ethernet
re*		at pci?			# Realtek 8169/8169S/8110S
rl*		at pci?			# Realtek 81[23]9 ethernet
hme*		at pci?			# Sun Happy Meal
gem*		at pci?			# Sun 'gem' ethernet
cas*		at pci?			# Sun Cassini 100/Gigabit
skc*		at pci?			# SysKonnect GEnesis 984x
sk*		at skc?			#  each port of above
mskc*		at pci?			# Marvell Yukon-2
msk*		at mskc?		#  each port of above
bge*		at pci?			# Broadcom BCM570x (aka Tigon3)
vge*		at pci?			# VIA VT612x
bnx*		at pci?			# Broadcom BCM5706/5708 GigE
sis*		at pci?			# SiS 900/7016 ethernet

exphy*		at mii?			# 3Com internal PHYs
inphy*		at mii?			# Intel 82555 PHYs
iophy*		at mii?			# Intel 82553 PHYs
icsphy*		at mii?			# ICS 1890 PHYs
lxtphy*		at mii?			# Level1 LXT970 PHYs
nsphy*		at mii?			# NS and compatible PHYs
nsphyter*	at mii?			# NS and compatible PHYs
qsphy*		at mii?			# Quality Semi QS6612 PHYs
sqphy*		at mii?			# Seeq 8x220 PHYs
luphy*		at mii?			# Lucent LU6612 PHY
rlphy*		at mii?			# Realtek 8139 internal PHYs
mtdphy*		at mii?			# Myson MTD972 PHYs
dcphy*		at mii?			# Digital Clone PHYs
acphy*		at mii?			# Altima AC101 PHYs
amphy*		at mii?			# AMD 79C873 PHYs
tqphy*		at mii?			# TDK 78Q212x PHYs
bmtphy*		at mii?			# Broadcom 10/100 PHYs
brgphy*		at mii?			# Broadcom Gigabit PHYs
ciphy*		at mii?			# Cicada CS8201 10/100/1000 copper PHY
eephy*		at mii?			# Marvell 88E1000 series PHY
xmphy*		at mii?			# XaQti XMAC-II PHYs
nsgphy*		at mii?			# NS gigabit PHYs
urlphy*		at mii?			# Realtek RTL8150L internal PHY
rgephy*		at mii?			# Realtek 8169S/8110S PHY
ipgphy*		at mii?			# IC Plus IP1000A PHYs
gentbi*		at mii?			# Generic 1000BASE-X ten-bit PHY
ukphy*		at mii?			# "unknown" PHYs

wsdisplay*	at gbe?
pckbd*		at mkbc?
wskbd*		at pckbd? console ?

scsibus*	at scsi?
sd*		at scsibus?
st*		at scsibus?
cd*		at scsibus?

pseudo-device	loop 1
pseudo-device	bpfilter 1
pseudo-device	rd 1
pseudo-device	bio 1


code:
#	$OpenBSD: files.sgi,v 1.53 2015/07/08 13:37:31 dlg Exp $
#
# maxpartitions must be first item in files.${ARCH}
#
maxpartitions 16

maxusers 2 8 64

#	Required files

file	dev/cninit.c
file	arch/sgi/sgi/autoconf.c
file	arch/sgi/sgi/bus_dma.c
file	arch/sgi/sgi/conf.c
file	arch/sgi/sgi/disksubr.c			disk
file	arch/sgi/sgi/lock_machdep.c		multiprocessor
file	arch/sgi/sgi/ip22_machdep.c		tgt_indigo | tgt_indigo2 |
						tgt_indy
file	arch/sgi/sgi/ip27_machdep.c		tgt_origin
file	arch/sgi/sgi/ip30_machdep.c		tgt_octane
file	arch/sgi/sgi/ip30_nmi.S			tgt_octane & ddb
file	arch/sgi/sgi/ip32_machdep.c		tgt_o2
file	arch/sgi/sgi/l1.c			tgt_origin
file	arch/sgi/sgi/machdep.c
file	arch/sgi/sgi/mainbus.c
file	arch/sgi/sgi/sginode.c			tgt_origin
file	arch/sgi/sgi/wscons_machdep.c		wsdisplay

# RAM disk for boot
major	{rd = 8}

#
# Media Indepedent Interface (mii)
#
include	"dev/mii/files.mii"

#
#	Machine-independent ATAPI drivers
#

include	"dev/atapiscsi/files.atapiscsi"
include	"dev/ata/files.ata"

include	"dev/pckbc/files.pckbc"

#
#	System BUS types
#
define	mainbus {[nasid = -1]}
device	mainbus
attach	mainbus at root

#	Our CPU configurator
device	cpu
attach	cpu at mainbus

#	Clock device
device	clock
attach	clock at mainbus

# Impact/ImpactSR common code
device	impact: wsemuldisplaydev, rasops32
file	arch/sgi/dev/impact.c			impact |
						impact_gio |
						impact_xbow	needs-flag

#
#	IP20/22/24/26/28 specific devices
#
define	giobus {}
device	imc: giobus, eisabus
attach	imc at mainbus
file	arch/sgi/localbus/imc.c			imc

device	int
attach	int at mainbus
file	arch/sgi/localbus/int.c			int

device	tcc
attach	tcc at mainbus
file	arch/sgi/localbus/tcc.c			tcc	needs-flag

include "arch/sgi/gio/files.gio"
include "arch/sgi/hpc/files.hpc"

#
#	O2 MACE localbus autoconfiguration devices
#
define	macebus {[base = -1]}
device	macebus
attach	macebus at mainbus
file	arch/sgi/localbus/macebus.c		macebus

#
#	Origin200/Origin2000 node configuration enumerator, and
#	Octane XBOW mux bridge
#
include "arch/sgi/xbow/files.xbow"

include "dev/onewire/files.onewire"

#
#	PCI Bus bridges
#

device	macepcibr {} : pcibus
attach	macepcibr at macebus
file	arch/sgi/pci/macepcibridge.c		macepcibr

#	Use machine independent SCSI driver routines
include	"scsi/files.scsi"
major	{sd = 0}
major	{cd = 3}

#
#	EISA Bus support
#

include	"dev/eisa/files.eisa"
file	arch/sgi/sgi/eisa_machdep.c		eisa

#
#	PCI Bus support
#

include	"dev/pci/files.pci"
file	arch/sgi/pci/pci_machdep.c		pci

# Sun HME Ethernet controllers
device	hme: ether, ifnet, mii, ifmedia
file	dev/ic/hme.c				hme
attach	hme at pci with hme_pci
file	dev/pci/if_hme_pci.c			hme_pci

# IOC3
define	ioc {[base = -1]}
device	ioc: onewirebus
attach	ioc at pci
file	arch/sgi/pci/ioc.c			ioc

# IOC4
define	iof {[base = -1]}
device	iof
attach	iof at pci
file	arch/sgi/pci/iof.c			iof

# IOC3/4 serial ports
attach	com at ioc with com_ioc
file	arch/sgi/dev/com_ioc.c			com_ioc
attach	com at iof with com_iof
file	arch/sgi/dev/com_iof.c			com_iof

# IOC3 onboard Ethernet
device	iec: ether, ifnet, ifmedia, mii
attach	iec at ioc
file	arch/sgi/dev/if_iec.c			iec

# IOC3/4 PS/2 controller
device	iockbc: pckbcslot
attach	iockbc at ioc with iockbc_ioc
attach	iockbc at iof with iockbc_iof
file	arch/sgi/dev/iockbc.c			iockbc |
						iockbc_ioc | iockbc_iof
							needs-flag

# DS1687 Time-Of-Day calendar device
device	dsrtc
attach	dsrtc at ioc with dsrtc_ioc
attach	dsrtc at iof with dsrtc_iof
attach	dsrtc at macebus with dsrtc_macebus
file	arch/sgi/dev/dsrtc.c			dsrtc

# GBE framebuffer
device	gbe: wsemuldisplaydev, rasops8, rasops16, rasops32
attach	gbe at mainbus
file	arch/sgi/dev/gbe.c			gbe	needs-flag

# 16[45]50-based "com" ports on localbus
attach	com at macebus with com_macebus
file	arch/sgi/localbus/com_lbus.c		com_macebus

# MACE MAC-110 ethernet
device	mec: ether, ifnet, ifmedia, mii
attach	mec at macebus
file	arch/sgi/dev/if_mec.c			mec

# Moosehead A/V Board audio
device	mavb: audio
attach	mavb at macebus
file	arch/sgi/dev/mavb.c			mavb

# MACE PS/2 Controller
device	mkbc: pckbcslot
attach	mkbc at macebus
file	arch/sgi/dev/mkbc.c			mkbc	needs-flag

# Power button
device	power
attach	power at macebus with power_macebus
attach	power at mainbus with power_mainbus
file 	arch/sgi/dev/power.c			power |
						power_macebus | power_mainbus
							needs-flag

# Raster operations
include	"dev/rasops/files.rasops"
include	"dev/wsfont/files.wsfont"

#
# wscons console
#
include	"dev/wscons/files.wscons"

#
# CardBus and PCMCIA bus support
#
include	"dev/cardbus/files.cardbus"
include	"dev/pcmcia/files.pcmcia"

#
# Machine-independent USB drivers
#
include	"dev/usb/files.usb"

#
# Number-In-a-Can containers
#
# Ethernet address
device	owmac
attach	owmac at onewire
file	arch/sgi/dev/owmac.c			owmac

# Serial numbers
device	owserial
attach	owserial at onewire
file	arch/sgi/dev/owserial.c			owserial
file	arch/sgi/dev/owmem_subr.c		owmac | owserial

# IP35 SPD memory information
attach	spdmem at mainbus with spdmem_mainbus
file	arch/sgi/dev/spdmem_mainbus.c		spdmem_mainbus


code:
OUTPUT_FORMAT("elf64-tradbigmips")
OUTPUT_ARCH(mips)
ENTRY(__start)

SECTIONS
{
	.text :		{ *(.text .text.* .gnu.linkonce.t.*) }
	PROVIDE (etext = .);
	.rodata :	{ *(.rodata .rodata.* .gnu.linkonce.r.*) }
	_gp = ALIGN(16) + 0x7ff0;
	.data :		{ *(.data .data.* .gnu.linkonce.d.*) }
	PROVIDE (edata = .);
	.sbss :		{ *(.sbss .sbss.* .gnu.linkonce.sb.* .scommon) }
	.bss :		{ *(.bss .bss.* .gnu.linkonce.b.* COMMON) }
	PROVIDE (_end = .);
	PROVIDE (end = .);
	/DISCARD/ :
	{
		*(.pdr)
		*(.mdebug.abi64)
		*(.MIPS.options)
	}
}


code: src/sys/arch/sgi/dev

path: sys/arch/sgi/dev/CVS/Repository


code:
/*	$OpenBSD: com_ioc.c,v 1.9 2012/10/03 22:46:09 miod Exp $ */

/*
 * Copyright (c) 2001-2004 Opsycon AB  (www.opsycon.se / www.opsycon.com)
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/tty.h>

#include <machine/autoconf.h>
#include <machine/bus.h>
#include <machine/intr.h>

#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
#include <dev/ic/ns16550reg.h>

#include <sgi/pci/iocvar.h>

int	com_ioc_probe(struct device *, void *, void *);
void	com_ioc_attach(struct device *, struct device *, void *);

struct cfattach com_ioc_ca = {
	sizeof(struct com_softc), com_ioc_probe, com_ioc_attach
};

extern struct cfdriver com_cd;

int
com_ioc_probe(struct device *parent, void *match, void *aux)
{
	struct cfdata *cf = match;
	struct ioc_attach_args *iaa = aux;
	bus_space_tag_t iot = iaa->iaa_memt;
	bus_space_handle_t ioh;
	int rv = 0, console = 0;

	if (strcmp(iaa->iaa_name, com_cd.cd_name) != 0)
		return 0;

	if (comconsiot != NULL)
		console = iaa->iaa_memh + iaa->iaa_base ==
		    comconsiot->bus_base + comconsaddr;

	/* if it's in use as console, it's there. */
	if (!(console && !comconsattached)) {
		if (bus_space_subregion(iot, iaa->iaa_memh,
		    iaa->iaa_base, COM_NPORTS, &ioh) == 0)
			rv = comprobe1(iot, ioh);
	} else
		rv = 1;

	/* make a config stanza with exact locators match over a generic line */
	if (cf->cf_loc[0] != -1)
		rv += rv;

	return rv;
}

void
com_ioc_attach(struct device *parent, struct device *self, void *aux)
{
	struct com_softc *sc = (void *)self;
	struct ioc_attach_args *iaa = aux;
	bus_space_handle_t ioh;
	int console = 0;

	if (comconsiot != NULL)
		console = iaa->iaa_memh + iaa->iaa_base ==
		    comconsiot->bus_base + comconsaddr;

	sc->sc_hwflags = 0;
	sc->sc_swflags = 0;
	sc->sc_frequency = 22000000 / 3;

	/* if it's in use as console, it's there. */
	if (!(console && !comconsattached)) {
		sc->sc_iot = iaa->iaa_memt;
		sc->sc_iobase = iaa->iaa_base;

		if (bus_space_subregion(iaa->iaa_memt, iaa->iaa_memh,
		    iaa->iaa_base, COM_NPORTS, &ioh) != 0) {
			printf(": can't map registers\n");
			return;
		}
	} else {
		/*
		 * If we are the console, reuse the existing bus_space
		 * information, so that comcnattach() invokes bus_space_map()
		 * with correct parameters.
		 */
		sc->sc_iot = comconsiot;
		sc->sc_iobase = comconsaddr;

		if (comcnattach(sc->sc_iot, sc->sc_iobase, comconsrate,
		    sc->sc_frequency, (TTYDEF_CFLAG & ~(CSIZE | PARENB)) | CS8))
			panic("can't setup serial console");
		ioh = comconsioh;
	}

	sc->sc_ioh = ioh;

	com_attach_subr(sc);

	ioc_intr_establish(parent, iaa->iaa_dev, IPL_TTY, comintr,
	    (void *)sc, sc->sc_dev.dv_xname);
}


code:
/*	$OpenBSD: com_iof.c,v 1.5 2009/10/16 00:15:46 miod Exp $	*/

/*
 * Copyright (c) 2001-2004 Opsycon AB  (www.opsycon.se / www.opsycon.com)
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/tty.h>

#include <machine/autoconf.h>
#include <machine/bus.h>

#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
#include <dev/ic/ns16550reg.h>

#include <sgi/pci/iofvar.h>

int	com_iof_probe(struct device *, void *, void *);
void	com_iof_attach(struct device *, struct device *, void *);

struct cfattach com_iof_ca = {
	sizeof(struct com_softc), com_iof_probe, com_iof_attach
};

extern struct cfdriver com_cd;

int
com_iof_probe(struct device *parent, void *match, void *aux)
{
	struct cfdata *cf = match;
	struct iof_attach_args *iaa = aux;
	bus_space_tag_t iot = iaa->iaa_memt;
	bus_space_handle_t ioh;
	int rv = 0, console;

	if (strcmp(iaa->iaa_name, com_cd.cd_name) != 0)
		return 0;

	console = iaa->iaa_memh + iaa->iaa_base ==
	    comconsiot->bus_base + comconsaddr;

	/* if it's in use as console, it's there. */
	if (!(console && !comconsattached)) {
		if (bus_space_subregion(iot, iaa->iaa_memh,
		    iaa->iaa_base, COM_NPORTS, &ioh) == 0)
			rv = comprobe1(iot, ioh);
	} else
		rv = 1;

	/* make a config stanza with exact locators match over a generic line */
	if (cf->cf_loc[0] != -1)
		rv += rv;

	return rv;
}

void
com_iof_attach(struct device *parent, struct device *self, void *aux)
{
	struct com_softc *sc = (void *)self;
	struct iof_attach_args *iaa = aux;
	bus_space_handle_t ioh;
	int console;

	console = iaa->iaa_memh + iaa->iaa_base ==
	    comconsiot->bus_base + comconsaddr;

	sc->sc_hwflags = 0;
	sc->sc_swflags = 0;
	sc->sc_frequency = iaa->iaa_clock;

	/* if it's in use as console, it's there. */
	if (!(console && !comconsattached)) {
		sc->sc_iot = iaa->iaa_memt;
		sc->sc_iobase = iaa->iaa_base;

		if (bus_space_subregion(iaa->iaa_memt, iaa->iaa_memh,
		    iaa->iaa_base, COM_NPORTS, &ioh) != 0) {
			printf(": can't map registers\n");
			return;
		}
	} else {
		/*
		 * If we are the console, reuse the existing bus_space
		 * information, so that comcnattach() invokes bus_space_map()
		 * with correct parameters.
		 */
		sc->sc_iot = comconsiot;
		sc->sc_iobase = comconsaddr;

		if (comcnattach(sc->sc_iot, sc->sc_iobase, comconsrate,
		    sc->sc_frequency, (TTYDEF_CFLAG & ~(CSIZE | PARENB)) | CS8))
			panic("can't setup serial console");
		ioh = comconsioh;
	}

	sc->sc_ioh = ioh;

	com_attach_subr(sc);

	iof_intr_establish(parent, iaa->iaa_dev, IPL_TTY, comintr,
	    (void *)sc, sc->sc_dev.dv_xname);
}


code:
/*	$OpenBSD: dsrtc.c,v 1.12 2012/03/28 20:44:23 miod Exp $ */

/*
 * Copyright (c) 2001-2004 Opsycon AB  (www.opsycon.se / www.opsycon.com)
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */

#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/device.h>

#include <machine/autoconf.h>
#include <machine/bus.h>

#include <dev/ic/ds1687reg.h>
#define	todr_chip_handle_t void *	/* XXX that's just to eat prototypes */
#include <dev/ic/mk48txxreg.h>

#include <mips64/archtype.h>
#include <mips64/dev/clockvar.h>

#include <sgi/dev/dsrtcvar.h>
#include <sgi/localbus/macebusvar.h>
#include <sgi/pci/iocreg.h>
#include <sgi/pci/iocvar.h>
#include <sgi/pci/iofvar.h>

struct	dsrtc_softc {
	struct device		sc_dev;
	bus_space_tag_t		sc_clkt;
	bus_space_handle_t	sc_clkh, sc_clkh2;
	int			sc_yrbase;

	int			(*read)(struct dsrtc_softc *, int);
	void			(*write)(struct dsrtc_softc *, int, int);
};

int	dsrtc_match(struct device *, void *, void *);
void	dsrtc_attach_ioc(struct device *, struct device *, void *);
void	dsrtc_attach_iof(struct device *, struct device *, void *);
void	dsrtc_attach_macebus(struct device *, struct device *, void *);

struct cfdriver dsrtc_cd = {
	NULL, "dsrtc", DV_DULL
};

struct cfattach dsrtc_macebus_ca = {
	sizeof(struct dsrtc_softc), dsrtc_match, dsrtc_attach_macebus
};

struct cfattach dsrtc_ioc_ca = {
	sizeof(struct dsrtc_softc), dsrtc_match, dsrtc_attach_ioc
};

struct cfattach dsrtc_iof_ca = {
	sizeof(struct dsrtc_softc), dsrtc_match, dsrtc_attach_ioc
};

int	ip32_dsrtc_read(struct dsrtc_softc *, int);
void	ip32_dsrtc_write(struct dsrtc_softc *, int, int);
int	ioc_ds1687_dsrtc_read(struct dsrtc_softc *, int);
void	ioc_ds1687_dsrtc_write(struct dsrtc_softc *, int, int);

void	ds1687_get(void *, time_t, struct tod_time *);
void	ds1687_set(void *, struct tod_time *);
void	ds1742_get(void *, time_t, struct tod_time *);
void	ds1742_set(void *, struct tod_time *);

static inline int frombcd(int, int);
static inline int tobcd(int, int);
static inline int
frombcd(int x, int binary)
{
	return binary ? x : (x >> 4) * 10 + (x & 0xf);
}
static inline int
tobcd(int x, int binary)
{
	return binary ? x : (x / 10 * 16) + (x % 10);
}

int
dsrtc_match(struct device *parent, void *match, void *aux)
{
	/*
	 * Depending on what dsrtc attaches to, the actual attach_args
	 * may be a different struct, but all of them start with the
	 * same name field.
	 */
	struct mainbus_attach_args *maa = aux;

	return strcmp(maa->maa_name, dsrtc_cd.cd_name) == 0;
}

void
dsrtc_attach_ioc(struct device *parent, struct device *self, void *aux)
{
	struct dsrtc_softc *sc = (void *)self;
	struct ioc_attach_args *iaa = aux;
	bus_space_handle_t ih, ih2;

	/*
	 * The IOC3 RTC is either a Dallas (now Maxim) DS1397 or compatible
	 * (likely a more recent DS1687), or a DS1747 or compatible
	 * (itself being a Mostek MK48T35 clone).
	 *
	 * Surprisingly, the chip found on Fuel has a DS1742W label,
	 * which has much less memory than the DS1747. I guess whatever
	 * the chip is, it is mapped to the end of the DS1747 address
	 * space, so that the clock registers always appear at the same
	 * addresses in memory.
	 */

	sc->sc_clkt = iaa->iaa_memt;

	if (iaa->iaa_base != IOC3_BYTEBUS_0) {
		/* DS1687 */

		if (bus_space_subregion(iaa->iaa_memt, iaa->iaa_memh,
		    IOC3_BYTEBUS_1, 1, &ih) != 0 ||
		    bus_space_subregion(iaa->iaa_memt, iaa->iaa_memh,
		    IOC3_BYTEBUS_2, 1, &ih2) != 0)
			goto fail;

		printf(": DS1687\n");

		sc->sc_clkh = ih;
		sc->sc_clkh2 = ih2;

		sc->read = ioc_ds1687_dsrtc_read;
		sc->write = ioc_ds1687_dsrtc_write;

		sys_tod.tod_get = ds1687_get;
		sys_tod.tod_set = ds1687_set;
	} else {
		/* DS1742W */

		bus_space_unmap(iaa->iaa_memt, ih, 1);
		bus_space_unmap(iaa->iaa_memt, ih2, 1);

		if (bus_space_subregion(iaa->iaa_memt, iaa->iaa_memh,
		    iaa->iaa_base + MK48T35_CLKOFF,
		    MK48T35_CLKSZ - MK48T35_CLKOFF, &ih) != 0)
			goto fail;

		printf(": DS1742W\n");

		sc->sc_clkh = ih;

		/*
		 * For some reason, the base year differs between IP27
		 * and IP35.
		 */
		sc->sc_yrbase = sys_config.system_type == SGI_IP35 ?
		    POSIX_BASE_YEAR - 2 : POSIX_BASE_YEAR;
		/* mips64 clock code expects year relative to 1900 */
		sc->sc_yrbase -= 1900;

		sys_tod.tod_get = ds1742_get;
		sys_tod.tod_set = ds1742_set;
	}
	sys_tod.tod_cookie = self;

	return;

fail:
	printf(": can't map registers\n");
}

void
dsrtc_attach_iof(struct device *parent, struct device *self, void *aux)
{
	struct dsrtc_softc *sc = (void *)self;
	struct iof_attach_args *iaa = aux;
	bus_space_handle_t ih;

	/*
	 * The IOC4 RTC is a DS1747 or compatible (itself being a Mostek
	 * MK48T35 clone).
	 */

	if (bus_space_subregion(iaa->iaa_memt, iaa->iaa_memh,
	    iaa->iaa_base + MK48T35_CLKOFF,
	    MK48T35_CLKSZ - MK48T35_CLKOFF, &ih) != 0)
		goto fail;

	printf(": DS1742W\n");

	sc->sc_clkh = ih;

	/*
	 * For some reason, the base year differs between IP27
	 * and IP35.
	 */
	sc->sc_yrbase = sys_config.system_type == SGI_IP35 ?
	    POSIX_BASE_YEAR - 2 : POSIX_BASE_YEAR;
	/* mips64 clock code expects year relative to 1900 */
	sc->sc_yrbase -= 1900;

	sys_tod.tod_cookie = self;
	sys_tod.tod_get = ds1742_get;
	sys_tod.tod_set = ds1742_set;

	return;

fail:
	printf(": can't map registers\n");
}

void
dsrtc_attach_macebus(struct device *parent, struct device *self, void *aux)
{
	struct dsrtc_softc *sc = (void *)self;
	struct macebus_attach_args *maa = aux;

	sc->sc_clkt = maa->maa_iot;
	if (bus_space_map(sc->sc_clkt, maa->maa_baseaddr, 128 * 256, 0,
	    &sc->sc_clkh)) {
		printf(": can't map registers\n");
		return;
	}

	printf(": DS1687\n");

	sc->read = ip32_dsrtc_read;
	sc->write = ip32_dsrtc_write;

	sys_tod.tod_cookie = self;
	sys_tod.tod_get = ds1687_get;
	sys_tod.tod_set = ds1687_set;
}

int
ip32_dsrtc_read(struct dsrtc_softc *sc, int reg)
{
	return bus_space_read_1(sc->sc_clkt, sc->sc_clkh, reg);
}

void
ip32_dsrtc_write(struct dsrtc_softc *sc, int reg, int val)
{
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, reg, val);
}

int
ioc_ds1687_dsrtc_read(struct dsrtc_softc *sc, int reg)
{
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, 0, reg);
	return bus_space_read_1(sc->sc_clkt, sc->sc_clkh2, 0);
}

void
ioc_ds1687_dsrtc_write(struct dsrtc_softc *sc, int reg, int val)
{
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, 0, reg);
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh2, 0, val);
}

/*
 * Dallas DS1687 clock driver.
 */

void
ds1687_get(void *v, time_t base, struct tod_time *ct)
{
	struct dsrtc_softc *sc = v;
	int ctrl, century, dm;

	/* Select bank 1. */
	ctrl = (*sc->read)(sc, DS1687_CTRL_A);
	(*sc->write)(sc, DS1687_CTRL_A, ctrl | DS1687_BANK_1);

	/* Figure out which data mode to use. */
	dm = (*sc->read)(sc, DS1687_CTRL_B) & DS1687_DM_1;

	/* Wait for no update in progress. */
	while ((*sc->read)(sc, DS1687_CTRL_A) & DS1687_UIP)
		/* Do nothing. */;

	/* Read the RTC. */
	ct->sec = frombcd((*sc->read)(sc, DS1687_SEC), dm);
	ct->min = frombcd((*sc->read)(sc, DS1687_MIN), dm);
	ct->hour = frombcd((*sc->read)(sc, DS1687_HOUR), dm);
	ct->day = frombcd((*sc->read)(sc, DS1687_DAY), dm);
	ct->mon = frombcd((*sc->read)(sc, DS1687_MONTH), dm);
	ct->year = frombcd((*sc->read)(sc, DS1687_YEAR), dm);
	century = frombcd((*sc->read)(sc, DS1687_CENTURY), dm);

	ct->year += 100 * (century - 19);
}

void
ds1687_set(void *v, struct tod_time *ct)
{
	struct dsrtc_softc *sc = v;
	int year, century, ctrl, dm;

	century = ct->year / 100 + 19;
	year = ct->year % 100;

	/* Select bank 1. */
	ctrl = (*sc->read)(sc, DS1687_CTRL_A);
	(*sc->write)(sc, DS1687_CTRL_A, ctrl | DS1687_BANK_1);

	/* Figure out which data mode to use, and select 24 hour time. */
	ctrl = (*sc->read)(sc, DS1687_CTRL_B);
	dm = ctrl & DS1687_DM_1;
	(*sc->write)(sc, DS1687_CTRL_B, ctrl | DS1687_24_HR);

	/* Prevent updates. */
	ctrl = (*sc->read)(sc, DS1687_CTRL_B);
	(*sc->write)(sc, DS1687_CTRL_B, ctrl | DS1687_SET_CLOCK);

	/* Update the RTC. */
	(*sc->write)(sc, DS1687_SEC, tobcd(ct->sec, dm));
	(*sc->write)(sc, DS1687_MIN, tobcd(ct->min, dm));
	(*sc->write)(sc, DS1687_HOUR, tobcd(ct->hour, dm));
	(*sc->write)(sc, DS1687_DOW, tobcd(ct->dow, dm));
	(*sc->write)(sc, DS1687_DAY, tobcd(ct->day, dm));
	(*sc->write)(sc, DS1687_MONTH, tobcd(ct->mon, dm));
	(*sc->write)(sc, DS1687_YEAR, tobcd(year, dm));
	(*sc->write)(sc, DS1687_CENTURY, tobcd(century, dm));

	/* Enable updates. */
	(*sc->write)(sc, DS1687_CTRL_B, ctrl);
}

/*
 * Dallas DS1742 clock driver.
 */

void
ds1742_get(void *v, time_t base, struct tod_time *ct)
{
	struct dsrtc_softc *sc = v;
	int csr;

	/* Freeze update. */
	csr = bus_space_read_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_ICSR);
	csr |= MK48TXX_CSR_READ;
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_ICSR, csr);

	/* Read the RTC. */
	ct->sec = frombcd(bus_space_read_1(sc->sc_clkt, sc->sc_clkh,
	    MK48TXX_ISEC), 0);
	ct->min = frombcd(bus_space_read_1(sc->sc_clkt, sc->sc_clkh,
	    MK48TXX_IMIN), 0);
	ct->hour = frombcd(bus_space_read_1(sc->sc_clkt, sc->sc_clkh,
	    MK48TXX_IHOUR), 0);
	ct->day = frombcd(bus_space_read_1(sc->sc_clkt, sc->sc_clkh,
	    MK48TXX_IDAY), 0);
	ct->mon = frombcd(bus_space_read_1(sc->sc_clkt, sc->sc_clkh,
	    MK48TXX_IMON), 0);
	ct->year = frombcd(bus_space_read_1(sc->sc_clkt, sc->sc_clkh,
	    MK48TXX_IYEAR), 0) + sc->sc_yrbase;

	/* Enable updates again. */
	csr = bus_space_read_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_ICSR);
	csr &= ~MK48TXX_CSR_READ;
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_ICSR, csr);
}

void
ds1742_set(void *v, struct tod_time *ct)
{
	struct dsrtc_softc *sc = v;
	int csr;

	/* Enable write. */
	csr = bus_space_read_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_ICSR);
	csr |= MK48TXX_CSR_WRITE;
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_ICSR, csr);

	/* Update the RTC. */
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_ISEC,
	    tobcd(ct->sec, 0));
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_IMIN,
	    tobcd(ct->min, 0));
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_IHOUR,
	    tobcd(ct->hour, 0));
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_IWDAY,
	    tobcd(ct->dow, 0));
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_IDAY,
	    tobcd(ct->day, 0));
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_IMON,
	    tobcd(ct->mon, 0));
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_IYEAR,
	    tobcd(ct->year - sc->sc_yrbase, 0));

	/* Load new values. */
	csr = bus_space_read_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_ICSR);
	csr &= ~MK48TXX_CSR_WRITE;
	bus_space_write_1(sc->sc_clkt, sc->sc_clkh, MK48TXX_ICSR, csr);
}

/*
 * Routines allowing external access to the RTC registers, used by
 * power(4).
 */

int
dsrtc_register_read(int reg)
{
	struct dsrtc_softc *sc;

	if (dsrtc_cd.cd_ndevs == 0 ||
	    (sc = (struct dsrtc_softc *)dsrtc_cd.cd_devs[0]) == NULL ||
	    sc->read == NULL)
		return -1;

	return (*sc->read)(sc, reg);
}

void
dsrtc_register_write(int reg, int val)
{
	struct dsrtc_softc *sc;

	if (dsrtc_cd.cd_ndevs == 0 ||
	    (sc = (struct dsrtc_softc *)dsrtc_cd.cd_devs[0]) == NULL ||
	    sc->write == NULL)
		return;

	(*sc->write)(sc, reg, val);
}


code:
/*	$OpenBSD: dsrtcvar.h,v 1.1 2009/05/15 23:03:32 miod Exp $	*/

/*
 * Copyright (c) 2009 Miodrag Vallat.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * Routines allowing external access to the RTC registers, used by
 * power(4).
 */

int	dsrtc_register_read(int);
void	dsrtc_register_write(int, int);