ACK: [PATCH 1/3] acpi: acpidump: add SPCR table (LP: #1260351)

IvanHu ivan.hu at canonical.com
Mon Dec 16 01:46:52 UTC 2013


On 12/12/2013 10:57 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Add support for the Serial Port Console Redirection Table
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/acpi/acpidump/acpidump.c | 35 +++++++++++++++++++++++++++++++++++
>   src/lib/include/fwts_acpi.h  | 24 ++++++++++++++++++++++++
>   2 files changed, 59 insertions(+)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index 240f6a9..2114134 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -1679,6 +1679,40 @@ static void acpidump_pcct(fwts_framework *fw, const fwts_acpi_table_info *table)
>   	}
>   }
>
> +/*
> + *  acpidump_spcr()
> + *	dump spcr, Serial Port Console Redirection Table
> + */
> +static void acpidump_spcr(fwts_framework *fw, const fwts_acpi_table_info *table)
> +{
> +	static const fwts_acpidump_field spcr_fields[] = {
> +		FIELD_UINT("Interface Type", 		fwts_acpi_table_spcr, interface_type),
> +		FIELD_UINT("Reserved", 			fwts_acpi_table_spcr, reserved1),
> +		FIELD_GAS ("Base Address", 		fwts_acpi_table_spcr, base_address),
> +		FIELD_UINT("Interrupt Type", 		fwts_acpi_table_spcr, interrupt_type),
> +		FIELD_UINT("IRQ", 			fwts_acpi_table_spcr, irq),
> +		FIELD_UINT("Global System Interrupt", 	fwts_acpi_table_spcr, gsi),
> +		FIELD_UINT("Baud Rate", 		fwts_acpi_table_spcr, baud_rate),
> +		FIELD_UINT("Parity", 			fwts_acpi_table_spcr, parity),
> +		FIELD_UINT("Stop Bits", 		fwts_acpi_table_spcr, stop_bits),
> +		FIELD_UINT("Flow Control", 		fwts_acpi_table_spcr, flow_control),
> +		FIELD_UINT("Terminal Type", 		fwts_acpi_table_spcr, terminal_type),
> +		FIELD_UINT("Reserved", 			fwts_acpi_table_spcr, reserved2),
> +		FIELD_UINT("PCI Device ID", 		fwts_acpi_table_spcr, pci_device_id),
> +		FIELD_UINT("PCI Vendor ID", 		fwts_acpi_table_spcr, pci_vendor_id),
> +		FIELD_UINT("PCI Bus Number", 		fwts_acpi_table_spcr, pci_bus_number),
> +		FIELD_UINT("PCI Device Number", 	fwts_acpi_table_spcr, pci_device_number),
> +		FIELD_UINT("PCI Function Number", 	fwts_acpi_table_spcr, pci_function_number),
> +		FIELD_UINT("PCI Flags", 		fwts_acpi_table_spcr, pci_flags),
> +		FIELD_UINT("PCI Segment", 		fwts_acpi_table_spcr, pci_segment),
> +		FIELD_UINT("Reserved", 			fwts_acpi_table_spcr, reserved3),
> +		FIELD_END
> +	};
> +
> +	acpi_dump_table_fields(fw, table->data, spcr_fields, 0, table->length);
> +}
> +
> +
>   typedef struct {
>   	const char *name;
>   	void (*func)(fwts_framework *fw, const fwts_acpi_table_info *table);
> @@ -1718,6 +1752,7 @@ static const acpidump_table_vec table_vec[] = {
>   	{ "RSDT", 	acpidump_rsdt, 	1 },
>   	{ "RSD PTR ", 	acpidump_rsdp, 	0 },
>   	{ "SBST", 	acpidump_sbst,  1 },
> +	{ "SPCR",	acpidump_spcr,  1 },
>   	{ "SSDT", 	acpidump_amlcode, 1 },
>   	{ "SLIT", 	acpidump_slit,  1 },
>   	{ "SLIC", 	acpidump_slic,  1 },
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index d466d32..171bdc4 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -681,6 +681,30 @@ typedef struct {
>   	uint16_t	min_request_turnaround_time;
>   } __attribute__ ((packed)) fwts_acpi_table_pcct_subspace_type_0;
>
> +typedef struct {
> +	fwts_acpi_table_header	header;
> +	uint8_t		interface_type;
> +	uint8_t		reserved1[3];
> +	fwts_acpi_gas	base_address;
> +	uint8_t		interrupt_type;
> +	uint8_t		irq;
> +	uint32_t	gsi;
> +	uint8_t		baud_rate;
> +	uint8_t		parity;
> +	uint8_t		stop_bits;
> +	uint8_t		flow_control;
> +	uint8_t		terminal_type;
> +	uint8_t		reserved2;
> +	uint16_t	pci_device_id;
> +	uint16_t	pci_vendor_id;
> +	uint8_t		pci_bus_number;
> +	uint8_t		pci_device_number;
> +	uint8_t		pci_function_number;
> +	uint32_t	pci_flags;
> +	uint8_t		pci_segment;
> +	uint32_t	reserved3;
> +} __attribute__ ((packed)) fwts_acpi_table_spcr;
> +
>   void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data);
>
>   #endif
>

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



More information about the fwts-devel mailing list