diff mbox series

[edk2,edk2-platforms,v3,01/15] Hisilicon/D05: Move Madt definition to head file

Message ID 1517573143-11451-2-git-send-email-heyi.guo@linaro.org
State Superseded
Headers show
Series Improve D0x platforms and bug fix | expand

Commit Message

gary guo Feb. 2, 2018, 12:05 p.m. UTC
Move definition of Madt struct to head file, so PPTT driver
can include it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang <huangming23@huawei.com>

Signed-off-by: Heyi Guo <heyi.guo@linaro.org>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Reviewed-by: Graeme Gregory <graeme@xora.org.uk>

Reveiwed-by: Jeremy Linton <jeremy.linton@arm.com>
---
 Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h | 30 +++++++++++++++++++-
 Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  | 23 +--------------
 2 files changed, 30 insertions(+), 23 deletions(-)

-- 
1.9.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Leif Lindholm Feb. 6, 2018, 2:58 p.m. UTC | #1
On Fri, Feb 02, 2018 at 08:05:29PM +0800, Heyi Guo wrote:
> Move definition of Madt struct to head file, so PPTT driver

> can include it.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ming Huang <huangming23@huawei.com>

> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>

> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> Reviewed-by: Graeme Gregory <graeme@xora.org.uk>

> Reveiwed-by: Jeremy Linton <jeremy.linton@arm.com>


Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>


> ---

>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h | 30 +++++++++++++++++++-

>  Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  | 23 +--------------

>  2 files changed, 30 insertions(+), 23 deletions(-)

> 

> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h

> index 808219a..ad73aa2 100644

> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h

> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h

> @@ -1,7 +1,7 @@

>  /** @file

>  *

>  *  Copyright (c) 2011-2015, ARM Limited. All rights reserved.

> -*  Copyright (c) 2015-2016, Hisilicon Limited. All rights reserved.

> +*  Copyright (c) 2015-2018, Hisilicon Limited. All rights reserved.

>  *  Copyright (c) 2015-2016, Linaro Limited. All rights reserved.

>  *

>  *  This program and the accompanying materials

> @@ -20,6 +20,8 @@

>  #ifndef _HI1610_PLATFORM_H_

>  #define _HI1610_PLATFORM_H_

>  

> +#include <IndustryStandard/Acpi.h>

> +

>  //

>  // ACPI table information used to initialize tables.

>  //

> @@ -44,5 +46,31 @@

>    }

>  

>  #define HI1616_WATCHDOG_COUNT  2

> +#define HI1616_GIC_STRUCTURE_COUNT  64

> +

> +#define HI1616_MPID_TA_BASE  0x10000

> +#define HI1616_MPID_TB_BASE  0x30000

> +#define HI1616_MPID_TA_2_BASE  0x50000

> +#define HI1616_MPID_TB_2_BASE  0x70000

> +

> +// Differs from Juno, we have another affinity level beyond cluster and core

> +#define PLATFORM_GET_MPID_TA(ClusterId, CoreId)   (HI1616_MPID_TA_BASE | ((ClusterId) << 8) | (CoreId))

> +#define PLATFORM_GET_MPID_TB(ClusterId, CoreId)   (HI1616_MPID_TB_BASE | ((ClusterId) << 8) | (CoreId))

> +#define PLATFORM_GET_MPID_TA_2(ClusterId, CoreId)   (HI1616_MPID_TA_2_BASE | ((ClusterId) << 8) | (CoreId))

> +#define PLATFORM_GET_MPID_TB_2(ClusterId, CoreId)   (HI1616_MPID_TB_2_BASE | ((ClusterId) << 8) | (CoreId))

> +

> +//

> +// Multiple APIC Description Table

> +//

> +#pragma pack (1)

> +

> +typedef struct {

> +  EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER   Header;

> +  EFI_ACPI_6_1_GIC_STRUCTURE                            GicInterfaces[HI1616_GIC_STRUCTURE_COUNT];

> +  EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE                GicDistributor;

> +  EFI_ACPI_6_1_GIC_ITS_STRUCTURE                        GicITS[8];

> +} EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE;

> +

> +#pragma pack ()

>  

>  #endif

> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc

> index 169ee72..54605a6 100644

> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc

> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc

> @@ -2,7 +2,7 @@

>  *  Multiple APIC Description Table (MADT)

>  *

>  *  Copyright (c) 2012 - 2014, ARM Limited. All rights reserved.

> -*  Copyright (c) 2015 - 2016, Hisilicon Limited. All rights reserved.

> +*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.

>  *  Copyright (c) 2015 - 2016, Linaro Limited. All rights reserved.

>  *

>  *  This program and the accompanying materials

> @@ -27,27 +27,6 @@

>  #include <Library/PcdLib.h>

>  #include "Hi1616Platform.h"

>  

> -// Differs from Juno, we have another affinity level beyond cluster and core

> -// 0x20000 is only for socket 0

> -#define PLATFORM_GET_MPID_TA(ClusterId, CoreId)   (0x10000 | ((ClusterId) << 8) | (CoreId))

> -#define PLATFORM_GET_MPID_TB(ClusterId, CoreId)   (0x30000 | ((ClusterId) << 8) | (CoreId))

> -#define PLATFORM_GET_MPID_TA_2(ClusterId, CoreId)   (0x50000 | ((ClusterId) << 8) | (CoreId))

> -#define PLATFORM_GET_MPID_TB_2(ClusterId, CoreId)   (0x70000 | ((ClusterId) << 8) | (CoreId))

> -

> -//

> -// Multiple APIC Description Table

> -//

> -#pragma pack (1)

> -

> -typedef struct {

> -  EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER   Header;

> -  EFI_ACPI_6_1_GIC_STRUCTURE                            GicInterfaces[64];

> -  EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE                GicDistributor;

> -  EFI_ACPI_6_1_GIC_ITS_STRUCTURE                      GicITS[8];

> -} EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE;

> -

> -#pragma pack ()

> -

>  EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {

>    {

>      ARM_ACPI_HEADER (

> -- 

> 1.9.1

> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
index 808219a..ad73aa2 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
@@ -1,7 +1,7 @@ 
 /** @file
 *
 *  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
-*  Copyright (c) 2015-2016, Hisilicon Limited. All rights reserved.
+*  Copyright (c) 2015-2018, Hisilicon Limited. All rights reserved.
 *  Copyright (c) 2015-2016, Linaro Limited. All rights reserved.
 *
 *  This program and the accompanying materials
@@ -20,6 +20,8 @@ 
 #ifndef _HI1610_PLATFORM_H_
 #define _HI1610_PLATFORM_H_
 
+#include <IndustryStandard/Acpi.h>
+
 //
 // ACPI table information used to initialize tables.
 //
@@ -44,5 +46,31 @@ 
   }
 
 #define HI1616_WATCHDOG_COUNT  2
+#define HI1616_GIC_STRUCTURE_COUNT  64
+
+#define HI1616_MPID_TA_BASE  0x10000
+#define HI1616_MPID_TB_BASE  0x30000
+#define HI1616_MPID_TA_2_BASE  0x50000
+#define HI1616_MPID_TB_2_BASE  0x70000
+
+// Differs from Juno, we have another affinity level beyond cluster and core
+#define PLATFORM_GET_MPID_TA(ClusterId, CoreId)   (HI1616_MPID_TA_BASE | ((ClusterId) << 8) | (CoreId))
+#define PLATFORM_GET_MPID_TB(ClusterId, CoreId)   (HI1616_MPID_TB_BASE | ((ClusterId) << 8) | (CoreId))
+#define PLATFORM_GET_MPID_TA_2(ClusterId, CoreId)   (HI1616_MPID_TA_2_BASE | ((ClusterId) << 8) | (CoreId))
+#define PLATFORM_GET_MPID_TB_2(ClusterId, CoreId)   (HI1616_MPID_TB_2_BASE | ((ClusterId) << 8) | (CoreId))
+
+//
+// Multiple APIC Description Table
+//
+#pragma pack (1)
+
+typedef struct {
+  EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER   Header;
+  EFI_ACPI_6_1_GIC_STRUCTURE                            GicInterfaces[HI1616_GIC_STRUCTURE_COUNT];
+  EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE                GicDistributor;
+  EFI_ACPI_6_1_GIC_ITS_STRUCTURE                        GicITS[8];
+} EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE;
+
+#pragma pack ()
 
 #endif
diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
index 169ee72..54605a6 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
@@ -2,7 +2,7 @@ 
 *  Multiple APIC Description Table (MADT)
 *
 *  Copyright (c) 2012 - 2014, ARM Limited. All rights reserved.
-*  Copyright (c) 2015 - 2016, Hisilicon Limited. All rights reserved.
+*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
 *  Copyright (c) 2015 - 2016, Linaro Limited. All rights reserved.
 *
 *  This program and the accompanying materials
@@ -27,27 +27,6 @@ 
 #include <Library/PcdLib.h>
 #include "Hi1616Platform.h"
 
-// Differs from Juno, we have another affinity level beyond cluster and core
-// 0x20000 is only for socket 0
-#define PLATFORM_GET_MPID_TA(ClusterId, CoreId)   (0x10000 | ((ClusterId) << 8) | (CoreId))
-#define PLATFORM_GET_MPID_TB(ClusterId, CoreId)   (0x30000 | ((ClusterId) << 8) | (CoreId))
-#define PLATFORM_GET_MPID_TA_2(ClusterId, CoreId)   (0x50000 | ((ClusterId) << 8) | (CoreId))
-#define PLATFORM_GET_MPID_TB_2(ClusterId, CoreId)   (0x70000 | ((ClusterId) << 8) | (CoreId))
-
-//
-// Multiple APIC Description Table
-//
-#pragma pack (1)
-
-typedef struct {
-  EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER   Header;
-  EFI_ACPI_6_1_GIC_STRUCTURE                            GicInterfaces[64];
-  EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE                GicDistributor;
-  EFI_ACPI_6_1_GIC_ITS_STRUCTURE                      GicITS[8];
-} EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE;
-
-#pragma pack ()
-
 EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
   {
     ARM_ACPI_HEADER (