diff mbox series

[v2,2/3] rockpi4: board: Add firmware image information needed for capsule updates

Message ID 20220906065823.7413-3-sughosh.ganu@linaro.org
State New
Headers show
Series rockpi4: Add capsule update support | expand

Commit Message

Sughosh Ganu Sept. 6, 2022, 6:58 a.m. UTC
Add information that will be needed for enabling the UEFI capsule
update feature on the RockPi4 boards. With the feature enabled, it
would be possible to update the idbloader and u-boot.itb images on the
RockPi4B and RockPi4C variants.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---
Changes since V1:
* Split the board related declarations into a separate patch.

 board/rockchip/evb_rk3399/evb-rk3399.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Peter Robinson Sept. 9, 2022, 12:41 p.m. UTC | #1
On Tue, Sep 6, 2022 at 7:59 AM Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> Add information that will be needed for enabling the UEFI capsule
> update feature on the RockPi4 boards. With the feature enabled, it
> would be possible to update the idbloader and u-boot.itb images on the
> RockPi4B and RockPi4C variants.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> ---
> Changes since V1:
> * Split the board related declarations into a separate patch.
>
>  board/rockchip/evb_rk3399/evb-rk3399.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c
> index abb76585cf..abb0580a8e 100644
> --- a/board/rockchip/evb_rk3399/evb-rk3399.c
> +++ b/board/rockchip/evb_rk3399/evb-rk3399.c
> @@ -5,11 +5,25 @@
>
>  #include <common.h>
>  #include <dm.h>
> +#include <efi_loader.h>
>  #include <init.h>
>  #include <log.h>
>  #include <asm/arch-rockchip/periph.h>
> +#include <linux/kernel.h>
>  #include <power/regulator.h>
>
> +#define ROCKPI4_UPDATABLE_IMAGES       2

Any reason the above isn't defineable in the config file?

> +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
> +struct efi_fw_image fw_images[ROCKPI4_UPDATABLE_IMAGES] = {0};
> +
> +struct efi_capsule_update_info update_info = {
> +       .images = fw_images,
> +};
> +
> +u8 num_image_type_guids = ARRAY_SIZE(fw_images);
> +#endif
> +
>  #ifndef CONFIG_SPL_BUILD
>  int board_early_init_f(void)
>  {
> --
> 2.34.1
>
Sughosh Ganu Sept. 13, 2022, 9:31 a.m. UTC | #2
hi Peter,

On Fri, 9 Sept 2022 at 18:12, Peter Robinson <pbrobinson@gmail.com> wrote:
>
> On Tue, Sep 6, 2022 at 7:59 AM Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
> >
> > Add information that will be needed for enabling the UEFI capsule
> > update feature on the RockPi4 boards. With the feature enabled, it
> > would be possible to update the idbloader and u-boot.itb images on the
> > RockPi4B and RockPi4C variants.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> > ---
> > Changes since V1:
> > * Split the board related declarations into a separate patch.
> >
> >  board/rockchip/evb_rk3399/evb-rk3399.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c
> > index abb76585cf..abb0580a8e 100644
> > --- a/board/rockchip/evb_rk3399/evb-rk3399.c
> > +++ b/board/rockchip/evb_rk3399/evb-rk3399.c
> > @@ -5,11 +5,25 @@
> >
> >  #include <common.h>
> >  #include <dm.h>
> > +#include <efi_loader.h>
> >  #include <init.h>
> >  #include <log.h>
> >  #include <asm/arch-rockchip/periph.h>
> > +#include <linux/kernel.h>
> >  #include <power/regulator.h>
> >
> > +#define ROCKPI4_UPDATABLE_IMAGES       2
>
> Any reason the above isn't defineable in the config file?

Do you mean through a Kconfig symbol? Currently, RockPi4 is the only
board for which such a macro is needed. The rest of the boards which
enable capsule updates define the fw_images array statically and the
number of images can be computed without a need for a config symbol.
So I did not want to add a Kconfig symbol when it won't be needed for
a majority of the boards.

-sughosh

>
> > +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
> > +struct efi_fw_image fw_images[ROCKPI4_UPDATABLE_IMAGES] = {0};
> > +
> > +struct efi_capsule_update_info update_info = {
> > +       .images = fw_images,
> > +};
> > +
> > +u8 num_image_type_guids = ARRAY_SIZE(fw_images);
> > +#endif
> > +
> >  #ifndef CONFIG_SPL_BUILD
> >  int board_early_init_f(void)
> >  {
> > --
> > 2.34.1
> >
diff mbox series

Patch

diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c
index abb76585cf..abb0580a8e 100644
--- a/board/rockchip/evb_rk3399/evb-rk3399.c
+++ b/board/rockchip/evb_rk3399/evb-rk3399.c
@@ -5,11 +5,25 @@ 
 
 #include <common.h>
 #include <dm.h>
+#include <efi_loader.h>
 #include <init.h>
 #include <log.h>
 #include <asm/arch-rockchip/periph.h>
+#include <linux/kernel.h>
 #include <power/regulator.h>
 
+#define ROCKPI4_UPDATABLE_IMAGES	2
+
+#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[ROCKPI4_UPDATABLE_IMAGES] = {0};
+
+struct efi_capsule_update_info update_info = {
+	.images = fw_images,
+};
+
+u8 num_image_type_guids = ARRAY_SIZE(fw_images);
+#endif
+
 #ifndef CONFIG_SPL_BUILD
 int board_early_init_f(void)
 {