public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: devel@edk2.groups.io
Cc: "Stefan Berger" <stefanb@linux.ibm.com>,
	"Julien Grall" <julien@xen.org>,
	"Anthony Perard" <anthony.perard@citrix.com>,
	"Ard Biesheuvel" <ardb+tianocore@kernel.org>,
	"Jordan Justen" <jordan.l.justen@intel.com>,
	"Pawel Polawski" <ppolawsk@redhat.com>,
	"Oliver Steffen" <osteffen@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Jiewen Yao" <jiewen.yao@intel.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [PATCH 1/4] OvmfPkg: add IndustryStandard/VirtioSerial.h
Date: Mon, 17 Apr 2023 11:03:17 +0200	[thread overview]
Message-ID: <20230417090320.225046-2-kraxel@redhat.com> (raw)
In-Reply-To: <20230417090320.225046-1-kraxel@redhat.com>

Add header files with structs and defines for the virtio serial device.

The virtio serial device also known as virtio console device because
initially it had only support for a single tty, intended to be used as
console.  Support for multiple streams and named data ports has been
added later on.

https://docs.oasis-open.org/virtio/virtio/v1.2/cs01/virtio-v1.2-cs01.html#x1-2900003

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 .../Include/IndustryStandard/VirtioSerial.h   | 64 +++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 OvmfPkg/Include/IndustryStandard/VirtioSerial.h

diff --git a/OvmfPkg/Include/IndustryStandard/VirtioSerial.h b/OvmfPkg/Include/IndustryStandard/VirtioSerial.h
new file mode 100644
index 000000000000..ffc8f84d03cc
--- /dev/null
+++ b/OvmfPkg/Include/IndustryStandard/VirtioSerial.h
@@ -0,0 +1,64 @@
+/** @file
+  Virtio Serial Device specific type and macro definitions.
+
+  Copyright (C) 2013-2016, Red Hat, Inc.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _VIRTIO_SERIAL_H_
+#define _VIRTIO_SERIAL_H_
+
+#include <IndustryStandard/Virtio095.h>
+#include <IndustryStandard/Virtio10.h>
+
+//
+// Device Configuration
+//
+typedef struct {
+  UINT16    Cols;
+  UINT16    Rows;
+  UINT32    MaxPorts;
+  UINT32    EmergWrite;
+} VIRTIO_SERIAL_CONFIG;
+
+//
+// Control Queue
+//
+typedef struct {
+  UINT32    Id;
+  UINT16    Event;
+  UINT16    Value;
+} VIRTIO_SERIAL_CONTROL;
+
+//
+// Queue Identifiers
+//
+#define VIRTIO_SERIAL_Q_RX_PORT0  0
+#define VIRTIO_SERIAL_Q_TX_PORT0  1
+#define VIRTIO_SERIAL_Q_RX_CTRL   2
+#define VIRTIO_SERIAL_Q_TX_CTRL   3
+#define VIRTIO_SERIAL_Q_RX_BASE   4
+#define VIRTIO_SERIAL_Q_TX_BASE   5
+
+//
+// Feature Bits
+//
+#define VIRTIO_SERIAL_F_SIZE         BIT0
+#define VIRTIO_SERIAL_F_MULTIPORT    BIT1
+#define VIRTIO_SERIAL_F_EMERG_WRITE  BIT2
+
+//
+// Events
+//
+#define VIRTIO_SERIAL_DEVICE_READY   0
+#define VIRTIO_SERIAL_DEVICE_ADD     1
+#define VIRTIO_SERIAL_DEVICE_REMOVE  2
+#define VIRTIO_SERIAL_PORT_READY     3
+#define VIRTIO_SERIAL_CONSOLE_PORT   4
+#define VIRTIO_SERIAL_RESIZE         5
+#define VIRTIO_SERIAL_PORT_OPEN      6
+#define VIRTIO_SERIAL_PORT_NAME      7
+
+#endif /* _VIRTIO_SERIAL_H_ */
-- 
2.39.2


  reply	other threads:[~2023-04-17  9:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17  9:03 [PATCH 0/4] OvmfPkg: add virtio serial driver Gerd Hoffmann
2023-04-17  9:03 ` Gerd Hoffmann [this message]
2023-04-17  9:03 ` [PATCH 2/4] OvmfPkg/VirtioSerialDxe: add driver Gerd Hoffmann
2023-04-17  9:03 ` [PATCH 3/4] OvmfPkg/VirtioSerialDxe: wire up in OvmfPkg* Gerd Hoffmann
2023-04-17  9:03 ` [PATCH 4/4] OvmfPkg/PlatformBootManagerLib: setup virtio serial console Gerd Hoffmann
2023-04-18 15:46 ` [PATCH 0/4] OvmfPkg: add virtio serial driver Ard Biesheuvel
2023-04-19  6:18   ` Gerd Hoffmann
2023-04-20  9:52     ` [edk2-devel] " Gupta, Pankaj
2023-04-20 11:46       ` Gerd Hoffmann
2023-04-20 13:31         ` Gupta, Pankaj

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-list 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=20230417090320.225046-2-kraxel@redhat.com \
    --to=devel@edk2.groups.io \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox