no-OS
parameters.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef __PARAMETERS_H__
34 #define __PARAMETERS_H__
35 
36 #ifdef XILINX_PLATFORM
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #include <xparameters.h>
41 
42 /******************************************************************************/
43 /********************** Macros and Constants Definitions **********************/
44 /******************************************************************************/
45 #ifdef _XPARAMETERS_PS_H_
46 #define UART_BAUDRATE 921600
47 #define SYSID_BASEADDR XPAR_AXI_SYSID_0_BASEADDR
48 #else
49 #define UART_BAUDRATE 115200
50 #endif
51 #ifdef XPAR_AXI_AD9361_0_BASEADDR
52 #define AD9361_RX_0_BASEADDR XPAR_AXI_AD9361_0_BASEADDR
53 #define AD9361_TX_0_BASEADDR XPAR_AXI_AD9361_0_BASEADDR + 0x4000
54 #else
55 #define AD9361_RX_0_BASEADDR XPAR_AXI_AD9361_BASEADDR
56 #define AD9361_TX_0_BASEADDR XPAR_AXI_AD9361_BASEADDR + 0x4000
57 #endif
58 #ifdef XPAR_AXI_AD9361_1_BASEADDR
59 #define AD9361_RX_1_BASEADDR XPAR_AXI_AD9361_1_BASEADDR
60 #define AD9361_TX_1_BASEADDR XPAR_AXI_AD9361_1_BASEADDR + 0x4000
61 #else
62 #ifdef XPAR_AXI_AD9361_0_BASEADDR
63 #define AD9361_RX_1_BASEADDR XPAR_AXI_AD9361_0_BASEADDR
64 #define AD9361_TX_1_BASEADDR XPAR_AXI_AD9361_0_BASEADDR + 0x4000
65 #else
66 #define AD9361_RX_1_BASEADDR XPAR_AXI_AD9361_BASEADDR
67 #define AD9361_TX_1_BASEADDR XPAR_AXI_AD9361_BASEADDR + 0x4000
68 #endif
69 #endif
70 #ifdef XPAR_AXI_DMAC_0_BASEADDR
71 #define CF_AD9361_RX_DMA_BASEADDR XPAR_AXI_DMAC_0_BASEADDR
72 #else
73 #define CF_AD9361_RX_DMA_BASEADDR XPAR_AXI_AD9361_ADC_DMA_BASEADDR
74 #endif
75 #ifdef XPAR_AXI_DMAC_1_BASEADDR
76 #define CF_AD9361_TX_DMA_BASEADDR XPAR_AXI_DMAC_1_BASEADDR
77 #else
78 #define CF_AD9361_TX_DMA_BASEADDR XPAR_AXI_AD9361_DAC_DMA_BASEADDR
79 #endif
80 #ifdef _XPARAMETERS_PS_H_
81 #define ADC_DDR_BASEADDR XPAR_DDR_MEM_BASEADDR + 0x800000
82 #define DAC_DDR_BASEADDR XPAR_DDR_MEM_BASEADDR + 0xA000000
83 
84 #define UART_DEVICE_ID XPAR_XUARTPS_0_DEVICE_ID
85 #define INTC_DEVICE_ID XPAR_SCUGIC_SINGLE_DEVICE_ID
86 
87 #ifdef XPS_BOARD_ZCU102
88 #define GPIO_DEVICE_ID XPAR_PSU_GPIO_0_DEVICE_ID
89 #ifdef FMCOMMS5
90 #define GPIO_RESET_PIN 130
91 #define GPIO_SYNC_PIN 129
92 #define GPIO_RESET_PIN_2 143
93 #define GPIO_CAL_SW1_PIN 137
94 #define GPIO_CAL_SW2_PIN 138
95 #else
96 #define GPIO_RESET_PIN 124
97 #define GPIO_SYNC_PIN 123
98 #define GPIO_RESET_PIN_2 113
99 #define GPIO_CAL_SW1_PIN 107
100 #define GPIO_CAL_SW2_PIN 108
101 #endif
102 #define GPIO_ENABLE_PIN 125
103 #define GPIO_TXNRX_PIN 126
104 #define SPI_DEVICE_ID XPAR_PSU_SPI_0_DEVICE_ID
105 #define UART_IRQ_ID XPAR_XUARTPS_0_INTR
106 #else
107 #define GPIO_DEVICE_ID XPAR_PS7_GPIO_0_DEVICE_ID
108 #define GPIO_RESET_PIN 100
109 #define GPIO_SYNC_PIN 99
110 #define GPIO_RESET_PIN_2 113
111 #define GPIO_CAL_SW1_PIN 107
112 #define GPIO_CAL_SW2_PIN 108
113 #define GPIO_ENABLE_PIN 101
114 #define GPIO_TXNRX_PIN 102
115 #define SPI_DEVICE_ID XPAR_PS7_SPI_0_DEVICE_ID
116 #define UART_IRQ_ID XPAR_XUARTPS_1_INTR
117 #endif
118 #define GPIO_RESET_PIN_ZC702 84
119 #define GPIO_RESET_PIN_ZC706 83
120 #define GPIO_RESET_PIN_ZED 100
121 #define GPIO_CTL0_PIN 94
122 #define GPIO_CTL1_PIN 95
123 #define GPIO_CTL2_PIN 96
124 #define GPIO_CTL3_PIN 97
125 
126 #else
127 #ifdef XPAR_DDR3_SDRAM_S_AXI_BASEADDR
128 #define ADC_DDR_BASEADDR XPAR_DDR3_SDRAM_S_AXI_BASEADDR + 0x800000
129 #define DAC_DDR_BASEADDR XPAR_DDR3_SDRAM_S_AXI_BASEADDR + 0xA000000
130 #else
131 #if defined(XPAR_AXI_DDR_CNTRL_BASEADDR)
132 #define ADC_DDR_BASEADDR XPAR_AXI_DDR_CNTRL_BASEADDR + 0x800000
133 #define DAC_DDR_BASEADDR XPAR_AXI_DDR_CNTRL_BASEADDR + 0xA000000
134 #else
135 #define ADC_DDR_BASEADDR XPAR_AXI_DDR_CNTRL_C0_DDR4_MEMORY_MAP_BASEADDR + 0x800000
136 #define DAC_DDR_BASEADDR XPAR_AXI_DDR_CNTRL_C0_DDR4_MEMORY_MAP_BASEADDR + 0xA000000
137 #endif
138 #endif
139 
140 #define UART_DEVICE_ID XPAR_AXI_UART_DEVICE_ID
141 #define INTC_DEVICE_ID XPAR_INTC_SINGLE_DEVICE_ID
142 #define UART_IRQ_ID XPAR_AXI_INTC_AXI_UART_INTERRUPT_INTR
143 
144 #define GPIO_DEVICE_ID 0
145 #define GPIO_RESET_PIN 46
146 #ifdef XPAR_AXI_SPI_0_DEVICE_ID
147 #define SPI_DEVICE_ID XPAR_AXI_SPI_0_DEVICE_ID
148 #else
149 #define SPI_DEVICE_ID XPAR_SPI_0_DEVICE_ID
150 #endif
151 #endif
152 
153 #define SPI_CS 0
154 #define SPI_CS_2 1
155 
156 #define RX_CORE_BASEADDR AD9361_RX_0_BASEADDR
157 #define TX_CORE_BASEADDR AD9361_TX_0_BASEADDR
158 #endif
159 
160 #define DAC_BUFFER_SAMPLES 1024
161 #define ADC_BUFFER_SAMPLES 16384
162 #define ADC_CHANNELS 4
163 
164 #if defined LINUX_PLATFORM || defined GENERIC_PLATFORM
165 #define RX_CORE_BASEADDR 0
166 #define TX_CORE_BASEADDR 1
167 #define CF_AD9361_RX_DMA_BASEADDR 2
168 #define CF_AD9361_TX_DMA_BASEADDR 3
169 
170 #define SPI_DEVICE_ID 0
171 #define SPI_CS 0
172 
173 #define MAX_SIZE_BASE_ADDR 0x1000
174 
175 #define DAC_DDR_BASEADDR ((uintptr_t)out_buff)
176 #define ADC_DDR_BASEADDR ((uintptr_t)in_buff)
177 
178 #define GPIO_RESET_PIN 1006
179 #endif
180 
181 /* Workaround for correcting the erroneous generation of defines
182  * for DMA IRQs from the *.xsa file. This is a HDL known issue. */
183 #ifdef PLATFORM_ZYNQ
184 #define AD9361_DAC_DMA_IRQ_INTR 88
185 #define AD9361_ADC_DMA_IRQ_INTR 89
186 #else
187 #define AD9361_DAC_DMA_IRQ_INTR XPAR_FABRIC_AXI_AD9361_DAC_DMA_IRQ_INTR
188 #define AD9361_ADC_DMA_IRQ_INTR XPAR_FABRIC_AXI_AD9361_ADC_DMA_IRQ_INTR
189 #endif
190 
191 #endif // __PARAMETERS_H__