summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/dev/schizo.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-01-19 11:13:44 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-01-19 11:13:44 +0000
commit759014753c3f5679a4dbf7f1e0c01e1ad14c7888 (patch)
tree48d2b48caa4d68a2734c45dcb8338738e1bed8e5 /sys/arch/sparc64/dev/schizo.c
parent0045dcf8cbc73adb4cf29549a96bccf0f7716908 (diff)
Make host bridges provide their own implementation of pci_conf_read() and
pci_conf_write() and give pyro(4) an implementation suitable for PCIe. For psycho(4) and schizo(4), go back to the origional implementation. This gets rid of the 'tagshift' member of pci_chipset_tag_t, and clears the way for sun4v.
Diffstat (limited to 'sys/arch/sparc64/dev/schizo.c')
-rw-r--r--sys/arch/sparc64/dev/schizo.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c
index b8ae049f7cd..10b2e3287e5 100644
--- a/sys/arch/sparc64/dev/schizo.c
+++ b/sys/arch/sparc64/dev/schizo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: schizo.c,v 1.52 2007/11/13 15:51:59 kettenis Exp $ */
+/* $OpenBSD: schizo.c,v 1.53 2008/01/19 11:13:43 kettenis Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -85,6 +85,9 @@ bus_space_tag_t schizo_alloc_bus_tag(struct schizo_pbm *, const char *,
int, int, int);
bus_dma_tag_t schizo_alloc_dma_tag(struct schizo_pbm *);
+pcireg_t schizo_conf_read(pci_chipset_tag_t, pcitag_t, int);
+void schizo_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
+
int schizo_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
int schizo_bus_map(bus_space_tag_t, bus_space_tag_t, bus_addr_t,
bus_size_t, int, bus_space_handle_t *);
@@ -223,6 +226,8 @@ schizo_init(struct schizo_softc *sc, int busa)
pba.pba_dmat = pbm->sp_dmat;
pba.pba_memt = pbm->sp_memt;
pba.pba_iot = pbm->sp_iot;
+ pba.pba_pc->conf_read = schizo_conf_read;
+ pba.pba_pc->conf_write = schizo_conf_write;
pba.pba_pc->intr_map = schizo_intr_map;
free(busranges, M_DEVBUF);
@@ -433,6 +438,20 @@ schizo_print(void *aux, const char *p)
return (QUIET);
}
+pcireg_t
+schizo_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg)
+{
+ return (bus_space_read_4(pc->bustag, pc->bushandle,
+ PCITAG_OFFSET(tag) + reg));
+}
+
+void
+schizo_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t data)
+{
+ bus_space_write_4(pc->bustag, pc->bushandle,
+ PCITAG_OFFSET(tag) + reg, data);
+}
+
/*
* Bus-specific interrupt mapping
*/