[coreboot-gerrit] Patch set updated for coreboot: Exynos7: Add GIC initialization
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Fri May 20 18:23:46 CEST 2016
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14913
-gerrit
commit d8768caf439e6e6e0c9c50b2fe0910aeae3566a9
Author: Akshay Saraswat <akshay.s at samsung.com>
Date: Thu Aug 7 16:26:12 2014 +0530
Exynos7: Add GIC initialization
Adding initial GIC setup for Exynos7 in this patch.
BUG=None
BRANCH=None
TEST=None
Change-Id: I9bdcd8924950b5442914a2f669ecfad52ff8dd2e
Signed-off-by: Akshay Saraswat <akshay.s at samsung.com>
---
src/soc/samsung/exynos7/Makefile.inc | 1 +
src/soc/samsung/exynos7/bootblock.c | 4 ++++
src/soc/samsung/exynos7/gic.c | 32 ++++++++++++++++++++++++++++++
src/soc/samsung/exynos7/include/soc/gic.h | 33 +++++++++++++++++++++++++++++++
4 files changed, 70 insertions(+)
diff --git a/src/soc/samsung/exynos7/Makefile.inc b/src/soc/samsung/exynos7/Makefile.inc
index 93f21c2..f954bd3 100644
--- a/src/soc/samsung/exynos7/Makefile.inc
+++ b/src/soc/samsung/exynos7/Makefile.inc
@@ -23,6 +23,7 @@ bootblock-y += bootblock.c
bootblock-y += clock.c
bootblock-y += clock_init.c
bootblock-y += dmc_init_lpddr4.c
+bootblock-y += gic.c
bootblock-y += gpio.c
bootblock-y += mct.c
bootblock-y += monotonic_timer.c
diff --git a/src/soc/samsung/exynos7/bootblock.c b/src/soc/samsung/exynos7/bootblock.c
index fab66a1..2f3208b 100644
--- a/src/soc/samsung/exynos7/bootblock.c
+++ b/src/soc/samsung/exynos7/bootblock.c
@@ -21,6 +21,7 @@
#include <soc/clock.h>
#include <soc/cpu.h>
#include <soc/dmc.h>
+#include <soc/gic.h>
#include <soc/mct.h>
#include <soc/pinmux.h>
#include <soc/power.h>
@@ -60,6 +61,9 @@ void bootblock_cpu_init(void)
/* Initialize trustzone */
trustzone_init();
+ /* Initialize GIC */
+ gic_init();
+
/* Set GPIOs for UART */
if (IS_ENABLED(CONFIG_CONSOLE_SERIAL_UART0))
exynos_pinmux_uart0();
diff --git a/src/soc/samsung/exynos7/gic.c b/src/soc/samsung/exynos7/gic.c
new file mode 100644
index 0000000..4002f23d
--- /dev/null
+++ b/src/soc/samsung/exynos7/gic.c
@@ -0,0 +1,32 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Samsung Electronics
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+#include <arch/io.h>
+#include <soc/gic.h>
+
+/* Setting Generic Interrupt Controller */
+void gic_init(void)
+{
+ uint64_t addr, start = 0, end = 0;
+
+ start = EXYNOS7_GIC_DIST_BASE + 0x80;
+ end = start + (NUM_GIC_INTERFACES * 0x4);
+
+ for (addr = start; addr < end; addr += 0x4)
+ writel(GIC_DIST_VAL, (void *)addr);
+
+ writel(0xb, (void *)EXYNOS7_GIC_CPU_INTERFACE);
+ writel(0xff, (void *)EXYNOS7_GIC_CPU_INTERFACE + 0x4);
+}
diff --git a/src/soc/samsung/exynos7/include/soc/gic.h b/src/soc/samsung/exynos7/include/soc/gic.h
new file mode 100644
index 0000000..8186dc5
--- /dev/null
+++ b/src/soc/samsung/exynos7/include/soc/gic.h
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Samsung Electronics
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+#ifndef _CPU_SAMSUNG_EXYNOS7_GIC_H_
+#define _CPU_SAMSUNG_EXYNOS7_GIC_H_
+
+#include <soc/cpu.h>
+
+#define EXYNOS7_GIC_DIST_BASE (EXYNOS7_GIC_BASE + 0x1000)
+#define EXYNOS7_GIC_CPU_INTERFACE (EXYNOS7_GIC_BASE + 0x2000)
+#define EXYNOS7_GICC_HPPIR (EXYNOS7_GIC_CPU_INTERFACE + 0x18)
+
+#define NUM_GIC_INTERFACES 16
+#define GIC_DIST_VAL 0xffffffff
+
+#define GIC_SPURIOUS_INTERRUPT 1023
+
+/* Setting Generic Interrupt Controller */
+void gic_init(void);
+
+#endif /* _CPU_SAMSUNG_EXYNOS7_GIC_H_ */
More information about the coreboot-gerrit
mailing list