machine: freedom-u540: Add support for booting from SD card

Modify freedom-u540 machine to boot off of sd card by default.
Note that there is a bug with the U540's SPI controller that
makes this painfully slow.

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
This commit is contained in:
Moritz Fischer
2018-04-07 23:46:22 +00:00
committed by Khem Raj
parent 0473a5ba80
commit c01c8aad5b
4 changed files with 2680 additions and 17 deletions

View File

@@ -18,15 +18,20 @@ QEMUVERSION = "riscv"
EXTRA_IMAGEDEPENDS += "riscv-pk"
SERIAL_CONSOLE = "115200 ttyS0"
SERIAL_CONSOLE = "115200 console"
MACHINE_EXTRA_RRECOMMENDS += " kernel-modules"
RISCV_BBL_PAYLOAD ?= "${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin"
# The following options can be used to build images that use initramfs,
# since the SPI controller driver currently still has an issue, using this
# might speed up your boot process signifcantly
#
#RISCV_BBL_PAYLOAD ?= "${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin"
#INITRAMFS_IMAGE_BUNDLE = "1"
#INITRAMFS_IMAGE = "riscv-initramfs-image"
#KERNEL_INITRAMFS = '-initramfs'
INITRAMFS_IMAGE_BUNDLE = "1"
INITRAMFS_IMAGE = "riscv-initramfs-image"
KERNEL_INITRAMFS = '-initramfs'
RISCV_BBL_PAYLOAD ?= "${KERNEL_IMAGETYPE}-${MACHINE}.bin"
IMAGE_FSTYPES_append = " wic.gz"

View File

@@ -0,0 +1,42 @@
From dc58ccb30dd1152a2483f4a3d4e2476a7f0d54cf Mon Sep 17 00:00:00 2001
From: Moritz Fischer <mdf@kernel.org>
Date: Sat, 7 Apr 2018 22:01:54 +0000
Subject: [PATCH] risc-v: Fix issue ignoring CONFIG_CMDLINE_OVERRIDE
Fix issue with ignoring CONFIG_CMDLINE_OVERRIDE.
Upstream-status: Inapporopriate [Not correct fix]
Signed-off-by: Moritz Fischer <mdf@kernel.org>
---
arch/riscv/kernel/setup.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index a1d585387f60..727caa5f5f42 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -39,6 +39,8 @@
#include <asm/tlbflush.h>
#include <asm/thread_info.h>
+static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
+
#ifdef CONFIG_EARLY_PRINTK
static void sbi_console_write(struct console *co, const char *buf,
unsigned int n)
@@ -222,7 +224,12 @@ void __init setup_arch(char **cmdline_p)
register_console(early_console);
}
#endif
+
+#if defined(CONFIG_CMDLINE_OVERRIDE)
+ *cmdline_p = default_command_line;
+#else
*cmdline_p = boot_command_line;
+#endif
parse_early_param();
--
2.14.3

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,9 @@ SRC_URI = "\
# qemu uses in-tree defconfig
# freedom-u540 uses out-of-tree defconfig
SRC_URI_append_freedom-u540 = " file://defconfig"
SRC_URI_append_freedom-u540 = " file://defconfig \
file://0001-risc-v-Fix-issue-ignoring-CONFIG_CMDLINE_OVERRIDE.patch \
"
LINUX_VERSION_EXTENSION = "-riscv"