| .. | .. |
|---|
| 32 | 32 | #define __FSL_QMAN_H |
|---|
| 33 | 33 | |
|---|
| 34 | 34 | #include <linux/bitops.h> |
|---|
| 35 | +#include <linux/device.h> |
|---|
| 35 | 36 | |
|---|
| 36 | 37 | /* Hardware constants */ |
|---|
| 37 | 38 | #define QM_CHANNEL_SWPORTAL0 0 |
|---|
| .. | .. |
|---|
| 255 | 256 | __be32 context_b; |
|---|
| 256 | 257 | struct qm_fd fd; |
|---|
| 257 | 258 | u8 __reserved4[32]; |
|---|
| 258 | | -} __packed; |
|---|
| 259 | +} __packed __aligned(64); |
|---|
| 259 | 260 | #define QM_DQRR_VERB_VBIT 0x80 |
|---|
| 260 | 261 | #define QM_DQRR_VERB_MASK 0x7f /* where the verb contains; */ |
|---|
| 261 | 262 | #define QM_DQRR_VERB_FRAME_DEQUEUE 0x60 /* "this format" */ |
|---|
| .. | .. |
|---|
| 288 | 289 | __be32 tag; |
|---|
| 289 | 290 | struct qm_fd fd; |
|---|
| 290 | 291 | u8 __reserved1[32]; |
|---|
| 291 | | - } __packed ern; |
|---|
| 292 | + } __packed __aligned(64) ern; |
|---|
| 292 | 293 | struct { |
|---|
| 293 | 294 | u8 verb; |
|---|
| 294 | 295 | u8 fqs; /* Frame Queue Status */ |
|---|
| .. | .. |
|---|
| 915 | 916 | struct qman_portal *qman_get_affine_portal(int cpu); |
|---|
| 916 | 917 | |
|---|
| 917 | 918 | /** |
|---|
| 919 | + * qman_start_using_portal - register a device link for the portal user |
|---|
| 920 | + * @p: the portal that will be in use |
|---|
| 921 | + * @dev: the device that will use the portal |
|---|
| 922 | + * |
|---|
| 923 | + * Makes sure that the devices that use the portal are unbound when the |
|---|
| 924 | + * portal is unbound |
|---|
| 925 | + */ |
|---|
| 926 | +int qman_start_using_portal(struct qman_portal *p, struct device *dev); |
|---|
| 927 | + |
|---|
| 928 | +/** |
|---|
| 918 | 929 | * qman_p_poll_dqrr - process DQRR (fast-path) entries |
|---|
| 919 | 930 | * @limit: the maximum number of DQRR entries to process |
|---|
| 920 | 931 | * |
|---|
| .. | .. |
|---|
| 1194 | 1205 | */ |
|---|
| 1195 | 1206 | int qman_is_probed(void); |
|---|
| 1196 | 1207 | |
|---|
| 1208 | +/** |
|---|
| 1209 | + * qman_portals_probed - Check if all cpu bound qman portals are probed |
|---|
| 1210 | + * |
|---|
| 1211 | + * Returns 1 if all the required cpu bound qman portals successfully probed, |
|---|
| 1212 | + * -1 if probe errors appeared or 0 if the qman portals did not yet finished |
|---|
| 1213 | + * probing. |
|---|
| 1214 | + */ |
|---|
| 1215 | +int qman_portals_probed(void); |
|---|
| 1216 | + |
|---|
| 1217 | +/** |
|---|
| 1218 | + * qman_dqrr_get_ithresh - Get coalesce interrupt threshold |
|---|
| 1219 | + * @portal: portal to get the value for |
|---|
| 1220 | + * @ithresh: threshold pointer |
|---|
| 1221 | + */ |
|---|
| 1222 | +void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh); |
|---|
| 1223 | + |
|---|
| 1224 | +/** |
|---|
| 1225 | + * qman_dqrr_set_ithresh - Set coalesce interrupt threshold |
|---|
| 1226 | + * @portal: portal to set the new value on |
|---|
| 1227 | + * @ithresh: new threshold value |
|---|
| 1228 | + * |
|---|
| 1229 | + * Returns 0 on success, or a negative error code. |
|---|
| 1230 | + */ |
|---|
| 1231 | +int qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh); |
|---|
| 1232 | + |
|---|
| 1233 | +/** |
|---|
| 1234 | + * qman_dqrr_get_iperiod - Get coalesce interrupt period |
|---|
| 1235 | + * @portal: portal to get the value for |
|---|
| 1236 | + * @iperiod: period pointer |
|---|
| 1237 | + */ |
|---|
| 1238 | +void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod); |
|---|
| 1239 | + |
|---|
| 1240 | +/** |
|---|
| 1241 | + * qman_dqrr_set_iperiod - Set coalesce interrupt period |
|---|
| 1242 | + * @portal: portal to set the new value on |
|---|
| 1243 | + * @ithresh: new period value |
|---|
| 1244 | + * |
|---|
| 1245 | + * Returns 0 on success, or a negative error code. |
|---|
| 1246 | + */ |
|---|
| 1247 | +int qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod); |
|---|
| 1248 | + |
|---|
| 1197 | 1249 | #endif /* __FSL_QMAN_H */ |
|---|