summaryrefslogtreecommitdiff
path: root/bsp/include/sifive/devices
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/include/sifive/devices')
-rw-r--r--bsp/include/sifive/devices/clic.h30
-rw-r--r--bsp/include/sifive/devices/spi.h4
2 files changed, 32 insertions, 2 deletions
diff --git a/bsp/include/sifive/devices/clic.h b/bsp/include/sifive/devices/clic.h
new file mode 100644
index 0000000..e8dc2df
--- /dev/null
+++ b/bsp/include/sifive/devices/clic.h
@@ -0,0 +1,30 @@
+// See LICENSE for license details.
+
+#ifndef _SIFIVE_CLIC_H
+#define _SIFIVE_CLIC_H
+
+#define CLIC_HART0 0x00800000
+#define CLIC_MSIP 0x0000
+#define CLIC_MSIP_size 0x4
+#define CLIC_MTIMECMP 0x4000
+#define CLIC_MTIMECMP_size 0x8
+#define CLIC_MTIME 0xBFF8
+#define CLIC_MTIME_size 0x8
+
+#define CLIC_INTIP 0x000
+#define CLIC_INTIE 0x400
+#define CLIC_INTCFG 0x800
+#define CLIC_CFG 0xc00
+
+// These interrupt IDs are consistent across old and new mtvec modes
+#define SSIPID 1
+#define MSIPID 3
+#define STIPID 5
+#define MTIPID 7
+#define SEIPID 9
+#define MEIPID 11
+#define CSIPID 12
+#define LOCALINTIDBASE 16
+
+
+#endif /* _SIFIVE_CLIC_H */
diff --git a/bsp/include/sifive/devices/spi.h b/bsp/include/sifive/devices/spi.h
index 916d86b..80ef345 100644
--- a/bsp/include/sifive/devices/spi.h
+++ b/bsp/include/sifive/devices/spi.h
@@ -30,8 +30,8 @@
/* Fields */
-#define SPI_SCK_POL 0x1
-#define SPI_SCK_PHA 0x2
+#define SPI_SCK_PHA 0x1
+#define SPI_SCK_POL 0x2
#define SPI_FMT_PROTO(x) ((x) & 0x3)
#define SPI_FMT_ENDIAN(x) (((x) & 0x1) << 2)