public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY
@ 2021-06-18 15:27 Vikas Singh
  2021-06-18 15:27 ` [PATCH V2 1/4] Platform/NXP: Make SoC version log in ConfigurationManager generic Vikas Singh
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Vikas Singh @ 2021-06-18 15:27 UTC (permalink / raw)
  To: devel
  Cc: sami.mujawar, leif, meenakshi.aggarwal, samer.el-haj-mahmoud,
	v.sethi, arokia.samy, kuldip.dwivedi, ard.biesheuvel, vikas.singh,
	Sunny.Wang

This patch series basically aims to extend the Dynamic ACPI
framework towards NXP's LS1046AFRWY platform.

In continuation to https://edk2.groups.io/g/devel/message/71709

The change set in the series is in below order -

(1)Introducing a new platform specific macro "PLAT_SOC_NAME"
This macro will be consumed by Configuration Manager(CM).
Platforms who extends CM services for themselves must notify
their SoC details to CM using this macro only.
Additionally also update the lx2160ardb platform header with
PLAT_SOC_NAME, this will be consumed by CM.

(2)Introduced a function to get SoC's System Version Register(SVR)
This function will fetch SVR details for LS1046A SoC based platforms.
In current patch series, this function will be used by LS1046aFrwyPkg.

(3)Extending Configuration Manager (CM) and its services to leverage
the Dynamic ACPI support for NXP's LS1046aFrwy platform.

(4)Introduced an OEM specific firmware acpi table generator
Also add Dsdt.asl as a place holder having only platform's clock
related dsdt properties for now and will accommodate other IP specific
dsdt tables(acpi properties) for LS1046AFRWY in future patch series.

Vikas Singh (4):
  Platform/NXP: Make SoC version log in ConfigurationManager generic
  Silicon/NXP: Add support of SVR handling for LS1046A SoC
  NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY
  Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator

 Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c  |  11 +-
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl                           |  60 ++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl                          |  15 ++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf                |  39 +++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c | 138 +++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h                      |  23 +++
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h                                       | 156 ++++++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc                                       |  29 ++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf                                       |  13 ++
 Platform/NXP/LX2160aRdbPkg/Include/Platform.h                                        |   8 +-
 Silicon/NXP/LS1046A/LS1046A.dsc.inc                                                  |  11 ++
 Silicon/NXP/LS1046A/Library/SocLib/SocLib.c                                          |  16 ++
 Silicon/NXP/LX2160A/LX2160A.dsc.inc                                                  |   3 +-
 13 files changed, 508 insertions(+), 14 deletions(-)
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h

-- 
2.25.1


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

* [PATCH V2 1/4] Platform/NXP: Make SoC version log in ConfigurationManager generic
  2021-06-18 15:27 [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY Vikas Singh
@ 2021-06-18 15:27 ` Vikas Singh
  2021-07-12 10:36   ` Sunny Wang
  2021-06-18 15:27 ` [PATCH V2 2/4] Silicon/NXP: Add support of SVR handling for LS1046A SoC Vikas Singh
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Vikas Singh @ 2021-06-18 15:27 UTC (permalink / raw)
  To: devel
  Cc: sami.mujawar, leif, meenakshi.aggarwal, samer.el-haj-mahmoud,
	v.sethi, arokia.samy, kuldip.dwivedi, ard.biesheuvel, vikas.singh,
	Sunny.Wang

This patch replaces the logic in ConfigurationManager to print platform
name based on platform ID with a simple #define PLAT_SOC_NAME defined in
platform headers.
This also removes duplication of the SVR_LX2160A, SVR_SOC_VER, SVR_MAJOR
and SVR_MINOR macro definitions  between SoC headers and platform headers.

Signed-off-by: Vikas Singh <vikas.singh@puresoftware.com>
---
 Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c | 11 ++++-------
 Platform/NXP/LX2160aRdbPkg/Include/Platform.h                                       |  8 ++------
 Silicon/NXP/LX2160A/LX2160A.dsc.inc                                                 |  3 ++-
 3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c
index 80ce8412c4..39376d900b 100644
--- a/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c
+++ b/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c
@@ -2,7 +2,7 @@
   Configuration Manager Dxe
 
   Copyright 2020 NXP
-  Copyright 2020 Puresoftware Ltd
+  Copyright 2020-2021 Puresoftware Ltd
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -25,6 +25,7 @@
 */
 #include "ConfigurationManager.h"
 #include <Library/SocLib.h>
+#include <Chassis.h>
 
 /** The platform configuration repository information.
 */
@@ -170,12 +171,8 @@ InitializePlatformRepository (
   PlatformRepo = This->PlatRepoInfo;
 
   Svr = SocGetSvr ();
-  if (SVR_SOC_VER(Svr) == SVR_LX2160A) {
-    PlatformRepo->FslBoardRevision = SVR_MAJOR(Svr);
-    DEBUG ((DEBUG_INFO, "Fsl : SoC LX2160A Rev = 0x%x\n", PlatformRepo->FslBoardRevision));
-  } else {
-    DEBUG ((DEBUG_INFO, "Fsl : SoC Unknown Rev = 0x%x\n", PlatformRepo->FslBoardRevision));
-  }
+  PlatformRepo->FslBoardRevision = SVR_MAJOR(Svr);
+  DEBUG ((DEBUG_INFO, "Fsl : SoC = %s Rev = 0x%x\n", PLAT_SOC_NAME, PlatformRepo->FslBoardRevision));
 
   return EFI_SUCCESS;
 }
diff --git a/Platform/NXP/LX2160aRdbPkg/Include/Platform.h b/Platform/NXP/LX2160aRdbPkg/Include/Platform.h
index 76a41d4369..f2e831f033 100644
--- a/Platform/NXP/LX2160aRdbPkg/Include/Platform.h
+++ b/Platform/NXP/LX2160aRdbPkg/Include/Platform.h
@@ -2,7 +2,7 @@
  *  Platform headers
  *
  *  Copyright 2020 NXP
- *  Copyright 2020 Puresoftware Ltd
+ *  Copyright 2020-2021 Puresoftware Ltd
  *
  *  SPDX-License-Identifier: BSD-2-Clause-Patent
  *
@@ -15,11 +15,7 @@
 #define EFI_ACPI_ARM_OEM_REVISION       0x00000000
 
 // Soc defines
-#define SVR_SOC_VER(svr)        (((svr) >> 8) & 0xFFFFFE)
-#define SVR_MAJOR(svr)          (((svr) >> 4) & 0xf)
-#define SVR_MINOR(svr)          (((svr) >> 0) & 0xf)
-
-#define SVR_LX2160A             0x873600
+#define PLAT_SOC_NAME           "LX2160ARDB"
 
 // PCLK
 #define DCFG_BASE   0x1E00000
diff --git a/Silicon/NXP/LX2160A/LX2160A.dsc.inc b/Silicon/NXP/LX2160A/LX2160A.dsc.inc
index ea7e54fa89..15a06bea1f 100644
--- a/Silicon/NXP/LX2160A/LX2160A.dsc.inc
+++ b/Silicon/NXP/LX2160A/LX2160A.dsc.inc
@@ -2,7 +2,7 @@
 #  LX2160A Soc package.
 #
 #  Copyright 2018-2020 NXP
-#  Copyright 2020 Puresoftware Ltd
+#  Copyright 2020-2021 Puresoftware Ltd
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -70,6 +70,7 @@
   Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf {
     <BuildOptions>
       *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Platform/NXP/LX2160aRdbPkg/Include
+      *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Silicon/NXP/Chassis3V2/Include
   }
 !endif
 
-- 
2.25.1


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

* [PATCH V2 2/4] Silicon/NXP: Add support of SVR handling for LS1046A SoC
  2021-06-18 15:27 [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY Vikas Singh
  2021-06-18 15:27 ` [PATCH V2 1/4] Platform/NXP: Make SoC version log in ConfigurationManager generic Vikas Singh
@ 2021-06-18 15:27 ` Vikas Singh
  2021-07-12 10:36   ` Sunny Wang
  2021-06-18 15:27 ` [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY Vikas Singh
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Vikas Singh @ 2021-06-18 15:27 UTC (permalink / raw)
  To: devel
  Cc: sami.mujawar, leif, meenakshi.aggarwal, samer.el-haj-mahmoud,
	v.sethi, arokia.samy, kuldip.dwivedi, ard.biesheuvel, vikas.singh,
	Sunny.Wang

This patch adds a generic method to get Silicon Version Register (SVR)
on LS1046A SoC. This method will be generic for all platfroms based
on LS1046A SoC, like - LS1046AFRWY, LS1046ARDB.

Signed-off-by: Vikas Singh <vikas.singh@puresoftware.com>
---
 Silicon/NXP/LS1046A/Library/SocLib/SocLib.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c
index 8fa6a7dd00..003f5bd82f 100644
--- a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c
+++ b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c
@@ -2,6 +2,7 @@
   SoC specific Library containg functions to initialize various SoC components
 
   Copyright 2017-2020 NXP
+  Copyright 2021 Puresoftware Ltd
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -64,6 +65,21 @@ SocGetClock (
   return ReturnValue;
 }
 
+/**
+  Function to get SoC's System Version Register(SVR)
+ **/
+UINT32
+SocGetSvr (
+  VOID
+  )
+{
+  LS1046A_DEVICE_CONFIG  *Dcfg;
+
+  Dcfg = (LS1046A_DEVICE_CONFIG  *)LS1046A_DCFG_ADDRESS;
+
+  return DcfgRead32 ((UINTN)&Dcfg->Svr);
+}
+
 /**
    Function to select pins depending upon pcd using supplemental
    configuration unit(SCFG) extended RCW controlled pinmux control
-- 
2.25.1


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

* [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY
  2021-06-18 15:27 [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY Vikas Singh
  2021-06-18 15:27 ` [PATCH V2 1/4] Platform/NXP: Make SoC version log in ConfigurationManager generic Vikas Singh
  2021-06-18 15:27 ` [PATCH V2 2/4] Silicon/NXP: Add support of SVR handling for LS1046A SoC Vikas Singh
@ 2021-06-18 15:27 ` Vikas Singh
  2021-07-12 10:37   ` Sunny Wang
  2021-06-18 15:27 ` [PATCH V2 4/4] Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator Vikas Singh
  2021-07-12 10:33 ` [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY Sunny Wang
  4 siblings, 1 reply; 15+ messages in thread
From: Vikas Singh @ 2021-06-18 15:27 UTC (permalink / raw)
  To: devel
  Cc: sami.mujawar, leif, meenakshi.aggarwal, samer.el-haj-mahmoud,
	v.sethi, arokia.samy, kuldip.dwivedi, ard.biesheuvel, vikas.singh,
	Sunny.Wang

This patch enables the use of ConfigurationManager (CM) and
its services to leverage the Dynamic ACPI support for NXP's
LS1046aFrwy platform.

Signed-off-by: Vikas Singh <vikas.singh@puresoftware.com>
---
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h | 152 ++++++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc |  28 ++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf |  13 ++
 Silicon/NXP/LS1046A/LS1046A.dsc.inc            |  11 ++
 4 files changed, 204 insertions(+)

diff --git a/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
new file mode 100644
index 0000000000..3c68d65cd3
--- /dev/null
+++ b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
@@ -0,0 +1,152 @@
+/** @file
+ *  Platform headers
+ *
+ *  Copyright 2021 NXP
+ *  Copyright 2021 Puresoftware Ltd
+ *
+ *  SPDX-License-Identifier: BSD-2-Clause-Patent
+ *
+**/
+
+
+#ifndef LS1046AFRWY_PLATFORM_H
+#define LS1046AFRWY_PLATFORM_H
+
+#define EFI_ACPI_ARM_OEM_REVISION    0x00000000
+
+// Soc defines
+#define PLAT_SOC_NAME                "LS1046AFRWY"
+
+// Gic
+#define GIC_VERSION                  2
+#define GICD_BASE                    0x1410000
+#define GICC_BASE                    0x142f000
+#define GICH_BASE                    0x1440000
+#define GICV_BASE                    0x1460000
+
+// UART
+#define UART0_BASE                   0x21C0500
+#define UART0_IT                     86
+#define UART0_LENGTH                 0x100
+#define SPCR_FLOW_CONTROL_NONE       0
+
+// Timer
+#define TIMER_BLOCK_COUNT            1
+#define TIMER_FRAME_COUNT            4
+#define TIMER_WATCHDOG_COUNT         1
+#define TIMER_BASE_ADDRESS           0x23E0000 // a.k.a CNTControlBase
+#define TIMER_READ_BASE_ADDRESS      0x23F0000 // a.k.a CNTReadBase
+#define TIMER_SEC_IT                 29
+#define TIMER_NON_SEC_IT             30
+#define TIMER_VIRT_IT                27
+#define TIMER_HYP_IT                 26
+#define TIMER_FRAME0_IT              78
+#define TIMER_FRAME1_IT              79
+#define TIMER_FRAME2_IT              92
+
+// Mcfg
+#define LS1046A_PCI_SEG0_CONFIG_BASE 0x4000000000
+#define LS1046A_PCI_SEG0             0x0
+#define LS1046A_PCI_SEG_BUSNUM_MIN   0x0
+#define LS1046A_PCI_SEG_BUSNUM_MAX   0xff
+#define LS1046A_PCI_SEG1_CONFIG_BASE 0x4800000000
+#define LS1046A_PCI_SEG2_CONFIG_BASE 0x5000000000
+#define LS1046A_PCI_SEG1             0x1
+#define LS1046A_PCI_SEG2             0x2
+
+// Platform specific info needed by Configuration Manager
+
+#define CFG_MGR_TABLE_ID  SIGNATURE_64 ('L','S','1','0','4','6',' ',' ')
+
+// Specify the OEM defined tables
+#define OEM_ACPI_TABLES             0
+
+#define PLAT_PCI_SEG0               LS1046A_PCI_SEG0
+#define PLAT_PCI_SEG1_CONFIG_BASE   LS1046A_PCI_SEG1_CONFIG_BASE
+#define PLAT_PCI_SEG1               LS1046A_PCI_SEG1
+#define PLAT_PCI_SEG_BUSNUM_MIN     LS1046A_PCI_SEG_BUSNUM_MIN
+#define PLAT_PCI_SEG_BUSNUM_MAX     LS1046A_PCI_SEG_BUSNUM_MAX
+#define PLAT_PCI_SEG2_CONFIG_BASE   LS1046A_PCI_SEG2_CONFIG_BASE
+#define PLAT_PCI_SEG2               LS1046A_PCI_SEG2
+
+#define PLAT_GIC_VERSION            GIC_VERSION
+#define PLAT_GICD_BASE              GICD_BASE
+#define PLAT_GICI_BASE              GICI_BASE
+#define PLAT_GICR_BASE              GICR_BASE
+#define PLAT_GICR_LEN               GICR_LEN
+#define PLAT_GICC_BASE              GICC_BASE
+#define PLAT_GICH_BASE              GICH_BASE
+#define PLAT_GICV_BASE              GICV_BASE
+
+#define PLAT_CPU_COUNT              4
+#define PLAT_GTBLOCK_COUNT          0
+#define PLAT_GTFRAME_COUNT          0
+#define PLAT_PCI_CONFG_COUNT        2
+
+#define PLAT_WATCHDOG_COUNT           0
+#define PLAT_GIC_REDISTRIBUTOR_COUNT  0
+#define PLAT_GIC_ITS_COUNT            0
+
+/* GIC CPU Interface information
+   GIC_ENTRY (CPUInterfaceNumber, Mpidr, PmuIrq, VGicIrq, EnergyEfficiency)
+ */
+#define PLAT_GIC_CPU_INTERFACE    {                          \
+             GICC_ENTRY (0,  GET_MPID (0, 0), 138, 0x19, 0), \
+             GICC_ENTRY (1,  GET_MPID (0, 1), 139, 0x19, 0), \
+             GICC_ENTRY (2,  GET_MPID (0, 2), 127, 0x19, 0), \
+             GICC_ENTRY (3,  GET_MPID (0, 3), 129, 0x19, 0), \
+}
+
+#define PLAT_WATCHDOG_INFO                    \
+  {                                           \
+  }                                           \
+
+#define PLAT_TIMER_BLOCK_INFO                 \
+  {                                           \
+  }                                           \
+
+#define PLAT_TIMER_FRAME_INFO                 \
+  {                                           \
+  }                                           \
+
+#define PLAT_GIC_DISTRIBUTOR_INFO                                      \
+  {                                                                    \
+    PLAT_GICD_BASE,                  /* UINT64  PhysicalBaseAddress */ \
+    0,                               /* UINT32  SystemVectorBase */    \
+    PLAT_GIC_VERSION                 /* UINT8   GicVersion */          \
+  }                                                                    \
+
+#define PLAT_GIC_REDISTRIBUTOR_INFO                                    \
+  {                                                                    \
+  }                                                                    \
+
+#define PLAT_GIC_ITS_INFO                                              \
+  {                                                                    \
+  }                                                                    \
+
+#define PLAT_MCFG_INFO                \
+  {                                   \
+    {                                 \
+      PLAT_PCI_SEG1_CONFIG_BASE,      \
+      PLAT_PCI_SEG1,                  \
+      PLAT_PCI_SEG_BUSNUM_MIN,        \
+      PLAT_PCI_SEG_BUSNUM_MAX,        \
+    },                                \
+    {                                 \
+      PLAT_PCI_SEG2_CONFIG_BASE,      \
+      PLAT_PCI_SEG2,                  \
+      PLAT_PCI_SEG_BUSNUM_MIN,        \
+      PLAT_PCI_SEG_BUSNUM_MAX,        \
+    }                                 \
+  }                                   \
+
+#define PLAT_SPCR_INFO                                                            \
+  {                                                                               \
+    UART0_BASE,                                                                   \
+    UART0_IT,                                                                     \
+    115200,                                                                       \
+    0,                                                                            \
+    EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550           \
+  }                                                                               \
+
+#endif // LS1046AFRWY_PLATFORM_H
diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
index 67cf15cbe4..20111e6037 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
@@ -3,6 +3,7 @@
 #  LS1046AFRWY Board package.
 #
 #  Copyright 2019-2020 NXP
+#  Copyright 2021 Puresoftware Ltd
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -22,10 +23,18 @@
   OUTPUT_DIRECTORY               = Build/LS1046aFrwyPkg
   FLASH_DEFINITION               = Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
 
+  # This flag controls the dynamic acpi generation
+  #
+  DEFINE DYNAMIC_ACPI_ENABLE     = TRUE
+
 !include Silicon/NXP/NxpQoriqLs.dsc.inc
 !include MdePkg/MdeLibs.dsc.inc
 !include Silicon/NXP/LS1046A/LS1046A.dsc.inc
 
+!if $(DYNAMIC_ACPI_ENABLE) == TRUE
+  !include DynamicTablesPkg/DynamicTables.dsc.inc
+!endif
+
 [LibraryClasses.common]
   ArmPlatformLib|Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf
   RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf
@@ -46,4 +55,23 @@
 
   Silicon/NXP/Drivers/UsbHcdInitDxe/UsbHcd.inf
 
+  #
+  # Dynamic Table Factory
+  !if $(DYNAMIC_ACPI_ENABLE) == TRUE
+    DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
+      <LibraryClasses>
+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
+    }
+  !endif
+
+  #
+  # Acpi Support
+  #
+  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
+  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+
 ##
diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
index 34c4e5a025..f3cac033bc 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
@@ -3,6 +3,7 @@
 #  FLASH layout file for LS1046a board.
 #
 #  Copyright 2019-2020 NXP
+#  Copyright 2021 Puresoftware Ltd
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -99,6 +100,18 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Metronome/Metronome.inf
   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
+
+  #
+  # Acpi Support
+  #
+  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
+  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+
+  !if $(DYNAMIC_ACPI_ENABLE) == TRUE
+    INF Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+    !include DynamicTablesPkg/DynamicTables.fdf.inc
+  !endif
+
   #
   # Multiple Console IO support
   #
diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc.inc b/Silicon/NXP/LS1046A/LS1046A.dsc.inc
index 7004533ed5..caebb321d0 100644
--- a/Silicon/NXP/LS1046A/LS1046A.dsc.inc
+++ b/Silicon/NXP/LS1046A/LS1046A.dsc.inc
@@ -2,6 +2,7 @@
 #  LS1046A Soc package.
 #
 #  Copyright 2017-2020 NXP
+#  Copyright 2021-2021 Puresoftware Ltd
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -48,4 +49,14 @@
 [Components.common]
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
 
+#
+# Configuration Manager
+!if $(DYNAMIC_ACPI_ENABLE) == TRUE
+  Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf {
+    <BuildOptions>
+      *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Platform/NXP/LS1046aFrwyPkg/Include
+      *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Silicon/NXP/Chassis2/Include
+  }
+!endif
+
 ##
-- 
2.25.1


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

* [PATCH V2 4/4] Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator
  2021-06-18 15:27 [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY Vikas Singh
                   ` (2 preceding siblings ...)
  2021-06-18 15:27 ` [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY Vikas Singh
@ 2021-06-18 15:27 ` Vikas Singh
  2021-07-12 10:33 ` [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY Sunny Wang
  4 siblings, 0 replies; 15+ messages in thread
From: Vikas Singh @ 2021-06-18 15:27 UTC (permalink / raw)
  To: devel
  Cc: sami.mujawar, leif, meenakshi.aggarwal, samer.el-haj-mahmoud,
	v.sethi, arokia.samy, kuldip.dwivedi, ard.biesheuvel, vikas.singh,
	Sunny.Wang

This patch adds platform specific DSDT generator
and Clk dsdt properties for LS1046AFRWY platform.

Reviewed-by: Leif Lindholm <leif@nuviainc.com>

Signed-off-by: Vikas Singh <vikas.singh@puresoftware.com>
---
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl                           |  60 +++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl                          |  15 +++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf                |  39 ++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c | 138 ++++++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h                      |  23 ++++
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h                                       |   6 +-
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc                                       |   1 +
 7 files changed, 281 insertions(+), 1 deletion(-)

diff --git a/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl
new file mode 100644
index 0000000000..58541c3019
--- /dev/null
+++ b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl
@@ -0,0 +1,60 @@
+/** @file
+*  DSDT : Dynamic Clock ACPI Information
+*
+*  Copyright 2021 NXP
+*  Copyright 2021 Puresoftware Ltd.
+*
+*  SPDX-License-Identifier: BSD-2-Clause-Patent
+*
+**/
+
+Scope(_SB)
+{
+  Device(PCLK) {
+    Name(_HID, "NXP0017")
+    Name(CLK, 0)  // Maximum Platform Clock (Hz)
+    Name(CCLK, 0) // Maximum CPU Core Clock (MHz)
+    Name(AVBL, 0)
+    OperationRegion(RCWS, SystemMemory, DCFG_BASE, DCFG_LEN)
+    Method(_REG,2) {
+      if (Arg0 == "RCWS") {
+        Store(Arg1, AVBL)
+      }
+    }
+    Field (RCWS, ByteAcc, NoLock, Preserve) {
+      /* The below table provides the func of diff bits in 512 bits RCW data:
+         SYS_PLL_CFG : 0-1 bits
+         SYS_PLL_RAT : 2-6 bits
+         SYSCLK_FREQ : 472-481 bits etc.
+         Refer LS1046ARM for more info.
+         For LS1046 RCWSRs are read as RCW[0:31] .
+      */
+      offset(0x100),
+      RESV, 1,
+      PRAT, 5,
+      PCFG, 2,
+      offset(0x103),
+      CPRT, 6,  // Cluster Group PLL Multiplier ratio
+      offset(0x13B),
+      HFRQ, 8,  // Higher 8 bits of SYSCLK_FREQ
+      RESX, 6,
+      LFRQ, 2   // Lower bits of SYSCLK_FREQ
+    }
+
+    Method(_INI, 0, NotSerialized) {
+      /* Calculating Platform Clock */
+      Local0 = (HFRQ<<2 | LFRQ) // Concatinating LFRQ at end of HFRQ
+      Multiply(Local0, 500000, Local0)
+      Multiply(Local0, PRAT, Local0)
+      Divide(Local0, 3, , Local0)
+      Store(Local0, CLK)
+
+      /* Calculating Maximum Core Clock */
+      Local0 = (HFRQ<<2 | LFRQ) // Concatinating LFRQ at end of HFRQ
+      Multiply(Local0, 500000, Local0)
+      Divide(Local0, 3, , Local0)
+      Divide(Local0, 1000000, , Local0) //Just the MHz part of SYSCLK.
+      Multiply(Local0, CPRT, CCLK) // PLL_Ratio * SYSCLK, Max freq of cluster
+    }
+  } // end of device PCLK
+}
diff --git a/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl
new file mode 100644
index 0000000000..19f3f1c0e8
--- /dev/null
+++ b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl
@@ -0,0 +1,15 @@
+/** @file
+  Differentiated System Description Table Fields (DSDT)
+
+  Copyright 2021 NXP
+  Copyright 2021 Puresoftware Ltd.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "Platform.h"
+
+DefinitionBlock("DsdtTable.aml", "DSDT", 2, "NXP  ", "LS1046  ", EFI_ACPI_ARM_OEM_REVISION) {
+  include ("Clk.asl")
+}
diff --git a/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf
new file mode 100644
index 0000000000..ed5f9dd442
--- /dev/null
+++ b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf
@@ -0,0 +1,39 @@
+## @file
+#  Raw Table Generator
+#
+#  Copyright 2021 NXP
+#  Copyright 2021 Puresoftware Ltd
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+  INF_VERSION    = 0x00010019
+  BASE_NAME      = PlatformAcpiDsdtLib
+  FILE_GUID      = A97F70AC-3BB4-4596-B4D2-9F948EC12D17
+  VERSION_STRING = 1.0
+  MODULE_TYPE    = DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR    = AcpiDsdtLibConstructor
+  DESTRUCTOR     = AcpiDsdtLibDestructor
+
+[Sources]
+  PlatformAcpiDsdtLib/RawDsdtGenerator.c
+  Dsdt/Dsdt.asl
+
+[Packages]
+  DynamicTablesPkg/DynamicTablesPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dec
+  Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
diff --git a/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c
new file mode 100644
index 0000000000..7d886396ca
--- /dev/null
+++ b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c
@@ -0,0 +1,138 @@
+/** @file
+  Raw DSDT Table Generator
+
+  Copyright 2021 NXP
+  Copyright 2021 Puresoftware Ltd.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/AcpiLib.h>
+#include <Library/DebugLib.h>
+#include <Protocol/AcpiTable.h>
+
+// Module specific include files.
+#include <AcpiTableGenerator.h>
+#include <ConfigurationManagerObject.h>
+#include <ConfigurationManagerHelper.h>
+#include <Library/TableHelperLib.h>
+#include <Protocol/ConfigurationManagerProtocol.h>
+
+#include "PlatformAcpiLib.h"
+
+/** Construct the ACPI table using the ACPI table data provided.
+  This function invokes the Configuration Manager protocol interface
+  to get the required hardware information for generating the ACPI
+  table.
+  If this function allocates any resources then they must be freed
+  in the FreeXXXXTableResources function.
+  @param [in]  This           Pointer to the table generator.
+  @param [in]  AcpiTableInfo  Pointer to the ACPI Table Info.
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
+                              Protocol Interface.
+  @param [out] Table          Pointer to the constructed ACPI Table.
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+BuildRawDsdtTable (
+  IN  CONST ACPI_TABLE_GENERATOR                  * CONST This,
+  IN  CONST CM_STD_OBJ_ACPI_TABLE_INFO            * CONST AcpiTableInfo,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
+  OUT       EFI_ACPI_DESCRIPTION_HEADER          ** CONST Table
+  )
+{
+  ASSERT (This != NULL);
+  ASSERT (AcpiTableInfo != NULL);
+  ASSERT (CfgMgrProtocol != NULL);
+  ASSERT (Table != NULL);
+  ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
+
+  if (AcpiTableInfo->AcpiTableData == NULL) {
+    // Add the dsdt aml code here.
+    *Table = (EFI_ACPI_DESCRIPTION_HEADER *)&dsdt_aml_code;
+  }
+
+  return EFI_SUCCESS;
+}
+
+/** This macro defines the Raw Generator revision.
+*/
+#define DSDT_GENERATOR_REVISION CREATE_REVISION (1, 0)
+
+/** The interface for the Raw Table Generator.
+*/
+STATIC
+CONST
+ACPI_TABLE_GENERATOR RawDsdtGenerator = {
+  // Generator ID
+  CREATE_OEM_ACPI_TABLE_GEN_ID (PlatAcpiTableIdDsdt),
+  // Generator Description
+  L"ACPI.OEM.RAW.DSDT.GENERATOR",
+  // ACPI Table Signature - Unused
+  0,
+  // ACPI Table Revision - Unused
+  0,
+  // Minimum ACPI Table Revision - Unused
+  0,
+  // Creator ID
+  TABLE_GENERATOR_CREATOR_ID_ARM,
+  // Creator Revision
+  DSDT_GENERATOR_REVISION,
+  // Build Table function
+  BuildRawDsdtTable,
+  // No additional resources are allocated by the generator.
+  // Hence the Free Resource function is not required.
+  NULL,
+  // Extended build function not needed
+  NULL,
+  // Extended build function not implemented by the generator.
+  // Hence extended free resource function is not required.
+  NULL
+};
+
+/** Register the Generator with the ACPI Table Factory.
+  @param [in]  ImageHandle  The handle to the image.
+  @param [in]  SystemTable  Pointer to the System Table.
+  @retval EFI_SUCCESS           The Generator is registered.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_ALREADY_STARTED   The Generator for the Table ID
+                                is already registered.
+**/
+EFI_STATUS
+EFIAPI
+AcpiDsdtLibConstructor (
+  IN CONST EFI_HANDLE                ImageHandle,
+  IN       EFI_SYSTEM_TABLE  * CONST SystemTable
+  )
+{
+  EFI_STATUS  Status;
+  Status = RegisterAcpiTableGenerator (&RawDsdtGenerator);
+  DEBUG ((DEBUG_INFO, "OEM: Register DSDT Generator. Status = %r\n", Status));
+  ASSERT_EFI_ERROR (Status);
+  return Status;
+}
+
+/** Deregister the Generator from the ACPI Table Factory.
+  @param [in]  ImageHandle  The handle to the image.
+  @param [in]  SystemTable  Pointer to the System Table.
+  @retval EFI_SUCCESS           The Generator is deregistered.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND         The Generator is not registered.
+**/
+EFI_STATUS
+EFIAPI
+AcpiDsdtLibDestructor (
+  IN CONST EFI_HANDLE                ImageHandle,
+  IN       EFI_SYSTEM_TABLE  * CONST SystemTable
+  )
+{
+  EFI_STATUS  Status;
+  Status = DeregisterAcpiTableGenerator (&RawDsdtGenerator);
+  DEBUG ((DEBUG_INFO, "OEM: Deregister DSDT Generator. Status = %r\n", Status));
+  ASSERT_EFI_ERROR (Status);
+  return Status;
+}
diff --git a/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h
new file mode 100644
index 0000000000..e5f907a7d4
--- /dev/null
+++ b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h
@@ -0,0 +1,23 @@
+/** @file
+ *  Acpi lib headers
+ *
+ *  Copyright 2021 NXP
+ *  Copyright 2021 Puresoftware Ltd
+ *
+ *  SPDX-License-Identifier: BSD-2-Clause-Patent
+ *
+**/
+
+
+#ifndef LS1046AFRWY_PLATFORM_ACPI_LIB_H
+#define LS1046AFRWY_PLATFORM_ACPI_LIB_H
+
+#include <PlatformAcpiTableGenerator.h>
+
+/** C array containing the compiled AML template.
+    These symbols are defined in the auto generated C file
+    containing the AML bytecode array.
+*/
+extern CHAR8  dsdt_aml_code[];
+
+#endif
diff --git a/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
index 3c68d65cd3..0483bf2dc8 100644
--- a/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
+++ b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
@@ -17,6 +17,10 @@
 // Soc defines
 #define PLAT_SOC_NAME                "LS1046AFRWY"
 
+// PCLK : Dynamic Clock
+#define DCFG_BASE                    0x1EE0000  /* Device configuration data Base Address */
+#define DCFG_LEN                     0xFFF      /* Device configuration data length */
+
 // Gic
 #define GIC_VERSION                  2
 #define GICD_BASE                    0x1410000
@@ -59,7 +63,7 @@
 #define CFG_MGR_TABLE_ID  SIGNATURE_64 ('L','S','1','0','4','6',' ',' ')
 
 // Specify the OEM defined tables
-#define OEM_ACPI_TABLES             0
+#define OEM_ACPI_TABLES             1 // Added DSDT
 
 #define PLAT_PCI_SEG0               LS1046A_PCI_SEG0
 #define PLAT_PCI_SEG1_CONFIG_BASE   LS1046A_PCI_SEG1_CONFIG_BASE
diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
index 20111e6037..7041d15da5 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
@@ -65,6 +65,7 @@
         NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
         NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
         NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
+        NULL|Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf
     }
   !endif
 
-- 
2.25.1


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

* Re: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY
  2021-06-18 15:27 [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY Vikas Singh
                   ` (3 preceding siblings ...)
  2021-06-18 15:27 ` [PATCH V2 4/4] Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator Vikas Singh
@ 2021-07-12 10:33 ` Sunny Wang
  2021-07-26 13:04   ` Vikas Singh
  4 siblings, 1 reply; 15+ messages in thread
From: Sunny Wang @ 2021-07-12 10:33 UTC (permalink / raw)
  To: Vikas Singh, devel@edk2.groups.io,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	leif@nuviainc.com
  Cc: Sami Mujawar, leif@nuviainc.com, Samer El-Haj-Mahmoud,
	V Sethi (v.sethi@nxp.com), arokia.samy,
	kuldip.dwivedi@puresoftware.com, Ard Biesheuvel,
	vikas.singh@nxp.com, White Weng, Ran Wang, Sunny Wang, Joe Byrne

Hi Vikas,

Thanks for working on this.

As our offline discussion with NXP, our goal is to make the Tiano edk2-platform and NXP LSDK opensource https://source.codeaurora.org/external/qoriq/qoriq-components/edk2-platforms in sync. Now the main problem is that some folders' names and locations have been changed to be different from NXP LSDK opensource in previous commits, which causes difficulty in doing synchronization between Tiano edk2-platform and NXP LSDK opensource and also causes LSDK user's confusion.  I'm fine with keeping some changes that are needed for cleanup purposes or fixing build issues. However, I think we can still avoid some folder-renaming or folder-moving changes. For avoiding them, could you check my questions/comments below?

1. Why do we need to have ConfigurationManagerPkg.dec? Can we remove this? After removing it, we can rename the ConfigurationManagerPkg folder back to ConfigurationManager to be consistent with other platforms (JunoPkg).
2. Can we move \Platform\NXP\LX2160aRdbPkg\Include\Platform.h to the same location as LSDK (\Platform\NXP\LX2160aRdbPkg\AcpiTables\)?
3. Can we move \Platform\NXP\LS1046aFrwyPkg\Include\Platform.h t h to the same location as LSDK (\Platform\NXP\ LS1046aFrwyPkg\AcpiTables\)?
4. Can we add \Silicon\NXP\LS1046A\Library\SocFixupLib\ for patch 2/4 (adding SocGetSvr() function)? Furthermore, can we just add the whole Silicon\NXP\LS1046A\Library\SocFixupLib\ from NXP LSDK?

Add few more NXP guys.



Hi Leif and Meenakshi,

Can we just push the latest LSDK to the Tiano edk2-platform in one patch set? Then, If there is anything that needs to be cleaned up like the Coding style issue, we can create an issue in Bugzilla for it. What do you guys think?


Best Regards,
Sunny Wang

-----Original Message-----
From: Vikas Singh <vikas.singh@puresoftware.com>
Sent: Friday, June 18, 2021 11:28 PM
To: devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; arokia.samy <arokia.samy@puresoftware.com>; kuldip.dwivedi@puresoftware.com; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; Sunny Wang <Sunny.Wang@arm.com>
Subject: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY

This patch series basically aims to extend the Dynamic ACPI
framework towards NXP's LS1046AFRWY platform.

In continuation to https://edk2.groups.io/g/devel/message/71709

The change set in the series is in below order -

(1)Introducing a new platform specific macro "PLAT_SOC_NAME"
This macro will be consumed by Configuration Manager(CM).
Platforms who extends CM services for themselves must notify
their SoC details to CM using this macro only.
Additionally also update the lx2160ardb platform header with
PLAT_SOC_NAME, this will be consumed by CM.

(2)Introduced a function to get SoC's System Version Register(SVR)
This function will fetch SVR details for LS1046A SoC based platforms.
In current patch series, this function will be used by LS1046aFrwyPkg.

(3)Extending Configuration Manager (CM) and its services to leverage
the Dynamic ACPI support for NXP's LS1046aFrwy platform.

(4)Introduced an OEM specific firmware acpi table generator
Also add Dsdt.asl as a place holder having only platform's clock
related dsdt properties for now and will accommodate other IP specific
dsdt tables(acpi properties) for LS1046AFRWY in future patch series.

Vikas Singh (4):
  Platform/NXP: Make SoC version log in ConfigurationManager generic
  Silicon/NXP: Add support of SVR handling for LS1046A SoC
  NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY
  Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator

 Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c  |  11 +-
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl                           |  60 ++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl                          |  15 ++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf                |  39 +++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c | 138 +++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h                      |  23 +++
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h                                       | 156 ++++++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc                                       |  29 ++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf                                       |  13 ++
 Platform/NXP/LX2160aRdbPkg/Include/Platform.h                                        |   8 +-
 Silicon/NXP/LS1046A/LS1046A.dsc.inc                                                  |  11 ++
 Silicon/NXP/LS1046A/Library/SocLib/SocLib.c                                          |  16 ++
 Silicon/NXP/LX2160A/LX2160A.dsc.inc                                                  |   3 +-
 13 files changed, 508 insertions(+), 14 deletions(-)
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h

--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH V2 1/4] Platform/NXP: Make SoC version log in ConfigurationManager generic
  2021-06-18 15:27 ` [PATCH V2 1/4] Platform/NXP: Make SoC version log in ConfigurationManager generic Vikas Singh
@ 2021-07-12 10:36   ` Sunny Wang
  0 siblings, 0 replies; 15+ messages in thread
From: Sunny Wang @ 2021-07-12 10:36 UTC (permalink / raw)
  To: Vikas Singh, devel@edk2.groups.io
  Cc: Sami Mujawar, leif@nuviainc.com,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	Samer El-Haj-Mahmoud, V Sethi (v.sethi@nxp.com), arokia.samy,
	kuldip.dwivedi@puresoftware.com, Ard Biesheuvel,
	vikas.singh@nxp.com, Sunny Wang, White Weng, Ran Wang

Looks good.
Just have some comments mentioned Patch 0/4 about moving/renaming file/folder for synchronizing with NXP LSDK opensource https://source.codeaurora.org/external/qoriq/qoriq-components/edk2-platforms.

Best Regards,
Sunny Wang

-----Original Message-----
From: Vikas Singh <vikas.singh@puresoftware.com>
Sent: Friday, June 18, 2021 11:28 PM
To: devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; arokia.samy <arokia.samy@puresoftware.com>; kuldip.dwivedi@puresoftware.com; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; Sunny Wang <Sunny.Wang@arm.com>
Subject: [PATCH V2 1/4] Platform/NXP: Make SoC version log in ConfigurationManager generic

This patch replaces the logic in ConfigurationManager to print platform
name based on platform ID with a simple #define PLAT_SOC_NAME defined in
platform headers.
This also removes duplication of the SVR_LX2160A, SVR_SOC_VER, SVR_MAJOR
and SVR_MINOR macro definitions  between SoC headers and platform headers.

Signed-off-by: Vikas Singh <vikas.singh@puresoftware.com>
---
 Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c | 11 ++++-------
 Platform/NXP/LX2160aRdbPkg/Include/Platform.h                                       |  8 ++------
 Silicon/NXP/LX2160A/LX2160A.dsc.inc                                                 |  3 ++-
 3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c
index 80ce8412c4..39376d900b 100644
--- a/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c
+++ b/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c
@@ -2,7 +2,7 @@
   Configuration Manager Dxe



   Copyright 2020 NXP

-  Copyright 2020 Puresoftware Ltd

+  Copyright 2020-2021 Puresoftware Ltd



   SPDX-License-Identifier: BSD-2-Clause-Patent



@@ -25,6 +25,7 @@
 */

 #include "ConfigurationManager.h"

 #include <Library/SocLib.h>

+#include <Chassis.h>



 /** The platform configuration repository information.

 */

@@ -170,12 +171,8 @@ InitializePlatformRepository (
   PlatformRepo = This->PlatRepoInfo;



   Svr = SocGetSvr ();

-  if (SVR_SOC_VER(Svr) == SVR_LX2160A) {

-    PlatformRepo->FslBoardRevision = SVR_MAJOR(Svr);

-    DEBUG ((DEBUG_INFO, "Fsl : SoC LX2160A Rev = 0x%x\n", PlatformRepo->FslBoardRevision));

-  } else {

-    DEBUG ((DEBUG_INFO, "Fsl : SoC Unknown Rev = 0x%x\n", PlatformRepo->FslBoardRevision));

-  }

+  PlatformRepo->FslBoardRevision = SVR_MAJOR(Svr);

+  DEBUG ((DEBUG_INFO, "Fsl : SoC = %s Rev = 0x%x\n", PLAT_SOC_NAME, PlatformRepo->FslBoardRevision));



   return EFI_SUCCESS;

 }

diff --git a/Platform/NXP/LX2160aRdbPkg/Include/Platform.h b/Platform/NXP/LX2160aRdbPkg/Include/Platform.h
index 76a41d4369..f2e831f033 100644
--- a/Platform/NXP/LX2160aRdbPkg/Include/Platform.h
+++ b/Platform/NXP/LX2160aRdbPkg/Include/Platform.h
@@ -2,7 +2,7 @@
  *  Platform headers

  *

  *  Copyright 2020 NXP

- *  Copyright 2020 Puresoftware Ltd

+ *  Copyright 2020-2021 Puresoftware Ltd

  *

  *  SPDX-License-Identifier: BSD-2-Clause-Patent

  *

@@ -15,11 +15,7 @@
 #define EFI_ACPI_ARM_OEM_REVISION       0x00000000



 // Soc defines

-#define SVR_SOC_VER(svr)        (((svr) >> 8) & 0xFFFFFE)

-#define SVR_MAJOR(svr)          (((svr) >> 4) & 0xf)

-#define SVR_MINOR(svr)          (((svr) >> 0) & 0xf)

-

-#define SVR_LX2160A             0x873600

+#define PLAT_SOC_NAME           "LX2160ARDB"



 // PCLK

 #define DCFG_BASE   0x1E00000

diff --git a/Silicon/NXP/LX2160A/LX2160A.dsc.inc b/Silicon/NXP/LX2160A/LX2160A.dsc.inc
index ea7e54fa89..15a06bea1f 100644
--- a/Silicon/NXP/LX2160A/LX2160A.dsc.inc
+++ b/Silicon/NXP/LX2160A/LX2160A.dsc.inc
@@ -2,7 +2,7 @@
 #  LX2160A Soc package.

 #

 #  Copyright 2018-2020 NXP

-#  Copyright 2020 Puresoftware Ltd

+#  Copyright 2020-2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -70,6 +70,7 @@
   Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf {

     <BuildOptions>

       *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Platform/NXP/LX2160aRdbPkg/Include

+      *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Silicon/NXP/Chassis3V2/Include

   }

 !endif



--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH V2 2/4] Silicon/NXP: Add support of SVR handling for LS1046A SoC
  2021-06-18 15:27 ` [PATCH V2 2/4] Silicon/NXP: Add support of SVR handling for LS1046A SoC Vikas Singh
@ 2021-07-12 10:36   ` Sunny Wang
  0 siblings, 0 replies; 15+ messages in thread
From: Sunny Wang @ 2021-07-12 10:36 UTC (permalink / raw)
  To: Vikas Singh, devel@edk2.groups.io
  Cc: Sami Mujawar, leif@nuviainc.com,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	Samer El-Haj-Mahmoud, V Sethi (v.sethi@nxp.com), arokia.samy,
	kuldip.dwivedi@puresoftware.com, Ard Biesheuvel,
	vikas.singh@nxp.com, Sunny Wang, White Weng, Ran Wang

Looks good.
Just have some comments mentioned Patch 0/4 about moving/renaming file/folder for synchronizing with NXP LSDK opensource https://source.codeaurora.org/external/qoriq/qoriq-components/edk2-platforms.

Best Regards,
Sunny Wang

-----Original Message-----
From: Vikas Singh <vikas.singh@puresoftware.com>
Sent: Friday, June 18, 2021 11:28 PM
To: devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; arokia.samy <arokia.samy@puresoftware.com>; kuldip.dwivedi@puresoftware.com; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; Sunny Wang <Sunny.Wang@arm.com>
Subject: [PATCH V2 2/4] Silicon/NXP: Add support of SVR handling for LS1046A SoC

This patch adds a generic method to get Silicon Version Register (SVR)
on LS1046A SoC. This method will be generic for all platfroms based
on LS1046A SoC, like - LS1046AFRWY, LS1046ARDB.

Signed-off-by: Vikas Singh <vikas.singh@puresoftware.com>
---
 Silicon/NXP/LS1046A/Library/SocLib/SocLib.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c
index 8fa6a7dd00..003f5bd82f 100644
--- a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c
+++ b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c
@@ -2,6 +2,7 @@
   SoC specific Library containg functions to initialize various SoC components



   Copyright 2017-2020 NXP

+  Copyright 2021 Puresoftware Ltd



   SPDX-License-Identifier: BSD-2-Clause-Patent



@@ -64,6 +65,21 @@ SocGetClock (
   return ReturnValue;

 }



+/**

+  Function to get SoC's System Version Register(SVR)

+ **/

+UINT32

+SocGetSvr (

+  VOID

+  )

+{

+  LS1046A_DEVICE_CONFIG  *Dcfg;

+

+  Dcfg = (LS1046A_DEVICE_CONFIG  *)LS1046A_DCFG_ADDRESS;

+

+  return DcfgRead32 ((UINTN)&Dcfg->Svr);

+}

+

 /**

    Function to select pins depending upon pcd using supplemental

    configuration unit(SCFG) extended RCW controlled pinmux control

--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY
  2021-06-18 15:27 ` [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY Vikas Singh
@ 2021-07-12 10:37   ` Sunny Wang
  2021-07-23  4:45     ` [EXT] " Vikas Singh
  2021-07-26 13:08     ` Vikas Singh
  0 siblings, 2 replies; 15+ messages in thread
From: Sunny Wang @ 2021-07-12 10:37 UTC (permalink / raw)
  To: Vikas Singh, devel@edk2.groups.io
  Cc: Sami Mujawar, leif@nuviainc.com,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	Samer El-Haj-Mahmoud, V Sethi (v.sethi@nxp.com), arokia.samy,
	kuldip.dwivedi@puresoftware.com, Ard Biesheuvel,
	vikas.singh@nxp.com, White Weng, Ran Wang, Sunny Wang

Hi Vikas,

Just have two comments below. Others look good to me.
1. In LS1046aFrwyPkg.dsc, since you already include DynamicTablesPkg/DynamicTables.dsc.inc, I think we need to remove DynamicTableFactoryDxe.inf code block. Could you check this?
2. Remove " DEFINE DYNAMIC_ACPI_ENABLE = TRUE ". In our offline discussion, this would cause some build problems with the current CM implementation (Multiple NXP platforms share One CM folder).

Best Regards,
Sunny Wang

-----Original Message-----
From: Vikas Singh <vikas.singh@puresoftware.com>
Sent: Friday, June 18, 2021 11:28 PM
To: devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; arokia.samy <arokia.samy@puresoftware.com>; kuldip.dwivedi@puresoftware.com; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; Sunny Wang <Sunny.Wang@arm.com>
Subject: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY

This patch enables the use of ConfigurationManager (CM) and
its services to leverage the Dynamic ACPI support for NXP's
LS1046aFrwy platform.

Signed-off-by: Vikas Singh <vikas.singh@puresoftware.com>
---
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h | 152 ++++++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc |  28 ++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf |  13 ++
 Silicon/NXP/LS1046A/LS1046A.dsc.inc            |  11 ++
 4 files changed, 204 insertions(+)

diff --git a/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
new file mode 100644
index 0000000000..3c68d65cd3
--- /dev/null
+++ b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
@@ -0,0 +1,152 @@
+/** @file

+ *  Platform headers

+ *

+ *  Copyright 2021 NXP

+ *  Copyright 2021 Puresoftware Ltd

+ *

+ *  SPDX-License-Identifier: BSD-2-Clause-Patent

+ *

+**/

+

+

+#ifndef LS1046AFRWY_PLATFORM_H

+#define LS1046AFRWY_PLATFORM_H

+

+#define EFI_ACPI_ARM_OEM_REVISION    0x00000000

+

+// Soc defines

+#define PLAT_SOC_NAME                "LS1046AFRWY"

+

+// Gic

+#define GIC_VERSION                  2

+#define GICD_BASE                    0x1410000

+#define GICC_BASE                    0x142f000

+#define GICH_BASE                    0x1440000

+#define GICV_BASE                    0x1460000

+

+// UART

+#define UART0_BASE                   0x21C0500

+#define UART0_IT                     86

+#define UART0_LENGTH                 0x100

+#define SPCR_FLOW_CONTROL_NONE       0

+

+// Timer

+#define TIMER_BLOCK_COUNT            1

+#define TIMER_FRAME_COUNT            4

+#define TIMER_WATCHDOG_COUNT         1

+#define TIMER_BASE_ADDRESS           0x23E0000 // a.k.a CNTControlBase

+#define TIMER_READ_BASE_ADDRESS      0x23F0000 // a.k.a CNTReadBase

+#define TIMER_SEC_IT                 29

+#define TIMER_NON_SEC_IT             30

+#define TIMER_VIRT_IT                27

+#define TIMER_HYP_IT                 26

+#define TIMER_FRAME0_IT              78

+#define TIMER_FRAME1_IT              79

+#define TIMER_FRAME2_IT              92

+

+// Mcfg

+#define LS1046A_PCI_SEG0_CONFIG_BASE 0x4000000000

+#define LS1046A_PCI_SEG0             0x0

+#define LS1046A_PCI_SEG_BUSNUM_MIN   0x0

+#define LS1046A_PCI_SEG_BUSNUM_MAX   0xff

+#define LS1046A_PCI_SEG1_CONFIG_BASE 0x4800000000

+#define LS1046A_PCI_SEG2_CONFIG_BASE 0x5000000000

+#define LS1046A_PCI_SEG1             0x1

+#define LS1046A_PCI_SEG2             0x2

+

+// Platform specific info needed by Configuration Manager

+

+#define CFG_MGR_TABLE_ID  SIGNATURE_64 ('L','S','1','0','4','6',' ',' ')

+

+// Specify the OEM defined tables

+#define OEM_ACPI_TABLES             0

+

+#define PLAT_PCI_SEG0               LS1046A_PCI_SEG0

+#define PLAT_PCI_SEG1_CONFIG_BASE   LS1046A_PCI_SEG1_CONFIG_BASE

+#define PLAT_PCI_SEG1               LS1046A_PCI_SEG1

+#define PLAT_PCI_SEG_BUSNUM_MIN     LS1046A_PCI_SEG_BUSNUM_MIN

+#define PLAT_PCI_SEG_BUSNUM_MAX     LS1046A_PCI_SEG_BUSNUM_MAX

+#define PLAT_PCI_SEG2_CONFIG_BASE   LS1046A_PCI_SEG2_CONFIG_BASE

+#define PLAT_PCI_SEG2               LS1046A_PCI_SEG2

+

+#define PLAT_GIC_VERSION            GIC_VERSION

+#define PLAT_GICD_BASE              GICD_BASE

+#define PLAT_GICI_BASE              GICI_BASE

+#define PLAT_GICR_BASE              GICR_BASE

+#define PLAT_GICR_LEN               GICR_LEN

+#define PLAT_GICC_BASE              GICC_BASE

+#define PLAT_GICH_BASE              GICH_BASE

+#define PLAT_GICV_BASE              GICV_BASE

+

+#define PLAT_CPU_COUNT              4

+#define PLAT_GTBLOCK_COUNT          0

+#define PLAT_GTFRAME_COUNT          0

+#define PLAT_PCI_CONFG_COUNT        2

+

+#define PLAT_WATCHDOG_COUNT           0

+#define PLAT_GIC_REDISTRIBUTOR_COUNT  0

+#define PLAT_GIC_ITS_COUNT            0

+

+/* GIC CPU Interface information

+   GIC_ENTRY (CPUInterfaceNumber, Mpidr, PmuIrq, VGicIrq, EnergyEfficiency)

+ */

+#define PLAT_GIC_CPU_INTERFACE    {                          \

+             GICC_ENTRY (0,  GET_MPID (0, 0), 138, 0x19, 0), \

+             GICC_ENTRY (1,  GET_MPID (0, 1), 139, 0x19, 0), \

+             GICC_ENTRY (2,  GET_MPID (0, 2), 127, 0x19, 0), \

+             GICC_ENTRY (3,  GET_MPID (0, 3), 129, 0x19, 0), \

+}

+

+#define PLAT_WATCHDOG_INFO                    \

+  {                                           \

+  }                                           \

+

+#define PLAT_TIMER_BLOCK_INFO                 \

+  {                                           \

+  }                                           \

+

+#define PLAT_TIMER_FRAME_INFO                 \

+  {                                           \

+  }                                           \

+

+#define PLAT_GIC_DISTRIBUTOR_INFO                                      \

+  {                                                                    \

+    PLAT_GICD_BASE,                  /* UINT64  PhysicalBaseAddress */ \

+    0,                               /* UINT32  SystemVectorBase */    \

+    PLAT_GIC_VERSION                 /* UINT8   GicVersion */          \

+  }                                                                    \

+

+#define PLAT_GIC_REDISTRIBUTOR_INFO                                    \

+  {                                                                    \

+  }                                                                    \

+

+#define PLAT_GIC_ITS_INFO                                              \

+  {                                                                    \

+  }                                                                    \

+

+#define PLAT_MCFG_INFO                \

+  {                                   \

+    {                                 \

+      PLAT_PCI_SEG1_CONFIG_BASE,      \

+      PLAT_PCI_SEG1,                  \

+      PLAT_PCI_SEG_BUSNUM_MIN,        \

+      PLAT_PCI_SEG_BUSNUM_MAX,        \

+    },                                \

+    {                                 \

+      PLAT_PCI_SEG2_CONFIG_BASE,      \

+      PLAT_PCI_SEG2,                  \

+      PLAT_PCI_SEG_BUSNUM_MIN,        \

+      PLAT_PCI_SEG_BUSNUM_MAX,        \

+    }                                 \

+  }                                   \

+

+#define PLAT_SPCR_INFO                                                            \

+  {                                                                               \

+    UART0_BASE,                                                                   \

+    UART0_IT,                                                                     \

+    115200,                                                                       \

+    0,                                                                            \

+    EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550           \

+  }                                                                               \

+

+#endif // LS1046AFRWY_PLATFORM_H

diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
index 67cf15cbe4..20111e6037 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
@@ -3,6 +3,7 @@
 #  LS1046AFRWY Board package.

 #

 #  Copyright 2019-2020 NXP

+#  Copyright 2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -22,10 +23,18 @@
   OUTPUT_DIRECTORY               = Build/LS1046aFrwyPkg

   FLASH_DEFINITION               = Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf



+  # This flag controls the dynamic acpi generation

+  #

+  DEFINE DYNAMIC_ACPI_ENABLE     = TRUE

+

 !include Silicon/NXP/NxpQoriqLs.dsc.inc

 !include MdePkg/MdeLibs.dsc.inc

 !include Silicon/NXP/LS1046A/LS1046A.dsc.inc



+!if $(DYNAMIC_ACPI_ENABLE) == TRUE

+  !include DynamicTablesPkg/DynamicTables.dsc.inc

+!endif

+

 [LibraryClasses.common]

   ArmPlatformLib|Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf

   RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf

@@ -46,4 +55,23 @@


   Silicon/NXP/Drivers/UsbHcdInitDxe/UsbHcd.inf



+  #

+  # Dynamic Table Factory

+  !if $(DYNAMIC_ACPI_ENABLE) == TRUE

+    DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {

+      <LibraryClasses>

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf

+    }

+  !endif

+

+  #

+  # Acpi Support

+  #

+  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf

+  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf

+

 ##

diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
index 34c4e5a025..f3cac033bc 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
@@ -3,6 +3,7 @@
 #  FLASH layout file for LS1046a board.

 #

 #  Copyright 2019-2020 NXP

+#  Copyright 2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -99,6 +100,18 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Metronome/Metronome.inf

   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf



+

+  #

+  # Acpi Support

+  #

+  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf

+  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf

+

+  !if $(DYNAMIC_ACPI_ENABLE) == TRUE

+    INF Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf

+    !include DynamicTablesPkg/DynamicTables.fdf.inc

+  !endif

+

   #

   # Multiple Console IO support

   #

diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc.inc b/Silicon/NXP/LS1046A/LS1046A.dsc.inc
index 7004533ed5..caebb321d0 100644
--- a/Silicon/NXP/LS1046A/LS1046A.dsc.inc
+++ b/Silicon/NXP/LS1046A/LS1046A.dsc.inc
@@ -2,6 +2,7 @@
 #  LS1046A Soc package.

 #

 #  Copyright 2017-2020 NXP

+#  Copyright 2021-2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -48,4 +49,14 @@
 [Components.common]

   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf



+#

+# Configuration Manager

+!if $(DYNAMIC_ACPI_ENABLE) == TRUE

+  Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf {

+    <BuildOptions>

+      *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Platform/NXP/LS1046aFrwyPkg/Include

+      *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Silicon/NXP/Chassis2/Include

+  }

+!endif

+

 ##

--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [EXT] RE: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY
  2021-07-12 10:37   ` Sunny Wang
@ 2021-07-23  4:45     ` Vikas Singh
  2021-07-26 13:08     ` Vikas Singh
  1 sibling, 0 replies; 15+ messages in thread
From: Vikas Singh @ 2021-07-23  4:45 UTC (permalink / raw)
  To: Sunny.Wang@arm.com, devel@edk2.groups.io
  Cc: Sami Mujawar, leif@nuviainc.com, Meenakshi Aggarwal,
	Samer El-Haj-Mahmoud, Varun Sethi, arokia.samy, kuldip dwivedi,
	Ard Biesheuvel, White Weng, Ran Wang

Sunny, Thank you for reviewing my code. Here are my remarks. PSB

-----Original Message-----
From: Sunny Wang <Sunny.Wang@arm.com> 
Sent: Monday, July 12, 2021 4:08 PM
To: Vikas Singh <vikas.singh@puresoftware.com>; devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com; Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Varun Sethi <V.Sethi@nxp.com>; arokia.samy <arokia.samy@puresoftware.com>; kuldip dwivedi <kuldip.dwivedi@puresoftware.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; Vikas Singh <vikas.singh@nxp.com>; White Weng <white.weng@nxp.com>; Ran Wang <ran.wang_1@nxp.com>; Sunny Wang <Sunny.Wang@arm.com>
Subject: [EXT] RE: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY

Caution: EXT Email

Hi Vikas,

Just have two comments below. Others look good to me.
1. In LS1046aFrwyPkg.dsc, since you already include DynamicTablesPkg/DynamicTables.dsc.inc, I think we need to remove DynamicTableFactoryDxe.inf code block. Could you check this?
[[VIKAS]] No, DynamicTableFactoryDxe.inf code block Is required to override, or I would say to choose what we want for our platform from DynamicTablesPkg.
This block can expose different "inf" files for different platforms as per the need basis.
 
2. Remove " DEFINE DYNAMIC_ACPI_ENABLE = TRUE ". In our offline discussion, this would cause some build problems with the current CM implementation (Multiple NXP platforms share One CM folder).
[[VIKAS]] I don't think "DEFINE DYNAMIC_ACPI_ENABLE = TRUE" should cause any problem while building other platforms. In fact this flag is to avoid any build issue with other platforms. CM is common for all layer scape platforms but it will be only visible to any platform if and only if "DEFINE DYNAMIC_ACPI_ENABLE = TRUE". Else platform must be building in old native mode. Could you share any scenario or something that I have missed out, will check this implementation and try to rectify.

Best Regards,
Sunny Wang

-----Original Message-----
From: Vikas Singh <vikas.singh@puresoftware.com>
Sent: Friday, June 18, 2021 11:28 PM
To: devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; arokia.samy <arokia.samy@puresoftware.com>; kuldip.dwivedi@puresoftware.com; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; Sunny Wang <Sunny.Wang@arm.com>
Subject: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY

This patch enables the use of ConfigurationManager (CM) and its services to leverage the Dynamic ACPI support for NXP's LS1046aFrwy platform.

Signed-off-by: Vikas Singh <vikas.singh@puresoftware.com>
---
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h | 152 ++++++++++++++++++++  Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc |  28 ++++  Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf |  13 ++
 Silicon/NXP/LS1046A/LS1046A.dsc.inc            |  11 ++
 4 files changed, 204 insertions(+)

diff --git a/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
new file mode 100644
index 0000000000..3c68d65cd3
--- /dev/null
+++ b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
@@ -0,0 +1,152 @@
+/** @file

+ *  Platform headers

+ *

+ *  Copyright 2021 NXP

+ *  Copyright 2021 Puresoftware Ltd

+ *

+ *  SPDX-License-Identifier: BSD-2-Clause-Patent

+ *

+**/

+

+

+#ifndef LS1046AFRWY_PLATFORM_H

+#define LS1046AFRWY_PLATFORM_H

+

+#define EFI_ACPI_ARM_OEM_REVISION    0x00000000

+

+// Soc defines

+#define PLAT_SOC_NAME                "LS1046AFRWY"

+

+// Gic

+#define GIC_VERSION                  2

+#define GICD_BASE                    0x1410000

+#define GICC_BASE                    0x142f000

+#define GICH_BASE                    0x1440000

+#define GICV_BASE                    0x1460000

+

+// UART

+#define UART0_BASE                   0x21C0500

+#define UART0_IT                     86

+#define UART0_LENGTH                 0x100

+#define SPCR_FLOW_CONTROL_NONE       0

+

+// Timer

+#define TIMER_BLOCK_COUNT            1

+#define TIMER_FRAME_COUNT            4

+#define TIMER_WATCHDOG_COUNT         1

+#define TIMER_BASE_ADDRESS           0x23E0000 // a.k.a CNTControlBase

+#define TIMER_READ_BASE_ADDRESS      0x23F0000 // a.k.a CNTReadBase

+#define TIMER_SEC_IT                 29

+#define TIMER_NON_SEC_IT             30

+#define TIMER_VIRT_IT                27

+#define TIMER_HYP_IT                 26

+#define TIMER_FRAME0_IT              78

+#define TIMER_FRAME1_IT              79

+#define TIMER_FRAME2_IT              92

+

+// Mcfg

+#define LS1046A_PCI_SEG0_CONFIG_BASE 0x4000000000

+#define LS1046A_PCI_SEG0             0x0

+#define LS1046A_PCI_SEG_BUSNUM_MIN   0x0

+#define LS1046A_PCI_SEG_BUSNUM_MAX   0xff

+#define LS1046A_PCI_SEG1_CONFIG_BASE 0x4800000000

+#define LS1046A_PCI_SEG2_CONFIG_BASE 0x5000000000

+#define LS1046A_PCI_SEG1             0x1

+#define LS1046A_PCI_SEG2             0x2

+

+// Platform specific info needed by Configuration Manager

+

+#define CFG_MGR_TABLE_ID  SIGNATURE_64 ('L','S','1','0','4','6',' ',' 
+')

+

+// Specify the OEM defined tables

+#define OEM_ACPI_TABLES             0

+

+#define PLAT_PCI_SEG0               LS1046A_PCI_SEG0

+#define PLAT_PCI_SEG1_CONFIG_BASE   LS1046A_PCI_SEG1_CONFIG_BASE

+#define PLAT_PCI_SEG1               LS1046A_PCI_SEG1

+#define PLAT_PCI_SEG_BUSNUM_MIN     LS1046A_PCI_SEG_BUSNUM_MIN

+#define PLAT_PCI_SEG_BUSNUM_MAX     LS1046A_PCI_SEG_BUSNUM_MAX

+#define PLAT_PCI_SEG2_CONFIG_BASE   LS1046A_PCI_SEG2_CONFIG_BASE

+#define PLAT_PCI_SEG2               LS1046A_PCI_SEG2

+

+#define PLAT_GIC_VERSION            GIC_VERSION

+#define PLAT_GICD_BASE              GICD_BASE

+#define PLAT_GICI_BASE              GICI_BASE

+#define PLAT_GICR_BASE              GICR_BASE

+#define PLAT_GICR_LEN               GICR_LEN

+#define PLAT_GICC_BASE              GICC_BASE

+#define PLAT_GICH_BASE              GICH_BASE

+#define PLAT_GICV_BASE              GICV_BASE

+

+#define PLAT_CPU_COUNT              4

+#define PLAT_GTBLOCK_COUNT          0

+#define PLAT_GTFRAME_COUNT          0

+#define PLAT_PCI_CONFG_COUNT        2

+

+#define PLAT_WATCHDOG_COUNT           0

+#define PLAT_GIC_REDISTRIBUTOR_COUNT  0

+#define PLAT_GIC_ITS_COUNT            0

+

+/* GIC CPU Interface information

+   GIC_ENTRY (CPUInterfaceNumber, Mpidr, PmuIrq, VGicIrq, 
+ EnergyEfficiency)

+ */

+#define PLAT_GIC_CPU_INTERFACE    {                          \

+             GICC_ENTRY (0,  GET_MPID (0, 0), 138, 0x19, 0), \

+             GICC_ENTRY (1,  GET_MPID (0, 1), 139, 0x19, 0), \

+             GICC_ENTRY (2,  GET_MPID (0, 2), 127, 0x19, 0), \

+             GICC_ENTRY (3,  GET_MPID (0, 3), 129, 0x19, 0), \

+}

+

+#define PLAT_WATCHDOG_INFO                    \

+  {                                           \

+  }                                           \

+

+#define PLAT_TIMER_BLOCK_INFO                 \

+  {                                           \

+  }                                           \

+

+#define PLAT_TIMER_FRAME_INFO                 \

+  {                                           \

+  }                                           \

+

+#define PLAT_GIC_DISTRIBUTOR_INFO                                      \

+  {                                                                    \

+    PLAT_GICD_BASE,                  /* UINT64  PhysicalBaseAddress */ \

+    0,                               /* UINT32  SystemVectorBase */    \

+    PLAT_GIC_VERSION                 /* UINT8   GicVersion */          \

+  }                                                                    \

+

+#define PLAT_GIC_REDISTRIBUTOR_INFO                                    \

+  {                                                                    \

+  }                                                                    \

+

+#define PLAT_GIC_ITS_INFO                                              \

+  {                                                                    \

+  }                                                                    \

+

+#define PLAT_MCFG_INFO                \

+  {                                   \

+    {                                 \

+      PLAT_PCI_SEG1_CONFIG_BASE,      \

+      PLAT_PCI_SEG1,                  \

+      PLAT_PCI_SEG_BUSNUM_MIN,        \

+      PLAT_PCI_SEG_BUSNUM_MAX,        \

+    },                                \

+    {                                 \

+      PLAT_PCI_SEG2_CONFIG_BASE,      \

+      PLAT_PCI_SEG2,                  \

+      PLAT_PCI_SEG_BUSNUM_MIN,        \

+      PLAT_PCI_SEG_BUSNUM_MAX,        \

+    }                                 \

+  }                                   \

+

+#define PLAT_SPCR_INFO                                                            \

+  {                                                                               \

+    UART0_BASE,                                                                   \

+    UART0_IT,                                                                     \

+    115200,                                                                       \

+    0,                                                                            \

+    EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550           \

+  }                                                                               \

+

+#endif // LS1046AFRWY_PLATFORM_H

diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
index 67cf15cbe4..20111e6037 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
@@ -3,6 +3,7 @@
 #  LS1046AFRWY Board package.

 #

 #  Copyright 2019-2020 NXP

+#  Copyright 2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -22,10 +23,18 @@
   OUTPUT_DIRECTORY               = Build/LS1046aFrwyPkg

   FLASH_DEFINITION               = Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf



+  # This flag controls the dynamic acpi generation

+  #

+  DEFINE DYNAMIC_ACPI_ENABLE     = TRUE

+

 !include Silicon/NXP/NxpQoriqLs.dsc.inc

 !include MdePkg/MdeLibs.dsc.inc

 !include Silicon/NXP/LS1046A/LS1046A.dsc.inc



+!if $(DYNAMIC_ACPI_ENABLE) == TRUE

+  !include DynamicTablesPkg/DynamicTables.dsc.inc

+!endif

+

 [LibraryClasses.common]

   ArmPlatformLib|Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf

   RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf

@@ -46,4 +55,23 @@


   Silicon/NXP/Drivers/UsbHcdInitDxe/UsbHcd.inf



+  #

+  # Dynamic Table Factory

+  !if $(DYNAMIC_ACPI_ENABLE) == TRUE

+    
+ DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe
+ .inf {

+      <LibraryClasses>

+        
+ NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.i
+ nf

+        
+ NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.i
+ nf

+        
+ NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.i
+ nf

+        
+ NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.i
+ nf

+        
+ NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.i
+ nf

+    }

+  !endif

+

+  #

+  # Acpi Support

+  #

+  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf

+  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf

+

 ##

diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
index 34c4e5a025..f3cac033bc 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
@@ -3,6 +3,7 @@
 #  FLASH layout file for LS1046a board.

 #

 #  Copyright 2019-2020 NXP

+#  Copyright 2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -99,6 +100,18 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Metronome/Metronome.inf

   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf



+

+  #

+  # Acpi Support

+  #

+  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf

+  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf

+

+  !if $(DYNAMIC_ACPI_ENABLE) == TRUE

+    INF 
+ Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Configura
+ tionManagerDxe.inf

+    !include DynamicTablesPkg/DynamicTables.fdf.inc

+  !endif

+

   #

   # Multiple Console IO support

   #

diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc.inc b/Silicon/NXP/LS1046A/LS1046A.dsc.inc
index 7004533ed5..caebb321d0 100644
--- a/Silicon/NXP/LS1046A/LS1046A.dsc.inc
+++ b/Silicon/NXP/LS1046A/LS1046A.dsc.inc
@@ -2,6 +2,7 @@
 #  LS1046A Soc package.

 #

 #  Copyright 2017-2020 NXP

+#  Copyright 2021-2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -48,4 +49,14 @@
 [Components.common]

   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf



+#

+# Configuration Manager

+!if $(DYNAMIC_ACPI_ENABLE) == TRUE

+  
+ Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Configura
+ tionManagerDxe.inf {

+    <BuildOptions>

+      *_*_*_PLATFORM_FLAGS = 
+ -I$(WORKSPACE)/Platform/NXP/LS1046aFrwyPkg/Include

+      *_*_*_PLATFORM_FLAGS = 
+ -I$(WORKSPACE)/Silicon/NXP/Chassis2/Include

+  }

+!endif

+

 ##

--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY
  2021-07-12 10:33 ` [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY Sunny Wang
@ 2021-07-26 13:04   ` Vikas Singh
  2021-08-04  8:47     ` Sunny Wang
  0 siblings, 1 reply; 15+ messages in thread
From: Vikas Singh @ 2021-07-26 13:04 UTC (permalink / raw)
  To: Sunny Wang, devel@edk2.groups.io,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	leif@nuviainc.com
  Cc: Sami Mujawar, Samer El-Haj-Mahmoud, V Sethi (v.sethi@nxp.com),
	Arokia Samy, Kuldip Dwivedi, Ard Biesheuvel, vikas.singh@nxp.com,
	White Weng, Ran Wang, Joe Byrne

[-- Attachment #1: Type: text/plain, Size: 7517 bytes --]

Sunny,    thanks for your review and PSB my remarks.

________________________________
From: Sunny Wang <Sunny.Wang@arm.com>
Sent: Monday, July 12, 2021 4:03 PM
To: Vikas Singh <vikas.singh@puresoftware.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; leif@nuviainc.com <leif@nuviainc.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com <leif@nuviainc.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; Arokia Samy <arokia.samy@puresoftware.com>; Kuldip Dwivedi <kuldip.dwivedi@puresoftware.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com <vikas.singh@nxp.com>; White Weng <white.weng@nxp.com>; Ran Wang <ran.wang_1@nxp.com>; Sunny Wang <Sunny.Wang@arm.com>; Joe Byrne <joseph.byrne@nxp.com>
Subject: RE: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY

Hi Vikas,

Thanks for working on this.

As our offline discussion with NXP, our goal is to make the Tiano edk2-platform and NXP LSDK opensource https://source.codeaurora.org/external/qoriq/qoriq-components/edk2-platforms in sync. Now the main problem is that some folders' names and locations have been changed to be different from NXP LSDK opensource in previous commits, which causes difficulty in doing synchronization between Tiano edk2-platform and NXP LSDK opensource and also causes LSDK user's confusion.  I'm fine with keeping some changes that are needed for cleanup purposes or fixing build issues. However, I think we can still avoid some folder-renaming or folder-moving changes. For avoiding them, could you check my questions/comments below?

1. Why do we need to have ConfigurationManagerPkg.dec? Can we remove this? After removing it, we can rename the ConfigurationManagerPkg folder back to ConfigurationManager to be consistent with other platforms (JunoPkg).
[[Vikas]] ConfigurationManagerPkg folder should not be renamed back to ConfigurationManager because of the hierarchy and placement of this folder as a common generic for all the platform pkgs.
This is already been discussed with leif and moreover in case of JunoPkg the CM is private to JunoPkg not visible to other ARM platform pkgs. Here in our case CM serves all the NXP platforms.

2. Can we move \Platform\NXP\LX2160aRdbPkg\Include\Platform.h to the same location as LSDK (\Platform\NXP\LX2160aRdbPkg\AcpiTables\)?
[[Vikas]] This involves extra effort/rework.

3. Can we move \Platform\NXP\LS1046aFrwyPkg\Include\Platform.h t h to the same location as LSDK (\Platform\NXP\ LS1046aFrwyPkg\AcpiTables\)?
[[Vikas]] This involves extra effort/rework.

4. Can we add \Silicon\NXP\LS1046A\Library\SocFixupLib\ for patch 2/4 (adding SocGetSvr() function)? Furthermore, can we just add the whole Silicon\NXP\LS1046A\Library\SocFixupLib\ from NXP LSDK?
[[Vikas]] This involves extra effort/rework.

Add few more NXP guys.



Hi Leif and Meenakshi,

Can we just push the latest LSDK to the Tiano edk2-platform in one patch set? Then, If there is anything that needs to be cleaned up like the Coding style issue, we can create an issue in Bugzilla for it. What do you guys think?


Best Regards,
Sunny Wang

-----Original Message-----
From: Vikas Singh <vikas.singh@puresoftware.com>
Sent: Friday, June 18, 2021 11:28 PM
To: devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; arokia.samy <arokia.samy@puresoftware.com>; kuldip.dwivedi@puresoftware.com; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; Sunny Wang <Sunny.Wang@arm.com>
Subject: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY

This patch series basically aims to extend the Dynamic ACPI
framework towards NXP's LS1046AFRWY platform.

In continuation to https://edk2.groups.io/g/devel/message/71709

The change set in the series is in below order -

(1)Introducing a new platform specific macro "PLAT_SOC_NAME"
This macro will be consumed by Configuration Manager(CM).
Platforms who extends CM services for themselves must notify
their SoC details to CM using this macro only.
Additionally also update the lx2160ardb platform header with
PLAT_SOC_NAME, this will be consumed by CM.

(2)Introduced a function to get SoC's System Version Register(SVR)
This function will fetch SVR details for LS1046A SoC based platforms.
In current patch series, this function will be used by LS1046aFrwyPkg.

(3)Extending Configuration Manager (CM) and its services to leverage
the Dynamic ACPI support for NXP's LS1046aFrwy platform.

(4)Introduced an OEM specific firmware acpi table generator
Also add Dsdt.asl as a place holder having only platform's clock
related dsdt properties for now and will accommodate other IP specific
dsdt tables(acpi properties) for LS1046AFRWY in future patch series.

Vikas Singh (4):
  Platform/NXP: Make SoC version log in ConfigurationManager generic
  Silicon/NXP: Add support of SVR handling for LS1046A SoC
  NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY
  Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator

 Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c  |  11 +-
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl                           |  60 ++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl                          |  15 ++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf                |  39 +++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c | 138 +++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h                      |  23 +++
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h                                       | 156 ++++++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc                                       |  29 ++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf                                       |  13 ++
 Platform/NXP/LX2160aRdbPkg/Include/Platform.h                                        |   8 +-
 Silicon/NXP/LS1046A/LS1046A.dsc.inc                                                  |  11 ++
 Silicon/NXP/LS1046A/Library/SocLib/SocLib.c                                          |  16 ++
 Silicon/NXP/LX2160A/LX2160A.dsc.inc                                                  |   3 +-
 13 files changed, 508 insertions(+), 14 deletions(-)
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h

--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[-- Attachment #2: Type: text/html, Size: 11676 bytes --]

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

* Re: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY
  2021-07-12 10:37   ` Sunny Wang
  2021-07-23  4:45     ` [EXT] " Vikas Singh
@ 2021-07-26 13:08     ` Vikas Singh
  2021-08-04  7:16       ` Sunny Wang
  1 sibling, 1 reply; 15+ messages in thread
From: Vikas Singh @ 2021-07-26 13:08 UTC (permalink / raw)
  To: Sunny Wang, devel@edk2.groups.io
  Cc: Sami Mujawar, leif@nuviainc.com,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	Samer El-Haj-Mahmoud, V Sethi (v.sethi@nxp.com), Arokia Samy,
	Kuldip Dwivedi, Ard Biesheuvel, vikas.singh@nxp.com, White Weng,
	Ran Wang

[-- Attachment #1: Type: text/plain, Size: 14503 bytes --]

Sunny, Thank you for reviewing my code. Here are my remarks. PSB

________________________________
From: Sunny Wang <Sunny.Wang@arm.com>
Sent: Monday, July 12, 2021 4:07 PM
To: Vikas Singh <vikas.singh@puresoftware.com>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com <leif@nuviainc.com>; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; Arokia Samy <arokia.samy@puresoftware.com>; Kuldip Dwivedi <kuldip.dwivedi@puresoftware.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com <vikas.singh@nxp.com>; White Weng <white.weng@nxp.com>; Ran Wang <ran.wang_1@nxp.com>; Sunny Wang <Sunny.Wang@arm.com>
Subject: RE: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY

Hi Vikas,

Just have two comments below. Others look good to me.
1. In LS1046aFrwyPkg.dsc, since you already include DynamicTablesPkg/DynamicTables.dsc.inc, I think we need to remove DynamicTableFactoryDxe.inf code block. Could you check this?
[[VIKAS]] No, DynamicTableFactoryDxe.inf code block Is required to override, or I would say to choose what we want for our platform from DynamicTablesPkg.
This block can expose different "inf" files for different platforms as per the need basis.

2. Remove " DEFINE DYNAMIC_ACPI_ENABLE = TRUE ". In our offline discussion, this would cause some build problems with the current CM implementation (Multiple NXP platforms share One CM folder).
[[VIKAS]] I don't think "DEFINE DYNAMIC_ACPI_ENABLE = TRUE" should cause any problem while building other platforms. In fact this flag is to avoid any build issue with other platforms. CM is common for all layer scape platforms but it will be only visible to any platform if and only if "DEFINE DYNAMIC_ACPI_ENABLE = TRUE". Else platform must be building in old native mode. Could you share any scenario or something that I have missed out, will check this implementation and try to rectify.

Best Regards,
Sunny Wang

-----Original Message-----
From: Vikas Singh <vikas.singh@puresoftware.com>
Sent: Friday, June 18, 2021 11:28 PM
To: devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; arokia.samy <arokia.samy@puresoftware.com>; kuldip.dwivedi@puresoftware.com; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; Sunny Wang <Sunny.Wang@arm.com>
Subject: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY

This patch enables the use of ConfigurationManager (CM) and
its services to leverage the Dynamic ACPI support for NXP's
LS1046aFrwy platform.

Signed-off-by: Vikas Singh <vikas.singh@puresoftware.com>
---
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h | 152 ++++++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc |  28 ++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf |  13 ++
 Silicon/NXP/LS1046A/LS1046A.dsc.inc            |  11 ++
 4 files changed, 204 insertions(+)

diff --git a/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
new file mode 100644
index 0000000000..3c68d65cd3
--- /dev/null
+++ b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
@@ -0,0 +1,152 @@
+/** @file

+ *  Platform headers

+ *

+ *  Copyright 2021 NXP

+ *  Copyright 2021 Puresoftware Ltd

+ *

+ *  SPDX-License-Identifier: BSD-2-Clause-Patent

+ *

+**/

+

+

+#ifndef LS1046AFRWY_PLATFORM_H

+#define LS1046AFRWY_PLATFORM_H

+

+#define EFI_ACPI_ARM_OEM_REVISION    0x00000000

+

+// Soc defines

+#define PLAT_SOC_NAME                "LS1046AFRWY"

+

+// Gic

+#define GIC_VERSION                  2

+#define GICD_BASE                    0x1410000

+#define GICC_BASE                    0x142f000

+#define GICH_BASE                    0x1440000

+#define GICV_BASE                    0x1460000

+

+// UART

+#define UART0_BASE                   0x21C0500

+#define UART0_IT                     86

+#define UART0_LENGTH                 0x100

+#define SPCR_FLOW_CONTROL_NONE       0

+

+// Timer

+#define TIMER_BLOCK_COUNT            1

+#define TIMER_FRAME_COUNT            4

+#define TIMER_WATCHDOG_COUNT         1

+#define TIMER_BASE_ADDRESS           0x23E0000 // a.k.a CNTControlBase

+#define TIMER_READ_BASE_ADDRESS      0x23F0000 // a.k.a CNTReadBase

+#define TIMER_SEC_IT                 29

+#define TIMER_NON_SEC_IT             30

+#define TIMER_VIRT_IT                27

+#define TIMER_HYP_IT                 26

+#define TIMER_FRAME0_IT              78

+#define TIMER_FRAME1_IT              79

+#define TIMER_FRAME2_IT              92

+

+// Mcfg

+#define LS1046A_PCI_SEG0_CONFIG_BASE 0x4000000000

+#define LS1046A_PCI_SEG0             0x0

+#define LS1046A_PCI_SEG_BUSNUM_MIN   0x0

+#define LS1046A_PCI_SEG_BUSNUM_MAX   0xff

+#define LS1046A_PCI_SEG1_CONFIG_BASE 0x4800000000

+#define LS1046A_PCI_SEG2_CONFIG_BASE 0x5000000000

+#define LS1046A_PCI_SEG1             0x1

+#define LS1046A_PCI_SEG2             0x2

+

+// Platform specific info needed by Configuration Manager

+

+#define CFG_MGR_TABLE_ID  SIGNATURE_64 ('L','S','1','0','4','6',' ',' ')

+

+// Specify the OEM defined tables

+#define OEM_ACPI_TABLES             0

+

+#define PLAT_PCI_SEG0               LS1046A_PCI_SEG0

+#define PLAT_PCI_SEG1_CONFIG_BASE   LS1046A_PCI_SEG1_CONFIG_BASE

+#define PLAT_PCI_SEG1               LS1046A_PCI_SEG1

+#define PLAT_PCI_SEG_BUSNUM_MIN     LS1046A_PCI_SEG_BUSNUM_MIN

+#define PLAT_PCI_SEG_BUSNUM_MAX     LS1046A_PCI_SEG_BUSNUM_MAX

+#define PLAT_PCI_SEG2_CONFIG_BASE   LS1046A_PCI_SEG2_CONFIG_BASE

+#define PLAT_PCI_SEG2               LS1046A_PCI_SEG2

+

+#define PLAT_GIC_VERSION            GIC_VERSION

+#define PLAT_GICD_BASE              GICD_BASE

+#define PLAT_GICI_BASE              GICI_BASE

+#define PLAT_GICR_BASE              GICR_BASE

+#define PLAT_GICR_LEN               GICR_LEN

+#define PLAT_GICC_BASE              GICC_BASE

+#define PLAT_GICH_BASE              GICH_BASE

+#define PLAT_GICV_BASE              GICV_BASE

+

+#define PLAT_CPU_COUNT              4

+#define PLAT_GTBLOCK_COUNT          0

+#define PLAT_GTFRAME_COUNT          0

+#define PLAT_PCI_CONFG_COUNT        2

+

+#define PLAT_WATCHDOG_COUNT           0

+#define PLAT_GIC_REDISTRIBUTOR_COUNT  0

+#define PLAT_GIC_ITS_COUNT            0

+

+/* GIC CPU Interface information

+   GIC_ENTRY (CPUInterfaceNumber, Mpidr, PmuIrq, VGicIrq, EnergyEfficiency)

+ */

+#define PLAT_GIC_CPU_INTERFACE    {                          \

+             GICC_ENTRY (0,  GET_MPID (0, 0), 138, 0x19, 0), \

+             GICC_ENTRY (1,  GET_MPID (0, 1), 139, 0x19, 0), \

+             GICC_ENTRY (2,  GET_MPID (0, 2), 127, 0x19, 0), \

+             GICC_ENTRY (3,  GET_MPID (0, 3), 129, 0x19, 0), \

+}

+

+#define PLAT_WATCHDOG_INFO                    \

+  {                                           \

+  }                                           \

+

+#define PLAT_TIMER_BLOCK_INFO                 \

+  {                                           \

+  }                                           \

+

+#define PLAT_TIMER_FRAME_INFO                 \

+  {                                           \

+  }                                           \

+

+#define PLAT_GIC_DISTRIBUTOR_INFO                                      \

+  {                                                                    \

+    PLAT_GICD_BASE,                  /* UINT64  PhysicalBaseAddress */ \

+    0,                               /* UINT32  SystemVectorBase */    \

+    PLAT_GIC_VERSION                 /* UINT8   GicVersion */          \

+  }                                                                    \

+

+#define PLAT_GIC_REDISTRIBUTOR_INFO                                    \

+  {                                                                    \

+  }                                                                    \

+

+#define PLAT_GIC_ITS_INFO                                              \

+  {                                                                    \

+  }                                                                    \

+

+#define PLAT_MCFG_INFO                \

+  {                                   \

+    {                                 \

+      PLAT_PCI_SEG1_CONFIG_BASE,      \

+      PLAT_PCI_SEG1,                  \

+      PLAT_PCI_SEG_BUSNUM_MIN,        \

+      PLAT_PCI_SEG_BUSNUM_MAX,        \

+    },                                \

+    {                                 \

+      PLAT_PCI_SEG2_CONFIG_BASE,      \

+      PLAT_PCI_SEG2,                  \

+      PLAT_PCI_SEG_BUSNUM_MIN,        \

+      PLAT_PCI_SEG_BUSNUM_MAX,        \

+    }                                 \

+  }                                   \

+

+#define PLAT_SPCR_INFO                                                            \

+  {                                                                               \

+    UART0_BASE,                                                                   \

+    UART0_IT,                                                                     \

+    115200,                                                                       \

+    0,                                                                            \

+    EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550           \

+  }                                                                               \

+

+#endif // LS1046AFRWY_PLATFORM_H

diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
index 67cf15cbe4..20111e6037 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
@@ -3,6 +3,7 @@
 #  LS1046AFRWY Board package.

 #

 #  Copyright 2019-2020 NXP

+#  Copyright 2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -22,10 +23,18 @@
   OUTPUT_DIRECTORY               = Build/LS1046aFrwyPkg

   FLASH_DEFINITION               = Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf



+  # This flag controls the dynamic acpi generation

+  #

+  DEFINE DYNAMIC_ACPI_ENABLE     = TRUE

+

 !include Silicon/NXP/NxpQoriqLs.dsc.inc

 !include MdePkg/MdeLibs.dsc.inc

 !include Silicon/NXP/LS1046A/LS1046A.dsc.inc



+!if $(DYNAMIC_ACPI_ENABLE) == TRUE

+  !include DynamicTablesPkg/DynamicTables.dsc.inc

+!endif

+

 [LibraryClasses.common]

   ArmPlatformLib|Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf

   RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf

@@ -46,4 +55,23 @@


   Silicon/NXP/Drivers/UsbHcdInitDxe/UsbHcd.inf



+  #

+  # Dynamic Table Factory

+  !if $(DYNAMIC_ACPI_ENABLE) == TRUE

+    DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {

+      <LibraryClasses>

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf

+    }

+  !endif

+

+  #

+  # Acpi Support

+  #

+  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf

+  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf

+

 ##

diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
index 34c4e5a025..f3cac033bc 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
@@ -3,6 +3,7 @@
 #  FLASH layout file for LS1046a board.

 #

 #  Copyright 2019-2020 NXP

+#  Copyright 2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -99,6 +100,18 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Metronome/Metronome.inf

   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf



+

+  #

+  # Acpi Support

+  #

+  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf

+  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf

+

+  !if $(DYNAMIC_ACPI_ENABLE) == TRUE

+    INF Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf

+    !include DynamicTablesPkg/DynamicTables.fdf.inc

+  !endif

+

   #

   # Multiple Console IO support

   #

diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc.inc b/Silicon/NXP/LS1046A/LS1046A.dsc.inc
index 7004533ed5..caebb321d0 100644
--- a/Silicon/NXP/LS1046A/LS1046A.dsc.inc
+++ b/Silicon/NXP/LS1046A/LS1046A.dsc.inc
@@ -2,6 +2,7 @@
 #  LS1046A Soc package.

 #

 #  Copyright 2017-2020 NXP

+#  Copyright 2021-2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -48,4 +49,14 @@
 [Components.common]

   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf



+#

+# Configuration Manager

+!if $(DYNAMIC_ACPI_ENABLE) == TRUE

+  Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf {

+    <BuildOptions>

+      *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Platform/NXP/LS1046aFrwyPkg/Include

+      *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Silicon/NXP/Chassis2/Include

+  }

+!endif

+

 ##

--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[-- Attachment #2: Type: text/html, Size: 31673 bytes --]

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

* Re: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY
  2021-07-26 13:08     ` Vikas Singh
@ 2021-08-04  7:16       ` Sunny Wang
  0 siblings, 0 replies; 15+ messages in thread
From: Sunny Wang @ 2021-08-04  7:16 UTC (permalink / raw)
  To: Vikas Singh, devel@edk2.groups.io
  Cc: Sami Mujawar, leif@nuviainc.com,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	Samer El-Haj-Mahmoud, V Sethi (v.sethi@nxp.com), Arokia Samy,
	Kuldip Dwivedi, Ard Biesheuvel, vikas.singh@nxp.com, White Weng,
	Ran Wang, Sunny Wang

[-- Attachment #1: Type: text/plain, Size: 17257 bytes --]

Hi Vikas,



Sorry for the delay and thanks for clarifying.

1. OK. I was just curious why we need to override it to include fewer tables. Isn't it better to support more ACPI tables? Anyways, I'm fine with the current change because it is intended. We can discuss this later once we're done with synchronizing edk2-platform with NXP-LSDK.

2. OK, I just thought that you would like to use the same way (build flag) as what we used in NXP LSDK. I'm also fine with the current approach. We can co-work with NXP to update NXP-LSDK later.



Reviewed-by: Sunny Wang <sunny.wang@arm.com<mailto:sunny.wang@arm.com>>

Best Regards,
Sunny Wang

From: Vikas Singh <vikas.singh@puresoftware.com>
Sent: Monday, July 26, 2021 9:08 PM
To: Sunny Wang <Sunny.Wang@arm.com>; devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; Arokia Samy <arokia.samy@puresoftware.com>; Kuldip Dwivedi <kuldip.dwivedi@puresoftware.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; White Weng <white.weng@nxp.com>; Ran Wang <ran.wang_1@nxp.com>
Subject: Re: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY

Sunny, Thank you for reviewing my code. Here are my remarks. PSB

________________________________
From: Sunny Wang <Sunny.Wang@arm.com<mailto:Sunny.Wang@arm.com>>
Sent: Monday, July 12, 2021 4:07 PM
To: Vikas Singh <vikas.singh@puresoftware.com<mailto:vikas.singh@puresoftware.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>
Cc: Sami Mujawar <Sami.Mujawar@arm.com<mailto:Sami.Mujawar@arm.com>>; leif@nuviainc.com<mailto:leif@nuviainc.com> <leif@nuviainc.com<mailto:leif@nuviainc.com>>; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com<mailto:meenakshi.aggarwal@nxp.com>) <meenakshi.aggarwal@nxp.com<mailto:meenakshi.aggarwal@nxp.com>>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com<mailto:Samer.El-Haj-Mahmoud@arm.com>>; V Sethi (v.sethi@nxp.com<mailto:v.sethi@nxp.com>) <v.sethi@nxp.com<mailto:v.sethi@nxp.com>>; Arokia Samy <arokia.samy@puresoftware.com<mailto:arokia.samy@puresoftware.com>>; Kuldip Dwivedi <kuldip.dwivedi@puresoftware.com<mailto:kuldip.dwivedi@puresoftware.com>>; Ard Biesheuvel <Ard.Biesheuvel@arm.com<mailto:Ard.Biesheuvel@arm.com>>; vikas.singh@nxp.com<mailto:vikas.singh@nxp.com> <vikas.singh@nxp.com<mailto:vikas.singh@nxp.com>>; White Weng <white.weng@nxp.com<mailto:white.weng@nxp.com>>; Ran Wang <ran.wang_1@nxp.com<mailto:ran.wang_1@nxp.com>>; Sunny Wang <Sunny.Wang@arm.com<mailto:Sunny.Wang@arm.com>>
Subject: RE: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY

Hi Vikas,

Just have two comments below. Others look good to me.
1. In LS1046aFrwyPkg.dsc, since you already include DynamicTablesPkg/DynamicTables.dsc.inc, I think we need to remove DynamicTableFactoryDxe.inf code block. Could you check this?
[[VIKAS]] No, DynamicTableFactoryDxe.inf code block Is required to override, or I would say to choose what we want for our platform from DynamicTablesPkg.
This block can expose different "inf" files for different platforms as per the need basis.

2. Remove " DEFINE DYNAMIC_ACPI_ENABLE = TRUE ". In our offline discussion, this would cause some build problems with the current CM implementation (Multiple NXP platforms share One CM folder).
[[VIKAS]] I don't think "DEFINE DYNAMIC_ACPI_ENABLE = TRUE" should cause any problem while building other platforms. In fact this flag is to avoid any build issue with other platforms. CM is common for all layer scape platforms but it will be only visible to any platform if and only if "DEFINE DYNAMIC_ACPI_ENABLE = TRUE". Else platform must be building in old native mode. Could you share any scenario or something that I have missed out, will check this implementation and try to rectify.

Best Regards,
Sunny Wang

-----Original Message-----
From: Vikas Singh <vikas.singh@puresoftware.com<mailto:vikas.singh@puresoftware.com>>
Sent: Friday, June 18, 2021 11:28 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Sami Mujawar <Sami.Mujawar@arm.com<mailto:Sami.Mujawar@arm.com>>; leif@nuviainc.com<mailto:leif@nuviainc.com>; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com<mailto:meenakshi.aggarwal@nxp.com>) <meenakshi.aggarwal@nxp.com<mailto:meenakshi.aggarwal@nxp.com>>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com<mailto:Samer.El-Haj-Mahmoud@arm.com>>; V Sethi (v.sethi@nxp.com<mailto:v.sethi@nxp.com>) <v.sethi@nxp.com<mailto:v.sethi@nxp.com>>; arokia.samy <arokia.samy@puresoftware.com<mailto:arokia.samy@puresoftware.com>>; kuldip.dwivedi@puresoftware.com<mailto:kuldip.dwivedi@puresoftware.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com<mailto:Ard.Biesheuvel@arm.com>>; vikas.singh@nxp.com<mailto:vikas.singh@nxp.com>; Sunny Wang <Sunny.Wang@arm.com<mailto:Sunny.Wang@arm.com>>
Subject: [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY

This patch enables the use of ConfigurationManager (CM) and
its services to leverage the Dynamic ACPI support for NXP's
LS1046aFrwy platform.

Signed-off-by: Vikas Singh <vikas.singh@puresoftware.com<mailto:vikas.singh@puresoftware.com>>
---
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h | 152 ++++++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc |  28 ++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf |  13 ++
 Silicon/NXP/LS1046A/LS1046A.dsc.inc            |  11 ++
 4 files changed, 204 insertions(+)

diff --git a/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
new file mode 100644
index 0000000000..3c68d65cd3
--- /dev/null
+++ b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h
@@ -0,0 +1,152 @@
+/** @file

+ *  Platform headers

+ *

+ *  Copyright 2021 NXP

+ *  Copyright 2021 Puresoftware Ltd

+ *

+ *  SPDX-License-Identifier: BSD-2-Clause-Patent

+ *

+**/

+

+

+#ifndef LS1046AFRWY_PLATFORM_H

+#define LS1046AFRWY_PLATFORM_H

+

+#define EFI_ACPI_ARM_OEM_REVISION    0x00000000

+

+// Soc defines

+#define PLAT_SOC_NAME                "LS1046AFRWY"

+

+// Gic

+#define GIC_VERSION                  2

+#define GICD_BASE                    0x1410000

+#define GICC_BASE                    0x142f000

+#define GICH_BASE                    0x1440000

+#define GICV_BASE                    0x1460000

+

+// UART

+#define UART0_BASE                   0x21C0500

+#define UART0_IT                     86

+#define UART0_LENGTH                 0x100

+#define SPCR_FLOW_CONTROL_NONE       0

+

+// Timer

+#define TIMER_BLOCK_COUNT            1

+#define TIMER_FRAME_COUNT            4

+#define TIMER_WATCHDOG_COUNT         1

+#define TIMER_BASE_ADDRESS           0x23E0000 // a.k.a CNTControlBase

+#define TIMER_READ_BASE_ADDRESS      0x23F0000 // a.k.a CNTReadBase

+#define TIMER_SEC_IT                 29

+#define TIMER_NON_SEC_IT             30

+#define TIMER_VIRT_IT                27

+#define TIMER_HYP_IT                 26

+#define TIMER_FRAME0_IT              78

+#define TIMER_FRAME1_IT              79

+#define TIMER_FRAME2_IT              92

+

+// Mcfg

+#define LS1046A_PCI_SEG0_CONFIG_BASE 0x4000000000

+#define LS1046A_PCI_SEG0             0x0

+#define LS1046A_PCI_SEG_BUSNUM_MIN   0x0

+#define LS1046A_PCI_SEG_BUSNUM_MAX   0xff

+#define LS1046A_PCI_SEG1_CONFIG_BASE 0x4800000000

+#define LS1046A_PCI_SEG2_CONFIG_BASE 0x5000000000

+#define LS1046A_PCI_SEG1             0x1

+#define LS1046A_PCI_SEG2             0x2

+

+// Platform specific info needed by Configuration Manager

+

+#define CFG_MGR_TABLE_ID  SIGNATURE_64 ('L','S','1','0','4','6',' ',' ')

+

+// Specify the OEM defined tables

+#define OEM_ACPI_TABLES             0

+

+#define PLAT_PCI_SEG0               LS1046A_PCI_SEG0

+#define PLAT_PCI_SEG1_CONFIG_BASE   LS1046A_PCI_SEG1_CONFIG_BASE

+#define PLAT_PCI_SEG1               LS1046A_PCI_SEG1

+#define PLAT_PCI_SEG_BUSNUM_MIN     LS1046A_PCI_SEG_BUSNUM_MIN

+#define PLAT_PCI_SEG_BUSNUM_MAX     LS1046A_PCI_SEG_BUSNUM_MAX

+#define PLAT_PCI_SEG2_CONFIG_BASE   LS1046A_PCI_SEG2_CONFIG_BASE

+#define PLAT_PCI_SEG2               LS1046A_PCI_SEG2

+

+#define PLAT_GIC_VERSION            GIC_VERSION

+#define PLAT_GICD_BASE              GICD_BASE

+#define PLAT_GICI_BASE              GICI_BASE

+#define PLAT_GICR_BASE              GICR_BASE

+#define PLAT_GICR_LEN               GICR_LEN

+#define PLAT_GICC_BASE              GICC_BASE

+#define PLAT_GICH_BASE              GICH_BASE

+#define PLAT_GICV_BASE              GICV_BASE

+

+#define PLAT_CPU_COUNT              4

+#define PLAT_GTBLOCK_COUNT          0

+#define PLAT_GTFRAME_COUNT          0

+#define PLAT_PCI_CONFG_COUNT        2

+

+#define PLAT_WATCHDOG_COUNT           0

+#define PLAT_GIC_REDISTRIBUTOR_COUNT  0

+#define PLAT_GIC_ITS_COUNT            0

+

+/* GIC CPU Interface information

+   GIC_ENTRY (CPUInterfaceNumber, Mpidr, PmuIrq, VGicIrq, EnergyEfficiency)

+ */

+#define PLAT_GIC_CPU_INTERFACE    {                          \

+             GICC_ENTRY (0,  GET_MPID (0, 0), 138, 0x19, 0), \

+             GICC_ENTRY (1,  GET_MPID (0, 1), 139, 0x19, 0), \

+             GICC_ENTRY (2,  GET_MPID (0, 2), 127, 0x19, 0), \

+             GICC_ENTRY (3,  GET_MPID (0, 3), 129, 0x19, 0), \

+}

+

+#define PLAT_WATCHDOG_INFO                    \

+  {                                           \

+  }                                           \

+

+#define PLAT_TIMER_BLOCK_INFO                 \

+  {                                           \

+  }                                           \

+

+#define PLAT_TIMER_FRAME_INFO                 \

+  {                                           \

+  }                                           \

+

+#define PLAT_GIC_DISTRIBUTOR_INFO                                      \

+  {                                                                    \

+    PLAT_GICD_BASE,                  /* UINT64  PhysicalBaseAddress */ \

+    0,                               /* UINT32  SystemVectorBase */    \

+    PLAT_GIC_VERSION                 /* UINT8   GicVersion */          \

+  }                                                                    \

+

+#define PLAT_GIC_REDISTRIBUTOR_INFO                                    \

+  {                                                                    \

+  }                                                                    \

+

+#define PLAT_GIC_ITS_INFO                                              \

+  {                                                                    \

+  }                                                                    \

+

+#define PLAT_MCFG_INFO                \

+  {                                   \

+    {                                 \

+      PLAT_PCI_SEG1_CONFIG_BASE,      \

+      PLAT_PCI_SEG1,                  \

+      PLAT_PCI_SEG_BUSNUM_MIN,        \

+      PLAT_PCI_SEG_BUSNUM_MAX,        \

+    },                                \

+    {                                 \

+      PLAT_PCI_SEG2_CONFIG_BASE,      \

+      PLAT_PCI_SEG2,                  \

+      PLAT_PCI_SEG_BUSNUM_MIN,        \

+      PLAT_PCI_SEG_BUSNUM_MAX,        \

+    }                                 \

+  }                                   \

+

+#define PLAT_SPCR_INFO                                                            \

+  {                                                                               \

+    UART0_BASE,                                                                   \

+    UART0_IT,                                                                     \

+    115200,                                                                       \

+    0,                                                                            \

+    EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550           \

+  }                                                                               \

+

+#endif // LS1046AFRWY_PLATFORM_H

diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
index 67cf15cbe4..20111e6037 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc
@@ -3,6 +3,7 @@
 #  LS1046AFRWY Board package.

 #

 #  Copyright 2019-2020 NXP

+#  Copyright 2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -22,10 +23,18 @@
   OUTPUT_DIRECTORY               = Build/LS1046aFrwyPkg

   FLASH_DEFINITION               = Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf



+  # This flag controls the dynamic acpi generation

+  #

+  DEFINE DYNAMIC_ACPI_ENABLE     = TRUE

+

 !include Silicon/NXP/NxpQoriqLs.dsc.inc

 !include MdePkg/MdeLibs.dsc.inc

 !include Silicon/NXP/LS1046A/LS1046A.dsc.inc



+!if $(DYNAMIC_ACPI_ENABLE) == TRUE

+  !include DynamicTablesPkg/DynamicTables.dsc.inc

+!endif

+

 [LibraryClasses.common]

   ArmPlatformLib|Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf

   RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf

@@ -46,4 +55,23 @@


   Silicon/NXP/Drivers/UsbHcdInitDxe/UsbHcd.inf



+  #

+  # Dynamic Table Factory

+  !if $(DYNAMIC_ACPI_ENABLE) == TRUE

+    DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {

+      <LibraryClasses>

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf

+        NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf

+    }

+  !endif

+

+  #

+  # Acpi Support

+  #

+  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf

+  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf

+

 ##

diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
index 34c4e5a025..f3cac033bc 100755
--- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
+++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf
@@ -3,6 +3,7 @@
 #  FLASH layout file for LS1046a board.

 #

 #  Copyright 2019-2020 NXP

+#  Copyright 2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -99,6 +100,18 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Metronome/Metronome.inf

   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf



+

+  #

+  # Acpi Support

+  #

+  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf

+  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf

+

+  !if $(DYNAMIC_ACPI_ENABLE) == TRUE

+    INF Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf

+    !include DynamicTablesPkg/DynamicTables.fdf.inc

+  !endif

+

   #

   # Multiple Console IO support

   #

diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc.inc b/Silicon/NXP/LS1046A/LS1046A.dsc.inc
index 7004533ed5..caebb321d0 100644
--- a/Silicon/NXP/LS1046A/LS1046A.dsc.inc
+++ b/Silicon/NXP/LS1046A/LS1046A.dsc.inc
@@ -2,6 +2,7 @@
 #  LS1046A Soc package.

 #

 #  Copyright 2017-2020 NXP

+#  Copyright 2021-2021 Puresoftware Ltd

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -48,4 +49,14 @@
 [Components.common]

   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf



+#

+# Configuration Manager

+!if $(DYNAMIC_ACPI_ENABLE) == TRUE

+  Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf {

+    <BuildOptions>

+      *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Platform/NXP/LS1046aFrwyPkg/Include

+      *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Silicon/NXP/Chassis2/Include

+  }

+!endif

+

 ##

--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[-- Attachment #2: Type: text/html, Size: 38784 bytes --]

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

* Re: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY
  2021-07-26 13:04   ` Vikas Singh
@ 2021-08-04  8:47     ` Sunny Wang
  2021-08-13  9:29       ` Vikas Singh
  0 siblings, 1 reply; 15+ messages in thread
From: Sunny Wang @ 2021-08-04  8:47 UTC (permalink / raw)
  To: Vikas Singh, devel@edk2.groups.io,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	leif@nuviainc.com
  Cc: Sami Mujawar, Samer El-Haj-Mahmoud, V Sethi (v.sethi@nxp.com),
	Arokia Samy, Kuldip Dwivedi, Ard Biesheuvel, vikas.singh@nxp.com,
	White Weng, Ran Wang, Joe Byrne, Sunny Wang

[-- Attachment #1: Type: text/plain, Size: 10467 bytes --]

Hi Vikas,



Sorry for the delay and thanks for clarifying. Added my further rcomments below:

  1.  For your previous discussion with Leif, do you mean this one https://edk2.groups.io/g/devel/message/70090? If my understanding of your previous discussion is correct, the reason why you needed to rename ConfigurationManager to ConfigurationManagerPkg is that you created ConfigurationManagerPkg.dec file. However, I don't see a need to create ConfigurationManagerPkg.dec. At least, the current NXP LSDK can work without it. Did you have any plan to use ConfigurationManagerPkg.dec? Moreover, for putting common files for all platforms to consume, it doesn't have to be an XXXXPkg folder and doesn't need a .dec file. In your previous discussion with Leif (https://edk2.groups.io/g/devel/message/70090), It looks like Leif was also asking to remove ConfigurationManagerPkg.dec if the purpose of adding the .dec file is just for all platforms to include common header files in this folder. Actually, I thought we would only name the folder with the postfix string "Pkg" when the folder needs to be separately built. If my thought is correct, I think we don't need to separately build ConfigurationManager.
  2.  After thinking this over, I think \Platform\NXP\LX2160aRdbPkg\Include\ is a better place for putting LX2160aRdbPkg's Platform.h, so this change looks good to me.
  3.  After thinking this over, I think \Platform\NXP\ LS1046aFrwyPkg\Include\ is a better place for putting LS1046aFrwyPkg's Platform.h, so this change looks good to me.
  4.  Could you give me more information about why you don't want to put extra effort at this moment? It looks worth doing this because we will need to add the whole Silicon\NXP\LS1046A\Library\SocFixupLib\ from NXP LSDK later and adding it now can avoid confusion caused by the mismatch between edk2 and NXP LSDK. Why don't we add it now?

Best Regards,
Sunny Wang
From: Vikas Singh <vikas.singh@puresoftware.com>
Sent: Monday, July 26, 2021 9:04 PM
To: Sunny Wang <Sunny.Wang@arm.com>; devel@edk2.groups.io; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; leif@nuviainc.com
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; Arokia Samy <arokia.samy@puresoftware.com>; Kuldip Dwivedi <kuldip.dwivedi@puresoftware.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; White Weng <white.weng@nxp.com>; Ran Wang <ran.wang_1@nxp.com>; Joe Byrne <joseph.byrne@nxp.com>
Subject: Re: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY

Sunny,    thanks for your review and PSB my remarks.

________________________________
From: Sunny Wang <Sunny.Wang@arm.com>
Sent: Monday, July 12, 2021 4:03 PM
To: Vikas Singh <vikas.singh@puresoftware.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; leif@nuviainc.com <leif@nuviainc.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com <leif@nuviainc.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; Arokia Samy <arokia.samy@puresoftware.com>; Kuldip Dwivedi <kuldip.dwivedi@puresoftware.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com <vikas.singh@nxp.com>; White Weng <white.weng@nxp.com>; Ran Wang <ran.wang_1@nxp.com>; Sunny Wang <Sunny.Wang@arm.com>; Joe Byrne <joseph.byrne@nxp.com>
Subject: RE: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY

Hi Vikas,

Thanks for working on this.

As our offline discussion with NXP, our goal is to make the Tiano edk2-platform and NXP LSDK opensource https://source.codeaurora.org/external/qoriq/qoriq-components/edk2-platforms in sync. Now the main problem is that some folders' names and locations have been changed to be different from NXP LSDK opensource in previous commits, which causes difficulty in doing synchronization between Tiano edk2-platform and NXP LSDK opensource and also causes LSDK user's confusion.  I'm fine with keeping some changes that are needed for cleanup purposes or fixing build issues. However, I think we can still avoid some folder-renaming or folder-moving changes. For avoiding them, could you check my questions/comments below?

1. Why do we need to have ConfigurationManagerPkg.dec? Can we remove this? After removing it, we can rename the ConfigurationManagerPkg folder back to ConfigurationManager to be consistent with other platforms (JunoPkg).
[[Vikas]] ConfigurationManagerPkg folder should not be renamed back to ConfigurationManager because of the hierarchy and placement of this folder as a common generic for all the platform pkgs.
This is already been discussed with leif and moreover in case of JunoPkg the CM is private to JunoPkg not visible to other ARM platform pkgs. Here in our case CM serves all the NXP platforms.

2. Can we move \Platform\NXP\LX2160aRdbPkg\Include\Platform.h to the same location as LSDK (\Platform\NXP\LX2160aRdbPkg\AcpiTables\)?
[[Vikas]] This involves extra effort/rework.

3. Can we move \Platform\NXP\LS1046aFrwyPkg\Include\Platform.h t h to the same location as LSDK (\Platform\NXP\ LS1046aFrwyPkg\AcpiTables\)?
[[Vikas]] This involves extra effort/rework.

4. Can we add \Silicon\NXP\LS1046A\Library\SocFixupLib\ for patch 2/4 (adding SocGetSvr() function)? Furthermore, can we just add the whole Silicon\NXP\LS1046A\Library\SocFixupLib\ from NXP LSDK?
[[Vikas]] This involves extra effort/rework.

Add few more NXP guys.



Hi Leif and Meenakshi,

Can we just push the latest LSDK to the Tiano edk2-platform in one patch set? Then, If there is anything that needs to be cleaned up like the Coding style issue, we can create an issue in Bugzilla for it. What do you guys think?


Best Regards,
Sunny Wang

-----Original Message-----
From: Vikas Singh <vikas.singh@puresoftware.com>
Sent: Friday, June 18, 2021 11:28 PM
To: devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; leif@nuviainc.com; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; arokia.samy <arokia.samy@puresoftware.com>; kuldip.dwivedi@puresoftware.com; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; Sunny Wang <Sunny.Wang@arm.com>
Subject: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY

This patch series basically aims to extend the Dynamic ACPI
framework towards NXP's LS1046AFRWY platform.

In continuation to https://edk2.groups.io/g/devel/message/71709

The change set in the series is in below order -

(1)Introducing a new platform specific macro "PLAT_SOC_NAME"
This macro will be consumed by Configuration Manager(CM).
Platforms who extends CM services for themselves must notify
their SoC details to CM using this macro only.
Additionally also update the lx2160ardb platform header with
PLAT_SOC_NAME, this will be consumed by CM.

(2)Introduced a function to get SoC's System Version Register(SVR)
This function will fetch SVR details for LS1046A SoC based platforms.
In current patch series, this function will be used by LS1046aFrwyPkg.

(3)Extending Configuration Manager (CM) and its services to leverage
the Dynamic ACPI support for NXP's LS1046aFrwy platform.

(4)Introduced an OEM specific firmware acpi table generator
Also add Dsdt.asl as a place holder having only platform's clock
related dsdt properties for now and will accommodate other IP specific
dsdt tables(acpi properties) for LS1046AFRWY in future patch series.

Vikas Singh (4):
  Platform/NXP: Make SoC version log in ConfigurationManager generic
  Silicon/NXP: Add support of SVR handling for LS1046A SoC
  NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY
  Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator

 Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c  |  11 +-
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl                           |  60 ++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl                          |  15 ++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf                |  39 +++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c | 138 +++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h                      |  23 +++
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h                                       | 156 ++++++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc                                       |  29 ++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf                                       |  13 ++
 Platform/NXP/LX2160aRdbPkg/Include/Platform.h                                        |   8 +-
 Silicon/NXP/LS1046A/LS1046A.dsc.inc                                                  |  11 ++
 Silicon/NXP/LS1046A/Library/SocLib/SocLib.c                                          |  16 ++
 Silicon/NXP/LX2160A/LX2160A.dsc.inc                                                  |   3 +-
 13 files changed, 508 insertions(+), 14 deletions(-)
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h

--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[-- Attachment #2: Type: text/html, Size: 19870 bytes --]

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

* Re: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY
  2021-08-04  8:47     ` Sunny Wang
@ 2021-08-13  9:29       ` Vikas Singh
  0 siblings, 0 replies; 15+ messages in thread
From: Vikas Singh @ 2021-08-13  9:29 UTC (permalink / raw)
  To: Sunny Wang, devel@edk2.groups.io,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	leif@nuviainc.com
  Cc: Sami Mujawar, Samer El-Haj-Mahmoud, V Sethi (v.sethi@nxp.com),
	Arokia Samy, Kuldip Dwivedi, Ard Biesheuvel, vikas.singh@nxp.com,
	White Weng, Ran Wang, Joe Byrne

[-- Attachment #1: Type: text/plain, Size: 14807 bytes --]

Sunny, Apologies for late response. (Not keeping well these days)
Ok, PSB my remarks.

#1. True, if an entity is independently getting build must be prefixed with Pkg. In my previous discussion with Leif (https://edk2.groups.io/g/devel/message/70090) Leif requested a reason of this kind of setup.
So basically Here the ConfigurationManager is postfixed with  "Pkg" because it has its own .dec and the reason being having this .dec is like CM exposes few headers which are OEM/platform specific (generic in nature consumed by platforms, not by CM itself). In case when platform try to expose its own OEM specific generators these headers cannot come from DynamicTablePkg(edk2) and even platforms are nearly clueless about these headers. So kept these headers as part of CM and exposed them using CM's  .dec in platforms inf files as and when needed. Not sure if this type of setup is acceptable, but seems that Lief was OK, plz check with leif and let me know if at all any correction needed.
I will check and plan modifications accordingly.

#2. Good to hear that.
#3. Got to hear that.

#4. Sunny renaming to directory structure and changes as such are inevitable. In my opinion we must choose what represents our software best. For instance plz check these 2 repo instance, they are already out of sync from LSDK.
LSDK specific --> https://github.com/ossdev07/edk2-platforms/tree/UEFI_ACPI_EAR1-PS-Devel/Silicon/NXP/LX2160A/Library
Tianocore --> https://github.com/tianocore/edk2-platforms/tree/master/Silicon/NXP/LX2160A/Library

Now, referring the "SocFixupLib" as you mentioned, I would suggest pushing changes as and when needed makes more sense.
No point of pushing something which is not needed or is not being used by someone currently.
However I'm ok if you conclude it to be pushed in advance but still there is nothing called as "SocFixupLib" in current tianocore repos.

Let me know if I can help further.

Regards,
Vikas Singh

From: Sunny Wang <Sunny.Wang@arm.com>
Sent: 04 August 2021 14:17
To: Vikas Singh <vikas.singh@puresoftware.com>; devel@edk2.groups.io; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com) <meenakshi.aggarwal@nxp.com>; leif@nuviainc.com
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; V Sethi (v.sethi@nxp.com) <v.sethi@nxp.com>; Arokia Samy <arokia.samy@puresoftware.com>; Kuldip Dwivedi <kuldip.dwivedi@puresoftware.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com>; vikas.singh@nxp.com; White Weng <white.weng@nxp.com>; Ran Wang <ran.wang_1@nxp.com>; Joe Byrne <joseph.byrne@nxp.com>; Sunny Wang <Sunny.Wang@arm.com>
Subject: RE: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY


Hi Vikas,



Sorry for the delay and thanks for clarifying. Added my further rcomments below:

  1.  For your previous discussion with Leif, do you mean this one https://edk2.groups.io/g/devel/message/70090? If my understanding of your previous discussion is correct, the reason why you needed to rename ConfigurationManager to ConfigurationManagerPkg is that you created ConfigurationManagerPkg.dec file. However, I don't see a need to create ConfigurationManagerPkg.dec. At least, the current NXP LSDK can work without it. Did you have any plan to use ConfigurationManagerPkg.dec? Moreover, for putting common files for all platforms to consume, it doesn't have to be an XXXXPkg folder and doesn't need a .dec file. In your previous discussion with Leif (https://edk2.groups.io/g/devel/message/70090), It looks like Leif was also asking to remove ConfigurationManagerPkg.dec if the purpose of adding the .dec file is just for all platforms to include common header files in this folder. Actually, I thought we would only name the folder with the postfix string "Pkg" when the folder needs to be separately built. If my thought is correct, I think we don't need to separately build ConfigurationManager.
  2.  After thinking this over, I think \Platform\NXP\LX2160aRdbPkg\Include\ is a better place for putting LX2160aRdbPkg's Platform.h, so this change looks good to me.
  3.  After thinking this over, I think \Platform\NXP\ LS1046aFrwyPkg\Include\ is a better place for putting LS1046aFrwyPkg's Platform.h, so this change looks good to me.
  4.  Could you give me more information about why you don't want to put extra effort at this moment? It looks worth doing this because we will need to add the whole Silicon\NXP\LS1046A\Library\SocFixupLib\ from NXP LSDK later and adding it now can avoid confusion caused by the mismatch between edk2 and NXP LSDK. Why don't we add it now?

Best Regards,
Sunny Wang
From: Vikas Singh <vikas.singh@puresoftware.com<mailto:vikas.singh@puresoftware.com>>
Sent: Monday, July 26, 2021 9:04 PM
To: Sunny Wang <Sunny.Wang@arm.com<mailto:Sunny.Wang@arm.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com<mailto:meenakshi.aggarwal@nxp.com>) <meenakshi.aggarwal@nxp.com<mailto:meenakshi.aggarwal@nxp.com>>; leif@nuviainc.com<mailto:leif@nuviainc.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com<mailto:Sami.Mujawar@arm.com>>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com<mailto:Samer.El-Haj-Mahmoud@arm.com>>; V Sethi (v.sethi@nxp.com<mailto:v.sethi@nxp.com>) <v.sethi@nxp.com<mailto:v.sethi@nxp.com>>; Arokia Samy <arokia.samy@puresoftware.com<mailto:arokia.samy@puresoftware.com>>; Kuldip Dwivedi <kuldip.dwivedi@puresoftware.com<mailto:kuldip.dwivedi@puresoftware.com>>; Ard Biesheuvel <Ard.Biesheuvel@arm.com<mailto:Ard.Biesheuvel@arm.com>>; vikas.singh@nxp.com<mailto:vikas.singh@nxp.com>; White Weng <white.weng@nxp.com<mailto:white.weng@nxp.com>>; Ran Wang <ran.wang_1@nxp.com<mailto:ran.wang_1@nxp.com>>; Joe Byrne <joseph.byrne@nxp.com<mailto:joseph.byrne@nxp.com>>
Subject: Re: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY

Sunny,    thanks for your review and PSB my remarks.

________________________________
From: Sunny Wang <Sunny.Wang@arm.com<mailto:Sunny.Wang@arm.com>>
Sent: Monday, July 12, 2021 4:03 PM
To: Vikas Singh <vikas.singh@puresoftware.com<mailto:vikas.singh@puresoftware.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com<mailto:meenakshi.aggarwal@nxp.com>) <meenakshi.aggarwal@nxp.com<mailto:meenakshi.aggarwal@nxp.com>>; leif@nuviainc.com<mailto:leif@nuviainc.com> <leif@nuviainc.com<mailto:leif@nuviainc.com>>
Cc: Sami Mujawar <Sami.Mujawar@arm.com<mailto:Sami.Mujawar@arm.com>>; leif@nuviainc.com<mailto:leif@nuviainc.com> <leif@nuviainc.com<mailto:leif@nuviainc.com>>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com<mailto:Samer.El-Haj-Mahmoud@arm.com>>; V Sethi (v.sethi@nxp.com<mailto:v.sethi@nxp.com>) <v.sethi@nxp.com<mailto:v.sethi@nxp.com>>; Arokia Samy <arokia.samy@puresoftware.com<mailto:arokia.samy@puresoftware.com>>; Kuldip Dwivedi <kuldip.dwivedi@puresoftware.com<mailto:kuldip.dwivedi@puresoftware.com>>; Ard Biesheuvel <Ard.Biesheuvel@arm.com<mailto:Ard.Biesheuvel@arm.com>>; vikas.singh@nxp.com<mailto:vikas.singh@nxp.com> <vikas.singh@nxp.com<mailto:vikas.singh@nxp.com>>; White Weng <white.weng@nxp.com<mailto:white.weng@nxp.com>>; Ran Wang <ran.wang_1@nxp.com<mailto:ran.wang_1@nxp.com>>; Sunny Wang <Sunny.Wang@arm.com<mailto:Sunny.Wang@arm.com>>; Joe Byrne <joseph.byrne@nxp.com<mailto:joseph.byrne@nxp.com>>
Subject: RE: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY

Hi Vikas,

Thanks for working on this.

As our offline discussion with NXP, our goal is to make the Tiano edk2-platform and NXP LSDK opensource https://source.codeaurora.org/external/qoriq/qoriq-components/edk2-platforms in sync. Now the main problem is that some folders' names and locations have been changed to be different from NXP LSDK opensource in previous commits, which causes difficulty in doing synchronization between Tiano edk2-platform and NXP LSDK opensource and also causes LSDK user's confusion.  I'm fine with keeping some changes that are needed for cleanup purposes or fixing build issues. However, I think we can still avoid some folder-renaming or folder-moving changes. For avoiding them, could you check my questions/comments below?

1. Why do we need to have ConfigurationManagerPkg.dec? Can we remove this? After removing it, we can rename the ConfigurationManagerPkg folder back to ConfigurationManager to be consistent with other platforms (JunoPkg).
[[Vikas]] ConfigurationManagerPkg folder should not be renamed back to ConfigurationManager because of the hierarchy and placement of this folder as a common generic for all the platform pkgs.
This is already been discussed with leif and moreover in case of JunoPkg the CM is private to JunoPkg not visible to other ARM platform pkgs. Here in our case CM serves all the NXP platforms.

2. Can we move \Platform\NXP\LX2160aRdbPkg\Include\Platform.h to the same location as LSDK (\Platform\NXP\LX2160aRdbPkg\AcpiTables\)?
[[Vikas]] This involves extra effort/rework.

3. Can we move \Platform\NXP\LS1046aFrwyPkg\Include\Platform.h t h to the same location as LSDK (\Platform\NXP\ LS1046aFrwyPkg\AcpiTables\)?
[[Vikas]] This involves extra effort/rework.

4. Can we add \Silicon\NXP\LS1046A\Library\SocFixupLib\ for patch 2/4 (adding SocGetSvr() function)? Furthermore, can we just add the whole Silicon\NXP\LS1046A\Library\SocFixupLib\ from NXP LSDK?
[[Vikas]] This involves extra effort/rework.

Add few more NXP guys.



Hi Leif and Meenakshi,

Can we just push the latest LSDK to the Tiano edk2-platform in one patch set? Then, If there is anything that needs to be cleaned up like the Coding style issue, we can create an issue in Bugzilla for it. What do you guys think?


Best Regards,
Sunny Wang

-----Original Message-----
From: Vikas Singh <vikas.singh@puresoftware.com<mailto:vikas.singh@puresoftware.com>>
Sent: Friday, June 18, 2021 11:28 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Sami Mujawar <Sami.Mujawar@arm.com<mailto:Sami.Mujawar@arm.com>>; leif@nuviainc.com<mailto:leif@nuviainc.com>; Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com<mailto:meenakshi.aggarwal@nxp.com>) <meenakshi.aggarwal@nxp.com<mailto:meenakshi.aggarwal@nxp.com>>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com<mailto:Samer.El-Haj-Mahmoud@arm.com>>; V Sethi (v.sethi@nxp.com<mailto:v.sethi@nxp.com>) <v.sethi@nxp.com<mailto:v.sethi@nxp.com>>; arokia.samy <arokia.samy@puresoftware.com<mailto:arokia.samy@puresoftware.com>>; kuldip.dwivedi@puresoftware.com<mailto:kuldip.dwivedi@puresoftware.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com<mailto:Ard.Biesheuvel@arm.com>>; vikas.singh@nxp.com<mailto:vikas.singh@nxp.com>; Sunny Wang <Sunny.Wang@arm.com<mailto:Sunny.Wang@arm.com>>
Subject: [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY

This patch series basically aims to extend the Dynamic ACPI
framework towards NXP's LS1046AFRWY platform.

In continuation to https://edk2.groups.io/g/devel/message/71709

The change set in the series is in below order -

(1)Introducing a new platform specific macro "PLAT_SOC_NAME"
This macro will be consumed by Configuration Manager(CM).
Platforms who extends CM services for themselves must notify
their SoC details to CM using this macro only.
Additionally also update the lx2160ardb platform header with
PLAT_SOC_NAME, this will be consumed by CM.

(2)Introduced a function to get SoC's System Version Register(SVR)
This function will fetch SVR details for LS1046A SoC based platforms.
In current patch series, this function will be used by LS1046aFrwyPkg.

(3)Extending Configuration Manager (CM) and its services to leverage
the Dynamic ACPI support for NXP's LS1046aFrwy platform.

(4)Introduced an OEM specific firmware acpi table generator
Also add Dsdt.asl as a place holder having only platform's clock
related dsdt properties for now and will accommodate other IP specific
dsdt tables(acpi properties) for LS1046AFRWY in future patch series.

Vikas Singh (4):
  Platform/NXP: Make SoC version log in ConfigurationManager generic
  Silicon/NXP: Add support of SVR handling for LS1046A SoC
  NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY
  Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator

 Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c  |  11 +-
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl                           |  60 ++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl                          |  15 ++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf                |  39 +++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c | 138 +++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h                      |  23 +++
 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h                                       | 156 ++++++++++++++++++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc                                       |  29 ++++
 Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf                                       |  13 ++
 Platform/NXP/LX2160aRdbPkg/Include/Platform.h                                        |   8 +-
 Silicon/NXP/LS1046A/LS1046A.dsc.inc                                                  |  11 ++
 Silicon/NXP/LS1046A/Library/SocLib/SocLib.c                                          |  16 ++
 Silicon/NXP/LX2160A/LX2160A.dsc.inc                                                  |   3 +-
 13 files changed, 508 insertions(+), 14 deletions(-)
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtGenerator.c
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h
 create mode 100644 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h

--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[-- Attachment #2: Type: text/html, Size: 28931 bytes --]

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

end of thread, other threads:[~2021-08-13  9:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-18 15:27 [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY Vikas Singh
2021-06-18 15:27 ` [PATCH V2 1/4] Platform/NXP: Make SoC version log in ConfigurationManager generic Vikas Singh
2021-07-12 10:36   ` Sunny Wang
2021-06-18 15:27 ` [PATCH V2 2/4] Silicon/NXP: Add support of SVR handling for LS1046A SoC Vikas Singh
2021-07-12 10:36   ` Sunny Wang
2021-06-18 15:27 ` [PATCH V2 3/4] NXP/LS1046aFrwyPkg: Enable ConfigurationManager on LS1046AFRWY Vikas Singh
2021-07-12 10:37   ` Sunny Wang
2021-07-23  4:45     ` [EXT] " Vikas Singh
2021-07-26 13:08     ` Vikas Singh
2021-08-04  7:16       ` Sunny Wang
2021-06-18 15:27 ` [PATCH V2 4/4] Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator Vikas Singh
2021-07-12 10:33 ` [PATCH V2 0/4] Enable Dynamic ACPI for LS1046AFRWY Sunny Wang
2021-07-26 13:04   ` Vikas Singh
2021-08-04  8:47     ` Sunny Wang
2021-08-13  9:29       ` Vikas Singh

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