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 A9A187803CE for ; Wed, 20 Mar 2024 13:15:48 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=9NTjSfxc6IGednLEZo9oaEiSnZUcW0xC8UCtqoSFjHg=; 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:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20240206; t=1710940547; v=1; b=VCPLn+yNeq8vgaHyo+B+H+eRBpJUSDjV0LMd19fkrli5qNz3KF/bs3qcooMHZxcLaptqX2Nr q4zVeHA6JJh43jVaNBw4QKD/+P2koKv2eIYgqohd564XZKZ2PLisK9V287GgCR6oljXSJ0RcdH8 UgfFmnzaHVOttbRlfYjdv4kty00KmZ1vmWmjE9quEcwb5nHiJW0LrKyWIpUcoJSePqjgS92em2G knkuBbmBYJ2exVz7uTyctjghT8Qy4USflA1TDrEq++NwuutL4/lyXD4VxVLbJjmWH4avdRhyi1L 1Cs+detLqW5UDDcqrQ+8YlaUzIVDKLl2NvdS47stZkONA== X-Received: by 127.0.0.2 with SMTP id cXzwYY7687511xtAM34HY33d; Wed, 20 Mar 2024 06:15:47 -0700 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web10.44065.1710940546531286173 for ; Wed, 20 Mar 2024 06:15:46 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 2FA8D260C04; Wed, 20 Mar 2024 14:15:41 +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 TwrU8s-gKTmM; Wed, 20 Mar 2024 14:15:39 +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 D39C2260259; Wed, 20 Mar 2024 14:15:37 +0100 (CET) From: "Marcin Juszkiewicz" Subject: [edk2-devel] [PATCH edk2-platforms v8 0/4] get rid of DeviceTree from SbsaQemu Date: Wed, 20 Mar 2024 14:15:31 +0100 Message-Id: <20240320-no-dt-for-cpu-v8-0-599ba99861ec@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAHPh+mUC/2XNTQrCMBCG4atI1kaSjMk0rryHuEjzUwPSSKpFK b27sSDWdvkNPO8MpPM5+o4cNgPJvo9dTG0Z1XZD7MW0jafRlU0EE3vGuaRtou5OQ8rU3h5UWMk 5aHBBAynmln2Iz6l3Opd9id095deU78Xn+i2pRakXlFFlA8PKaVOjOl5ja3LapdyQT6qHGRf7J YfCJaAMJaEZ4IqrHwe2+q4KN9ZVKNDwWuoVxxnneslx4sxINAJMFf74OI5vXYOmi2gBAAA= 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 Resent-Date: Wed, 20 Mar 2024 06:15:46 -0700 Reply-To: devel@edk2.groups.io,marcin.juszkiewicz@linaro.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: KbsrsemFUndzRBP4rPRZqU84x7686176AA= 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=VCPLn+yN; 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. 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 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-ac0a= 57a23a8f@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-acd8= 727a1b59@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-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 (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 Silicon/Qemu/SbsaQemu/SbsaQemu.dec | 2 + Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 4 +- Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf | 6 +- .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 5 +- .../SbsaQemuHardwareInfoLib.inf | 29 ++++ .../SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf | 5 +- .../SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h | 19 ++- .../Qemu/SbsaQemu/Include/Library/HardwareInfoLib.h | 73 ++++++++++ Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c | 11 +- .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 21 +-- .../SbsaQemuHardwareInfoLib.c | 146 ++++++++++++++++= ++++ .../Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c | 54 ++------ 12 files changed, 298 insertions(+), 77 deletions(-) --- base-commit: 80ee8b861edb6a8b02a100f63bbb435499f8741a 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 (#116937): https://edk2.groups.io/g/devel/message/116937 Mute This Topic: https://groups.io/mt/105044059/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-