diff mbox series

[7/7] x86: fsp: Only FSP2 has INIT_PHASE_END_FIRMWARE

Message ID 20210731084529.7524-8-bmeng.cn@gmail.com
State Superseded
Delegated to: Bin Meng
Headers show
Series x86: Various fixes to MTRR and FSP codes | expand

Commit Message

Bin Meng July 31, 2021, 8:45 a.m. UTC
For FSP1, there is no such INIT_PHASE_END_FIRMWARE.

Fixes: 7c73cea44290 ("x86: Notify the FSP of the 'end firmware' event")
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

 arch/x86/lib/fsp/fsp_common.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

Comments

Simon Glass Aug. 1, 2021, 7:19 p.m. UTC | #1
Hi Bin,

On Sat, 31 Jul 2021 at 02:45, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> For FSP1, there is no such INIT_PHASE_END_FIRMWARE.
>
> Fixes: 7c73cea44290 ("x86: Notify the FSP of the 'end firmware' event")
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>
> ---
>
>  arch/x86/lib/fsp/fsp_common.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/lib/fsp/fsp_common.c b/arch/x86/lib/fsp/fsp_common.c
> index 6365b0a50a..0155eaee8d 100644
> --- a/arch/x86/lib/fsp/fsp_common.c
> +++ b/arch/x86/lib/fsp/fsp_common.c
> @@ -68,13 +68,15 @@ void board_final_cleanup(void)
>         /* TODO(sjg@chromium.org): This causes Linux to crash */
>         return;
>
> -       /* call into FspNotify */
> -       debug("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): ");
> -       status = fsp_notify(NULL, INIT_PHASE_END_FIRMWARE);
> -       if (status)
> -               debug("fail, error code %x\n", status);
> -       else
> -               debug("OK\n");
> +       if (CONFIG_IS_ENABLED(FSP_VERSION2)) {
> +               /* call into FspNotify */
> +               debug("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): ");
> +               status = fsp_notify(NULL, INIT_PHASE_END_FIRMWARE);
> +               if (status)
> +                       debug("fail, error code %x\n", status);
> +               else
> +                       debug("OK\n");
> +       }
>  }

So shouldn't we move this whole function into fsp2?

>
>  int fsp_save_s3_stack(void)
> --
> 2.25.1
>

Regards,
Simon
Bin Meng Aug. 2, 2021, 2:53 a.m. UTC | #2
Hi Simon,

On Mon, Aug 2, 2021 at 3:19 AM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Bin,
>
> On Sat, 31 Jul 2021 at 02:45, Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > For FSP1, there is no such INIT_PHASE_END_FIRMWARE.
> >
> > Fixes: 7c73cea44290 ("x86: Notify the FSP of the 'end firmware' event")
> > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> >
> > ---
> >
> >  arch/x86/lib/fsp/fsp_common.c | 16 +++++++++-------
> >  1 file changed, 9 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/x86/lib/fsp/fsp_common.c b/arch/x86/lib/fsp/fsp_common.c
> > index 6365b0a50a..0155eaee8d 100644
> > --- a/arch/x86/lib/fsp/fsp_common.c
> > +++ b/arch/x86/lib/fsp/fsp_common.c
> > @@ -68,13 +68,15 @@ void board_final_cleanup(void)
> >         /* TODO(sjg@chromium.org): This causes Linux to crash */
> >         return;
> >
> > -       /* call into FspNotify */
> > -       debug("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): ");
> > -       status = fsp_notify(NULL, INIT_PHASE_END_FIRMWARE);
> > -       if (status)
> > -               debug("fail, error code %x\n", status);
> > -       else
> > -               debug("OK\n");
> > +       if (CONFIG_IS_ENABLED(FSP_VERSION2)) {
> > +               /* call into FspNotify */
> > +               debug("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): ");
> > +               status = fsp_notify(NULL, INIT_PHASE_END_FIRMWARE);
> > +               if (status)
> > +                       debug("fail, error code %x\n", status);
> > +               else
> > +                       debug("OK\n");
> > +       }
> >  }
>
> So shouldn't we move this whole function into fsp2?

Yes, I think so.

Regards,
Bin
diff mbox series

Patch

diff --git a/arch/x86/lib/fsp/fsp_common.c b/arch/x86/lib/fsp/fsp_common.c
index 6365b0a50a..0155eaee8d 100644
--- a/arch/x86/lib/fsp/fsp_common.c
+++ b/arch/x86/lib/fsp/fsp_common.c
@@ -68,13 +68,15 @@  void board_final_cleanup(void)
 	/* TODO(sjg@chromium.org): This causes Linux to crash */
 	return;
 
-	/* call into FspNotify */
-	debug("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): ");
-	status = fsp_notify(NULL, INIT_PHASE_END_FIRMWARE);
-	if (status)
-		debug("fail, error code %x\n", status);
-	else
-		debug("OK\n");
+	if (CONFIG_IS_ENABLED(FSP_VERSION2)) {
+		/* call into FspNotify */
+		debug("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): ");
+		status = fsp_notify(NULL, INIT_PHASE_END_FIRMWARE);
+		if (status)
+			debug("fail, error code %x\n", status);
+		else
+			debug("OK\n");
+	}
 }
 
 int fsp_save_s3_stack(void)