public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] A bug in the use of timer was discovered during the RISC-V adaptation process
@ 2024-03-04  8:57 "vicshuang(黄松) via groups.io
  0 siblings, 0 replies; 2+ messages in thread
From: "vicshuang(黄松) via groups.io @ 2024-03-04  8:57 UTC (permalink / raw)
  To: devel


[-- Attachment #1.1: Type: text/plain, Size: 823 bytes --]

Hello:


 


In the process of using UEFI EDK2 to adapt to RISC-V, we referred to SIFIVE's adaptation method.


    However, during the debugging process, we found that there was an issue with inaccurate timer operation. This problem also existed in the package that targeted SIFIVE, so we wanted to submit it. patch to fix this problem.


    The relevant patches are in the attachment.







发自我的企业微信

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



[-- Attachment #1.2: Type: text/html, Size: 6383 bytes --]

[-- Attachment #2: fix-Fixed-incorrect-Timer-timing-in-RISC-V.patch --]
[-- Type: application/octet-stream, Size: 1981 bytes --]

From bfe08a688b9074b507e962982f373f88fa16ac5a Mon Sep 17 00:00:00 2001
From: vicshuang <vicshuang@tencent.com>
Date: Fri, 1 Mar 2024 16:30:53 +0800
Subject: [PATCH] fix:Fixed incorrect Timer timing in RISC-V The current code
 has the problem of inaccurate Timer timing. The main reason is that the
 PcdCpuCoreCrystalClockFrequency variable required by the
 BaseRiscV64CpuTimerLib.inf library used by the system is not assigned a value
 in the file.

    Signed-off-by: Song Huang  <vicshuang@tencent.com>
                   Bin Fan <tombinfan@tencent.com>
                   Lingheng Du <dylanlhdu@tencent.com>
---
 .../U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc
index 404c0b71ca..d7115f3eba 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc
@@ -3,6 +3,8 @@
 #
 #  Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 #
+#  Copyright (c) 2024, Tencent. All rights reserved.<BR>
+#
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -87,7 +89,7 @@ SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdScratchRamSize   = $(SCRATCH_SIZE)
 SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamBase = $(CODE_BASE_ADDRESS) + $(FW_SIZE)
 SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamSize = 0x10000
 
-
+SET gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency    = 1000000
 SET gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerFrequencyInHerz    = 1000000
 SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdU5PlatformSystemClock = 1000000000 # 1GHz system clock
 SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootHartId                  = 1          # Boot hart ID
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [edk2-devel] A bug in the use of timer was discovered during the RISC-V adaptation process
@ 2024-03-04  2:36 "vicshuang(黄松) via groups.io
  0 siblings, 0 replies; 2+ messages in thread
From: "vicshuang(黄松) via groups.io @ 2024-03-04  2:36 UTC (permalink / raw)
  To: devel


[-- Attachment #1.1: Type: text/plain, Size: 829 bytes --]

Hello:


&nbsp;


In the process of using UEFI EDK2 to adapt to RISC-V, we referred to SIFIVE's adaptation method.&nbsp;


&nbsp; &nbsp; However, during the debugging process, we found that there was an issue with inaccurate timer operation. This problem also existed in the package that targeted SIFIVE, so we wanted to submit it. patch to fix this problem.


&nbsp; &nbsp; The relevant patches are in the attachment.







发自我的企业微信

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



[-- Attachment #1.2: Type: text/html, Size: 5003 bytes --]

[-- Attachment #2: 0001-fix-Fixed-incorrect-Timer-timing-in-RISC-V.patch --]
[-- Type: application/octet-stream, Size: 1959 bytes --]

From bfe08a688b9074b507e962982f373f88fa16ac5a Mon Sep 17 00:00:00 2001
From: vicshuang <vicshuang@tencent.com>
Date: Fri, 1 Mar 2024 16:30:53 +0800
Subject: [PATCH] fix:Fixed incorrect Timer timing in RISC-V The current code
 has the problem of inaccurate Timer timing. The main reason is that the
 PcdCpuCoreCrystalClockFrequency variable required by the
 BaseRiscV64CpuTimerLib.inf library used by the system is not assigned a value
 in the file.

    Cc: Bin Fan <tombinfan@tencent.com>
    Cc: Lingheng Du <dylanlhdu@tencent.com>
    Signed-off-by: Song Huang  <vicshuang@tencent.com>
---
 .../U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc
index 404c0b71ca..d7115f3eba 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc
@@ -3,6 +3,8 @@
 #
 #  Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 #
+#  Copyright (c) 2024, Tencent. All rights reserved.<BR>
+#
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -87,7 +89,7 @@ SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdScratchRamSize   = $(SCRATCH_SIZE)
 SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamBase = $(CODE_BASE_ADDRESS) + $(FW_SIZE)
 SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamSize = 0x10000
 
-
+SET gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency    = 1000000
 SET gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerFrequencyInHerz    = 1000000
 SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdU5PlatformSystemClock = 1000000000 # 1GHz system clock
 SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootHartId                  = 1          # Boot hart ID
-- 
2.34.1


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

end of thread, other threads:[~2024-03-04 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-04  8:57 [edk2-devel] A bug in the use of timer was discovered during the RISC-V adaptation process "vicshuang(黄松) via groups.io
  -- strict thread matches above, loose matches on Subject: below --
2024-03-04  2:36 "vicshuang(黄松) via groups.io

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