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 210E5780091 for ; Fri, 2 Feb 2024 02:27:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=n4ji8MCHAawITo+vIhUsBrTIQDsHzKfP+2J+SDcWToU=; 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:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1706840826; v=1; b=nP+7K/r7uBdDHB3JdOXN1Mp9B+VGHuP2cqsmxmGfAWx91YJVMM4pqNVuGXcEcmFIyZiWM0Au xv3K1RTDG7uhCC5U7LOreo2wQKQZHRcViM5uGjX/RIZhn5AzpIShHB3wAF/XX1xmXdyf5YGYRVW NsSWmMyV47t5V7Sqzh85jVnQ= X-Received: by 127.0.0.2 with SMTP id qmPxYY7687511xraOTOxsZHQ; Thu, 01 Feb 2024 18:27:06 -0800 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web10.14257.1706840824313741110 for ; Thu, 01 Feb 2024 18:27:05 -0800 X-Received: from loongson.cn (unknown [10.2.9.245]) by gateway (Coremail) with SMTP id _____8BxuvD0UrxlAPgJAA--.28863S3; Fri, 02 Feb 2024 10:27:00 +0800 (CST) X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxHs_wUrxlFscsAA--.39727S2; Fri, 02 Feb 2024 10:26:56 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Leif Lindholm , Ard Biesheuvel , Abner Chang , Laszlo Ersek , Sami Mujawar , Gerd Hoffmann , Ray Ni , Rahul Kumar , Jiewen Yao , Sunil V L , Andrei Warkentin , Dongyan Qian Subject: [edk2-devel] [PATCH v1 00/19] Add LoongArch helper functions and defines Date: Fri, 2 Feb 2024 10:26:37 +0800 Message-Id: <20240202022637.2444159-1-lichao@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8AxHs_wUrxlFscsAA--.39727S2 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAOCGW7VmEFUQBKsw X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== 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,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: lblqzj3ixdvhY27SqWVKQag2x7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="nP+7K/r7"; 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 This series is part 1 of enabling LoongArch64 virtual machine. Added LoongArch helper functions and defines in MdePkg, added LoongArch CPU IO width in EmbeddedPkg, moved some libraries and PCDs from ArmVirtPkg to OvmfPkg for easiser use by other ARCHs, added a new CPU IO2 driver named CpuMmio2Dxe in UefiCpuPkg, for non-IO port implement CPUs. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Abner Chang Cc: Laszlo Ersek Cc: Leif Lindholm Cc: Sami Mujawar Cc: Gerd Hoffmann Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Sunil V L Cc: Andrei Warkentin Cc: Dongyan Qian Chao Li (19): MdePkg: Add the header file named Csr.h for LoongArch64 MdePkg: Add LoongArch64 FPU function set into BaseCpuLib MdePkg: Add LoongArch64 exception function set into BaseLib MdePkg: Add LoongArch64 local interrupt function set into BaseLib MdePkg: Add LoongArch Cpucfg function MdePkg: Add read stable counter operation for LoongArch MdePkg: Add CSR operation for LoongArch MdePkg: Add IOCSR operation for LoongArch MdePkg: Add a new library named PeiServicesTablePointerLibKs0 MdePkg: Add some comments for LoongArch exceptions EmbeddedPkg: Add PcdPrePiCpuIoSize width for LOONGARCH64 ArmVirtPkg: Move PCD of FDT base address and FDT padding to OvmfPkg UefiCpuPkg: Add a new CPU IO 2 driver named CpuMmio2Dxe ArmVirtPkg: Enable CpuMmio2Dxe OvmfPkg/RiscVVirt: Enable CpuMmio2Dxe OvmfPkg/RiscVVirt: Remove PciCpuIo2Dxe from RiscVVirt ArmVirtPkg: Move the FdtSerialPortAddressLib to OvmfPkg ArmVirtPkg: Move two PCD variables into OvmfPkg ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg ArmVirtPkg/ArmVirt.dsc.inc | 2 +- ArmVirtPkg/ArmVirtCloudHv.dsc | 4 +- ArmVirtPkg/ArmVirtCloudHv.fdf | 2 +- ArmVirtPkg/ArmVirtKvmTool.dsc | 4 +- ArmVirtPkg/ArmVirtKvmTool.fdf | 2 +- ArmVirtPkg/ArmVirtPkg.ci.yaml | 1 - ArmVirtPkg/ArmVirtPkg.dec | 28 - ArmVirtPkg/ArmVirtQemu.dsc | 8 +- ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- ArmVirtPkg/ArmVirtQemuKernel.dsc | 8 +- ArmVirtPkg/ArmVirtXen.dsc | 2 +- .../ArmVirtPsciResetSystemPeiLib.inf | 3 +- .../CloudHvVirtMemInfoPeiLib.inf | 3 +- .../DebugLibFdtPL011UartFlash.inf | 3 +- .../EarlyFdt16550SerialPortHookLib.inf | 3 +- .../EarlyFdtPL011SerialPortLib.inf | 3 +- .../KvmtoolPlatformPeiLib.inf | 5 +- .../Library/PlatformPeiLib/PlatformPeiLib.inf | 10 +- .../QemuVirtMemInfoPeiLib.inf | 3 +- .../PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 3 +- EmbeddedPkg/EmbeddedPkg.dec | 3 + MdePkg/Include/Library/BaseLib.h | 221 +++++++ MdePkg/Include/Library/CpuLib.h | 43 +- .../Library/PeiServicesTablePointerLib.h | 9 +- MdePkg/Include/Protocol/DebugSupport.h | 14 + MdePkg/Include/Register/LoongArch64/Cpucfg.h | 565 ++++++++++++++++++ MdePkg/Include/Register/LoongArch64/Csr.h | 263 ++++++++ MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 7 +- .../Library/BaseCpuLib/LoongArch/DisableFpu.S | 17 + .../Library/BaseCpuLib/LoongArch/EnableFpu.S | 17 + .../BaseCpuLib/LoongArch/InitializeFpu.S | 51 ++ MdePkg/Library/BaseLib/BaseLib.inf | 6 + MdePkg/Library/BaseLib/LoongArch64/AsmCsr.S | 422 +++++++++++++ MdePkg/Library/BaseLib/LoongArch64/Cpucfg.S | 26 + MdePkg/Library/BaseLib/LoongArch64/Csr.c | 81 +++ .../BaseLib/LoongArch64/DisableInterrupts.S | 22 +- .../BaseLib/LoongArch64/EnableInterrupts.S | 22 +- .../BaseLib/LoongArch64/ExceptionBase.S | 41 ++ MdePkg/Library/BaseLib/LoongArch64/IoCsr.S | 120 ++++ .../BaseLib/LoongArch64/ReadStableCounter.S | 24 + .../PeiServicesTablePointer.c | 87 +++ .../PeiServicesTablePointerLibKs0.inf | 37 ++ .../PeiServicesTablePointerLibKs0.uni | 20 + MdePkg/MdePkg.ci.yaml | 3 +- MdePkg/MdePkg.dsc | 3 + .../Include/Library/FdtSerialPortAddressLib.h | 0 .../FdtSerialPortAddressLib.c | 0 .../FdtSerialPortAddressLib.inf | 2 +- .../PlatformBootManagerLibLight}/PlatformBm.c | 0 .../PlatformBootManagerLibLight}/PlatformBm.h | 0 .../PlatformBootManagerLib.inf | 5 +- .../PlatformBootManagerLibLight}/QemuKernel.c | 0 OvmfPkg/OvmfPkg.dec | 32 + OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 2 +- OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf | 2 +- .../CpuMmio2Dxe/CpuMmio2Dxe.c | 8 +- .../CpuMmio2Dxe/CpuMmio2Dxe.inf | 16 +- UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.uni | 18 + UefiCpuPkg/UefiCpuPkg.dsc | 1 + 59 files changed, 2209 insertions(+), 100 deletions(-) create mode 100644 MdePkg/Include/Register/LoongArch64/Cpucfg.h create mode 100644 MdePkg/Include/Register/LoongArch64/Csr.h create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/DisableFpu.S create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/EnableFpu.S create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/InitializeFpu.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/AsmCsr.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Cpucfg.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Csr.c create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ExceptionBase.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/IoCsr.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ReadStableCounter.S create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointer.c create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.inf create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.uni rename {ArmVirtPkg => OvmfPkg}/Include/Library/FdtSerialPortAddressLib.h (100%) rename {ArmVirtPkg => OvmfPkg}/Library/FdtSerialPortAddressLib/FdtSerialPortAddressLib.c (100%) rename {ArmVirtPkg => OvmfPkg}/Library/FdtSerialPortAddressLib/FdtSerialPortAddressLib.inf (90%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBm.c (100%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBm.h (100%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBootManagerLib.inf (89%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/QemuKernel.c (100%) rename OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.c => UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.c (96%) rename OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.inf => UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf (61%) create mode 100644 UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.uni -- 2.27.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114985): https://edk2.groups.io/g/devel/message/114985 Mute This Topic: https://groups.io/mt/104112112/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-