Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
This supports bbl living above 4 GiB.
|
|
This allows bbl to be loaded above 4 GiB on RV64.
|
|
|
|
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>
|
|
|
|
This indicates the access is actually invalid, i.e., should not
be emulated.
|
|
This reverts commit 7bee30c1ff56975041ffc67cd0170d7477aba865.
All ones is no longer "reserved", so the old code is OK.
|
|
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>
|
|
|
|
Use a proxy syscall instead of a blocking character write.
Resolves #84
|
|
Currently it's being used by both enter_supervisor_mode and enter_machine_mode
|
|
|
|
Upgrade SoftFloat
|
|
Correct the comment of timer interrupt
|
|
|
|
|
|
Can't cast to pointer from 64 bit size integer directly on 32 bit
environment.
|
|
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.
|
|
|
|
|
|
|
|
The MENTRY_IPI_PENDING_OFFSET offset is based on stack pointer
|
|
Reboot does not work reliably without this.
|
|
Otherwise, linux complains the moment an interrupt arrives and
wakes up one of the not-looping cores.
|
|
gcc sometimes takes liberties with optimizing away our important halt function!
|
|
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.
|
|
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.
|
|
|
|
We now automatically detect everything that the platform interface used
to be used for, so it's now obsolete!
|
|
|
|
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
|
|
|
|
I'm trying to debug some device tree problems while booting Linux and
figured it would be really nice to have access to the device tree while
trying to debug these problems. I think this might be useful for lots
of people, so I went ahead and cleaned up the code enough that it should
actaully work in most cases.
|
|
Some platforms can't boot Linux on all the harts. This commit allows
platforms to define the set of harts that should be prevented from
booting past BBL. This is essentially just a new mechanism for defining
the DISABLED_HART_MASK.
|
|
|
|
SiFive's pk fork is the second one I've had to maintain, and it's a huge
pain because people keep just leaving changes all over the tree. I want
to introduce an interface that the platform-specific details can live
behind so I don't have to keep doing these painful merges.
|
|
We were accidentally advancing the PC by 4, not 2.
|
|
|
|
This fixes RV32 pk.
|
|
|
|
|