public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 0/5] Improvements for booting to Linux on RISC-V
@ 2021-10-03 17:23 Daniel Schaefer
  2021-10-03 17:23 ` [PATCH v1 1/5] U540, U500: Add filesystem drivers Daniel Schaefer
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Daniel Schaefer @ 2021-10-03 17:23 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Sunil V L, Leif Lindholm

Some miscellaneous patches, that each compile and still boot to UEFI
Shell, to allow for booting to Linux on HW and also prepare for Linux on
RiscvVirtPkg (RISC-V OVMF equivalent).

Available as a branch here:
https://github.com/JohnAZoidberg/edk2-platforms/pull/2

Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>

Daniel Schaefer (5):
  U540, U500: Add filesystem drivers
  RISC-V/CpuDxe: Ignore set memory attributes failure
  U540, U500: Add initrd command to boot Linux
  U540: BuildCpuHob with 48 to indicate size memory space
  Signal EndOfDxe in boot manager

 Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c                 |  7 ++++++-
 Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf            |  3 ++-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc                                       | 14 +++++++++++++-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf                                       |  5 ++++-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc                             | 14 +++++++++++++-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf                             |  5 ++++-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c |  4 ++--
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c                                            |  4 ++--
 8 files changed, 46 insertions(+), 10 deletions(-)

-- 
2.33.0


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

* [PATCH v1 1/5] U540, U500: Add filesystem drivers
  2021-10-03 17:23 [PATCH v1 0/5] Improvements for booting to Linux on RISC-V Daniel Schaefer
@ 2021-10-03 17:23 ` Daniel Schaefer
  2021-10-04 10:19   ` Sunil V L
  2021-10-03 17:23 ` [PATCH v1 2/5] RISC-V/CpuDxe: Ignore set memory attributes failure Daniel Schaefer
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Daniel Schaefer @ 2021-10-03 17:23 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Sunil V L, Leif Lindholm

Not DiskIoDxe because we don't have a disk, just for loading from
Ramdisks.

Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc           | 7 ++++++-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf           | 4 +++-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 7 ++++++-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 4 +++-
 4 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
index 124f0d02cc..cdc1b9ee8f 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  RISC-V EFI on SiFive VC707 (U500) RISC-V platform
 #
-#  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+#  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -507,6 +507,11 @@
   MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
   MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
 
+  #
+  # FAT filesystem + GPT/MBR partitioning + UDF filesystem
+  #
+  FatPkg/EnhancedFatDxe/Fat.inf
+  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
 
   ShellPkg/Application/Shell/Shell.inf {
     <LibraryClasses>
diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
index dac6f85272..f262e4fe17 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
@@ -1,7 +1,7 @@
 # @file
 #  Flash definition file on SiFive VC707 (U500) RISC-V platform
 #
-#  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+#  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -178,6 +178,8 @@ INF  MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 INF  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
 INF  MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
 INF  MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
+INF  FatPkg/EnhancedFatDxe/Fat.inf
+INF  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
 
 !ifndef $(SOURCE_DEBUG_ENABLE)
 INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
index db7905774a..be70ef5294 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  RISC-V EFI on SiFive Freedom U540 HiFive Unleashed RISC-V platform
 #
-#  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+#  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -506,6 +506,11 @@
   MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
   MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
 
+  #
+  # FAT filesystem + GPT/MBR partitioning + UDF filesystem
+  #
+  FatPkg/EnhancedFatDxe/Fat.inf
+  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
 
   ShellPkg/Application/Shell/Shell.inf {
     <LibraryClasses>
diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
index 5622e589d6..c0ce09fcee 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
@@ -1,7 +1,7 @@
 # @file
 #  Flash definition file on SiFive Freedom U540 HiFive Unleashed RISC-V platform
 #
-#  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+#  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -178,6 +178,8 @@ INF  MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 INF  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
 INF  MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
 INF  MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
+INF  FatPkg/EnhancedFatDxe/Fat.inf
+INF  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
 
 !ifndef $(SOURCE_DEBUG_ENABLE)
 INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
-- 
2.33.0


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

* [PATCH v1 2/5] RISC-V/CpuDxe: Ignore set memory attributes failure
  2021-10-03 17:23 [PATCH v1 0/5] Improvements for booting to Linux on RISC-V Daniel Schaefer
  2021-10-03 17:23 ` [PATCH v1 1/5] U540, U500: Add filesystem drivers Daniel Schaefer
@ 2021-10-03 17:23 ` Daniel Schaefer
  2021-10-04 10:39   ` Sunil V L
  2021-10-03 17:23 ` [PATCH v1 3/5] U540, U500: Add initrd command to boot Linux Daniel Schaefer
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Daniel Schaefer @ 2021-10-03 17:23 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Sunil V L, Leif Lindholm

While enumerating the PCIe devices, the driver tries to set some caching
attributes on the memory.

Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c b/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c
index 27a07b1561..b8b8e91a6c 100644
--- a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c
+++ b/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c
@@ -1,7 +1,7 @@
 /** @file
   RISC-V CPU DXE driver.
 
-  Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+  Copyright (c) 2016 - 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -269,7 +269,7 @@ CpuSetMemoryAttributes (
   )
 {
   DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __FUNCTION__));
-  return EFI_UNSUPPORTED;
+  return EFI_SUCCESS;
 }
 
 /**
-- 
2.33.0


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

* [PATCH v1 3/5] U540, U500: Add initrd command to boot Linux
  2021-10-03 17:23 [PATCH v1 0/5] Improvements for booting to Linux on RISC-V Daniel Schaefer
  2021-10-03 17:23 ` [PATCH v1 1/5] U540, U500: Add filesystem drivers Daniel Schaefer
  2021-10-03 17:23 ` [PATCH v1 2/5] RISC-V/CpuDxe: Ignore set memory attributes failure Daniel Schaefer
@ 2021-10-03 17:23 ` Daniel Schaefer
  2021-10-04 10:45   ` Sunil V L
  2021-10-03 17:23 ` [PATCH v1 4/5] U540: BuildCpuHob with 48 to indicate size memory space Daniel Schaefer
  2021-10-03 17:23 ` [PATCH v1 5/5] Signal EndOfDxe in boot manager Daniel Schaefer
  4 siblings, 1 reply; 13+ messages in thread
From: Daniel Schaefer @ 2021-10-03 17:23 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Sunil V L, Leif Lindholm

Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc           | 7 +++++++
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf           | 1 +
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 7 +++++++
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 1 +
 4 files changed, 16 insertions(+)

diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
index cdc1b9ee8f..23f50ab2c4 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
@@ -513,6 +513,13 @@
   FatPkg/EnhancedFatDxe/Fat.inf
   MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
 
+  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf {
+    <PcdsFixedAtBuild>
+      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
+    <LibraryClasses>
+      ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
+  }
+
   ShellPkg/Application/Shell/Shell.inf {
     <LibraryClasses>
       ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
index f262e4fe17..5f3ac8e0b7 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
@@ -187,6 +187,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
 
 INF  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
 
+INF  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
 INF  ShellPkg/Application/Shell/Shell.inf
 
 #
diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
index be70ef5294..850d60afa2 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
@@ -512,6 +512,13 @@
   FatPkg/EnhancedFatDxe/Fat.inf
   MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
 
+  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf {
+    <PcdsFixedAtBuild>
+      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
+    <LibraryClasses>
+      ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
+  }
+
   ShellPkg/Application/Shell/Shell.inf {
     <LibraryClasses>
       ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
index c0ce09fcee..a1a4b342e3 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
@@ -187,6 +187,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
 
 INF  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
 
+INF  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
 INF  ShellPkg/Application/Shell/Shell.inf
 
 #
-- 
2.33.0


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

* [PATCH v1 4/5] U540: BuildCpuHob with 48 to indicate size memory space
  2021-10-03 17:23 [PATCH v1 0/5] Improvements for booting to Linux on RISC-V Daniel Schaefer
                   ` (2 preceding siblings ...)
  2021-10-03 17:23 ` [PATCH v1 3/5] U540, U500: Add initrd command to boot Linux Daniel Schaefer
@ 2021-10-03 17:23 ` Daniel Schaefer
  2021-10-04 11:02   ` Sunil V L
  2021-10-03 17:23 ` [PATCH v1 5/5] Signal EndOfDxe in boot manager Daniel Schaefer
  4 siblings, 1 reply; 13+ messages in thread
From: Daniel Schaefer @ 2021-10-03 17:23 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Sunil V L, Leif Lindholm

Otherwise it will crash on QEMU 6.0 with:

> Loading driver at 0x000BF814000 EntryPoint=0x000BF81428A PciHostBridgeDxe.efi
> InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF BF351F98
> ProtectUefiImageCommon - 0xBF365BC0
>   - 0x00000000BF814000 - 0x00000000000124C0
> PROGRESS CODE: V03040002 I0
> ProcessPciHost: Config[0x30000000+0x10000000) Bus[0x0..0xFF] Io[0x0+0x10000)@0x3000000 Mem32[0x40000000+0x40000000)@0x0 Mem64[0x400000000+0x400000000)@0x0
> CpuSetMemoryAttributes: Set memory attributes not supported yet
> CpuSetMemoryAttributes: Set memory attributes not supported yet
> RootBridge: PciRoot(0x0)
>   Support/Attr: 70001 / 70001
>     DmaAbove4G: Yes
> NoExtConfSpace: No
>      AllocAttr: 3 (CombineMemPMem Mem64Decode)
>            Bus: 0 - FF Translation=0
>             Io: 0 - FFFF Translation=0
>            Mem: 40000000 - 7FFFFFFF Translation=0
>     MemAbove4G: 400000000 - 7FFFFFFFF Translation=0
>           PMem: FFFFFFFFFFFFFFFF - 0 Translation=0
>    PMemAbove4G: FFFFFFFFFFFFFFFF - 0 Translation=0
> CpuSetMemoryAttributes: Set memory attributes not supported yet
>
> ASSERT_EFI_ERROR (Status = Not Found)
> ASSERT [PciHostBridgeDxe] /edk2/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c(332): !EFI_ERROR (CheckStatus)
> QEMU: Terminated

Change works on QEMU 5.2 and 6.0.

Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c
index 6641e10f2e..9a2cb9413c 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c
@@ -1,7 +1,7 @@
 /**@file
   Platform PEI driver
 
-  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
   Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2011, Andrei Warkentin <andreiw@motorola.com>
 
@@ -199,7 +199,7 @@ MiscInitialization (
   // of IO space. (Side note: unlike other HOBs, the CPU HOB is needed during
   // S3 resume as well, so we build it unconditionally.)
   //
-  BuildCpuHob (32, 32);
+  BuildCpuHob (48, 32);
 }
 
 /**
-- 
2.33.0


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

* [PATCH v1 5/5] Signal EndOfDxe in boot manager
  2021-10-03 17:23 [PATCH v1 0/5] Improvements for booting to Linux on RISC-V Daniel Schaefer
                   ` (3 preceding siblings ...)
  2021-10-03 17:23 ` [PATCH v1 4/5] U540: BuildCpuHob with 48 to indicate size memory space Daniel Schaefer
@ 2021-10-03 17:23 ` Daniel Schaefer
  2021-10-04 11:07   ` Sunil V L
  4 siblings, 1 reply; 13+ messages in thread
From: Daniel Schaefer @ 2021-10-03 17:23 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Sunil V L, Leif Lindholm

Otherwise we can't load a 3rd party image because we're still in DXE.
MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c prevents
that.

Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c      | 7 ++++++-
 Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 82cd311df5..d67f4836fc 100644
--- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -1,7 +1,7 @@
 /** @file
   This file include all platform actions
 
-Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -155,6 +155,11 @@ PlatformBootManagerBeforeConsole (
   EFI_INPUT_KEY                F2;
   EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
 
+  //
+  // Signal EndOfDxe PI Event
+  //
+  EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
+
   //
   // Update the console variables.
   //
diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index afba07573f..2bf89a3c44 100644
--- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Include all platform action which can be customized by IBV/OEM.
 #
-#  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+#  Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -48,6 +48,7 @@
   PrintLib
 
 [Guids]
+  gEfiEndOfDxeEventGroupGuid
 
 [Protocols]
   gEfiGenericMemTestProtocolGuid  ## CONSUMES
-- 
2.33.0


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

* Re: [PATCH v1 1/5] U540, U500: Add filesystem drivers
  2021-10-03 17:23 ` [PATCH v1 1/5] U540, U500: Add filesystem drivers Daniel Schaefer
@ 2021-10-04 10:19   ` Sunil V L
  0 siblings, 0 replies; 13+ messages in thread
From: Sunil V L @ 2021-10-04 10:19 UTC (permalink / raw)
  To: Daniel Schaefer; +Cc: devel, Abner Chang, Leif Lindholm

Looks good to me.

Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>

Thanks
Sunil
On Mon, Oct 04, 2021 at 01:23:55AM +0800, Daniel Schaefer wrote:
> Not DiskIoDxe because we don't have a disk, just for loading from
> Ramdisks.
> 
> Cc: Abner Chang <abner.chang@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> 
> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> ---
>  Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc           | 7 ++++++-
>  Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf           | 4 +++-
>  Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 7 ++++++-
>  Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 4 +++-
>  4 files changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
> index 124f0d02cc..cdc1b9ee8f 100644
> --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
> @@ -1,7 +1,7 @@
>  ## @file
>  #  RISC-V EFI on SiFive VC707 (U500) RISC-V platform
>  #
> -#  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
> +#  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -507,6 +507,11 @@
>    MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
>    MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
>  
> +  #
> +  # FAT filesystem + GPT/MBR partitioning + UDF filesystem
> +  #
> +  FatPkg/EnhancedFatDxe/Fat.inf
> +  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
>  
>    ShellPkg/Application/Shell/Shell.inf {
>      <LibraryClasses>
> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
> index dac6f85272..f262e4fe17 100644
> --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
> @@ -1,7 +1,7 @@
>  # @file
>  #  Flash definition file on SiFive VC707 (U500) RISC-V platform
>  #
> -#  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
> +#  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -178,6 +178,8 @@ INF  MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
>  INF  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
>  INF  MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
>  INF  MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
> +INF  FatPkg/EnhancedFatDxe/Fat.inf
> +INF  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
>  
>  !ifndef $(SOURCE_DEBUG_ENABLE)
>  INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
> index db7905774a..be70ef5294 100644
> --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
> @@ -1,7 +1,7 @@
>  ## @file
>  #  RISC-V EFI on SiFive Freedom U540 HiFive Unleashed RISC-V platform
>  #
> -#  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
> +#  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -506,6 +506,11 @@
>    MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
>    MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
>  
> +  #
> +  # FAT filesystem + GPT/MBR partitioning + UDF filesystem
> +  #
> +  FatPkg/EnhancedFatDxe/Fat.inf
> +  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
>  
>    ShellPkg/Application/Shell/Shell.inf {
>      <LibraryClasses>
> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
> index 5622e589d6..c0ce09fcee 100644
> --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
> @@ -1,7 +1,7 @@
>  # @file
>  #  Flash definition file on SiFive Freedom U540 HiFive Unleashed RISC-V platform
>  #
> -#  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
> +#  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -178,6 +178,8 @@ INF  MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
>  INF  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
>  INF  MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
>  INF  MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
> +INF  FatPkg/EnhancedFatDxe/Fat.inf
> +INF  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
>  
>  !ifndef $(SOURCE_DEBUG_ENABLE)
>  INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> -- 
> 2.33.0
> 

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

* Re: [PATCH v1 2/5] RISC-V/CpuDxe: Ignore set memory attributes failure
  2021-10-03 17:23 ` [PATCH v1 2/5] RISC-V/CpuDxe: Ignore set memory attributes failure Daniel Schaefer
@ 2021-10-04 10:39   ` Sunil V L
  0 siblings, 0 replies; 13+ messages in thread
From: Sunil V L @ 2021-10-04 10:39 UTC (permalink / raw)
  To: Daniel Schaefer; +Cc: devel, Abner Chang, Leif Lindholm

On Mon, Oct 04, 2021 at 01:23:56AM +0800, Daniel Schaefer wrote:
> While enumerating the PCIe devices, the driver tries to set some caching
> attributes on the memory.
> 
> Cc: Abner Chang <abner.chang@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> 
> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> ---
>  Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c b/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c
> index 27a07b1561..b8b8e91a6c 100644
> --- a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c
> +++ b/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c
> @@ -1,7 +1,7 @@
>  /** @file
>    RISC-V CPU DXE driver.
>  
> -  Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
> +  Copyright (c) 2016 - 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
>  
>    SPDX-License-Identifier: BSD-2-Clause-Patent
>  
> @@ -269,7 +269,7 @@ CpuSetMemoryAttributes (
>    )
>  {
>    DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __FUNCTION__));
> -  return EFI_UNSUPPORTED;
> +  return EFI_SUCCESS;
Looks good to me.

Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>

Thanks
Sunil
>  }
>  
>  /**
> -- 
> 2.33.0
> 

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

* Re: [PATCH v1 3/5] U540, U500: Add initrd command to boot Linux
  2021-10-03 17:23 ` [PATCH v1 3/5] U540, U500: Add initrd command to boot Linux Daniel Schaefer
@ 2021-10-04 10:45   ` Sunil V L
  2021-10-04 11:07     ` Daniel Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Sunil V L @ 2021-10-04 10:45 UTC (permalink / raw)
  To: Daniel Schaefer; +Cc: devel, Abner Chang, Leif Lindholm

On Mon, Oct 04, 2021 at 01:23:57AM +0800, Daniel Schaefer wrote:
> Cc: Abner Chang <abner.chang@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> 
> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> ---
>  Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc           | 7 +++++++
>  Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf           | 1 +
>  Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 7 +++++++
>  Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 1 +
>  4 files changed, 16 insertions(+)
> 
> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
> index cdc1b9ee8f..23f50ab2c4 100644
> --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
> @@ -513,6 +513,13 @@
>    FatPkg/EnhancedFatDxe/Fat.inf
>    MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
>  
> +  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf {
> +    <PcdsFixedAtBuild>
> +      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> +    <LibraryClasses>
> +      ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
Do we need to add UefiShellLib.inf here? Same question for other changes
too.

> +  }
> +
>    ShellPkg/Application/Shell/Shell.inf {
>      <LibraryClasses>
>        ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
> index f262e4fe17..5f3ac8e0b7 100644
> --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
> @@ -187,6 +187,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
>  
>  INF  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
>  
> +INF  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
>  INF  ShellPkg/Application/Shell/Shell.inf
>  
>  #
> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
> index be70ef5294..850d60afa2 100644
> --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
> @@ -512,6 +512,13 @@
>    FatPkg/EnhancedFatDxe/Fat.inf
>    MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
>  
> +  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf {
> +    <PcdsFixedAtBuild>
> +      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> +    <LibraryClasses>
> +      ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> +  }
> +
>    ShellPkg/Application/Shell/Shell.inf {
>      <LibraryClasses>
>        ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
> index c0ce09fcee..a1a4b342e3 100644
> --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
> @@ -187,6 +187,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
>  
>  INF  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
>  
> +INF  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
>  INF  ShellPkg/Application/Shell/Shell.inf
>  
>  #
> -- 
> 2.33.0
> 

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

* Re: [PATCH v1 4/5] U540: BuildCpuHob with 48 to indicate size memory space
  2021-10-03 17:23 ` [PATCH v1 4/5] U540: BuildCpuHob with 48 to indicate size memory space Daniel Schaefer
@ 2021-10-04 11:02   ` Sunil V L
  2021-10-04 11:26     ` Abner Chang
  0 siblings, 1 reply; 13+ messages in thread
From: Sunil V L @ 2021-10-04 11:02 UTC (permalink / raw)
  To: Daniel Schaefer; +Cc: devel, Abner Chang, Leif Lindholm

On Mon, Oct 04, 2021 at 01:23:58AM +0800, Daniel Schaefer wrote:
> Otherwise it will crash on QEMU 6.0 with:
> 
> > Loading driver at 0x000BF814000 EntryPoint=0x000BF81428A PciHostBridgeDxe.efi
> > InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF BF351F98
> > ProtectUefiImageCommon - 0xBF365BC0
> >   - 0x00000000BF814000 - 0x00000000000124C0
> > PROGRESS CODE: V03040002 I0
> > ProcessPciHost: Config[0x30000000+0x10000000) Bus[0x0..0xFF] Io[0x0+0x10000)@0x3000000 Mem32[0x40000000+0x40000000)@0x0 Mem64[0x400000000+0x400000000)@0x0
> > CpuSetMemoryAttributes: Set memory attributes not supported yet
> > CpuSetMemoryAttributes: Set memory attributes not supported yet
> > RootBridge: PciRoot(0x0)
> >   Support/Attr: 70001 / 70001
> >     DmaAbove4G: Yes
> > NoExtConfSpace: No
> >      AllocAttr: 3 (CombineMemPMem Mem64Decode)
> >            Bus: 0 - FF Translation=0
> >             Io: 0 - FFFF Translation=0
> >            Mem: 40000000 - 7FFFFFFF Translation=0
> >     MemAbove4G: 400000000 - 7FFFFFFFF Translation=0
> >           PMem: FFFFFFFFFFFFFFFF - 0 Translation=0
> >    PMemAbove4G: FFFFFFFFFFFFFFFF - 0 Translation=0
> > CpuSetMemoryAttributes: Set memory attributes not supported yet
> >
> > ASSERT_EFI_ERROR (Status = Not Found)
> > ASSERT [PciHostBridgeDxe] /edk2/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c(332): !EFI_ERROR (CheckStatus)
> > QEMU: Terminated
> 
> Change works on QEMU 5.2 and 6.0.
> 
> Cc: Abner Chang <abner.chang@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> 
> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> ---
>  Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c
> index 6641e10f2e..9a2cb9413c 100644
> --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c
> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c
> @@ -1,7 +1,7 @@
>  /**@file
>    Platform PEI driver
>  
> -  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
> +  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
>    Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
>    Copyright (c) 2011, Andrei Warkentin <andreiw@motorola.com>
>  
> @@ -199,7 +199,7 @@ MiscInitialization (
>    // of IO space. (Side note: unlike other HOBs, the CPU HOB is needed during
>    // S3 resume as well, so we build it unconditionally.)
>    //
> -  BuildCpuHob (32, 32);
> +  BuildCpuHob (48, 32);

This is fine for now. But I think this should be found dynamically
instead of hard coding. Do you know if there is any way in RISC-V to
find out the physical address bits implemented? I am thinking some thing
similar to ArmGetPhysicalAddressBits().

Otherwise, looks fine to me.

Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>

Thanks
Sunil
>  }
>  
>  /**
> -- 
> 2.33.0
> 

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

* Re: [PATCH v1 5/5] Signal EndOfDxe in boot manager
  2021-10-03 17:23 ` [PATCH v1 5/5] Signal EndOfDxe in boot manager Daniel Schaefer
@ 2021-10-04 11:07   ` Sunil V L
  0 siblings, 0 replies; 13+ messages in thread
From: Sunil V L @ 2021-10-04 11:07 UTC (permalink / raw)
  To: Daniel Schaefer; +Cc: devel, Abner Chang, Leif Lindholm

On Mon, Oct 04, 2021 at 01:23:59AM +0800, Daniel Schaefer wrote:
> Otherwise we can't load a 3rd party image because we're still in DXE.
> MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c prevents
> that.
> 
> Cc: Abner Chang <abner.chang@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> 
> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> ---
>  Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c      | 7 ++++++-
>  Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 3 ++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> index 82cd311df5..d67f4836fc 100644
> --- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> @@ -1,7 +1,7 @@
>  /** @file
>    This file include all platform actions
>  
> -Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
> +Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
>  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
>  
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -155,6 +155,11 @@ PlatformBootManagerBeforeConsole (
>    EFI_INPUT_KEY                F2;
>    EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
>  
> +  //
> +  // Signal EndOfDxe PI Event
> +  //
> +  EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
> +
>    //
>    // Update the console variables.
>    //
> diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> index afba07573f..2bf89a3c44 100644
> --- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  Include all platform action which can be customized by IBV/OEM.
>  #
> -#  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
> +#  Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -48,6 +48,7 @@
>    PrintLib
>  
>  [Guids]
> +  gEfiEndOfDxeEventGroupGuid

Looks good to me.

Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>

Thanks
Sunil
>  
>  [Protocols]
>    gEfiGenericMemTestProtocolGuid  ## CONSUMES
> -- 
> 2.33.0
> 

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

* Re: [PATCH v1 3/5] U540, U500: Add initrd command to boot Linux
  2021-10-04 10:45   ` Sunil V L
@ 2021-10-04 11:07     ` Daniel Schaefer
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Schaefer @ 2021-10-04 11:07 UTC (permalink / raw)
  To: Sunil V L; +Cc: devel, Abner Chang, Leif Lindholm

On 10/4/21 18:45, Sunil V L wrote:
> On Mon, Oct 04, 2021 at 01:23:57AM +0800, Daniel Schaefer wrote:
>> Cc: Abner Chang <abner.chang@hpe.com>
>> Cc: Sunil V L <sunilvl@ventanamicro.com>
>> Cc: Leif Lindholm <leif@nuviainc.com>
>>
>> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
>> ---
>>  Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc           | 7 +++++++
>>  Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf           | 1 +
>>  Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 7 +++++++
>>  Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 1 +
>>  4 files changed, 16 insertions(+)
>>
>> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
>> index cdc1b9ee8f..23f50ab2c4 100644
>> --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
>> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
>> @@ -513,6 +513,13 @@
>>    FatPkg/EnhancedFatDxe/Fat.inf
>>    MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
>>  
>> +  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf {
>> +    <PcdsFixedAtBuild>
>> +      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>> +    <LibraryClasses>
>> +      ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> Do we need to add UefiShellLib.inf here? Same question for other changes
> too.

You're right. We don't, if we add it to the regular libraries.
Neither do we need it for
ShellPkg/Application/Shell/Shell.inf

I'll remove it.

>> +  }
>> +
>>    ShellPkg/Application/Shell/Shell.inf {
>>      <LibraryClasses>
>>        ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
>> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
>> index f262e4fe17..5f3ac8e0b7 100644
>> --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
>> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
>> @@ -187,6 +187,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
>>  
>>  INF  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
>>  
>> +INF  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
>>  INF  ShellPkg/Application/Shell/Shell.inf
>>  
>>  #
>> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
>> index be70ef5294..850d60afa2 100644
>> --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
>> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
>> @@ -512,6 +512,13 @@
>>    FatPkg/EnhancedFatDxe/Fat.inf
>>    MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
>>  
>> +  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf {
>> +    <PcdsFixedAtBuild>
>> +      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>> +    <LibraryClasses>
>> +      ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
>> +  }
>> +
>>    ShellPkg/Application/Shell/Shell.inf {
>>      <LibraryClasses>
>>        ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
>> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
>> index c0ce09fcee..a1a4b342e3 100644
>> --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
>> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
>> @@ -187,6 +187,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
>>  
>>  INF  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
>>  
>> +INF  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
>>  INF  ShellPkg/Application/Shell/Shell.inf
>>  
>>  #
>> -- 
>> 2.33.0
>>

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

* Re: [PATCH v1 4/5] U540: BuildCpuHob with 48 to indicate size memory space
  2021-10-04 11:02   ` Sunil V L
@ 2021-10-04 11:26     ` Abner Chang
  0 siblings, 0 replies; 13+ messages in thread
From: Abner Chang @ 2021-10-04 11:26 UTC (permalink / raw)
  To: Sunil V L, Schaefer, Daniel; +Cc: devel@edk2.groups.io, Leif Lindholm



> -----Original Message-----
> From: Sunil V L [mailto:sunilvl@ventanamicro.com]
> Sent: Monday, October 4, 2021 7:02 PM
> To: Schaefer, Daniel <daniel.schaefer@hpe.com>
> Cc: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>; Leif Lindholm <leif@nuviainc.com>
> Subject: Re: [PATCH v1 4/5] U540: BuildCpuHob with 48 to indicate size
> memory space
> 
> On Mon, Oct 04, 2021 at 01:23:58AM +0800, Daniel Schaefer wrote:
> > Otherwise it will crash on QEMU 6.0 with:
> >
> > > Loading driver at 0x000BF814000 EntryPoint=0x000BF81428A
> PciHostBridgeDxe.efi
> > > InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF
> BF351F98
> > > ProtectUefiImageCommon - 0xBF365BC0
> > >   - 0x00000000BF814000 - 0x00000000000124C0
> > > PROGRESS CODE: V03040002 I0
> > > ProcessPciHost: Config[0x30000000+0x10000000) Bus[0x0..0xFF]
> Io[0x0+0x10000)@0x3000000 Mem32[0x40000000+0x40000000)@0x0
> Mem64[0x400000000+0x400000000)@0x0
> > > CpuSetMemoryAttributes: Set memory attributes not supported yet
> > > CpuSetMemoryAttributes: Set memory attributes not supported yet
> > > RootBridge: PciRoot(0x0)
> > >   Support/Attr: 70001 / 70001
> > >     DmaAbove4G: Yes
> > > NoExtConfSpace: No
> > >      AllocAttr: 3 (CombineMemPMem Mem64Decode)
> > >            Bus: 0 - FF Translation=0
> > >             Io: 0 - FFFF Translation=0
> > >            Mem: 40000000 - 7FFFFFFF Translation=0
> > >     MemAbove4G: 400000000 - 7FFFFFFFF Translation=0
> > >           PMem: FFFFFFFFFFFFFFFF - 0 Translation=0
> > >    PMemAbove4G: FFFFFFFFFFFFFFFF - 0 Translation=0
> > > CpuSetMemoryAttributes: Set memory attributes not supported yet
> > >
> > > ASSERT_EFI_ERROR (Status = Not Found)
> > > ASSERT [PciHostBridgeDxe]
> /edk2/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c(332): !EFI
> _ERROR (CheckStatus)
> > > QEMU: Terminated
> >
> > Change works on QEMU 5.2 and 6.0.
> >
> > Cc: Abner Chang <abner.chang@hpe.com>
> > Cc: Sunil V L <sunilvl@ventanamicro.com>
> > Cc: Leif Lindholm <leif@nuviainc.com>
> >
> > Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> > ---
> >
> Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universa
> l/Pei/PlatformPei/Platform.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git
> a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Univer
> sal/Pei/PlatformPei/Platform.c
> b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Univer
> sal/Pei/PlatformPei/Platform.c
> > index 6641e10f2e..9a2cb9413c 100644
> > ---
> a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Univer
> sal/Pei/PlatformPei/Platform.c
> > +++
> b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Univer
> sal/Pei/PlatformPei/Platform.c
> > @@ -1,7 +1,7 @@
> >  /**@file
> >    Platform PEI driver
> >
> > -  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights
> reserved.<BR>
> > +  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All
> rights reserved.<BR>
> >    Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
> >    Copyright (c) 2011, Andrei Warkentin <andreiw@motorola.com>
> >
> > @@ -199,7 +199,7 @@ MiscInitialization (
> >    // of IO space. (Side note: unlike other HOBs, the CPU HOB is needed
> during
> >    // S3 resume as well, so we build it unconditionally.)
> >    //
> > -  BuildCpuHob (32, 32);
> > +  BuildCpuHob (48, 32);
> 
> This is fine for now. But I think this should be found dynamically
> instead of hard coding. Do you know if there is any way in RISC-V to
> find out the physical address bits implemented? I am thinking some thing
> similar to ArmGetPhysicalAddressBits().
We don't have dynamic way to get this information yet.  Maybe DT has the information  of addressable bits, otherwise we have to wait until config-structure to be implemented in the HART for the dynamically discovery.
Or create something like ArmGetPhysicalAddressBits as the platform level library later.
Thanks
Abner
> 
> Otherwise, looks fine to me.
> 
> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
> 
> Thanks
> Sunil
> >  }
> >
> >  /**
> > --
> > 2.33.0
> >

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

end of thread, other threads:[~2021-10-04 11:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-03 17:23 [PATCH v1 0/5] Improvements for booting to Linux on RISC-V Daniel Schaefer
2021-10-03 17:23 ` [PATCH v1 1/5] U540, U500: Add filesystem drivers Daniel Schaefer
2021-10-04 10:19   ` Sunil V L
2021-10-03 17:23 ` [PATCH v1 2/5] RISC-V/CpuDxe: Ignore set memory attributes failure Daniel Schaefer
2021-10-04 10:39   ` Sunil V L
2021-10-03 17:23 ` [PATCH v1 3/5] U540, U500: Add initrd command to boot Linux Daniel Schaefer
2021-10-04 10:45   ` Sunil V L
2021-10-04 11:07     ` Daniel Schaefer
2021-10-03 17:23 ` [PATCH v1 4/5] U540: BuildCpuHob with 48 to indicate size memory space Daniel Schaefer
2021-10-04 11:02   ` Sunil V L
2021-10-04 11:26     ` Abner Chang
2021-10-03 17:23 ` [PATCH v1 5/5] Signal EndOfDxe in boot manager Daniel Schaefer
2021-10-04 11:07   ` 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