Read the PCI memory space base and the PCI DMA window base from the

V3 PBC, and use them in the bus mem tag and the bus dma tag on the
P-4032.  This allows us to get much further when PMON has configured
the PBC using the old-style PCI address map.
This commit is contained in:
thorpej 2001-06-14 17:57:26 +00:00
parent 6c492e4e70
commit 80dfaa3e5a
5 changed files with 43 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p4032_bus_mem.c,v 1.1 2001/06/01 16:00:03 thorpej Exp $ */
/* $NetBSD: algor_p4032_bus_mem.c,v 1.2 2001/06/14 17:57:26 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -53,20 +53,26 @@
#include <algor/algor/algor_p4032reg.h>
#include <algor/algor/algor_p4032var.h>
#include <algor/pci/vtpbcvar.h>
#define CHIP algor_p4032
#define CHIP_EX_MALLOC_SAFE(v) (((struct p4032_config *)(v))->ac_mallocsafe)
#define CHIP_MEM_EXTENT(v) (((struct p4032_config *)(v))->ac_mem_ex)
/* MEM region 1 */
#define CHIP_MEM_W1_BUS_START(v) 0x00000000UL
#define CHIP_MEM_W1_BUS_END(v) 0x007fffffUL
#define CHIP_MEM_W1_BUS_START(v) \
(vtpbc_configuration.vt_pci_membase + 0x00000000UL)
#define CHIP_MEM_W1_BUS_END(v) \
(vtpbc_configuration.vt_pci_membase + 0x007fffffUL)
#define CHIP_MEM_W1_SYS_START(v) P4032_ISAMEM
#define CHIP_MEM_W1_SYS_END(v) (P4032_ISAMEM + CHIP_MEM_W1_BUS_END(v))
/* MEM region 2 */
#define CHIP_MEM_W2_BUS_START(v) 0x01000000UL
#define CHIP_MEM_W2_BUS_END(v) 0x07ffffffUL
#define CHIP_MEM_W2_BUS_START(v) \
(vtpbc_configuration.vt_pci_membase + 0x01000000UL)
#define CHIP_MEM_W2_BUS_END(v) \
(vtpbc_configuration.vt_pci_membase + 0x07ffffffUL)
#define CHIP_MEM_W2_SYS_START(v) P4032_PCIMEM
#define CHIP_MEM_W2_SYS_END(v) (P4032_PCIMEM + 0x06ffffffUL)

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p4032_dma.c,v 1.1 2001/06/01 16:00:03 thorpej Exp $ */
/* $NetBSD: algor_p4032_dma.c,v 1.2 2001/06/14 17:57:26 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -48,6 +48,8 @@
#include <algor/algor/algor_p4032reg.h>
#include <algor/algor/algor_p4032var.h>
#include <algor/pci/vtpbcvar.h>
void
algor_p4032_dma_init(struct p4032_config *acp)
{
@ -58,7 +60,7 @@ algor_p4032_dma_init(struct p4032_config *acp)
*/
t = &acp->ac_pci_dmat;
t->_cookie = acp;
t->_wbase = P4032_DMA_PCI_PCIBASE;
t->_wbase = vtpbc_configuration.vt_dma_winbase;
t->_physbase = P4032_DMA_PCI_PHYSBASE;
t->_wsize = P4032_DMA_PCI_SIZE;
t->_dmamap_create = _bus_dmamap_create;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vtpbc_mainbus.c,v 1.2 2001/06/10 06:17:15 thorpej Exp $ */
/* $NetBSD: vtpbc_mainbus.c,v 1.3 2001/06/14 17:57:26 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -103,6 +103,11 @@ vtpbc_mainbus_attach(struct device *parent, struct device *self, void *aux)
else
printf(": V3 V962, unknown revision %d\n", vt->vt_rev);
printf("%s: PCI memory space base: 0x%08lx\n", sc->sc_dev.dv_xname,
(u_long) vt->vt_pci_membase);
printf("%s: PCI DMA window base: 0x%08lx\n", sc->sc_dev.dv_xname,
(u_long) vt->vt_dma_winbase);
pba.pba_busname = "pci";
pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
pba.pba_bus = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vtpbc.c,v 1.1 2001/05/28 16:22:21 thorpej Exp $ */
/* $NetBSD: vtpbc.c,v 1.2 2001/06/14 17:57:26 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -99,6 +99,18 @@ vtpbc_init(pci_chipset_tag_t pc, struct vtpbc_config *vt)
pc->pc_conf_write = vtpbc_conf_write;
vt->vt_rev = V96X_PCI_CC_REV(vt) & V96X_PCI_CC_REV_VREV;
/*
* Determine the PCI memory space base that our PCI
* memory window maps to.
*/
vt->vt_pci_membase = (V96X_LB_MAP1(vt) & V96X_LB_MAPx_MAP_ADR) << 16;
/*
* Determine the PCI window base that maps host RAM for
* DMA.
*/
vt->vt_dma_winbase = V96X_PCI_BASE1(vt) & 0xfffffff0;
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: vtpbcvar.h,v 1.1 2001/05/28 16:22:22 thorpej Exp $ */
/* $NetBSD: vtpbcvar.h,v 1.2 2001/06/14 17:57:27 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -43,6 +43,14 @@ struct vtpbc_config {
vaddr_t vt_cfgbase; /* PCI configuration space base */
int vt_adbase; /* AD line base for config access */
int vt_rev; /* silicon revision */
/*
* These are here in order to support the old-style PCI address
* map used by boards with older firmware (mostly on P-4032
* boards).
*/
bus_addr_t vt_pci_membase; /* PCI memory space base */
bus_addr_t vt_dma_winbase; /* DMA window base */
};
#ifdef _KERNEL