Skip to content
Commit 26f4fd1c authored by Anup Patel's avatar Anup Patel Committed by Andes
Browse files

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: default avatarAtish Patra <atish.patra@wdc.com>
Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
Reviewed-by: default avatarLukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent 1fa625b8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment