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.web10.3564.1668157958660814004 for ; Fri, 11 Nov 2022 01:12:39 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: loongson.cn, ip: 114.242.206.163, mailfrom: lixianglai@loongson.cn) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8AxDdkBEm5jaRMGAA--.18775S3; Fri, 11 Nov 2022 17:12:34 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxFlcAEm5jXc0QAA--.27651S2; Fri, 11 Nov 2022 17:12:32 +0800 (CST) From: "xianglai" To: devel@edk2.groups.io Cc: Bibo Mao , Chao Li , Leif Lindholm , Liming Gao , Michael D Kinney Subject: [edk2-platforms][PATCH V5 00/15] Platform: Add Loongson support. Date: Fri, 11 Nov 2022 17:12:15 +0800 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxFlcAEm5jXc0QAA--.27651S2 X-CM-SenderInfo: 5ol0xt5qjotxo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBjvAXoW3tFW8CFW3Kr4kZFyxZr1xGrg_yoW8JFyxCo W8JFZruw4UJr1fAa4v93ZxJrWxX3ZFgw4Fqr40vayUZFZIkryqqFs8Ga4xWF15ZFy3Aw15 G3s5K3ykJFW2qrZ3n29KB7ZKAUJUUUUx529EdanIXcx71UUUUU7KY7ZEXasCq-sGcSsGvf J3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnRJU UUkv1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64 kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY 1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7 CjxVAFwI0_Cr1j6rxdM2kKe7AKxVWUAVWUtwAS0I0E0xvYzxvE52x082IY62kv0487Mc80 4VCY07AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VCjz48v1sIEY2 0_WwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2AFwI0_JF0_ Jw1l42xK82IYc2Ij64vIr41l42xK82IY6x8ErcxFaVAv8VWrMxC20s026xCaFVCjc4AY6r 1j6r4UMxCIbckI1I0E14v26r1Y6r17MI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xv wVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjx v20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20E Y4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Cr0_Gr1UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0zR9iSdUUUUU= Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4054=0D =0D The uploaded code generates firmware to support Linux launching on the Loon= gArch platform under qemu,=0D So it will run in a virtual machine.=0D =0D LoongArch is the general processor architecture of Loongson.=0D You can get the latest LoongArch documents or LoongArch tools at https://gi= thub.com/loongson/.=0D =0D You can also view the code through the Loongson community.=0D The edk2 code in Loongson community:=0D https://github.com/loongson/edk2/tree/LoongArch=0D The edk2-platform code in Loonson community:=0D https://github.com/loongson/edk2-platforms=0D The qemu code in Loongson community:=0D https://gitlab.com/qemu-project/qemu.git=0D The LoongArch Documentation in Loongson community:=0D https://github.com/loongson/LoongArch-Documentation/tree/main/docs=0D The all patches at:=0D https://github.com/loongson/edk2-platforms/tree/devel-LoongArch-patch=0D =0D v2 changes:=0D - Remove the inline assembly from StableTimerLib.=0D - troubleshoot TAB strings, convert TAB characters to spaces.=0D - remove smm related code, loongarch has no smm mode.=0D =0D v3 changes:=0D - delete ExtractHandler related code.=0D - Boot UEFI with low 256M memory.=0D - Modify common interrupt handling.=0D =0D v4 changes:=0D - Remove qemu flash related code.=0D - Modify fdt base address.=0D =0D v5 changes:=0D - Add Udf driver support.=0D - Split readme file into a separate patch.=0D - Modify the code style=0D - delete extra blank lines=0D - use the assembly function definition macros in MdePkg=0D - sort out the PCD variable Token value.=0D =0D Cc: Bibo Mao =0D Cc: Chao Li =0D Cc: Leif Lindholm =0D Cc: Liming Gao =0D Cc: Michael D Kinney =0D =0D xianglai li (15):=0D Platform/Loongson: Add Serial Port library=0D Platform/Loongson: Support SEC=0D Platform/Loongson: Add PeiServicesTablePointerLib.=0D Platform/Loongson: Add QemuFwCfgLib.=0D Platform/Loongson: Add MmuLib.=0D Platform/Loongson: Add StableTimerLib.=0D Platform/Loongson: Support PEI phase.=0D Platform/Loongson: Add CPU DXE driver.=0D Platform/Loongson: Add PciCpuIoDxe driver.=0D Platform/Loongson: Add timer Dxe driver.=0D Platform/Loongson: Add RealTime Clock lib.=0D Platform/Loongson: Add Platform Boot Manager Lib.=0D Platform/Loongson: Add Reset System Lib.=0D Platform/Loongson: Support Dxe=0D Platform/Loongson: Add Readme.=0D =0D .../LoongArchQemuPkg/Drivers/CpuDxe/CpuDxe.c | 367 ++++++++=0D .../LoongArchQemuPkg/Drivers/CpuDxe/CpuDxe.h | 199 +++++=0D .../Drivers/CpuDxe/CpuDxe.inf | 59 ++=0D .../Drivers/CpuDxe/LoongArch64/Exception.c | 335 +++++++=0D .../Drivers/CpuDxe/LoongArch64/Fpu.S | 97 ++=0D .../Drivers/CpuDxe/LoongArch64/LoongArch.S | 321 +++++++=0D .../Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.c | 538 ++++++++++++=0D .../Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.h | 207 +++++=0D .../Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf | 44 +=0D .../Drivers/StableTimerDxe/Timer.c | 388 ++++++++=0D .../Drivers/StableTimerDxe/Timer.h | 172 ++++=0D .../Drivers/StableTimerDxe/TimerConfig.S | 38 +=0D .../Drivers/StableTimerDxe/TimerDxe.inf | 44 +=0D .../LoongArchQemuPkg/Include/Library/Cpu.h | 237 +++++=0D .../LoongArchQemuPkg/Include/Library/MmuLib.h | 85 ++=0D .../Include/Library/QemuFwCfgLib.h | 174 ++++=0D .../Include/Library/StableTimer.h | 59 ++=0D .../Include/LoongArchQemuPlatform.h | 95 ++=0D .../LsRealTimeClockLib/LsRealTimeClock.h | 40 +=0D .../LsRealTimeClockLib/LsRealTimeClockLib.c | 335 +++++++=0D .../LsRealTimeClockLib/LsRealTimeClockLib.inf | 44 +=0D .../LoongArchQemuPkg/Library/MmuLib/Mmu.S | 155 ++++=0D .../Library/MmuLib/MmuBaseLib.inf | 40 +=0D .../Library/MmuLib/MmuBaseLibPei.inf | 47 +=0D .../Library/MmuLib/MmuLibCore.c | 831 ++++++++++++++++++=0D .../Library/MmuLib/MmuLibCore.h | 40 +=0D .../Library/MmuLib/MmuLibCorePei.c | 231 +++++=0D .../LoongArchQemuPkg/Library/MmuLib/mmu.h | 190 ++++=0D .../LoongArchQemuPkg/Library/MmuLib/page.h | 280 ++++++=0D .../LoongArchQemuPkg/Library/MmuLib/pte.h | 57 ++=0D .../PeiServicesTablePointer.c | 79 ++=0D .../PeiServicesTablePointer.h | 39 +=0D .../PeiServicesTablePointerLib.S | 40 +=0D .../PeiServicesTablePointerLib.inf | 32 +=0D .../PlatformBootManagerLib/PlatformBm.c | 742 ++++++++++++++++=0D .../PlatformBootManagerLib/PlatformBm.h | 112 +++=0D .../PlatformBootManagerLib.inf | 75 ++=0D .../PlatformBootManagerLib/QemuKernel.c | 81 ++=0D .../QemuFwCfgLib/QemuFwCfgLibInternal.h | 63 ++=0D .../Library/QemuFwCfgLib/QemuFwCfgPei.c | 117 +++=0D .../Library/QemuFwCfgLib/QemuFwCfgPeiLib.c | 463 ++++++++++=0D .../Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf | 46 +=0D .../BaseResetSystemAcpiGed.c | 146 +++=0D .../BaseResetSystemAcpiGedLib.inf | 37 +=0D .../DxeResetSystemAcpiGed.c | 257 ++++++=0D .../DxeResetSystemAcpiGedLib.inf | 41 +=0D .../ResetSystemAcpiLib/ResetSystemAcpiGed.c | 128 +++=0D .../ResetSystemAcpiLib/ResetSystemAcpiGed.h | 23 +=0D .../Library/SerialPortLib/SerialPortLib.c | 593 +++++++++++++=0D .../Library/SerialPortLib/SerialPortLib.inf | 39 +=0D .../Library/StableTimerLib/Count.S | 52 ++=0D .../Library/StableTimerLib/TimerLib.c | 236 +++++=0D .../Library/StableTimerLib/TimerLib.inf | 32 +=0D .../Loongson/LoongArchQemuPkg/Loongson.dec | 74 ++=0D .../Loongson/LoongArchQemuPkg/Loongson.dsc | 607 +++++++++++++=0D .../Loongson/LoongArchQemuPkg/Loongson.fdf | 349 ++++++++=0D .../LoongArchQemuPkg/Loongson.fdf.inc | 63 ++=0D .../LoongArchQemuPkg/PlatformPei/Fv.c | 58 ++=0D .../LoongArchQemuPkg/PlatformPei/MemDetect.c | 104 +++=0D .../LoongArchQemuPkg/PlatformPei/Platform.c | 261 ++++++=0D .../LoongArchQemuPkg/PlatformPei/Platform.h | 86 ++=0D .../PlatformPei/PlatformPei.inf | 72 ++=0D Platform/Loongson/LoongArchQemuPkg/Readme.md | 60 ++=0D .../LoongArchQemuPkg/Sec/LoongArch64/Start.S | 84 ++=0D .../Loongson/LoongArchQemuPkg/Sec/SecMain.c | 494 +++++++++++=0D .../Loongson/LoongArchQemuPkg/Sec/SecMain.inf | 51 ++=0D Readme.md | 9 +=0D 67 files changed, 11594 insertions(+)=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/CpuDx= e.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/CpuDx= e.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/CpuDx= e.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/Loong= Arch64/Exception.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/Loong= Arch64/Fpu.S=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/Loong= Arch64/LoongArch.S=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/PciCpuIo2Dxe= /PciCpuIo2Dxe.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/PciCpuIo2Dxe= /PciCpuIo2Dxe.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/PciCpuIo2Dxe= /PciCpuIo2Dxe.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/StableTimerD= xe/Timer.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/StableTimerD= xe/Timer.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/StableTimerD= xe/TimerConfig.S=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Drivers/StableTimerD= xe/TimerDxe.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Include/Library/Cpu.= h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Include/Library/MmuL= ib.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Include/Library/Qemu= FwCfgLib.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Include/Library/Stab= leTimer.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Include/LoongArchQem= uPlatform.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeCl= ockLib/LsRealTimeClock.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeCl= ockLib/LsRealTimeClockLib.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeCl= ockLib/LsRealTimeClockLib.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/Mmu.S= =0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuBa= seLib.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuBa= seLibPei.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuLi= bCore.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuLi= bCore.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuLi= bCorePei.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/mmu.h= =0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/page.= h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/pte.h= =0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PeiServicesT= ablePointerLib/PeiServicesTablePointer.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PeiServicesT= ablePointerLib/PeiServicesTablePointer.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PeiServicesT= ablePointerLib/PeiServicesTablePointerLib.S=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PeiServicesT= ablePointerLib/PeiServicesTablePointerLib.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PlatformBoot= ManagerLib/PlatformBm.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PlatformBoot= ManagerLib/PlatformBm.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PlatformBoot= ManagerLib/PlatformBootManagerLib.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/PlatformBoot= ManagerLib/QemuKernel.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/QemuFwCfgLib= /QemuFwCfgLibInternal.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/QemuFwCfgLib= /QemuFwCfgPei.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/QemuFwCfgLib= /QemuFwCfgPeiLib.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/QemuFwCfgLib= /QemuFwCfgPeiLib.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemA= cpiLib/BaseResetSystemAcpiGed.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemA= cpiLib/BaseResetSystemAcpiGedLib.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemA= cpiLib/DxeResetSystemAcpiGed.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemA= cpiLib/DxeResetSystemAcpiGedLib.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemA= cpiLib/ResetSystemAcpiGed.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemA= cpiLib/ResetSystemAcpiGed.h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/SerialPortLi= b/SerialPortLib.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/SerialPortLi= b/SerialPortLib.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/StableTimerL= ib/Count.S=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/StableTimerL= ib/TimerLib.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Library/StableTimerL= ib/TimerLib.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Loongson.dec=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Loongson.dsc=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Loongson.fdf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/PlatformPei/Fv.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/PlatformPei/MemDetec= t.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/PlatformPei/Platform= .c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/PlatformPei/Platform= .h=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/PlatformPei/Platform= Pei.inf=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Readme.md=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Sec/LoongArch64/Star= t.S=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.inf=0D =0D -- =0D 2.31.1=0D =0D