Skip to content

Commit

Permalink
xen: arm: scmi_dt_maker: Set shared memory phandle to existing node
Browse files Browse the repository at this point in the history
When creating hardware domain there is a need to set correct phandle
to the "shmem" property on the scmi node. Shared memory node is
generated while scmi node is copied as is from Xen device-tree.
Correct shmem phandle is set during domain device-tree processing.

Signed-off-by: Oleksii Moisieiev <[email protected]>
  • Loading branch information
oleksiimoisieiev committed Sep 27, 2024
1 parent fa08643 commit 222379a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 14 additions & 1 deletion xen/drivers/passthrough/arm/scmi_dt_maker.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct scmi_phandle {

LIST_HEAD(scmi_ph_list);

int __init scmi_dt_make_shmem_node(struct kernel_info *kinfo)
int __init scmi_dt_make_shmem_node(struct kernel_info *kinfo)
{
int res;
void *fdt = kinfo->fdt;
Expand Down Expand Up @@ -311,3 +311,16 @@ int __init scmi_dt_scan_node(struct kernel_info *kinfo, void *pfdt,
clean_handles();
return rc;
}

int __init scmi_dt_set_phandle(struct kernel_info *kinfo,
const char *name)
{
int offset = fdt_path_offset(kinfo->fdt, name);
__be32 val = cpu_to_be32(kinfo->phandle_sci_shmem);

if ( !offset )
return -ENODEV;

return fdt_setprop_inplace(kinfo->fdt, offset, "shmem",
&val,sizeof(val));
}
3 changes: 3 additions & 0 deletions xen/include/xen/scmi_dt_maker.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ int __init scmi_dt_make_shmem_node(struct kernel_info *kinfo);
int __init scmi_dt_create_node(struct kernel_info *kinfo);
int __init scmi_dt_scan_node(struct kernel_info *kinfo, void *pfdt,
int nodeoff);
int __init scmi_dt_set_phandle(struct kernel_info *kinfo,
const char *name);
#else
#define scmi_dt_make_shmem_node(kinfo) (0)
#define scmi_dt_create_node(kinfo) (0)
#define scmi_dt_scan_node(kinfo, pfdt, nodeoff) (0)
#define scmi_dt_set_phandle(kinfo, name) (0)

#endif /* CONFIG_SCMI_SMC */

Expand Down

0 comments on commit 222379a

Please sign in to comment.