From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id D6AAC78003C for ; Mon, 27 May 2024 03:17:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=5vF7UuAHVIrnNxnRHe0PXfHXHoU9BGXiVwG+zUbg0Q0=; c=relaxed/simple; d=groups.io; h=Subject:To:Cc:References:From:Message-ID:Date:User-Agent:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding:Content-Language; s=20240206; t=1716779853; v=1; b=kwEmeaQcNDxJF2QnIWh7QpPGBSY43xK3QEnH/u59IQS1VxqwmM5q1J+Nzdk0b24E5RKbJ923 dZW3xckEuOlFu9uX54gEyKg63WpM6bNokxNy/ECma8MaMnRSezVXXiFJaU1uj5CAyuLQa43AKGW S8wwnGXXGJFeEPI+XS5mm93muyLCyXXUN3fuIvVvC+aKlsgDF/4roIQKo3CDEwoarI6aBNcL4G8 HSFd8566htQuR+n73c9XdWewzSzakYJb4QMWdlPWEC8O0TzOroLV+OIGxbqIemHYAfiV+++lMSe UC92brLr8Dqok9Fu4IA2VPA3cdumHQDwGfP9FWUv8uV4w== X-Received: by 127.0.0.2 with SMTP id bbN9YY7687511xsdOMWVEqD4; Sun, 26 May 2024 20:17:32 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web10.19850.1716779850941538335 for ; Sun, 26 May 2024 20:17:31 -0700 X-Received: from loongson.cn (unknown [10.20.42.13]) by gateway (Coremail) with SMTP id _____8AxW+pI+1NmdQgAAA--.15S3; Mon, 27 May 2024 11:17:28 +0800 (CST) X-Received: from [10.20.42.13] (unknown [10.20.42.13]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxqsZE+1Nmiq0KAA--.28135S3; Mon, 27 May 2024 11:17:26 +0800 (CST) Subject: Re: [edk2-devel] [PATCH v1 1/2] OvmfPkg: Add no hardcode version of FtdNorFlashQemuLib To: Marcin Juszkiewicz , devel@edk2.groups.io, lichao@loongson.cn Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Gerd Hoffmann , Jiewen Yao References: <20240517071729.188409-1-lichao@loongson.cn> <20240517071754.188521-1-lichao@loongson.cn> <314a58cc-9add-493e-a3d7-fd77edf77999@linaro.org> From: "xianglai" Message-ID: <38d4d808-69ed-e6a1-7163-1e82d5905e4a@loongson.cn> Date: Mon, 27 May 2024 11:17:24 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <314a58cc-9add-493e-a3d7-fd77edf77999@linaro.org> X-CM-TRANSID: AQAAf8CxqsZE+1Nmiq0KAA--.28135S3 X-CM-SenderInfo: 5ol0xt5qjotxo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBj93XoW7KF1rGr18GrWkZFWDurWrtFc_yoW8uFy5pF 4UZa9Ikr4DWFWSywsrX3y7Cr97Za98JF90qr4vqw109wnxWF93urZay3WrGFW2yF1vqFyY vrZ7ta4UCayDJrXCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUU9Ib4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JF0_Jw1lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCYjI0SjxkI62AI1c AE67vIY487MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI1I0E 14v26r126r1DMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4 CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4U MIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF 4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnI WIevJa73UjIFyTuYvjxUwMKuUUUUU 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: Sun, 26 May 2024 20:17:31 -0700 Resent-From: lixianglai@loongson.cn Reply-To: devel@edk2.groups.io,lixianglai@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ndcOKA2mnv0OJc6QEBAAd60qx7686176AA= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=kwEmeaQc; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Marcin: > W dniu 17.05.2024 o 09:17, Chao Li via groups.io pisze: >> This library is copied from ArmVirtPkg, in the Arm version, the value of >> PcdFlashNvStorageVariableBase, PcdFlashNvStorageFtwWorkingBase and >> PcdFlashNvStorageFtwSpareBase are hardcoded in INC file. >> >> This version will calculate them from FDT resource and using the set PCD >> to store when the NorFlashInitialise is called. By default, the first >> available flash(not used for storage UEFI code) as NV variable storage >> medium. >> >> In this way, UEFI can better handle the change of flash base address, >> which is suitable for different cpu architecture board implementation. >> >> BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=4770 >> >> Cc: Ard Biesheuvel >> Cc: Leif Lindholm >> Cc: Sami Mujawar >> Cc: Gerd Hoffmann >> Cc: Jiewen Yao >> Signed-off-by: Chao Li >> Signed-off-by: Xianglai Li > > Can you split it into driver itself and part which uses DT data to > setup parameters? > > This way driver can be used on other platforms as well, despite do > they hardcode flash data, read it via Firmware Handoff protocol, SMC > calls to embedded controller or have other way to keep flash data. This lib is provided for resolving pfalsh base addresses for virtual machines emulated by qemu. The pfash base address of the arm and riscv architectures emulated by qemu is hardcoded in UEFI. After this lib is committed, arm and riscv can easily use this lib by modifying the dsc and VarStore.fdf.inc files. Later, we will send out the patch of arm and riscv, then arm and riscv will also be realized by resolving the pflash base address through fdt. So, what other qemu emulation platforms do you think will hard-code fdt base addresses?:-) Or are there specific scenarios that require hard-coded pflash base addresses?:-) I admit that there is more flexibility, but do we really need to do that?:-) Thanks! Xianglai. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119271): https://edk2.groups.io/g/devel/message/119271 Mute This Topic: https://groups.io/mt/106149595/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-