Some ELF loaders, in particular gdb's load command for dynamically
loading files into memory, which is often used to load binaries onto
FPGAs over JTAG, do not zero out BSS, leaving the memory in whatever
state it was previously in. Thus, introduce a new --enable-zero-bss
configure flag, which will include code to zero out BSS when booting.
* Added --with-abi configure option
* Revised to preserve original semantics when user specifies --with-arch but not --with-abi or when the user specifies --with-arch but not --host.
SV32 is presented in RISC-V Privileged Architecture Manual (version
20190608-Priv-MSU-Ratified) Section 4.3 for RV32 systems. However, BBL
responds to sv32 with:
hart_filter_mask saw unknown hart type: status="okay", mmu_type="riscv,sv32"
and hangs.
This patch is adopted from the original 'riscv-pk.diff' patch written
by Fabrice Bellard, distributed as part of the following tarball:
https://bellard.org/tinyemu/diskimage-linux-riscv-2018-09-23.tar.gz
Closes: https://github.com/riscv/riscv-pk/issues/160
This commit makes bbl read some additional fields from
the device tree if it detects an ns16550a:
- reg-shift
- reg-offset
- clock-frequency
For explanation of these check out the Linux Kernel doc:
https://www.kernel.org/doc/Documentation/devicetree/bindings/serial/8250.txt
In particular this allows the Xilinx AXI UART 16550 to act
as serial console with bbl and the Linux early boot console.
This also fixes a bug in which bbl will ignore any other than the first
"compatible" string when iterating over the nodes.
Previously this line would not have worked:
compatible = "xlnx,xps-uart16550-2.00.a", "ns16550a";
Before bbl would have just checked the first field instead of checking
all strings in the list.
With -ftree-loop-distribute-patterns, GCC detects that the body of memset
is equivalent to memset, and so turns it into a call to memset, causing
infinite recursion.
Closes#170.
For systems where physical memory is mapped to a start address
different from 0x80000000, allow the default to be overridden
using the --with-mem-start argument to the configure script.
Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
On 64-bit Rocket with 'DefaultFPGAConfig' (using 'WithNSmallCores'),
the 'U' extension is not supported, and accessing 'mcounteren' would
trigger an 'Illegal Instruction' trap.
Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
configure script does not support --enable-32bit option since June 2018
(commit c3cf29a8f2). The right step
to enable 32-bit support in pk is to provide '--with-arch=rv32i' option to
configure.
bbl.bin is necessary for booting on hardware and is created by
a simple objcopy line. It's much more convienent for riscv-pk to
create this file then to expect the user to know to do it or
to dig through the SDK's makefile to learn that it's required.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
The riscv compiler available in Ubuntu enables stack protection and
FORTIFY source by default which breaks the build. Adding
-fno-stack-protector and -U_FORTIFY_SOURCE to the tool flags
fixes this without any side effects.
The compiler available in debian do not have these protections enabled
and work with or without the extra flag.
Fixes: #105
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
The number of interrupt enable words should be the number of devices
divided by the number of bits per word (not the number of bytes per
word) and it should round up.
Without this fix, when using a larger number of interrupts,
the user will see a number of errors in qemu of the form:
plic: invalid register write: %08x
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>