[coreboot-gerrit] New patch to review for coreboot: Exynos7: Add GIC initialization
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Thu May 19 20:38:56 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 9d0f4fc702077e9d87b95f2a19a8d10606646f4e
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 | 36 ++++++++++++++++++++++++++++++
src/soc/samsung/exynos7/include/soc/gic.h | 37 +++++++++++++++++++++++++++++++
4 files changed, 78 insertions(+)
diff --git a/src/soc/samsung/exynos7/Makefile.inc b/src/soc/samsung/exynos7/Makefile.inc
index 5b77958..0e49448 100644
--- a/src/soc/samsung/exynos7/Makefile.inc
+++ b/src/soc/samsung/exynos7/Makefile.inc
@@ -27,6 +27,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 fab3e7c..5ceb09a 100644
--- a/src/soc/samsung/exynos7/bootblock.c
+++ b/src/soc/samsung/exynos7/bootblock.c
@@ -25,6 +25,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>
@@ -64,6 +65,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..a65684d
--- /dev/null
+++ b/src/soc/samsung/exynos7/gic.c
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#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..98d32a2
--- /dev/null
+++ b/src/soc/samsung/exynos7/include/soc/gic.h
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#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