summaryrefslogtreecommitdiffstats
path: root/arch/riscv/boot/main_entry.c
diff options
context:
space:
mode:
authorAntony Pavlov <antonynpavlov@gmail.com>2018-12-18 10:19:34 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2019-01-07 08:53:18 +0100
commit8099f22c1bfac85110823ea2dafcfb01453bcbae (patch)
tree53ad0dbd618f659eacca533eb14c78582ed2b9dc /arch/riscv/boot/main_entry.c
parent64fc4ac1b50a06b17a72c7427e797b3a33a30e8c (diff)
downloadbarebox-8099f22c1bfac85110823ea2dafcfb01453bcbae.tar.gz
barebox-8099f22c1bfac85110823ea2dafcfb01453bcbae.tar.xz
Add initial RISC-V architecture support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/riscv/boot/main_entry.c')
-rw-r--r--arch/riscv/boot/main_entry.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/riscv/boot/main_entry.c b/arch/riscv/boot/main_entry.c
new file mode 100644
index 0000000000..f9c640c112
--- /dev/null
+++ b/arch/riscv/boot/main_entry.c
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2016 Antony Pavlov <antonynpavlov@gmail.com>
+ *
+ * This file is part of barebox.
+ *
+ * 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 <common.h>
+#include <memory.h>
+#include <asm-generic/memory_layout.h>
+#include <asm/sections.h>
+
+void main_entry(void);
+
+/**
+ * Called plainly from assembler code
+ *
+ * @note The C environment isn't initialized yet
+ */
+void main_entry(void)
+{
+ /* clear the BSS first */
+ memset(__bss_start, 0x00, __bss_stop - __bss_start);
+
+ mem_malloc_init((void *)MALLOC_BASE,
+ (void *)(MALLOC_BASE + MALLOC_SIZE - 1));
+
+ start_barebox();
+}