mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 02:15:45 +01:00 
			
		
		
		
	Commit37dc958947("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>
		
			
				
	
	
		
			39 lines
		
	
	
		
			759 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			759 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 <asm/global_data.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();
 | |
| }
 | |
| 
 | |
| phys_size_t board_get_usable_ram_top(phys_size_t total_size)
 | |
| {
 | |
| 	/*
 | |
| 	 * 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 - 1;
 | |
| 
 | |
| 	return gd->ram_top;
 | |
| }
 |