summaryrefslogtreecommitdiff
path: root/drivers/axi
diff options
context:
space:
mode:
authorMario Six <mario.six@gdsys.cc>2018-08-09 14:51:16 +0200
committerAnatolij Gustschin <agust@denx.de>2018-08-11 08:07:36 +0200
commita63e54ab5fea8aa15c561dd29bd10edfccc1609c (patch)
tree9461d3c18d87303508de348aa26d4a270a69d205 /drivers/axi
parentf05ebbf47a9dc863ff4bb084649ecb34d728b5f2 (diff)
drivers: Add AXI uclass
Add a uclass for AXI (Advanced eXtensible Interface) busses, and a driver for the gdsys IHS AXI bus on IHS FPGAs. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/axi')
-rw-r--r--drivers/axi/Kconfig13
-rw-r--r--drivers/axi/Makefile8
-rw-r--r--drivers/axi/axi-uclass.c39
3 files changed, 60 insertions, 0 deletions
diff --git a/drivers/axi/Kconfig b/drivers/axi/Kconfig
new file mode 100644
index 0000000000..4e4153b428
--- /dev/null
+++ b/drivers/axi/Kconfig
@@ -0,0 +1,13 @@
+menuconfig AXI
+ bool "AXI bus drivers"
+ help
+ Support AXI (Advanced eXtensible Interface) busses, a on-chip
+ interconnect specification for managing functional blocks in SoC
+ designs, which is also often used in designs involving FPGAs (e.g.
+ communication with IP cores in Xilinx FPGAs).
+
+ These types of busses expose a virtual address space that can be
+ accessed using different address widths (8, 16, and 32 are supported
+ for now).
+
+ Other similar bus architectures may be compatible as well.
diff --git a/drivers/axi/Makefile b/drivers/axi/Makefile
new file mode 100644
index 0000000000..100a77788a
--- /dev/null
+++ b/drivers/axi/Makefile
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2017
+# Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-$(CONFIG_AXI) += axi-uclass.o
diff --git a/drivers/axi/axi-uclass.c b/drivers/axi/axi-uclass.c
new file mode 100644
index 0000000000..af8acd9f88
--- /dev/null
+++ b/drivers/axi/axi-uclass.c
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2017
+ * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <axi.h>
+
+int axi_read(struct udevice *dev, ulong address, void *data,
+ enum axi_size_t size)
+{
+ struct axi_ops *ops = axi_get_ops(dev);
+
+ if (!ops->read)
+ return -ENOSYS;
+
+ return ops->read(dev, address, data, size);
+}
+
+int axi_write(struct udevice *dev, ulong address, void *data,
+ enum axi_size_t size)
+{
+ struct axi_ops *ops = axi_get_ops(dev);
+
+ if (!ops->write)
+ return -ENOSYS;
+
+ return ops->write(dev, address, data, size);
+}
+
+UCLASS_DRIVER(axi) = {
+ .id = UCLASS_AXI,
+ .name = "axi",
+ .post_bind = dm_scan_fdt_dev,
+ .flags = DM_UC_FLAG_SEQ_ALIAS,
+};
+