98a66ffa | 25-Feb-2019 |
Anup Patel <Anup.Patel@wdc.com> |
riscv: Enable CONFIG_SYS_BOOT_RAMDISK_HIGH for using initrd
This patch enables CONFIG_SYS_BOOT_RAMDISK_HIGH for RISC-V because bootm will update initrd location in DTB only if CONFIG_SYS_BOOT_RAMDIS
riscv: Enable CONFIG_SYS_BOOT_RAMDISK_HIGH for using initrd
This patch enables CONFIG_SYS_BOOT_RAMDISK_HIGH for RISC-V because bootm will update initrd location in DTB only if CONFIG_SYS_BOOT_RAMDISK_HIGH is enabled. If we don't enable this option then bootm assumes DTB already has initrd details which is not the case most of the time.
Signed-off-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
show more ...
|
26f4fd1c | 25-Feb-2019 |
Anup Patel <Anup.Patel@wdc.com> |
riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems
On 64bit systems, the DRAM top can be easily beyond 4GB and U-Boot DMA mapping APIs will generate DMA addresses beyond 4GB. This
riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems
On 64bit systems, the DRAM top can be easily beyond 4GB and U-Boot DMA mapping APIs will generate DMA addresses beyond 4GB. This breaks DMA programming in 32bit DMA capable devices (such as Cadence MACB ethernet). For example, If DRAM is more then 2GB on QEMU sifive_u machine then Cadence MACB ethernet stops working for U-Boot because it is a 32bit DMA capable device.
To handle 32bit DMA capable devices on 64bit systems, we provide custom implementation of board_get_usable_ram_top() which ensures that usable ram top is not more then 4GB. This in-turn ensures that U-Boot always runs within 4GB hence DMA addresses generated by DMA mapping APIs will be within 4GB too.
Signed-off-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
show more ...
|
1fa625b8 | 25-Feb-2019 |
Anup Patel <Anup.Patel@wdc.com> |
riscv: Add place-holder asm/arch/clk.h for driver compilation
Some of the drivers (such as Cadence MACB ethernet driver) expect asm/arch/clk.h to be provided by arch support so we add place-holder a
riscv: Add place-holder asm/arch/clk.h for driver compilation
Some of the drivers (such as Cadence MACB ethernet driver) expect asm/arch/clk.h to be provided by arch support so we add place-holder asm/arch-generic/clk.h for RISC-V generic CPU.
Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
show more ...
|
70b8562d | 25-Feb-2019 |
Anup Patel <Anup.Patel@wdc.com> |
riscv: Add asm/dma-mapping.h for DMA mappings
This patch adds asm/dma-mapping.h for Linux-like DMA mappings APIs required by some of the drivers (such as, Cadance MACB Ethernet driver).
Signed-off-
riscv: Add asm/dma-mapping.h for DMA mappings
This patch adds asm/dma-mapping.h for Linux-like DMA mappings APIs required by some of the drivers (such as, Cadance MACB Ethernet driver).
Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
show more ...
|
91882c47 | 03-Jan-2019 |
Lukas Auer <lukas.auer@aisec.fraunhofer.de> |
riscv: qemu: define standalone load address
We need to define the standalone load address to use standalone application on qemu-riscv. Define it and set it equal to CONFIG_SYS_LOAD_ADDR.
To not ove
riscv: qemu: define standalone load address
We need to define the standalone load address to use standalone application on qemu-riscv. Define it and set it equal to CONFIG_SYS_LOAD_ADDR.
To not overwrite it, change the assigned of CONFIG_STANDALONE_LOAD_ADDR in arch/riscv/config.mk to a conditional one.
Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
show more ...
|
3c37278f | 03-Jan-2019 |
Lukas Auer <lukas.auer@aisec.fraunhofer.de> |
riscv: remove RISC-V standalone linker script
Standalone applications do not require a separate linker script and can use the default linker script of the compiler instead. Remove the RISC-V standal
riscv: remove RISC-V standalone linker script
Standalone applications do not require a separate linker script and can use the default linker script of the compiler instead. Remove the RISC-V standalone linker script.
Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
show more ...
|
f74c416e | 03-Jan-2019 |
Lukas Auer <lukas.auer@aisec.fraunhofer.de> |
riscv: use invalidate/flush_*cache_range functions in cache.c
The flush_cache() function in lib/cache.c ignores its arguments and flushes the complete data and instruction caches. Use the invalidate
riscv: use invalidate/flush_*cache_range functions in cache.c
The flush_cache() function in lib/cache.c ignores its arguments and flushes the complete data and instruction caches. Use the invalidate/flush_*cache_range() functions instead to only flush the requested memory region.
This patch does not change the current behavior of U-Boot, since the implementation of the invalidate/flush_*cache_range() functions flush the complete data and instruction caches. It is in preparation for CPUs with the necessary functionality for flushing a selectable memory range.
Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
show more ...
|
c9056653 | 03-Jan-2019 |
Lukas Auer <lukas.auer@aisec.fraunhofer.de> |
riscv: move the AX25-specific implementation of flush_dcache_all
The fence instruction is used to enforce device I/O and memory ordering constraints in RISC-V. It can not be relied on to directly af
riscv: move the AX25-specific implementation of flush_dcache_all
The fence instruction is used to enforce device I/O and memory ordering constraints in RISC-V. It can not be relied on to directly affect the data cache on every CPU. Andes' AX25 does not have a coherence agent. Its fence instruction flushes the data cache and is used to keep data in the system coherent. The implementation of flush_dcache_all in lib/cache.c is therefore specific to the AX25. Move it into the AX25-specific cache.c in cpu/ax25/.
This also adds a missing new line between flush_dcache_all and flush_dcache_range in lib/cache.c.
Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
show more ...
|
dcad9b8d | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Remove ae350.dts
This is not used by any board. Remove it.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup
riscv: Remove ae350.dts
This is not used by any board. Remove it.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
3c85099a | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: bootm: Change to use boot_hart from global data
Avoid reading mhartid CSR directly, instead use the one we saved in the global data structure before.
With this patch, BBL no longer needs to
riscv: bootm: Change to use boot_hart from global data
Avoid reading mhartid CSR directly, instead use the one we saved in the global data structure before.
With this patch, BBL no longer needs to be hacked to provide the mhartid CSR emulation for S-mode U-Boot.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
51ab4570 | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Save boot hart id to the global data
At present the hart id passed via a0 in the U-Boot entry is saved to s0 at the beginning but does not preserve later. Save it to the global data structure
riscv: Save boot hart id to the global data
At present the hart id passed via a0 in the U-Boot entry is saved to s0 at the beginning but does not preserve later. Save it to the global data structure so that it can be used later.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
7f5d35a5 | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Adjust the _exit_trap() position to come before handle_trap()
With this change, we can avoid a forward declaration.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <luka
riscv: Adjust the _exit_trap() position to come before handle_trap()
With this change, we can avoid a forward declaration.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
10753ef8 | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Return to previous privilege level after trap handling
At present the trap handler returns to hardcoded M-mode/S-mode. Change to returning to previous privilege level instead.
Signed-off-by:
riscv: Return to previous privilege level after trap handling
At present the trap handler returns to hardcoded M-mode/S-mode. Change to returning to previous privilege level instead.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
496262cc | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Fix context restore before returning from trap handler
sp cannot be loaded before restoring other registers.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@
riscv: Fix context restore before returning from trap handler
sp cannot be loaded before restoring other registers.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
4b3f5ed5 | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Move trap handler codes to mtrap.S
Currently the M-mode trap handler codes are in start.S. For future extension, move them to a separate file mtrap.S.
Signed-off-by: Bin Meng <bmeng.cn@gmail
riscv: Move trap handler codes to mtrap.S
Currently the M-mode trap handler codes are in start.S. For future extension, move them to a separate file mtrap.S.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
485e8223 | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Do some basic architecture level cpu initialization
In arch_cpu_init_dm() do some basic architecture level cpu initialization, like FPU enable, etc.
Signed-off-by: Bin Meng <bmeng.cn@gmail.c
riscv: Do some basic architecture level cpu initialization
In arch_cpu_init_dm() do some basic architecture level cpu initialization, like FPU enable, etc.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
57fe5c64 | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Add indirect stringification to csr_xxx ops
With current csr_xxx ops, we cannot pass a macro to parameter 'csr', hence we need add another level to allow the parameter to be a macro itself, a
riscv: Add indirect stringification to csr_xxx ops
With current csr_xxx ops, we cannot pass a macro to parameter 'csr', hence we need add another level to allow the parameter to be a macro itself, aka indirect stringification.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
aef59e5c | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Update supports_extension() to use desc from cpu driver
This updates supports_extension() implementation to use the desc string from the cpu driver whenever possible, which avoids the reading
riscv: Update supports_extension() to use desc from cpu driver
This updates supports_extension() implementation to use the desc string from the cpu driver whenever possible, which avoids the reading of misa CSR for S-mode U-Boot.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
39671564 | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Add exception codes for xcause register
This adds all exception codes in encoding.h.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Rev
riscv: Add exception codes for xcause register
This adds all exception codes in encoding.h.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
ea53f1c7 | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Add CSR numbers
The standard RISC-V ISA sets aside a 12-bit encoding space for up to 4096 CSRs. This adds all known CSR numbers as defined in the RISC-V Privileged Architecture Version 1.10.
riscv: Add CSR numbers
The standard RISC-V ISA sets aside a 12-bit encoding space for up to 4096 CSRs. This adds all known CSR numbers as defined in the RISC-V Privileged Architecture Version 1.10.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|
3c276b27 | 12-Dec-2018 |
Bin Meng <bmeng.cn@gmail.com> |
riscv: Remove non-DM version of print_cpuinfo()
With DM CPU driver, the non-DM version of print_cpuinfo() is no longer needed.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <
riscv: Remove non-DM version of print_cpuinfo()
With DM CPU driver, the non-DM version of print_cpuinfo() is no longer needed.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
show more ...
|