public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marcin Juszkiewicz" <marcin.juszkiewicz@linaro.org>
To: devel@edk2.groups.io
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
	 Ard Biesheuvel <ardb+tianocore@kernel.org>,
	 Graeme Gregory <graeme@xora.org.uk>,
	 Xiong Yining <xiongyining1480@phytium.com.cn>,
	 Chen Baozi <chenbaozi@phytium.com.cn>,
	 Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: [edk2-devel] [PATCH edk2-platforms v7 0/4] get rid of DeviceTree from SbsaQemu
Date: Tue, 19 Mar 2024 14:49:53 +0100	[thread overview]
Message-ID: <20240319-no-dt-for-cpu-v7-0-ac0a57a23a8f@linaro.org> (raw)

We want to stop parsing DeviceTree to gather hardware information.

Instead we ask TF-A for those details using SMC calls. On real hardware
platform it could be asking on-board Embedded Controller.

Hardware information (CPU, Memory) is now in SbsaQemuHardwareInfoLib
together with new code for handling SMC stuff. There is no DT parsing
anywhere.

TF-A part is merged already (and we have it in edk2-non-osi):
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/25707

Patch 4 needs work to pass MemInfo as reference.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
Changes in v7:
- dropped CoreCount Pcd - code calls SbsaQemuGetCpuCount() instead
- dropped DT fallbacks - we have up-to-date TF-A in edk2-non-osi
- system shutdowns when there is no cpu or memory information
- SbsaQemuHardwareInfoLib debug calls show function names
- Link to v6: https://openfw.io/edk2-devel/20240306-no-dt-for-cpu-v6-0-acd8727a1b59@linaro.org

Changes in v6 (Marcin Juszkiewicz):
- patch 5 now shutdowns system in case of no CPU information

Changes in v5 (Xiong Yining):
- added missing patch
- Link to v5: https://openfw.io/edk2-devel/20240131132400.3022662-1-xiongyining1480@phytium.com.cn/

Changes in v4 (Xiong Yining):
- patch 6 add the support for getting the hardware information of memory via SMC calls.
- patch 7 add the callback of DeviceTree when SMC calls defined on patch 6 failled.
- replace FdtHelperGetMpidr() with SbsaQemuGetMpidr() on patch 4 to compile successfully.
- Link to v4: https://openfw.io/edk2-devel/20240131100027.2538549-1-xiongyining1480@phytium.com.cn/

Changes in v3:
- added SMC_SIP_CALL_SUCCESS
- on SMC call fail tell that SMC call failed instead of blaming TF-A
- hang when there is no cpu information (TODO: shutdown instead)
- Link to v3: https://openfw.io/edk2-devel/20240124-no-dt-for-cpu-v3-0-5375fcf09037@linaro.org/

---
Marcin Juszkiewicz (3):
      Platform/SbsaQemu: add SbsaQemuHardwareInfoLib
      Platform/SbsaQemu: use SbsaQemuHardwareInfoLib for cpu information
      Platform/SbsaQemu: drop FdtHandlerLib

Xiong Yining (1):
      Platform/SbsaQemu: get the information of memory via SMC calls

 Platform/Qemu/SbsaQemu/SbsaQemu.dsc                 |   4 +-
 Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf    |   6 +-
 .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf     |   5 +-
 .../SbsaQemu/Library/FdtHelperLib/FdtHelperLib.inf  |  33 -----
 .../SbsaQemuHardwareInfoLib.inf                     |  31 +++++
 .../SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf    |   4 +-
 .../SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h |  19 ++-
 .../Qemu/SbsaQemu/Include/Library/FdtHelperLib.h    |  36 -----
 .../Include/Library/SbsaQemuHardwareInfoLib.h       |  73 ++++++++++
 Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c      |  11 +-
 .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c       |  21 +--
 .../SbsaQemu/Library/FdtHelperLib/FdtHelperLib.c    |  98 -------------
 .../SbsaQemuHardwareInfoLib.c                       | 146 ++++++++++++++++++++
 .../Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c |  54 ++------
 14 files changed, 298 insertions(+), 243 deletions(-)
---
base-commit: 80ee8b861edb6a8b02a100f63bbb435499f8741a
change-id: 20240115-no-dt-for-cpu-2c511393df93

Best regards,
-- 
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116895): https://edk2.groups.io/g/devel/message/116895
Mute This Topic: https://groups.io/mt/105024008/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



             reply	other threads:[~2024-03-19 13:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 13:49 Marcin Juszkiewicz [this message]
2024-03-19 13:49 ` [edk2-devel] [PATCH edk2-platforms v7 1/4] Platform/SbsaQemu: add SbsaQemuHardwareInfoLib Marcin Juszkiewicz
2024-03-19 16:53   ` Ard Biesheuvel
2024-03-20 11:10     ` Marcin Juszkiewicz
2024-03-19 13:49 ` [edk2-devel] [PATCH edk2-platforms v7 2/4] Platform/SbsaQemu: use SbsaQemuHardwareInfoLib for cpu information Marcin Juszkiewicz
2024-03-19 13:49 ` [edk2-devel] [PATCH edk2-platforms v7 3/4] Platform/SbsaQemu: drop FdtHandlerLib Marcin Juszkiewicz
2024-03-19 13:49 ` [edk2-devel] [PATCH edk2-platforms v7 4/4] Platform/SbsaQemu: get the information of memory via SMC calls Marcin Juszkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240319-no-dt-for-cpu-v7-0-ac0a57a23a8f@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox