From: hanjun.guo@linaro.org (Hanjun Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ACPI / ACPICA: Add GTDT support updated by ACPI 5.1
Date: Thu, 24 Jul 2014 20:59:17 +0800 [thread overview]
Message-ID: <1406206757-15512-4-git-send-email-hanjun.guo@linaro.org> (raw)
In-Reply-To: <1406206757-15512-1-git-send-email-hanjun.guo@linaro.org>
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
prev parent reply other threads:[~2014-07-24 12:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406206757-15512-4-git-send-email-hanjun.guo@linaro.org \
--to=hanjun.guo@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).