diff --git a/xen/drivers/passthrough/arm/scmi_dt_maker.c b/xen/drivers/passthrough/arm/scmi_dt_maker.c index f088acb4ee3d..33587cab3466 100644 --- a/xen/drivers/passthrough/arm/scmi_dt_maker.c +++ b/xen/drivers/passthrough/arm/scmi_dt_maker.c @@ -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; @@ -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)); +} diff --git a/xen/include/xen/scmi_dt_maker.h b/xen/include/xen/scmi_dt_maker.h index 5675351a8bba..f15fa59fd947 100644 --- a/xen/include/xen/scmi_dt_maker.h +++ b/xen/include/xen/scmi_dt_maker.h @@ -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 */