From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.50081.1681722204979105002 for ; Mon, 17 Apr 2023 02:03:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KIDT2ahg; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681722203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2b0etu8d9BLQJ4pyvxHquOIx357s4kaErjcWsd9pd7I=; b=KIDT2ahgoDrmOc5ODmWRmA/+DQZJUS1VS7SnEOL+A8k2Ml3KqSZbs6FxRHI/ViLAyfziQP M0sTrOBxQwLXNDovbh5t0kqukY2Vpn7LR/ox7E0rGG2S0jM1+aSmH1siI8uJzuQP2NpKqK 742SeMLrlp7v5mVaWM1dfBZCpdFq4z4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-205-QmKSi6Z5Ndeo8ObOPUd-kg-1; Mon, 17 Apr 2023 05:03:22 -0400 X-MC-Unique: QmKSi6Z5Ndeo8ObOPUd-kg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2FCAA884EC9; Mon, 17 Apr 2023 09:03:22 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.149]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C32362031A22; Mon, 17 Apr 2023 09:03:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0B9131800383; Mon, 17 Apr 2023 11:03:20 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Stefan Berger , Julien Grall , Anthony Perard , Ard Biesheuvel , Jordan Justen , Pawel Polawski , Oliver Steffen , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jiewen Yao , Gerd Hoffmann Subject: [PATCH 1/4] OvmfPkg: add IndustryStandard/VirtioSerial.h Date: Mon, 17 Apr 2023 11:03:17 +0200 Message-Id: <20230417090320.225046-2-kraxel@redhat.com> In-Reply-To: <20230417090320.225046-1-kraxel@redhat.com> References: <20230417090320.225046-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 --- .../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 +#include + +// +// 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