From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Simek Date: Thu, 22 Oct 2020 12:32:15 +0200 Subject: [PATCH 03/10] xilinx: Add DDR base address to bootscript address In-Reply-To: References: Message-ID: <6e5a4a0e7954ca693660e40127baed9547660309.1603362738.git.michal.simek@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 From: T Karthik Reddy Add ram base address to scriptaddr env variable to make boot script address to be a valid address when ddr base address changes. This works properly if the first memory region is the region where uboot runs. Also the solution was taken in respect of a lot of jtag script putting u-boot script to certain address. For standard cases bd->bi_dram[0].start is 0 all the time. Only for systems with DDR placed out of this location it does calculation. This is not the best solution and should be done differently in future but enough for now till we don't have full solution ready yet. Signed-off-by: T Karthik Reddy Signed-off-by: Michal Simek --- board/xilinx/common/board.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 821ee836dd84..857a66a50407 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -371,6 +371,15 @@ int board_late_init_xilinx(void) int i, id, macid = 0; struct xilinx_board_description *desc; phys_size_t bootm_size = gd->ram_size; + struct bd_info *bd = gd->bd; + + if (bd->bi_dram[0].start) { + ulong scriptaddr; + + scriptaddr = env_get_hex("scriptaddr", 0); + ret |= env_set_hex("scriptaddr", + bd->bi_dram[0].start + scriptaddr); + } if (CONFIG_IS_ENABLED(ARCH_ZYNQ)) bootm_size = min(bootm_size, (phys_size_t)(SZ_512M + SZ_256M)); -- 2.28.0