{"id":815062,"url":"http://patchwork.ozlabs.org/api/1.2/covers/815062/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/cover/1505758708-29213-1-git-send-email-philipp.tomsich@theobroma-systems.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505758708-29213-1-git-send-email-philipp.tomsich@theobroma-systems.com>","list_archive_url":null,"date":"2017-09-18T18:18:23","name":"[U-Boot,v2,0/5] rockchip: back-to-bootrom: replace assembly-implementation with C-code","submitter":{"id":53488,"url":"http://patchwork.ozlabs.org/api/1.2/people/53488/?format=json","name":"Philipp Tomsich","email":"philipp.tomsich@theobroma-systems.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/cover/1505758708-29213-1-git-send-email-philipp.tomsich@theobroma-systems.com/mbox/","series":[{"id":3697,"url":"http://patchwork.ozlabs.org/api/1.2/series/3697/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=3697","date":"2017-09-18T18:18:23","name":"rockchip: back-to-bootrom: replace assembly-implementation with C-code","version":2,"mbox":"http://patchwork.ozlabs.org/series/3697/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/815062/comments/","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwvQf0Sb9z9s7m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 19 Sep 2017 04:18:48 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 3DF6CC21DCA; Mon, 18 Sep 2017 18:18:42 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 6EC50C21C41;\n\tMon, 18 Sep 2017 18:18:39 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 3B592C21C57; Mon, 18 Sep 2017 18:18:38 +0000 (UTC)","from mail.theobroma-systems.com (vegas.theobroma-systems.com\n\t[144.76.126.164])\n\tby lists.denx.de (Postfix) with ESMTPS id E6312C21C2B\n\tfor <u-boot@lists.denx.de>; Mon, 18 Sep 2017 18:18:37 +0000 (UTC)","from [86.59.122.178] (port=34776 helo=android.lan)\n\tby mail.theobroma-systems.com with esmtpsa\n\t(TLS1.2:RSA_AES_128_CBC_SHA256:128)\n\t(Exim 4.80) (envelope-from <philipp.tomsich@theobroma-systems.com>)\n\tid 1du0cr-00053h-VX; Mon, 18 Sep 2017 20:18:34 +0200"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0","From":"Philipp Tomsich <philipp.tomsich@theobroma-systems.com>","To":"u-boot@lists.denx.de","Date":"Mon, 18 Sep 2017 20:18:23 +0200","Message-Id":"<1505758708-29213-1-git-send-email-philipp.tomsich@theobroma-systems.com>","X-Mailer":"git-send-email 2.1.4","Cc":"Stephen Warren <swarren@nvidia.com>,\n\tKlaus Goger <klaus.goger@theobroma-systems.com>,\n\tAndy Yan <andy.yan@rock-chips.com>","Subject":"[U-Boot] [PATCH v2 0/5] rockchip: back-to-bootrom: replace\n\tassembly-implementation with C-code","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"Recent discussions confirmed (what the code always assumed): the\nRockchip BROM always enters U-Boot with the stack-pointer valid\n(i.e. the U-Boot startup code is running off the BROM stack).\n\nWe can thus replace the back-to-bootrom code (i.e. both the\nsave_boot_params and back_to_bootrom implementations) using C-code\nbased on setjmp/longjmp.  The new implementation is already structured\nto allow an easy drop-in of Andy's changes to enter download-mode when\nreturning to the BROM.\n\nThis entails one minor tweak to asm/system.h, which only exported\nthe save_boot_params_ret prototype for ARMv7, but not for AArch64.\n\nFor v2, we force bootrom.o to alway be emitted as A32 (not T32), so we\ncan safely call save_boot_params_ret().\n\nIt also turned out that I had not caught the RK3188 in my earlier\nseries... and my luck being what it is, the RK3188 needed some extra\nhandholding to adapt to the new regime: instead of passing the context\naddress (for returning to the BROM) from the TPL to the SPL, the SPL\nnow returns to the TPL and the TPL then returns to the BROM.\n\nChanges in v2:\n- [added in v2] chain back_to_bootrom calls for SPL, first returning\n  to the TPL (using the same mechanism) and further calling through\n  to the BROM from the TPL by invoking back_to_bootrom again\n- adapt the RK3188 spl support file (that I had originally missed)\n\nPhilipp Tomsich (5):\n  arm: make save_boot_params_ret prototype visible for AArch64\n  rockchip: back-to-bootrom: replace assembly-implementation with C-code\n  rockchip: back-to-bootrom: rk3188: chain from SPL via TPL to the BROM\n  rockchip: back-to-bootrom: allow passing a cmd to the bootrom\n  rockchip: back-to-bootrom: do not compile bootrom.o in thumb mode\n\n arch/arm/include/asm/arch-rockchip/bootrom.h | 30 +++++++++---\n arch/arm/include/asm/system.h                | 62 ++++++++++++-------------\n arch/arm/mach-rockchip/Makefile              | 10 +++-\n arch/arm/mach-rockchip/bootrom.c             | 54 +++++++++++++++++++++-\n arch/arm/mach-rockchip/rk3036-board-spl.c    |  2 +-\n arch/arm/mach-rockchip/rk3188-board-spl.c    | 14 +-----\n arch/arm/mach-rockchip/rk3188-board-tpl.c    | 19 ++++----\n arch/arm/mach-rockchip/rk322x-board-spl.c    |  2 +-\n arch/arm/mach-rockchip/rk3288-board-spl.c    |  4 +-\n arch/arm/mach-rockchip/rk3368-board-tpl.c    |  2 +-\n arch/arm/mach-rockchip/rk3399-board-spl.c    |  2 +-\n arch/arm/mach-rockchip/save_boot_param.S     | 69 ----------------------------\n 12 files changed, 133 insertions(+), 137 deletions(-)\n delete mode 100644 arch/arm/mach-rockchip/save_boot_param.S"}