board_f: Fix types for board_get_usable_ram_top()

Commit 37dc958947 ("global_data.h: Change ram_top type to phys_addr_t")
changed type of ram_top member from ulong to phys_addr_t but did not
changed types in board_get_usable_ram_top() function which returns value
for ram_top.

So change ulong to phys_addr_t type also in board_get_usable_ram_top()
signature and implementations.

Fixes: 37dc958947 ("global_data.h: Change ram_top type to phys_addr_t")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Pali Rohár 2022-09-09 17:32:40 +02:00 committed by Tom Rini
parent 777aaaa706
commit 049704f808
35 changed files with 36 additions and 36 deletions

View file

@ -327,7 +327,7 @@ phys_size_t get_effective_memsize(void)
}
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
ulong top_addr;

View file

@ -30,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
*/
#define USABLE_RAM_SIZE 0x80000000ULL
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
unsigned long top = CONFIG_SYS_SDRAM_BASE + min(gd->ram_size, USABLE_RAM_SIZE);

View file

@ -205,7 +205,7 @@ int dram_init(void)
return 0;
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
unsigned long top = CONFIG_SYS_SDRAM_BASE + SDRAM_MAX_SIZE;

View file

@ -40,7 +40,7 @@ int dram_init(void)
return 0;
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
phys_size_t size;
phys_addr_t reg;

View file

@ -65,7 +65,7 @@ static struct mm_region sunxi_mem_map[] = {
};
struct mm_region *mem_map = sunxi_mem_map;
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
/* Some devices (like the EMAC) have a 32-bit DMA limit. */
if (gd->ram_top > (1ULL << 32))

View file

@ -401,7 +401,7 @@ int dram_init_banksize(void)
* This function is called before dram_init_banksize(), so we can't simply
* return gd->bd->bi_dram[1].start + gd->bd->bi_dram[1].size.
*/
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
ulong ram_top;

View file

@ -76,7 +76,7 @@ void board_init_f(ulong dummy)
}
#endif /* CONFIG_SPL_BUILD */
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
return CONFIG_SYS_SDRAM_BASE + (256 * 1024 * 1024);
}

View file

@ -77,7 +77,7 @@ phys_size_t get_effective_memsize(void)
return UBOOT_RAM_SIZE_MAX;
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
if (IS_ENABLED(CONFIG_RAM_OCTEON)) {
/* Map a maximum of 256MiB - return not size but address */

View file

@ -21,7 +21,7 @@ int dram_init_banksize(void)
return fdtdec_setup_memory_banksize();
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
/*
* Ensure that we run from first 4GB so that all

View file

@ -20,7 +20,7 @@ int dram_init_banksize(void)
return fdtdec_setup_memory_banksize();
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
#ifdef CONFIG_64BIT
/*

View file

@ -21,7 +21,7 @@ int dram_init_banksize(void)
return fdtdec_setup_memory_banksize();
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
/*
* Ensure that we run from first 4GB so that all

View file

@ -25,7 +25,7 @@
#include <asm/arch/pei_data.h>
#include <asm/arch/pm.h>
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
return mrc_common_board_get_usable_ram_top(total_size);
}

View file

@ -27,7 +27,7 @@ unsigned int install_e820_map(unsigned int max_entries,
* address, and how far U-Boot is moved by relocation are set in the global
* data structure.
*/
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
uintptr_t dest_addr = 0;
int i;

View file

@ -27,7 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;
* the relocation address, and how far U-Boot is moved by relocation are
* set in the global data structure.
*/
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
struct efi_mem_desc *desc, *end;
struct efi_entry_memmap *map;

View file

@ -11,7 +11,7 @@
DECLARE_GLOBAL_DATA_PTR;
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
return (ulong)efi_get_ram_base() + gd->ram_size;
}

View file

@ -25,7 +25,7 @@ static const char *const ecc_decoder[] = {
"active"
};
ulong mrc_common_board_get_usable_ram_top(ulong total_size)
phys_size_t mrc_common_board_get_usable_ram_top(phys_size_t total_size)
{
struct memory_info *info = &gd->arch.meminfo;
uintptr_t dest_addr = 0;
@ -50,7 +50,7 @@ ulong mrc_common_board_get_usable_ram_top(ulong total_size)
dest_addr = largest->start + largest->size;
return (ulong)dest_addr;
return (phys_size_t)dest_addr;
}
void mrc_common_dram_init_banksize(void)

View file

@ -44,7 +44,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define CMOS_OFFSET_MRC_SEED_S3 156
#define CMOS_OFFSET_MRC_SEED_CHK 160
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
return mrc_common_board_get_usable_ram_top(total_size);
}

View file

@ -71,7 +71,7 @@ int dram_init_banksize(void)
* the relocation address, and how far U-Boot is moved by relocation are
* set in the global data structure.
*/
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
return qemu_get_low_memory_size();
}

View file

@ -184,7 +184,7 @@ int dram_init_banksize(void)
* the relocation address, and how far U-Boot is moved by relocation are
* set in the global data structure.
*/
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
return gd->ram_size;
}

View file

@ -48,7 +48,7 @@ static struct sbl_memory_map_info *get_memory_map_info(void)
* @total_size: The memory size that u-boot occupies
* Return: : The top available memory address lower than 4GB
*/
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
struct sbl_memory_map_info *data;
int i;

View file

@ -204,7 +204,7 @@ unsigned int install_e820_map(unsigned int max_entries,
* address, and how far U-Boot is moved by relocation are set in the global
* data structure.
*/
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
struct sfi_table_simple *sb;
struct sfi_mem_entry *mentry;

View file

@ -47,7 +47,7 @@ int mrc_add_memory_area(struct memory_info *info, uint64_t start,
* the relocation address, and how far U-Boot is moved by relocation are
* set in the global data structure.
*/
ulong mrc_common_board_get_usable_ram_top(ulong total_size);
phys_size_t mrc_common_board_get_usable_ram_top(phys_size_t total_size);
void mrc_common_dram_init_banksize(void);

View file

@ -77,7 +77,7 @@ int x86_cleanup_before_linux(void);
void x86_enable_caches(void);
void x86_disable_caches(void);
int x86_init_cache(void);
ulong board_get_usable_ram_top(ulong total_size);
phys_size_t board_get_usable_ram_top(phys_size_t total_size);
int default_print_cpuinfo(void);
/* Set up a UART which can be used with printch(), printhex8(), etc. */

View file

@ -34,7 +34,7 @@ int dram_init(void)
* the relocation address, and how far U-Boot is moved by relocation are
* set in the global data structure.
*/
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
return fsp_get_usable_lowmem_top(gd->arch.hob_list);
}

View file

@ -77,7 +77,7 @@ int dram_init(void)
return 0;
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
if (!ll_boot_init())
return gd->ram_size;

View file

@ -183,7 +183,7 @@ int dram_init_banksize(void)
}
/* Limit RAM used by U-Boot to the DDR first bank End region */
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
return BCM_NS3_MEM_END;
}

View file

@ -23,7 +23,7 @@ int dram_init(void)
return 0;
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
DECLARE_GLOBAL_DATA_PTR;

View file

@ -42,7 +42,7 @@ DECLARE_GLOBAL_DATA_PTR;
static u32 mx53_dram_size[2];
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
/*
* WARNING: We must override get_effective_memsize() function here

View file

@ -335,7 +335,7 @@ static void set_fdt_addr(void)
/*
* Prevent relocation from stomping on a firmware provided FDT blob.
*/
unsigned long board_get_usable_ram_top(unsigned long total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
if ((gd->ram_top - fw_dtb_pointer) > SZ_64M)
return gd->ram_top;

View file

@ -61,7 +61,7 @@ int dram_init(void)
return 0;
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
#ifdef CONFIG_PHYS_64BIT
/* Limit RAM used by U-Boot to the DDR low region */

View file

@ -57,7 +57,7 @@ int dram_init(void)
return 0;
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
#ifdef CONFIG_PHYS_64BIT
/* Limit RAM used by U-Boot to the DDR low region */

View file

@ -46,7 +46,7 @@ int dram_init(void)
return 0;
}
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
#ifdef CONFIG_PHYS_64BIT
/* Limit RAM used by U-Boot to the DDR low region */

View file

@ -631,7 +631,7 @@ int embedded_dtb_select(void)
#endif
#if defined(CONFIG_LMB)
ulong board_get_usable_ram_top(ulong total_size)
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
phys_size_t size;
phys_addr_t reg;

View file

@ -305,7 +305,7 @@ __weak int mach_cpu_init(void)
}
/* Get the top of usable RAM */
__weak ulong board_get_usable_ram_top(ulong total_size)
__weak phys_size_t board_get_usable_ram_top(phys_size_t total_size)
{
#if defined(CONFIG_SYS_SDRAM_BASE) && CONFIG_SYS_SDRAM_BASE > 0
/*

View file

@ -291,7 +291,7 @@ int show_board_info(void);
*
* @param total_size Size of U-Boot (unused?)
*/
ulong board_get_usable_ram_top(ulong total_size);
phys_size_t board_get_usable_ram_top(phys_size_t total_size);
int board_early_init_f(void);