soc/intel/apollolake: pre-evaluate gpio number values
To allow sharing macros in ASL as well as C the macros can't have complex expression because the ASL compiler does not evaluate those expressions. To that end, just pre-calculate the values. Lastly, add N_OFFSET and utilize it for symmetry. Change-Id: I546d71008e776b27ce8bcd24d2cbd2ee1b2d8020 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/13693 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
parent
ada13ed4cb
commit
c65b8f128e
2 changed files with 175 additions and 172 deletions
|
@ -29,7 +29,7 @@ static const struct pad_community {
|
|||
.first_pad = NW_OFFSET,
|
||||
}, {
|
||||
.port = GPIO_NORTH,
|
||||
.first_pad = 0,
|
||||
.first_pad = N_OFFSET,
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -148,183 +148,186 @@
|
|||
#define SVID0_CLK 77
|
||||
|
||||
/* North community pads */
|
||||
#define NW_OFFSET 78
|
||||
#define GPIO_187 NW_OFFSET + 0
|
||||
#define GPIO_188 NW_OFFSET + 1
|
||||
#define GPIO_189 NW_OFFSET + 2
|
||||
#define GPIO_190 NW_OFFSET + 3
|
||||
#define GPIO_191 NW_OFFSET + 4
|
||||
#define GPIO_192 NW_OFFSET + 5
|
||||
#define GPIO_193 NW_OFFSET + 6
|
||||
#define GPIO_194 NW_OFFSET + 7
|
||||
#define GPIO_195 NW_OFFSET + 8
|
||||
#define GPIO_196 NW_OFFSET + 9
|
||||
#define GPIO_197 NW_OFFSET + 10
|
||||
#define GPIO_198 NW_OFFSET + 11
|
||||
#define GPIO_199 NW_OFFSET + 12
|
||||
#define GPIO_200 NW_OFFSET + 13
|
||||
#define GPIO_201 NW_OFFSET + 14
|
||||
#define GPIO_202 NW_OFFSET + 15
|
||||
#define GPIO_203 NW_OFFSET + 16
|
||||
#define GPIO_204 NW_OFFSET + 17
|
||||
#define PMC_SPI_FS0 NW_OFFSET + 18
|
||||
#define PMC_SPI_FS1 NW_OFFSET + 19
|
||||
#define PMC_SPI_FS2 NW_OFFSET + 20
|
||||
#define PMC_SPI_RXD NW_OFFSET + 21
|
||||
#define PMC_SPI_TXD NW_OFFSET + 22
|
||||
#define PMC_SPI_CLK NW_OFFSET + 23
|
||||
#define PMIC_PWRGOOD NW_OFFSET + 24
|
||||
#define PMIC_RESET_B NW_OFFSET + 25
|
||||
#define GPIO_213 NW_OFFSET + 26
|
||||
#define GPIO_214 NW_OFFSET + 27
|
||||
#define GPIO_215 NW_OFFSET + 28
|
||||
#define PMIC_THERMTRIP_B NW_OFFSET + 29
|
||||
#define PMIC_STDBY NW_OFFSET + 30
|
||||
#define PROCHOT_B NW_OFFSET + 31
|
||||
#define PMIC_I2C_SCL NW_OFFSET + 32
|
||||
#define PMIC_I2C_SDA NW_OFFSET + 33
|
||||
#define GPIO_74 NW_OFFSET + 34
|
||||
#define GPIO_75 NW_OFFSET + 35
|
||||
#define GPIO_76 NW_OFFSET + 36
|
||||
#define GPIO_77 NW_OFFSET + 37
|
||||
#define GPIO_78 NW_OFFSET + 38
|
||||
#define GPIO_79 NW_OFFSET + 39
|
||||
#define GPIO_80 NW_OFFSET + 40
|
||||
#define GPIO_81 NW_OFFSET + 41
|
||||
#define GPIO_82 NW_OFFSET + 42
|
||||
#define GPIO_83 NW_OFFSET + 43
|
||||
#define GPIO_84 NW_OFFSET + 44
|
||||
#define GPIO_85 NW_OFFSET + 45
|
||||
#define GPIO_86 NW_OFFSET + 46
|
||||
#define GPIO_87 NW_OFFSET + 47
|
||||
#define GPIO_88 NW_OFFSET + 48
|
||||
#define GPIO_89 NW_OFFSET + 49
|
||||
#define GPIO_90 NW_OFFSET + 50
|
||||
#define GPIO_91 NW_OFFSET + 51
|
||||
#define GPIO_92 NW_OFFSET + 52
|
||||
#define GPIO_97 NW_OFFSET + 53
|
||||
#define GPIO_98 NW_OFFSET + 54
|
||||
#define GPIO_99 NW_OFFSET + 55
|
||||
#define GPIO_100 NW_OFFSET + 56
|
||||
#define GPIO_101 NW_OFFSET + 57
|
||||
#define GPIO_102 NW_OFFSET + 58
|
||||
#define GPIO_103 NW_OFFSET + 59
|
||||
#define FST_SPI_CLK_FB NW_OFFSET + 60
|
||||
#define GPIO_104 NW_OFFSET + 61
|
||||
#define GPIO_105 NW_OFFSET + 62
|
||||
#define GPIO_106 NW_OFFSET + 63
|
||||
#define GPIO_109 NW_OFFSET + 64
|
||||
#define GPIO_110 NW_OFFSET + 65
|
||||
#define GPIO_111 NW_OFFSET + 66
|
||||
#define GPIO_112 NW_OFFSET + 67
|
||||
#define GPIO_113 NW_OFFSET + 68
|
||||
#define GPIO_116 NW_OFFSET + 69
|
||||
#define GPIO_117 NW_OFFSET + 70
|
||||
#define GPIO_118 NW_OFFSET + 71
|
||||
#define GPIO_119 NW_OFFSET + 72
|
||||
#define GPIO_120 NW_OFFSET + 73
|
||||
#define GPIO_121 NW_OFFSET + 74
|
||||
#define GPIO_122 NW_OFFSET + 75
|
||||
#define GPIO_123 NW_OFFSET + 76
|
||||
#define GPIO_187 78
|
||||
#define GPIO_188 79
|
||||
#define GPIO_189 80
|
||||
#define GPIO_190 81
|
||||
#define GPIO_191 82
|
||||
#define GPIO_192 83
|
||||
#define GPIO_193 84
|
||||
#define GPIO_194 85
|
||||
#define GPIO_195 86
|
||||
#define GPIO_196 87
|
||||
#define GPIO_197 88
|
||||
#define GPIO_198 89
|
||||
#define GPIO_199 90
|
||||
#define GPIO_200 91
|
||||
#define GPIO_201 92
|
||||
#define GPIO_202 93
|
||||
#define GPIO_203 94
|
||||
#define GPIO_204 95
|
||||
#define PMC_SPI_FS0 96
|
||||
#define PMC_SPI_FS1 97
|
||||
#define PMC_SPI_FS2 98
|
||||
#define PMC_SPI_RXD 99
|
||||
#define PMC_SPI_TXD 100
|
||||
#define PMC_SPI_CLK 101
|
||||
#define PMIC_PWRGOOD 102
|
||||
#define PMIC_RESET_B 103
|
||||
#define GPIO_213 104
|
||||
#define GPIO_214 105
|
||||
#define GPIO_215 106
|
||||
#define PMIC_THERMTRIP_B 107
|
||||
#define PMIC_STDBY 108
|
||||
#define PROCHOT_B 109
|
||||
#define PMIC_I2C_SCL 110
|
||||
#define PMIC_I2C_SDA 111
|
||||
#define GPIO_74 112
|
||||
#define GPIO_75 113
|
||||
#define GPIO_76 114
|
||||
#define GPIO_77 115
|
||||
#define GPIO_78 116
|
||||
#define GPIO_79 117
|
||||
#define GPIO_80 118
|
||||
#define GPIO_81 119
|
||||
#define GPIO_82 120
|
||||
#define GPIO_83 121
|
||||
#define GPIO_84 122
|
||||
#define GPIO_85 123
|
||||
#define GPIO_86 124
|
||||
#define GPIO_87 125
|
||||
#define GPIO_88 126
|
||||
#define GPIO_89 127
|
||||
#define GPIO_90 128
|
||||
#define GPIO_91 129
|
||||
#define GPIO_92 130
|
||||
#define GPIO_97 131
|
||||
#define GPIO_98 132
|
||||
#define GPIO_99 133
|
||||
#define GPIO_100 134
|
||||
#define GPIO_101 135
|
||||
#define GPIO_102 136
|
||||
#define GPIO_103 137
|
||||
#define FST_SPI_CLK_FB 138
|
||||
#define GPIO_104 139
|
||||
#define GPIO_105 140
|
||||
#define GPIO_106 141
|
||||
#define GPIO_109 142
|
||||
#define GPIO_110 143
|
||||
#define GPIO_111 144
|
||||
#define GPIO_112 145
|
||||
#define GPIO_113 146
|
||||
#define GPIO_116 147
|
||||
#define GPIO_117 148
|
||||
#define GPIO_118 149
|
||||
#define GPIO_119 150
|
||||
#define GPIO_120 151
|
||||
#define GPIO_121 152
|
||||
#define GPIO_122 153
|
||||
#define GPIO_123 154
|
||||
|
||||
/* West community pads */
|
||||
#define W_OFFSET (NW_OFFSET + 77)
|
||||
#define GPIO_124 W_OFFSET + 0
|
||||
#define GPIO_125 W_OFFSET + 1
|
||||
#define GPIO_126 W_OFFSET + 2
|
||||
#define GPIO_127 W_OFFSET + 3
|
||||
#define GPIO_128 W_OFFSET + 4
|
||||
#define GPIO_129 W_OFFSET + 5
|
||||
#define GPIO_130 W_OFFSET + 6
|
||||
#define GPIO_131 W_OFFSET + 7
|
||||
#define GPIO_132 W_OFFSET + 8
|
||||
#define GPIO_133 W_OFFSET + 9
|
||||
#define GPIO_134 W_OFFSET + 10
|
||||
#define GPIO_135 W_OFFSET + 11
|
||||
#define GPIO_136 W_OFFSET + 12
|
||||
#define GPIO_137 W_OFFSET + 13
|
||||
#define GPIO_138 W_OFFSET + 14
|
||||
#define GPIO_139 W_OFFSET + 15
|
||||
#define GPIO_146 W_OFFSET + 16
|
||||
#define GPIO_147 W_OFFSET + 17
|
||||
#define GPIO_148 W_OFFSET + 18
|
||||
#define GPIO_149 W_OFFSET + 19
|
||||
#define GPIO_150 W_OFFSET + 20
|
||||
#define GPIO_151 W_OFFSET + 21
|
||||
#define GPIO_152 W_OFFSET + 22
|
||||
#define GPIO_153 W_OFFSET + 23
|
||||
#define GPIO_154 W_OFFSET + 24
|
||||
#define GPIO_155 W_OFFSET + 25
|
||||
#define GPIO_209 W_OFFSET + 26
|
||||
#define GPIO_210 W_OFFSET + 27
|
||||
#define GPIO_211 W_OFFSET + 28
|
||||
#define GPIO_212 W_OFFSET + 29
|
||||
#define OSC_CLK_OUT_0 W_OFFSET + 30
|
||||
#define OSC_CLK_OUT_1 W_OFFSET + 31
|
||||
#define OSC_CLK_OUT_2 W_OFFSET + 32
|
||||
#define OSC_CLK_OUT_3 W_OFFSET + 33
|
||||
#define OSC_CLK_OUT_4 W_OFFSET + 34
|
||||
#define PMU_AC_PRESENT W_OFFSET + 35
|
||||
#define PMU_BATLOW_B W_OFFSET + 36
|
||||
#define PMU_PLTRST_B W_OFFSET + 37
|
||||
#define PMU_PWRBTN_B W_OFFSET + 38
|
||||
#define PMU_RESETBUTTON_B W_OFFSET + 39
|
||||
#define PMU_SLP_S0_B W_OFFSET + 40
|
||||
#define PMU_SLP_S3_B W_OFFSET + 41
|
||||
#define PMU_SLP_S4_B W_OFFSET + 42
|
||||
#define PMU_SUSCLK W_OFFSET + 43
|
||||
#define PMU_WAKE_B W_OFFSET + 44
|
||||
#define SUS_STAT_B W_OFFSET + 45
|
||||
#define SUSPWRDNACK W_OFFSET + 46
|
||||
#define GPIO_124 155
|
||||
#define GPIO_125 156
|
||||
#define GPIO_126 157
|
||||
#define GPIO_127 158
|
||||
#define GPIO_128 159
|
||||
#define GPIO_129 160
|
||||
#define GPIO_130 161
|
||||
#define GPIO_131 162
|
||||
#define GPIO_132 163
|
||||
#define GPIO_133 164
|
||||
#define GPIO_134 165
|
||||
#define GPIO_135 166
|
||||
#define GPIO_136 167
|
||||
#define GPIO_137 168
|
||||
#define GPIO_138 169
|
||||
#define GPIO_139 170
|
||||
#define GPIO_146 171
|
||||
#define GPIO_147 172
|
||||
#define GPIO_148 173
|
||||
#define GPIO_149 174
|
||||
#define GPIO_150 175
|
||||
#define GPIO_151 176
|
||||
#define GPIO_152 177
|
||||
#define GPIO_153 178
|
||||
#define GPIO_154 179
|
||||
#define GPIO_155 180
|
||||
#define GPIO_209 181
|
||||
#define GPIO_210 182
|
||||
#define GPIO_211 183
|
||||
#define GPIO_212 184
|
||||
#define OSC_CLK_OUT_0 185
|
||||
#define OSC_CLK_OUT_1 186
|
||||
#define OSC_CLK_OUT_2 187
|
||||
#define OSC_CLK_OUT_3 188
|
||||
#define OSC_CLK_OUT_4 189
|
||||
#define PMU_AC_PRESENT 190
|
||||
#define PMU_BATLOW_B 191
|
||||
#define PMU_PLTRST_B 192
|
||||
#define PMU_PWRBTN_B 193
|
||||
#define PMU_RESETBUTTON_B 194
|
||||
#define PMU_SLP_S0_B 195
|
||||
#define PMU_SLP_S3_B 196
|
||||
#define PMU_SLP_S4_B 197
|
||||
#define PMU_SUSCLK 198
|
||||
#define PMU_WAKE_B 199
|
||||
#define SUS_STAT_B 200
|
||||
#define SUSPWRDNACK 201
|
||||
|
||||
/* Southwest community pads */
|
||||
#define SW_OFFSET (W_OFFSET + 47)
|
||||
#define GPIO_205 SW_OFFSET + 0
|
||||
#define GPIO_206 SW_OFFSET + 1
|
||||
#define GPIO_207 SW_OFFSET + 2
|
||||
#define GPIO_208 SW_OFFSET + 3
|
||||
#define GPIO_156 SW_OFFSET + 4
|
||||
#define GPIO_157 SW_OFFSET + 5
|
||||
#define GPIO_158 SW_OFFSET + 6
|
||||
#define GPIO_159 SW_OFFSET + 7
|
||||
#define GPIO_160 SW_OFFSET + 8
|
||||
#define GPIO_161 SW_OFFSET + 9
|
||||
#define GPIO_162 SW_OFFSET + 10
|
||||
#define GPIO_163 SW_OFFSET + 11
|
||||
#define GPIO_164 SW_OFFSET + 12
|
||||
#define GPIO_165 SW_OFFSET + 13
|
||||
#define GPIO_166 SW_OFFSET + 14
|
||||
#define GPIO_167 SW_OFFSET + 15
|
||||
#define GPIO_168 SW_OFFSET + 16
|
||||
#define GPIO_169 SW_OFFSET + 17
|
||||
#define GPIO_170 SW_OFFSET + 18
|
||||
#define GPIO_171 SW_OFFSET + 19
|
||||
#define GPIO_172 SW_OFFSET + 20
|
||||
#define GPIO_179 SW_OFFSET + 21
|
||||
#define GPIO_173 SW_OFFSET + 22
|
||||
#define GPIO_174 SW_OFFSET + 23
|
||||
#define GPIO_175 SW_OFFSET + 24
|
||||
#define GPIO_176 SW_OFFSET + 25
|
||||
#define GPIO_177 SW_OFFSET + 26
|
||||
#define GPIO_178 SW_OFFSET + 27
|
||||
#define GPIO_186 SW_OFFSET + 28
|
||||
#define GPIO_182 SW_OFFSET + 29
|
||||
#define GPIO_183 SW_OFFSET + 30
|
||||
#define SMB_ALERTB SW_OFFSET + 31
|
||||
#define SMB_CLK SW_OFFSET + 32
|
||||
#define SMB_DATA SW_OFFSET + 33
|
||||
#define LPC_ILB_SERIRQ SW_OFFSET + 34
|
||||
#define LPC_CLKOUT0 SW_OFFSET + 35
|
||||
#define LPC_CLKOUT1 SW_OFFSET + 36
|
||||
#define LPC_AD0 SW_OFFSET + 37
|
||||
#define LPC_AD1 SW_OFFSET + 38
|
||||
#define LPC_AD2 SW_OFFSET + 39
|
||||
#define LPC_AD3 SW_OFFSET + 40
|
||||
#define LPC_CLKRUNB SW_OFFSET + 41
|
||||
#define LPC_FRAMEB SW_OFFSET + 42
|
||||
#define GPIO_205 202
|
||||
#define GPIO_206 203
|
||||
#define GPIO_207 204
|
||||
#define GPIO_208 205
|
||||
#define GPIO_156 206
|
||||
#define GPIO_157 207
|
||||
#define GPIO_158 208
|
||||
#define GPIO_159 209
|
||||
#define GPIO_160 210
|
||||
#define GPIO_161 211
|
||||
#define GPIO_162 212
|
||||
#define GPIO_163 213
|
||||
#define GPIO_164 214
|
||||
#define GPIO_165 215
|
||||
#define GPIO_166 216
|
||||
#define GPIO_167 217
|
||||
#define GPIO_168 218
|
||||
#define GPIO_169 219
|
||||
#define GPIO_170 220
|
||||
#define GPIO_171 221
|
||||
#define GPIO_172 222
|
||||
#define GPIO_179 223
|
||||
#define GPIO_173 224
|
||||
#define GPIO_174 225
|
||||
#define GPIO_175 226
|
||||
#define GPIO_176 227
|
||||
#define GPIO_177 228
|
||||
#define GPIO_178 229
|
||||
#define GPIO_186 230
|
||||
#define GPIO_182 231
|
||||
#define GPIO_183 232
|
||||
#define SMB_ALERTB 233
|
||||
#define SMB_CLK 234
|
||||
#define SMB_DATA 235
|
||||
#define LPC_ILB_SERIRQ 236
|
||||
#define LPC_CLKOUT0 237
|
||||
#define LPC_CLKOUT1 238
|
||||
#define LPC_AD0 239
|
||||
#define LPC_AD1 240
|
||||
#define LPC_AD2 241
|
||||
#define LPC_AD3 242
|
||||
#define LPC_CLKRUNB 243
|
||||
#define LPC_FRAMEB 244
|
||||
|
||||
#define TOTAL_PADS 245
|
||||
#define N_OFFSET GPIO_0
|
||||
#define NW_OFFSET GPIO_187
|
||||
#define W_OFFSET GPIO_124
|
||||
#define SW_OFFSET GPIO_205
|
||||
|
||||
/* Macros for translating a global pad offset to a local offset */
|
||||
#define PAD_N(pad) (pad)
|
||||
#define PAD_N(pad) (pad - N_OFFSET)
|
||||
#define PAD_NW(pad) (pad - NW_OFFSET)
|
||||
#define PAD_W(pad) (pad - W_OFFSET)
|
||||
#define PAD_SW(pad) (pad - SW_OFFSET)
|
||||
|
|
Loading…
Reference in a new issue