[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/13] microvm/acpi: add serial
From: |
Gerd Hoffmann |
Subject: |
[PATCH 11/13] microvm/acpi: add serial |
Date: |
Thu, 19 Mar 2020 09:01:15 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/i386/acpi-build.c | 36 +++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 928e0ee2deeb..b765c31c80b0 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1226,7 +1226,7 @@ static Aml *build_lpt_device_aml(void)
return dev;
}
-static Aml *build_com_device_aml(uint8_t uid)
+static Aml *build_com_device_aml(uint8_t uid, bool sta)
{
Aml *dev;
Aml *crs;
@@ -1250,19 +1250,22 @@ static Aml *build_com_device_aml(uint8_t uid)
aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0501")));
aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
- method = aml_method("_STA", 0, AML_NOTSERIALIZED);
- aml_append(method, aml_store(aml_name("%s", enabled_field), is_present));
- if_ctx = aml_if(aml_equal(is_present, zero));
- {
- aml_append(if_ctx, aml_return(aml_int(0x00)));
+ if (sta) {
+ method = aml_method("_STA", 0, AML_NOTSERIALIZED);
+ aml_append(method, aml_store(aml_name("%s", enabled_field),
+ is_present));
+ if_ctx = aml_if(aml_equal(is_present, zero));
+ {
+ aml_append(if_ctx, aml_return(aml_int(0x00)));
+ }
+ aml_append(method, if_ctx);
+ else_ctx = aml_else();
+ {
+ aml_append(else_ctx, aml_return(aml_int(0x0f)));
+ }
+ aml_append(method, else_ctx);
+ aml_append(dev, method);
}
- aml_append(method, if_ctx);
- else_ctx = aml_else();
- {
- aml_append(else_ctx, aml_return(aml_int(0x0f)));
- }
- aml_append(method, else_ctx);
- aml_append(dev, method);
crs = aml_resource_template();
aml_append(crs, aml_io(AML_DECODE16, io_port, io_port, 0x00, 0x08));
@@ -1287,8 +1290,8 @@ static void build_isa_devices_aml(Aml *table)
aml_append(scope, build_fdc_device_aml(fdc));
}
aml_append(scope, build_lpt_device_aml());
- aml_append(scope, build_com_device_aml(1));
- aml_append(scope, build_com_device_aml(2));
+ aml_append(scope, build_com_device_aml(1, true));
+ aml_append(scope, build_com_device_aml(2, true));
if (ambiguous) {
error_report("Multiple ISA busses, unable to define IPMI ACPI data");
@@ -2818,6 +2821,9 @@ build_dsdt_microvm(GArray *table_data, BIOSLinker *linker,
if (mms->rtc_state) {
aml_append(sb_scope, build_rtc_device_aml());
}
+ if (mms->isa_serial) {
+ aml_append(sb_scope, build_com_device_aml(1, false));
+ }
acpi_dsdt_add_fw_cfg(sb_scope, OBJECT(x86ms->fw_cfg));
acpi_dsdt_add_virtio(sb_scope);
aml_append(dsdt, sb_scope);
--
2.18.2
- [PATCH 02/13] acpi: factor out acpi_dsdt_add_fw_cfg(), (continued)
- [PATCH 02/13] acpi: factor out acpi_dsdt_add_fw_cfg(), Gerd Hoffmann, 2020/03/19
- [PATCH 13/13] microvm/acpi: use GSI 16-23 for virtio, Gerd Hoffmann, 2020/03/19
- [PATCH 01/13] acpi: make build_madt() more generic., Gerd Hoffmann, 2020/03/19
- [PATCH 12/13] microvm: make virtio irq base runtime configurable, Gerd Hoffmann, 2020/03/19
- [PATCH 08/13] [testing] seabios: update config & build rules, Gerd Hoffmann, 2020/03/19
- [PATCH 10/13] microvm/acpi: add rtc, Gerd Hoffmann, 2020/03/19
- [PATCH 06/13] microvm: disable virtio-mmio cmdline hack, Gerd Hoffmann, 2020/03/19
- [PATCH 11/13] microvm/acpi: add serial,
Gerd Hoffmann <=
- [PATCH 07/13] [testing] seabios: update submodule to experimental microvm branch, Gerd Hoffmann, 2020/03/19
- [PATCH 05/13] microvm: add acpi_dsdt_add_virtio() for x86, Gerd Hoffmann, 2020/03/19
- [PATCH 09/13] [testing] seabios: update binaries to experimental microvm branch, Gerd Hoffmann, 2020/03/19
- Re: [PATCH 00/13] microvm: add acpi support, no-reply, 2020/03/19
- Re: [PATCH 00/13] microvm: add acpi support, no-reply, 2020/03/19
- Re: [PATCH 00/13] microvm: add acpi support, no-reply, 2020/03/19
- Re: [PATCH 00/13] microvm: add acpi support, Paolo Bonzini, 2020/03/19