Message ID | 2784018844ba4afced0e3edff76bdbfe532f517d.1664523444.git.michal.simek@amd.com |
---|---|
State | Changes Requested |
Delegated to: | Michal Simek |
Headers | show |
Series | firmware: zynqmp: Change loadable config object from APU_0 to OCM_BANK_0 | expand |
pá 30. 9. 2022 v 9:37 odesílatel Michal Simek <michal.simek@amd.com> napsal: > > From: Ashok Reddy Soma <ashok.reddy.soma@amd.com> > > To check dynamic loading of config object, currently APU_0 is used. > Suggestion from pmwfw team is to load OCM_BANK_0 and check for > XST_PM_NO_ACCESS error only to skip future config objects. Other errors > should not be considered for skipping. Change from NODE_APU_0 to > NODE_OCM_BANK_0 and check for XST_PM_NO_ACCESS to skip future config > objects. > > Add ": " to printf statement when there is no permission to load config > object, to align with PMUFW version print. > > Update kernel doc for return value for zynqmp_pmufw_load_config_object(). > > Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> > Signed-off-by: Michal Simek <michal.simek@amd.com> > --- > > drivers/firmware/firmware-zynqmp.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c > index a9ed3e7d8b15..d52706c82a66 100644 > --- a/drivers/firmware/firmware-zynqmp.c > +++ b/drivers/firmware/firmware-zynqmp.c > @@ -101,7 +101,7 @@ int zynqmp_pmufw_node(u32 id) > ret = zynqmp_pmufw_load_config_object(xpm_configobject, > sizeof(xpm_configobject)); > > - if (ret && id == NODE_APU_0) > + if (ret == XST_PM_NO_ACCESS && id == NODE_OCM_BANK_0) > skip_config = true; > > return 0; > @@ -254,6 +254,8 @@ int zynqmp_pm_is_function_supported(const u32 api_id, const u32 id) > * > * @cfg_obj: Pointer to the configuration object > * @size: Size of @cfg_obj in bytes > + * Return: 0 on success otherwise negative errno. If the config object > + * is not loadable returns positive errno XST_PM_NO_ACCESS(2002) > */ > int zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size) > { > @@ -268,7 +270,10 @@ int zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size) > err = xilinx_pm_request(PM_SET_CONFIGURATION, (u32)(u64)cfg_obj, 0, 0, > 0, ret_payload); > if (err == XST_PM_NO_ACCESS) { > - printf("PMUFW no permission to change config object\n"); > + if (((u32 *)cfg_obj)[NODE_ID_LOCATION] == NODE_OCM_BANK_0) { > + printf("PMUFW: No permission to change config object\n"); > + return err; > + } > return -EACCES; > } > > @@ -313,7 +318,7 @@ static int zynqmp_power_probe(struct udevice *dev) > ret & ZYNQMP_PM_VERSION_MINOR_MASK); > > if (IS_ENABLED(CONFIG_ARCH_ZYNQMP)) > - zynqmp_pmufw_node(NODE_APU_0); > + zynqmp_pmufw_node(NODE_OCM_BANK_0); > > return 0; > }; > -- > 2.36.1 > Applied M
diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index a9ed3e7d8b15..d52706c82a66 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -101,7 +101,7 @@ int zynqmp_pmufw_node(u32 id) ret = zynqmp_pmufw_load_config_object(xpm_configobject, sizeof(xpm_configobject)); - if (ret && id == NODE_APU_0) + if (ret == XST_PM_NO_ACCESS && id == NODE_OCM_BANK_0) skip_config = true; return 0; @@ -254,6 +254,8 @@ int zynqmp_pm_is_function_supported(const u32 api_id, const u32 id) * * @cfg_obj: Pointer to the configuration object * @size: Size of @cfg_obj in bytes + * Return: 0 on success otherwise negative errno. If the config object + * is not loadable returns positive errno XST_PM_NO_ACCESS(2002) */ int zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size) { @@ -268,7 +270,10 @@ int zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size) err = xilinx_pm_request(PM_SET_CONFIGURATION, (u32)(u64)cfg_obj, 0, 0, 0, ret_payload); if (err == XST_PM_NO_ACCESS) { - printf("PMUFW no permission to change config object\n"); + if (((u32 *)cfg_obj)[NODE_ID_LOCATION] == NODE_OCM_BANK_0) { + printf("PMUFW: No permission to change config object\n"); + return err; + } return -EACCES; } @@ -313,7 +318,7 @@ static int zynqmp_power_probe(struct udevice *dev) ret & ZYNQMP_PM_VERSION_MINOR_MASK); if (IS_ENABLED(CONFIG_ARCH_ZYNQMP)) - zynqmp_pmufw_node(NODE_APU_0); + zynqmp_pmufw_node(NODE_OCM_BANK_0); return 0; };