Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / asm-arm / arch-ixp2000 / ixp2000-regs.h
index 9c8b21d..ccae4be 100644 (file)
 #ifndef _IXP2000_REGS_H_
 #define _IXP2000_REGS_H_
 
+/*
+ * IXP2000 linux memory map:
+ *
+ * virt                phys            size
+ * fb000000    db000000        16M             PCI CFG1
+ * fc000000    da000000        16M             PCI CFG0
+ * fd000000    d8000000        16M             PCI I/O
+ * fe[0-7]00000                        8M              per-platform mappings
+ * fe900000    80000000        1M              SRAM #0 (first MB)
+ * fea00000    cb400000        1M              SCRATCH ring get/put
+ * feb00000    c8000000        1M              MSF
+ * fec00000    df000000        1M              PCI CSRs
+ * fed00000    de000000        1M              PCI CREG
+ * fee00000    d6000000        1M              INTCTL
+ * fef00000    c0000000        1M              CAP
+ */
+
 /* 
- * Static I/O regions. The manual defines each region as being several
- * MB in size, but all the registers are within the first 4K, so there's
- * no purpose in mapping the whole region in.
+ * Static I/O regions.
+ *
+ * Most of the registers are clumped in 4K regions spread throughout
+ * the 0xc0000000 -> 0xc0100000 address range, but we just map in
+ * the whole range using a single 1 MB section instead of small
+ * 4K pages.  This has two advantages for us:
+ *
+ * 1) We use only one TLB entry for large number of on-chip I/O devices.
+ *
+ * 2) We can easily set the Section attributes to XCB=101 on the IXP2400
+ *    as required per erratum #66.  We accomplish this by using a
+ *    new MT_IXP2000_DEVICE memory type with the bits set as required.
+ *
+ * CAP stands for CSR Access Proxy.
+ *
+ * If you change the virtual address of this mapping, please propagate
+ * the change to arch/arm/kernel/debug.S, which hardcodes the virtual
+ * address of the UART located in this region.
  */
-#define        IXP2000_SLOWPORT_CSR_PHYS_BASE  0xc0080000
-#define        IXP2000_SLOWPORT_CSR_VIRT_BASE  0xfefff000
-#define        IXP2000_SLOWPORT_CSR_SIZE       0x1000
 
-#define        IXP2000_GLOBAL_REG_PHYS_BASE    0xc0004000
-#define        IXP2000_GLOBAL_REG_VIRT_BASE    0xfeffe000
-#define        IXP2000_GLOBAL_REG_SIZE         0x1000
+#define        IXP2000_CAP_PHYS_BASE           0xc0000000
+#define        IXP2000_CAP_VIRT_BASE           0xfef00000
+#define        IXP2000_CAP_SIZE                0x00100000
 
+/*
+ * Addresses for specific on-chip peripherals.
+ */
+#define        IXP2000_SLOWPORT_CSR_VIRT_BASE  0xfef80000
+#define        IXP2000_GLOBAL_REG_VIRT_BASE    0xfef04000
 #define        IXP2000_UART_PHYS_BASE          0xc0030000
 #define        IXP2000_UART_VIRT_BASE          0xfef30000
-#define IXP2000_UART_SIZE              0x1000
-
-#define        IXP2000_TIMER_PHYS_BASE         0xc0020000
-#define        IXP2000_TIMER_VIRT_BASE         0xfeffc000
-#define        IXP2000_TIMER_SIZE              0x1000
-
-#define        IXP2000_GPIO_PHYS_BASE          0xc0010000
-#define        IXP2000_GPIO_VIRT_BASE          0xfeffb000
-#define        IXP2000_GPIO_SIZE               0x1000
+#define        IXP2000_TIMER_VIRT_BASE         0xfef20000
+#define        IXP2000_UENGINE_CSR_VIRT_BASE   0xfef18000
+#define        IXP2000_GPIO_VIRT_BASE          0xfef10000
 
+/*
+ * Devices outside of the 0xc0000000 -> 0xc0100000 range.  The virtual
+ * addresses of the INTCTL and PCI_CSR mappings are hardcoded in
+ * entry-macro.S, so if you ever change these please propagate
+ * the change.
+ */
 #define IXP2000_INTCTL_PHYS_BASE       0xd6000000
-#define        IXP2000_INTCTL_VIRT_BASE        0xfeffa000
-#define        IXP2000_INTCTL_SIZE             0x01000
+#define        IXP2000_INTCTL_VIRT_BASE        0xfee00000
+#define        IXP2000_INTCTL_SIZE             0x00100000
 
 #define IXP2000_PCI_CREG_PHYS_BASE     0xde000000
-#define        IXP2000_PCI_CREG_VIRT_BASE      0xfeff0000
-#define        IXP2000_PCI_CREG_SIZE           0x1000
+#define        IXP2000_PCI_CREG_VIRT_BASE      0xfed00000
+#define        IXP2000_PCI_CREG_SIZE           0x00100000
 
 #define IXP2000_PCI_CSR_PHYS_BASE      0xdf000000
-#define        IXP2000_PCI_CSR_VIRT_BASE       0xfefde000
-#define        IXP2000_PCI_CSR_SIZE            0x1000
+#define        IXP2000_PCI_CSR_VIRT_BASE       0xfec00000
+#define        IXP2000_PCI_CSR_SIZE            0x00100000
+
+#define IXP2000_MSF_PHYS_BASE          0xc8000000
+#define IXP2000_MSF_VIRT_BASE          0xfeb00000
+#define IXP2000_MSF_SIZE               0x00100000
+
+#define IXP2000_SCRATCH_RING_PHYS_BASE 0xcb400000
+#define IXP2000_SCRATCH_RING_VIRT_BASE 0xfea00000
+#define IXP2000_SCRATCH_RING_SIZE      0x00100000
+
+#define IXP2000_SRAM0_PHYS_BASE                0x80000000
+#define IXP2000_SRAM0_VIRT_BASE                0xfe900000
+#define IXP2000_SRAM0_SIZE             0x00100000
 
 #define IXP2000_PCI_IO_PHYS_BASE       0xd8000000
 #define        IXP2000_PCI_IO_VIRT_BASE        0xfd000000
 #define IXP2000_PCI_CFG1_VIRT_BASE     0xfb000000
 #define IXP2000_PCI_CFG1_SIZE          0x01000000
 
-
 /* 
  * Timers
  */
 #define        WDT_ENABLE                      0x00000001
 #define        TIMER_DIVIDER_256               0x00000008
 #define        TIMER_ENABLE                    0x00000080
+#define        IRQ_MASK_TIMER1                 (1 << 4)
 
 /*
  * Interrupt controller registers
 #define IXP2000_IRQ_ERR_ENABLE_SET     IXP2000_INTCTL_REG(0x2c)
 #define IXP2000_FIQ_ERR_ENABLE_CLR     IXP2000_INTCTL_REG(0x30)
 #define IXP2000_IRQ_ERR_ENABLE_CLR     IXP2000_INTCTL_REG(0x34)
+#define IXP2000_IRQ_THD_RAW_STATUS_A_0 IXP2000_INTCTL_REG(0x60)
+#define IXP2000_IRQ_THD_RAW_STATUS_A_1 IXP2000_INTCTL_REG(0x64)
+#define IXP2000_IRQ_THD_RAW_STATUS_A_2 IXP2000_INTCTL_REG(0x68)
+#define IXP2000_IRQ_THD_RAW_STATUS_A_3 IXP2000_INTCTL_REG(0x6c)
+#define IXP2000_IRQ_THD_RAW_STATUS_B_0 IXP2000_INTCTL_REG(0x80)
+#define IXP2000_IRQ_THD_RAW_STATUS_B_1 IXP2000_INTCTL_REG(0x84)
+#define IXP2000_IRQ_THD_RAW_STATUS_B_2 IXP2000_INTCTL_REG(0x88)
+#define IXP2000_IRQ_THD_RAW_STATUS_B_3 IXP2000_INTCTL_REG(0x8c)
+#define IXP2000_IRQ_THD_STATUS_A_0     IXP2000_INTCTL_REG(0xe0)
+#define IXP2000_IRQ_THD_STATUS_A_1     IXP2000_INTCTL_REG(0xe4)
+#define IXP2000_IRQ_THD_STATUS_A_2     IXP2000_INTCTL_REG(0xe8)
+#define IXP2000_IRQ_THD_STATUS_A_3     IXP2000_INTCTL_REG(0xec)
+#define IXP2000_IRQ_THD_STATUS_B_0     IXP2000_INTCTL_REG(0x100)
+#define IXP2000_IRQ_THD_STATUS_B_1     IXP2000_INTCTL_REG(0x104)
+#define IXP2000_IRQ_THD_STATUS_B_2     IXP2000_INTCTL_REG(0x108)
+#define IXP2000_IRQ_THD_STATUS_B_3     IXP2000_INTCTL_REG(0x10c)
+#define IXP2000_IRQ_THD_ENABLE_SET_A_0 IXP2000_INTCTL_REG(0x160)
+#define IXP2000_IRQ_THD_ENABLE_SET_A_1 IXP2000_INTCTL_REG(0x164)
+#define IXP2000_IRQ_THD_ENABLE_SET_A_2 IXP2000_INTCTL_REG(0x168)
+#define IXP2000_IRQ_THD_ENABLE_SET_A_3 IXP2000_INTCTL_REG(0x16c)
+#define IXP2000_IRQ_THD_ENABLE_SET_B_0 IXP2000_INTCTL_REG(0x180)
+#define IXP2000_IRQ_THD_ENABLE_SET_B_1 IXP2000_INTCTL_REG(0x184)
+#define IXP2000_IRQ_THD_ENABLE_SET_B_2 IXP2000_INTCTL_REG(0x188)
+#define IXP2000_IRQ_THD_ENABLE_SET_B_3 IXP2000_INTCTL_REG(0x18c)
+#define IXP2000_IRQ_THD_ENABLE_CLEAR_A_0       IXP2000_INTCTL_REG(0x1e0)
+#define IXP2000_IRQ_THD_ENABLE_CLEAR_A_1       IXP2000_INTCTL_REG(0x1e4)
+#define IXP2000_IRQ_THD_ENABLE_CLEAR_A_2       IXP2000_INTCTL_REG(0x1e8)
+#define IXP2000_IRQ_THD_ENABLE_CLEAR_A_3       IXP2000_INTCTL_REG(0x1ec)
+#define IXP2000_IRQ_THD_ENABLE_CLEAR_B_0       IXP2000_INTCTL_REG(0x200)
+#define IXP2000_IRQ_THD_ENABLE_CLEAR_B_1       IXP2000_INTCTL_REG(0x204)
+#define IXP2000_IRQ_THD_ENABLE_CLEAR_B_2       IXP2000_INTCTL_REG(0x208)
+#define IXP2000_IRQ_THD_ENABLE_CLEAR_B_3       IXP2000_INTCTL_REG(0x20c)
 
 /*
  * Mask of valid IRQs in the 32-bit IRQ register. We use
- * this to mark certain IRQs as being in-valid.
+ * this to mark certain IRQs as being invalid.
  */
 #define        IXP2000_VALID_IRQ_MASK  0x0f0fffff
 
 #define IXP2000_PCI_XSCALE_INT_ENABLE  IXP2000_PCI_CSR(0x15C)
 
 #define IXP2000_PCICNTL_PNR            (1<<17) /* PCI not Reset bit of PCI_CONTROL */
-#define IXP2000_PCICNTL_PCF            (1<<28) /* PCI Centrolfunction bit */
-#define IXP2000_XSCALE_INT             (1<<1)  /* Interrupt from  XScale to PCI */
+#define IXP2000_PCICNTL_PCF            (1<<28) /* PCI Central function bit */
+#define IXP2000_XSCALE_INT             (1<<1)  /* Interrupt from XScale to PCI */
 
 /* These are from the IRQ register in the PCI ISR register */
 #define PCI_CONTROL_BE_DEO             (1 << 22)       /* Big Endian Data Enable Out */
 #define PCI_CONTROL_BE_DEI             (1 << 21)       /* Big Endian Data Enable In  */
 #define PCI_CONTROL_BE_BEO             (1 << 20)       /* Big Endian Byte Enable Out */
 #define PCI_CONTROL_BE_BEI             (1 << 19)       /* Big Endian Byte Enable In  */
-#define PCI_CONTROL_PNR                        (1 << 17)       /* PCI Not Reset bit */
+#define PCI_CONTROL_IEE                        (1 << 17)       /* I/O cycle Endian swap Enable */
 
 #define IXP2000_PCI_RST_REL            (1 << 2)
 #define CFG_RST_DIR                    (*IXP2000_PCI_CONTROL & IXP2000_PCICNTL_PCF)
 #define        SLOWPORT_CCR_DIV_30             0x0f
 
 /*
- * PCR values.  PCR configure the mode of the interfac3
+ * PCR values.  PCR configure the mode of the interface.
  */
 #define        SLOWPORT_MODE_FLASH             0x00
 #define        SLOWPORT_MODE_LUCENT            0x01
 #define        SLOWPORT_MODE_MOTOROLA_UP       0x04
 
 /*
- * ADC values.  Defines data and address bus widths
+ * ADC values.  Defines data and address bus widths.
  */
 #define        SLOWPORT_ADDR_WIDTH_8           0x00
 #define        SLOWPORT_ADDR_WIDTH_16          0x01
 #define        SLOWPORT_DATA_WIDTH_32          0x30
 
 /*
- * Masks and shifts for various fields in the WTC and RTC registers
+ * Masks and shifts for various fields in the WTC and RTC registers.
  */
 #define        SLOWPORT_WRTC_MASK_HD           0x0003
-#define        SLOWPORT_WRTC_MASK_SU           0x003c
-#define        SLOWPORT_WRTC_MASK_PW           0x03c0
+#define        SLOWPORT_WRTC_MASK_PW           0x003c
+#define        SLOWPORT_WRTC_MASK_SU           0x03c0
 
 #define        SLOWPORT_WRTC_SHIFT_HD          0x00
 #define        SLOWPORT_WRTC_SHIFT_SU          0x02
 
 
 /*
- * GPIO registers & GPIO interface
+ * GPIO registers & GPIO interface.
  */
 #define IXP2000_GPIO_REG(x)            ((volatile unsigned long*)(IXP2000_GPIO_VIRT_BASE+(x)))
 #define IXP2000_GPIO_PLR               IXP2000_GPIO_REG(0x00)
 #define GLOBAL_REG_BASE                        (IXP2000_GLOBAL_REG_VIRT_BASE + 0x0a00)
 #define GLOBAL_REG(x)                  (volatile unsigned long*)(GLOBAL_REG_BASE | (x))
 
-#define IXP2000_PROD_ID                        GLOBAL_REG(0x00)
-
 #define IXP2000_MAJ_PROD_TYPE_MASK     0x001F0000
 #define IXP2000_MAJ_PROD_TYPE_IXP2000  0x00000000
 #define IXP2000_MIN_PROD_TYPE_MASK     0x0000FF00
 #define IXP2000_MIN_REV_MASK           0x0000000F
 #define IXP2000_PROD_ID_MASK           0xFFFFFFFF
 
+#define IXP2000_PRODUCT_ID             GLOBAL_REG(0x00)
 #define IXP2000_MISC_CONTROL           GLOBAL_REG(0x04)
 #define IXP2000_MSF_CLK_CNTRL                  GLOBAL_REG(0x08)
 #define IXP2000_RESET0                 GLOBAL_REG(0x0c)
 #define        WDT_RESET_ENABLE                0x01000000
 
 
+/*
+ * MSF registers.  The IXP2400 and IXP2800 have somewhat different MSF
+ * units, but the registers that differ between the two don't overlap,
+ * so we can have one register list for both.
+ */
+#define IXP2000_MSF_REG(x)                     ((volatile unsigned long*)(IXP2000_MSF_VIRT_BASE + (x)))
+#define IXP2000_MSF_RX_CONTROL                 IXP2000_MSF_REG(0x0000)
+#define IXP2000_MSF_TX_CONTROL                 IXP2000_MSF_REG(0x0004)
+#define IXP2000_MSF_INTERRUPT_STATUS           IXP2000_MSF_REG(0x0008)
+#define IXP2000_MSF_INTERRUPT_ENABLE           IXP2000_MSF_REG(0x000c)
+#define IXP2000_MSF_CSIX_TYPE_MAP              IXP2000_MSF_REG(0x0010)
+#define IXP2000_MSF_FC_EGRESS_STATUS           IXP2000_MSF_REG(0x0014)
+#define IXP2000_MSF_FC_INGRESS_STATUS          IXP2000_MSF_REG(0x0018)
+#define IXP2000_MSF_HWM_CONTROL                        IXP2000_MSF_REG(0x0024)
+#define IXP2000_MSF_FC_STATUS_OVERRIDE         IXP2000_MSF_REG(0x0028)
+#define IXP2000_MSF_CLOCK_CONTROL              IXP2000_MSF_REG(0x002c)
+#define IXP2000_MSF_RX_PORT_MAP                        IXP2000_MSF_REG(0x0040)
+#define IXP2000_MSF_RBUF_ELEMENT_DONE          IXP2000_MSF_REG(0x0044)
+#define IXP2000_MSF_RX_MPHY_POLL_LIMIT         IXP2000_MSF_REG(0x0048)
+#define IXP2000_MSF_RX_CALENDAR_LENGTH         IXP2000_MSF_REG(0x0048)
+#define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_0       IXP2000_MSF_REG(0x0050)
+#define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_1       IXP2000_MSF_REG(0x0054)
+#define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_2       IXP2000_MSF_REG(0x0058)
+#define IXP2000_MSF_TX_SEQUENCE_0              IXP2000_MSF_REG(0x0060)
+#define IXP2000_MSF_TX_SEQUENCE_1              IXP2000_MSF_REG(0x0064)
+#define IXP2000_MSF_TX_SEQUENCE_2              IXP2000_MSF_REG(0x0068)
+#define IXP2000_MSF_TX_MPHY_POLL_LIMIT         IXP2000_MSF_REG(0x0070)
+#define IXP2000_MSF_TX_CALENDAR_LENGTH         IXP2000_MSF_REG(0x0070)
+#define IXP2000_MSF_RX_UP_CONTROL_0            IXP2000_MSF_REG(0x0080)
+#define IXP2000_MSF_RX_UP_CONTROL_1            IXP2000_MSF_REG(0x0084)
+#define IXP2000_MSF_RX_UP_CONTROL_2            IXP2000_MSF_REG(0x0088)
+#define IXP2000_MSF_RX_UP_CONTROL_3            IXP2000_MSF_REG(0x008c)
+#define IXP2000_MSF_TX_UP_CONTROL_0            IXP2000_MSF_REG(0x0090)
+#define IXP2000_MSF_TX_UP_CONTROL_1            IXP2000_MSF_REG(0x0094)
+#define IXP2000_MSF_TX_UP_CONTROL_2            IXP2000_MSF_REG(0x0098)
+#define IXP2000_MSF_TX_UP_CONTROL_3            IXP2000_MSF_REG(0x009c)
+#define IXP2000_MSF_TRAIN_DATA                 IXP2000_MSF_REG(0x00a0)
+#define IXP2000_MSF_TRAIN_CALENDAR             IXP2000_MSF_REG(0x00a4)
+#define IXP2000_MSF_TRAIN_FLOW_CONTROL         IXP2000_MSF_REG(0x00a8)
+#define IXP2000_MSF_TX_CALENDAR_0              IXP2000_MSF_REG(0x1000)
+#define IXP2000_MSF_RX_PORT_CALENDAR_STATUS    IXP2000_MSF_REG(0x1400)
+
+
 #endif                         /* _IXP2000_H_ */