summaryrefslogtreecommitdiffstats
path: root/sys/dev/cy/cyreg.h
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-11-23 13:58:55 +0000
committerbde <bde@FreeBSD.org>1998-11-23 13:58:55 +0000
commit461b5f77f68e93963067a55a96b771db99f6daa9 (patch)
tree712f6147eb2d746d122da156c3b7fa6a6cacc005 /sys/dev/cy/cyreg.h
parentf17aeea6de055b15cc6ea94cf29b4a7a64701f23 (diff)
downloadFreeBSD-src-461b5f77f68e93963067a55a96b771db99f6daa9.zip
FreeBSD-src-461b5f77f68e93963067a55a96b771db99f6daa9.tar.gz
Untangled the Cyclades offsets a little. CY16_RESET and CY_CLEAR_INTR
were half of their physical offsets for ISA and 1/4 of their physical offsets for PCI, while all other Cyclades offsets were physical/1 for ISA and physical/2 for PCI. Logically wrong macros were used to scale CY16_RESET and CY_CLEAR_INTR to the correct physical offsets. Fixed some style bugs (mostly long lines).
Diffstat (limited to 'sys/dev/cy/cyreg.h')
-rw-r--r--sys/dev/cy/cyreg.h46
1 files changed, 32 insertions, 14 deletions
diff --git a/sys/dev/cy/cyreg.h b/sys/dev/cy/cyreg.h
index d98cfd8..baedda4 100644
--- a/sys/dev/cy/cyreg.h
+++ b/sys/dev/cy/cyreg.h
@@ -26,32 +26,50 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cyreg.h,v 1.6 1998/08/13 13:54:10 bde Exp $
+ * $Id: cyreg.h,v 1.7 1998/08/13 19:03:22 bde Exp $
*/
/*
* Definitions for Cyclades Cyclom-Y serial boards.
*/
-#define CY8_SVCACKR 0x100
-#define CY8_SVCACKT 0x200
-#define CY8_SVCACKM 0x300
-#define CY16_RESET 0x0a00
-#define CY_CLEAR_INTR 0x0c00 /* intr ack address */
+/*
+ * Cyclades register offsets. These are physical offsets for ISA boards
+ * and physical offsets divided by 2 for PCI boards.
+ */
+#define CY8_SVCACKR 0x100 /* (r) */
+#define CY8_SVCACKT 0x200 /* (r) */
+#define CY8_SVCACKM 0x300 /* (r) */
+#define CY16_RESET 0x1400 /* (r) */
+#define CY_CLEAR_INTR 0x1800 /* intr ack address (w) */
#define CY_MAX_CD1400s 8 /* for Cyclom-32Y */
#define CY_CLOCK(version) ((version) >= 0x48 ? 60000000 : 25000000)
#define CY_RTS_DTR_SWAPPED(version) ((version) >= 0x48)
+/*
+ * The `cd' macros are for access to cd1400 registers. The `cy' macros
+ * are for access to Cyclades registers. Both sets of macros scale the
+ * register number to get an offset, but the scales are different for
+ * mostly historical reasons.
+ */
#ifdef CyDebug
-#define cd_inb(iobase, reg, cy_align) (++cd_inbs, *((iobase) + ((reg)*2 << (cy_align))))
-#define cy_inb(iobase, reg) (++cy_inbs, *((iobase) + (reg)))
-#define cd_outb(iobase, reg, cy_align, val) (++cd_outbs, (void)(*((iobase) + ((reg)*2 << (cy_align))) = (val)))
-#define cy_outb(iobase, reg, val) (++cy_outbs, (void)(*((iobase) + (reg)) = (val)))
+#define cd_inb(iobase, reg, cy_align) \
+ (++cd_inbs, *((iobase) + (2 * (reg) << (cy_align))))
+#define cy_inb(iobase, reg, cy_align) \
+ (++cy_inbs, *((iobase) + ((reg) << (cy_align))))
+#define cd_outb(iobase, reg, cy_align, val) \
+ (++cd_outbs, (void)(*((iobase) + (2 * (reg) << (cy_align))) = (val)))
+#define cy_outb(iobase, reg, cy_align, val) \
+ (++cy_outbs, (void)(*((iobase) + ((reg) << (cy_align))) = (val)))
#else
-#define cd_inb(iobase, reg, cy_align) (*((iobase) + ((reg)*2 << (cy_align))))
-#define cy_inb(iobase, reg) (*((iobase) + (reg)))
-#define cd_outb(iobase, reg, cy_align, val) ((void)(*((iobase) + ((reg)*2 << (cy_align))) = (val)))
-#define cy_outb(iobase, reg, val) ((void)(*((iobase) + (reg)) = (val)))
+#define cd_inb(iobase, reg, cy_align) \
+ (*((iobase) + (2 * (reg) << (cy_align))))
+#define cy_inb(iobase, reg, cy_align) \
+ (*((iobase) + ((reg) << (cy_align))))
+#define cd_outb(iobase, reg, cy_align, val) \
+ ((void)(*((iobase) + (2 * (reg) << (cy_align))) = (val)))
+#define cy_outb(iobase, reg, cy_align, val) \
+ ((void)(*((iobase) + ((reg) << (cy_align))) = (val)))
#endif
OpenPOWER on IntegriCloud