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 1649C941731 for ; Wed, 6 Mar 2024 11:41:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ywKatoStpc2DUlKokOZasKxGCqcSY5FTE6Kj5pMXrgg=; c=relaxed/simple; d=groups.io; h=From:Subject:Date:Message-Id:MIME-Version:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20240206; t=1709725312; v=1; b=M2RwvHYjePHBuxUjpbCxzbV3ym6BqfBJLHwCFZm0mHPxpyjZWxtLYLx8a3UANR2ij8zn8ekI 7yRMeyQ/N4O4GeMhhW5iuZo9pLFlyIFE02XQVxp3tzFUCBgOAoa5WwFPw0xSyQBOzarLemjsBB9 hc5cxCGQiG9za2PnPoUlAwwTJU7V9ioX0sKbDEpL9ULnc6THb9mn7xbrEjK0yFY2xrkyUIbA2Sn KX0aaoRAvn7diVvXyekYpy9tka/SbDdzrI1OI/QkvEY9jUswqg720lXqT5QMB+KBnkhjOy1VHEe r+PFGYSy6KUtuJBzpBBe9H/iLh64rnpAh2KnRDP4Wflgw== X-Received: by 127.0.0.2 with SMTP id 1voSYY7687511xLrT8IJTiFG; Wed, 06 Mar 2024 03:41:52 -0800 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web11.9847.1709725311699116471 for ; Wed, 06 Mar 2024 03:41:52 -0800 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id E3604260837; Wed, 6 Mar 2024 12:41:45 +0100 (CET) X-Virus-Scanned: Debian amavis at juszkiewicz.com.pl X-Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavis, port 10024) with ESMTP id bN_D3-D6EOFF; Wed, 6 Mar 2024 12:41:43 +0100 (CET) X-Received: from [172.17.0.1] (83.11.22.169.ipv4.supernova.orange.pl [83.11.22.169]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 4554A26001A; Wed, 6 Mar 2024 12:41:39 +0100 (CET) From: "Marcin Juszkiewicz" Subject: [edk2-devel] [PATCH edk2-platforms v6 0/7] get rid of DeviceTree from SbsaQemu Date: Wed, 06 Mar 2024 03:41:52 -0800 Message-Id: <20240306-no-dt-for-cpu-v6-0-acd8727a1b59@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAGJW6GUC/13MSwrCMBSF4a2UjL2SR5MYR+5DHNQ82oAkJalBK d27aUHQDs+B/5tRtsnbjM7NjJItPvsY6hCHBumhC70Fb+pGFNMWE8IhRDATuJhAj0+gmhPCFDN OMVSbMVnnX5t3vdU9+DzF9N74Qtf3K4mdVChgENpheTKqu0txefjQpXiMqUcrVdhPTtt9zmrOm eSuEgoz+Zcvy/IBqJFC5uoAAAA= To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Graeme Gregory , Xiong Yining , Chen Baozi , Marcin Juszkiewicz 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 Reply-To: devel@edk2.groups.io,marcin.juszkiewicz@linaro.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: BIzjNQcsvZTFbsA3JDj47A5Yx7686176AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=M2RwvHYj; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linaro.org (policy=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. If TF-A answer to SMC call would be not success then we go back to parsing DeviceTree data directly. There is no DT parsing elsewhere. I hope that we can drop FdtHandler part as part of 202411 release. TF-A part: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/2= 5707 Signed-off-by: Marcin Juszkiewicz --- 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-xiongyi= ning1480@phytium.com.cn/ Changes in v4 (Xiong Yining): - patch 6 add the support for getting the hardware information of memory vi= a 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-xiongyi= ning1480@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-5375= fcf09037@linaro.org/ --- Marcin Juszkiewicz (5): Platform/SbsaQemu: add SbsaQemuHardwareInfoLib Platform/SbsaQemu: read amount of cpus during init Platform/SbsaQemu: use PcdCoreCount directly Platform/SbsaQemu: move FdtHandlerLib to SbsaQemuHardwareInfoLib Platform/SbsaQemu: hang if there is no cpu information Xiong Yining (2): Platform/SbsaQemu: get the information of memory via SMC calls Platform/SbsaQemu: add DeviceTree fallbacks to parse memory informati= on Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 4 +- Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf | 6 +- .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 4 +- .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf | 4 +- .../SbsaQemu/Library/FdtHelperLib/FdtHelperLib.inf | 33 -- .../SbsaQemuHardwareInfoLib.inf | 36 ++ .../SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf | 2 +- .../SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h | 17 +- .../Qemu/SbsaQemu/Include/Library/FdtHelperLib.h | 36 -- .../Include/Library/SbsaQemuHardwareInfoLib.h | 73 ++++ Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c | 10 +- .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 15 +- .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 9 +- .../SbsaQemu/Library/FdtHelperLib/FdtHelperLib.c | 98 ------ .../SbsaQemuHardwareInfoLib.c | 352 ++++++++++++++++= ++++ .../Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c | 54 +-- 16 files changed, 511 insertions(+), 242 deletions(-) --- base-commit: fe41713668d42b20a2370dab27de3269e877e454 change-id: 20240115-no-dt-for-cpu-2c511393df93 Best regards, --=20 Marcin Juszkiewicz -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116425): https://edk2.groups.io/g/devel/message/116425 Mute This Topic: https://groups.io/mt/104763761/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-