Skip to content

Commit 2cf0b6f

Browse files
IoanaCiorneidavem330
authored andcommitted
soc: fsl: dpio: extract the QBMAN clock frequency from the attributes
Through the dpio_get_attributes() firmware call the dpio driver has access to the QBMAN clock frequency. Extend the structure which holds the firmware's response so that we can have access to this information. This will be needed in the next patches which also add support for interrupt coalescing which needs to be configured based on the frequency. Signed-off-by: Ioana Ciornei <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f3fafbc commit 2cf0b6f

File tree

7 files changed

+11
-0
lines changed

7 files changed

+11
-0
lines changed

drivers/soc/fsl/dpio/dpio-cmd.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ struct dpio_rsp_get_attr {
4646
__le64 qbman_portal_ci_addr;
4747
/* cmd word 3 */
4848
__le32 qbman_version;
49+
__le32 pad1;
50+
/* cmd word 4 */
51+
__le32 clk;
4952
};
5053

5154
struct dpio_stashing_dest {

drivers/soc/fsl/dpio/dpio-driver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
162162
goto err_get_attr;
163163
}
164164
desc.qman_version = dpio_attrs.qbman_version;
165+
desc.qman_clk = dpio_attrs.clk;
165166

166167
err = dpio_enable(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
167168
if (err) {

drivers/soc/fsl/dpio/dpio-service.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc,
127127
obj->dpio_desc = *desc;
128128
obj->swp_desc.cena_bar = obj->dpio_desc.regs_cena;
129129
obj->swp_desc.cinh_bar = obj->dpio_desc.regs_cinh;
130+
obj->swp_desc.qman_clk = obj->dpio_desc.qman_clk;
130131
obj->swp_desc.qman_version = obj->dpio_desc.qman_version;
131132
obj->swp = qbman_swp_init(&obj->swp_desc);
132133

drivers/soc/fsl/dpio/dpio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ int dpio_get_attributes(struct fsl_mc_io *mc_io,
162162
attr->qbman_portal_ci_offset =
163163
le64_to_cpu(dpio_rsp->qbman_portal_ci_addr);
164164
attr->qbman_version = le32_to_cpu(dpio_rsp->qbman_version);
165+
attr->clk = le32_to_cpu(dpio_rsp->clk);
165166

166167
return 0;
167168
}

drivers/soc/fsl/dpio/dpio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ int dpio_disable(struct fsl_mc_io *mc_io,
5959
* @num_priorities: Number of priorities for the notification channel (1-8);
6060
* relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL'
6161
* @qbman_version: QBMAN version
62+
* @clk: QBMAN clock frequency value in Hz
6263
*/
6364
struct dpio_attr {
6465
int id;
@@ -68,6 +69,7 @@ struct dpio_attr {
6869
enum dpio_channel_mode channel_mode;
6970
u8 num_priorities;
7071
u32 qbman_version;
72+
u32 clk;
7173
};
7274

7375
int dpio_get_attributes(struct fsl_mc_io *mc_io,

drivers/soc/fsl/dpio/qbman-portal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct qbman_swp_desc {
2424
void *cena_bar; /* Cache-enabled portal base address */
2525
void __iomem *cinh_bar; /* Cache-inhibited portal base address */
2626
u32 qman_version;
27+
u32 qman_clk;
2728
};
2829

2930
#define QBMAN_SWP_INTERRUPT_EQRI 0x01

include/soc/fsl/dpaa2-io.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct device;
4444
* @regs_cinh: The cache inhibited regs
4545
* @dpio_id: The dpio index
4646
* @qman_version: The qman version
47+
* @qman_clk: The qman clock frequency in Hz
4748
*
4849
* Describes the attributes and features of the DPIO object.
4950
*/
@@ -55,6 +56,7 @@ struct dpaa2_io_desc {
5556
void __iomem *regs_cinh;
5657
int dpio_id;
5758
u32 qman_version;
59+
u32 qman_clk;
5860
};
5961

6062
struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc,

0 commit comments

Comments
 (0)