From: Kever Yang <kever.yang@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 0/4] rockchip: rk3399: Update SPL generation for the RK3399
Date: Thu, 16 Mar 2017 15:48:27 +0800 [thread overview]
Message-ID: <58CA434B.5040705@rock-chips.com> (raw)
In-Reply-To: <1489576125-32355-1-git-send-email-philipp.tomsich@theobroma-systems.com>
Hi Philipp,
It's great to see your patch fix the align issue in rk3399, reserve
space
for magic tag is a good idea which is the same with our internal code.
In this case, you do not need to separate for rk3399 and other Rockchips
SoCs:
1. SPL code: reserve 4-byte space for all rockchip SoCs's SPL,
2. mkimage: override the first 4 byte with magic number, no need to
insert 'nop'
for rk3399, rk3399 is the same with other SoCs
3. doc: maybe you can help to update doc/README.rockchip?
Thanks,
- Kever
On 03/15/2017 07:08 PM, Philipp Tomsich wrote:
> For the RK3399, which boots in AArch64 mode, the Boot ROM still starts
> execution at the instruction following the SPL boot-magic
> (i.e. 'RK33'). This puts the first executed instruction on an odd
> address (+0x4).
>
> However, we can't reasonably use for the start of the .text-section on
> AArch64, as it would violate natural alignment... which in turn
> invites trouble down the line if a linker assumes natural alignment or
> some assembly snippet tries to be smart.
>
> This series implements both approaches for dealing with this odd
> alignment during SPL image creation:
> * patches 1 and 2 take an SPL image which starts at (+0x8) and
> prepends it with a AArch64 'nop' during image assembly
> * patches 3 and 4 change this to using a BOOT0_HOOK to insert a single
> 4-byte word at the beginning of the SPL build to make space for the
> 'RK33' magic and then have the mkimage-tool overwrite this word in
> the 'set_header' function.
>
> In doing so, the rkimage code is refactored:
> - to remove duplication between rksd.c and rkspi.c
> - to dynamically allocate the space for headers from vrec
>
> Changes in v2:
> - Use BOOT0_HOOK to insert space into the SPL payload that can be
> overwritten with the boot magic (e.g. 'RK33') by rkimage
> - Change rkimage to overwrite this padding for the RK3399 instead of
> inserting an artificial 'nop'
>
> Philipp Tomsich (4):
> rockchip: mkimage: simplify start/size calculation for rc4_encode
> rockchip: mkimage: pad the header to 8-bytes (using a 'nop') for
> RK3399
> rockchip: spl: RK3399: use boot0 hook to create space for SPL magic
> rockchip: mkimage: update rkimage to support pre-padded payloads
>
> arch/arm/include/asm/arch-rockchip/boot0.h | 18 ++++++
> arch/arm/mach-rockchip/Kconfig | 1 +
> include/configs/rk3399_common.h | 2 +-
> tools/rkcommon.c | 90 ++++++++++++++++++++++++++----
> tools/rkcommon.h | 10 ++++
> tools/rksd.c | 17 ++----
> tools/rkspi.c | 17 ++----
> 7 files changed, 119 insertions(+), 36 deletions(-)
> create mode 100644 arch/arm/include/asm/arch-rockchip/boot0.h
>
prev parent reply other threads:[~2017-03-16 7:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 11:08 [U-Boot] [PATCH v2 0/4] rockchip: rk3399: Update SPL generation for the RK3399 Philipp Tomsich
2017-03-15 11:08 ` [U-Boot] [PATCH v2 1/4] rockchip: mkimage: simplify start/size calculation for rc4_encode Philipp Tomsich
2017-03-26 2:40 ` Simon Glass
2017-03-15 11:08 ` [U-Boot] [PATCH v2 2/4] rockchip: mkimage: pad the header to 8-bytes (using a 'nop') for RK3399 Philipp Tomsich
2017-03-26 2:40 ` Simon Glass
2017-03-15 11:08 ` [U-Boot] [PATCH v2 3/4] rockchip: spl: RK3399: use boot0 hook to create space for SPL magic Philipp Tomsich
2017-03-26 2:40 ` Simon Glass
2017-03-15 11:08 ` [U-Boot] [PATCH v2 4/4] rockchip: mkimage: update rkimage to support pre-padded payloads Philipp Tomsich
2017-03-26 2:40 ` Simon Glass
2017-03-16 7:48 ` Kever Yang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=58CA434B.5040705@rock-chips.com \
--to=kever.yang@rock-chips.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox