Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/evbppc Remove some constant (use value in bus_space...
details: https://anonhg.NetBSD.org/src/rev/cd77fb15138a
branches: trunk
changeset: 543990:cd77fb15138a
user: matt <matt%NetBSD.org@localhost>
date: Fri Mar 07 18:24:00 2003 +0000
description:
Remove some constant (use value in bus_space_tags).
diffstat:
sys/arch/evbppc/ev64260/bus_space.c | 54 +++++++++++-----------
sys/arch/evbppc/ev64260/gt_mainbus.c | 86 ++++++++++++++++++++++-------------
sys/arch/evbppc/ev64260/machdep.c | 12 ++--
sys/arch/evbppc/ev64260/mainbus.c | 5 +-
sys/arch/evbppc/include/bus.h | 8 +--
5 files changed, 93 insertions(+), 72 deletions(-)
diffs (truncated from 373 to 300 lines):
diff -r 33ab61cadd2f -r cd77fb15138a sys/arch/evbppc/ev64260/bus_space.c
--- a/sys/arch/evbppc/ev64260/bus_space.c Fri Mar 07 17:00:22 2003 +0000
+++ b/sys/arch/evbppc/ev64260/bus_space.c Fri Mar 07 18:24:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_space.c,v 1.3 2003/03/06 20:15:24 matt Exp $ */
+/* $NetBSD: bus_space.c,v 1.4 2003/03/07 18:24:00 matt Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -55,31 +55,31 @@
bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *);
static void memio_free(bus_space_tag_t, bus_space_handle_t, bus_size_t);
-struct powerpc_bus_space ev64260_pci0_mem_bs_tag = {
+struct powerpc_bus_space gt_pci0_mem_bs_tag = {
_BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_MEM_TYPE,
0x00000000, 0x81000000, 0x89000000,
NULL,
memio_mmap, memio_map, memio_unmap, memio_alloc, memio_free
};
-struct powerpc_bus_space ev64260_pci0_io_bs_tag = {
+struct powerpc_bus_space gt_pci0_io_bs_tag = {
_BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_IO_TYPE,
0x80000000, 0x00000000, 0x00800000,
NULL,
memio_mmap, memio_map, memio_unmap, memio_alloc, memio_free
};
-struct powerpc_bus_space ev64260_pci1_mem_bs_tag = {
+struct powerpc_bus_space gt_pci1_mem_bs_tag = {
_BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_MEM_TYPE,
0x00000000, 0x89000000, 0x90000000,
NULL,
memio_mmap, memio_map, memio_unmap, memio_alloc, memio_free
};
-struct powerpc_bus_space ev64260_pci1_io_bs_tag = {
+struct powerpc_bus_space gt_pci1_io_bs_tag = {
_BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_IO_TYPE,
0x88000000, 0x00000000, 0x00800000,
NULL,
memio_mmap, memio_map, memio_unmap, memio_alloc, memio_free
};
-struct powerpc_bus_space ev64260_gt_mem_bs_tag = {
+struct powerpc_bus_space gt_mem_bs_tag = {
_BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_MEM_TYPE,
0x00000000, 0x00000000, 0x00010000,
NULL,
@@ -92,58 +92,58 @@
static int extent_flags;
void
-ev64260_bus_space_init(void)
+bus_space_init(void)
{
int error;
- ev64260_pci0_mem_bs_tag.pbs_extent = extent_create("pci0-mem",
- ev64260_pci0_mem_bs_tag.pbs_base,
- ev64260_pci0_mem_bs_tag.pbs_limit-1,
+ gt_pci0_mem_bs_tag.pbs_extent = extent_create("pci0-mem",
+ gt_pci0_mem_bs_tag.pbs_base,
+ gt_pci0_mem_bs_tag.pbs_limit-1,
M_DEVBUF,
ex_storage[0], sizeof(ex_storage[0]),
EX_NOCOALESCE|EX_NOWAIT);
- ev64260_pci0_io_bs_tag.pbs_extent = extent_create("pci0-ioport",
- ev64260_pci0_io_bs_tag.pbs_base,
- ev64260_pci0_io_bs_tag.pbs_limit-1,
+ gt_pci0_io_bs_tag.pbs_extent = extent_create("pci0-ioport",
+ gt_pci0_io_bs_tag.pbs_base,
+ gt_pci0_io_bs_tag.pbs_limit-1,
M_DEVBUF,
ex_storage[1], sizeof(ex_storage[1]),
EX_NOCOALESCE|EX_NOWAIT);
- error = extent_alloc_region(ev64260_pci0_io_bs_tag.pbs_extent,
+ error = extent_alloc_region(gt_pci0_io_bs_tag.pbs_extent,
0x10000, 0x7F0000, EX_NOWAIT);
if (error)
- panic("ev64260_bus_space_init: can't block out reserved "
+ panic("gt_bus_space_init: can't block out reserved "
"I/O space 0x10000-0x7fffff: error=%d\n", error);
- ev64260_pci1_mem_bs_tag.pbs_extent = extent_create("pci1-iomem",
- ev64260_pci1_mem_bs_tag.pbs_base,
- ev64260_pci1_mem_bs_tag.pbs_limit-1,
+ gt_pci1_mem_bs_tag.pbs_extent = extent_create("pci1-iomem",
+ gt_pci1_mem_bs_tag.pbs_base,
+ gt_pci1_mem_bs_tag.pbs_limit-1,
M_DEVBUF,
ex_storage[2], sizeof(ex_storage[2]),
EX_NOCOALESCE|EX_NOWAIT);
- ev64260_pci1_io_bs_tag.pbs_extent = extent_create("pci1-ioport",
- ev64260_pci1_io_bs_tag.pbs_base,
- ev64260_pci1_io_bs_tag.pbs_limit-1,
+ gt_pci1_io_bs_tag.pbs_extent = extent_create("pci1-ioport",
+ gt_pci1_io_bs_tag.pbs_base,
+ gt_pci1_io_bs_tag.pbs_limit-1,
M_DEVBUF,
ex_storage[3], sizeof(ex_storage[3]),
EX_NOCOALESCE|EX_NOWAIT);
- error = extent_alloc_region(ev64260_pci1_io_bs_tag.pbs_extent,
+ error = extent_alloc_region(gt_pci1_io_bs_tag.pbs_extent,
0x10000, 0x7F0000, EX_NOWAIT);
if (error)
- panic("ev64260_bus_space_init: can't block out reserved "
+ panic("gt_bus_space_init: can't block out reserved "
"I/O space 0x10000-0x7fffff: error=%d\n", error);
- ev64260_gt_mem_bs_tag.pbs_extent = extent_create("gtmem",
- ev64260_gt_mem_bs_tag.pbs_base,
- ev64260_gt_mem_bs_tag.pbs_limit-1,
+ gt_mem_bs_tag.pbs_extent = extent_create("gtmem",
+ gt_mem_bs_tag.pbs_base,
+ gt_mem_bs_tag.pbs_limit-1,
M_DEVBUF,
ex_storage[4], sizeof(ex_storage[4]),
EX_NOCOALESCE|EX_NOWAIT);
}
void
-ev64260_bus_space_mallocok(void)
+bus_space_mallocok(void)
{
extent_flags = EX_MALLOCOK;
}
diff -r 33ab61cadd2f -r cd77fb15138a sys/arch/evbppc/ev64260/gt_mainbus.c
--- a/sys/arch/evbppc/ev64260/gt_mainbus.c Fri Mar 07 17:00:22 2003 +0000
+++ b/sys/arch/evbppc/ev64260/gt_mainbus.c Fri Mar 07 18:24:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gt_mainbus.c,v 1.2 2003/03/06 06:04:22 matt Exp $ */
+/* $NetBSD: gt_mainbus.c,v 1.3 2003/03/07 18:24:01 matt Exp $ */
/*
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -44,6 +44,7 @@
#define _POWERPC_BUS_DMA_PRIVATE
#include <machine/bus.h>
+#include "opt_pci.h"
#include <dev/pci/pcivar.h>
#include <dev/pci/pciconf.h>
@@ -53,11 +54,11 @@
#include <dev/marvell/gtpcireg.h>
#include <dev/marvell/gtpcivar.h>
-extern struct powerpc_bus_space ev64260_gt_mem_bs_tag;
-extern struct powerpc_bus_space ev64260_pci0_mem_bs_tag;
-extern struct powerpc_bus_space ev64260_pci0_io_bs_tag;
-extern struct powerpc_bus_space ev64260_pci1_mem_bs_tag;
-extern struct powerpc_bus_space ev64260_pci1_io_bs_tag;
+extern struct powerpc_bus_space gt_mem_bs_tag;
+extern struct powerpc_bus_space gt_pci0_mem_bs_tag;
+extern struct powerpc_bus_space gt_pci0_io_bs_tag;
+extern struct powerpc_bus_space gt_pci1_mem_bs_tag;
+extern struct powerpc_bus_space gt_pci1_io_bs_tag;
struct powerpc_bus_dma_tag gt_bus_dma_tag = {
0, /* _bounce_thresh */
@@ -108,11 +109,11 @@
gt->gt_vbase = GT_BASE;
gt->gt_dmat = >_bus_dma_tag;
- gt->gt_memt = &ev64260_gt_mem_bs_tag;
- gt->gt_pci0_memt = &ev64260_pci0_io_bs_tag;
- gt->gt_pci0_iot = &ev64260_pci0_mem_bs_tag;
- gt->gt_pci1_memt = &ev64260_pci1_io_bs_tag;
- gt->gt_pci1_iot = &ev64260_pci1_mem_bs_tag;
+ gt->gt_memt = >_mem_bs_tag;
+ gt->gt_pci0_memt = >_pci0_io_bs_tag;
+ gt->gt_pci0_iot = >_pci0_mem_bs_tag;
+ gt->gt_pci1_memt = >_pci1_io_bs_tag;
+ gt->gt_pci1_iot = >_pci1_mem_bs_tag;
gt_attach_common(gt);
}
@@ -121,20 +122,32 @@
gt_setup(struct device *gt)
{
#if 1
- GT_DecodeAddr_SET(gt, GT_PCI0_IO_Low_Decode, 0x80000000);
- GT_DecodeAddr_SET(gt, GT_PCI0_IO_High_Decode, 0x807FFFFF);
- GT_DecodeAddr_SET(gt, GT_PCI1_IO_Low_Decode, 0x80800000);
- GT_DecodeAddr_SET(gt, GT_PCI1_IO_High_Decode, 0x80FFFFFF);
- GT_DecodeAddr_SET(gt, GT_PCI0_Mem0_Low_Decode, 0x81000000);
- GT_DecodeAddr_SET(gt, GT_PCI0_Mem0_High_Decode, 0x88FFFFFF);
- GT_DecodeAddr_SET(gt, GT_PCI1_Mem0_Low_Decode, 0x89000000);
- GT_DecodeAddr_SET(gt, GT_PCI1_Mem0_High_Decode, 0x8FFFFFFF);
+ GT_DecodeAddr_SET(gt, GT_PCI0_IO_Low_Decode,
+ gt_pci0_io_bs_tag.pbs_offset + gt_pci0_io_bs_tag.pbs_base);
+ GT_DecodeAddr_SET(gt, GT_PCI0_IO_High_Decode,
+ gt_pci0_io_bs_tag.pbs_offset + gt_pci0_io_bs_tag.pbs_limit - 1);
+
+ GT_DecodeAddr_SET(gt, GT_PCI1_IO_Low_Decode,
+ gt_pci1_io_bs_tag.pbs_offset + gt_pci1_io_bs_tag.pbs_base);
+ GT_DecodeAddr_SET(gt, GT_PCI1_IO_High_Decode,
+ gt_pci1_io_bs_tag.pbs_offset + gt_pci1_io_bs_tag.pbs_limit - 1);
+
+ GT_DecodeAddr_SET(gt, GT_PCI0_Mem0_Low_Decode,
+ gt_pci0_mem_bs_tag.pbs_offset + gt_pci0_mem_bs_tag.pbs_base);
+ GT_DecodeAddr_SET(gt, GT_PCI0_Mem0_High_Decode,
+ gt_pci1_mem_bs_tag.pbs_offset + gt_pci1_mem_bs_tag.pbs_limit - 1);
+
+ GT_DecodeAddr_SET(gt, GT_PCI1_Mem0_Low_Decode,
+ gt_pci1_mem_bs_tag.pbs_offset + gt_pci1_mem_bs_tag.pbs_base);
+ GT_DecodeAddr_SET(gt, GT_PCI1_Mem0_High_Decode,
+ gt_pci1_mem_bs_tag.pbs_offset + gt_pci1_mem_bs_tag.pbs_limit - 1);
#endif
}
void
gtpci_config_bus(struct pci_chipset *pc, int busno)
{
+#ifdef PCI_NETBSD_CONFIGURE
struct extent *ioext, *memext;
uint32_t data;
pcitag_t tag;
@@ -145,16 +158,20 @@
switch (busno) {
case 0:
- ioext = extent_create("pciio0", 0x00000600, 0x0000ffff,
- M_DEVBUF, NULL, 0, EX_NOWAIT);
- memext = extent_create("pcimem0", 0x81000000, 0x88ffffff,
- M_DEVBUF, NULL, 0, EX_NOWAIT);
+ ioext = extent_create("pci0-io", 0x00000600, 0x0000ffff,
+ M_DEVBUF, NULL, 0, EX_NOWAIT);
+ memext = extent_create("pci0-mem",
+ gt_pci0_mem_bs_tag.pbs_base,
+ gt_pci0_mem_bs_tag.pbs_limit-1,
+ M_DEVBUF, NULL, 0, EX_NOWAIT);
break;
case 1:
- ioext = extent_create("pciio1", 0x00000600, 0x0000ffff,
- M_DEVBUF, NULL, 0, EX_NOWAIT);
- memext = extent_create("pcimem1", 0x89000000, 0x8fffffff,
- M_DEVBUF, NULL, 0, EX_NOWAIT);
+ ioext = extent_create("pci1-io", 0x00000600, 0x0000ffff,
+ M_DEVBUF, NULL, 0, EX_NOWAIT);
+ memext = extent_create("pci1-mem",
+ gt_pci1_mem_bs_tag.pbs_base,
+ gt_pci1_mem_bs_tag.pbs_limit-1,
+ M_DEVBUF, NULL, 0, EX_NOWAIT);
break;
}
@@ -255,6 +272,15 @@
PCI_BARE_SCS2En | /* PCI_BARE_SCS3En | */ \
PCI_BARE_IntMemEn | PCI_BARE_IntIOEn);
gtpci_write(pc, PCI_BASE_ADDR_REGISTERS_ENABLE(pc->pc_md.mdpc_busno), data);
+#endif /* PCI_NETBSD_CONFIGURE */
+}
+
+void
+gtpci_md_conf_interrupt(pci_chipset_tag_t pc, int bus, int dev, int pin,
+ int swiz, int *iline)
+{
+#ifdef PCI_NETBSD_CONFIGURE
+#endif /* PCI_NETBSD_CONFIGURE */
}
void
@@ -277,12 +303,6 @@
return 1;
}
-void
-gtpci_md_conf_interrupt(pci_chipset_tag_t pc, int bus, int dev, int pin,
- int swiz, int *iline)
-{
-}
-
int
gtpci_md_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
diff -r 33ab61cadd2f -r cd77fb15138a sys/arch/evbppc/ev64260/machdep.c
--- a/sys/arch/evbppc/ev64260/machdep.c Fri Mar 07 17:00:22 2003 +0000
+++ b/sys/arch/evbppc/ev64260/machdep.c Fri Mar 07 18:24:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.2 2003/03/06 06:04:22 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.3 2003/03/07 18:24:01 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -161,9 +161,9 @@
gtbase = GT_BASE;
}
{
- extern struct powerpc_bus_space ev64260_gt_mem_bs_tag;
- ev64260_gt_mem_bs_tag.pbs_base = GT_BASE;
- ev64260_gt_mem_bs_tag.pbs_limit = GT_BASE + 4096;
+ extern struct powerpc_bus_space gt_mem_bs_tag;
+ gt_mem_bs_tag.pbs_base = GT_BASE;
+ gt_mem_bs_tag.pbs_limit = GT_BASE + 4096;
}
/*
@@ -204,7 +204,7 @@
*/
Home |
Main Index |
Thread Index |
Old Index