diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-11-18 19:05:54 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-11-18 19:05:54 +0000 |
commit | dcd88473ccbbe7f2bb5400192de0a6e7c478c637 (patch) | |
tree | 0076e0e410a6eded553ac730e325c76303f18319 /sys | |
parent | 539fb2c086bcc8d287cf8f8e6f223e660d5d7a25 (diff) |
Move widget register information apart from xbow software interface, and
update #include needs. No functional change.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sgi/sgi/ip27_machdep.c | 5 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/ip30_machdep.c | 5 | ||||
-rw-r--r-- | sys/arch/sgi/xbow/widget.h | 73 | ||||
-rw-r--r-- | sys/arch/sgi/xbow/xbow.c | 8 | ||||
-rw-r--r-- | sys/arch/sgi/xbow/xbow.h | 58 | ||||
-rw-r--r-- | sys/arch/sgi/xbow/xbridge.c | 3 |
6 files changed, 90 insertions, 62 deletions
diff --git a/sys/arch/sgi/sgi/ip27_machdep.c b/sys/arch/sgi/sgi/ip27_machdep.c index 6b6204afefe..a3edf183c38 100644 --- a/sys/arch/sgi/sgi/ip27_machdep.c +++ b/sys/arch/sgi/sgi/ip27_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip27_machdep.c,v 1.35 2009/11/12 17:13:33 miod Exp $ */ +/* $OpenBSD: ip27_machdep.c,v 1.36 2009/11/18 19:05:51 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -29,7 +29,6 @@ #include <sys/reboot.h> #include <sys/tty.h> -#include <mips64/arcbios.h> #include <mips64/archtype.h> #include <machine/autoconf.h> @@ -42,8 +41,8 @@ #include <sgi/sgi/ip27.h> #include <sgi/xbow/hub.h> +#include <sgi/xbow/widget.h> #include <sgi/xbow/xbow.h> -#include <sgi/xbow/xbridgereg.h> #include <sgi/pci/iofreg.h> #include <dev/ic/comvar.h> diff --git a/sys/arch/sgi/sgi/ip30_machdep.c b/sys/arch/sgi/sgi/ip30_machdep.c index b6c7b897802..e03565a7b1e 100644 --- a/sys/arch/sgi/sgi/ip30_machdep.c +++ b/sys/arch/sgi/sgi/ip30_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip30_machdep.c,v 1.15 2009/10/31 00:20:46 miod Exp $ */ +/* $OpenBSD: ip30_machdep.c,v 1.16 2009/11/18 19:05:51 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -35,8 +35,9 @@ #include <uvm/uvm_extern.h> #include <sgi/sgi/ip30.h> +#include <sgi/xbow/widget.h> #include <sgi/xbow/xbow.h> -#include <sgi/xbow/xbridgereg.h> +#include <sgi/xbow/xbridgereg.h> /* BRIDGE_PCI0_MEM_SPACE_BASE */ #include <sgi/xbow/xheartreg.h> #include <sgi/pci/iocreg.h> diff --git a/sys/arch/sgi/xbow/widget.h b/sys/arch/sgi/xbow/widget.h new file mode 100644 index 00000000000..fbde457d77e --- /dev/null +++ b/sys/arch/sgi/xbow/widget.h @@ -0,0 +1,73 @@ +/* $OpenBSD: widget.h,v 1.1 2009/11/18 19:05:53 miod Exp $ */ + +/* + * Copyright (c) 2008 Miodrag Vallat. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _WIDGET_H_ +#define _WIDGET_H_ + +/* + * Common Widget Registers. Every widget provides them. + * + * Registers are 32 or 64 bit wide (depending on the particular widget + * or register) on 64 bit boundaries. + * The widget_{read,write}_[48] functions below hide the addressing + * games required to perform 32 bit accesses. + */ + +#define WIDGET_ID 0x0000 +#define WIDGET_ID_REV_MASK 0xf0000000 +#define WIDGET_ID_REV_SHIFT 28 +#define WIDGET_ID_PRODUCT_MASK 0x0ffff000 +#define WIDGET_ID_PRODUCT_SHIFT 12 +#define WIDGET_ID_VENDOR_MASK 0x00000ffe +#define WIDGET_ID_VENDOR_SHIFT 1 +#define WIDGET_STATUS 0x0008 +#define WIDGET_ERR_ADDR_UPPER 0x0010 +#define WIDGET_ERR_ADDR_LOWER 0x0018 +#define WIDGET_CONTROL 0x0020 +#define WIDGET_REQ_TIMEOUT 0x0028 +#define WIDGET_INTDEST_ADDR_UPPER 0x0030 +#define WIDGET_INTDEST_ADDR_LOWER 0x0038 +#define WIDGET_ERR_CMD_WORD 0x0040 +#define WIDGET_LLP_CFG 0x0048 +#define WIDGET_TFLUSH 0x0050 + +/* + * Crossbow Specific Registers. + */ + +#define XBOW_WID_ARB_RELOAD 0x0058 +#define XBOW_PERFCNTR_A 0x0060 +#define XBOW_PERFCNTR_B 0x0068 +#define XBOW_NIC 0x0070 +#define XBOW_WIDGET_LINK(w) (0x0100 + ((w) & 7) * 0x0040) + +/* + * Crossbow Per-widget ``Link'' Register Set. + */ +#define WIDGET_LINK_IBF 0x0000 +#define WIDGET_LINK_CONTROL 0x0008 +#define WIDGET_CONTROL_ALIVE 0x80000000 +#define WIDGET_LINK_STATUS 0x0010 +#define WIDGET_STATUS_ALIVE 0x80000000 +#define WIDGET_LINK_ARB_UPPER 0x0018 +#define WIDGET_LINK_ARB_LOWER 0x0020 +#define WIDGET_LINK_STATUS_CLEAR 0x0028 +#define WIDGET_LINK_RESET 0x0030 +#define WIDGET_LINK_AUX_STATUS 0x0038 + +#endif /* _WIDGET_H_ */ diff --git a/sys/arch/sgi/xbow/xbow.c b/sys/arch/sgi/xbow/xbow.c index 9b5a7c401fa..9be999d45be 100644 --- a/sys/arch/sgi/xbow/xbow.c +++ b/sys/arch/sgi/xbow/xbow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbow.c,v 1.24 2009/11/07 18:56:55 miod Exp $ */ +/* $OpenBSD: xbow.c,v 1.25 2009/11/18 19:05:53 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -69,7 +69,9 @@ #include <machine/mnode.h> #include <sgi/xbow/hub.h> +#include <sgi/xbow/widget.h> #include <sgi/xbow/xbow.h> + #include <sgi/xbow/xbowdevs.h> #include <sgi/xbow/xbowdevs_data.h> @@ -140,7 +142,7 @@ static const bus_space_t xbowbus_tag = { }; /* - * Function pointers to hide widget window mapping differences accross + * Function pointers to hide widget discovery and mapping differences accross * systems. */ paddr_t (*xbow_widget_base)(int16_t, u_int); @@ -248,7 +250,7 @@ const uint8_t xbow_probe_xbrick[] = { 0x08, 0x09, 0x0c, 0x0d, 0x0a, 0x0b, 0x0e, 0x0f, 0 }; /* - * Structures used to carry information between KL and atatchment code. + * Structures used to carry information between KL and attachment code. */ struct xbow_config { diff --git a/sys/arch/sgi/xbow/xbow.h b/sys/arch/sgi/xbow/xbow.h index 146dcec5fed..579cf7a6770 100644 --- a/sys/arch/sgi/xbow/xbow.h +++ b/sys/arch/sgi/xbow/xbow.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xbow.h,v 1.8 2009/10/26 18:11:27 miod Exp $ */ +/* $OpenBSD: xbow.h,v 1.9 2009/11/18 19:05:53 miod Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -57,64 +57,12 @@ extern void (*xbow_intr_widget_intr_set)(int); extern void (*xbow_intr_widget_intr_clear)(int); /* - * Common Widget Registers. Every widget provides them. - * - * Registers are 32 or 64 bit wide (depending on the particular widget - * or register) on 64 bit boundaries. - * The widget_{read,write}_[48] functions below hide the addressing - * games required to perform 32 bit accesses. - */ - -#define WIDGET_ID 0x0000 -#define WIDGET_ID_REV_MASK 0xf0000000 -#define WIDGET_ID_REV_SHIFT 28 -#define WIDGET_ID_PRODUCT_MASK 0x0ffff000 -#define WIDGET_ID_PRODUCT_SHIFT 12 -#define WIDGET_ID_VENDOR_MASK 0x00000ffe -#define WIDGET_ID_VENDOR_SHIFT 1 -#define WIDGET_STATUS 0x0008 -#define WIDGET_ERR_ADDR_UPPER 0x0010 -#define WIDGET_ERR_ADDR_LOWER 0x0018 -#define WIDGET_CONTROL 0x0020 -#define WIDGET_REQ_TIMEOUT 0x0028 -#define WIDGET_INTDEST_ADDR_UPPER 0x0030 -#define WIDGET_INTDEST_ADDR_LOWER 0x0038 -#define WIDGET_ERR_CMD_WORD 0x0040 -#define WIDGET_LLP_CFG 0x0048 -#define WIDGET_TFLUSH 0x0050 - -/* - * Crossbow Specific Registers. - */ - -#define XBOW_WID_ARB_RELOAD 0x0058 -#define XBOW_PERFCNTR_A 0x0060 -#define XBOW_PERFCNTR_B 0x0068 -#define XBOW_NIC 0x0070 -#define XBOW_WIDGET_LINK(w) (0x0100 + ((w) & 7) * 0x0040) - -/* - * Per-widget ``Link'' Register Set. - */ -#define WIDGET_LINK_IBF 0x0000 -#define WIDGET_LINK_CONTROL 0x0008 -#define WIDGET_CONTROL_ALIVE 0x80000000 -#define WIDGET_LINK_STATUS 0x0010 -#define WIDGET_STATUS_ALIVE 0x80000000 -#define WIDGET_LINK_ARB_UPPER 0x0018 -#define WIDGET_LINK_ARB_LOWER 0x0020 -#define WIDGET_LINK_STATUS_CLEAR 0x0028 -#define WIDGET_LINK_RESET 0x0030 -#define WIDGET_LINK_AUX_STATUS 0x0038 - -/* * Valid widget values */ #define WIDGET_MIN 8 #define WIDGET_MAX 15 - struct xbow_attach_args { int16_t xaa_nasid; int xaa_widget; @@ -124,6 +72,10 @@ struct xbow_attach_args { uint32_t xaa_revision; bus_space_tag_t xaa_iot; + /* + * WARNING! xaa_iot points to memory allocated on the stack, + * drivers need to make a copy of it. + */ }; void xbow_build_bus_space(struct mips_bus_space *, int, int); diff --git a/sys/arch/sgi/xbow/xbridge.c b/sys/arch/sgi/xbow/xbridge.c index e0c2cb3d662..cbd70b489c2 100644 --- a/sys/arch/sgi/xbow/xbridge.c +++ b/sys/arch/sgi/xbow/xbridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbridge.c,v 1.61 2009/11/11 15:29:31 miod Exp $ */ +/* $OpenBSD: xbridge.c,v 1.62 2009/11/18 19:05:53 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -57,6 +57,7 @@ #include <sgi/xbow/xbow.h> #include <sgi/xbow/xbowdevs.h> +#include <sgi/xbow/widget.h> #include <sgi/xbow/xbridgereg.h> #ifdef TGT_OCTANE |