lib: fdtdec: Rename routine fdtdec_setup_memory_size()

This patch renames the routine fdtdec_setup_memory_size()
to fdtdec_setup_mem_size_base() as it now fills the
mem base as well along with size.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Siva Durga Prasad Paladugu 2018-07-16 15:56:11 +05:30 committed by Michal Simek
parent 1473b12ad0
commit 12308b128f
31 changed files with 40 additions and 38 deletions

View File

@ -54,7 +54,7 @@ int dram_init_banksize(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -40,7 +40,7 @@ struct bsel bsel_str[] = {
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -48,7 +48,7 @@ int print_cpuinfo(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -47,7 +47,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -78,7 +78,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -339,7 +339,7 @@ int board_eth_init(bd_t *bis)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -96,7 +96,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -74,7 +74,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -50,7 +50,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -83,7 +83,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -85,7 +85,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -94,7 +94,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -83,7 +83,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -108,7 +108,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -78,7 +78,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -97,7 +97,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -96,7 +96,7 @@ int board_init(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -29,7 +29,7 @@ int dram_init(void)
return rv;
}
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
rv = -EINVAL;
return rv;

View File

@ -23,7 +23,7 @@ int dram_init(void)
return rv;
}
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
rv = -EINVAL;
return rv;

View File

@ -23,7 +23,7 @@ int dram_init(void)
return rv;
}
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
rv = -EINVAL;
return rv;

View File

@ -20,7 +20,7 @@ int dram_init(void)
return ret;
}
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
ret = -EINVAL;
return ret;

View File

@ -20,7 +20,7 @@ int dram_init(void)
return ret;
}
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
ret = -EINVAL;
return ret;

View File

@ -98,7 +98,7 @@ int dram_init_banksize(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
zynq_ddrc_init();

View File

@ -423,7 +423,7 @@ int dram_init_banksize(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -18,7 +18,7 @@ int dram_init_banksize(void)
int dram_init(void)
{
if (fdtdec_setup_memory_size() != 0)
if (fdtdec_setup_mem_size_base() != 0)
return -EINVAL;
return 0;

View File

@ -957,20 +957,22 @@ int fdtdec_decode_display_timing(const void *blob, int node, int index,
struct display_timing *config);
/**
* fdtdec_setup_memory_size() - decode and setup gd->ram_size
* fdtdec_setup_mem_size_base() - decode and setup gd->ram_size and
* gd->ram_start
*
* Decode the /memory 'reg' property to determine the size of the first memory
* bank, populate the global data with the size of the first bank of memory.
* Decode the /memory 'reg' property to determine the size and start of the
* first memory bank, populate the global data with the size and start of the
* first bank of memory.
*
* This function should be called from a boards dram_init(). This helper
* function allows for boards to query the device tree for DRAM size instead of
* hard coding the value in the case where the memory size cannot be detected
* automatically.
* function allows for boards to query the device tree for DRAM size and start
* address instead of hard coding the value in the case where the memory size
* and start address cannot be detected automatically.
*
* @return 0 if OK, -EINVAL if the /memory node or reg property is missing or
* invalid
*/
int fdtdec_setup_memory_size(void);
int fdtdec_setup_mem_size_base(void);
/**
* fdtdec_setup_memory_banksize() - decode and populate gd->bd->bi_dram

View File

@ -1155,7 +1155,7 @@ int fdtdec_decode_display_timing(const void *blob, int parent, int index,
return ret;
}
int fdtdec_setup_memory_size(void)
int fdtdec_setup_mem_size_base(void)
{
int ret, mem;
struct fdt_resource res;

View File

@ -210,7 +210,7 @@ Changes in v4:
Simon Glass (2):
pci: Correct cast for sandbox
fdt: Correct cast for sandbox in fdtdec_setup_memory_size()
fdt: Correct cast for sandbox in fdtdec_setup_mem_size_base()
cmd/pci.c | 3 ++-
fs/fat/fat.c | 1 +

View File

@ -10,7 +10,7 @@ Content-Transfer-Encoding: 8bit
Simon Glass (2):
pci: Correct cast for sandbox
fdt: Correct cast for sandbox in fdtdec_setup_memory_size()
fdt: Correct cast for sandbox in fdtdec_setup_mem_size_base()
cmd/pci.c | 3 ++-
fs/fat/fat.c | 1 +

View File

@ -1,7 +1,7 @@
From 5ab48490f03051875ab13d288a4bf32b507d76fd Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Sat, 15 Apr 2017 15:39:08 -0600
Subject: [RFC 2/2] fdt: Correct cast for sandbox in fdtdec_setup_memory_size()
Subject: [RFC 2/2] fdt: Correct cast for sandbox in fdtdec_setup_mem_size_base()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -58,7 +58,7 @@ diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index c072e54..942244f 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1200,7 +1200,8 @@ int fdtdec_setup_memory_size(void)
@@ -1200,7 +1200,8 @@ int fdtdec_setup_mem_size_base(void)
}
gd->ram_size = (phys_size_t)(res.end - res.start + 1);

View File

@ -28,7 +28,7 @@ commit 5ab48490f03051875ab13d288a4bf32b507d76fd
Author: Simon Glass <sjg@chromium.org>
Date: Sat Apr 15 15:39:08 2017 -0600
fdt: Correct cast for sandbox in fdtdec_setup_memory_size()
fdt: Correct cast for sandbox in fdtdec_setup_mem_size_base()
This gives a warning with some native compilers: