mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 05:31:32 +00:00
armv8: cavium: Get DRAM size from ATF
Change the dram_init() function on ThunderX to query ATF services for the real installed DRAM size Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com> Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
This commit is contained in:
parent
900f88f3b0
commit
3ed2ece5e1
1 changed files with 27 additions and 0 deletions
|
@ -9,6 +9,8 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
|
|
||||||
|
#include <cavium/atf.h>
|
||||||
|
|
||||||
#if !CONFIG_IS_ENABLED(OF_CONTROL)
|
#if !CONFIG_IS_ENABLED(OF_CONTROL)
|
||||||
#include <dm/platdata.h>
|
#include <dm/platdata.h>
|
||||||
#include <dm/platform_data/serial_pl01x.h>
|
#include <dm/platform_data/serial_pl01x.h>
|
||||||
|
@ -50,6 +52,31 @@ int timer_init(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int dram_init(void)
|
||||||
|
{
|
||||||
|
ssize_t node_count = atf_node_count();
|
||||||
|
ssize_t dram_size;
|
||||||
|
int node;
|
||||||
|
|
||||||
|
printf("Initializing\nNodes in system: %zd\n", node_count);
|
||||||
|
|
||||||
|
gd->ram_size = 0;
|
||||||
|
|
||||||
|
for (node = 0; node < node_count; node++) {
|
||||||
|
dram_size = atf_dram_size(node);
|
||||||
|
printf("Node %d: %zd MBytes of DRAM\n", node, dram_size >> 20);
|
||||||
|
gd->ram_size += dram_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
gd->ram_size -= MEM_BASE;
|
||||||
|
|
||||||
|
*(unsigned long *)CPU_RELEASE_ADDR = 0;
|
||||||
|
|
||||||
|
puts("DRAM size:");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Board specific reset that is system reset.
|
* Board specific reset that is system reset.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue