summaryrefslogtreecommitdiff
path: root/sys/arch/i386/pci/via8231reg.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386/pci/via8231reg.h')
-rw-r--r--sys/arch/i386/pci/via8231reg.h50
1 files changed, 44 insertions, 6 deletions
diff --git a/sys/arch/i386/pci/via8231reg.h b/sys/arch/i386/pci/via8231reg.h
index d8f563fab40..c7cbd7cdba8 100644
--- a/sys/arch/i386/pci/via8231reg.h
+++ b/sys/arch/i386/pci/via8231reg.h
@@ -1,6 +1,7 @@
-/* $OpenBSD: via8231reg.h,v 1.1 2003/07/30 05:26:33 mickey Exp $ */
+/* $OpenBSD: via8231reg.h,v 1.2 2005/10/20 15:09:31 mickey Exp $ */
/*
+ * Copyright (c) 2005, by Michael Shalayeff
* Copyright (c) 2003, by Matthew Gream
* Copyright (c) 1999, by UCHIYAMA Yasushi
* All rights reserved.
@@ -50,49 +51,86 @@
* (0x57)
* bits 7-4: PINTD# Routing
* bits 3-0: reserved
+ * PIRQ Select register. (0x44 - 0x47)
+ * (0x44)
+ * bits 7-4: PINTF# Routing
+ * bits 3-0: PINTE# Routing
+ * (0x45)
+ * bits 7-4: PINTH# Routing
+ * bits 3-0: PINTG# Routing
+ * (0x46)
+ * bit 4: EFGH/ABCD share (1 -- use above mappings)
+ * bit 3: Edge Triggered Interrupt Select for PCI Interrupt H
+ * bit 2: Edge Triggered Interrupt Select for PCI Interrupt G
+ * bit 1: Edge Triggered Interrupt Select for PCI Interrupt F
+ * bit 0: Edge Triggered Interrupt Select for PCI Interrupt E
+ *
* 0000: Disabled 0100: IRQ4 1000: Reserved 1100: IRQ12
* 0001: IRQ1 0101: IRQ5 1001: IRQ9 1101: Reserved
* 0010: Reserved 0110: IRQ6 1010: IRQ10 1110: IRQ14
* 0011: IRQ3 0111: IRQ7 1011: IRQ11 1111: IRQ15
*/
-#define VIA8231_CFG_PIR 0x54
-
+#define VIA8231_CFG_PIR 0x54
+#define VIA8237_CFG_PIR 0x44
#define VIA8231_TRIGGER_CNFG_MASK 0x000000ff
#define VIA8231_TRIGGER_CNFG_SHFT 0
+#define VIA8237_TRIGGER_CNFG_MASK 0x00ff0000
+#define VIA8237_TRIGGER_CNFG_SHFT 16
#define VIA8231_TRIGGER_CNFG_LEVEL 0
#define VIA8231_TRIGGER_CNFG_EDGE 1
+#define VIA8237_TRIGGER_CNFG_ENA 0x100000
#define VIA8231_GET_TRIGGER(ph) \
((pci_conf_read((ph)->ph_pc, (ph)->ph_tag, VIA8231_CFG_PIR) \
- & VIA8231_TRIGGER_CNFG_MASK) >> VIA8231_TRIGGER_CNFG_SHFT)
+ & VIA8231_TRIGGER_CNFG_MASK) >> VIA8231_TRIGGER_CNFG_SHFT)
+#define VIA8237_GET_TRIGGER(ph) \
+ ((pci_conf_read((ph)->ph_pc, (ph)->ph_tag, VIA8237_CFG_PIR) \
+ & VIA8237_TRIGGER_CNFG_MASK) >> VIA8237_TRIGGER_CNFG_SHFT)
#define VIA8231_SET_TRIGGER(ph, n) \
pci_conf_write((ph)->ph_pc, (ph)->ph_tag, VIA8231_CFG_PIR, \
(pci_conf_read((ph)->ph_pc, (ph)->ph_tag, VIA8231_CFG_PIR) \
& ~VIA8231_TRIGGER_CNFG_MASK) | ((n) << VIA8231_TRIGGER_CNFG_SHFT))
+#define VIA8237_SET_TRIGGER(ph, n) \
+ pci_conf_write((ph)->ph_pc, (ph)->ph_tag, VIA8237_CFG_PIR, \
+ (pci_conf_read((ph)->ph_pc, (ph)->ph_tag, VIA8237_CFG_PIR) \
+ & ~VIA8237_TRIGGER_CNFG_MASK) | ((n) << VIA8237_TRIGGER_CNFG_SHFT))
#define VIA8231_ROUTING_CNFG_MASK 0xffffff00
#define VIA8231_ROUTING_CNFG_SHFT 8 /* skip 0x54 triggers */
#define VIA8231_ROUTING_CNFG_DISABLED 0
+#define VIA8237_ROUTING_CNFG_MASK 0xffff
+#define VIA8237_ROUTING_CNFG_SHFT 0
#define VIA8231_GET_ROUTING(ph) \
((pci_conf_read((ph)->ph_pc, (ph)->ph_tag, VIA8231_CFG_PIR) \
- & VIA8231_ROUTING_CNFG_MASK) >> VIA8231_ROUTING_CNFG_SHFT)
+ & VIA8237_ROUTING_CNFG_MASK) >> VIA8231_ROUTING_CNFG_SHFT)
+#define VIA8237_GET_ROUTING(ph) \
+ ((pci_conf_read((ph)->ph_pc, (ph)->ph_tag, VIA8237_CFG_PIR) \
+ & VIA8231_ROUTING_CNFG_MASK) >> VIA8237_ROUTING_CNFG_SHFT)
#define VIA8231_SET_ROUTING(ph, n) \
pci_conf_write((ph)->ph_pc, (ph)->ph_tag, VIA8231_CFG_PIR, \
(pci_conf_read((ph)->ph_pc, (ph)->ph_tag, VIA8231_CFG_PIR) \
& ~VIA8231_ROUTING_CNFG_MASK) | ((n) << VIA8231_ROUTING_CNFG_SHFT))
+#define VIA8237_SET_ROUTING(ph, n) \
+ pci_conf_write((ph)->ph_pc, (ph)->ph_tag, VIA8237_CFG_PIR, \
+ (pci_conf_read((ph)->ph_pc, (ph)->ph_tag, VIA8237_CFG_PIR) \
+ & ~VIA8237_ROUTING_CNFG_MASK) | \
+ ((n) << VIA8237_ROUTING_CNFG_SHFT) | VIA8237_TRIGGER_CNFG_ENA)
#define VIA8231_PIRQ_MASK 0xdefa
#define VIA8231_PIRQ_LEGAL(irq) \
- ((irq) >= 0 && (irq) <= 15 && ((1 << (irq)) & VIA8231_PIRQ_MASK) != 0)
+ ((irq) >= 0 && (irq) <= 15 && ((1 << (irq)) & VIA8231_PIRQ_MASK))
#define VIA8231_LINK_MAX 3
+#define VIA8237_LINK_MAX 7
#define VIA8231_LINK_LEGAL(link) \
((link) >= 0 && (link) <= VIA8231_LINK_MAX)
+#define VIA8237_LINK_LEGAL(link) \
+ ((link) >= 0 && (link) <= VIA8237_LINK_MAX)
#define VIA8231_TRIG_LEGAL(trig) \
((trig) == IST_LEVEL || (trig) == IST_EDGE)