From: Simon Glass Date: Thu, 2 May 2019 10:52:27 -0600 Subject: [U-Boot] [PATCH v3 17/18] x86: Add a way to jump from TPL to SPL In-Reply-To: <20190502165229.203099-1-sjg@chromium.org> References: <20190502165229.203099-1-sjg@chromium.org> Message-ID: <20190502165229.203099-18-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de When TPL finishes it needs to jump to SPL with the stack set up correctly. Add a function to handle this. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v3: None Changes in v2: - Add a new patch allowing jumping from TPL to SPL arch/x86/cpu/start.S | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S index 30fa7def464..4a82add76b7 100644 --- a/arch/x86/cpu/start.S +++ b/arch/x86/cpu/start.S @@ -190,6 +190,19 @@ board_init_f_r_trampoline: /* Re-enter U-Boot by calling board_init_f_r() */ call board_init_f_r +#ifdef CONFIG_TPL +.globl jump_to_spl +.type jump_to_spl, @function +jump_to_spl: + /* Reset stack to the top of CAR space */ + movl $(CONFIG_SYS_CAR_ADDR + CONFIG_SYS_CAR_SIZE - 4), %esp +#ifdef CONFIG_DCACHE_RAM_MRC_VAR_SIZE + subl $CONFIG_DCACHE_RAM_MRC_VAR_SIZE, %esp +#endif + + jmp *%eax +#endif + die: hlt jmp die -- 2.21.0.1020.gf2820cf01a-goog