diff mbox series

boot: vbe_simple: Fix vbe_simple_read_bootflow() dependency

Message ID 20230403034026.2812495-1-bmeng@tinylab.org
State Accepted
Commit 327883c3c93692cca32d20a7f59b07f5c3d0c5c8
Delegated to: Simon Glass
Headers show
Series boot: vbe_simple: Fix vbe_simple_read_bootflow() dependency | expand

Commit Message

Bin Meng April 3, 2023, 3:40 a.m. UTC
vbe_simple_read_bootflow() calls vbe_simple_read_bootflow_fw()
which is only available when BOOTMETH_VBE_SIMPLE_FW is on.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
---

 boot/vbe_simple.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Heinrich Schuchardt April 4, 2023, 4:50 a.m. UTC | #1
On 4/3/23 05:40, Bin Meng wrote:
> vbe_simple_read_bootflow() calls vbe_simple_read_bootflow_fw()
> which is only available when BOOTMETH_VBE_SIMPLE_FW is on.
>
> Signed-off-by: Bin Meng <bmeng@tinylab.org>
> ---
>
>   boot/vbe_simple.c | 12 +++++++-----
>   1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/boot/vbe_simple.c b/boot/vbe_simple.c
> index 59676d8613..12682abd39 100644
> --- a/boot/vbe_simple.c
> +++ b/boot/vbe_simple.c
> @@ -148,11 +148,13 @@ static int vbe_simple_read_bootflow(struct udevice *dev, struct bootflow *bflow)
>   {
>   	int ret;
>
> -	if (vbe_phase() == VBE_PHASE_FIRMWARE) {
> -		ret = vbe_simple_read_bootflow_fw(dev, bflow);
> -		if (ret)
> -			return log_msg_ret("fw", ret);
> -		return 0;
> +	if (CONFIG_IS_ENABLED(BOOTMETH_VBE_SIMPLE_FW)) {

Hello Simon,

boot/Makefile:58:obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE_FW) +=
vbe_simple_fw.o
CONFIG_IS_ENABLED(FOO) does not cover CONFIG_VPL_VPL_FOO.

The patch looks ok. But what is CONFIG_VPL_BOOTMETH_VBE_SIMPLE_FW to be
used for (boot/Kconfig:606)? Can we delete that symbol?

Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

> +		if (vbe_phase() == VBE_PHASE_FIRMWARE) {
> +			ret = vbe_simple_read_bootflow_fw(dev, bflow);
> +			if (ret)
> +				return log_msg_ret("fw", ret);
> +			return 0;
> +		}
>   	}
>
>   	return -EINVAL;
Simon Glass April 7, 2023, 6:55 p.m. UTC | #2
Hi Heinrich,

On Tue, 4 Apr 2023 at 16:50, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 4/3/23 05:40, Bin Meng wrote:
> > vbe_simple_read_bootflow() calls vbe_simple_read_bootflow_fw()
> > which is only available when BOOTMETH_VBE_SIMPLE_FW is on.
> >
> > Signed-off-by: Bin Meng <bmeng@tinylab.org>
> > ---
> >
> >   boot/vbe_simple.c | 12 +++++++-----
> >   1 file changed, 7 insertions(+), 5 deletions(-)
> >
> > diff --git a/boot/vbe_simple.c b/boot/vbe_simple.c
> > index 59676d8613..12682abd39 100644
> > --- a/boot/vbe_simple.c
> > +++ b/boot/vbe_simple.c
> > @@ -148,11 +148,13 @@ static int vbe_simple_read_bootflow(struct udevice *dev, struct bootflow *bflow)
> >   {
> >       int ret;
> >
> > -     if (vbe_phase() == VBE_PHASE_FIRMWARE) {
> > -             ret = vbe_simple_read_bootflow_fw(dev, bflow);
> > -             if (ret)
> > -                     return log_msg_ret("fw", ret);
> > -             return 0;
> > +     if (CONFIG_IS_ENABLED(BOOTMETH_VBE_SIMPLE_FW)) {
>
> Hello Simon,
>
> boot/Makefile:58:obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE_FW) +=
> vbe_simple_fw.o
> CONFIG_IS_ENABLED(FOO) does not cover CONFIG_VPL_VPL_FOO.
>
> The patch looks ok. But what is CONFIG_VPL_BOOTMETH_VBE_SIMPLE_FW to be
> used for (boot/Kconfig:606)? Can we delete that symbol?

We use that to enable the VPL part of VBE's 'simple' method, i.e. the
bit that decides what SPL to use. One we have other VBE methods, we'll
need to add more options.

Reviewed-by: Simon Glass <sjg@chromium.org>

>
> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>
> > +             if (vbe_phase() == VBE_PHASE_FIRMWARE) {
> > +                     ret = vbe_simple_read_bootflow_fw(dev, bflow);
> > +                     if (ret)
> > +                             return log_msg_ret("fw", ret);
> > +                     return 0;
> > +             }
> >       }
> >
> >       return -EINVAL;
>

Regards,
SImon
Simon Glass April 22, 2023, 4:51 p.m. UTC | #3
Hi Heinrich,

On Tue, 4 Apr 2023 at 16:50, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 4/3/23 05:40, Bin Meng wrote:
> > vbe_simple_read_bootflow() calls vbe_simple_read_bootflow_fw()
> > which is only available when BOOTMETH_VBE_SIMPLE_FW is on.
> >
> > Signed-off-by: Bin Meng <bmeng@tinylab.org>
> > ---
> >
> >   boot/vbe_simple.c | 12 +++++++-----
> >   1 file changed, 7 insertions(+), 5 deletions(-)
> >
Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/boot/vbe_simple.c b/boot/vbe_simple.c
index 59676d8613..12682abd39 100644
--- a/boot/vbe_simple.c
+++ b/boot/vbe_simple.c
@@ -148,11 +148,13 @@  static int vbe_simple_read_bootflow(struct udevice *dev, struct bootflow *bflow)
 {
 	int ret;
 
-	if (vbe_phase() == VBE_PHASE_FIRMWARE) {
-		ret = vbe_simple_read_bootflow_fw(dev, bflow);
-		if (ret)
-			return log_msg_ret("fw", ret);
-		return 0;
+	if (CONFIG_IS_ENABLED(BOOTMETH_VBE_SIMPLE_FW)) {
+		if (vbe_phase() == VBE_PHASE_FIRMWARE) {
+			ret = vbe_simple_read_bootflow_fw(dev, bflow);
+			if (ret)
+				return log_msg_ret("fw", ret);
+			return 0;
+		}
 	}
 
 	return -EINVAL;