From: Michal Simek Date: Mon, 11 Jun 2018 08:17:17 +0200 Subject: [U-Boot] [PATCH 1/4] lib: fdtdec: Fill initial ram top with DDR start value from dt In-Reply-To: References: <1528183254-9302-1-git-send-email-siva.durga.paladugu@xilinx.com> <8abaca93-e3ff-ac8f-3835-4e81dc64e0c8@xilinx.com> Message-ID: <13c59cdd-d61f-aae9-bc58-85a0a19f7e3f@xilinx.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 8.6.2018 23:59, Simon Glass wrote: > Hi, > > > On 7 June 2018 at 06:18, Michal Simek wrote: >> Hi, >> >> On 5.6.2018 09:20, Siva Durga Prasad Paladugu wrote: >>> Fill initial ram top with DDR base addr value from DT as not filling >>> it here always assumes it as zero while calculating relocation >>> offset and hence lead to failures in somecases. This will assumed >>> as zero if CONFIG_SYS_SDRAM_BASE is not defined. >>> >>> Signed-off-by: Siva Durga Prasad Paladugu >>> Signed-off-by: Michal Simek >>> --- >>> lib/fdtdec.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/lib/fdtdec.c b/lib/fdtdec.c >>> index f4e8dbf..34ef9b8 100644 >>> --- a/lib/fdtdec.c >>> +++ b/lib/fdtdec.c >>> @@ -1172,6 +1172,7 @@ int fdtdec_setup_memory_size(void) >>> } >>> >>> gd->ram_size = (phys_size_t)(res.end - res.start + 1); >>> + gd->ram_top = (unsigned long)res.start; >>> debug("%s: Initial DRAM size %llx\n", __func__, >>> (unsigned long long)gd->ram_size); >>> >>> >> >> I am curious about ram_top meaning. It is used more as ram_base. >> >> I expect we can workaround it by board_get_usable_ram_top() where we >> decode it exactly the same as patched fdtdec_setup_memory_size() but I >> don't think it is better solution than this one. >> >> Simon/Tom: any comment? > > I wonder why it is not set to res.end in this patch? > > Comments from global_data.h: > > unsigned long ram_top; /* Top address of RAM used by U-Boot */ > phys_size_t ram_size; /* RAM size */ I am aware about this but in common/ but I have incorrectly read this code in setup_dest_addr() DP: Can you please check this again why you have created this patch? Thanks, Michal