mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-11-19 10:21:38 +00:00
include: mailbox: correct RPMI CPPC request field ordering
Per the RPMI specification, CPPC_PROBE_REG, CPPC_READ_REG, and
CPPC_WRITE_REG require REG_ID in word 0 and HART_ID in word 1.
The current request structures have these fields swapped, causing
incompatibility with spec-compliant RPMI servers.
Swap the fields to match the specification and reorder the
corresponding field assignments in lib for consistency.
Fixes: 591a98bdd5 ("lib: utils/cppc: Add RPMI CPPC driver")
Signed-off-by: wuliwen <liwen.wu@spacemit.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20261022020525.1503945-1-liwen.wu@spacemit.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
1 parent
f6abdaf25d
commit
332798211e
2 files changed
+6
-6
No files matched your search
@@ -539,8 +539,8 @@ enum rpmi_cppc_service_id {
|
||||
};
|
||||
|
||||
struct rpmi_cppc_probe_req {
|
||||
u32 hart_id;
|
||||
u32 reg_id;
|
||||
u32 hart_id;
|
||||
};
|
||||
|
||||
struct rpmi_cppc_probe_resp {
|
||||
@@ -549,8 +549,8 @@ struct rpmi_cppc_probe_resp {
|
||||
};
|
||||
|
||||
struct rpmi_cppc_read_reg_req {
|
||||
u32 hart_id;
|
||||
u32 reg_id;
|
||||
u32 hart_id;
|
||||
};
|
||||
|
||||
struct rpmi_cppc_read_reg_resp {
|
||||
@@ -560,8 +560,8 @@ struct rpmi_cppc_read_reg_resp {
|
||||
};
|
||||
|
||||
struct rpmi_cppc_write_reg_req {
|
||||
u32 hart_id;
|
||||
u32 reg_id;
|
||||
u32 hart_id;
|
||||
u32 data_lo;
|
||||
u32 data_hi;
|
||||
};
|
||||
|
||||
@@ -116,8 +116,8 @@ static int rpmi_cppc_read(unsigned long reg, u64 *val)
|
||||
struct rpmi_cppc_read_reg_resp resp;
|
||||
struct rpmi_cppc *cppc;
|
||||
|
||||
req.hart_id = current_hartid();
|
||||
req.reg_id = reg;
|
||||
req.hart_id = current_hartid();
|
||||
cppc = rpmi_cppc_get_pointer(req.hart_id);
|
||||
|
||||
if ((reg == SBI_CPPC_DELIVERED_CTR) && cppc->fc_supported) {
|
||||
@@ -170,8 +170,8 @@ static int rpmi_cppc_write(unsigned long reg, u64 val)
|
||||
struct rpmi_cppc *cppc = rpmi_cppc_get_pointer(hart_id);
|
||||
|
||||
if (reg != SBI_CPPC_DESIRED_PERF || !cppc->fc_supported) {
|
||||
req.hart_id = hart_id;
|
||||
req.reg_id = reg;
|
||||
req.hart_id = hart_id;
|
||||
req.data_lo = val & 0xFFFFFFFF;
|
||||
req.data_hi = val >> 32;
|
||||
|
||||
@@ -197,8 +197,8 @@ static int rpmi_cppc_probe(unsigned long reg)
|
||||
struct rpmi_cppc_probe_resp resp;
|
||||
struct rpmi_cppc_probe_req req;
|
||||
|
||||
req.hart_id = current_hartid();
|
||||
req.reg_id = reg;
|
||||
req.hart_id = current_hartid();
|
||||
|
||||
cppc = rpmi_cppc_get_pointer(req.hart_id);
|
||||
if (!cppc)
|
||||
|
||||
Reference in new issue
Block a user