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 4ACEED80186 for ; Wed, 20 Mar 2024 09:36:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ynkbV2R9wU/RcV6T6UCAgaV95fYazMisAgtw7Kqxym0=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:From:To:Cc:Reply-To:References:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1710927416; v=1; b=plRYOHYhwdmoqiKm6beW5QkEQfSobSN0asFErjR4Sc6UoioTT/tlEogGS7miBZSlR4FyLKDs otgQGCfdULgu4dPgxY7ujhjLsORs/atuXzdCG5o2KvCVdbu7MR+sn+2bDPuQU/DACXhlr1yB2Zq J6Dobga/amNXcTz01ANzIDtQ3r0o6rezXedqkRChKELTtOov0xvP9gV+UyvkEbziarDs5YARex4 eUfPSAODO7DX6KKg8GZfzQMN/JvTrGJJjroRlqU+v9fa//+YV4k1OlvzgbL/cw56gStUFvPwybO o3fdyL58Zcutb693TaTkaBltpK2ILtpGepF0+ExkF1r/g== X-Received: by 127.0.0.2 with SMTP id YfJ4YY7687511xGbqnyG9KGO; Wed, 20 Mar 2024 02:36:56 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web10.39466.1710927414969776390 for ; Wed, 20 Mar 2024 02:36:55 -0700 X-Received: from loongson.cn (unknown [10.40.24.149]) by gateway (Coremail) with SMTP id _____8DxdfEzrvplRzQbAA--.65319S3; Wed, 20 Mar 2024 17:36:51 +0800 (CST) X-Received: from [10.40.24.149] (unknown [10.40.24.149]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxX88wrvplaUpeAA--.50824S3; Wed, 20 Mar 2024 17:36:48 +0800 (CST) Message-ID: <8dfbeeb9-9666-4273-97e5-f957016950ac@loongson.cn> Date: Wed, 20 Mar 2024 17:36:47 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 17/26] OvmfPkg/LoongArchVirt: Add serial port hook library From: "Chao Li" To: devel@edk2.groups.io, ardb@kernel.org Cc: kraxel@redhat.com, Ard Biesheuvel , Jiewen Yao , Jordan Justen , Bibo Mao , Dongyan Qian Reply-To: devel@edk2.groups.io,lichao@loongson.cn References: <20240311093631.1251466-1-lichao@loongson.cn> <20240311093902.1254321-1-lichao@loongson.cn> <2c9c655d-6c17-4373-8dca-05196a86ca24@loongson.cn> <17BCE78056888EC1.6435@groups.io> In-Reply-To: <17BCE78056888EC1.6435@groups.io> X-CM-TRANSID: AQAAf8AxX88wrvplaUpeAA--.50824S3 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQACCGX6nmgA0wABsw 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 Resent-Date: Wed, 20 Mar 2024 02:36:55 -0700 List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Jyf2XN8FtLj6nXmyAPIK0Ss8x7686176AA= Content-Type: multipart/alternative; boundary="------------LbO3KRU08KN6oMTWvtKgf1GG" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=plRYOHYh; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none --------------LbO3KRU08KN6oMTWvtKgf1GG Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Ard and Gerd, Thanks, Chao On 2024/3/15 17:54, Chao Li wrote: > > Hi Ard, > > On 2024/3/15 17:51, Ard Biesheuvel wrote: >> On Fri, 15 Mar 2024 at 10:49, Chao Li wrote: >>> Hi Gerd, >>> >>> >>> Thanks, >>> Chao >>> On 2024/3/15 17:33, Gerd Hoffmann wrote: >>> >>> On Mon, Mar 11, 2024 at 05:39:02PM +0800, Chao Li wrote: >>> >>> Add a serial port hook library in LoongArchVirt named >>> Fdt16550SerialProtHookLib, this library is referenced from ArmVirtPkg. >>> >>> LoongArch QEMU virtual machine uses register of LOONGARCH_CSR_KS1 to >>> transfer serial port base addres from the PEI phase to the DXE phase. >>> >>> Why use LOONGARCH_CSR_KS1? Can't you simply set PcdSerialRegisterBase? >>> >>> The LoongArch QEMU PEI stage runs on flash and does not allow set PCD o= perations(memory have not enabled), so the address can only be transferred = through a SAVE register. >>> >> Then maybe use a HOB instead? > Ha, I forgot this way, let's me try. I remember, before committing the first version, I tried to usb the HOB=20 in this library, but if the HOB library is referenced, the=20 UefiDevicePathLibDevicePathProtocol.inf and UefiLib.inf will be cycle=20 consumed, I rememberd the UefiDevicePathLibDevicePathProtocol.inf=20 included a constructor that will cause the cycle comsumed. So, I think it is a better choice for this library to use register KCS1. >> >=20 -=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 (#116931): https://edk2.groups.io/g/devel/message/116931 Mute This Topic: https://groups.io/mt/104859892/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- --------------LbO3KRU08KN6oMTWvtKgf1GG Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi Ard and Gerd,


=
Thanks,
Chao
On 2024/3/15 17:54, Chao Li wrote:

Hi Ard,

On 2024/3/15 17:51, Ard Biesheuvel wrote:
On Fri, 15 Mar 2024 at 10:49=
, Chao Li <lichao@loongson.cn> wrote:
Hi Gerd,


Thanks,
Chao
On 2024/3/15 17:33, Gerd Hoffmann wrote:

On Mon, Mar 11, 2024 at 05:39:02PM +0800, Chao Li wrote:

Add a serial port hook library in LoongArchVirt named
Fdt16550SerialProtHookLib, this library is referenced from ArmVirtPkg.

LoongArch QEMU virtual machine uses register of LOONGARCH_CSR_KS1 to
transfer serial port base addres from the PEI phase to the DXE phase.

Why use LOONGARCH_CSR_KS1?  Can't you simply set PcdSerialRegisterBase?

The LoongArch QEMU PEI stage runs on flash and does not allow set PCD opera=
tions(memory have not enabled), so the address can only be transferred thro=
ugh a SAVE register.

Then maybe use a HOB instead=
?
Ha, I forgot this way, let's me try.

I remember, before committing the first version, I tried to usb the HOB in this library, but if the HOB library is referenced, the UefiDevicePathLibDevicePathProtocol.inf and UefiLib.inf will be cycle consumed, I rememberd the UefiDevicePathLibDevicePathProtocol.inf included a constructor that will cause the cycle comsumed.

So, I think it is a better choice for this library to use register KCS1.


=20
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#116931) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--------------LbO3KRU08KN6oMTWvtKgf1GG--