All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH 0/5] move boot0 hook in the beginning for armv7
@ 2017-05-31 10:50 Kever Yang
  2017-05-31 10:50 ` [U-Boot] [RFC PATCH 1/5] armv7: move boot hook before '_start' Kever Yang
                   ` (5 more replies)
  0 siblings, 6 replies; 34+ messages in thread
From: Kever Yang @ 2017-05-31 10:50 UTC (permalink / raw)
  To: u-boot


I think the boot0 hook is suppose to add some data in the very beginning
of the SPL image, am I right?

Rockchip SoCs bootrom design is like this:
- First 2KB or 4KB internal memory is for bootrom stack and heap;
- Then the first 4-byte suppose to be a TAG like 'RK33';
- The the following memory address end with '0004' is the first
  instruction load and running by bootrom;

Example for RK3288:
Before this patch set, the SPL_TEXT_BASE is ff704004, and image write to
media device after mkimage like this:

ff704000: 32334b52 00000000 00000000 00000000    RK32............
ff704010: 00000000 00000000 00000000 00000000    ................
ff704020: ea00000f e59ff014 e59ff014 e59ff014    ................
ff704030: e59ff014 e59ff014 e59ff014 e59ff014    ................

Where the first instruction from bootrom is '00000000', which is a
undefined instruction.
The '_start' and 'reset' have to align to 0x20 for the requirement of
VBAR, the memory offset '004'~'01c' are filled with '00000000'.

We can use the boot0 hook to fix this issue, after this patch set,
the SPL_TEXT_BASE is ff704000 and image write to media device after
mkimage like this:

ff704000: 32334b52 ea00001d e320f000 e320f000    RK32...... ... .
ff704010: e320f000 e320f000 e320f000 e320f000    .. ... ... ... .
ff704020: ea000016 e59ff014 e59ff014 e59ff014    ................
ff704030: e59ff014 e59ff014 e59ff014 e59ff014    ................

The first instruction from bootrom is a 'b reset', and memory of
'008'~'01c' are filled with 'nop' instruction.

This patch set does not provide patch for socfpga, bcm and sunxi SoCs which also
enable BOOT0_HOOK, so this is a RFC patch, please advice how to make it
compatible with those three platforms.



Kever Yang (5):
  armv7: move boot hook before '_start'
  rockchip: boot0: align to 0x20 for armv7 '_start'
  rockchip: enable BOOT0_HOOK for SoCs
  rockchip: configs: use aligned address for SPL_TEXT_BASE
  rockchip: mkimage: use spl_boot0 for all Rockchip SoCs

 arch/arm/include/asm/arch-rockchip/boot0.h |  9 ++++++++-
 arch/arm/lib/vectors.S                     | 19 ++++++++++---------
 arch/arm/mach-rockchip/Kconfig             |  3 +++
 include/configs/rk3036_common.h            |  2 +-
 include/configs/rk3288_common.h            |  2 +-
 tools/rkcommon.c                           |  8 ++++----
 6 files changed, 27 insertions(+), 16 deletions(-)

-- 
1.9.1

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

end of thread, other threads:[~2017-06-17  3:42 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31 10:50 [U-Boot] [RFC PATCH 0/5] move boot0 hook in the beginning for armv7 Kever Yang
2017-05-31 10:50 ` [U-Boot] [RFC PATCH 1/5] armv7: move boot hook before '_start' Kever Yang
2017-06-07  2:28   ` Kever Yang
2017-06-07  6:28     ` Marek Vasut
2017-06-13  1:51       ` Kever Yang
2017-06-13  8:42         ` Marek Vasut
2017-06-13  9:44           ` Dr. Philipp Tomsich
2017-06-13  9:47             ` Marek Vasut
2017-06-13 10:31               ` Dr. Philipp Tomsich
2017-06-17  3:42                 ` Simon Glass
2017-05-31 10:50 ` [U-Boot] [RFC PATCH 2/5] rockchip: boot0: align to 0x20 for armv7 '_start' Kever Yang
     [not found]   ` <alpine.OSX.2.21.1706092037210.12195@vpn-10-11-0-14.lan>
2017-06-13  1:58     ` [U-Boot] [U-Boot, RFC, " Kever Yang
2017-05-31 10:50 ` [U-Boot] [RFC PATCH 3/5] rockchip: enable BOOT0_HOOK for SoCs Kever Yang
2017-05-31 10:50 ` [U-Boot] [RFC PATCH 4/5] rockchip: configs: use aligned address for SPL_TEXT_BASE Kever Yang
2017-05-31 10:50 ` [U-Boot] [RFC PATCH 5/5] rockchip: mkimage: use spl_boot0 for all Rockchip SoCs Kever Yang
2017-05-31 10:58   ` Dr. Philipp Tomsich
2017-06-01  1:11     ` Andy Yan
2017-06-01  7:41       ` Dr. Philipp Tomsich
2017-06-02  1:09         ` Kever Yang
2017-06-06 21:08 ` [U-Boot] [RFC PATCH 0/5] move boot0 hook in the beginning for armv7 Simon Glass
2017-06-07  2:41   ` Kever Yang
2017-06-07  3:15     ` Simon Glass
2017-06-07 10:55       ` Kever Yang
2017-06-09 12:27         ` Simon Glass
2017-06-09 12:59           ` Dr. Philipp Tomsich
2017-06-12 23:50             ` Simon Glass
2017-06-13 17:48             ` Jagan Teki
2017-06-13 18:07               ` Dr. Philipp Tomsich
2017-06-13 18:14                 ` Jagan Teki
2017-06-13 18:29                   ` Dr. Philipp Tomsich
2017-06-13  1:40           ` Kever Yang
2017-06-13  7:44             ` Dr. Philipp Tomsich
2017-06-13 17:10               ` Jagan Teki
2017-06-13 18:59                 ` Dr. Philipp Tomsich

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.