From 37c48ece580d4aeacd2f905999d656ff184ffb9c Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Tue, 13 Oct 2009 21:17:14 +0000 Subject: Make iof(4) pass its bus speed to children, this in turn allows com(4) to pick the right clock if the PCI bus the I/O board is on degrades to 33MHz. --- sys/arch/sgi/pci/iof.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/arch/sgi/pci/iof.c') diff --git a/sys/arch/sgi/pci/iof.c b/sys/arch/sgi/pci/iof.c index 8da9e4b409b..7d6a6631f7a 100644 --- a/sys/arch/sgi/pci/iof.c +++ b/sys/arch/sgi/pci/iof.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iof.c,v 1.3 2009/10/07 20:39:45 miod Exp $ */ +/* $OpenBSD: iof.c,v 1.4 2009/10/13 21:17:13 miod Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. @@ -64,6 +64,8 @@ struct iof_softc { bus_dma_tag_t sc_dmat; pci_chipset_tag_t sc_pc; + uint32_t sc_mcr; + void *sc_ih; struct iof_intr *sc_intr[IOC4_NDEVS]; }; @@ -153,6 +155,8 @@ iof_attach(struct device *parent, struct device *self, void *aux) sc->sc_memt = sc->sc_mem_bus_space; sc->sc_memh = memh; + sc->sc_mcr = bus_space_read_4(sc->sc_memt, sc->sc_memh, IOC4_MCR); + /* * Acknowledge all pending interrupts, and disable them. */ @@ -211,6 +215,7 @@ iof_attach_child(struct device *iof, const char *name, bus_addr_t base, iaa.iaa_dmat = sc->sc_dmat; iaa.iaa_base = base; iaa.iaa_dev = dev; + iaa.iaa_clock = sc->sc_mcr & IOC4_MCR_PCI_66MHZ ? 66666667 : 33333333; config_found_sm(iof, &iaa, iof_print, iof_search); } -- cgit v1.2.3