|
153 | 153 | #define ATC_AUTO BIT(31) /* Auto multiple buffer tx enable */
|
154 | 154 |
|
155 | 155 | /* Bitfields in CFG */
|
156 |
| -#define ATC_PER_MSB(h) ((0x30U & (h)) >> 4) /* Extract most significant bits of a handshaking identifier */ |
157 |
| - |
158 | 156 | #define ATC_SRC_PER GENMASK(3, 0) /* Channel src rq associated with periph handshaking ifc h */
|
159 | 157 | #define ATC_DST_PER GENMASK(7, 4) /* Channel dst rq associated with periph handshaking ifc h */
|
160 | 158 | #define ATC_SRC_REP BIT(8) /* Source Replay Mod */
|
|
181 | 179 | #define ATC_DPIP_HOLE GENMASK(15, 0)
|
182 | 180 | #define ATC_DPIP_BOUNDARY GENMASK(25, 16)
|
183 | 181 |
|
184 |
| -#define ATC_SRC_PER_ID(id) (FIELD_PREP(ATC_SRC_PER_MSB, (id)) | \ |
185 |
| - FIELD_PREP(ATC_SRC_PER, (id))) |
186 |
| -#define ATC_DST_PER_ID(id) (FIELD_PREP(ATC_DST_PER_MSB, (id)) | \ |
187 |
| - FIELD_PREP(ATC_DST_PER, (id))) |
| 182 | +#define ATC_PER_MSB GENMASK(5, 4) /* Extract MSBs of a handshaking identifier */ |
| 183 | +#define ATC_SRC_PER_ID(id) \ |
| 184 | + ({ typeof(id) _id = (id); \ |
| 185 | + FIELD_PREP(ATC_SRC_PER_MSB, FIELD_GET(ATC_PER_MSB, _id)) | \ |
| 186 | + FIELD_PREP(ATC_SRC_PER, _id); }) |
| 187 | +#define ATC_DST_PER_ID(id) \ |
| 188 | + ({ typeof(id) _id = (id); \ |
| 189 | + FIELD_PREP(ATC_DST_PER_MSB, FIELD_GET(ATC_PER_MSB, _id)) | \ |
| 190 | + FIELD_PREP(ATC_DST_PER, _id); }) |
188 | 191 |
|
189 | 192 |
|
190 | 193 |
|
|
0 commit comments