public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH] SG2042Pkg/Sec:Modify Calculation LowestMemSize
@ 2024-03-25  2:09 WangYang
  2024-03-28 13:46 ` Jingyu Li via groups.io
  2024-04-03  3:48 ` Sunil V L
  0 siblings, 2 replies; 7+ messages in thread
From: WangYang @ 2024-03-25  2:09 UTC (permalink / raw)
  To: sunilvl, caiyuqing_hz, devel; +Cc: Yang Wang, USER0FISH, dahogn, meng-cz

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]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-08  4:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25  2:09 [edk2-devel] [PATCH] SG2042Pkg/Sec:Modify Calculation LowestMemSize WangYang
2024-03-28 13:46 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox