openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches
pin_mapping.h
Go to the documentation of this file.
1
/*
2
* openMMC -- Open Source modular IPM Controller firmware
3
*
4
* Copyright (C) 2016 Henrique Silva <henrique.silva@lnls.br>
5
*
6
* This program is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*
19
* @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
20
*/
21
40
#ifndef PIN_MAPPING_H_
41
#define PIN_MAPPING_H_
42
43
/* SPI Interfaces */
44
#define FPGA_SPI 0
45
#define FLASH_SPI 1
46
47
/* UART Interfaces */
48
#define UART_DEBUG 3
49
50
/* Pin definitions */
51
52
/* I2C ports */
53
#define I2C0_SDA PIN_DEF( PORT0, 27, (IOCON_FUNC1 | IOCON_MODE_INACT), NON_GPIO )
54
#define I2C0_SCL PIN_DEF( PORT0, 28, (IOCON_FUNC1 | IOCON_MODE_INACT), NON_GPIO )
55
#define I2C1_SDA PIN_DEF( PORT0, 0, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO )
56
#define I2C1_SCL PIN_DEF( PORT0, 1, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO )
57
#define I2C2_SDA PIN_DEF( PORT0, 10, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO )
58
#define I2C2_SCL PIN_DEF( PORT0, 11, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO )
59
60
/* UART Debug port */
61
#define UART_DEBUG_TXD PIN_DEF( PORT4, 28, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO )
62
#define UART_DEBUG_RXD PIN_DEF( PORT4, 29, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO )
63
64
/* SSP Ports */
65
/* FPGA SPI Port (SSEL is GPIO for word transfers larger than 8bits) */
66
#define SSP0_SCK PIN_DEF( PORT1, 20, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO )
67
#define SSP0_SSEL PIN_DEF( PORT1, 21, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT )
68
#define SSP0_MISO PIN_DEF( PORT1, 23, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO )
69
#define SSP0_MOSI PIN_DEF( PORT1, 24, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO )
70
/* Flash SPI Port (SSEL is GPIO for word transfers larger than 8bits) */
71
#define SSP1_SCK PIN_DEF( PORT0, 7, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO )
72
#define SSP1_SSEL PIN_DEF( PORT0, 6, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT )
73
#define SSP1_MISO PIN_DEF( PORT0, 8, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO )
74
#define SSP1_MOSI PIN_DEF( PORT0, 9, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO )
75
76
/* SPI Legacy port - should be updated to SSP interface */
77
/* DAC SPI Port (SSEL is GPIO for word transfers larger than 8bits) */
78
#define SPI_SCK PIN_DEF( PORT0, 15, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO )
79
#define SPI_SSEL PIN_DEF( PORT0, 16, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT )
80
//#define SPI_MISO PIN_DEF( PORT0, 17, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO )
81
#define SPI_MOSI PIN_DEF( PORT0, 18, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO )
82
83
/* GPIO definitions */
84
/* Geographic Address pin definitions */
85
#define GPIO_GA0 PIN_DEF( PORT1, 0, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT )
86
#define GPIO_GA1 PIN_DEF( PORT1, 1, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT )
87
#define GPIO_GA2 PIN_DEF( PORT1, 4, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT )
88
#define GPIO_GA_TEST PIN_DEF( PORT1, 8, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT )
89
90
/* Board LEDs */
91
#define GPIO_LEDBLUE PIN_DEF( PORT1, 9, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT )
92
#define GPIO_LEDGREEN PIN_DEF( PORT1, 10, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
93
#define GPIO_LEDRED PIN_DEF( PORT1, 25, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
94
95
/* Front Panel BUTTON */
96
#define GPIO_FRONT_BUTTON PIN_DEF( PORT2, 12, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT )
97
98
/* Hot swap handle */
99
#define GPIO_HOT_SWAP_HANDLE PIN_DEF( PORT2, 13, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT )
100
101
/* FPGA DCDC converters */
102
#define GPIO_EN_P1V0 PIN_DEF( PORT3, 25, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
103
#define GPIO_EN_P1V2 PIN_DEF( PORT0, 23, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
104
#define GPIO_EN_P1V8 PIN_DEF( PORT0, 24, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
105
#define GPIO_EN_P3V3 PIN_DEF( PORT1, 27, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
106
#define GPIO_EN_P1V5_VTT PIN_DEF( PORT1, 29, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
107
#define GPIO_DCDC_PGOOD PIN_DEF( PORT3, 26, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_INPUT )
108
109
/* FMC1 DCDC Converters */
110
#define GPIO_EN_FMC1_P12V PIN_DEF( PORT0, 4, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
111
#define GPIO_EN_FMC1_P3V3 PIN_DEF( PORT0, 25, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
112
#define GPIO_EN_FMC1_PVADJ PIN_DEF( PORT1, 31, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
113
114
/* FMC2 DCDC Converters */
115
#define GPIO_EN_FMC2_P12V PIN_DEF( PORT0, 5, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
116
#define GPIO_EN_FMC2_P3V3 PIN_DEF( PORT0, 26, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
117
#define GPIO_EN_FMC2_PVADJ PIN_DEF( PORT1, 28, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
118
119
/* RTM */
120
#define GPIO_EN_RTM_PWR PIN_DEF( PORT1, 30, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
121
/* NOTE: Due to a hardware limitation, pins 29 and 30 from port 0 will have the same direction, even if set differently in the register */
122
#define GPIO_RTM_PS PIN_DEF( PORT0, 29, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT )
123
#define GPIO_EN_RTM_I2C PIN_DEF( PORT0, 30, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
124
125
/* FPGA Control */
126
#define GPIO_FPGA_PROGRAM_B PIN_DEF( PORT0, 17, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
127
#define GPIO_FPGA_DONE_B PIN_DEF( PORT0, 22, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT )
128
#define GPIO_FPGA_RESET PIN_DEF( PORT2, 9, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
129
#define GPIO_FPGA_INITB PIN_DEF( PORT0, 20, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT )
130
#define GPIO_FLASH_CS_MUX PIN_DEF( PORT0, 19, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT )
131
132
/* VADJ DAC */
133
#define GPIO_DAC_VADJ_RST PIN_DEF( PORT0, 21, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT )
134
#define GPIO_DAC_VADJ_CSN PIN_DEF( PORT0, 16, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT )
135
136
/* ADN4604 Clock Switch */
137
#define GPIO_ADN_UPDATE PIN_DEF( PORT1, 26, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT )
138
#define GPIO_ADN_RESETN PIN_DEF( PORT1, 22, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT )
139
140
/* SCANSTA1101 JTAG Switch */
141
#define GPIO_SCANSTA1101_ADDR0 PIN_DEF( PORT2, 0, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
142
#define GPIO_SCANSTA1101_ADDR1 PIN_DEF( PORT2, 1, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
143
#define GPIO_SCANSTA1101_ADDR2 PIN_DEF( PORT2, 2, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
144
#define GPIO_SCANSTA1101_ADDR3 PIN_DEF( PORT2, 3, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
145
#define GPIO_SCANSTA1101_ADDR4 PIN_DEF( PORT2, 4, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
146
#define GPIO_SCANSTA1101_ADDR5 PIN_DEF( PORT2, 5, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
147
#define GPIO_SCANSTA1101_ADDR6 PIN_DEF( PORT2, 6, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT )
148
#define GPIO_SCANSTA1101_TRIST_B PIN_DEF( PORT2, 7, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT )
149
150
/* MMC ENABLE# */
151
#define GPIO_MMC_ENABLE PIN_DEF( PORT2, 8, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT )
152
153
/* Overtemp signal */
154
#define GPIO_OVERTEMPn PIN_DEF( PORT2, 10, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT )
155
156
/* FMC Present signals */
157
#define GPIO_FMC1_PRSNT_M2C PIN_DEF( PORT1, 14, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT )
158
#define GPIO_FMC2_PRSNT_M2C PIN_DEF( PORT1, 15, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT )
159
160
/* FMC Power Good signals */
161
#define GPIO_FMC1_PG_M2C PIN_DEF( PORT1, 16, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT )
162
#define GPIO_FMC2_PG_M2C PIN_DEF( PORT1, 17, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT )
163
#define GPIO_FMC1_PG_C2M PIN_DEF( PORT1, 18, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT )
164
#define GPIO_FMC2_PG_C2M PIN_DEF( PORT1, 19, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT )
165
166
/* Pin initialization (config) list */
167
#define PIN_CFG_LIST \
168
I2C0_SDA, \
169
I2C0_SCL, \
170
I2C1_SDA, \
171
I2C1_SCL, \
172
I2C2_SDA, \
173
I2C2_SCL, \
174
UART_DEBUG_TXD, \
175
UART_DEBUG_RXD, \
176
SSP0_SCK, \
177
SSP0_SSEL, \
178
SSP0_MISO, \
179
SSP0_MOSI, \
180
SSP1_SCK, \
181
SSP1_SSEL, \
182
SSP1_MISO, \
183
SSP1_MOSI, \
184
SPI_SCK, \
185
SPI_SSEL, \
186
SPI_MOSI, \
187
GPIO_GA0, \
188
GPIO_GA1, \
189
GPIO_GA2, \
190
GPIO_GA_TEST, \
191
GPIO_LEDBLUE, \
192
GPIO_LEDGREEN, \
193
GPIO_LEDRED, \
194
GPIO_FRONT_BUTTON, \
195
GPIO_HOT_SWAP_HANDLE, \
196
GPIO_EN_P1V0, \
197
GPIO_EN_P1V2, \
198
GPIO_EN_P1V8, \
199
GPIO_EN_P3V3, \
200
GPIO_EN_P1V5_VTT, \
201
GPIO_DCDC_PGOOD, \
202
GPIO_EN_FMC1_P12V, \
203
GPIO_EN_FMC1_P3V3, \
204
GPIO_EN_FMC1_PVADJ, \
205
GPIO_EN_FMC2_P12V, \
206
GPIO_EN_FMC2_P3V3, \
207
GPIO_EN_FMC2_PVADJ, \
208
GPIO_EN_RTM_PWR, \
209
GPIO_RTM_PS, \
210
GPIO_EN_RTM_I2C, \
211
GPIO_FPGA_PROGRAM_B, \
212
GPIO_FPGA_DONE_B, \
213
GPIO_FPGA_RESET, \
214
GPIO_FPGA_INITB, \
215
GPIO_FLASH_CS_MUX, \
216
GPIO_DAC_VADJ_RST, \
217
GPIO_DAC_VADJ_CSN, \
218
GPIO_ADN_UPDATE, \
219
GPIO_ADN_RESETN, \
220
GPIO_SCANSTA1101_ADDR0, \
221
GPIO_SCANSTA1101_ADDR1, \
222
GPIO_SCANSTA1101_ADDR2, \
223
GPIO_SCANSTA1101_ADDR3, \
224
GPIO_SCANSTA1101_ADDR4, \
225
GPIO_SCANSTA1101_ADDR5, \
226
GPIO_SCANSTA1101_ADDR6, \
227
GPIO_SCANSTA1101_TRIST_B, \
228
GPIO_MMC_ENABLE, \
229
GPIO_FMC1_PRSNT_M2C, \
230
GPIO_FMC2_PRSNT_M2C, \
231
GPIO_FMC1_PG_M2C, \
232
GPIO_FMC2_PG_M2C, \
233
GPIO_FMC1_PG_C2M, \
234
GPIO_FMC2_PG_C2M
235
236
#endif
237
port
board
afc-v3
pin_mapping.h
Generated on Wed Jul 24 2024 08:15:56 for openMMC by
1.11.0