hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/include/soc/fsl/qman.h
....@@ -32,6 +32,7 @@
3232 #define __FSL_QMAN_H
3333
3434 #include <linux/bitops.h>
35
+#include <linux/device.h>
3536
3637 /* Hardware constants */
3738 #define QM_CHANNEL_SWPORTAL0 0
....@@ -255,7 +256,7 @@
255256 __be32 context_b;
256257 struct qm_fd fd;
257258 u8 __reserved4[32];
258
-} __packed;
259
+} __packed __aligned(64);
259260 #define QM_DQRR_VERB_VBIT 0x80
260261 #define QM_DQRR_VERB_MASK 0x7f /* where the verb contains; */
261262 #define QM_DQRR_VERB_FRAME_DEQUEUE 0x60 /* "this format" */
....@@ -288,7 +289,7 @@
288289 __be32 tag;
289290 struct qm_fd fd;
290291 u8 __reserved1[32];
291
- } __packed ern;
292
+ } __packed __aligned(64) ern;
292293 struct {
293294 u8 verb;
294295 u8 fqs; /* Frame Queue Status */
....@@ -915,6 +916,16 @@
915916 struct qman_portal *qman_get_affine_portal(int cpu);
916917
917918 /**
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
+/**
918929 * qman_p_poll_dqrr - process DQRR (fast-path) entries
919930 * @limit: the maximum number of DQRR entries to process
920931 *
....@@ -1194,4 +1205,45 @@
11941205 */
11951206 int qman_is_probed(void);
11961207
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
+
11971249 #endif /* __FSL_QMAN_H */