diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-05-26 21:15:32 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-05-26 21:15:32 +0000 |
commit | c502ba9b8b0156ef0259c000be4ec7cf6f4fcc52 (patch) | |
tree | 46ccf9663276f11b211f355b4f0055cd629b7153 /sys/arch/mvme88k/dev | |
parent | b62805d01db690f08f55d66a384c3a0e22c8c5db (diff) |
Use physical addresses as seen in the A24 MVME332XT address space, this
allows the driver to really don't care about its VME address and simplifies
some code.
Diffstat (limited to 'sys/arch/mvme88k/dev')
-rw-r--r-- | sys/arch/mvme88k/dev/vx.c | 17 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vxreg.h | 10 |
2 files changed, 16 insertions, 11 deletions
diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c index 6dcb258a491..2a5175515c1 100644 --- a/sys/arch/mvme88k/dev/vx.c +++ b/sys/arch/mvme88k/dev/vx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vx.c,v 1.31 2004/05/25 21:22:49 miod Exp $ */ +/* $OpenBSD: vx.c,v 1.32 2004/05/26 21:15:31 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -68,7 +68,6 @@ struct vxsoftc { struct evcnt sc_intrcnt; struct vx_info sc_info[NVXPORTS]; struct vxreg *vx_reg; - paddr_t board_addr; vaddr_t board_vaddr; struct channel *channel; char channel_number; @@ -140,8 +139,16 @@ void vx_unblock(struct tty *); * opposite. */ #define VIRTUAL(addr) (((addr) & 0xffff) + sc->board_vaddr) -#define PHYSICAL(addr) (((addr - sc->board_vaddr) & 0xffff) + sc->board_addr) -/* #define PHYSICAL(addr) (((addr - sc->board_vaddr) & 0xffff) | 0xf30000) */ +#define PHYSICAL(addr) \ + (((addr - sc->board_vaddr) & 0xffff) | LOCAL_DPMEM_ADDRESS) + +#if 0 +#define LO(x) (u_short)((unsigned long)x & 0x0000FFFF) +#define HI(x) (u_short)((unsigned long)x >> 16) +#else +#define LO(x) (u_short)(x) +#define HI(x) (LOCAL_DPMEM_ADDRESS >> 16) +#endif struct tty * vxtty(dev_t dev) @@ -191,8 +198,6 @@ vxattach(struct device *parent, struct device *self, void *aux) if (ca->ca_ipl < 0) ca->ca_ipl = IPL_TTY; - sc->board_addr = ca->ca_paddr; - if (bus_space_map(iot, ca->ca_paddr, 0x10000, 0, &ioh) != 0) { printf(": can't map registers!\n"); return; diff --git a/sys/arch/mvme88k/dev/vxreg.h b/sys/arch/mvme88k/dev/vxreg.h index c677bcb550e..1344d711c78 100644 --- a/sys/arch/mvme88k/dev/vxreg.h +++ b/sys/arch/mvme88k/dev/vxreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vxreg.h,v 1.7 2004/05/25 21:21:24 miod Exp $ */ +/* $OpenBSD: vxreg.h,v 1.8 2004/05/26 21:15:31 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. All rights reserved. @@ -396,8 +396,8 @@ struct init_info { /* 88 bytes */ #define NENVELOPES 30 #define NPACKETS NENVELOPES -#define USER_AREA (sc->board_addr + 0x0100) -#define CHANNEL_H (sc->board_addr + 0x0100) +#define USER_AREA (0x0100) +#define CHANNEL_H (0x0100) #define ENVELOPE_AREA (CHANNEL_H + sizeof(struct channel)) #define ENVELOPE_AREA_SIZE (NENVELOPES * sizeof(struct envelope)) #define PACKET_AREA (ENVELOPE_AREA + ENVELOPE_AREA_SIZE) @@ -410,5 +410,5 @@ struct init_info { /* 88 bytes */ #define RRING_AREA_SIZE (NVXPORTS * sizeof(struct rring)) #define USER_AREA_SIZE (RRING_AREA + RRING_AREA_SIZE - USER_AREA) -#define LO(x) (u_short)((unsigned long)x & 0x0000FFFF) -#define HI(x) (u_short)((unsigned long)x >> 16) +/* Hardware's view of the dual ported memory */ +#define LOCAL_DPMEM_ADDRESS 0x00f30000 |