summaryrefslogtreecommitdiffstats
path: root/grlib.h
diff options
context:
space:
mode:
authorJiri Gaisler <jiri@gaisler.se>2019-03-22 10:00:07 +0100
committerJiri Gaisler <jiri@gaisler.se>2019-05-14 22:26:21 +0200
commit865b177d0e2fd534270ef158030e7c3056a930e3 (patch)
tree4edbf27496977adaed90287d11eaffbe357ac757 /grlib.h
downloadsis-865b177d0e2fd534270ef158030e7c3056a930e3.tar.bz2
Standalone sis - initial commit
Diffstat (limited to 'grlib.h')
-rw-r--r--grlib.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/grlib.h b/grlib.h
new file mode 100644
index 0000000..d1ab397
--- /dev/null
+++ b/grlib.h
@@ -0,0 +1,61 @@
+/*
+ * This file is part of SIS.
+ *
+ * SIS, SPARC instruction simulator. Copyright (C) 2014 Jiri Gaisler
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+/* Definitions for AMBA PNP in Gaisler Research GRLIB SOC */
+
+/* Vendors */
+
+#define VENDOR_GAISLER 1
+#define VENDOR_PENDER 2
+#define VENDOR_ESA 4
+#define VENDOR_DLR 10
+
+/* Devices */
+
+#define GAISLER_LEON3 0x003
+#define GAISLER_APBMST 0x006
+#define GAISLER_SRCTRL 0x008
+#define GAISLER_APBUART 0x00C
+#define GAISLER_IRQMP 0x00D
+#define GAISLER_GPTIMER 0x011
+#define ESA_MCTRL 0x00F
+
+/* How to build entries in the plug&play area */
+
+#define GRLIB_PP_ID(v, d, x, i) ((v & 0xff) << 24) | ((d & 0x3ff) << 12) |\
+ ((x & 0x1f) << 5) | (i & 0x1f)
+#define GRLIB_PP_AHBADDR(a, m, p, c, t) (a & 0xfff00000) | ((m & 0xfff) << 4) |\
+ ((p & 1) << 17) | ((c & 1) << 16) | (t & 0x3)
+#define GRLIB_PP_APBADDR(a, m) ((a & 0xfff00)<< 12) | ((m & 0xfff) << 4) | 1
+
+#define AHBPP_START 0xFFFFF000
+#define AHBPP_END 0xFFFFFFFF
+#define APBPP_START 0x800FF000
+#define APBPP_END 0x800FFFFF
+
+extern int grlib_apbpp_add (uint32 id, uint32 addr);
+extern int grlib_ahbmpp_add (uint32 id);
+extern int grlib_ahbspp_add (uint32 id, uint32 addr1, uint32 addr2,
+ uint32 addr3, uint32 addr4);
+extern uint32 grlib_ahbpnp_read (uint32 addr);
+extern uint32 grlib_apbpnp_read (uint32 addr);
+extern void grlib_init ();
+extern uint32 rvtimer_read(int address, int cpu);