public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "WangYang" <wangyang@bosc.ac.cn>
To: sunilvl@ventanamicro.com, caiyuqing_hz@outlook.com, devel@edk2.groups.io
Cc: Yang Wang <wangyang@bosc.ac.cn>,
	USER0FISH <libing1202@outlook.com>, dahogn <dahogn@hotmail.com>,
	meng-cz <mengcz1126@gmail.com>
Subject: [edk2-devel] [PATCH] SG2042Pkg/Sec:Modify Calculation LowestMemSize
Date: Mon, 25 Mar 2024 10:09:28 +0800	[thread overview]
Message-ID: <20240325020928.2737-1-wangyang@bosc.ac.cn> (raw)

Adapting memory addresses may not start from 0x0,
for example, the starting memory address starts
from 0x8000_0000.

I understand: LowestMemBase is the lowest DDR
address in the system.

UefiMemoryBase = LowestMemBase +
CodeSize(opensbi+UEFI);

LowestMemSize -= CodeSize(UefiMemoryBase -
LowestMemBase)

Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: USER0FISH <libing1202@outlook.com>
Cc: caiyuqing379 <caiyuqing_hz@outlook.com>
Cc: dahogn <dahogn@hotmail.com>
Cc: meng-cz <mengcz1126@gmail.com>

Signed-off-by: Yang Wang <wangyang@bosc.ac.cn>
---
 Silicon/Sophgo/SG2042Pkg/Sec/Memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Sophgo/SG2042Pkg/Sec/Memory.c b/Silicon/Sophgo/SG2042Pkg/Sec/Memory.c
index df49a17695..a160278eaa 100644
--- a/Silicon/Sophgo/SG2042Pkg/Sec/Memory.c
+++ b/Silicon/Sophgo/SG2042Pkg/Sec/Memory.c
@@ -301,8 +301,8 @@ MemoryPeimInitialization (
   }
 
   if (UefiMemoryBase > LowestMemBase) {
+    LowestMemSize -= (UefiMemoryBase - LowestMemBase);
     LowestMemBase = UefiMemoryBase;
-    LowestMemSize -= UefiMemoryBase;
   }
 
   DEBUG ((
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117072): https://edk2.groups.io/g/devel/message/117072
Mute This Topic: https://groups.io/mt/105131337/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



             reply	other threads:[~2024-03-25  2:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25  2:09 WangYang [this message]
2024-03-28 13:46 ` [edk2-devel] [PATCH] SG2042Pkg/Sec:Modify Calculation LowestMemSize Jingyu Li via groups.io
2024-04-02 10:30   ` WangYang
2024-04-03  3:48 ` Sunil V L
2024-04-03  6:21   ` Jingyu Li via groups.io
2024-04-08  3:00   ` WangYang
2024-04-08  4:28     ` Sunil V L

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240325020928.2737-1-wangyang@bosc.ac.cn \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox