2 * Copyright (C) 2016 Vladimir Zapolskiy <vz@mleia.com>
4 * SPDX-License-Identifier: GPL-2.0+
9 DECLARE_GLOBAL_DATA_PTR;
13 gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
14 CONFIG_SYS_SDRAM_SIZE);
19 void relocate_code(ulong start_addr_sp, gd_t *new_gd, ulong relocaddr)
21 void (*reloc_board_init_r)(gd_t *gd, ulong dest) = board_init_r;
23 if (new_gd->reloc_off) {
24 memcpy((void *)new_gd->relocaddr,
25 (void *)(new_gd->relocaddr - new_gd->reloc_off),
28 reloc_board_init_r += new_gd->reloc_off;
31 __asm__ __volatile__("mov.l %0, r15\n" : : "m" (new_gd->start_addr_sp));
34 reloc_board_init_r(new_gd, 0x0);