Re: [edk2] [PATCH edk2-platforms v1 01/14] Hisilicon/D05: Add PPTT support

2018-01-25 Thread Jeremy Linton

Hi,

On 01/24/2018 11:56 PM, Huangming (Mark) wrote:



On 2018/1/24 5:29, Jeremy Linton wrote:

Hi,


On 01/18/2018 09:01 AM, Ming Huang wrote:

From: Jason Zhang 

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jason Zhang 
Signed-off-by: Ming Huang 
Signed-off-by: Heyi Guo 
---
   Platform/Hisilicon/D05/D05.dsc  |   1 +
   Platform/Hisilicon/D05/D05.fdf  |   1 +
   Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h |  27 ++
   Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  |  31 +-
   Silicon/Hisilicon/Hi1616/Pptt/Pptt.c| 447 

   Silicon/Hisilicon/Hi1616/Pptt/Pptt.h| 142 +++
   Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf  |  55 +++
   7 files changed, 677 insertions(+), 27 deletions(-)

diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
index 77a89fd..710339c 100644
--- a/Platform/Hisilicon/D05/D05.dsc
+++ b/Platform/Hisilicon/D05/D05.dsc
@@ -506,6 +506,7 @@
 MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
   Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
+  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
 Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
   #
diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
index 78ab0c8..97de4d2 100644
--- a/Platform/Hisilicon/D05/D05.fdf
+++ b/Platform/Hisilicon/D05/D05.fdf
@@ -241,6 +241,7 @@ READ_LOCK_STATUS   = TRUE
 INF Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
   INF RuleOverride=ACPITABLE 
Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
+  INF Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
 INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
   #
diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h 
b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
index 808219a..f1927e8 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
@@ -19,6 +19,7 @@
 #ifndef _HI1610_PLATFORM_H_
   #define _HI1610_PLATFORM_H_
+#include 
 //
   // ACPI table information used to initialize tables.
@@ -44,5 +45,31 @@
 }
 #define HI1616_WATCHDOG_COUNT  2
+#define HI1616_GIC_STRUCTURE_COUNT  64
+
+#define HI1616_MPID_TA_BASE  0x1
+#define HI1616_MPID_TB_BASE  0x3
+#define HI1616_MPID_TA_2_BASE  0x5
+#define HI1616_MPID_TB_2_BASE  0x7
+
+// 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_STRUCTUREGicDistributor;
+  EFI_ACPI_6_1_GIC_ITS_STRUCTUREGicITS[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..33dca03 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
@@ -1,9 +1,9 @@
   /** @file
   *  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 - 2016, Linaro Limited. All rights reserved.
+*  Copyright (c) 2012 - 2018, ARM Limited. All rights reserved.
+*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
+*  Copyright (c) 2015 - 2018, Linaro Limited. All rights reserved.
   *
   *  This program and the accompanying materials
   *
@@ -19,34 +19,11 @@
   *
   **/
   -
-#include 
+#include "Hi1616Platform.h"
   #include 
   #include 
   #include 
   #include 
-#include "Hi1616Platform.h"
-
-// Differs from Juno, we have another affinity level beyond cluster and core
-// 0x2 is only for socket 0
-#define PLATFORM_GET_MPID_TA(ClusterId, CoreId)   (0x1 | ((ClusterId) << 
8) | (CoreId))
-#define PLATFORM_GET_MPID_TB(ClusterId, CoreId)   (0x3 | ((ClusterId) << 
8) | (CoreId))
-#define PLATFORM_GET_MPID_TA_2(ClusterId, CoreId)   (0x5 | ((ClusterId) << 
8) | (CoreId))

Re: [edk2] [PATCH edk2-platforms v1 01/14] Hisilicon/D05: Add PPTT support

2018-01-24 Thread Huangming (Mark)


On 2018/1/24 5:29, Jeremy Linton wrote:
> Hi,
> 
> 
> On 01/18/2018 09:01 AM, Ming Huang wrote:
>> From: Jason Zhang 
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Jason Zhang 
>> Signed-off-by: Ming Huang 
>> Signed-off-by: Heyi Guo 
>> ---
>>   Platform/Hisilicon/D05/D05.dsc  |   1 +
>>   Platform/Hisilicon/D05/D05.fdf  |   1 +
>>   Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h |  27 ++
>>   Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  |  31 +-
>>   Silicon/Hisilicon/Hi1616/Pptt/Pptt.c| 447 
>> 
>>   Silicon/Hisilicon/Hi1616/Pptt/Pptt.h| 142 +++
>>   Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf  |  55 +++
>>   7 files changed, 677 insertions(+), 27 deletions(-)
>>
>> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
>> index 77a89fd..710339c 100644
>> --- a/Platform/Hisilicon/D05/D05.dsc
>> +++ b/Platform/Hisilicon/D05/D05.dsc
>> @@ -506,6 +506,7 @@
>> MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
>>   Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> +  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>> Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>>   #
>> diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
>> index 78ab0c8..97de4d2 100644
>> --- a/Platform/Hisilicon/D05/D05.fdf
>> +++ b/Platform/Hisilicon/D05/D05.fdf
>> @@ -241,6 +241,7 @@ READ_LOCK_STATUS   = TRUE
>> INF Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
>>   INF RuleOverride=ACPITABLE 
>> Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> +  INF Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>> INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>>   #
>> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h 
>> b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> index 808219a..f1927e8 100644
>> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> @@ -19,6 +19,7 @@
>> #ifndef _HI1610_PLATFORM_H_
>>   #define _HI1610_PLATFORM_H_
>> +#include 
>> //
>>   // ACPI table information used to initialize tables.
>> @@ -44,5 +45,31 @@
>> }
>> #define HI1616_WATCHDOG_COUNT  2
>> +#define HI1616_GIC_STRUCTURE_COUNT  64
>> +
>> +#define HI1616_MPID_TA_BASE  0x1
>> +#define HI1616_MPID_TB_BASE  0x3
>> +#define HI1616_MPID_TA_2_BASE  0x5
>> +#define HI1616_MPID_TB_2_BASE  0x7
>> +
>> +// 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_STRUCTUREGicDistributor;
>> +  EFI_ACPI_6_1_GIC_ITS_STRUCTUREGicITS[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..33dca03 100644
>> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
>> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
>> @@ -1,9 +1,9 @@
>>   /** @file
>>   *  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 - 2016, Linaro Limited. All rights reserved.
>> +*  Copyright (c) 2012 - 2018, ARM Limited. All rights reserved.
>> +*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
>> +*  Copyright (c) 2015 - 2018, Linaro Limited. All rights reserved.
>>   *
>>   *  This program and the accompanying materials
>>   *
>> @@ -19,34 +19,11 @@
>>   *
>>   **/
>>   -
>> -#include 
>> +#include "Hi1616Platform.h"
>>   #include 
>>   #include 
>>   #include 
>>   #include 
>> -#include "Hi1616Platform.h"
>> -
>> -// Differs from Juno, we have another affinity level beyond cluster and core
>> -// 0x2 is only for socket 0
>> -#define 

Re: [edk2] [PATCH edk2-platforms v1 01/14] Hisilicon/D05: Add PPTT support

2018-01-24 Thread graeme . gregory
On Mon, Jan 22, 2018 at 01:53:18PM +, Leif Lindholm wrote:
> Detailed commit description, please.
> 
> Graeme - any comments on ACPIness?
> 
I think Jeremy probably gave it a much more in depth review than I can
below.

Once he is happy Ill be happy.

Graeme

> On Thu, Jan 18, 2018 at 11:01:30PM +0800, Ming Huang wrote:
> > From: Jason Zhang 
> > 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Jason Zhang 
> > Signed-off-by: Ming Huang 
> > Signed-off-by: Heyi Guo 
> > ---
> >  Platform/Hisilicon/D05/D05.dsc  |   1 +
> >  Platform/Hisilicon/D05/D05.fdf  |   1 +
> >  Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h |  27 ++
> >  Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  |  31 +-
> >  Silicon/Hisilicon/Hi1616/Pptt/Pptt.c| 447 
> > 
> >  Silicon/Hisilicon/Hi1616/Pptt/Pptt.h| 142 +++
> >  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf  |  55 +++
> >  7 files changed, 677 insertions(+), 27 deletions(-)
> > 
> > diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> > index 77a89fd..710339c 100644
> > --- a/Platform/Hisilicon/D05/D05.dsc
> > +++ b/Platform/Hisilicon/D05/D05.dsc
> > @@ -506,6 +506,7 @@
> >MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> >  
> >Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> > +  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
> >Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
> >  
> >#
> > diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
> > index 78ab0c8..97de4d2 100644
> > --- a/Platform/Hisilicon/D05/D05.fdf
> > +++ b/Platform/Hisilicon/D05/D05.fdf
> > @@ -241,6 +241,7 @@ READ_LOCK_STATUS   = TRUE
> >INF Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> >  
> >INF RuleOverride=ACPITABLE 
> > Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> > +  INF Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
> >INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
> >  
> >#
> > diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h 
> > b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
> > index 808219a..f1927e8 100644
> > --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
> > +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
> 
> As far as I can tell, all of the changes to this file (and the
> resulting counterpart in
> Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc) are
> non-functional.
> 
> Please break these changes out as a separate patch.
> This is good cleanup, but unrelated to the stated change.
> 
> > @@ -19,6 +19,7 @@
> >  
> >  #ifndef _HI1610_PLATFORM_H_
> >  #define _HI1610_PLATFORM_H_
> > +#include 
> >  
> >  //
> >  // ACPI table information used to initialize tables.
> > @@ -44,5 +45,31 @@
> >}
> >  
> >  #define HI1616_WATCHDOG_COUNT  2
> > +#define HI1616_GIC_STRUCTURE_COUNT  64
> > +
> > +#define HI1616_MPID_TA_BASE  0x1
> > +#define HI1616_MPID_TB_BASE  0x3
> > +#define HI1616_MPID_TA_2_BASE  0x5
> > +#define HI1616_MPID_TB_2_BASE  0x7
> > +
> > +// 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_STRUCTUREGicDistributor;
> > +  EFI_ACPI_6_1_GIC_ITS_STRUCTUREGicITS[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..33dca03 100644
> > --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
> > +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
> > @@ -1,9 +1,9 @@
> >  /** @file
> >  *  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 - 2016, Linaro Limited. 

Re: [edk2] [PATCH edk2-platforms v1 01/14] Hisilicon/D05: Add PPTT support

2018-01-23 Thread Huangming (Mark)


On 2018/1/24 5:29, Jeremy Linton wrote:
> Hi,
> 
> 
> On 01/18/2018 09:01 AM, Ming Huang wrote:
>> From: Jason Zhang 
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Jason Zhang 
>> Signed-off-by: Ming Huang 
>> Signed-off-by: Heyi Guo 
>> ---
>>   Platform/Hisilicon/D05/D05.dsc  |   1 +
>>   Platform/Hisilicon/D05/D05.fdf  |   1 +
>>   Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h |  27 ++
>>   Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  |  31 +-
>>   Silicon/Hisilicon/Hi1616/Pptt/Pptt.c| 447 
>> 
>>   Silicon/Hisilicon/Hi1616/Pptt/Pptt.h| 142 +++
>>   Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf  |  55 +++
>>   7 files changed, 677 insertions(+), 27 deletions(-)
>>
>> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
>> index 77a89fd..710339c 100644
>> --- a/Platform/Hisilicon/D05/D05.dsc
>> +++ b/Platform/Hisilicon/D05/D05.dsc
>> @@ -506,6 +506,7 @@
>> MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
>>   Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> +  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>> Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>>   #
>> diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
>> index 78ab0c8..97de4d2 100644
>> --- a/Platform/Hisilicon/D05/D05.fdf
>> +++ b/Platform/Hisilicon/D05/D05.fdf
>> @@ -241,6 +241,7 @@ READ_LOCK_STATUS   = TRUE
>> INF Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
>>   INF RuleOverride=ACPITABLE 
>> Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> +  INF Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>> INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>>   #
>> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h 
>> b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> index 808219a..f1927e8 100644
>> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> @@ -19,6 +19,7 @@
>> #ifndef _HI1610_PLATFORM_H_
>>   #define _HI1610_PLATFORM_H_
>> +#include 
>> //
>>   // ACPI table information used to initialize tables.
>> @@ -44,5 +45,31 @@
>> }
>> #define HI1616_WATCHDOG_COUNT  2
>> +#define HI1616_GIC_STRUCTURE_COUNT  64
>> +
>> +#define HI1616_MPID_TA_BASE  0x1
>> +#define HI1616_MPID_TB_BASE  0x3
>> +#define HI1616_MPID_TA_2_BASE  0x5
>> +#define HI1616_MPID_TB_2_BASE  0x7
>> +
>> +// 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_STRUCTUREGicDistributor;
>> +  EFI_ACPI_6_1_GIC_ITS_STRUCTUREGicITS[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..33dca03 100644
>> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
>> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
>> @@ -1,9 +1,9 @@
>>   /** @file
>>   *  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 - 2016, Linaro Limited. All rights reserved.
>> +*  Copyright (c) 2012 - 2018, ARM Limited. All rights reserved.
>> +*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
>> +*  Copyright (c) 2015 - 2018, Linaro Limited. All rights reserved.
>>   *
>>   *  This program and the accompanying materials
>>   *
>> @@ -19,34 +19,11 @@
>>   *
>>   **/
>>   -
>> -#include 
>> +#include "Hi1616Platform.h"
>>   #include 
>>   #include 
>>   #include 
>>   #include 
>> -#include "Hi1616Platform.h"
>> -
>> -// Differs from Juno, we have another affinity level beyond cluster and core
>> -// 0x2 is only for socket 0
>> -#define 

Re: [edk2] [PATCH edk2-platforms v1 01/14] Hisilicon/D05: Add PPTT support

2018-01-22 Thread Huangming (Mark)


On 2018/1/20 18:16, Ard Biesheuvel wrote:
> On 18 January 2018 at 15:01, Ming Huang  wrote:
>> From: Jason Zhang 
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Jason Zhang 
>> Signed-off-by: Ming Huang 
>> Signed-off-by: Heyi Guo 
>> ---
>>  Platform/Hisilicon/D05/D05.dsc  |   1 +
>>  Platform/Hisilicon/D05/D05.fdf  |   1 +
>>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h |  27 ++
>>  Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  |  31 +-
>>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.c| 447 
>> 
>>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.h| 142 +++
>>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf  |  55 +++
>>  7 files changed, 677 insertions(+), 27 deletions(-)
>>
>> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
>> index 77a89fd..710339c 100644
>> --- a/Platform/Hisilicon/D05/D05.dsc
>> +++ b/Platform/Hisilicon/D05/D05.dsc
>> @@ -506,6 +506,7 @@
>>MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
>>
>>Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> +  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>>Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>>
>>#
>> diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
>> index 78ab0c8..97de4d2 100644
>> --- a/Platform/Hisilicon/D05/D05.fdf
>> +++ b/Platform/Hisilicon/D05/D05.fdf
>> @@ -241,6 +241,7 @@ READ_LOCK_STATUS   = TRUE
>>INF Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
>>
>>INF RuleOverride=ACPITABLE 
>> Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> +  INF Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>>INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>>
>>#
>> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h 
>> b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> index 808219a..f1927e8 100644
>> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> @@ -19,6 +19,7 @@
>>
>>  #ifndef _HI1610_PLATFORM_H_
>>  #define _HI1610_PLATFORM_H_
>> +#include 
>>
> 
> Empty line before ^^^ please
> 
>>  //
>>  // ACPI table information used to initialize tables.
>> @@ -44,5 +45,31 @@
>>}
>>
>>  #define HI1616_WATCHDOG_COUNT  2
>> +#define HI1616_GIC_STRUCTURE_COUNT  64
>> +
>> +#define HI1616_MPID_TA_BASE  0x1
>> +#define HI1616_MPID_TB_BASE  0x3
>> +#define HI1616_MPID_TA_2_BASE  0x5
>> +#define HI1616_MPID_TB_2_BASE  0x7
>> +
>> +// 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_STRUCTUREGicDistributor;
>> +  EFI_ACPI_6_1_GIC_ITS_STRUCTUREGicITS[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..33dca03 100644
>> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
>> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
>> @@ -1,9 +1,9 @@
>>  /** @file
>>  *  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 - 2016, Linaro Limited. All rights reserved.
>> +*  Copyright (c) 2012 - 2018, ARM Limited. All rights reserved.
>> +*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
>> +*  Copyright (c) 2015 - 2018, Linaro Limited. All rights reserved.
> 
> Please don't touch the copyright statements belonging to other companies
> 
>>  *
>>  *  This program and the accompanying materials
>>  *
>> @@ -19,34 +19,11 @@
>>  *
>>  **/
>>
>> -
>> -#include 
>> +#include "Hi1616Platform.h"
>>  #include 
>>  #include 
>>  #include 
>>  #include 
>> -#include "Hi1616Platform.h"
>> -
>> -// Differs from Juno, we have 

Re: [edk2] [PATCH edk2-platforms v1 01/14] Hisilicon/D05: Add PPTT support

2018-01-22 Thread Leif Lindholm
On Mon, Jan 22, 2018 at 01:53:18PM +, Leif Lindholm wrote:
> > diff --git a/Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf 
> > b/Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
> > new file mode 100644
> > index 000..ce26b97
> > --- /dev/null
> > +++ b/Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
> > @@ -0,0 +1,55 @@
> > +/** @file
> > +*
> > +*  Copyright (c) 2017, Hisilicon Limited. All rights reserved.
> > +*  Copyright (c) 2017, Linaro Limited. All rights reserved.
> 
> 2018?
> 
> > +*
> > +*  This program and the accompanying materials
> > +*  are licensed and made available under the terms and conditions of the 
> > BSD License
> > +*  which accompanies this distribution.  The full text of the license may 
> > be found at
> > +*  http://opensource.org/licenses/bsd-license.php
> > +*
> > +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> > +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> > IMPLIED.
> > +*
> > +*  Based on the files under ArmPlatformPkg/ArmJunoPkg/AcpiTables/
> 
> Platform/ARM/JunoPkg/AcpiTables.
> 
> > +*
> > +**/
> > +
> > +[Defines]
> > +  INF_VERSION= 0x00010005
> 
> A new .inf should probably claim 0x00010020.

WARNING: extended periods of non-work may adversely affect your
 hexadecimal arithmetic skills.

Clearly this should say 0x0001001a for 1.26. (Thanks, Ard.)

/
Leif

> > +  BASE_NAME  = AcpiPptt
> > +  FILE_GUID  = AAB14F90-DC2E-4f33-A594-C7894A5B412D
> > +  MODULE_TYPE= DXE_DRIVER
> > +  VERSION_STRING = 1.0
> > +  ENTRY_POINT= PpttEntryPoint
> > +
> > +[Sources.common]
> > +  Pptt.c
> > +  Pptt.h
> > +
> > +[Packages]
> > +  MdePkg/MdePkg.dec
> > +  edk2-platforms/Silicon/Hisilicon/HisiPkg.dec
> 
> This is incorrect - path resolution should be using PACKAGES_PATH and
> refer only to Silicon/Hisilicon/HisiPkg.dec.
> 
> > +  ArmPkg/ArmPkg.dec
> 
> Please sort these alphabetically.
> 
> > +
> > +[LibraryClasses]
> > +  ArmLib
> > +  HobLib
> > +  UefiRuntimeServicesTableLib
> > +  UefiDriverEntryPoint
> > +  BaseMemoryLib
> > +  DebugLib
> 
> Please sort these alphabetically.
> 
> > +
> > +[Guids]
> > +
> > +
> > +[Protocols]
> > +  gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED
> > +  gEfiAcpiSdtProtocolGuid
> 
> Please sort these alphabetically (where there is not a more logical
> grouping available).
> 
> /
> Leif
> 
> > +
> > +[Pcd]
> > +
> > +
> > +[Depex]
> > +  gEfiAcpiTableProtocolGuid AND gEfiAcpiSdtProtocolGuid
> > +
> > -- 
> > 1.9.1
> > 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v1 01/14] Hisilicon/D05: Add PPTT support

2018-01-22 Thread Leif Lindholm
Detailed commit description, please.

Graeme - any comments on ACPIness?

On Thu, Jan 18, 2018 at 11:01:30PM +0800, Ming Huang wrote:
> From: Jason Zhang 
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jason Zhang 
> Signed-off-by: Ming Huang 
> Signed-off-by: Heyi Guo 
> ---
>  Platform/Hisilicon/D05/D05.dsc  |   1 +
>  Platform/Hisilicon/D05/D05.fdf  |   1 +
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h |  27 ++
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  |  31 +-
>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.c| 447 
> 
>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.h| 142 +++
>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf  |  55 +++
>  7 files changed, 677 insertions(+), 27 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> index 77a89fd..710339c 100644
> --- a/Platform/Hisilicon/D05/D05.dsc
> +++ b/Platform/Hisilicon/D05/D05.dsc
> @@ -506,6 +506,7 @@
>MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
>  
>Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> +  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>  
>#
> diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
> index 78ab0c8..97de4d2 100644
> --- a/Platform/Hisilicon/D05/D05.fdf
> +++ b/Platform/Hisilicon/D05/D05.fdf
> @@ -241,6 +241,7 @@ READ_LOCK_STATUS   = TRUE
>INF Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
>  
>INF RuleOverride=ACPITABLE 
> Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> +  INF Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>  
>#
> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h 
> b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
> index 808219a..f1927e8 100644
> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h

As far as I can tell, all of the changes to this file (and the
resulting counterpart in
Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc) are
non-functional.

Please break these changes out as a separate patch.
This is good cleanup, but unrelated to the stated change.

> @@ -19,6 +19,7 @@
>  
>  #ifndef _HI1610_PLATFORM_H_
>  #define _HI1610_PLATFORM_H_
> +#include 
>  
>  //
>  // ACPI table information used to initialize tables.
> @@ -44,5 +45,31 @@
>}
>  
>  #define HI1616_WATCHDOG_COUNT  2
> +#define HI1616_GIC_STRUCTURE_COUNT  64
> +
> +#define HI1616_MPID_TA_BASE  0x1
> +#define HI1616_MPID_TB_BASE  0x3
> +#define HI1616_MPID_TA_2_BASE  0x5
> +#define HI1616_MPID_TB_2_BASE  0x7
> +
> +// 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_STRUCTUREGicDistributor;
> +  EFI_ACPI_6_1_GIC_ITS_STRUCTUREGicITS[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..33dca03 100644
> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
> @@ -1,9 +1,9 @@
>  /** @file
>  *  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 - 2016, Linaro Limited. All rights reserved.
> +*  Copyright (c) 2012 - 2018, ARM Limited. All rights reserved.
> +*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2015 - 2018, Linaro Limited. All rights reserved.

As mentioned by Ard elsewhere in the series - please only update your
own copyright dates. (I will not point this out through the rest of
the review, but please address throughout for v2.)

> 

Re: [edk2] [PATCH edk2-platforms v1 01/14] Hisilicon/D05: Add PPTT support

2018-01-22 Thread Huangming (Mark)


On 2018/1/20 18:16, Ard Biesheuvel wrote:
> On 18 January 2018 at 15:01, Ming Huang  wrote:
>> From: Jason Zhang 
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Jason Zhang 
>> Signed-off-by: Ming Huang 
>> Signed-off-by: Heyi Guo 
>> ---
>>  Platform/Hisilicon/D05/D05.dsc  |   1 +
>>  Platform/Hisilicon/D05/D05.fdf  |   1 +
>>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h |  27 ++
>>  Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  |  31 +-
>>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.c| 447 
>> 
>>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.h| 142 +++
>>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf  |  55 +++
>>  7 files changed, 677 insertions(+), 27 deletions(-)
>>
>> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
>> index 77a89fd..710339c 100644
>> --- a/Platform/Hisilicon/D05/D05.dsc
>> +++ b/Platform/Hisilicon/D05/D05.dsc
>> @@ -506,6 +506,7 @@
>>MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
>>
>>Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> +  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>>Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>>
>>#
>> diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
>> index 78ab0c8..97de4d2 100644
>> --- a/Platform/Hisilicon/D05/D05.fdf
>> +++ b/Platform/Hisilicon/D05/D05.fdf
>> @@ -241,6 +241,7 @@ READ_LOCK_STATUS   = TRUE
>>INF Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
>>
>>INF RuleOverride=ACPITABLE 
>> Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> +  INF Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>>INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>>
>>#
>> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h 
>> b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> index 808219a..f1927e8 100644
>> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
>> @@ -19,6 +19,7 @@
>>
>>  #ifndef _HI1610_PLATFORM_H_
>>  #define _HI1610_PLATFORM_H_
>> +#include 
>>
> 
> Empty line before ^^^ please
> 
>>  //
>>  // ACPI table information used to initialize tables.
>> @@ -44,5 +45,31 @@
>>}
>>
>>  #define HI1616_WATCHDOG_COUNT  2
>> +#define HI1616_GIC_STRUCTURE_COUNT  64
>> +
>> +#define HI1616_MPID_TA_BASE  0x1
>> +#define HI1616_MPID_TB_BASE  0x3
>> +#define HI1616_MPID_TA_2_BASE  0x5
>> +#define HI1616_MPID_TB_2_BASE  0x7
>> +
>> +// 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_STRUCTUREGicDistributor;
>> +  EFI_ACPI_6_1_GIC_ITS_STRUCTUREGicITS[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..33dca03 100644
>> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
>> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
>> @@ -1,9 +1,9 @@
>>  /** @file
>>  *  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 - 2016, Linaro Limited. All rights reserved.
>> +*  Copyright (c) 2012 - 2018, ARM Limited. All rights reserved.
>> +*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
>> +*  Copyright (c) 2015 - 2018, Linaro Limited. All rights reserved.
> 
> Please don't touch the copyright statements belonging to other companies
> 
>>  *
>>  *  This program and the accompanying materials
>>  *
>> @@ -19,34 +19,11 @@
>>  *
>>  **/
>>
>> -
>> -#include 
>> +#include "Hi1616Platform.h"
>>  #include 
>>  #include 
>>  #include 
>>  #include 
>> -#include "Hi1616Platform.h"
>> -
>> -// Differs from Juno, we have 

Re: [edk2] [PATCH edk2-platforms v1 01/14] Hisilicon/D05: Add PPTT support

2018-01-20 Thread Ard Biesheuvel
On 18 January 2018 at 15:01, Ming Huang  wrote:
> From: Jason Zhang 
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jason Zhang 
> Signed-off-by: Ming Huang 
> Signed-off-by: Heyi Guo 
> ---
>  Platform/Hisilicon/D05/D05.dsc  |   1 +
>  Platform/Hisilicon/D05/D05.fdf  |   1 +
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h |  27 ++
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  |  31 +-
>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.c| 447 
> 
>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.h| 142 +++
>  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf  |  55 +++
>  7 files changed, 677 insertions(+), 27 deletions(-)
>
> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> index 77a89fd..710339c 100644
> --- a/Platform/Hisilicon/D05/D05.dsc
> +++ b/Platform/Hisilicon/D05/D05.dsc
> @@ -506,6 +506,7 @@
>MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
>
>Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> +  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>
>#
> diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
> index 78ab0c8..97de4d2 100644
> --- a/Platform/Hisilicon/D05/D05.fdf
> +++ b/Platform/Hisilicon/D05/D05.fdf
> @@ -241,6 +241,7 @@ READ_LOCK_STATUS   = TRUE
>INF Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
>
>INF RuleOverride=ACPITABLE 
> Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> +  INF Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
>INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>
>#
> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h 
> b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
> index 808219a..f1927e8 100644
> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
> @@ -19,6 +19,7 @@
>
>  #ifndef _HI1610_PLATFORM_H_
>  #define _HI1610_PLATFORM_H_
> +#include 
>

Empty line before ^^^ please

>  //
>  // ACPI table information used to initialize tables.
> @@ -44,5 +45,31 @@
>}
>
>  #define HI1616_WATCHDOG_COUNT  2
> +#define HI1616_GIC_STRUCTURE_COUNT  64
> +
> +#define HI1616_MPID_TA_BASE  0x1
> +#define HI1616_MPID_TB_BASE  0x3
> +#define HI1616_MPID_TA_2_BASE  0x5
> +#define HI1616_MPID_TB_2_BASE  0x7
> +
> +// 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_STRUCTUREGicDistributor;
> +  EFI_ACPI_6_1_GIC_ITS_STRUCTUREGicITS[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..33dca03 100644
> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
> @@ -1,9 +1,9 @@
>  /** @file
>  *  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 - 2016, Linaro Limited. All rights reserved.
> +*  Copyright (c) 2012 - 2018, ARM Limited. All rights reserved.
> +*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2015 - 2018, Linaro Limited. All rights reserved.

Please don't touch the copyright statements belonging to other companies

>  *
>  *  This program and the accompanying materials
>  *
> @@ -19,34 +19,11 @@
>  *
>  **/
>
> -
> -#include 
> +#include "Hi1616Platform.h"
>  #include 
>  #include 
>  #include 
>  #include 
> -#include "Hi1616Platform.h"
> -
> -// Differs from Juno, we have another affinity level beyond cluster and core
> -// 0x2 is only for socket 0
> -#define PLATFORM_GET_MPID_TA(ClusterId, CoreId)   (0x1 | ((ClusterId) << 
> 8) | (CoreId))
> 

[edk2] [PATCH edk2-platforms v1 01/14] Hisilicon/D05: Add PPTT support

2018-01-18 Thread Ming Huang
From: Jason Zhang 

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jason Zhang 
Signed-off-by: Ming Huang 
Signed-off-by: Heyi Guo 
---
 Platform/Hisilicon/D05/D05.dsc  |   1 +
 Platform/Hisilicon/D05/D05.fdf  |   1 +
 Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h |  27 ++
 Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc  |  31 +-
 Silicon/Hisilicon/Hi1616/Pptt/Pptt.c| 447 

 Silicon/Hisilicon/Hi1616/Pptt/Pptt.h| 142 +++
 Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf  |  55 +++
 7 files changed, 677 insertions(+), 27 deletions(-)

diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
index 77a89fd..710339c 100644
--- a/Platform/Hisilicon/D05/D05.dsc
+++ b/Platform/Hisilicon/D05/D05.dsc
@@ -506,6 +506,7 @@
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
 
   Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
+  Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
   Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
 
   #
diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
index 78ab0c8..97de4d2 100644
--- a/Platform/Hisilicon/D05/D05.fdf
+++ b/Platform/Hisilicon/D05/D05.fdf
@@ -241,6 +241,7 @@ READ_LOCK_STATUS   = TRUE
   INF Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
 
   INF RuleOverride=ACPITABLE 
Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
+  INF Silicon/Hisilicon/Hi1616/Pptt/Pptt.inf
   INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
 
   #
diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h 
b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
index 808219a..f1927e8 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h
@@ -19,6 +19,7 @@
 
 #ifndef _HI1610_PLATFORM_H_
 #define _HI1610_PLATFORM_H_
+#include 
 
 //
 // ACPI table information used to initialize tables.
@@ -44,5 +45,31 @@
   }
 
 #define HI1616_WATCHDOG_COUNT  2
+#define HI1616_GIC_STRUCTURE_COUNT  64
+
+#define HI1616_MPID_TA_BASE  0x1
+#define HI1616_MPID_TB_BASE  0x3
+#define HI1616_MPID_TA_2_BASE  0x5
+#define HI1616_MPID_TB_2_BASE  0x7
+
+// 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_STRUCTUREGicDistributor;
+  EFI_ACPI_6_1_GIC_ITS_STRUCTUREGicITS[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..33dca03 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
@@ -1,9 +1,9 @@
 /** @file
 *  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 - 2016, Linaro Limited. All rights reserved.
+*  Copyright (c) 2012 - 2018, ARM Limited. All rights reserved.
+*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
+*  Copyright (c) 2015 - 2018, Linaro Limited. All rights reserved.
 *
 *  This program and the accompanying materials
 *
@@ -19,34 +19,11 @@
 *
 **/
 
-
-#include 
+#include "Hi1616Platform.h"
 #include 
 #include 
 #include 
 #include 
-#include "Hi1616Platform.h"
-
-// Differs from Juno, we have another affinity level beyond cluster and core
-// 0x2 is only for socket 0
-#define PLATFORM_GET_MPID_TA(ClusterId, CoreId)   (0x1 | ((ClusterId) << 
8) | (CoreId))
-#define PLATFORM_GET_MPID_TB(ClusterId, CoreId)   (0x3 | ((ClusterId) << 
8) | (CoreId))
-#define PLATFORM_GET_MPID_TA_2(ClusterId, CoreId)   (0x5 | ((ClusterId) << 
8) | (CoreId))
-#define PLATFORM_GET_MPID_TB_2(ClusterId, CoreId)   (0x7 | ((ClusterId) << 
8) | (CoreId))
-
-//
-// Multiple APIC Description Table
-//
-#pragma pack (1)
-
-typedef struct {
-