firmware/ice40-riscv: Import common parts to all iCE40/RISC-V firmwares

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
diff --git a/firmware/ice40-riscv/common/dma.h b/firmware/ice40-riscv/common/dma.h
new file mode 100644
index 0000000..1793750
--- /dev/null
+++ b/firmware/ice40-riscv/common/dma.h
@@ -0,0 +1,23 @@
+/*
+ * dma.h
+ *
+ * Copyright (C) 2019-2020  Sylvain Munaut <tnt@246tNt.com>
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <stdbool.h>
+
+typedef void (*dma_cb)(void *);
+
+/* Direction
+ *  0 is E1  to USB
+ *  1 is USB to E1
+ */
+
+bool dma_ready(void);
+void dma_exec(unsigned addr_e1, unsigned addr_usb, unsigned len, bool dir,
+              dma_cb cb_fn, void *cb_data);
+
+bool dma_poll(void);