Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oTzwL-00015q-9T for mharc-grub-devel@gnu.org; Fri, 02 Sep 2022 02:14:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTzwJ-00011K-Db for grub-devel@gnu.org; Fri, 02 Sep 2022 02:14:03 -0400 Received: from gate.crashing.org ([63.228.1.57]:54381) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTzwH-0007Jy-Ns for grub-devel@gnu.org; Fri, 02 Sep 2022 02:14:03 -0400 Received: from u9a582362680a51.ant.amazon.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 2826CpoR022956; Fri, 2 Sep 2022 01:12:56 -0500 From: Benjamin Herrenschmidt To: grub-devel@gnu.org Cc: Benjamin Herrenschmidt Subject: [PATCH 2/7] acpi: Add SPCR and generic address definitions Date: Fri, 2 Sep 2022 16:12:17 +1000 Message-Id: <20220902061222.1086343-3-benh@kernel.crashing.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220902061222.1086343-1-benh@kernel.crashing.org> References: <20220902061222.1086343-1-benh@kernel.crashing.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=63.228.1.57; envelope-from=benh@kernel.crashing.org; helo=gate.crashing.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2022 06:14:03 -0000 From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt --- include/grub/acpi.h | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/include/grub/acpi.h b/include/grub/acpi.h index 8c126b2b9..17aadb802 100644 --- a/include/grub/acpi.h +++ b/include/grub/acpi.h @@ -179,6 +179,57 @@ enum GRUB_ACPI_MADT_ENTRY_SAPIC_FLAGS_ENABLED = 1 }; +struct grub_acpi_genaddr { + grub_uint8_t space_id; +#define GRUB_ACPI_GENADDR_MEM_SPACE 0x00 +#define GRUB_ACPI_GENADDR_IO_SPACE 0x01 + grub_uint8_t bit_width; + grub_uint8_t bit_offset; + grub_uint8_t access_size; +#define GRUB_ACPI_GENADDR_SIZE_LGCY 0x00 +#define GRUB_ACPI_GENADDR_SIZE_BYTE 0x01 +#define GRUB_ACPI_GENADDR_SIZE_WORD 0x02 +#define GRUB_ACPI_GENADDR_SIZE_DWORD 0x03 +#define GRUB_ACPI_GENADDR_SIZE_QWORD 0x04 + grub_uint64_t addr; +} GRUB_PACKED; + +#define GRUB_ACPI_SPCR_SIGNATURE "SPCR" + +struct grub_acpi_spcr { + struct grub_acpi_table_header hdr; + grub_uint8_t intf_type; +#define GRUB_ACPI_SPCR_INTF_TYPE_16550 0x00 +#define GRUB_ACPI_SPCR_INTF_TYPE_16550X 0x01 + grub_uint8_t reserved_0[3]; + struct grub_acpi_genaddr base_addr; + grub_uint8_t interrupt_type; + grub_uint8_t irq; + grub_uint32_t gsi; + grub_uint8_t baud_rate; +#define GRUB_ACPI_SPCR_BAUD_CURRENT 0x00 +#define GRUB_ACPI_SPCR_BAUD_9600 0x03 +#define GRUB_ACPI_SPCR_BAUD_19200 0x04 +#define GRUB_ACPI_SPCR_BAUD_57600 0x06 +#define GRUB_ACPI_SPCR_BAUD_115200 0x07 + grub_uint8_t parity; + grub_uint8_t stop_bits; + grub_uint8_t flow_control; +#define GRUB_ACPI_SPCR_FC_DCD_TX (1 << 0) +#define GRUB_ACPI_SPCR_FC_RTSCTS (1 << 1) +#define GRUB_ACPI_SPCR_FC_XONXOFF (1 << 2) + grub_uint8_t terminal_type; + grub_uint8_t language; + grub_uint16_t pci_device_id; + grub_uint16_t pci_vendor_id; + grub_uint8_t pci_bus; + grub_uint8_t pci_device; + grub_uint8_t pci_function; + grub_uint32_t pci_flags; + grub_uint8_t pci_segment; + grub_uint32_t reserved_1; +} GRUB_PACKED; + #ifndef GRUB_DSDT_TEST struct grub_acpi_rsdp_v10 *grub_acpi_get_rsdpv1 (void); struct grub_acpi_rsdp_v20 *grub_acpi_get_rsdpv2 (void); -- 2.34.1