linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ACPICA updates for ACPI 5.1 MADT, FADT, GTDT (Just for patch review)
@ 2014-07-24 12:59 Hanjun Guo
  2014-07-24 12:59 ` [PATCH 1/3] ACPI / ACPICA: Introduce ARM Boot Architecture Flags in FADT Hanjun Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hanjun Guo @ 2014-07-24 12:59 UTC (permalink / raw)
  To: linux-arm-kernel

This is the patch set to update ACPICA for MADT, FADT, GTDT in
ACPI 5.1. These patches are only for review purpose, ACPICA
patches will have there own special upstream process, it will be
handled by Bob and Lv.

Bob, Lv, please ignore this patch set since you are working on
them now, it just for people to undstand the later ARM64 ACPI
core patches better and for temporary test purpose. I will rebase
my patch set once new version of ACPICA is released, thanks.

Hanjun Guo (2):
  ACPI / ACPICA: Introduce ARM Boot Architecture Flags in FADT
  ACPI / ACPICA: Add GTDT support updated by ACPI 5.1

Tomasz Nowicki (1):
  ACPI / ACPICA: Add new features for MADT which introduced by ACPI 5.1

 include/acpi/actbl.h  |   12 ++++--
 include/acpi/actbl1.h |   40 +++++++++++++++++---
 include/acpi/actbl3.h |   99 ++++++++++++++++++++++++++++++++++++++++++-------
 3 files changed, 129 insertions(+), 22 deletions(-)

-- 
1.7.9.5

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

* [PATCH 1/3] ACPI / ACPICA: Introduce ARM Boot Architecture Flags in FADT
  2014-07-24 12:59 [PATCH 0/3] ACPICA updates for ACPI 5.1 MADT, FADT, GTDT (Just for patch review) Hanjun Guo
@ 2014-07-24 12:59 ` Hanjun Guo
  2014-07-24 12:59 ` [PATCH 2/3] ACPI / ACPICA: Add new features for MADT which introduced by ACPI 5.1 Hanjun Guo
  2014-07-24 12:59 ` [PATCH 3/3] ACPI / ACPICA: Add GTDT support updated " Hanjun Guo
  2 siblings, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2014-07-24 12:59 UTC (permalink / raw)
  To: linux-arm-kernel

The Power State Coordination Interface (PSCI) defines an API that
can be used to coordinate power control amongst the various supervisory
systems concurrently running on a device. ACPI support for this
technology would require the addition of two flags: PSCI_COMPLIANT and
PSCI_USE_HVC. When set, the former signals to the OS that the hardware
is PSCI compliant. The latter selects the appropriate conduit for PSCI
calls by toggling between Hypervisor Calls (HVC) and Secure Monitor
Calls (SMC).

An ARM Boot Architecture Flags structure to support new ARM hardware
was introduced in FADT in ACPI 5.1, add the code accordingly to
implement that in ACPICA core.

Since ACPI 5.1 doesn't support self defined PSCI function IDs,
which means that only PSCI 0.2+ is supported in ACPI.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 include/acpi/actbl.h |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 1cc7ef1..e339a28 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -270,7 +270,8 @@ struct acpi_table_fadt {
 	u32 flags;		/* Miscellaneous flag bits (see below for individual flags) */
 	struct acpi_generic_address reset_register;	/* 64-bit address of the Reset register */
 	u8 reset_value;		/* Value to write to the reset_register port to reset the system */
-	u8 reserved4[3];	/* Reserved, must be zero */
+	u16 arm_boot_flags;	/* ARM Boot Architecture Flags (see below for individual flags) */
+	u8 minor_version;	/* Minor version of this FADT structure */
 	u64 Xfacs;		/* 64-bit physical address of FACS */
 	u64 Xdsdt;		/* 64-bit physical address of DSDT */
 	struct acpi_generic_address xpm1a_event_block;	/* 64-bit Extended Power Mgt 1a Event Reg Blk address */
@@ -285,7 +286,7 @@ struct acpi_table_fadt {
 	struct acpi_generic_address sleep_status;	/* 64-bit Sleep Status register (ACPI 5.0) */
 };
 
-/* Masks for FADT Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
+/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
 
 #define ACPI_FADT_LEGACY_DEVICES    (1)  	/* 00: [V2] System has LPC or ISA bus devices */
 #define ACPI_FADT_8042              (1<<1)	/* 01: [V3] System has an 8042 controller on port 60/64 */
@@ -296,6 +297,11 @@ struct acpi_table_fadt {
 
 #define FADT2_REVISION_ID               3
 
+/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) */
+
+#define ACPI_FADT_PSCI_COMPLIANT    (1)  	/* 00: PSCI 0.2+ is implemented */
+#define ACPI_FADT_PSCI_USE_HVC      (1<<1)	/* 01: HVC must be used instead of SMC as the PSCI conduit */
+
 /* Masks for FADT flags */
 
 #define ACPI_FADT_WBINVD            (1)	/* 00: [V1] The WBINVD instruction works properly */
@@ -399,7 +405,7 @@ struct acpi_table_desc {
  *     FADT V5  size: 0x10C
  */
 #define ACPI_FADT_V1_SIZE       (u32) (ACPI_FADT_OFFSET (flags) + 4)
-#define ACPI_FADT_V2_SIZE       (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3)
+#define ACPI_FADT_V2_SIZE       (u32) (ACPI_FADT_OFFSET (arm_boot_flags) + 3)
 #define ACPI_FADT_V3_SIZE       (u32) (ACPI_FADT_OFFSET (sleep_control))
 #define ACPI_FADT_V5_SIZE       (u32) (sizeof (struct acpi_table_fadt))
 
-- 
1.7.9.5

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

* [PATCH 2/3] ACPI / ACPICA: Add new features for MADT which introduced by ACPI 5.1
  2014-07-24 12:59 [PATCH 0/3] ACPICA updates for ACPI 5.1 MADT, FADT, GTDT (Just for patch review) Hanjun Guo
  2014-07-24 12:59 ` [PATCH 1/3] ACPI / ACPICA: Introduce ARM Boot Architecture Flags in FADT Hanjun Guo
@ 2014-07-24 12:59 ` Hanjun Guo
  2014-07-24 12:59 ` [PATCH 3/3] ACPI / ACPICA: Add GTDT support updated " Hanjun Guo
  2 siblings, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2014-07-24 12:59 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tomasz Nowicki <tomasz.nowicki@linaro.org>

Add new features for MADT which introduced by ACPI 5.1:
 -comment on the GIC ID field of the GIC structure which is replaced
  by CPU Interface Number.
 -add new fields: Redistributor Base Address, GICV, GICH, and MPIDR.
 -add new structures for GIC MSI frame and GICR.
 -add flag definition for GICC flags.

Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 include/acpi/actbl1.h |   40 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 35 insertions(+), 5 deletions(-)

diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 9613e8e..8c91ad6 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -671,7 +671,9 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
 	ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
 	ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
-	ACPI_MADT_TYPE_RESERVED = 13	/* 13 and greater are reserved */
+	ACPI_MADT_TYPE_GIC_MSI_FRAME = 13,
+	ACPI_MADT_TYPE_GIC_REDISTRIBUTOR = 14,
+	ACPI_MADT_TYPE_RESERVED = 15	/* 15 and greater are reserved */
 };
 
 /*
@@ -792,18 +794,23 @@ struct acpi_madt_local_x2apic_nmi {
 	u8 reserved[3];		/* reserved - must be zero */
 };
 
-/* 11: Generic Interrupt (ACPI 5.0) */
+/* 11: Generic Interrupt (ACPI 5.1) */
 
 struct acpi_madt_generic_interrupt {
 	struct acpi_subtable_header header;
 	u16 reserved;		/* reserved - must be zero */
-	u32 gic_id;
+	u32 gic_id;		/* it was renamed to cpu interface number in ACPI 5.1 */
 	u32 uid;
 	u32 flags;
 	u32 parking_version;
 	u32 performance_interrupt;
 	u64 parked_address;
 	u64 base_address;
+	u64 gicv_base_address;
+	u64 gich_base_address;
+	u32 vgic_maintenance_interrupt;
+	u64 redist_base_address;
+	u64 mpidr;
 };
 
 /* 12: Generic Distributor (ACPI 5.0) */
@@ -817,13 +824,36 @@ struct acpi_madt_generic_distributor {
 	u32 reserved2;		/* reserved - must be zero */
 };
 
+/* 13: GIC MSI Frame (ACPI 5.1) */
+
+struct acpi_madt_gic_msi_frame {
+	struct acpi_subtable_header header;
+	u16 reserved;           /* reserved - must be zero */
+	u32 gic_msi_frame_id;
+	u64 base_address;
+};
+
+/* 14: GIC Redistributor (ACPI 5.1) */
+
+struct acpi_madt_gic_redistributor {
+	struct acpi_subtable_header header;
+	u16 reserved;           /* reserved - must be zero */
+	u64 base_address;
+	u32 region_size;
+};
+
 /*
  * Common flags fields for MADT subtables
  */
 
-/* MADT Local APIC flags (lapic_flags) and GIC flags */
+/* MADT Local APIC flags (lapic_flags) and GICC flags */
+
+#define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
+
+/* MADT GICC flags only */
 
-#define ACPI_MADT_ENABLED           (1)	/* 00: Processor is usable if set */
+#define ACPI_MADT_PERF_INT_MODE     (1<<1)	/* 01: Performance Interrupt Mode */
+#define ACPI_MADT_VGIC              (1<<2)	/* 02: VGIC Maintenance interrupt mode */
 
 /* MADT MPS INTI flags (inti_flags) */
 
-- 
1.7.9.5

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

* [PATCH 3/3] ACPI / ACPICA: Add GTDT support updated by ACPI 5.1
  2014-07-24 12:59 [PATCH 0/3] ACPICA updates for ACPI 5.1 MADT, FADT, GTDT (Just for patch review) Hanjun Guo
  2014-07-24 12:59 ` [PATCH 1/3] ACPI / ACPICA: Introduce ARM Boot Architecture Flags in FADT Hanjun Guo
  2014-07-24 12:59 ` [PATCH 2/3] ACPI / ACPICA: Add new features for MADT which introduced by ACPI 5.1 Hanjun Guo
@ 2014-07-24 12:59 ` Hanjun Guo
  2 siblings, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2014-07-24 12:59 UTC (permalink / raw)
  To: linux-arm-kernel

With ACPI 5.0, we got per-processor timer support in GTDT,
and ACPI 5.1 introduced the support for platform (memory-mapped)
timers: GT Block and SBSA watchdog timer, add the code needed
for the spec change.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 include/acpi/actbl3.h |   99 ++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 85 insertions(+), 14 deletions(-)

diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index c2295cc..96c60cd 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -241,33 +241,104 @@ struct acpi_s3pt_suspend {
 
 /*******************************************************************************
  *
- * GTDT - Generic Timer Description Table (ACPI 5.0)
- *        Version 1
+ * GTDT - Generic Timer Description Table (ACPI 5.1)
+ *        Version 2
  *
  ******************************************************************************/
 
 struct acpi_table_gtdt {
 	struct acpi_table_header header;	/* Common ACPI table header */
-	u64 address;
-	u32 flags;
-	u32 secure_pl1_interrupt;
-	u32 secure_pl1_flags;
-	u32 non_secure_pl1_interrupt;
-	u32 non_secure_pl1_flags;
+	u64 cnt_control_base_address;
+	u32 reserved;
+	u32 secure_el1_interrupt;
+	u32 secure_el1_flags;
+	u32 non_secure_el1_interrupt;
+	u32 non_secure_el1_flags;
 	u32 virtual_timer_interrupt;
 	u32 virtual_timer_flags;
-	u32 non_secure_pl2_interrupt;
-	u32 non_secure_pl2_flags;
+	u32 non_secure_el2_interrupt;
+	u32 non_secure_el2_flags;
+	u64 cnt_read_base_address;
+	u32 platform_timer_count;
+	u32 platform_timer_offset;
 };
 
-/* Values for Flags field above */
-
-#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
-
 /* Values for all "TimerFlags" fields above */
 
 #define ACPI_GTDT_INTERRUPT_MODE            1
 #define ACPI_GTDT_INTERRUPT_POLARITY        2
+#define ACPI_GTDT_ALWAYS_ON		    4
+
+/*
+ * GTDT Subtable header
+ */
+struct acpi_gtdt_header {
+	u8 type;
+	u16 length;
+};
+
+/* Values for GTDT subtable type for GTDT subtables above */
+
+enum acpi_gtdt_type {
+	ACPI_GTDT_TYPE_GT_BLOCK = 0,	/* memory-mapped generic timer */
+	ACPI_GTDT_TYPE_SBSA_GENERIC_WATCHDOG = 1,
+	ACPI_GTDT_TYPE_RESERVED = 2	/* 2 and greater are reserved */
+};
+
+/*
+ * GTDT Subtables, correspond to Type in struct acpi_gtdt_header
+ */
+
+/* 0: Generic Timer Block */
+
+struct acpi_gtdt_gt_block {
+	struct acpi_gtdt_header header;
+	u8 reserved;
+	u64 gt_block_address;
+	u32 gt_block_timer_count;	/* must be less than or equal to 8 */
+	u32 gt_block_timer_offset;
+};
+
+/* GT Block Timer Structure */
+
+struct acpi_gt_block_timer {
+	u8 gt_frame_number;
+	u8 reseved[3];
+	u64 cnt_base_address;
+	u64 cnt_el0_base_adress;
+	u32 physical_timer_interrupt;
+	u32 physical_timer_flags;
+	u32 vitual_timer_interrupt;
+	u32 vitual_timer_flags;
+	u32 timer_common_flags;
+};
+
+/* Flag Definitions: GT Block Physical Timers and Virtual timers */
+
+#define ACPI_GT_BLOCK_INTERRUPT_MODE		1
+#define ACPI_GT_BLOCK_INTERRUPT_POLARITY	2
+
+/* Flag Definitions: Common Flags */
+
+#define ACPI_GT_BLOCK_IS_SECURE_TIMER	1
+#define ACPI_GT_BLOCK_ALWAYS_ON		2
+
+/* 1: SBSA Generic Watchdog Structure */
+
+struct acpi_sbsa_generic_watchdog {
+	struct acpi_gtdt_header header;
+	u8 reserved;
+	u64 refresh_frame_address;
+	u64 control_frame_address;
+	u32 interrupt;
+	u32 flags;
+};
+
+/* Flag Definitions: SBSA Generic Watchdog */
+
+#define ACPI_SBSA_WATCHDOG_INTERRUPT_MODE	1
+#define ACPI_SBSA_WATCHDOG_INTERRUPT_POLARITY	2
+#define ACPI_SBSA_WATCHDOG_IS_SECURE_TIMER	4
 
 /*******************************************************************************
  *
-- 
1.7.9.5

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

end of thread, other threads:[~2014-07-24 12:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-24 12:59 [PATCH 0/3] ACPICA updates for ACPI 5.1 MADT, FADT, GTDT (Just for patch review) Hanjun Guo
2014-07-24 12:59 ` [PATCH 1/3] ACPI / ACPICA: Introduce ARM Boot Architecture Flags in FADT Hanjun Guo
2014-07-24 12:59 ` [PATCH 2/3] ACPI / ACPICA: Add new features for MADT which introduced by ACPI 5.1 Hanjun Guo
2014-07-24 12:59 ` [PATCH 3/3] ACPI / ACPICA: Add GTDT support updated " Hanjun Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).