summaryrefslogtreecommitdiff
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorIwona Winiarska <iwona.winiarska@intel.com>2020-04-06 23:00:46 +0300
committerJae Hyun Yoo <jae.hyun.yoo@linux.intel.com>2021-11-05 10:22:10 +0300
commit0961100720689cab02408d6b4d0366a69261febc (patch)
tree99afe13f28ceac1de4e328d09a4fa1eb8ca69c69 /include/uapi/linux
parent84b9c0c4c138a4257f0c5d6a8f939bc661158128 (diff)
downloadlinux-0961100720689cab02408d6b4d0366a69261febc.tar.xz
soc: aspeed: mctp: Add initial driver for ast2600-mctp
Currently, there is no proper MCTP networking subsystem in Linux. Until we are able to work out the details of that, we are going to expose HW to userspace using raw read/write interface. Because of that, this driver is not intended to be submitted upstream. Here we are providing a simple device driver for AST2600 MCTP controller. v2: Added workarounds for BMC reboot/reset, corrected endianess comment, changed TX_BUF_ADDR to be consistent, fixed typos. v3: Added workaround for RX hang, added swapping PCIe VDM header to network order, corrected buffer allocation size. v4: Fixed TX broken after sending 32 byte packet Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/aspeed-mctp.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/include/uapi/linux/aspeed-mctp.h b/include/uapi/linux/aspeed-mctp.h
new file mode 100644
index 000000000000..9819b6029d19
--- /dev/null
+++ b/include/uapi/linux/aspeed-mctp.h
@@ -0,0 +1,67 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2020 Intel Corporation */
+
+#ifndef _UAPI_LINUX_ASPEED_MCTP_H
+#define _UAPI_LINUX_ASPEED_MCTP_H
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+/*
+ * aspeed-mctp is a simple device driver exposing a read/write interface:
+ * +----------------------+
+ * | PCIe VDM Header | 16 bytes (Big Endian)
+ * +----------------------+
+ * | MCTP Message Payload | 64/128/256/512 bytes (Big Endian)
+ * +----------------------+
+ *
+ * MCTP packet description can be found in DMTF DSP0238,
+ * MCTP PCIe VDM Transport Specification.
+ */
+
+#define ASPEED_MCTP_PCIE_VDM_HDR_SIZE 16
+
+/*
+ * uevents generated by aspeed-mctp driver
+ */
+#define ASPEED_MCTP_READY "PCIE_READY"
+
+/*
+ * MCTP operations
+ * @ASPEED_MCTP_IOCTL_FILTER_EID: enable/disable filter incoming packets based
+ * on Endpoint ID (BROKEN)
+ * @ASPEED_MCTP_IOCTL_GET_BDF: read PCI bus/device/function of MCTP Controller
+ * @ASPEED_MCTP_IOCTL_GET_MEDIUM_ID: read MCTP physical medium identifier
+ * related to PCIe revision
+ * @ASPEED_MCTP_IOCTL_GET_MTU: read max transmission unit (in bytes)
+ */
+
+struct aspeed_mctp_filter_eid {
+ __u8 eid;
+ bool enable;
+};
+
+struct aspeed_mctp_get_bdf {
+ __u16 bdf;
+};
+
+struct aspeed_mctp_get_medium_id {
+ __u8 medium_id;
+};
+
+struct aspeed_mctp_get_mtu {
+ __u8 mtu;
+};
+
+#define ASPEED_MCTP_IOCTL_BASE 0x4d
+
+#define ASPEED_MCTP_IOCTL_FILTER_EID \
+ _IOW(ASPEED_MCTP_IOCTL_BASE, 0, struct aspeed_mctp_filter_eid)
+#define ASPEED_MCTP_IOCTL_GET_BDF \
+ _IOR(ASPEED_MCTP_IOCTL_BASE, 1, struct aspeed_mctp_get_bdf)
+#define ASPEED_MCTP_IOCTL_GET_MEDIUM_ID \
+ _IOR(ASPEED_MCTP_IOCTL_BASE, 2, struct aspeed_mctp_get_medium_id)
+#define ASPEED_MCTP_IOCTL_GET_MTU \
+ _IOR(ASPEED_MCTP_IOCTL_BASE, 3, struct aspeed_mctp_get_mtu)
+
+#endif /* _UAPI_LINUX_ASPEED_MCTP_H */