- May 19, 2020
-
-
Anup Patel authored
It is not mandatory for a RISC-V systems to implement all PMP regions so we have to check all PMPADDRx CSRs to determine excat number of supported PMP regions. Signed-off-by:Anup Patel <anup.patel@wdc.com>
-
Anup Patel authored
This patch does few cosmetic improvements to HART feature detection: 1. Remove sbi_ perfix from HART feature detection functions because all local/static functions in sbi_hart.c don't have sbi_ prefix 2. Remove sbi_hart_set_feature() because it's quite small and local/static in sbi_hart.c Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
It makes more sense to have scratch pointer as parameter in HART feature APIs because: 1. We already have scratch pointer at places where these APIs are used. 2. This is consistent with lot of other APIs in sbi_hart.h Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
On platforms with continuous HART ids starting from zero: 0 <= boot HART id < platform HART count The above co-relation of boot HART id and platform HART count is true for most RISC-V platfors so it's better to print platform HART count just before boot HART id. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We remove extra spaces from boot time prints. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We do following improvements for get_feature_str(): 1. We should return "none" from get_feature_str() no features available instead of sbi_boot_prints() explicitly handling failure. 2. We don't need to return failure (just like misa_xlen()) because we are returning "none" for no features and we are truncating output when space is not available. 3. Based on 1 and 2, the sbi_boot_prints() can be further simplified. 4. No need for two char[] in sbi_boot_prints() Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We should detect HART features in sbi_hart_init() before mstatus_init(), delegate_traps() and pmp_init(). Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
- May 18, 2020
-
-
Daniel Schaefer authored
Signed-off-by:
Daniel Schaefer <git@danielschaefer.me> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
- May 16, 2020
-
-
Atish Patra authored
Currently, unprivileged access functions uses few additional instructions which are redundant. It also uses specific registers which are not necessary. Remove those additional instructions and let the compiler choose the registers. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
- May 10, 2020
-
-
Atish Patra authored
We have now clear distinction between platform and hart features. Modify the boot print messages to print hart specific features in a string format. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Tested-by:
Jonathan Balkind <jbalkind@cs.princeton.edu> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Atish Patra authored
We have now clear distinction between platform and hart features. Modify the boot print messages to print platform features in a string format. In the process, this patch moved relatively larger functions to its own file from platform.h header file. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Tested-by:
Jonathan Balkind <jbalkind@cs.princeton.edu> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Atish Patra authored
As per the RISC-V specification, time value can be obtained from a time CSR implemented in hardware or a MMIO based IP block. Qemu virt machine already supports timer csr while CLINT provides the timer for other platforms. Implement a hart specific timer feature that can be detected at runtime. As CSR based timer implementation are faster than MMIO address based, it is always preferred over MMIO based one. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Tested-by:
Jonathan Balkind <jbalkind@cs.princeton.edu> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Atish Patra authored
Any platform feature that belongs to a hart, have already been moved to hart features and are detected at run time. The remaining platform features are identical to platform default features. Use the platform default features instead of defining a separate copy of it. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Tested-by:
Jonathan Balkind <jbalkind@cs.princeton.edu> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Atish Patra authored
PMP & performance counters belong to a hart rather than a platform. In addition to that, these features enable reading/writing from a particular csr. Thus, they can be detected and set at runtime rather than compile time. Move PMP/MCOUNTEREN/SCOUNTEREN features to hart and detect them at runtime. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Tested-by:
Jonathan Balkind <jbalkind@cs.princeton.edu> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Atish Patra authored
There may be some features which are hart specific rather than a platform specific feature. Add a framework to support that. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Tested-by:
Jonathan Balkind <jbalkind@cs.princeton.edu> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Atish Patra authored
As per RISC-V ISA, pmp is not mandatory. Currently, we only add reserved memory node in DT only if PMP is present. That allows supervisor to access the memory where OpenSBI continue to exist without realizing it for non-pmp based platforms. It may result in corrupting OpenSBI. That's why OpenSBI should at least let the supervisor know where it continue to exist. This a best effort service provided by OpenSBI expecting that supervisor software is not buggy and properly sets up its memory after parsing the reserved-memory device tree node. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Atish Patra authored
There may be few common mathematics helper functions which can be used anywhere in OpenSBI project. Add a separate math helper function file to add these functions. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Atish Patra authored
As RISC-V ISA allows many CSRs such as pmp, s/mcounteren to be optional in hardware, OpenSBI should provide an option to dynamically detect these csr access capability at run time. Implement a csr read/write access check helper macros. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Tested-by:
Jonathan Balkind <jbalkind@cs.princeton.edu> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Atish Patra authored
Unprivileged trap handler can be reused for any cases where the executing code expects a trap. Rename it to "expected" trap handler as it will be used in other cases in future. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Tested-by:
Jonathan Balkind <jbalkind@cs.princeton.edu> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
- May 07, 2020
-
-
Anup Patel authored
Doxygen does not support italic text in page title so fix some of the markdown files accordingly. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
Currently, all markdown pages are randomly arranged in table of contents so to fix this we treat top-level README.md as mainpage and enable Doxygen TREEVIEW. Also, there should not be any text before title of a markdown page so we move project copyright as separate section in top-level README.md. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We add platform requirements document to clarify OpenSBI expectations from a RISC-V platform. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Bin Meng <bin.meng@windriver.com>
-
Anup Patel authored
The generic platform provides IPI and timer functionality based on DT node provided in the FDT passed by previous booting stage. This patch updates generic platform documentation about IPI and timer expectations. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
The generic platform will try to select serial console based on the stdout-path DT property in /chosen DT node hence we document this. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
The RISC-V ISA string does not follow alphabetical order. Instead, we have a RISC-V specific ordering of extensions in the RISC-V ISA string. This patch improves misa_string() implementation to return a valid RISC-V ISA string. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
The HFENCE VVMA instructions flushes TLB based on the VMID present in HGATP CSR. To handle this, we get the current VMID for SBI HFENCE VVMA call and we use this current VMID to do remote TLB HFENCE VVMA on desired set of HARTs. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We don't have page table programming in OpenSBI so let's remove redundant page table related defines from riscv_encoding.h. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
- May 04, 2020
-
-
Anup Patel authored
The links to some of the platforms were missing in platform.md file hence this patch. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com>
-
Anup Patel authored
The OpenSBI generic platform works perfectly fine on the QEMU spike machine and Spike emulator so let's remove dedicated Spike platform from OpenSBI. All Spike platform related documentation in OpenSBI will now suggest using OpenSBI generic platform. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com>
-
Anup Patel authored
The OpenSBI generic platform works perfectly fine on the QEMU virt machine so let's remove dedicated QEMU virt machine platform from OpenSBI. All QEMU virt machine related documentation in OpenSBI will now suggest using OpenSBI generic platform. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com>
-
- May 01, 2020
-
-
Anup Patel authored
We need to override the remote TLB flush range limit for SiFive FU540 so we add platform override to achieve this. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
This patch adds generic platform to create-binary-archive.sh script. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
Now that we have generic platform which detects hart count from DTB, we should print platform hart count at boot time. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We add generic FDT based platform support which provides platform specific functionality based on the FDT passed by previous booting stage. By default, the generic FDT platform makes following assumptions: 1. platform FW_TEXT_START is 0x80000000 2. platform features are default 3. platform stack size is default 4. platform has no quirks or work-arounds The above assumptions (except 1) can be overridden by adding special platform callbacks which will be called based on the FDT root node compatible string. By default, we compile OpenSBI generic platform as follows: $ make PLATFORM=generic For a non-standard FW_TEXT_START, we can compile OpenSBI generic platform as follows: $ make PLATFORM=generic FW_TEXT_START=<non_standard_text_start> Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We add optional fw_platform_init() function which will allow platform specific code to update "struct sbi_platform platform" before it is used. The fw_platform_init() can be a regular C function so before callint it we: 1. zero-out BSS section 2. Setup temporary trap handler to catch bugs 3. Setup temporary stack pointer Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We add simple reset framework which will select and use reset driver based on details in FDT passed by previous booting stage. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We add simple serial framework which will select and use serial driver based on details in FDT passed by previous booting stage. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We add simple irqchip framework which will select and use irqchip driver based on details in FDT passed by previous booting stage. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We add simple ipi framework which will select and use ipi driver based on details in FDT passed by previous booting stage. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We add simple timer framework which will select and use timer driver based on details in FDT passed by previous booting stage. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-