aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-01-04Page-align the writable data sectionAndrew Waterman2-4/+6
For eventual PMP purposes
2019-01-04Clean up linker scripts a bitAndrew Waterman2-14/+3
2018-12-02Delegate misaligned AMOs as access exceptions, not misalignedAndrew Waterman1-2/+8
This indicates the access is actually invalid, i.e., should not be emulated.
2018-12-02Revert "Avoid writing reserved values to pmpaddr CSR"Andrew Waterman1-2/+1
This reverts commit 7bee30c1ff56975041ffc67cd0170d7477aba865. All ones is no longer "reserved", so the old code is OK.
2018-11-21Merge pull request #134 from lsgunth/ie_words_fixPalmer Dabbelt1-1/+2
Fix the calculation for the number of interrupt enable words
2018-11-20Fix the calculation for the number of interrupt enable wordsLogan Gunthorpe1-1/+2
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>
2018-11-07Merge pull request #114 from zongbox/mabiPalmer Dabbelt1-6/+3
Fix stubs-lp64.h/stubs-lp64d.h/stubs-ilp32.h/stubs-ilp32d.h not found
2018-09-23Avoid writing reserved values to pmpaddr CSRAndrew Waterman1-1/+2
2018-09-17Fix git-submodule fatal error for berkeley-softfloat-3Michael Clark1-0/+0
A portend from git-submodule: $ git submodule update --init --recursive fatal: No url found for submodule path 'softfloat/berkeley-softfloat-3' in .gitmodules
2018-09-17Add softfloat/README.md detailing sourceMichael Clark1-0/+10
2018-08-15Fix printm on RV32 (#119)Andrew Waterman1-0/+16
Use a proxy syscall instead of a blocking character write. Resolves #84
2018-08-06Add some exception handling functions to s-mode to handle exception return ↵wxjstz1-0/+28
from m-mode. (#117)
2018-08-03Merge pull request #104 from heshamelmatary/disable_vmPalmer Dabbelt7-1/+57
bbl: boot payload in machine mode on --enable-boot-machine
2018-07-26Fix stubs-lp64.h/stubs-lp64d.h/stubs-ilp32.h/stubs-ilp32d.h not foundZong Li1-6/+3
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
2018-07-12minit: Move pmp setup code to a separate function to avoid duplicating codeHesham Almatary1-11/+7
Currently it's being used by both enter_supervisor_mode and enter_machine_mode
2018-07-12bbl: boot payload in machine mode when --enable-boot-machine is passedHesham Almatary4-0/+37
2018-07-12configure: Add --enable-boot-machine in BBLHesham Almatary3-0/+23
If --enable-boot-machine is passed, BBL disables VM and runs the payload in machine mode. This is useful for payloads (e.g. RTOSes or other OSes) that want to run only in machine mode while still relying on bbl/pk for system calls and emulation
2018-07-11Merge pull request #113 from riscv/licensePalmer Dabbelt394-5549/+33859
Upgrade SoftFloat
2018-07-11Merge pull request #91 from bukinr/masterPalmer Dabbelt1-1/+1
Include .bss section to the binary so dtb_output() gets full size of payload
2018-07-11Merge pull request #103 from zongbox/commentPalmer Dabbelt1-1/+1
Correct the comment of timer interrupt
2018-07-11Upgrade to SoftFloat 3eAndrew Waterman388-5544/+33807
2018-07-10Fix license on f32_classify and f64_classify (I wrote them)Andrew Waterman2-2/+2
2018-07-10Don't look for riscv_logo.txt if logo is not enabledAndrew Waterman3-3/+19
2018-07-10License my ASCII RISC-V logoAndrew Waterman1-0/+31
2018-07-09Properly license all nontrivial filesAndrew Waterman186-238/+955
2018-06-21Merge pull request #102 from zongbox/m32-v2Kito Cheng3-52/+39
Replace the --enable-32bit option by --with-arch
2018-06-21Replace the --enable-32bit option by --with-archZong Li3-52/+39
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.
2018-06-20Fix problem of casting u64 to void* on 32-bit environment (#111)Zong Li1-2/+2
Can't cast to pointer from 64 bit size integer directly on 32 bit environment.
2018-05-22Merge pull request #107 from michaeljclark/fdt-firmware-onlyPalmer Dabbelt9-11/+115
RISC-V: Support separate firmware and kernel payload
2018-05-22RISC-V: Support separate firmware and kernel payloadMichael Clark9-11/+115
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>
2018-05-21machine,minit: initialize emulated FCSR in enter_supervisor_mode() (#106)Zihao Yu1-0/+4
* 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().
2018-05-15Fix for missing supervisor mode when running on E51 (#96)Jim Straus1-3/+10
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.
2018-05-09Correct the comment of timer interruptZong Li1-1/+1
2018-04-27Fix typo of perf counter (#100)Zong Li1-2/+2
2018-04-24Enable FPU in PK, regardless of FPU presenceAndrew Waterman1-1/+1
Otherwise, the emulation code will refuse to emulate FP instructions.
2018-04-10SBI emulation of reads and writes to perf counters and config (#98)Alex Solomatnikov1-0/+58
2018-04-09Fix the wrong access of ipi pending address (#99)Zong Li1-2/+2
The MENTRY_IPI_PENDING_OFFSET offset is based on stack pointer
2018-03-23Include .bss section to the binary so dtb_output() gets full sizeRuslan Bukin1-1/+1
of payload, in result DTB will not overlap with bss and will not be zeroed by OS
2018-03-21Fix build with compilers defaulting to PIE (#90)aurel322-2/+2
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.
2018-03-20minit: insert printm as work-around for a race conditionWesley W. Terpstra1-0/+1
Reboot does not work reliably without this.
2018-03-16Changed install_subdir to $host_alias with substituted 64->32 instead… (#89)Rishi Khan3-7/+9
* 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.
2018-03-15Update config.guess/config.subAndrew Waterman2-861/+950
Closes #87
2018-03-15Don't link build-id stringAndrew Waterman2-0/+4
Closes #88
2018-03-05mtrap: add a halt IPI used for poweroff (#86)Wesley W. Terpstra3-11/+18
Otherwise, linux complains the moment an interrupt arrives and wakes up one of the not-looping cores.
2018-02-01Bump the Linux version PK claims to supportAndrew Waterman1-1/+1
This makes it more compatible with recent glibc.
2018-01-22Merge pull request #77 from riscv/mtrap-fixPalmer Dabbelt1-1/+1
mtrap: loop forever, really
2018-01-22mtrap: loop forever, reallyWesley W. Terpstra1-1/+1
gcc sometimes takes liberties with optimizing away our important halt function!
2018-01-22Merge pull request #76 from riscv/racePalmer Dabbelt1-9/+2
Boot on the first hart
2018-01-22Boot on the first hartPalmer Dabbelt1-9/+2
This code is broken, and it's left over from before we could read the DTB to find harts to boot on.
2018-01-09Remove the repeating bitmask of medeleg register (#74)Zong Li1-1/+0