qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 23/26] hw: acpi: reduced: Add reboot support


From: Samuel Ortiz
Subject: [Qemu-devel] [PATCH 23/26] hw: acpi: reduced: Add reboot support
Date: Mon, 22 Oct 2018 20:36:53 +0200

From: Jing Liu <address@hidden>

We only need to expose it through FADT.

Cc: "Michael S. Tsirkin" <address@hidden>
Cc: Igor Mammedov <address@hidden>
Signed-off-by: Jing Liu <address@hidden>
---
 hw/acpi/reduced.c         | 7 ++++++-
 include/hw/acpi/reduced.h | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/hw/acpi/reduced.c b/hw/acpi/reduced.c
index 329d5112ca..3754258335 100644
--- a/hw/acpi/reduced.c
+++ b/hw/acpi/reduced.c
@@ -128,10 +128,15 @@ static void build_fadt_reduced(GArray *table_data, 
BIOSLinker *linker,
     AcpiFadtData fadt = {
         .rev = 5,
         .minor_ver = 1,
-        .flags = 1 << ACPI_FADT_F_HW_REDUCED_ACPI,
+        .flags = (1 << ACPI_FADT_F_HW_REDUCED_ACPI) |
+                 (1 << ACPI_FADT_F_RESET_REG_SUP),
         .dsdt_tbl_offset = &dsdt_tbl_offset,
         .xdsdt_tbl_offset = &dsdt_tbl_offset,
         .arm_boot_arch = 0,
+        .reset_reg = { .space_id = AML_AS_SYSTEM_IO,
+                      .bit_width = 8, .bit_offset = 0,
+                      .address = ACPI_REDUCED_RESET_IOPORT },
+        .reset_val = ACPI_REDUCED_RESET_VALUE,
         .sleep_control_reg = { .space_id = AML_AS_SYSTEM_IO,
                               .bit_width = 8, .bit_offset = 0,
                               .address = ACPI_REDUCED_SLEEP_CONTROL_IOPORT },
diff --git a/include/hw/acpi/reduced.h b/include/hw/acpi/reduced.h
index 3d3c003353..bcd266afd0 100644
--- a/include/hw/acpi/reduced.h
+++ b/include/hw/acpi/reduced.h
@@ -22,6 +22,8 @@
 #define ACPI_REDUCED_SLEEP_LEVEL          5
 #define ACPI_REDUCED_SLEEP_ENABLE         (1 << 5) /* SLP_EN */
 #define ACPI_REDUCED_SLEEP_CONTROL_IOPORT 0x3B0
+#define ACPI_REDUCED_RESET_IOPORT         0x3C0
+#define ACPI_REDUCED_RESET_VALUE          4
 
 typedef struct Aml Aml;
 
-- 
2.17.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]