All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: grub-devel@gnu.org
Cc: Matthias Lange <matthias.lange@kernkonzept.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [PATCH 2/5] acpi: Add SPCR and generic address definitions
Date: Fri, 19 Mar 2021 09:07:25 +1100	[thread overview]
Message-ID: <20210318220728.495970-3-benh@kernel.crashing.org> (raw)
In-Reply-To: <20210318220728.495970-1-benh@kernel.crashing.org>

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 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.25.1



  parent reply	other threads:[~2021-03-18 22:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 22:07 [PATCH 0/5] serial: Add MMIO & SPCR support for AWS EC2 metal instances Benjamin Herrenschmidt
2021-03-18 22:07 ` [PATCH 1/5] acpi: Export a generic grub_acpi_find_table Benjamin Herrenschmidt
2021-03-18 22:07 ` Benjamin Herrenschmidt [this message]
2021-03-18 22:07 ` [PATCH 3/5] ns8250: Add base support for MMIO UARTs Benjamin Herrenschmidt
2021-03-19 17:16   ` Glenn Washburn
2021-03-19 23:30     ` Benjamin Herrenschmidt
2022-05-23 17:11   ` Sven Anderson
2022-05-25  3:13     ` Benjamin Herrenschmidt
2022-08-31  5:56     ` Benjamin Herrenschmidt
2022-08-31  8:26       ` Benjamin Herrenschmidt
2022-09-02  3:58         ` Benjamin Herrenschmidt
2021-03-18 22:07 ` [PATCH 4/5] ns8250: Add configuration parameter when adding ports Benjamin Herrenschmidt
2021-03-18 22:07 ` [PATCH 5/5] ns8250: Use ACPI SPCR table when available to configure serial Benjamin Herrenschmidt
2021-03-19  0:03 ` [PATCH 0/5] serial: Add MMIO & SPCR support for AWS EC2 metal instances Glenn Washburn
2021-03-19  1:27   ` Benjamin Herrenschmidt
2021-03-19 16:25     ` Glenn Washburn
2021-03-23 18:04 ` Daniel Kiper
2021-03-23 22:23   ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210318220728.495970-3-benh@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=grub-devel@gnu.org \
    --cc=matthias.lange@kernkonzept.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.