diff options
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/include/chipset.h | 9 | ||||
-rw-r--r-- | sys/alpha/pci/apecs.c | 15 | ||||
-rw-r--r-- | sys/alpha/pci/cia.c | 24 | ||||
-rw-r--r-- | sys/alpha/pci/lca.c | 13 | ||||
-rw-r--r-- | sys/alpha/pci/pcibus.c | 20 |
5 files changed, 76 insertions, 5 deletions
diff --git a/sys/alpha/include/chipset.h b/sys/alpha/include/chipset.h index 5e2922e..74698c5 100644 --- a/sys/alpha/include/chipset.h +++ b/sys/alpha/include/chipset.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: chipset.h,v 1.3 1998/07/22 08:25:39 dfr Exp $ + * $Id: chipset.h,v 1.4 1998/08/10 07:53:58 dfr Exp $ */ #ifndef _MACHINE_CHIPSET_H_ @@ -53,6 +53,7 @@ typedef void alpha_chipset_cfgwritew_t(u_int, u_int, u_int, u_int, u_int16_t); typedef void alpha_chipset_cfgwritel_t(u_int, u_int, u_int, u_int, u_int32_t); +typedef vm_offset_t alpha_chipset_addrcvt_t(vm_offset_t); typedef struct alpha_chipset { @@ -88,6 +89,12 @@ typedef struct alpha_chipset { alpha_chipset_cfgwritel_t* cfgwritel; /* + * PCI address space translation functions + */ + alpha_chipset_addrcvt_t* cvt_to_dense; + alpha_chipset_addrcvt_t* cvt_to_bwx; + + /* * PCI interrupt device. * (XXX hack until I change pci code to use new * device framework.) diff --git a/sys/alpha/pci/apecs.c b/sys/alpha/pci/apecs.c index 4043fd3..4334102 100644 --- a/sys/alpha/pci/apecs.c +++ b/sys/alpha/pci/apecs.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cia.c,v 1.3 1998/07/22 08:32:17 dfr Exp $ + * $Id: apecs.c,v 1.1 1998/08/10 07:53:59 dfr Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -102,6 +102,7 @@ static alpha_chipset_cfgreadl_t apecs_swiz_cfgreadl; static alpha_chipset_cfgwriteb_t apecs_swiz_cfgwriteb; static alpha_chipset_cfgwritew_t apecs_swiz_cfgwritew; static alpha_chipset_cfgwritel_t apecs_swiz_cfgwritel; +static alpha_chipset_addrcvt_t apecs_cvt_dense; static alpha_chipset_t apecs_swiz_chipset = { apecs_swiz_inb, @@ -123,6 +124,8 @@ static alpha_chipset_t apecs_swiz_chipset = { apecs_swiz_cfgwriteb, apecs_swiz_cfgwritew, apecs_swiz_cfgwritel, + apecs_cvt_dense, + NULL, }; static int @@ -407,6 +410,16 @@ apecs_swiz_cfgwritel(u_int b, u_int s, u_int f, u_int r, u_int32_t data) } #endif + +static vm_offset_t +apecs_cvt_dense(vm_offset_t addr) +{ + addr &= 0xffffffffUL; + return (addr | APECS_PCI_DENSE); + +} + + static int apecs_probe(device_t dev); static int apecs_attach(device_t dev); static void *apecs_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg); diff --git a/sys/alpha/pci/cia.c b/sys/alpha/pci/cia.c index e9587b4..065c420 100644 --- a/sys/alpha/pci/cia.c +++ b/sys/alpha/pci/cia.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cia.c,v 1.8 1998/08/13 08:11:27 dfr Exp $ + * $Id: cia.c,v 1.9 1998/09/16 08:24:30 dfr Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -137,6 +137,7 @@ static alpha_chipset_cfgreadl_t cia_bwx_cfgreadl, cia_swiz_cfgreadl; static alpha_chipset_cfgwriteb_t cia_bwx_cfgwriteb, cia_swiz_cfgwriteb; static alpha_chipset_cfgwritew_t cia_bwx_cfgwritew, cia_swiz_cfgwritew; static alpha_chipset_cfgwritel_t cia_bwx_cfgwritel, cia_swiz_cfgwritel; +static alpha_chipset_addrcvt_t cia_cvt_dense, cia_cvt_bwx; static alpha_chipset_t cia_bwx_chipset = { cia_bwx_inb, @@ -158,6 +159,8 @@ static alpha_chipset_t cia_bwx_chipset = { cia_bwx_cfgwriteb, cia_bwx_cfgwritew, cia_bwx_cfgwritel, + cia_cvt_dense, + cia_cvt_bwx, }; static alpha_chipset_t cia_swiz_chipset = { cia_swiz_inb, @@ -179,6 +182,8 @@ static alpha_chipset_t cia_swiz_chipset = { cia_swiz_cfgwriteb, cia_swiz_cfgwritew, cia_swiz_cfgwritel, + cia_cvt_dense, + NULL, }; static u_int8_t @@ -596,6 +601,23 @@ cia_swiz_cfgwritel(u_int b, u_int s, u_int f, u_int r, u_int32_t data) SWIZ_CFGWRITE(b, s, f, r, data, LONG, u_int32_t); } +vm_offset_t +cia_cvt_dense(vm_offset_t addr) +{ + addr &= 0xffffffffUL; + return (addr | CIA_PCI_DENSE); + +} + +vm_offset_t +cia_cvt_bwx(vm_offset_t addr) +{ + addr &= 0xffffffffUL; + return (addr |= CIA_EV56_BWMEM); +} + + + static int cia_probe(device_t dev); static int cia_attach(device_t dev); static void *cia_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg); diff --git a/sys/alpha/pci/lca.c b/sys/alpha/pci/lca.c index 75b5ffc..58f873f 100644 --- a/sys/alpha/pci/lca.c +++ b/sys/alpha/pci/lca.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: lca.c,v 1.1 1998/08/10 07:53:59 dfr Exp $ + * $Id: lca.c,v 1.2 1998/09/23 21:23:51 msmith Exp $ */ #include <sys/param.h> @@ -69,6 +69,7 @@ static alpha_chipset_cfgreadl_t lca_cfgreadl; static alpha_chipset_cfgwriteb_t lca_cfgwriteb; static alpha_chipset_cfgwritew_t lca_cfgwritew; static alpha_chipset_cfgwritel_t lca_cfgwritel; +static alpha_chipset_addrcvt_t lca_cvt_dense; static alpha_chipset_t lca_chipset = { lca_inb, @@ -90,6 +91,7 @@ static alpha_chipset_t lca_chipset = { lca_cfgwriteb, lca_cfgwritew, lca_cfgwritel, + lca_cvt_dense, }; static u_int8_t @@ -302,6 +304,15 @@ lca_cfgwritel(u_int b, u_int s, u_int f, u_int r, u_int32_t data) CFGWRITE(b, s, f, r, data, LONG, u_int16_t); } +static vm_offset_t +lca_cvt_dense(vm_offset_t addr) +{ + addr &= 0xffffffffUL; + return (addr | LCA_PCI_DENSE); + +} + + static int lca_probe(device_t dev); static int lca_attach(device_t dev); static void *lca_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg); diff --git a/sys/alpha/pci/pcibus.c b/sys/alpha/pci/pcibus.c index a350772..0cafff2 100644 --- a/sys/alpha/pci/pcibus.c +++ b/sys/alpha/pci/pcibus.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcibus.c,v 1.3 1998/07/22 08:33:30 dfr Exp $ + * $Id: pcibus.c,v 1.4 1998/08/10 07:53:59 dfr Exp $ * */ @@ -90,6 +90,24 @@ pci_cfgopen(void) return 1; } +vm_offset_t +pci_cvt_to_dense(vm_offset_t sparse) +{ + if(chipset.cvt_to_dense) + return chipset.cvt_to_dense(sparse); + else + return NULL; +} + +vm_offset_t +pci_cvt_to_bwx(vm_offset_t sparse) +{ + if(chipset.cvt_to_bwx) + return chipset.cvt_to_bwx(sparse); + else + return NULL; +} + /* * These can disappear when I update the pci code to use the new * device framework. |