From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Stuebner Date: Wed, 11 Oct 2017 15:07:51 +0200 Subject: [U-Boot] [PATCH v5 00/18] rockchip: back-to-bootrom: replace assembly-implementation with C-code In-Reply-To: <1507645279-25188-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1507645279-25188-1-git-send-email-philipp.tomsich@theobroma-systems.com> Message-ID: <3469318.ZWUX5ZKbK4@phil> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am Dienstag, 10. Oktober 2017, 16:21:00 CEST schrieb Philipp Tomsich: > > Recent discussions confirmed (what the code always assumed): the > Rockchip BROM always enters U-Boot with the stack-pointer valid > (i.e. the U-Boot startup code is running off the BROM stack). > > We can thus replace the back-to-bootrom code (i.e. both the > save_boot_params and back_to_bootrom implementations) using C-code > based on setjmp/longjmp. The new implementation is already structured > to allow an easy drop-in of Andy's changes to enter download-mode when > returning to the BROM. > > This turned out to require a some tweaking to system.h (making sure > that the prototype for save_boot_params_ret is visible for A64)and > start.S (so binutils knows that this is a possible function entry and > it can correctly insert A32-to-Thumb transitions) and taking the axe > to setjmp.h (which created quite a few issues with it not expecting > A32/T32/Thumb call-sites and some fragility from GCC being smart about > the clobber-list of the inline assembly... which led to r9 not being > saved or restored). > > For v4+: To fix issues with the RK3188 support, this also updates the > boot0 hook changes (i.e. allowing the boot0-hook to insert code/data > before the ARM vector table) that Kever had submitted this spring and > implements a similar "early back-to-bootrom" as suggested by Pawel > (for the RK3066) as a generic mechanism. This series on rk3188-radxarock Tested-by: Heiko Stuebner It can enter SPL and from there also enter into proper uboot. At first I was about to complain that it broke mid-series until I realized that I'll of course need to adapt my image build script to not try to use a TPL binary :-D Heiko