mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-01 17:10:11 +00:00
7c45fc9870
Add SiFive fu540 cpu to support RISC-V arch Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com>
38 lines
739 B
C
38 lines
739 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <fdtdec.h>
|
|
#include <init.h>
|
|
#include <linux/sizes.h>
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
int dram_init(void)
|
|
{
|
|
return fdtdec_setup_mem_size_base();
|
|
}
|
|
|
|
int dram_init_banksize(void)
|
|
{
|
|
return fdtdec_setup_memory_banksize();
|
|
}
|
|
|
|
ulong board_get_usable_ram_top(ulong total_size)
|
|
{
|
|
#ifdef CONFIG_64BIT
|
|
/*
|
|
* Ensure that we run from first 4GB so that all
|
|
* addresses used by U-Boot are 32bit addresses.
|
|
*
|
|
* This in-turn ensures that 32bit DMA capable
|
|
* devices work fine because DMA mapping APIs will
|
|
* provide 32bit DMA addresses only.
|
|
*/
|
|
if (gd->ram_top > SZ_4G)
|
|
return SZ_4G;
|
|
#endif
|
|
return gd->ram_top;
|
|
}
|