The ArmJunoDxe driver installs two default boot options:
- Boot0001, that exposes only the 2xA57 cluster
- Boot0002, that exposes both the 2xA57 and 4xA53 clusters.

This is implemented by overriding the DTB passed via the config table
with a dtb= kernel command line, which requires that a DTB file by the exact
name 'r1a57a53.dtb' is present in the same volume that hosts the kernel Image.

So instead, define only a single Juno rev1 FDT, and implement the Boot0001
option by passing maxcpus=2 on the kernel command line. This is also more
flexible, since the A53 cluster may still be onlined manually through sysfs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <[email protected]>
---
 ArmPlatformPkg/ArmJunoPkg/ArmJuno.dec                       |  3 +--
 ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c   | 16 
++++++++--------
 ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf |  3 +--
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/ArmPlatformPkg/ArmJunoPkg/ArmJuno.dec 
b/ArmPlatformPkg/ArmJunoPkg/ArmJuno.dec
index 040a906ac1d2..834305c06dd7 100644
--- a/ArmPlatformPkg/ArmJunoPkg/ArmJuno.dec
+++ b/ArmPlatformPkg/ArmJunoPkg/ArmJuno.dec
@@ -45,5 +45,4 @@ [PcdsFixedAtBuild.common]
 
   # Juno Device Trees are loaded from NOR Flash
   
gArmJunoTokenSpaceGuid.PcdJunoR0FdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/juno.dtb"|VOID*|0x00000006
-  
gArmJunoTokenSpaceGuid.PcdJunoR1A57x2FdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/r1a57.dtb"|VOID*|0x00000007
-  
gArmJunoTokenSpaceGuid.PcdJunoR1A57x2A53x4FdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/r1a57a53.dtb"|VOID*|0x00000008
+  
gArmJunoTokenSpaceGuid.PcdJunoR1FdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/r1a57a53.dtb"|VOID*|0x00000007
diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c 
b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
index c82657aef718..e63b88f2eb6b 100644
--- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
+++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
@@ -361,7 +361,7 @@ ArmJunoEntryPoint (
     break;
 
   case JUNO_R1:
-    TextDevicePath = (CHAR16*)FixedPcdGetPtr (PcdJunoR1A57x2FdtDevicePath);
+    TextDevicePath = (CHAR16*)FixedPcdGetPtr (PcdJunoR1FdtDevicePath);
     break;
 
   default:
@@ -405,7 +405,7 @@ SetJunoR1DefaultBootEntries (
   )
 {
   EFI_STATUS                          Status;
-  CONST CHAR16*                       ExtraBootArgument = L" dtb=r1a57a53.dtb";
+  CONST CHAR16                        ExtraBootArgument[] = L" maxcpus=2";
   UINTN                               Size;
   EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL  *EfiDevicePathFromTextProtocol;
   EFI_DEVICE_PATH*                    BootDevicePath;
@@ -453,9 +453,9 @@ SetJunoR1DefaultBootEntries (
     return EFI_UNSUPPORTED;
   }
 
-  DefaultBootArgument1 = (CHAR16*)PcdGetPtr (PcdDefaultBootArgument);
-  DefaultBootArgument1Size = StrSize (DefaultBootArgument1);
-  DefaultBootArgument2Size = DefaultBootArgument1Size + StrSize 
(ExtraBootArgument);
+  DefaultBootArgument2 = (CHAR16*)PcdGetPtr (PcdDefaultBootArgument);
+  DefaultBootArgument2Size = StrSize (DefaultBootArgument2);
+  DefaultBootArgument1Size = DefaultBootArgument2Size + sizeof 
(ExtraBootArgument);
 
   Status = EFI_OUT_OF_RESOURCES;
   DefaultBootArgument1 = AllocatePool (DefaultBootArgument1Size);
@@ -467,11 +467,11 @@ SetJunoR1DefaultBootEntries (
     goto Error;
   }
 
-  CopyMem (DefaultBootArgument2, DefaultBootArgument1, 
DefaultBootArgument1Size);
+  CopyMem (DefaultBootArgument1, DefaultBootArgument2, 
DefaultBootArgument2Size);
   CopyMem (
-    (UINT8*)DefaultBootArgument2 + DefaultBootArgument1Size - sizeof (CHAR16),
+    (UINT8*)DefaultBootArgument1 + DefaultBootArgument2Size - sizeof (CHAR16),
     ExtraBootArgument,
-    StrSize (ExtraBootArgument)
+    sizeof (ExtraBootArgument)
   );
 
   //
diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf 
b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
index e0e62fae108d..754f950ee4e9 100644
--- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
+++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
@@ -74,8 +74,7 @@ [FixedPcd]
   gArmJunoTokenSpaceGuid.PcdSynopsysUsbOhciBaseAddress
 
   gArmJunoTokenSpaceGuid.PcdJunoR0FdtDevicePath
-  gArmJunoTokenSpaceGuid.PcdJunoR1A57x2FdtDevicePath
-  gArmJunoTokenSpaceGuid.PcdJunoR1A57x2A53x4FdtDevicePath
+  gArmJunoTokenSpaceGuid.PcdJunoR1FdtDevicePath
 
   gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath
   gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument
-- 
1.9.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to