From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ9ZK-0003sN-0z for qemu-devel@nongnu.org; Mon, 07 Sep 2015 23:27:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZ9ZG-0001wN-RX for qemu-devel@nongnu.org; Mon, 07 Sep 2015 23:27:37 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:56775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ9ZG-0001uu-92 for qemu-devel@nongnu.org; Mon, 07 Sep 2015 23:27:34 -0400 Message-ID: <55EE558C.1090105@huawei.com> Date: Tue, 8 Sep 2015 11:27:08 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <1441635826-4866-1-git-send-email-leif.lindholm@linaro.org> <1441635826-4866-2-git-send-email-leif.lindholm@linaro.org> In-Reply-To: <1441635826-4866-2-git-send-email-leif.lindholm@linaro.org> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] ACPI: Add definitions for the DBG2 table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leif Lindholm , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, drjones@redhat.com, shannon.zhao@linaro.org, al.stone@linaro.org On 2015/9/7 22:23, Leif Lindholm wrote: > The DBG2 table can be considered a "companion" to SPCR - it points out > debug consoles available in the system. > > Signed-off-by: Leif Lindholm > --- > include/hw/acpi/acpi-defs.h | 37 +++++++++++++++++++++++++++++++++++-- > 1 file changed, 35 insertions(+), 2 deletions(-) > > diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h > index 2b431e6..af062a7 100644 > --- a/include/hw/acpi/acpi-defs.h > +++ b/include/hw/acpi/acpi-defs.h > @@ -197,10 +197,43 @@ enum { > }; > > /* > - * Serial Port Console Redirection Table (SPCR), Rev. 1.02 > + * Debug Port Table 2 (DBG2) > * > * For .interface_type see Debug Port Table 2 (DBG2) serial port > - * subtypes in Table 3, Rev. May 22, 2012 > + * subtypes in Table 3, Rev. Aug 10, 2015 > + * > + * The specification permits multiple ports with multiple addresses, but this > + * implementation is limited to one port with one address. > + */ > +struct AcpiDebugPort2 { > + ACPI_TABLE_HEADER_DEF > + uint32_t debug_devices_offset; > + uint32_t number_debug_devices; > + struct { > + uint8_t revision; > + uint16_t length; > + uint8_t number_generic_address_registers; > + uint16_t namespace_string_length; > + uint16_t namespace_string_offset; > + uint16_t oem_data_length; > + uint16_t oem_data_offset; > + uint16_t port_type; > + uint16_t port_subtype; > + uint8_t reserved1[2]; > + uint16_t base_address_register_offset; > + uint16_t address_size_offset; > + struct AcpiGenericAddress base_address[1]; > + uint32_t address_size[1]; > + uint8_t namespace_string[2]; > + } QEMU_PACKED debug_devices[1]; This debug_device should be defined alone. And use acpi_data_push to add multiple debug_devices structures according to the number of debug device. > +} QEMU_PACKED; > +typedef struct AcpiDebugPort2 > + AcpiDebugPort2; > + > +/* > + * Serial Port Console Redirection Table (SPCR), Rev. 1.03 > + * Why do you change the revision of SPCR from 1.02 to 1.03? > + * .interface_type format same as for DBG2. > */ > struct AcpiSerialPortConsoleRedirection { > ACPI_TABLE_HEADER_DEF > -- Shannon