- Mar 19, 2020
-
-
Anup Patel authored
We don't need to use sbi_platform_hart_count() in sbi_init and sbi_scratch because checking sbi_platform_hart_disabled() or return value of sbi_hartid_to_scratch() is sufficient. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
Checking return value of sbi_hartid_to_scratch() is sufficient so no need to explicitly check for disabled HART using the sbi_platform_hart_disabled() API. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
The scratch parameter in sbi_hsm_hart_started_mask() API is now redundant hence removing it. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We remove usage of sbi_platform_hart_count() API from sbi_hsm so that discontinuous and sparse HART ids can be supported. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Anup Patel authored
As a step towards supporting discontinuous and sparse HART ids, we don't set hartid_to_scratch table for disabled HARTs. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
The sbi_platform_hart_disabled() should return TRUE for HART id greater than platform hart count. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Anup Patel authored
The sbi_hartid_to_scratch() API can fail for non-existent HARTs so all uses of sbi_hartid_to_scratch() API should check return value. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We remove redundant scratch parameter from sbi_tlb_entry_process() function. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
We remove redundant scratch parameter from sbi_hsm_hart_get_state() and sbi_hsm_hart_started() APIs. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
This patch simplify HART id to scratch macro as follows: 1. Remove current "scratch" pointer argument because now we use HART id to scratch table 2. Rename sbi_hart_id_to_scratch() to sbi_hartid_to_scratch() to have macro name consistent with the name of callback in struct sbi_scratch Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
Instead of calling hartid_to_scratch() callback every time when we want sbi_scratch pointer from HART id, we create a table of sbi_scratch pointers and use that to get sbi_scratch pointer. As a result of HART id to scratch table, the conversion of HART id to sbi_scratch pointer is just 2-3 instructions which was 9 instructions previously. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
- Mar 18, 2020
-
-
Bin Meng authored
Platform andes/ae350, ariane-fpga, qemu/virt and sifive/fu540 codes have been updated to call this general DT fix-up helper. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
This adds a general device tree fix-up helper to do all required device tree fix-ups for a typical platform. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
This replaces the FU540 specific cpu0 node "status" property fix-up with the newly introduced generic fdt_cpu_fixup() helper. Unlike previous logic, the helper routine does not test the "mmu-type" property to determine which node we should fix up, instead it uses sbi_platform_hart_disabled() API. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
Add a helper routine to updates the "status" property of a CPU node in the device tree to "disabled" if that hart is in disabled state. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
As of today the upstream U-Boot & Linux kernel ships a device tree that already has "stdout-path" properly set in the "/chosen" node. This is the same with the QEMU 'sifive_u' machine. Hence the codes to fix up the "stdout-path" in OpenSBI is not necessary. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Bin Meng authored
This calls fdt_reserved_memory_fixup() helper in the platform's final_init() routine. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Bin Meng authored
This calls fdt_reserved_memory_fixup() helper in the platform's final_init() routine. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
This calls fdt_reserved_memory_fixup() helper in the platform's final_init() routine. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Bin Meng authored
This calls fdt_reserved_memory_fixup() helper in the platform's final_init() routine. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Bin Meng authored
Now that we have a dedicated fdt_helper.c file for DT releated helper routines, move plic_fdt_fixup() codes from plic.c to fdt_helper.c and rename it to fdt_plic_fixup() at the same time, to keep name consistency in the same file. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Bin Meng authored
Adjust the order of include header files in alphabetical order in platform codes. Also remove unnecessary inclusions. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Bin Meng authored
Add a helper routine to insert a child node of the reserved memory node in the device tree that describes the protected memory region done by OpenSBI via PMP. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Bin Meng authored
Pull fdt_addresses.o in for fdt_address_cells() & fdt_size_cells(). Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Bin Meng authored
Currently pmp_get() returns the log2 length of the PMP memory region size. The caller has to calculate the size based on that and the same codes are duplicated. Update this function to return decoded size directly. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
- Mar 17, 2020
-
-
Bin Meng authored
We now support building sifive/fu540 as a 32-bit platform. Add it in the 32-bit platform list of binary archive script. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
- Mar 14, 2020
-
-
Bin Meng authored
As of today all platforms use 8KB of per-HART stack hence there is no need for each platform to define its own macro or use the magic number. Create one macro for all platforms. Platform still can use its own version if needed. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
The template platform codes should set per-HART stack size to 8KB to avoid possible mistakes of future platform ports. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
Recent commit 4a603eb6 ("platform: kendryte/k210: Set per-HART stack size to 8KB") forgot to update ariane-fpga codes, and the following commit 678c3c36 ("include: sbi_scratch: Set per-HART scratch size to 4KB") changed the per-HART scratch size to 4KB, which potentially breaks ariane-fpga platform. This patch set per-HART stack size of ariane-fpga to 8KB for consistency. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
- Mar 13, 2020
-
-
Anup Patel authored
The default install directory is not being removed correctly by distclean make target due to recent changes. This patch fixes distclean make target to fix default install directory removal. Fixes: 82ae8e8f ("makefile: Do setup of the install target more flexible") Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
The sbi_current_hartid() being a regular function is quite expensive because for callers it is a function call instead of a direct CSR read. This patch converts sbi_current_hartid() into a macro in riscv_asm.h. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
Now that sbi_hart_id_to_scratch() is optimized, we don't need the "if ()" statement. Also, the hstate local variable is redundant so we remove that as well. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Anup Patel authored
This patch optimizes _hartid_to_scratch() in following ways: 1. Use caller saved registers instead of callee saved registers so that we don't need to save/restore registers on stack 2. Remove second redundant mul instruction by re-arranging instructions Overall, we reduce 9 instructions in _hartid_to_scratch() implementation. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Anup Patel authored
The sbi_hart_id_to_scratch() just forwards call to firmware specific hartid_to_scratch() callback so we make sbi_hart_id_to_scratch() as macro in sbi_scratch.h instead of regular function in sbi_hart.c. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Bin Meng authored
Sync with latest libfdt v1.5.1 release source codes. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
Add two macros in preparation to sync libfdt codes to latest v1.5.1 release from upstream. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
We currently have TRUE/FALSE, but it could be convenient to have true/false as well. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Panagiotis Peristerakis authored
Signed-off-by:
Panagiotis Peristerakis <perister@ics.forth.gr> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Damien Le Moal authored
Compile time checks of __riscv_compressed can only check if OpenSBI is being compiled using compressed instructions or not. Checking this macro does not indicate if an instruction that generated a misaligned trap is a compressed instruction or not. Since the misaligned trap handling code inspects instructions _C_ bits to detect compressed instructions, we can remove all static checks on __riscv_compressed and dissociate hanlding of misaligned traps and OpenSBI compilation. Signed-off-by:
Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
- Mar 11, 2020
-
-
Atish Patra authored
Upstream U-Boot now have SMP support and doesn't require any additional patches for HiFive Unleashed. Update the documentation. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-