Message ID | 8d9d465b448d7a01c1a07e5835f8a1f5a338e3a1.1664523385.git.michal.simek@amd.com |
---|---|
State | Superseded |
Delegated to: | Michal Simek |
Headers | show |
Series | xilinx: zynqmp: Load pmufw configuration before checking access | expand |
pá 30. 9. 2022 v 9:36 odesílatel Michal Simek <michal.simek@amd.com> napsal: > > Before this patch you could see in the log: > U-Boot SPL 2022.10-rc5 (Sep 29 2022 - 15:29:27 +0200) > PMUFW: v1.1 > Loading new PMUFW cfg obj (32 bytes) > PMUFW: No permission to change config object > Loading new PMUFW cfg obj (2032 bytes) > > where it is visible that permission is check before sending PMUFW > configuration (big size). > > When this patch is applied it is visible that order is correct. > U-Boot SPL 2022.10-rc5 (Sep 29 2022 - 15:47:08 +0200) > Loading new PMUFW cfg obj (2032 bytes) > PMUFW: v1.1 > Loading new PMUFW cfg obj (32 bytes) > > Signed-off-by: Michal Simek <michal.simek@amd.com> > --- > > board/xilinx/zynqmp/zynqmp.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c > index 0b30dd048eb5..f1eb4ff38908 100644 > --- a/board/xilinx/zynqmp/zynqmp.c > +++ b/board/xilinx/zynqmp/zynqmp.c > @@ -227,6 +227,14 @@ int board_init(void) > char name[SOC_MAX_STR_SIZE]; > int ret; > #endif > + > + if (IS_ENABLED(CONFIG_SPL_BUILD)) { > + /* Check *at build time* if the filename is an non-empty string */ > + if (sizeof(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE) > 1) > + zynqmp_pmufw_load_config_object(zynqmp_pm_cfg_obj, > + zynqmp_pm_cfg_obj_size); > + } > + > #if defined(CONFIG_ZYNQMP_FIRMWARE) > struct udevice *dev; > > @@ -236,10 +244,6 @@ int board_init(void) > #endif > > #if defined(CONFIG_SPL_BUILD) > - /* Check *at build time* if the filename is an non-empty string */ > - if (sizeof(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE) > 1) > - zynqmp_pmufw_load_config_object(zynqmp_pm_cfg_obj, > - zynqmp_pm_cfg_obj_size); > printf("Silicon version:\t%d\n", zynqmp_get_silicon_version()); > > /* the CSU disables the JTAG interface when secure boot is enabled */ > -- > 2.36.1 > Applied. M
út 4. 10. 2022 v 13:54 odesílatel Michal Simek <monstr@monstr.eu> napsal: > > pá 30. 9. 2022 v 9:36 odesílatel Michal Simek <michal.simek@amd.com> napsal: > > > > Before this patch you could see in the log: > > U-Boot SPL 2022.10-rc5 (Sep 29 2022 - 15:29:27 +0200) > > PMUFW: v1.1 > > Loading new PMUFW cfg obj (32 bytes) > > PMUFW: No permission to change config object > > Loading new PMUFW cfg obj (2032 bytes) > > > > where it is visible that permission is check before sending PMUFW > > configuration (big size). > > > > When this patch is applied it is visible that order is correct. > > U-Boot SPL 2022.10-rc5 (Sep 29 2022 - 15:47:08 +0200) > > Loading new PMUFW cfg obj (2032 bytes) > > PMUFW: v1.1 > > Loading new PMUFW cfg obj (32 bytes) > > > > Signed-off-by: Michal Simek <michal.simek@amd.com> > > --- > > > > board/xilinx/zynqmp/zynqmp.c | 12 ++++++++---- > > 1 file changed, 8 insertions(+), 4 deletions(-) > > > > diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c > > index 0b30dd048eb5..f1eb4ff38908 100644 > > --- a/board/xilinx/zynqmp/zynqmp.c > > +++ b/board/xilinx/zynqmp/zynqmp.c > > @@ -227,6 +227,14 @@ int board_init(void) > > char name[SOC_MAX_STR_SIZE]; > > int ret; > > #endif > > + > > + if (IS_ENABLED(CONFIG_SPL_BUILD)) { > > + /* Check *at build time* if the filename is an non-empty string */ > > + if (sizeof(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE) > 1) > > + zynqmp_pmufw_load_config_object(zynqmp_pm_cfg_obj, > > + zynqmp_pm_cfg_obj_size); > > + } > > + > > #if defined(CONFIG_ZYNQMP_FIRMWARE) > > struct udevice *dev; > > > > @@ -236,10 +244,6 @@ int board_init(void) > > #endif > > > > #if defined(CONFIG_SPL_BUILD) > > - /* Check *at build time* if the filename is an non-empty string */ > > - if (sizeof(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE) > 1) > > - zynqmp_pmufw_load_config_object(zynqmp_pm_cfg_obj, > > - zynqmp_pm_cfg_obj_size); > > printf("Silicon version:\t%d\n", zynqmp_get_silicon_version()); > > > > /* the CSU disables the JTAG interface when secure boot is enabled */ > > -- > > 2.36.1 > > > > Applied. > M This patch is failing in CI loop that's why v2 is needed. CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE is not defined when SPL is disabled that's why if (IS_ENABLED(CONFIG_SPL_BUILD)) can't be used. Thanks, Michal
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 0b30dd048eb5..f1eb4ff38908 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -227,6 +227,14 @@ int board_init(void) char name[SOC_MAX_STR_SIZE]; int ret; #endif + + if (IS_ENABLED(CONFIG_SPL_BUILD)) { + /* Check *at build time* if the filename is an non-empty string */ + if (sizeof(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE) > 1) + zynqmp_pmufw_load_config_object(zynqmp_pm_cfg_obj, + zynqmp_pm_cfg_obj_size); + } + #if defined(CONFIG_ZYNQMP_FIRMWARE) struct udevice *dev; @@ -236,10 +244,6 @@ int board_init(void) #endif #if defined(CONFIG_SPL_BUILD) - /* Check *at build time* if the filename is an non-empty string */ - if (sizeof(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE) > 1) - zynqmp_pmufw_load_config_object(zynqmp_pm_cfg_obj, - zynqmp_pm_cfg_obj_size); printf("Silicon version:\t%d\n", zynqmp_get_silicon_version()); /* the CSU disables the JTAG interface when secure boot is enabled */
Before this patch you could see in the log: U-Boot SPL 2022.10-rc5 (Sep 29 2022 - 15:29:27 +0200) PMUFW: v1.1 Loading new PMUFW cfg obj (32 bytes) PMUFW: No permission to change config object Loading new PMUFW cfg obj (2032 bytes) where it is visible that permission is check before sending PMUFW configuration (big size). When this patch is applied it is visible that order is correct. U-Boot SPL 2022.10-rc5 (Sep 29 2022 - 15:47:08 +0200) Loading new PMUFW cfg obj (2032 bytes) PMUFW: v1.1 Loading new PMUFW cfg obj (32 bytes) Signed-off-by: Michal Simek <michal.simek@amd.com> --- board/xilinx/zynqmp/zynqmp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)