Move them to a single header.

Signed-off-by: Ralf Ramsauer <[email protected]>
---
 inmates/demos/arm/gic-demo.c                       |  2 +-
 inmates/lib/arm-common/gic-v2.c                    | 12 ++---
 inmates/lib/arm-common/printk.c                    |  2 +-
 inmates/lib/arm/Makefile.lib                       | 12 ++---
 inmates/lib/arm/gic-v3.c                           |  6 +--
 inmates/lib/arm/include/mach-sun7i/mach/console.h  | 17 -------
 inmates/lib/arm/include/mach-sun7i/mach/gic_v2.h   | 14 ------
 inmates/lib/arm/include/mach-sun7i/mach/timer.h    | 13 ------
 .../lib/arm/include/mach-tegra124/mach/console.h   | 21 ---------
 .../lib/arm/include/mach-tegra124/mach/gic_v2.h    | 14 ------
 inmates/lib/arm/include/mach-tegra124/mach/timer.h | 13 ------
 .../lib/arm/include/mach-vexpress/mach/console.h   | 15 ------
 .../lib/arm/include/mach-vexpress/mach/gic_v2.h    | 14 ------
 .../lib/arm/include/mach-vexpress/mach/gic_v3.h    | 14 ------
 inmates/lib/arm/include/mach-vexpress/mach/timer.h | 13 ------
 inmates/lib/arm/include/mach.h                     | 53 ++++++++++++++++++++++
 inmates/lib/arm64/Makefile.lib                     | 12 ++---
 .../arm64/include/mach-amd-seattle/mach/console.h  | 15 ------
 .../arm64/include/mach-amd-seattle/mach/gic_v2.h   | 14 ------
 .../arm64/include/mach-amd-seattle/mach/timer.h    | 13 ------
 .../include/mach-foundation-v8/mach/console.h      | 15 ------
 .../arm64/include/mach-foundation-v8/mach/gic_v2.h | 14 ------
 .../arm64/include/mach-foundation-v8/mach/timer.h  | 13 ------
 .../lib/arm64/include/mach-hi6220/mach/console.h   | 15 ------
 .../lib/arm64/include/mach-hi6220/mach/gic_v2.h    | 14 ------
 inmates/lib/arm64/include/mach-hi6220/mach/timer.h | 13 ------
 inmates/lib/arm64/include/mach.h                   | 42 +++++++++++++++++
 27 files changed, 118 insertions(+), 297 deletions(-)
 delete mode 100644 inmates/lib/arm/include/mach-sun7i/mach/console.h
 delete mode 100644 inmates/lib/arm/include/mach-sun7i/mach/gic_v2.h
 delete mode 100644 inmates/lib/arm/include/mach-sun7i/mach/timer.h
 delete mode 100644 inmates/lib/arm/include/mach-tegra124/mach/console.h
 delete mode 100644 inmates/lib/arm/include/mach-tegra124/mach/gic_v2.h
 delete mode 100644 inmates/lib/arm/include/mach-tegra124/mach/timer.h
 delete mode 100644 inmates/lib/arm/include/mach-vexpress/mach/console.h
 delete mode 100644 inmates/lib/arm/include/mach-vexpress/mach/gic_v2.h
 delete mode 100644 inmates/lib/arm/include/mach-vexpress/mach/gic_v3.h
 delete mode 100644 inmates/lib/arm/include/mach-vexpress/mach/timer.h
 create mode 100644 inmates/lib/arm/include/mach.h
 delete mode 100644 inmates/lib/arm64/include/mach-amd-seattle/mach/console.h
 delete mode 100644 inmates/lib/arm64/include/mach-amd-seattle/mach/gic_v2.h
 delete mode 100644 inmates/lib/arm64/include/mach-amd-seattle/mach/timer.h
 delete mode 100644 inmates/lib/arm64/include/mach-foundation-v8/mach/console.h
 delete mode 100644 inmates/lib/arm64/include/mach-foundation-v8/mach/gic_v2.h
 delete mode 100644 inmates/lib/arm64/include/mach-foundation-v8/mach/timer.h
 delete mode 100644 inmates/lib/arm64/include/mach-hi6220/mach/console.h
 delete mode 100644 inmates/lib/arm64/include/mach-hi6220/mach/gic_v2.h
 delete mode 100644 inmates/lib/arm64/include/mach-hi6220/mach/timer.h
 create mode 100644 inmates/lib/arm64/include/mach.h

diff --git a/inmates/demos/arm/gic-demo.c b/inmates/demos/arm/gic-demo.c
index 85e83fe1f5..ba12abe4fa 100644
--- a/inmates/demos/arm/gic-demo.c
+++ b/inmates/demos/arm/gic-demo.c
@@ -12,7 +12,7 @@
  * the COPYING file in the top-level directory.
  */
 
-#include <mach/timer.h>
+#include <mach.h>
 #include <inmate.h>
 
 #define BEATS_PER_SEC          10
diff --git a/inmates/lib/arm-common/gic-v2.c b/inmates/lib/arm-common/gic-v2.c
index 68244098ae..2123c72a55 100644
--- a/inmates/lib/arm-common/gic-v2.c
+++ b/inmates/lib/arm-common/gic-v2.c
@@ -10,7 +10,7 @@
  * the COPYING file in the top-level directory.
  */
 
-#include <mach/gic_v2.h>
+#include <mach.h>
 #include <gic.h>
 
 #define GICC_CTLR              0x0000
@@ -24,24 +24,24 @@
 
 void gic_enable(unsigned int irqn)
 {
-       mmio_write32(GICD_BASE + GICD_ISENABLER + ((irqn >> 3) & ~0x3),
+       mmio_write32(GICD_V2_BASE + GICD_ISENABLER + ((irqn >> 3) & ~0x3),
                     1 << (irqn & 0x1f));
 }
 
 int gic_init(void)
 {
-       mmio_write32(GICC_BASE + GICC_CTLR, GICC_CTLR_GRPEN1);
-       mmio_write32(GICC_BASE + GICC_PMR, GICC_PMR_DEFAULT);
+       mmio_write32(GICC_V2_BASE + GICC_CTLR, GICC_CTLR_GRPEN1);
+       mmio_write32(GICC_V2_BASE + GICC_PMR, GICC_PMR_DEFAULT);
 
        return 0;
 }
 
 void gic_write_eoi(u32 irqn)
 {
-       mmio_write32(GICC_BASE + GICC_EOIR, irqn);
+       mmio_write32(GICC_V2_BASE + GICC_EOIR, irqn);
 }
 
 u32 gic_read_ack(void)
 {
-       return mmio_read32(GICC_BASE + GICC_IAR);
+       return mmio_read32(GICC_V2_BASE + GICC_IAR);
 }
diff --git a/inmates/lib/arm-common/printk.c b/inmates/lib/arm-common/printk.c
index 5259e57d4f..81e32d9e7d 100644
--- a/inmates/lib/arm-common/printk.c
+++ b/inmates/lib/arm-common/printk.c
@@ -13,7 +13,7 @@
 #include <inmate.h>
 #include <stdarg.h>
 #include <uart.h>
-#include <mach/console.h>
+#include <mach.h>
 
 #ifndef CON_TYPE
 #define CON_TYPE "none"
diff --git a/inmates/lib/arm/Makefile.lib b/inmates/lib/arm/Makefile.lib
index ebbad6aa83..a1042ca6b5 100644
--- a/inmates/lib/arm/Makefile.lib
+++ b/inmates/lib/arm/Makefile.lib
@@ -28,13 +28,13 @@ define DECLARE_TARGETS =
             $$(_TARGETS:.bin=-linked.o) $$(_TARGETS)
 endef
 
-mach-$(CONFIG_MACH_VEXPRESS)           := vexpress
-mach-$(CONFIG_MACH_SUN7I)              := sun7i
-mach-$(CONFIG_MACH_TEGRA124)           := tegra124
+mach-$(CONFIG_MACH_VEXPRESS)           := VEXPRESS
+mach-$(CONFIG_MACH_SUN7I)              := SUN7I
+mach-$(CONFIG_MACH_TEGRA124)           := TEGRA124
 
-MACHINE                                        := mach-$(mach-y)
-KBUILD_CFLAGS                          += -I$(INMATES_LIB)/include/$(MACHINE)
-KBUILD_AFLAGS                          += -I$(INMATES_LIB)/include/$(MACHINE)
+MACHINE                                        := MACH_$(mach-y)
+KBUILD_CFLAGS                          += -D$(MACHINE)
+KBUILD_AFLAGS                          += -D$(MACHINE)
 
 # prevent deleting intermediate files which would cause rebuilds
 .SECONDARY: $(addprefix $(obj)/,$(targets))
diff --git a/inmates/lib/arm/gic-v3.c b/inmates/lib/arm/gic-v3.c
index ffc1151342..6831597abc 100644
--- a/inmates/lib/arm/gic-v3.c
+++ b/inmates/lib/arm/gic-v3.c
@@ -11,7 +11,7 @@
  */
 
 #include <asm/sysregs.h>
-#include <mach/gic_v3.h>
+#include <mach.h>
 #include <gic.h>
 
 #define GICR_SGI_BASE          0x10000
@@ -28,10 +28,10 @@
 void gic_enable(unsigned int irqn)
 {
        if (is_sgi_ppi(irqn))
-               mmio_write32(GICR_BASE + GICR_SGI_BASE + GICR_ISENABLER,
+               mmio_write32(GICR_V3_BASE + GICR_SGI_BASE + GICR_ISENABLER,
                             1 << irqn);
        else if (is_spi(irqn))
-               mmio_write32(GICD_BASE + GICD_ISENABLER + irqn / 32,
+               mmio_write32(GICD_V3_BASE + GICD_ISENABLER + irqn / 32,
                             1 << (irqn % 32));
 }
 
diff --git a/inmates/lib/arm/include/mach-sun7i/mach/console.h 
b/inmates/lib/arm/include/mach-sun7i/mach/console.h
deleted file mode 100644
index d01937b7f3..0000000000
--- a/inmates/lib/arm/include/mach-sun7i/mach/console.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) Siemens AG, 2014
- *
- * Authors:
- *  Jan Kiszka <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define CON_TYPE       "8250"
-
-#define CON_BASE       0x01c29c00
-#define CON_CLOCK_REG  0x01c2006c
-#define CON_GATE_NR    23
diff --git a/inmates/lib/arm/include/mach-sun7i/mach/gic_v2.h 
b/inmates/lib/arm/include/mach-sun7i/mach/gic_v2.h
deleted file mode 100644
index b7181da976..0000000000
--- a/inmates/lib/arm/include/mach-sun7i/mach/gic_v2.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) Siemens AG, 2014
- *
- * Authors:
- *  Jan Kiszka <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define GICD_BASE      ((void *)0x01c81000)
-#define GICC_BASE      ((void *)0x01c82000)
diff --git a/inmates/lib/arm/include/mach-sun7i/mach/timer.h 
b/inmates/lib/arm/include/mach-sun7i/mach/timer.h
deleted file mode 100644
index b0b544cb2f..0000000000
--- a/inmates/lib/arm/include/mach-sun7i/mach/timer.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) Siemens AG, 2014
- *
- * Authors:
- *  Jan Kiszka <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define TIMER_IRQ      27
diff --git a/inmates/lib/arm/include/mach-tegra124/mach/console.h 
b/inmates/lib/arm/include/mach-tegra124/mach/console.h
deleted file mode 100644
index ca54c34afd..0000000000
--- a/inmates/lib/arm/include/mach-tegra124/mach/console.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) Siemens AG, 2015
- *
- * Authors:
- *  Jan Kiszka <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define CON_TYPE       "8250"
-
-#define CON_BASE       0x70006300 /* UART D on tegra124, exposed to the DB9
-                                     connector of the Jetson TK1 */
-
-/* Do not enable the clock in the inmate, as enabling the clock requires access
- * to the tegra-car (Clock and Reset Controller) */
-#define CON_CLOCK_REG  0
-#define CON_GATE_NR    0
diff --git a/inmates/lib/arm/include/mach-tegra124/mach/gic_v2.h 
b/inmates/lib/arm/include/mach-tegra124/mach/gic_v2.h
deleted file mode 100644
index e51319443d..0000000000
--- a/inmates/lib/arm/include/mach-tegra124/mach/gic_v2.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) Siemens AG, 2015
- *
- * Authors:
- *  Jan Kiszka <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define GICD_BASE      ((void *)0x50041000)
-#define GICC_BASE      ((void *)0x50042000)
diff --git a/inmates/lib/arm/include/mach-tegra124/mach/timer.h 
b/inmates/lib/arm/include/mach-tegra124/mach/timer.h
deleted file mode 100644
index 428162d81c..0000000000
--- a/inmates/lib/arm/include/mach-tegra124/mach/timer.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) Siemens AG, 2015
- *
- * Authors:
- *  Jan Kiszka <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define TIMER_IRQ      27
diff --git a/inmates/lib/arm/include/mach-vexpress/mach/console.h 
b/inmates/lib/arm/include/mach-vexpress/mach/console.h
deleted file mode 100644
index 4f0df73915..0000000000
--- a/inmates/lib/arm/include/mach-vexpress/mach/console.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) ARM Limited, 2014
- *
- * Authors:
- *  Jean-Philippe Brucker <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define CON_TYPE       "PL011"
-
-#define CON_BASE       0x1c090000
diff --git a/inmates/lib/arm/include/mach-vexpress/mach/gic_v2.h 
b/inmates/lib/arm/include/mach-vexpress/mach/gic_v2.h
deleted file mode 100644
index aa9039d214..0000000000
--- a/inmates/lib/arm/include/mach-vexpress/mach/gic_v2.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) ARM Limited, 2014
- *
- * Authors:
- *  Jean-Philippe Brucker <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define GICD_BASE      ((void *)0x2c001000)
-#define GICC_BASE      ((void *)0x2c002000)
diff --git a/inmates/lib/arm/include/mach-vexpress/mach/gic_v3.h 
b/inmates/lib/arm/include/mach-vexpress/mach/gic_v3.h
deleted file mode 100644
index 8f4f7c62c0..0000000000
--- a/inmates/lib/arm/include/mach-vexpress/mach/gic_v3.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) ARM Limited, 2014
- *
- * Authors:
- *  Jean-Philippe Brucker <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define GICD_BASE      ((void *)0x2f000000)
-#define GICR_BASE      ((void *)0x2f100000)
diff --git a/inmates/lib/arm/include/mach-vexpress/mach/timer.h 
b/inmates/lib/arm/include/mach-vexpress/mach/timer.h
deleted file mode 100644
index be6e411ece..0000000000
--- a/inmates/lib/arm/include/mach-vexpress/mach/timer.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) ARM Limited, 2014
- *
- * Authors:
- *  Jean-Philippe Brucker <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define TIMER_IRQ      27
diff --git a/inmates/lib/arm/include/mach.h b/inmates/lib/arm/include/mach.h
new file mode 100644
index 0000000000..d311b611d6
--- /dev/null
+++ b/inmates/lib/arm/include/mach.h
@@ -0,0 +1,53 @@
+/*
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * Copyright (c) Siemens AG, 2015
+ * Copyright (c) ARM Limited, 2014
+ *
+ * Authors:
+ *  Jan Kiszka <[email protected]>
+ *  Jean-Philippe Brucker <[email protected]>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ */
+
+#ifdef MACH_TEGRA124
+#define CON_TYPE       "8250"
+#define CON_BASE       0x70006300 /* UART D on tegra124, exposed to the DB9
+                                     connector of the Jetson TK1 */
+/* Do not enable the clock in the inmate, as enabling the clock requires access
+ * to the tegra-car (Clock and Reset Controller) */
+#define CON_CLOCK_REG  0
+#define CON_GATE_NR    0
+
+#define GICD_V2_BASE   ((void *)0x50041000)
+#define GICC_V2_BASE   ((void *)0x50042000)
+
+#define TIMER_IRQ      27
+
+#elif defined(MACH_SUN7I)
+#define CON_TYPE       "8250"
+#define CON_BASE       0x01c29c00
+
+#define CON_CLOCK_REG  0x01c2006c
+#define CON_GATE_NR    23
+
+#define GICD_V2_BASE   ((void *)0x01c81000)
+#define GICC_V2_BASE   ((void *)0x01c82000)
+
+#define TIMER_IRQ      27
+
+#elif defined(MACH_VEXPRESS)
+#define CON_TYPE       "PL011"
+#define CON_BASE       0x1c090000
+
+#define GICD_V2_BASE   ((void *)0x2c001000)
+#define GICC_V2_BASE   ((void *)0x2c002000)
+
+#define GICD_V3_BASE   ((void *)0x2f000000)
+#define GICR_V3_BASE   ((void *)0x2f100000)
+
+#define TIMER_IRQ      27
+
+#endif
diff --git a/inmates/lib/arm64/Makefile.lib b/inmates/lib/arm64/Makefile.lib
index 45cdfa225f..dc470cc977 100644
--- a/inmates/lib/arm64/Makefile.lib
+++ b/inmates/lib/arm64/Makefile.lib
@@ -26,13 +26,13 @@ define DECLARE_TARGETS =
             $$(_TARGETS:.bin=-linked.o) $$(_TARGETS)
 endef
 
-mach-$(CONFIG_MACH_FOUNDATION_V8)      := foundation-v8
-mach-$(CONFIG_MACH_AMD_SEATTLE)         := amd-seattle
-mach-$(CONFIG_MACH_HI6220)             := hi6220
+mach-$(CONFIG_MACH_FOUNDATION_V8)      := FOUNDATION_V8
+mach-$(CONFIG_MACH_AMD_SEATTLE)         := AMD_SEATTLE
+mach-$(CONFIG_MACH_HI6220)             := HI6220
 
-MACHINE                                        := mach-$(mach-y)
-KBUILD_CFLAGS                          += -I$(INMATES_LIB)/include/$(MACHINE)
-KBUILD_AFLAGS                          += -I$(INMATES_LIB)/include/$(MACHINE)
+MACHINE                                        := MACH_$(mach-y)
+KBUILD_CFLAGS                          += -D$(MACHINE)
+KBUILD_AFLAGS                          += -D$(MACHINE)
 
 # prevent deleting intermediate files which would cause rebuilds
 .SECONDARY: $(addprefix $(obj)/,$(targets))
diff --git a/inmates/lib/arm64/include/mach-amd-seattle/mach/console.h 
b/inmates/lib/arm64/include/mach-amd-seattle/mach/console.h
deleted file mode 100644
index b73b868b84..0000000000
--- a/inmates/lib/arm64/include/mach-amd-seattle/mach/console.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Jailhouse AArch64 support
- *
- * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH
- *
- * Authors:
- *  Antonios Motakis <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define CON_TYPE       "PL011"
-
-#define CON_BASE       0xe1010000
diff --git a/inmates/lib/arm64/include/mach-amd-seattle/mach/gic_v2.h 
b/inmates/lib/arm64/include/mach-amd-seattle/mach/gic_v2.h
deleted file mode 100644
index b357a216d9..0000000000
--- a/inmates/lib/arm64/include/mach-amd-seattle/mach/gic_v2.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Jailhouse AArch64 support
- *
- * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH
- *
- * Authors:
- *  Antonios Motakis <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define GICD_BASE      ((void *)0xe1110000)
-#define GICC_BASE      ((void *)0xe112f000)
diff --git a/inmates/lib/arm64/include/mach-amd-seattle/mach/timer.h 
b/inmates/lib/arm64/include/mach-amd-seattle/mach/timer.h
deleted file mode 100644
index 696b5cb81d..0000000000
--- a/inmates/lib/arm64/include/mach-amd-seattle/mach/timer.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Jailhouse AArch64 support
- *
- * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH
- *
- * Authors:
- *  Antonios Motakis <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define TIMER_IRQ      27
diff --git a/inmates/lib/arm64/include/mach-foundation-v8/mach/console.h 
b/inmates/lib/arm64/include/mach-foundation-v8/mach/console.h
deleted file mode 100644
index 11d1016f58..0000000000
--- a/inmates/lib/arm64/include/mach-foundation-v8/mach/console.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Jailhouse AArch64 support
- *
- * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH
- *
- * Authors:
- *  Antonios Motakis <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define CON_TYPE       "PL011"
-
-#define CON_BASE       0x1c090000
diff --git a/inmates/lib/arm64/include/mach-foundation-v8/mach/gic_v2.h 
b/inmates/lib/arm64/include/mach-foundation-v8/mach/gic_v2.h
deleted file mode 100644
index bd3ec88393..0000000000
--- a/inmates/lib/arm64/include/mach-foundation-v8/mach/gic_v2.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Jailhouse AArch64 support
- *
- * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH
- *
- * Authors:
- *  Antonios Motakis <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define GICD_BASE      ((void *)0x2c001000)
-#define GICC_BASE      ((void *)0x2c002000)
diff --git a/inmates/lib/arm64/include/mach-foundation-v8/mach/timer.h 
b/inmates/lib/arm64/include/mach-foundation-v8/mach/timer.h
deleted file mode 100644
index 696b5cb81d..0000000000
--- a/inmates/lib/arm64/include/mach-foundation-v8/mach/timer.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Jailhouse AArch64 support
- *
- * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH
- *
- * Authors:
- *  Antonios Motakis <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define TIMER_IRQ      27
diff --git a/inmates/lib/arm64/include/mach-hi6220/mach/console.h 
b/inmates/lib/arm64/include/mach-hi6220/mach/console.h
deleted file mode 100644
index 0acc59d270..0000000000
--- a/inmates/lib/arm64/include/mach-hi6220/mach/console.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * HiSilicon Hi6220
- *
- * Copyright (c) Siemens AG, 2016
- *
- * Authors:
- *  Jan Kiszka <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define CON_TYPE       "PL011"
-
-#define CON_BASE       0xf7113000
diff --git a/inmates/lib/arm64/include/mach-hi6220/mach/gic_v2.h 
b/inmates/lib/arm64/include/mach-hi6220/mach/gic_v2.h
deleted file mode 100644
index a8955d49e8..0000000000
--- a/inmates/lib/arm64/include/mach-hi6220/mach/gic_v2.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * HiSilicon Hi6220
- *
- * Copyright (c) Siemens AG, 2016
- *
- * Authors:
- *  Jan Kiszka <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define GICD_BASE      ((void *)0xf6801000)
-#define GICC_BASE      ((void *)0xf6802000)
diff --git a/inmates/lib/arm64/include/mach-hi6220/mach/timer.h 
b/inmates/lib/arm64/include/mach-hi6220/mach/timer.h
deleted file mode 100644
index 6865d5bd22..0000000000
--- a/inmates/lib/arm64/include/mach-hi6220/mach/timer.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * HiSilicon Hi6220
- *
- * Copyright (c) Siemens AG, 2016
- *
- * Authors:
- *  Jan Kiszka <[email protected]>
- *
- * This work is licensed under the terms of the GNU GPL, version 2.  See
- * the COPYING file in the top-level directory.
- */
-
-#define TIMER_IRQ      27
diff --git a/inmates/lib/arm64/include/mach.h b/inmates/lib/arm64/include/mach.h
new file mode 100644
index 0000000000..2f33493fec
--- /dev/null
+++ b/inmates/lib/arm64/include/mach.h
@@ -0,0 +1,42 @@
+/*
+ * Jailhouse AArch64 support
+ *
+ * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH
+ * Copyright (c) Siemens AG, 2016
+ * 
+ *
+ * Authors:
+ *  Antonios Motakis <[email protected]>
+ *  Jan Kiszka <[email protected]>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ */
+
+#ifdef MACH_AMD_SEATTLE
+#define CON_TYPE       "PL011"
+#define CON_BASE       0xe1010000
+
+#define GICD_V2_BASE   ((void *)0xe1110000)
+#define GICC_V2_BASE   ((void *)0xe112f000)
+
+#define TIMER_IRQ      27
+
+#elif defined(MACH_FOUNDATION_V8)
+#define CON_TYPE       "PL011"
+#define CON_BASE       0x1c090000
+
+#define GICD_V2_BASE   ((void *)0x2c001000)
+#define GICC_V2_BASE   ((void *)0x2c002000)
+
+#define TIMER_IRQ      27
+
+#elif defined(MACH_HI6220)
+#define CON_TYPE       "PL011"
+#define CON_BASE       0xf7113000
+
+#define GICD_V2_BASE   ((void *)0xf6801000)
+#define GICC_V2_BASE   ((void *)0xf6802000)
+
+#define TIMER_IRQ      27
+#endif
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to