* [PATCH v2] efi_loader: Use sysreset instead of reset command
@ 2022-03-16 8:03 Masami Hiramatsu
2022-03-16 12:29 ` Heinrich Schuchardt
0 siblings, 1 reply; 5+ messages in thread
From: Masami Hiramatsu @ 2022-03-16 8:03 UTC (permalink / raw)
To: u-boot, Simon Glass
Cc: Masami Hiramatsu, Patrick Delaunay, Patrice Chotard,
Heinrich Schuchardt, Alexander Graf, AKASHI Takahiro, Bin Meng,
Ilias Apalodimas, Jose Marinho, Grant Likely, Tom Rini,
Etienne Carriere, Sughosh Ganu, Paul Liu
Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
feature to reboot (cold reset) machine instead of using reset command
interface, since this is not a command.
Note that this will make CONFIG_EFI_CAPSULE_ON_DISK depending on
the CONFIG_SYSRESET.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
---
Changes in v2:
- Add CONFIG_SYSRESET dependency.
- Fix to add #include <sysreset.h>
---
lib/efi_loader/Kconfig | 1 +
lib/efi_loader/efi_capsule.c | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index e5e35fe51f..33138237cc 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -130,6 +130,7 @@ config EFI_RUNTIME_UPDATE_CAPSULE
config EFI_CAPSULE_ON_DISK
bool "Enable capsule-on-disk support"
+ depends on SYSRESET
select EFI_HAVE_CAPSULE_SUPPORT
help
Select this option if you want to use capsule-on-disk feature,
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 613b531b82..a3d1d7e95a 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -18,6 +18,7 @@
#include <malloc.h>
#include <mapmem.h>
#include <sort.h>
+#include <sysreset.h>
#include <asm/global_data.h>
#include <crypto/pkcs7.h>
@@ -1150,9 +1151,9 @@ efi_status_t efi_launch_capsules(void)
* UEFI spec requires to reset system after complete processing capsule
* update on the storage.
*/
- log_info("Reboot after firmware update");
+ log_info("Reboot after firmware update.\n");
/* Cold reset is required for loading the new firmware. */
- do_reset(NULL, 0, 0, NULL);
+ sysreset_walk_halt(SYSRESET_COLD);
hang();
/* not reach here */
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] efi_loader: Use sysreset instead of reset command
2022-03-16 8:03 [PATCH v2] efi_loader: Use sysreset instead of reset command Masami Hiramatsu
@ 2022-03-16 12:29 ` Heinrich Schuchardt
2022-03-16 19:23 ` Simon Glass
0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2022-03-16 12:29 UTC (permalink / raw)
To: Masami Hiramatsu
Cc: Patrick Delaunay, Patrice Chotard, Alexander Graf,
AKASHI Takahiro, Bin Meng, Ilias Apalodimas, Jose Marinho,
Grant Likely, Tom Rini, Etienne Carriere, Sughosh Ganu, Paul Liu,
Simon Glass, u-boot
On 3/16/22 09:03, Masami Hiramatsu wrote:
> Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
> feature to reboot (cold reset) machine instead of using reset command
> interface, since this is not a command.
> Note that this will make CONFIG_EFI_CAPSULE_ON_DISK depending on
> the CONFIG_SYSRESET.
>
> Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> Changes in v2:
> - Add CONFIG_SYSRESET dependency.
> - Fix to add #include <sysreset.h>
> ---
> lib/efi_loader/Kconfig | 1 +
> lib/efi_loader/efi_capsule.c | 5 +++--
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> index e5e35fe51f..33138237cc 100644
> --- a/lib/efi_loader/Kconfig
> +++ b/lib/efi_loader/Kconfig
> @@ -130,6 +130,7 @@ config EFI_RUNTIME_UPDATE_CAPSULE
>
> config EFI_CAPSULE_ON_DISK
> bool "Enable capsule-on-disk support"
> + depends on SYSRESET
> select EFI_HAVE_CAPSULE_SUPPORT
> help
> Select this option if you want to use capsule-on-disk feature,
> diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> index 613b531b82..a3d1d7e95a 100644
> --- a/lib/efi_loader/efi_capsule.c
> +++ b/lib/efi_loader/efi_capsule.c
> @@ -18,6 +18,7 @@
> #include <malloc.h>
> #include <mapmem.h>
> #include <sort.h>
> +#include <sysreset.h>
> #include <asm/global_data.h>
>
> #include <crypto/pkcs7.h>
> @@ -1150,9 +1151,9 @@ efi_status_t efi_launch_capsules(void)
> * UEFI spec requires to reset system after complete processing capsule
> * update on the storage.
> */
> - log_info("Reboot after firmware update");
> + log_info("Reboot after firmware update.\n");
> /* Cold reset is required for loading the new firmware. */
> - do_reset(NULL, 0, 0, NULL);
> + sysreset_walk_halt(SYSRESET_COLD);
> hang();
> /* not reach here */
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] efi_loader: Use sysreset instead of reset command
2022-03-16 12:29 ` Heinrich Schuchardt
@ 2022-03-16 19:23 ` Simon Glass
2022-03-19 9:01 ` Heinrich Schuchardt
0 siblings, 1 reply; 5+ messages in thread
From: Simon Glass @ 2022-03-16 19:23 UTC (permalink / raw)
To: Heinrich Schuchardt
Cc: Masami Hiramatsu, Patrick Delaunay, Patrice Chotard,
Alexander Graf, AKASHI Takahiro, Bin Meng, Ilias Apalodimas,
Jose Marinho, Grant Likely, Tom Rini, Etienne Carriere,
Sughosh Ganu, Paul Liu, U-Boot Mailing List
On Wed, 16 Mar 2022 at 06:35, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 3/16/22 09:03, Masami Hiramatsu wrote:
> > Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
> > feature to reboot (cold reset) machine instead of using reset command
> > interface, since this is not a command.
> > Note that this will make CONFIG_EFI_CAPSULE_ON_DISK depending on
> > the CONFIG_SYSRESET.
> >
> > Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>
> > ---
> > Changes in v2:
> > - Add CONFIG_SYSRESET dependency.
> > - Fix to add #include <sysreset.h>
> > ---
> > lib/efi_loader/Kconfig | 1 +
> > lib/efi_loader/efi_capsule.c | 5 +++--
> > 2 files changed, 4 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> > index e5e35fe51f..33138237cc 100644
> > --- a/lib/efi_loader/Kconfig
> > +++ b/lib/efi_loader/Kconfig
> > @@ -130,6 +130,7 @@ config EFI_RUNTIME_UPDATE_CAPSULE
> >
> > config EFI_CAPSULE_ON_DISK
> > bool "Enable capsule-on-disk support"
> > + depends on SYSRESET
> > select EFI_HAVE_CAPSULE_SUPPORT
> > help
> > Select this option if you want to use capsule-on-disk feature,
> > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> > index 613b531b82..a3d1d7e95a 100644
> > --- a/lib/efi_loader/efi_capsule.c
> > +++ b/lib/efi_loader/efi_capsule.c
> > @@ -18,6 +18,7 @@
> > #include <malloc.h>
> > #include <mapmem.h>
> > #include <sort.h>
> > +#include <sysreset.h>
> > #include <asm/global_data.h>
> >
> > #include <crypto/pkcs7.h>
> > @@ -1150,9 +1151,9 @@ efi_status_t efi_launch_capsules(void)
> > * UEFI spec requires to reset system after complete processing capsule
> > * update on the storage.
> > */
> > - log_info("Reboot after firmware update");
> > + log_info("Reboot after firmware update.\n");
> > /* Cold reset is required for loading the new firmware. */
> > - do_reset(NULL, 0, 0, NULL);
> > + sysreset_walk_halt(SYSRESET_COLD);
> > hang();
> > /* not reach here */
> >
> >
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] efi_loader: Use sysreset instead of reset command
2022-03-16 19:23 ` Simon Glass
@ 2022-03-19 9:01 ` Heinrich Schuchardt
2022-03-21 8:02 ` Masami Hiramatsu
0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2022-03-19 9:01 UTC (permalink / raw)
To: Masami Hiramatsu
Cc: Patrick Delaunay, Patrice Chotard, Alexander Graf,
AKASHI Takahiro, Bin Meng, Ilias Apalodimas, Jose Marinho,
Grant Likely, Tom Rini, Etienne Carriere, Sughosh Ganu, Paul Liu,
U-Boot Mailing List, Simon Glass
On 3/16/22 20:23, Simon Glass wrote:
> On Wed, 16 Mar 2022 at 06:35, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>
>> On 3/16/22 09:03, Masami Hiramatsu wrote:
>>> Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
>>> feature to reboot (cold reset) machine instead of using reset command
>>> interface, since this is not a command.
>>> Note that this will make CONFIG_EFI_CAPSULE_ON_DISK depending on
>>> the CONFIG_SYSRESET.
>>>
>>> Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
>>
>> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>
>>> ---
>>> Changes in v2:
>>> - Add CONFIG_SYSRESET dependency.
>>> - Fix to add #include <sysreset.h>
>>> ---
>>> lib/efi_loader/Kconfig | 1 +
>>> lib/efi_loader/efi_capsule.c | 5 +++--
>>> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
>
>>>
>>> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
>>> index e5e35fe51f..33138237cc 100644
>>> --- a/lib/efi_loader/Kconfig
>>> +++ b/lib/efi_loader/Kconfig
>>> @@ -130,6 +130,7 @@ config EFI_RUNTIME_UPDATE_CAPSULE
>>>
>>> config EFI_CAPSULE_ON_DISK
>>> bool "Enable capsule-on-disk support"
>>> + depends on SYSRESET
With this change xilinx_zynq_virt_defconfig fails to build:
arm-linux-gnueabi-ld.bfd: cmd/efidebug.o: in function
`do_efi_capsule_on_disk_update':
/home/zfsdt/workspace/u-boot-build/denx/cmd/efidebug.c:92: undefined
reference to `efi_launch_capsules'
Command 'efi capsule disk-update' should only be enabled if
CONFIG_EFI_CAPSULE_ON_DISK=y.
arm-linux-gnueabi-ld.bfd: lib/efi_loader/efi_setup.o: in function
`efi_init_obj_list':
/home/zfsdt/workspace/u-boot-build/denx/lib/efi_loader/efi_setup.c:272:
undefined reference to `efi_load_capsule_drivers'
make: *** [Makefile:1801: u-boot] Error 1
efi_load_capsule_drivers() must be available even if EFI_CAPSULE_ON_DISK
is not enabled to make CapsuleUpdate() work.
Please, add the missing changes.
Best regards
Heinrich
>>> select EFI_HAVE_CAPSULE_SUPPORT
>>> help
>>> Select this option if you want to use capsule-on-disk feature,
>>> diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
>>> index 613b531b82..a3d1d7e95a 100644
>>> --- a/lib/efi_loader/efi_capsule.c
>>> +++ b/lib/efi_loader/efi_capsule.c
>>> @@ -18,6 +18,7 @@
>>> #include <malloc.h>
>>> #include <mapmem.h>
>>> #include <sort.h>
>>> +#include <sysreset.h>
>>> #include <asm/global_data.h>
>>>
>>> #include <crypto/pkcs7.h>
>>> @@ -1150,9 +1151,9 @@ efi_status_t efi_launch_capsules(void)
>>> * UEFI spec requires to reset system after complete processing capsule
>>> * update on the storage.
>>> */
>>> - log_info("Reboot after firmware update");
>>> + log_info("Reboot after firmware update.\n");
>>> /* Cold reset is required for loading the new firmware. */
>>> - do_reset(NULL, 0, 0, NULL);
>>> + sysreset_walk_halt(SYSRESET_COLD);
>>> hang();
>>> /* not reach here */
>>>
>>>
>>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] efi_loader: Use sysreset instead of reset command
2022-03-19 9:01 ` Heinrich Schuchardt
@ 2022-03-21 8:02 ` Masami Hiramatsu
0 siblings, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2022-03-21 8:02 UTC (permalink / raw)
To: Heinrich Schuchardt
Cc: Patrick Delaunay, Patrice Chotard, Alexander Graf,
AKASHI Takahiro, Bin Meng, Ilias Apalodimas, Jose Marinho,
Grant Likely, Tom Rini, Etienne Carriere, Sughosh Ganu, Paul Liu,
U-Boot Mailing List, Simon Glass
Hi Heinrich,
Thanks for finding the issues.
2022年3月19日(土) 18:02 Heinrich Schuchardt <xypron.glpk@gmx.de>:
>
> On 3/16/22 20:23, Simon Glass wrote:
> > On Wed, 16 Mar 2022 at 06:35, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> >>
> >> On 3/16/22 09:03, Masami Hiramatsu wrote:
> >>> Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
> >>> feature to reboot (cold reset) machine instead of using reset command
> >>> interface, since this is not a command.
> >>> Note that this will make CONFIG_EFI_CAPSULE_ON_DISK depending on
> >>> the CONFIG_SYSRESET.
> >>>
> >>> Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
> >>
> >> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >>
> >>> ---
> >>> Changes in v2:
> >>> - Add CONFIG_SYSRESET dependency.
> >>> - Fix to add #include <sysreset.h>
> >>> ---
> >>> lib/efi_loader/Kconfig | 1 +
> >>> lib/efi_loader/efi_capsule.c | 5 +++--
> >>> 2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> >
> >>>
> >>> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> >>> index e5e35fe51f..33138237cc 100644
> >>> --- a/lib/efi_loader/Kconfig
> >>> +++ b/lib/efi_loader/Kconfig
> >>> @@ -130,6 +130,7 @@ config EFI_RUNTIME_UPDATE_CAPSULE
> >>>
> >>> config EFI_CAPSULE_ON_DISK
> >>> bool "Enable capsule-on-disk support"
> >>> + depends on SYSRESET
>
> With this change xilinx_zynq_virt_defconfig fails to build:
>
> arm-linux-gnueabi-ld.bfd: cmd/efidebug.o: in function
> `do_efi_capsule_on_disk_update':
> /home/zfsdt/workspace/u-boot-build/denx/cmd/efidebug.c:92: undefined
> reference to `efi_launch_capsules'
>
> Command 'efi capsule disk-update' should only be enabled if
> CONFIG_EFI_CAPSULE_ON_DISK=y.
OK.
> arm-linux-gnueabi-ld.bfd: lib/efi_loader/efi_setup.o: in function
> `efi_init_obj_list':
> /home/zfsdt/workspace/u-boot-build/denx/lib/efi_loader/efi_setup.c:272:
> undefined reference to `efi_load_capsule_drivers'
> make: *** [Makefile:1801: u-boot] Error 1
>
> efi_load_capsule_drivers() must be available even if EFI_CAPSULE_ON_DISK
> is not enabled to make CapsuleUpdate() work.
Yes, we have CONFIG_EFI_HAVE_CAPSULE_SUPPORT for such case.
>
> Please, add the missing changes.
OK, let me update the series.
Thank you!
>
> Best regards
>
> Heinrich
>
> >>> select EFI_HAVE_CAPSULE_SUPPORT
> >>> help
> >>> Select this option if you want to use capsule-on-disk feature,
> >>> diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> >>> index 613b531b82..a3d1d7e95a 100644
> >>> --- a/lib/efi_loader/efi_capsule.c
> >>> +++ b/lib/efi_loader/efi_capsule.c
> >>> @@ -18,6 +18,7 @@
> >>> #include <malloc.h>
> >>> #include <mapmem.h>
> >>> #include <sort.h>
> >>> +#include <sysreset.h>
> >>> #include <asm/global_data.h>
> >>>
> >>> #include <crypto/pkcs7.h>
> >>> @@ -1150,9 +1151,9 @@ efi_status_t efi_launch_capsules(void)
> >>> * UEFI spec requires to reset system after complete processing capsule
> >>> * update on the storage.
> >>> */
> >>> - log_info("Reboot after firmware update");
> >>> + log_info("Reboot after firmware update.\n");
> >>> /* Cold reset is required for loading the new firmware. */
> >>> - do_reset(NULL, 0, 0, NULL);
> >>> + sysreset_walk_halt(SYSRESET_COLD);
> >>> hang();
> >>> /* not reach here */
> >>>
> >>>
> >>
>
--
Masami Hiramatsu
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-21 8:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 8:03 [PATCH v2] efi_loader: Use sysreset instead of reset command Masami Hiramatsu
2022-03-16 12:29 ` Heinrich Schuchardt
2022-03-16 19:23 ` Simon Glass
2022-03-19 9:01 ` Heinrich Schuchardt
2022-03-21 8:02 ` Masami Hiramatsu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.