All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/4] rockchip: rk3399: Update SPL generation for the RK3399
@ 2017-03-15 11:08 Philipp Tomsich
  2017-03-15 11:08 ` [U-Boot] [PATCH v2 1/4] rockchip: mkimage: simplify start/size calculation for rc4_encode Philipp Tomsich
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Philipp Tomsich @ 2017-03-15 11:08 UTC (permalink / raw)
  To: u-boot


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

-- 
1.9.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-03-26  2:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [U-Boot] [PATCH v2 0/4] rockchip: rk3399: Update SPL generation for the RK3399 Kever Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.