From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from loongson.cn (loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web09.1922.1668397867039596336 for ; Sun, 13 Nov 2022 19:51:07 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: loongson.cn, ip: 114.242.206.163, mailfrom: maobibo@loongson.cn) Received: from loongson.cn (unknown [10.20.42.170]) by gateway (Coremail) with SMTP id _____8CxLdknu3Fj18oGAA--.20511S3; Mon, 14 Nov 2022 11:51:04 +0800 (CST) Received: from [10.20.42.170] (unknown [10.20.42.170]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Axf+Aiu3Fj5kASAA--.49405S3; Mon, 14 Nov 2022 11:51:00 +0800 (CST) Message-ID: Date: Mon, 14 Nov 2022 11:50:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [edk2-platforms][PATCH V5 00/15] Platform: Add Loongson support. To: devel@edk2.groups.io, Leif Lindholm , Michael D Kinney , Liming Gao , Ard Biesheuvel Cc: Chao Li , xianglai li References: From: "maobibo" In-Reply-To: X-CM-TRANSID: AQAAf8Axf+Aiu3Fj5kASAA--.49405S3 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjvAXoW3Kw43Jw13trWrArWxCFy3Jwb_yoW8Gry5Ko W8JFW7uw4UJr1fAasF93ZxJrWIq3Waqw4Fqr40yayUZFZIkryqqFs8Ja4xuF1rZF9xAw15 G3s5K3ykJFZFqrZ3n29KB7ZKAUJUUUUr529EdanIXcx71UUUUU7KY7ZEXasCq-sGcSsGvf J3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnRJU UUBFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG6rWj6s 0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1l84 ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1U M2kKe7AKxVWUXVWUAwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zV CFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUXVWUAwAv7VC2 z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JMxk0xIA0c2 IEe2xFo4CEbIxvr21l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxY O2xFxVAFwI0_Jrv_JF1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGV WUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_ Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rV WUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4U YxBIdaVFxhVjvjDU0xZFpf9x07jjwZcUUUUU= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ping for reviewing, Any comments is welcome. >>From edk2 mailing list, Soft Feature Freeze start on 2022-11-07 for edk2-stable202211, is edk2-platform is affected also? And there are series of submition for Riscv ovmf supports recently, we will adopt the new multi-arch schemes on Loongarch virt machine also after both Riscv virt machine and Loongarch virt machine code are merged. Is that ok? regards bibo, mao 在 2022/11/11 17:12, xianglai li 写道: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4054 > > The uploaded code generates firmware to support Linux launching on the LoongArch platform under qemu, > So it will run in a virtual machine. > > LoongArch is the general processor architecture of Loongson. > You can get the latest LoongArch documents or LoongArch tools at https://github.com/loongson/. > > You can also view the code through the Loongson community. > The edk2 code in Loongson community: > https://github.com/loongson/edk2/tree/LoongArch > The edk2-platform code in Loonson community: > https://github.com/loongson/edk2-platforms > The qemu code in Loongson community: > https://gitlab.com/qemu-project/qemu.git > The LoongArch Documentation in Loongson community: > https://github.com/loongson/LoongArch-Documentation/tree/main/docs > The all patches at: > https://github.com/loongson/edk2-platforms/tree/devel-LoongArch-patch > > v2 changes: > - Remove the inline assembly from StableTimerLib. > - troubleshoot TAB strings, convert TAB characters to spaces. > - remove smm related code, loongarch has no smm mode. > > v3 changes: > - delete ExtractHandler related code. > - Boot UEFI with low 256M memory. > - Modify common interrupt handling. > > v4 changes: > - Remove qemu flash related code. > - Modify fdt base address. > > v5 changes: > - Add Udf driver support. > - Split readme file into a separate patch. > - Modify the code style > - delete extra blank lines > - use the assembly function definition macros in MdePkg > - sort out the PCD variable Token value. > > Cc: Bibo Mao > Cc: Chao Li > Cc: Leif Lindholm > Cc: Liming Gao > Cc: Michael D Kinney > > xianglai li (15): > Platform/Loongson: Add Serial Port library > Platform/Loongson: Support SEC > Platform/Loongson: Add PeiServicesTablePointerLib. > Platform/Loongson: Add QemuFwCfgLib. > Platform/Loongson: Add MmuLib. > Platform/Loongson: Add StableTimerLib. > Platform/Loongson: Support PEI phase. > Platform/Loongson: Add CPU DXE driver. > Platform/Loongson: Add PciCpuIoDxe driver. > Platform/Loongson: Add timer Dxe driver. > Platform/Loongson: Add RealTime Clock lib. > Platform/Loongson: Add Platform Boot Manager Lib. > Platform/Loongson: Add Reset System Lib. > Platform/Loongson: Support Dxe > Platform/Loongson: Add Readme. > > .../LoongArchQemuPkg/Drivers/CpuDxe/CpuDxe.c | 367 ++++++++ > .../LoongArchQemuPkg/Drivers/CpuDxe/CpuDxe.h | 199 +++++ > .../Drivers/CpuDxe/CpuDxe.inf | 59 ++ > .../Drivers/CpuDxe/LoongArch64/Exception.c | 335 +++++++ > .../Drivers/CpuDxe/LoongArch64/Fpu.S | 97 ++ > .../Drivers/CpuDxe/LoongArch64/LoongArch.S | 321 +++++++ > .../Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.c | 538 ++++++++++++ > .../Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.h | 207 +++++ > .../Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf | 44 + > .../Drivers/StableTimerDxe/Timer.c | 388 ++++++++ > .../Drivers/StableTimerDxe/Timer.h | 172 ++++ > .../Drivers/StableTimerDxe/TimerConfig.S | 38 + > .../Drivers/StableTimerDxe/TimerDxe.inf | 44 + > .../LoongArchQemuPkg/Include/Library/Cpu.h | 237 +++++ > .../LoongArchQemuPkg/Include/Library/MmuLib.h | 85 ++ > .../Include/Library/QemuFwCfgLib.h | 174 ++++ > .../Include/Library/StableTimer.h | 59 ++ > .../Include/LoongArchQemuPlatform.h | 95 ++ > .../LsRealTimeClockLib/LsRealTimeClock.h | 40 + > .../LsRealTimeClockLib/LsRealTimeClockLib.c | 335 +++++++ > .../LsRealTimeClockLib/LsRealTimeClockLib.inf | 44 + > .../LoongArchQemuPkg/Library/MmuLib/Mmu.S | 155 ++++ > .../Library/MmuLib/MmuBaseLib.inf | 40 + > .../Library/MmuLib/MmuBaseLibPei.inf | 47 + > .../Library/MmuLib/MmuLibCore.c | 831 ++++++++++++++++++ > .../Library/MmuLib/MmuLibCore.h | 40 + > .../Library/MmuLib/MmuLibCorePei.c | 231 +++++ > .../LoongArchQemuPkg/Library/MmuLib/mmu.h | 190 ++++ > .../LoongArchQemuPkg/Library/MmuLib/page.h | 280 ++++++ > .../LoongArchQemuPkg/Library/MmuLib/pte.h | 57 ++ > .../PeiServicesTablePointer.c | 79 ++ > .../PeiServicesTablePointer.h | 39 + > .../PeiServicesTablePointerLib.S | 40 + > .../PeiServicesTablePointerLib.inf | 32 + > .../PlatformBootManagerLib/PlatformBm.c | 742 ++++++++++++++++ > .../PlatformBootManagerLib/PlatformBm.h | 112 +++ > .../PlatformBootManagerLib.inf | 75 ++ > .../PlatformBootManagerLib/QemuKernel.c | 81 ++ > .../QemuFwCfgLib/QemuFwCfgLibInternal.h | 63 ++ > .../Library/QemuFwCfgLib/QemuFwCfgPei.c | 117 +++ > .../Library/QemuFwCfgLib/QemuFwCfgPeiLib.c | 463 ++++++++++ > .../Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf | 46 + > .../BaseResetSystemAcpiGed.c | 146 +++ > .../BaseResetSystemAcpiGedLib.inf | 37 + > .../DxeResetSystemAcpiGed.c | 257 ++++++ > .../DxeResetSystemAcpiGedLib.inf | 41 + > .../ResetSystemAcpiLib/ResetSystemAcpiGed.c | 128 +++ > .../ResetSystemAcpiLib/ResetSystemAcpiGed.h | 23 + > .../Library/SerialPortLib/SerialPortLib.c | 593 +++++++++++++ > .../Library/SerialPortLib/SerialPortLib.inf | 39 + > .../Library/StableTimerLib/Count.S | 52 ++ > .../Library/StableTimerLib/TimerLib.c | 236 +++++ > .../Library/StableTimerLib/TimerLib.inf | 32 + > .../Loongson/LoongArchQemuPkg/Loongson.dec | 74 ++ > .../Loongson/LoongArchQemuPkg/Loongson.dsc | 607 +++++++++++++ > .../Loongson/LoongArchQemuPkg/Loongson.fdf | 349 ++++++++ > .../LoongArchQemuPkg/Loongson.fdf.inc | 63 ++ > .../LoongArchQemuPkg/PlatformPei/Fv.c | 58 ++ > .../LoongArchQemuPkg/PlatformPei/MemDetect.c | 104 +++ > .../LoongArchQemuPkg/PlatformPei/Platform.c | 261 ++++++ > .../LoongArchQemuPkg/PlatformPei/Platform.h | 86 ++ > .../PlatformPei/PlatformPei.inf | 72 ++ > Platform/Loongson/LoongArchQemuPkg/Readme.md | 60 ++ > .../LoongArchQemuPkg/Sec/LoongArch64/Start.S | 84 ++ > .../Loongson/LoongArchQemuPkg/Sec/SecMain.c | 494 +++++++++++ > .../Loongson/LoongArchQemuPkg/Sec/SecMain.inf | 51 ++ > Readme.md | 9 + > 67 files changed, 11594 insertions(+) > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/CpuDxe.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/CpuDxe.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/CpuDxe.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/LoongArch64/Exception.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/LoongArch64/Fpu.S > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/LoongArch64/LoongArch.S > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/StableTimerDxe/Timer.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/StableTimerDxe/Timer.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/StableTimerDxe/TimerConfig.S > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/StableTimerDxe/TimerDxe.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Include/Library/Cpu.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Include/Library/MmuLib.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Include/Library/QemuFwCfgLib.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Include/Library/StableTimer.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Include/LoongArchQemuPlatform.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClock.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/Mmu.S > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuBaseLib.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuBaseLibPei.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuLibCore.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuLibCore.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuLibCorePei.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/mmu.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/page.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/pte.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.S > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PlatformBootManagerLib/PlatformBm.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PlatformBootManagerLib/PlatformBm.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PlatformBootManagerLib/QemuKernel.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemAcpiLib/BaseResetSystemAcpiGed.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemAcpiLib/BaseResetSystemAcpiGedLib.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemAcpiLib/DxeResetSystemAcpiGed.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemAcpiLib/DxeResetSystemAcpiGedLib.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemAcpiLib/ResetSystemAcpiGed.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemAcpiLib/ResetSystemAcpiGed.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/SerialPortLib/SerialPortLib.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/SerialPortLib/SerialPortLib.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/StableTimerLib/Count.S > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/StableTimerLib/TimerLib.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/StableTimerLib/TimerLib.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Loongson.dec > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Loongson.dsc > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Loongson.fdf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc > create mode 100644 Platform/Loongson/LoongArchQemuPkg/PlatformPei/Fv.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/PlatformPei/MemDetect.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/PlatformPei/Platform.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/PlatformPei/Platform.h > create mode 100644 Platform/Loongson/LoongArchQemuPkg/PlatformPei/PlatformPei.inf > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Readme.md > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Sec/LoongArch64/Start.S > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c > create mode 100644 Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.inf >