Age | Commit message (Collapse) | Author | Files | Lines |
|
For now, we always compile files with -mabi option by using
soft-fp ABI. But there are some files use the header which in
toolchain, like unistd.h, stdint.h and so on. Finally, these
header files include other header files which existing depend
on ABI such as stubs-lp64.h or stubs-lp64d.h. So it causes the
header file not found when using the double-float toolchain with
soft-float ABI.
Fix up by compiling files with -march and -mabi options only if
there is specifying the --with-arch option at configure time.
If use the --with-arch option at configure time, that means your
toolchain has multi-lib support, so always building riscv-pk
by soft-float ABI is fine. Otherwise, we don't compile files with
specifying march and mabi options explicitly
|
|
Upgrade SoftFloat
|
|
Include .bss section to the binary so dtb_output() gets full size of payload
|
|
Correct the comment of timer interrupt
|
|
|
|
|
|
|
|
|
|
|
|
Replace the --enable-32bit option by --with-arch
|
|
Get rid of the --enable-32bit option and switch to use --with-arch,
which is more standard because it matches the GCC build.
If --with-arch is not specified, it defaults to whatever the
compiler's default is.
The --with-abi is not necessary for this project.
Unconditionally compile it with a no-float ABI.
|
|
Can't cast to pointer from 64 bit size integer directly on 32 bit
environment.
|
|
RISC-V: Support separate firmware and kernel payload
|
|
Support for separate firmware and kernel payload is added
by updating BBL to read optional preloaded kernel address
attributes from device-tree using a similar mechanism to
that used to pass init ramdisk addresses to linux kernel.
chosen {
riscv,kernel-start = <0x00000000 0x80200000>;
riscv,kernel-end = <0x00000000 0x80590634>;
};
These attributes are added by QEMU and read by BBL when combining
-bios <firmware-image> and -kernel <kernel-image> options. e.g.
$ qemu-system-riscv64 -machine virt -bios bbl -kernel vmlinux
With this change, bbl can be compiled without --with-payload
and the dummy payload alignment is altered to make the memory
footprint of the firmware-only bbl smaller. The dummy payload
message is updated to indicate the alternative load method.
This load method could also be supported by a first stage boot
loader that reads seperate firmware and kernel from SPI flash.
The main advantage of this new mechanism is that it eases kernel
development by avoiding the riscv-pk packaging step after kernel
builds, makes building per repository artefacts for CI simpler,
and mimics bootloaders on other platforms that can load a kernel
image file directly. Ultimately BBL should use an SPI driver to
load the kernel image however this mechanism supports use cases
such such as QEMU's -bios, -kernel and -initrd options following
examples from other platforms that pass kernel entry to firmware
via device-tree.
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
|
|
* If BBL emulates the FPU, the trap handler will load emulated FCSR from
x0's save slot into tp. The emulated FCSR should be initialized, else
the field of rounding mode will contain garbage codes. This will
lead to raising SIGABRT for a user mode program which tries to print a
floating point variable. In glibc, __printf_fp_l() (defined in
riscv-glibc/stdio-common/printf_fp.c) will call round_away() (defined
in riscv-glibc/include/rounding-mode.h). With a garbage rounding mode
in emulated FCSR, round_away() may call abort().
|
|
The E51 core on the U54-MC lacks supervisor mode, thus the plic_s_ie and plic_s_thresh are NULL when running on this core. This adds checks for this case.
|
|
|
|
|
|
Otherwise, the emulation code will refuse to emulate FP instructions.
|
|
|
|
The MENTRY_IPI_PENDING_OFFSET offset is based on stack pointer
|
|
of payload, in result DTB will not overlap with bss and will not
be zeroed by OS
|
|
Debian toolchain defaults to PIE, and I guess that will also be the case
of most distributions. This cause bbl to be non-functional.
This patch fixes that by adding -fno-PIE in the default CFLAGS.
|
|
Reboot does not work reliably without this.
|
|
* Changed install_subdir to $host_alias with substituted 64->32 instead of hardcoded riscv[32|64]-unknown-elf
* Updated readme to reflect changes in install_subdir.
|
|
Closes #87
|
|
Closes #88
|
|
Otherwise, linux complains the moment an interrupt arrives and
wakes up one of the not-looping cores.
|
|
This makes it more compatible with recent glibc.
|
|
mtrap: loop forever, really
|
|
gcc sometimes takes liberties with optimizing away our important halt function!
|
|
Boot on the first hart
|
|
This code is broken, and it's left over from before we could read the
DTB to find harts to boot on.
|
|
|
|
Add __riscv_flush_icache
|
|
For BBL's purposes a local i-cache flush should be sufficient.
|
|
Add a 16550 UART driver to back the SBI console
|
|
QEMU currently provides the console via HTIF and the SBI. That's a bit
messy because BBL polls for serial input, which means that typing too
quickly loses characters. While QEMU has a standard 16550 device model,
there's no way to have two consoles share the console in QEMU (as they'd
step all over each other) so that means we can't have both the HTIF
console and the 16550 console.
With this patch, QEMU can be changed to use a 16650 instead of the HTIF
for serial output. Linux will use the SBI for early printk support
(which is fine, polling for output is stable) and then swap over as soon
as it detects the UART. When Linux swaps it prints out the whole
history, but there's probably a way to get around that. There's a few
lines that are output to both, but it appears the Linux driver is close
enough to ours that nothing catastrophic happens -- there's not much to
the device, so hopefully that pans out on real hardware too.
Once Linux swaps over to natively using the driver we get reliable
console input. If you don't have the in-kernel driver then Linux never
swaps over and keeps using the SBI console just like before.
|
|
|
|
Fix line endings in the logo
|
|
|
|
Remove the platform interface
|
|
|
|
We now automatically detect everything that the platform interface used
to be used for, so it's now obsolete!
|
|
Detect harts that can't boot Linux instead of hard-coding them
|
|
|
|
Without this I can't get printf to show me debug info during early boot.
|
|
This checks to see if a hart can't boot Linux by looking for a
compatible "mmu-type" field. If the hart can't boot Linux, then bbl
masks it off.
|
|
|
|
Per the Unix-class platform spec
|