|
@@ -224,3 +224,187 @@
|
|
|
|
|
|
/* Interrupt styles
|
|
/* Interrupt styles
|
|
*/
|
|
*/
|
|
|
|
+#define IXP4XX_GPIO_STYLE_ACTIVE_HIGH 0x0
|
|
|
|
+#define IXP4XX_GPIO_STYLE_ACTIVE_LOW 0x1
|
|
|
|
+#define IXP4XX_GPIO_STYLE_RISING_EDGE 0x2
|
|
|
|
+#define IXP4XX_GPIO_STYLE_FALLING_EDGE 0x3
|
|
|
|
+#define IXP4XX_GPIO_STYLE_TRANSITIONAL 0x4
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Mask used to clear interrupt styles
|
|
|
|
+ */
|
|
|
|
+#define IXP4XX_GPIO_STYLE_CLEAR 0x7
|
|
|
|
+#define IXP4XX_GPIO_STYLE_SIZE 3
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Constants to make it easy to access Timer Control/Status registers
|
|
|
|
+ */
|
|
|
|
+#define IXP4XX_OSTS_OFFSET 0x00 /* Continious TimeStamp */
|
|
|
|
+#define IXP4XX_OST1_OFFSET 0x04 /* Timer 1 Timestamp */
|
|
|
|
+#define IXP4XX_OSRT1_OFFSET 0x08 /* Timer 1 Reload */
|
|
|
|
+#define IXP4XX_OST2_OFFSET 0x0C /* Timer 2 Timestamp */
|
|
|
|
+#define IXP4XX_OSRT2_OFFSET 0x10 /* Timer 2 Reload */
|
|
|
|
+#define IXP4XX_OSWT_OFFSET 0x14 /* Watchdog Timer */
|
|
|
|
+#define IXP4XX_OSWE_OFFSET 0x18 /* Watchdog Enable */
|
|
|
|
+#define IXP4XX_OSWK_OFFSET 0x1C /* Watchdog Key */
|
|
|
|
+#define IXP4XX_OSST_OFFSET 0x20 /* Timer Status */
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Operating System Timer Register Definitions.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+#define IXP4XX_TIMER_REG(x) ((volatile u32 *)(IXP4XX_TIMER_BASE_VIRT+(x)))
|
|
|
|
+
|
|
|
|
+#define IXP4XX_OSTS IXP4XX_TIMER_REG(IXP4XX_OSTS_OFFSET)
|
|
|
|
+#define IXP4XX_OST1 IXP4XX_TIMER_REG(IXP4XX_OST1_OFFSET)
|
|
|
|
+#define IXP4XX_OSRT1 IXP4XX_TIMER_REG(IXP4XX_OSRT1_OFFSET)
|
|
|
|
+#define IXP4XX_OST2 IXP4XX_TIMER_REG(IXP4XX_OST2_OFFSET)
|
|
|
|
+#define IXP4XX_OSRT2 IXP4XX_TIMER_REG(IXP4XX_OSRT2_OFFSET)
|
|
|
|
+#define IXP4XX_OSWT IXP4XX_TIMER_REG(IXP4XX_OSWT_OFFSET)
|
|
|
|
+#define IXP4XX_OSWE IXP4XX_TIMER_REG(IXP4XX_OSWE_OFFSET)
|
|
|
|
+#define IXP4XX_OSWK IXP4XX_TIMER_REG(IXP4XX_OSWK_OFFSET)
|
|
|
|
+#define IXP4XX_OSST IXP4XX_TIMER_REG(IXP4XX_OSST_OFFSET)
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Timer register values and bit definitions
|
|
|
|
+ */
|
|
|
|
+#define IXP4XX_OST_ENABLE 0x00000001
|
|
|
|
+#define IXP4XX_OST_ONE_SHOT 0x00000002
|
|
|
|
+/* Low order bits of reload value ignored */
|
|
|
|
+#define IXP4XX_OST_RELOAD_MASK 0x00000003
|
|
|
|
+#define IXP4XX_OST_DISABLED 0x00000000
|
|
|
|
+#define IXP4XX_OSST_TIMER_1_PEND 0x00000001
|
|
|
|
+#define IXP4XX_OSST_TIMER_2_PEND 0x00000002
|
|
|
|
+#define IXP4XX_OSST_TIMER_TS_PEND 0x00000004
|
|
|
|
+#define IXP4XX_OSST_TIMER_WDOG_PEND 0x00000008
|
|
|
|
+#define IXP4XX_OSST_TIMER_WARM_RESET 0x00000010
|
|
|
|
+
|
|
|
|
+#define IXP4XX_WDT_KEY 0x0000482E
|
|
|
|
+
|
|
|
|
+#define IXP4XX_WDT_RESET_ENABLE 0x00000001
|
|
|
|
+#define IXP4XX_WDT_IRQ_ENABLE 0x00000002
|
|
|
|
+#define IXP4XX_WDT_COUNT_ENABLE 0x00000004
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Constants to make it easy to access PCI Control/Status registers
|
|
|
|
+ */
|
|
|
|
+#define PCI_NP_AD_OFFSET 0x00
|
|
|
|
+#define PCI_NP_CBE_OFFSET 0x04
|
|
|
|
+#define PCI_NP_WDATA_OFFSET 0x08
|
|
|
|
+#define PCI_NP_RDATA_OFFSET 0x0c
|
|
|
|
+#define PCI_CRP_AD_CBE_OFFSET 0x10
|
|
|
|
+#define PCI_CRP_WDATA_OFFSET 0x14
|
|
|
|
+#define PCI_CRP_RDATA_OFFSET 0x18
|
|
|
|
+#define PCI_CSR_OFFSET 0x1c
|
|
|
|
+#define PCI_ISR_OFFSET 0x20
|
|
|
|
+#define PCI_INTEN_OFFSET 0x24
|
|
|
|
+#define PCI_DMACTRL_OFFSET 0x28
|
|
|
|
+#define PCI_AHBMEMBASE_OFFSET 0x2c
|
|
|
|
+#define PCI_AHBIOBASE_OFFSET 0x30
|
|
|
|
+#define PCI_PCIMEMBASE_OFFSET 0x34
|
|
|
|
+#define PCI_AHBDOORBELL_OFFSET 0x38
|
|
|
|
+#define PCI_PCIDOORBELL_OFFSET 0x3C
|
|
|
|
+#define PCI_ATPDMA0_AHBADDR_OFFSET 0x40
|
|
|
|
+#define PCI_ATPDMA0_PCIADDR_OFFSET 0x44
|
|
|
|
+#define PCI_ATPDMA0_LENADDR_OFFSET 0x48
|
|
|
|
+#define PCI_ATPDMA1_AHBADDR_OFFSET 0x4C
|
|
|
|
+#define PCI_ATPDMA1_PCIADDR_OFFSET 0x50
|
|
|
|
+#define PCI_ATPDMA1_LENADDR_OFFSET 0x54
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * PCI Control/Status Registers
|
|
|
|
+ */
|
|
|
|
+#define IXP4XX_PCI_CSR(x) ((volatile u32 *)(IXP4XX_PCI_CFG_BASE_VIRT+(x)))
|
|
|
|
+
|
|
|
|
+#define PCI_NP_AD IXP4XX_PCI_CSR(PCI_NP_AD_OFFSET)
|
|
|
|
+#define PCI_NP_CBE IXP4XX_PCI_CSR(PCI_NP_CBE_OFFSET)
|
|
|
|
+#define PCI_NP_WDATA IXP4XX_PCI_CSR(PCI_NP_WDATA_OFFSET)
|
|
|
|
+#define PCI_NP_RDATA IXP4XX_PCI_CSR(PCI_NP_RDATA_OFFSET)
|
|
|
|
+#define PCI_CRP_AD_CBE IXP4XX_PCI_CSR(PCI_CRP_AD_CBE_OFFSET)
|
|
|
|
+#define PCI_CRP_WDATA IXP4XX_PCI_CSR(PCI_CRP_WDATA_OFFSET)
|
|
|
|
+#define PCI_CRP_RDATA IXP4XX_PCI_CSR(PCI_CRP_RDATA_OFFSET)
|
|
|
|
+#define PCI_CSR IXP4XX_PCI_CSR(PCI_CSR_OFFSET)
|
|
|
|
+#define PCI_ISR IXP4XX_PCI_CSR(PCI_ISR_OFFSET)
|
|
|
|
+#define PCI_INTEN IXP4XX_PCI_CSR(PCI_INTEN_OFFSET)
|
|
|
|
+#define PCI_DMACTRL IXP4XX_PCI_CSR(PCI_DMACTRL_OFFSET)
|
|
|
|
+#define PCI_AHBMEMBASE IXP4XX_PCI_CSR(PCI_AHBMEMBASE_OFFSET)
|
|
|
|
+#define PCI_AHBIOBASE IXP4XX_PCI_CSR(PCI_AHBIOBASE_OFFSET)
|
|
|
|
+#define PCI_PCIMEMBASE IXP4XX_PCI_CSR(PCI_PCIMEMBASE_OFFSET)
|
|
|
|
+#define PCI_AHBDOORBELL IXP4XX_PCI_CSR(PCI_AHBDOORBELL_OFFSET)
|
|
|
|
+#define PCI_PCIDOORBELL IXP4XX_PCI_CSR(PCI_PCIDOORBELL_OFFSET)
|
|
|
|
+#define PCI_ATPDMA0_AHBADDR IXP4XX_PCI_CSR(PCI_ATPDMA0_AHBADDR_OFFSET)
|
|
|
|
+#define PCI_ATPDMA0_PCIADDR IXP4XX_PCI_CSR(PCI_ATPDMA0_PCIADDR_OFFSET)
|
|
|
|
+#define PCI_ATPDMA0_LENADDR IXP4XX_PCI_CSR(PCI_ATPDMA0_LENADDR_OFFSET)
|
|
|
|
+#define PCI_ATPDMA1_AHBADDR IXP4XX_PCI_CSR(PCI_ATPDMA1_AHBADDR_OFFSET)
|
|
|
|
+#define PCI_ATPDMA1_PCIADDR IXP4XX_PCI_CSR(PCI_ATPDMA1_PCIADDR_OFFSET)
|
|
|
|
+#define PCI_ATPDMA1_LENADDR IXP4XX_PCI_CSR(PCI_ATPDMA1_LENADDR_OFFSET)
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * PCI register values and bit definitions
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+/* CSR bit definitions */
|
|
|
|
+#define PCI_CSR_HOST 0x00000001
|
|
|
|
+#define PCI_CSR_ARBEN 0x00000002
|
|
|
|
+#define PCI_CSR_ADS 0x00000004
|
|
|
|
+#define PCI_CSR_PDS 0x00000008
|
|
|
|
+#define PCI_CSR_ABE 0x00000010
|
|
|
|
+#define PCI_CSR_DBT 0x00000020
|
|
|
|
+#define PCI_CSR_ASE 0x00000100
|
|
|
|
+#define PCI_CSR_IC 0x00008000
|
|
|
|
+
|
|
|
|
+/* ISR (Interrupt status) Register bit definitions */
|
|
|
|
+#define PCI_ISR_PSE 0x00000001
|
|
|
|
+#define PCI_ISR_PFE 0x00000002
|
|
|
|
+#define PCI_ISR_PPE 0x00000004
|
|
|
|
+#define PCI_ISR_AHBE 0x00000008
|
|
|
|
+#define PCI_ISR_APDC 0x00000010
|
|
|
|
+#define PCI_ISR_PADC 0x00000020
|
|
|
|
+#define PCI_ISR_ADB 0x00000040
|
|
|
|
+#define PCI_ISR_PDB 0x00000080
|
|
|
|
+
|
|
|
|
+/* INTEN (Interrupt Enable) Register bit definitions */
|
|
|
|
+#define PCI_INTEN_PSE 0x00000001
|
|
|
|
+#define PCI_INTEN_PFE 0x00000002
|
|
|
|
+#define PCI_INTEN_PPE 0x00000004
|
|
|
|
+#define PCI_INTEN_AHBE 0x00000008
|
|
|
|
+#define PCI_INTEN_APDC 0x00000010
|
|
|
|
+#define PCI_INTEN_PADC 0x00000020
|
|
|
|
+#define PCI_INTEN_ADB 0x00000040
|
|
|
|
+#define PCI_INTEN_PDB 0x00000080
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Shift value for byte enable on NP cmd/byte enable register
|
|
|
|
+ */
|
|
|
|
+#define IXP4XX_PCI_NP_CBE_BESL 4
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * PCI commands supported by NP access unit
|
|
|
|
+ */
|
|
|
|
+#define NP_CMD_IOREAD 0x2
|
|
|
|
+#define NP_CMD_IOWRITE 0x3
|
|
|
|
+#define NP_CMD_CONFIGREAD 0xa
|
|
|
|
+#define NP_CMD_CONFIGWRITE 0xb
|
|
|
|
+#define NP_CMD_MEMREAD 0x6
|
|
|
|
+#define NP_CMD_MEMWRITE 0x7
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Constants for CRP access into local config space
|
|
|
|
+ */
|
|
|
|
+#define CRP_AD_CBE_BESL 20
|
|
|
|
+#define CRP_AD_CBE_WRITE 0x00010000
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * USB Device Controller
|
|
|
|
+ *
|
|
|
|
+ * These are used by the USB gadget driver, so they don't follow the
|
|
|
|
+ * IXP4XX_ naming convetions.
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+# define IXP4XX_USB_REG(x) (*((volatile u32 *)(x)))
|
|
|
|
+
|
|
|
|
+/* UDC Undocumented - Reserved1 */
|
|
|
|
+#define UDC_RES1 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0004)
|
|
|
|
+/* UDC Undocumented - Reserved2 */
|