From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcuS1-0007V0-A8 for qemu-devel@nongnu.org; Tue, 31 Mar 2015 07:35:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcuRx-0000At-9z for qemu-devel@nongnu.org; Tue, 31 Mar 2015 07:35:21 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59151 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcuRx-0000Af-47 for qemu-devel@nongnu.org; Tue, 31 Mar 2015 07:35:17 -0400 Message-ID: <551A8655.3060501@suse.de> Date: Tue, 31 Mar 2015 13:34:45 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1427715290-5435-1-git-send-email-fishman@saucelabs.com> In-Reply-To: <1427715290-5435-1-git-send-email-fishman@saucelabs.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH v2] acpi: add reset register to fadt List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Reza Jelveh , qemu-devel@nongnu.org Cc: marcel.apfelbaum@gmail.com Am 30.03.2015 um 13:34 schrieb Reza Jelveh: > Some operating systems such as FreeBSD and Mac OSX need the reset_regis= ter > section of the FADT filled to know which port to write to for a system = reset. >=20 > Signed-off-by: Reza Jelveh > --- > hw/i386/acpi-build.c | 9 +++++++++ > hw/i386/acpi-defs.h | 2 ++ > 2 files changed, 11 insertions(+) >=20 > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index d0a5c85..d029896 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -338,6 +338,8 @@ build_facs(GArray *table_data, GArray *linker, PcGu= estInfo *guest_info) > /* Load chipset information in FADT */ > static void fadt_setup(AcpiFadtDescriptorRev1 *fadt, AcpiPmInfo *pm) > { > + Object *lpc =3D ich9_lpc_find(); > + > fadt->model =3D 1; > fadt->reserved1 =3D 0; > fadt->sci_int =3D cpu_to_le16(pm->sci_int); > @@ -361,6 +363,13 @@ static void fadt_setup(AcpiFadtDescriptorRev1 *fad= t, AcpiPmInfo *pm) > (1 << ACPI_FADT_F_SLP_BUTTON) | > (1 << ACPI_FADT_F_RTC_S4)); > fadt->flags |=3D cpu_to_le32(1 << ACPI_FADT_F_USE_PLATFORM_CLOCK); > + if (lpc) { > + fadt->flags |=3D cpu_to_le32(1 << ACPI_FADT_F_RESET_REG_SUP); > + fadt->reset_val =3D 0xA; > + fadt->reset_reg.address_space_id =3D aml_system_io; > + fadt->reset_reg.register_bit_width =3D 8; > + fadt->reset_reg.address =3D ICH9_RST_CNT_IOPORT; Indentation is 4 spaces. Regards, Andreas > + } > /* APIC destination mode ("Flat Logical") has an upper limit of 8 = CPUs > * For more than 8 CPUs, "Clustered Logical" mode has to be used > */ > diff --git a/hw/i386/acpi-defs.h b/hw/i386/acpi-defs.h > index c4468f8..960c833 100644 > --- a/hw/i386/acpi-defs.h > +++ b/hw/i386/acpi-defs.h > @@ -132,6 +132,8 @@ struct AcpiFadtDescriptorRev1 > uint8_t reserved4a; /* Reserved */ > uint8_t reserved4b; /* Reserved */ > uint32_t flags; > + Acpi20GenericAddress reset_reg; > + uint8_t reset_val; > } QEMU_PACKED; > typedef struct AcpiFadtDescriptorRev1 AcpiFadtDescriptorRev1; > =20 --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)