summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-04-04firmware: Fix source fdt alignmentXiang Wang
When I tried to start opensbi with coreboot, I found that aligning to a 16-byte boundary would make a copy error. Corrected to align to an machine word length boundary. Signed-off-by: Xiang Wang <[email protected]>
2019-04-03lib: Pack struct sbi_fifoAnup Patel
This patch reduces memory consumed by struct sbi_fifo by droping redundant "head" member and using u16 in-place of "unsigned long". Signed-off-by: Anup Patel <[email protected]>
2019-04-03lib: More improvements to sbi_fifoAnup Patel
This patch does following improvements to sbi_fifo: 1. Use valid SBI_Exxxx error codes instead of -1 2. The sbi_fifo_is_full() and sbi_fifo_is_empty() did not acquire qlock before accessing head and tail hence fixed it 3. Added avail member for ease in debugging and simplifying head/tail updates. Due to above changes size of sbi_fifo changes from 48 bytes to 56 bytes. Signed-off-by: Anup Patel <[email protected]>
2019-04-03docs: Update mailing list details in contributing.mdAnup Patel
We now have an OpenSBI mailing list available for development and discussiong so update contributing.md accordingly. The Github PR based review and issue tracking will also continue to exist. Signed-off-by: Anup Patel <[email protected]>
2019-04-03lib: Use a fifo to keep track of sfence related IPIs.Atish Patra
Currently, there is no provision for tracking multiple IPIs sent to a single hart at the same time by different harts. Use a fifo manage the outstanding requests. While dequeueing, read all the entries once, because we have only 1 bit to track the type of IPI. Once the queue is full, busy wait until the there is space available in queue. This is not the most elegant approach. It should be changed in favor of a wakeup event once available in opensbi. Signed-off-by: Atish Patra <[email protected]>
2019-04-03lib: Increase the scratch space to 512 bytes.Atish Patra
Currently scratch space per hart is 256 bytes. Increase it to 512 bytes to accomodate ipi queue. Signed-off-by: Atish Patra <[email protected]>
2019-04-03lib: Introduce a tlb info type.Atish Patra
Add a tlb info to distinguish between different type of tlb flush request pending. Signed-off-by: Atish Patra <[email protected]>
2019-04-03lib: Add a fifo implementation.Atish Patra
Implement a fifo to accomodate outstanding IPIs for a specific hart at the same time. Signed-off-by: Atish Patra <[email protected]>
2019-04-03kendryte/k210: Fix file headersDamien Le Moal
Add missing SPDX and copyright information. Signed-off-by: Damien Le Moal <[email protected]>
2019-04-03README: Update license informationDamien Le Moal
Add information regarding the Apache License Version 2.0 of some of the Kendryte/k210 platform files. Also repeat this information in a new ThirdPartyNotices.md file. Signed-off-by: Damien Le Moal <[email protected]>
2019-04-01include: Make mstatus parameter optional for get_insn()Anup Patel
The mstatus parameter of get_insn() is used to return MSTATUS CSR value which get_insn() saw. Most of the get_insn() callers don't use the value returned in mstatus so this patch makes mstatus parameter optional for get_insn(). Signed-off-by: Anup Patel <[email protected]>
2019-04-01include: Rename sbi_unpriv.h to riscv_unpriv.hAnup Patel
The sbi_unpriv.h has quite a few load_xyz() and store_xyz() helper routines based on RISC-V inline assembly for unpriviledged accesses from M-mode. These helper routines are similar to helper routines present in riscv_locks.h, riscv_io.h, and riscv_atomic.h so let's rename sbi_unpriv.h to riscv_unpriv.h. Signed-off-by: Anup Patel <[email protected]>
2019-04-01lib: Remove unused mepc arg from load_xyz() and store_xyz() functionsAnup Patel
This patch removes unused mepc arg from load_xyz() and store_xyz() unpriviledge access functions. Signed-off-by: Anup Patel <[email protected]>
2019-03-29lib: Disable the boot prints if SBI_SCRATCH_NO_BOOT_PRINTS is setBin Meng
Use the newly introduced "options" in "struct sbi_scratch" to conditionally disable the boot prints. Signed-off-by: Bin Meng <[email protected]>
2019-03-29lib: Group all prints during boot into sbi_boot_prints()Bin Meng
Refactor the codes a little bit to put all prints during boot into sbi_boot_prints(). Signed-off-by: Bin Meng <[email protected]>
2019-03-29firmware: Introduce "options" in "struct sbi_scratch"Bin Meng
Introduce "options" in "struct sbi_scratch" and firmware can update it based on optional compile time flags before calling sbi_init(). Signed-off-by: Bin Meng <[email protected]>
2019-03-18platform: plic: Fix comments of programming the interrupt enable registerBin Meng
The codes that currently program the interrupt enable register for S-mode disagrees with what the comments say. Fix the comments. While we are here, add one line comment to describe what is done for M-mode too. Signed-off-by: Bin Meng <[email protected]>
2019-03-14lib: Return ENOTSUPP incase of invalid SBI function IDAtish Patra
OpenSBI should show error trace only if any valid SBI function does not perform as expected. However, OpenSBI should show notify the caller with a negative error if given SBI function ID is not valid. Signed-off-by: Atish Patra <[email protected]>
2019-03-14platform: plic: Bypass interrupt ID 0's priority programmingBin Meng
Per PLIC spec, interrupt ID 0 is defined to mean "no interrupt". We should bypass it. Signed-off-by: Bin Meng <[email protected]>
2019-03-14platform: plic: Fix plic_set_priority()Bin Meng
At present plic_set_priority() ignores the 'source' and the priority register to be programmed is constant. Fix it. Signed-off-by: Bin Meng <[email protected]>
2019-03-14firmware: Move scratch setup to _start instead of _start_warmAtish Patra
Scratch space setup needs to be done once for reboot for each hart. _start_warm may be called several times if hart hotplug is implemented. Move scratch space setup to the beginning so that it is done only once. Signed-off-by: Atish Patra <[email protected]>
2019-03-14lib: Fix full tlb flush behaviorAtish Patra
Currently, global page mappings are not flushed if start and size arguments are zero. Flush entire TLB if both size and start argument is passed as zero. Fixes : 90cb491 (lib: Implement sfence.vma correctly) Signed-off-by: Atish Patra <[email protected]>
2019-03-13platform: fu540: Fix cosmetic styling issuesBin Meng
There are some spaces or mixed usage of spaces and tabs in the macro definition. Change to use tab consistently. Signed-off-by: Bin Meng <[email protected]>
2019-03-13docs: firmware: Fix spelling of U-BootBin Meng
It's U-Boot, not U-boot. Signed-off-by: Bin Meng <[email protected]>
2019-03-12lib: Implement sfence.vma correctly.Atish Patra
Currently, OpenSBI doesn't distinguish between sfence.vma and sfence.vm asid calls. Moreover, it ignores the page ranges and just flush entire TLB everytime. Fix the sfence implementation by keeping all the tlb flush info in scratch area. The relevant Linux kernel code was added by https://patchwork.kernel.org/project/linux-riscv/list/?series=89695 However, this patch is backward compatible with older version kernel that doesn't have the above patches as well. Fixes #87 Signed-off-by: Atish Patra <[email protected]>
2019-03-10lib: Create a sbi_ipi_data structureAlistair Francis
Create a sbi_ipi_data structure that holds unpacked IPI information. At the same time remove ipi_type from the sbi_scratch struct and use a fixed offset to access it. This structure fits in behind the sbi_scratch structure. This fixes https://github.com/riscv/opensbi/issues/81 Signed-off-by: Alistair Francis <[email protected]>
2019-03-07firmware: Reset all registers and flush icacheAtish Patra
A warm reset using reset button may put icache and registers in non-coherent state. Flush the icache and reset all registers for every hart. Signed-off-by: Atish Patra <[email protected]>
2019-03-07firmware: Add nop to reduce bus traffic.Atish Patra
All the non-boot harts run in a tight loop which may cause a heavy load on the memory bus. This may delay the boot hart to complete the cold boot process. Introduce few nop that will ease up the traffic. Signed-off-by: Atish Patra <[email protected]>
2019-03-07Revert "firmware: Add a barrier instruction for wait for boot hart"Atish Patra
This reverts commit 05602e2bf4812533adcb7acb1a67e43726c0e7bb. Introducing a fence causes warm reset issue to reappear. Revert it for the time being.
2019-03-06platform: Make the `platform` read-onlyXiang Wang
platform should be a read-only variable, if it is placed in the data segment, it may be exploited. Signed-off-by: Xiang Wang <[email protected]>
2019-03-06firmware: Reset all the general purpose registers to zero.Atish Patra
A warm reset by pressing the reset button may not initialize all the registers to zero. Do it for every hart during warm boot. Signed-off-by: Atish Patra <[email protected]>
2019-03-06firmware: Ensure the mtvec is updated.Atish Patra
Signed-off-by: Atish Patra <[email protected]>
2019-03-06firmware: Fix a typoAtish Patra
Signed-off-by: Atish Patra <[email protected]>
2019-03-05lib:platform: Fix sbi_getc return type.Atish Patra
As per the current SBI specification, sbi_getc should return an int instead of char. In case of FIFO is empty, return -1 as per the specification. Reported-by: Sergi Granell <[email protected]> Suggested-by:Thadeu Lima de Souza Cascardo <[email protected]> Signed-off-by: Atish Patra <[email protected]>
2019-03-05firmware: Add a barrier instruction for wait for boot hartXiang Wang
Multi-core communication via memory requires the addition of a barrier instructions to ensure cache coherency. Signed-off-by: Xiang Wang <[email protected]>
2019-03-05firmware: Move _boot_hart_done to the data sectionXiang Wang
Writable code section can cause some security problems, so move _boot_hart_done to the data section Signed-off-by: Xiang Wang <[email protected]>
2019-03-05Add tags to .gitignore for being development friendlyXiang Wang
Signed-off-by: Xiang Wang <[email protected]>
2019-02-28Fix missing quotes in MakefileAndreas Schwab
2019-02-28Fix makefile dependency generationAndreas Schwab
2019-02-26include: Bump-up version to 0.3v0.3Anup Patel
This patch updates OpenSBI version to 0.3 as part of release preparation. Signed-off-by: Anup Patel <[email protected]>
2019-02-26Makefile: Set the platform variables before parsing the platformsAlistair Francis
Ensure the platform variable PLATFORM_RISCV_XLEN is set before we parse the platform files. This fixes the 32-bit openSBI FW_JUMP_ADDR. Signed-off-by: Alistair Francis <[email protected]>
2019-02-22include: Bump-up version to 0.2v0.2Anup Patel
This patch increases OpenSBI version to 0.2. Signed-off-by: Anup Patel <[email protected]>
2019-02-22scripts: Add script for creating binary archiveAnup Patel
This patch adds scripts/create-binary-archive.sh which helps us create a common tarball containing headers, static library and firmware ELFs for all platforms. This script can be used for release purpose OR for compile testing all platforms. Example usage commands are as follows: 1) Binary release archive for 32bit systems ./scripts/create-binary-archive.sh -s "bin" -x 32 -d 2) Binary release archive for 64bit systems ./scripts/create-binary-archive.sh -s "bin" -d 3) Compile test for 32bit systems ./scripts/create-binary-archive.sh -x 32 -t 4) Compile test for 64bit systems ./scripts/create-binary-archive.sh -t Signed-off-by: Anup Patel <[email protected]>
2019-02-22Makefile: Rename compile_ld() to compile_elf()Anup Patel
The compile_ld() is actually used to create ELF files so the name is misleading hence this patch renames it to compile_elf(). We also rename LDFLAGS to ELFFLAGS because these will be used for ELF creation only. Signed-off-by: Anup Patel <[email protected]>
2019-02-22doc: Fix root partition details for fu540.Atish Patra
Signed-off-by: Atish Patra <[email protected]>
2019-02-20firmware: Improve low-level trap handler for M-mode to M-mode trapsAnup Patel
This patch extends our low-level trap handler in fw_base.S for handling M-mode to M-mode traps without overwritting stack. Signed-off-by: Anup Patel <[email protected]>
2019-02-20include: Add PRILX define to help print unsigned longAnup Patel
The unsigned long is always machine word size. This means it is 4 bytes on 32bit system and 8 bytes on 64bit system. This patch adds PRILX define for sbi_printf() which will help us print unsigned long without worrying whether it is 32bit or 64bit system. Signed-off-by: Anup Patel <[email protected]>
2019-02-19template: Fix some callback namesSergi Granell
2019-02-19template: Remove trailing ';'Sergi Granell
2019-02-19template: Fix typo in platform_final_initSergi Granell
There was a space instead of '_' in the function `platform_final_init`.