Go to the documentation of this file.
35 #ifndef __NLM_HAL_IOMAP_H__
36 #define __NLM_HAL_IOMAP_H__
38 #define XLP_DEFAULT_IO_BASE 0x18000000
39 #define XLP_DEFAULT_PCI_ECFG_BASE XLP_DEFAULT_IO_BASE
40 #define XLP_DEFAULT_PCI_CFG_BASE 0x1c000000
42 #define NMI_BASE 0xbfc00000
43 #define XLP_IO_CLK 133333333
45 #define XLP_PCIE_CFG_SIZE 0x1000
46 #define XLP_PCIE_DEV_BLK_SIZE (8 * XLP_PCIE_CFG_SIZE)
47 #define XLP_PCIE_BUS_BLK_SIZE (256 * XLP_PCIE_DEV_BLK_SIZE)
48 #define XLP_IO_SIZE (64 << 20)
49 #define XLP_IO_PCI_HDRSZ 0x100
50 #define XLP_IO_DEV(node, dev) ((dev) + (node) * 8)
51 #define XLP_HDR_OFFSET(node, bus, dev, fn) (((bus) << 20) | \
52 ((XLP_IO_DEV(node, dev)) << 15) | ((fn) << 12))
54 #define XLP_IO_BRIDGE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 0)
56 #define XLP_IO_CIC0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 1)
57 #define XLP_IO_CIC1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 2)
58 #define XLP_IO_CIC2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 3)
59 #define XLP_IO_PIC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 4)
61 #define XLP_IO_PCIE_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 1, i)
62 #define XLP_IO_PCIE0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 0)
63 #define XLP_IO_PCIE1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 1)
64 #define XLP_IO_PCIE2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 2)
65 #define XLP_IO_PCIE3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 3)
67 #define XLP_IO_USB_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 2, i)
68 #define XLP_IO_USB_EHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 0)
69 #define XLP_IO_USB_OHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 1)
70 #define XLP_IO_USB_OHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 2)
71 #define XLP_IO_USB_EHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 3)
72 #define XLP_IO_USB_OHCI2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 4)
73 #define XLP_IO_USB_OHCI3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 5)
75 #define XLP_IO_NAE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 0)
76 #define XLP_IO_POE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 1)
78 #define XLP_IO_CMS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 0)
80 #define XLP_IO_DMA_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 1)
81 #define XLP_IO_SEC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 2)
82 #define XLP_IO_CMP_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 3)
84 #define XLP_IO_UART_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, i)
85 #define XLP_IO_UART0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 0)
86 #define XLP_IO_UART1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 1)
87 #define XLP_IO_I2C_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, 2 + i)
88 #define XLP_IO_I2C0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 2)
89 #define XLP_IO_I2C1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 3)
90 #define XLP_IO_GPIO_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 4)
92 #define XLP_IO_SYS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 5)
93 #define XLP_IO_JTAG_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 6)
95 #define XLP_IO_NOR_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 0)
96 #define XLP_IO_NAND_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 1)
97 #define XLP_IO_SPI_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 2)
99 #define XLP_IO_SD_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 3)
100 #define XLP_IO_MMC_OFFSET(node, slot) \
101 ((XLP_IO_SD_OFFSET(node))+(slot*0x100)+XLP_IO_PCI_HDRSZ)
104 #define XLP_PCI_CFGREG0 0x00
105 #define XLP_PCI_CFGREG1 0x01
106 #define XLP_PCI_CFGREG2 0x02
107 #define XLP_PCI_CFGREG3 0x03
108 #define XLP_PCI_CFGREG4 0x04
109 #define XLP_PCI_CFGREG5 0x05
110 #define XLP_PCI_DEVINFO_REG0 0x30
111 #define XLP_PCI_DEVINFO_REG1 0x31
112 #define XLP_PCI_DEVINFO_REG2 0x32
113 #define XLP_PCI_DEVINFO_REG3 0x33
114 #define XLP_PCI_DEVINFO_REG4 0x34
115 #define XLP_PCI_DEVINFO_REG5 0x35
116 #define XLP_PCI_DEVINFO_REG6 0x36
117 #define XLP_PCI_DEVINFO_REG7 0x37
118 #define XLP_PCI_DEVSCRATCH_REG0 0x38
119 #define XLP_PCI_DEVSCRATCH_REG1 0x39
120 #define XLP_PCI_DEVSCRATCH_REG2 0x3a
121 #define XLP_PCI_DEVSCRATCH_REG3 0x3b
122 #define XLP_PCI_MSGSTN_REG 0x3c
123 #define XLP_PCI_IRTINFO_REG 0x3d
124 #define XLP_PCI_UCODEINFO_REG 0x3e
125 #define XLP_PCI_SBB_WT_REG 0x3f
128 #define PCI_VENDOR_NETLOGIC 0x184e
130 #define PCI_DEVICE_ID_NLM_ROOT 0x1001
131 #define PCI_DEVICE_ID_NLM_ICI 0x1002
132 #define PCI_DEVICE_ID_NLM_PIC 0x1003
133 #define PCI_DEVICE_ID_NLM_PCIE 0x1004
134 #define PCI_DEVICE_ID_NLM_EHCI 0x1007
135 #define PCI_DEVICE_ID_NLM_OHCI 0x1008
136 #define PCI_DEVICE_ID_NLM_NAE 0x1009
137 #define PCI_DEVICE_ID_NLM_POE 0x100A
138 #define PCI_DEVICE_ID_NLM_FMN 0x100B
139 #define PCI_DEVICE_ID_NLM_RAID 0x100D
140 #define PCI_DEVICE_ID_NLM_SAE 0x100D
141 #define PCI_DEVICE_ID_NLM_RSA 0x100E
142 #define PCI_DEVICE_ID_NLM_CMP 0x100F
143 #define PCI_DEVICE_ID_NLM_UART 0x1010
144 #define PCI_DEVICE_ID_NLM_I2C 0x1011
145 #define PCI_DEVICE_ID_NLM_NOR 0x1015
146 #define PCI_DEVICE_ID_NLM_NAND 0x1016
147 #define PCI_DEVICE_ID_NLM_MMC 0x1018
151 #define nlm_read_pci_reg(b, r) nlm_read_reg(b, r)
152 #define nlm_write_pci_reg(b, r, v) nlm_write_reg(b, r, v)