From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id EE9F8AC172E for ; Wed, 27 Mar 2024 14:03:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=bWkTioeLUfaByA2jb4IXcTcLHUIlCCG9io60NJ5fhJo=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1711548206; v=1; b=W5/dm0/ZmOUyT1kE35Cwac8913RA5KUgjB6FeVKlJtNvYOi8ZkJiXSaxqfLAEOb2oso8Ekt6 xDNYfvOYWBHPyVgWNR9Xr9DX+zrKXuYHzim3g1T3HwYgl7UUnIUyUJoHLAtPrZjSu3zaplJFFM7 qy56CJfhzhQzsBJZGndRu0HPiujXZ2NZhwVcOgFro21gU9e6wGqRpibQojWaQwgp0caJ5fNHNu7 fGgBam/GsdPg8vKzFhLGKGxxQzmmaNUWA1Zq3SwAS3EkKqUjXVPRry9flwpJxeC1E6Wvy0ea26o VxJcnCzCa81o/Zd4+ROoe394p7zVUB3gRE3F6JgiOnZ6Q== X-Received: by 127.0.0.2 with SMTP id 9TYAYY7687511x5oRDwrUapt; Wed, 27 Mar 2024 07:03:26 -0700 X-Received: from zg8tmja5ljk3lje4ms43mwaa.icoremail.net (zg8tmja5ljk3lje4ms43mwaa.icoremail.net [209.97.181.73]) by mx.groups.io with SMTP id smtpd.web10.38451.1711548205445043767 for ; Wed, 27 Mar 2024 07:03:25 -0700 X-Received: from prodtpl.icoremail.net (unknown [10.12.1.20]) by hzbj-icmmx-7 (Coremail) with SMTP id AQAAfwBniXApJwRmzRoXEA--.13366S2; Wed, 27 Mar 2024 22:03:21 +0800 (CST) X-Received: from phytium.com.cn (unknown [218.76.62.144]) by mail (Coremail) with SMTP id AQAAfwCHGPgeJwRm8XcAAA--.515S3; Wed, 27 Mar 2024 22:03:11 +0800 (CST) From: "Xiong Yining" To: devel@edk2.groups.io Cc: quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, graeme@xora.org.uk, marcin.juszkiewicz@linaro.org, chenbaozi@phytium.com.cn, Xiong Yining Subject: [edk2-devel] [PATCH v10 0/4] get rid of DeviceTree from SbsaQemu Date: Wed, 27 Mar 2024 14:03:01 +0000 Message-Id: <20240327140305.3802896-1-xiongyining1480@phytium.com.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAfwCHGPgeJwRm8XcAAA--.515S3 X-CM-SenderInfo: x0lr0wp1lqx0bjrumio6sk53xlxphulrpou0/1tbiAQARBmYDI2QGVQABsm X-Coremail-Antispam: 1Uk129KBjvJXoWxXrWDJFykZr48Ar1DGF4Durg_yoWrZFyDpF W7CFZY9r4UJrWIvws3Wa4fXFW5CF1fJw45GFsFvw1UuwnxWFykXr48trn3Cr15JrZ7Ww4D WF48J3WUuF1qk3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj DUYxn0WfASr-VFAU7a7-sFnT9fnUUIcSsGvfJ3UbIYCTnIWIevJa73UjIFyTuYvj4RJUUU UUUUU Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 27 Mar 2024 07:03:25 -0700 Reply-To: devel@edk2.groups.io,xiongyining1480@phytium.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: f87frgmalWmHqnylEeYHKCECx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b="W5/dm0/Z"; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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 --- Changes in v10: - drop use aggregates as return types - Link to v9: https://openfw.io/edk2-devel/20240322-no-dt-for-cpu-v9-0-92e947e0fbdf@linaro.org/ Changes in v9: - recreated 3rd patch to drop all traces of Device Tree use - Link to v8: https://openfw.io/edk2-devel/20240320-no-dt-for-cpu-v8-0-599ba99861ec@linaro.org Changes in v8: - added HardwareInfoLib library class - created SbsaQemuHardwareInfoLib as HardwareInfoLib - dropped SbsaQemu from functions (to keep HardwareInfoLib class generic) - Link to v7: https://openfw.io/edk2-devel/20240319-no-dt-for-cpu-v7-0-ac0a57a23a8f@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 v4: 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 v3: 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 v2: 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 use of DeviceTree Xiong Yining (1): Platform/SbsaQemu: get the information of memory via SMC calls Silicon/Qemu/SbsaQemu/SbsaQemu.dec | 3 +- Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 11 +- .../Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf | 6 +- .../SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 5 +- .../Library/FdtHelperLib/FdtHelperLib.inf | 33 ---- .../SbsaQemuHardwareInfoLib.inf | 29 ++++ .../Library/SbsaQemuLib/SbsaQemuLib.inf | 5 +- .../Include/IndustryStandard/SbsaQemuSmc.h | 19 ++- .../SbsaQemu/Include/Library/FdtHelperLib.h | 36 ----- .../Include/Library/HardwareInfoLib.h | 76 +++++++++ .../Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c | 11 +- .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 21 +-- .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 2 - .../Library/FdtHelperLib/FdtHelperLib.c | 98 ------------ .../SbsaQemuHardwareInfoLib.c | 145 ++++++++++++++++++ .../Library/SbsaQemuLib/SbsaQemuMem.c | 54 ++----- 16 files changed, 301 insertions(+), 253 deletions(-) delete mode 100644 Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.inf create mode 100644 Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf delete mode 100644 Silicon/Qemu/SbsaQemu/Include/Library/FdtHelperLib.h create mode 100644 Silicon/Qemu/SbsaQemu/Include/Library/HardwareInfoLib.h delete mode 100644 Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.c create mode 100644 Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117174): https://edk2.groups.io/g/devel/message/117174 Mute This Topic: https://groups.io/mt/105177616/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-