Patchwork acpi: acpidump + acpi headers: Add basic dump of RASF

login
register
mail settings
Submitter Colin King
Date July 20, 2012, 6:09 p.m.
Message ID <1342807758-13022-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/172319/
State Accepted
Headers show

Comments

Colin King - July 20, 2012, 6:09 p.m.
From: Colin Ian King <colin.king@canonical.com>

    ACPI 5.0 has introduced the RASF, so add some simple acpidump
    support for the RASF.  This will be expanded once we're sure
    of the RASF PCC sub channel identifier records (and we have
    some real world examples to check this works).

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/acpidump/acpidump.c |   23 +++++++++++++++++++++++
 src/lib/include/fwts_acpi.h  |    5 +++++
 2 files changed, 28 insertions(+)
Keng-Yu Lin - July 23, 2012, 6:13 a.m.
On Sat, Jul 21, 2012 at 2:09 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
>     ACPI 5.0 has introduced the RASF, so add some simple acpidump
>     support for the RASF.  This will be expanded once we're sure
>     of the RASF PCC sub channel identifier records (and we have
>     some real world examples to check this works).
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/acpidump/acpidump.c |   23 +++++++++++++++++++++++
>  src/lib/include/fwts_acpi.h  |    5 +++++
>  2 files changed, 28 insertions(+)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index ef7c79d..9b65703 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -1571,6 +1571,28 @@ static void acpidump_fpdt(fwts_framework *fw, fwts_acpi_table_info *table)
>         }
>  }
>
> +/*
> + *  acpidump_rasf()
> + *     dump RASF, see 5.2.20 ACPI RAS FeatureTable (RASF)
> + *     of version 5.0 ACPI spec.
> + */
> +static void acpidump_rasf(fwts_framework *fw, fwts_acpi_table_info *table)
> +{
> +       uint8_t *data = (uint8_t *)table->data;
> +       size_t length = table->length;
> +
> +       static fwts_acpidump_field rasf_fields[] = {
> +               FIELD_UINTS("Comm. Channel ID", fwts_acpi_table_rasf, platform_cc_id),
> +               FIELD_END
> +       };
> +
> +       acpi_dump_table_fields(fw, data, rasf_fields, length, length);
> +
> +       /* No idea how to dump rest of table, spec is a rather poor */
> +       acpi_dump_raw_table(fw, table);
> +}
> +
> +
>  typedef struct {
>         char *name;
>         void (*func)(fwts_framework *fw, fwts_acpi_table_info *table);
> @@ -1603,6 +1625,7 @@ static acpidump_table_vec table_vec[] = {
>         { "MCFG",       acpidump_mcfg,  1 },
>         { "MSCT",       acpidump_msct,  1 },
>         { "PSDT",       acpidump_amlcode, 1 },
> +       { "RASF",       acpidump_rasf,  1 },
>         { "RSDT",       acpidump_rsdt,  1 },
>         { "RSD PTR ",   acpidump_rsdp,  0 },
>         { "SBST",       acpidump_sbst,  1 },
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index 5e9a24a..ec085aa 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -638,6 +638,11 @@ typedef struct {
>         uint32_t        non_secure_PL2_timer_flags;
>  } __attribute__ ((packed)) fwts_acpi_table_gtdt;
>
> +/* 5.2.20 ACPI RAS FeatureTable (RASF) */
> +typedef struct {
> +        uint8_t         platform_cc_id[12];
> +} __attribute__ ((packed)) fwts_acpi_table_rasf;
> +
>  void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data);
>
>  #endif
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - July 24, 2012, 8:16 a.m.
On 07/21/2012 02:09 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
>      ACPI 5.0 has introduced the RASF, so add some simple acpidump
>      support for the RASF.  This will be expanded once we're sure
>      of the RASF PCC sub channel identifier records (and we have
>      some real world examples to check this works).
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/acpidump/acpidump.c |   23 +++++++++++++++++++++++
>   src/lib/include/fwts_acpi.h  |    5 +++++
>   2 files changed, 28 insertions(+)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index ef7c79d..9b65703 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -1571,6 +1571,28 @@ static void acpidump_fpdt(fwts_framework *fw, fwts_acpi_table_info *table)
>   	}
>   }
>
> +/*
> + *  acpidump_rasf()
> + *	dump RASF, see 5.2.20 ACPI RAS FeatureTable (RASF)
> + *	of version 5.0 ACPI spec.
> + */
> +static void acpidump_rasf(fwts_framework *fw, fwts_acpi_table_info *table)
> +{
> +	uint8_t *data = (uint8_t *)table->data;
> +	size_t length = table->length;
> +
> +	static fwts_acpidump_field rasf_fields[] = {
> +		FIELD_UINTS("Comm. Channel ID", fwts_acpi_table_rasf, platform_cc_id),
> +		FIELD_END
> +	};
> +
> +	acpi_dump_table_fields(fw, data, rasf_fields, length, length);
> +	
> +	/* No idea how to dump rest of table, spec is a rather poor */
> +	acpi_dump_raw_table(fw, table);Acked-by: Ivan Hu <ivan.hu@canonical.com>
> +}
> +
> +
>   typedef struct {
>   	char *name;
>   	void (*func)(fwts_framework *fw, fwts_acpi_table_info *table);
> @@ -1603,6 +1625,7 @@ static acpidump_table_vec table_vec[] = {
>   	{ "MCFG", 	acpidump_mcfg, 	1 },
>   	{ "MSCT", 	acpidump_msct, 	1 },
>   	{ "PSDT", 	acpidump_amlcode, 1 },
> +	{ "RASF",	acpidump_rasf,	1 },
>   	{ "RSDT", 	acpidump_rsdt, 	1 },
>   	{ "RSD PTR ", 	acpidump_rsdp, 	0 },
>   	{ "SBST", 	acpidump_sbst,  1 },
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index 5e9a24a..ec085aa 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -638,6 +638,11 @@ typedef struct {
>   	uint32_t	non_secure_PL2_timer_flags;
>   } __attribute__ ((packed)) fwts_acpi_table_gtdt;
>
> +/* 5.2.20 ACPI RAS FeatureTable (RASF) */
> +typedef struct {
> +        uint8_t         platform_cc_id[12];
> +} __attribute__ ((packed)) fwts_acpi_table_rasf;
> +
>   void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data);
>
>   #endif
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
index ef7c79d..9b65703 100644
--- a/src/acpi/acpidump/acpidump.c
+++ b/src/acpi/acpidump/acpidump.c
@@ -1571,6 +1571,28 @@  static void acpidump_fpdt(fwts_framework *fw, fwts_acpi_table_info *table)
 	}
 }
 
+/*
+ *  acpidump_rasf()
+ *	dump RASF, see 5.2.20 ACPI RAS FeatureTable (RASF)
+ *	of version 5.0 ACPI spec.
+ */
+static void acpidump_rasf(fwts_framework *fw, fwts_acpi_table_info *table)
+{
+	uint8_t *data = (uint8_t *)table->data;
+	size_t length = table->length;
+
+	static fwts_acpidump_field rasf_fields[] = {
+		FIELD_UINTS("Comm. Channel ID", fwts_acpi_table_rasf, platform_cc_id),
+		FIELD_END
+	};
+
+	acpi_dump_table_fields(fw, data, rasf_fields, length, length);
+	
+	/* No idea how to dump rest of table, spec is a rather poor */
+	acpi_dump_raw_table(fw, table);
+}
+
+
 typedef struct {
 	char *name;
 	void (*func)(fwts_framework *fw, fwts_acpi_table_info *table);
@@ -1603,6 +1625,7 @@  static acpidump_table_vec table_vec[] = {
 	{ "MCFG", 	acpidump_mcfg, 	1 },
 	{ "MSCT", 	acpidump_msct, 	1 },
 	{ "PSDT", 	acpidump_amlcode, 1 },
+	{ "RASF",	acpidump_rasf,	1 },
 	{ "RSDT", 	acpidump_rsdt, 	1 },
 	{ "RSD PTR ", 	acpidump_rsdp, 	0 },
 	{ "SBST", 	acpidump_sbst,  1 },
diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
index 5e9a24a..ec085aa 100644
--- a/src/lib/include/fwts_acpi.h
+++ b/src/lib/include/fwts_acpi.h
@@ -638,6 +638,11 @@  typedef struct {
 	uint32_t	non_secure_PL2_timer_flags;
 } __attribute__ ((packed)) fwts_acpi_table_gtdt;
 
+/* 5.2.20 ACPI RAS FeatureTable (RASF) */
+typedef struct {
+        uint8_t         platform_cc_id[12];
+} __attribute__ ((packed)) fwts_acpi_table_rasf;
+
 void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data);
 
 #endif