Skip to content

Enable HPS execution stage notification

Ang u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [U-Boot] [PATCH v1 0/3] Enable HPS execution stage notification
Quoted 52 lines · Marek Vasut
Quoted 37 lines · Chee Hong
Quoted 29 lines · Marek Vasut
Quoted 22 lines · chee.hong.ang at intel.com

From: "Ang, Chee Hong" <[email protected]>

Notify Secure Device Manager (SDM) on the stage of HPS code execution.
In general, there are three main code execution stages:
(1) First Stage Boot Loader (FSBL) which is U-Boot SPL.
(2) Second Stage Boot Loader (SSBL) which is U-Boot.
(3) Operating System which is Linux.

Ang, Chee Hong (3):
  ARM: socfpga: stratix10: Add HPS execution stage notification function
  ARM: socfpga: stratix10: To notify SDM when SPL pass control to
U-Boot
  ARM: socfpga: stratix10: To notify SDM when U-Boot pass control
to
    Linux

Quoted 5 lines

 arch/arm/mach-socfpga/include/mach/mailbox_s10.h | 7 +++++++ arch/arm/mach-socfpga/mailbox_s10.c              | 6 ++++++ arch/arm/mach-socfpga/misc_s10.c                 | 5 +++++ arch/arm/mach-socfpga/spl_s10.c                  | 6 ++++++

 4 files changed, 24 insertions(+)
Quoted 6 lines

Can we expect any of this mbox stuff to be ever migrated over to DM
and
moved into drivers/ instead of constantly adding stuff to mach- socfpga ?

Quoted 14 lines

These mailbox stuffs are basically a set of functions shared by SPL, u-
boot and Linux (PSCI) which is specific to our platform. Even if we convert this mailbox stuffs to DM and move to drivers/, we still need
to duplicate those functions for PSCI which can be called by Linux. We
are starting to spend time converting our existing clock manager and
etc for S10 platform to DM and will move them to drivers/. But we still need to keep those PSCI stuffs which are specific to our
platform in mach-sofcpga.

Quoted 3 lines

There was some discussion about the PSCI here:
https://www.mail-archive.com/u-boot at lists.denx.de/msg319458.html

Yes. I am aware of it. Current implementation of PSCI in u-boot is "just work" but not elegant.

Currently, the PSCI sections only exist right before u-boot booting Linux, because those PSCI functions will be used by Linux only. Our current boot flow involve only u-boot (no ATF):
1) SPL (EL3, secure)
2) U-boot (El3. secure)
3) Install PSCI sections (EL3, secure)
4) Linux (EL1, non-secure)

U-boot don't need PSCI call to access secure resources because it's already running in EL3 (secure). Linux will be calling those PSCI functions(EL3) from EL1 to access secure resources.

For those users who typically don't use u-boot's PSCI, their boot flow is as follow:

1) ATF (EL3, secure)
2) Install PSCI sections (also known as secure monitor) (EL3, secure)
3) U-boot (EL2, non-secure)
4) Linux (EL1, non-secure)

With this boot flow, all PSCI stuffs are in ATF. So u-boot and Linux don't have access to secure resources so both of them have to access it via PSCI/SMC calls. The downside is this boot flow involves 2 pieces of software component which are ATF and u-boot.

Back to our u-boot use case, so far our PSCI services don't have dependency on common full driver such as (SPI, I2C and etc). That's the reason we just have sets of functions which can be directly called by u-boot(EL3) and also called by Linux(EL1) through PSCI/SMC.

Those PSCI discussions are some good discussions. You have made your points and I know where you stand in those discussions. Currently, PSCI is just part of u-boot (2nd stage boot loader) and it is detached from u-boot right before booting Linux because u-boot is not expected to stay resident in memory after booting Linux.

Whether PSCI should be part of SPL or TPL to support full drivers in DM and how/when it should be installed need some serious thought and effort to do it right.