Skip to content

VBE serial part H: Implement VBE on Rockchip RK3399

Simon Glass u-boot 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest25 patches 1 replyIn review
  2. v4 posting 2/225 patches 7 repliesSuperseded
  3. v3 posting 2/231 patches 19 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v4 posting 1/24 patches1 replySuperseded
v3 posting 1/24 patches0 repliesSuperseded
v235 patches47 repliesSuperseded
v129 patches57 repliesSuperseded

Changes in v5 from the cover letter · 21 lines

- Drop stray #endif
- Drop removal of stray #ifdef
- Mention VBE in the first paragraph of the commit message
- Wrap the entire simple-bin node and add the properties to vpl
- Expand commit message to mention VBE
- Move SUPPORT_VPL next to other SUPPORT_xxx options
- Put TPL_DM_MMC in alpha order
- Move VPL_ROCKCHIP_COMMON_BOARD up a bit
- Move VPL_LDSCRIPT up a bit
- Drop config SPL_STACK_R_ADDR
- Use if() instead of ? in spl_boot_device()
- Drop mention of SPL_RAW_IMAGE_SUPPORT since it is already the default
- Drop mention of SPL_SEPARATE_BSS since VPL doesn't need it
- Drop duplicate __image_copy_start and __image_copy_end
- Drop unwanted comment in script
- Reword first paragraph to mention bloblist instead of other stacks
- Add value for CONFIG_SPL_STACK_R_ADDR
- Add to VPL file also
- Use 'SDRAM' instead of 'IRAM' in comment
- Drop mention of rk3399 since 64-boards always have TF-A after SPL
- Drop condition on VPL

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/25spl: Adjust xPL symbolscommon/spl/spl_reloc.c+1 -10 replies
2/25spl: Allow VBE to handle xPL sizecommon/spl/spl.c+2 -00 replies
3/25vbe: Show the margin when using SPL_RELOCcmd/vbe.c common/spl/spl_reloc.c include/vbe.h+21 -20 replies
4/25rockchip: Allow RAM init to happen in SPL on rk3399drivers/ram/rockchip/sdram_rk3399.c+4 -20 replies
5/25rockchip: dts: Add an fdtmaparch/arm/dts/rockchip-u-boot.dtsi+6 -00 replies
6/25rockchip: dts: Specify the phase in the imagearch/arm/dts/rockchip-u-boot.dtsi+4 -00 replies
7/25rockchip: Provide a bootstd configurationarch/arm/dts/rockchip-u-boot.dtsi arch/arm/dts/rockchip-vpl-u-boot.dtsi+44 -00 replies
8/25rockchip: Add SPL into the main FITarch/arm/dts/rockchip-vpl-u-boot.dtsi+29 -00 replies
9/25rockchip: Add a template for SPLarch/arm/dts/rockchip-vpl-u-boot.dtsi+43 -00 replies
10/25rockchip: Add a VPL imagearch/arm/dts/rockchip-vpl-u-boot.dtsi+91 -00 replies
11/25rockchip: Add TPL alternativesarch/arm/dts/rockchip-u-boot.dtsi arch/arm/dts/rockchip-vpl-u-boot.dtsi+23 -00 replies
12/25rockchip: Update rk3399 bootph-tags for VPLarch/arm/dts/rk3399-u-boot.dtsi+9 -00 replies
13/25rockchip: Provide a VPL phase on rk3399arch/arm/include/asm/spl.h arch/arm/mach-rockchip/Kconfig arch/arm/mach-rockchip/Makefile +6 more+205 -60 replies
14/25rockchip: Add symbols for spl_relocarch/arm/mach-rockchip/u-boot-tpl-v8.lds+10 -00 replies
15/25rockchip: rk3399: Adjust TPL stack to allow for bloblistarch/arm/mach-rockchip/rk3399/Kconfig+1 -10 replies
16/25rockchip: Allow SPL to set up SDRAMarch/arm/mach-rockchip/tpl.c+6 -40 replies
17/25rockchip: Add a generic-ddr3 rk3399 boardboard/rockchip/evb_rk3399/MAINTAINERS configs/rk3399-generic-ddr3_defconfig+131 -00 replies
18/25rockchip: Add documentation for VBEdoc/board/rockchip/rockchip.rst+13 -00 replies
19/25gitlab: Add an VBE board to the sjg lab.gitlab-ci.yml+6 -00 replies
20/25rockchip: Set the skip-at-start property correctlyarch/arm/dts/rockchip-u-boot.dtsi arch/arm/dts/rockchip-vpl-u-boot.dtsi common/spl/Kconfig+3 -11 reply
21/25vbe: Add a bootmeth driver for abrecboot/vbe_abrec.c+99 -00 replies
22/25rockchip: Update binman image for new skip-at-start setuparch/arm/dts/rockchip-vpl-u-boot.dtsi+3 -40 replies
23/25bloblist: Temporary hacks to get VBE going.gitlab-ci.yml arch/arm/lib/xferlist.c common/bloblist.c +1 more+53 -1050 replies
24/25rockchip: Relocate bloblist at the end of the SPL phasearch/arm/mach-rockchip/spl.c+14 -00 replies
25/25bloblist: Allow using a different bloblist addresscommon/Kconfig common/bloblist.c+34 -10 replies

Reviews trailers per patch

2 of 25 patches have a Reviewed-by or Acked-by.

PatchTom RiniJonas Karlman
1/25R-b
2/25
3/25
4/25
5/25R-b
6/25
7/25
8/25
9/25
10/25
11/25
12/25
13/25
14/25
15/25
16/25
17/25
18/25
19/25
20/25
21/25
22/25
23/25
24/25
25/25

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 00/25] VBE serial part H: Implement VBE on Rockchip RK3399

This series completes the work to enable VBE on a suitable board. Most of it is rockchip-specific patches to support the VPL phase, i.e. the one which decides which boot patch to take (A, B or recovery).

A good chunk of this series is adding an image for VBE, by creating a new Binman image. Future work in Binman may make this more automated / easier, but for now it is written out in full. The work is undertaken piecemeal so it is easier to review the steps.

VBE allows similar boards to share firmware images, with perhaps just TPL (around 75K) being different for each board. Using a common image for VPL, SPL and U-Boot saves a lot of space in the image and makes builds easier. Of course, each board still needs a separate devicetree.

Here is the layout of the image:

Name Image-pos Size Entry-type Offset Uncomp-size
----------------------------------------------------------------------------------------------

image                                 0   1b960cf  section                    0
  alternates-fdt                   8000     31000  alternates-fdt          8000
    mkimage                        8000     31000  mkimage                    0
      u-boot-tpl                   8048     12a11  u-boot-tpl                48
  vpl                            208000     16200  fit                   208000
    image-vpl                    209400      a5a3  section                 1400
      section                    209400      a5a3  section                    0
        u-boot-vpl-nodtb                    10348  u-boot-vpl-nodtb           0
        u-boot-vpl-bss-pad                     20  u-boot-vpl-bss-pad     10348
    @fdt-SEQ                          0         0  section                    0
  vbe-a                          800000    39b200  section               800000
    spl-a                        800000    100000  fit                        0
      spl                        801400     10c97  section                 1400
        section                  801400     10c97  section                    0
          u-boot-spl-nodtb                  1a908  u-boot-spl-nodtb           0
          u-boot-spl-bss-pad                  1b0  u-boot-spl-bss-pad     1a908
      @fdt-SEQ                        0         0  section                    0
    u-boot-a                     900000    29b200  fit                   100000
      spl                        902400     10c97  section                 2400
        section                  902400     10c97  section                    0
          u-boot-spl-nodtb                  1a908  u-boot-spl-nodtb           0
          u-boot-spl-bss-pad                  1b0  u-boot-spl-bss-pad     1a908
      u-boot                     913200     e4250  section                13200
        u-boot-nodtb             913200     e4250  u-boot-nodtb               0
      @atf-SEQ                        0         0  section                    0
        atf-bl31                      0         0  atf-bl31                   0
      @tee-SEQ                        0         0  section                    0
        tee-os                        0         0  tee-os                     0
      @fdt-SEQ                        0         0  section                    0
  vbe-b                         1000000    39b200  section              1000000
    spl-b                       1000000    100000  fit                        0
      spl                       1001400     10c97  section                 1400
        section                 1001400     10c97  section                    0
          u-boot-spl-nodtb                  1a908  u-boot-spl-nodtb           0
          u-boot-spl-bss-pad                  1b0  u-boot-spl-bss-pad     1a908
      @fdt-SEQ                        0         0  section                    0
    u-boot-b                    1100000    29b200  fit                   100000
      spl                       1102400     10c97  section                 2400
        section                 1102400     10c97  section                    0
          u-boot-spl-nodtb                  1a908  u-boot-spl-nodtb           0
          u-boot-spl-bss-pad                  1b0  u-boot-spl-bss-pad     1a908
      u-boot                    1113200     e4250  section                13200
        u-boot-nodtb            1113200     e4250  u-boot-nodtb               0
      @atf-SEQ                        0         0  section                    0
        atf-bl31                      0         0  atf-bl31                   0
      @tee-SEQ                        0         0  section                    0
        tee-os                        0         0  tee-os                     0
      @fdt-SEQ                        0         0  section                    0
  vbe-recovery                  1800000    39b200  section              1800000
    spl-recovery                1800000    100000  fit                        0
      spl                       1801400     10c97  section                 1400
        section                 1801400     10c97  section                    0
          u-boot-spl-nodtb                  1a908  u-boot-spl-nodtb           0
          u-boot-spl-bss-pad                  1b0  u-boot-spl-bss-pad     1a908
      @fdt-SEQ                        0         0  section                    0
    u-boot-recovery             1900000    29b200  fit                   100000
      spl                       1902400     10c97  section                 2400
        section                 1902400     10c97  section                    0
          u-boot-spl-nodtb                  1a908  u-boot-spl-nodtb           0
          u-boot-spl-bss-pad                  1b0  u-boot-spl-bss-pad     1a908
      u-boot                    1913200     e4250  section                13200
        u-boot-nodtb            1913200     e4250  u-boot-nodtb               0
      @atf-SEQ                        0         0  section                    0
        atf-bl31                      0         0  atf-bl31                   0
      @tee-SEQ                        0         0  section                    0
        tee-os                        0         0  tee-os                     0
      @fdt-SEQ                        0         0  section                    0
  fdtmap                        1b9b200      2ecf  fdtmap               1b9b200

This series still includes the bloblist reverts, at the end, just so that the board doesn't have on boot, but I have a series locally which should improve things, so I will send that when complete.

This is (mostly) the final VBE series, but there are a few loose ends to tidy up:

- cache is disabled in SPL, which slows the boot a little
- pinctrl init needs to be tidied up to avoid warnings
- bloblist logic as above
- bloblist-relocation is partly in board-specific code, partly generic

Other things may become apparently after more usage / testing.

Changes in v5:
- Drop stray #endif
- Drop removal of stray #ifdef
- Mention VBE in the first paragraph of the commit message
- Wrap the entire simple-bin node and add the properties to vpl
- Expand commit message to mention VBE
- Move SUPPORT_VPL next to other SUPPORT_xxx options
- Put TPL_DM_MMC in alpha order
- Move VPL_ROCKCHIP_COMMON_BOARD up a bit
- Move VPL_LDSCRIPT up a bit
- Drop config SPL_STACK_R_ADDR
- Use if() instead of ? in spl_boot_device()
- Drop mention of SPL_RAW_IMAGE_SUPPORT since it is already the default
- Drop mention of SPL_SEPARATE_BSS since VPL doesn't need it
- Drop duplicate __image_copy_start and __image_copy_end
- Drop unwanted comment in script
- Reword first paragraph to mention bloblist instead of other stacks
- Add value for CONFIG_SPL_STACK_R_ADDR
- Add to VPL file also
- Use 'SDRAM' instead of 'IRAM' in comment
- Drop mention of rk3399 since 64-boards always have TF-A after SPL
- Drop condition on VPL

Changes in v4:
- Use FIT_ARCH instead of ARCH
- Use FIT_ARCH instead of ARCH
- Use FIT_ARCH instead of ARCH
- Use fit_template instead of common_part
- Put the fdtmap at the end of the image
- Update the comment at the end of the '#ifndef CONFIG_VPL' block
- Add a value for SPL_STACK_R_ADDR
- Drop SPL_PAD_TO value since the default is fine
- Drop ROCKCHIP_IODOMAIN since it is the default
- Add SPL_LIBCOMMON_SUPPORT and SPL_LIBGENERIC_SUPPORT

Changes in v3:
- Add blank lines before the node
- Add a comment about the offsets
- Move template to the vpl file
- Unindent bootph tags
- Add the BLOBLIST_RELOC condition as well

Changes in v2:
- Move VPL things into a separate file
- Move VPL things into a separate file
- Move VPL things into a separate file
- Mention RK3399 with respect to the memory limit
- Move VPL things into a separate file
- Only enable MMC when VPM is in use.
- Rewrite help for VPL_ROCKCHIP_COMMON_BOARD
- Skip spl-boot-order.c for VPL (rather than modifying it)
- Reword commit to mention comments from Jonas
- Rename to rk3399-generic-ddr3
- Update devicetree to match firefly-rk3399
- Use the firefly devicetree as the default for this board
- Move this patch to the end of the series
- Drop 0x8000 offset for SPI
- Add new patch with a bootmeth driver for abrec
- Split out the fixes for skip-at-start into a new patch
- Move this logic into board-specific code
- Move the actual relocation code to a previous board-specific patch

Simon Glass (25):
spl: Adjust xPL symbols
spl: Allow VBE to handle xPL size
vbe: Show the margin when using SPL_RELOC
rockchip: Allow RAM init to happen in SPL on rk3399
rockchip: dts: Add an fdtmap
rockchip: dts: Specify the phase in the image
rockchip: Provide a bootstd configuration
rockchip: Add SPL into the main FIT
rockchip: Add a template for SPL
rockchip: Add a VPL image
rockchip: Add TPL alternatives
rockchip: Update rk3399 bootph-tags for VPL
rockchip: Provide a VPL phase on rk3399
rockchip: Add symbols for spl_reloc
rockchip: rk3399: Adjust TPL stack to allow for bloblist
rockchip: Allow SPL to set up SDRAM
rockchip: Add a generic-ddr3 rk3399 board
rockchip: Add documentation for VBE
gitlab: Add an VBE board to the sjg lab
rockchip: Set the skip-at-start property correctly
vbe: Add a bootmeth driver for abrec
rockchip: Update binman image for new skip-at-start setup
bloblist: Temporary hacks to get VBE going
rockchip: Relocate bloblist at the end of the SPL phase
bloblist: Allow using a different bloblist address

 .gitlab-ci.yml                           |  20 +-
 arch/arm/dts/rk3399-u-boot.dtsi          |   9 +
 arch/arm/dts/rockchip-u-boot.dtsi        |  17 ++
 arch/arm/dts/rockchip-vpl-u-boot.dtsi    | 224 +++++++++++++++++++++++
 arch/arm/include/asm/spl.h               |   1 +
 arch/arm/lib/xferlist.c                  |  12 +-
 arch/arm/mach-rockchip/Kconfig           |  23 ++-
 arch/arm/mach-rockchip/Makefile          |  11 +-
 arch/arm/mach-rockchip/rk3399/Kconfig    |  11 +-
 arch/arm/mach-rockchip/spl.c             |  17 ++
 arch/arm/mach-rockchip/tpl.c             |  13 +-
 arch/arm/mach-rockchip/u-boot-tpl-v8.lds |  10 +
 arch/arm/mach-rockchip/u-boot-vpl-v8.lds | 107 +++++++++++
 arch/arm/mach-rockchip/vpl.c             |  53 ++++++
 board/rockchip/evb_rk3399/MAINTAINERS    |   6 +
 boot/vbe_abrec.c                         |  99 ++++++++++
 cmd/vbe.c                                |   8 +-
 common/Kconfig                           |  20 ++
 common/bloblist.c                        | 127 +++++--------
 common/spl/Kconfig                       |   3 +-
 common/spl/spl.c                         |   2 +
 common/spl/spl_reloc.c                   |  14 +-
 configs/rk3399-generic-ddr3_defconfig    | 125 +++++++++++++
 doc/board/rockchip/rockchip.rst          |  13 ++
 drivers/ram/rockchip/sdram_rk3399.c      |   6 +-
 include/bloblist.h                       |  16 +-
 include/vbe.h                            |   3 +
 27 files changed, 849 insertions(+), 121 deletions(-)
 create mode 100644 arch/arm/dts/rockchip-vpl-u-boot.dtsi
 create mode 100644 arch/arm/mach-rockchip/u-boot-vpl-v8.lds
 create mode 100644 arch/arm/mach-rockchip/vpl.c
 create mode 100644 configs/rk3399-generic-ddr3_defconfig
Signature · 4 lines
2.43.0

base-commit: bab54f5942c428be698216224fd10b91d974d4da
branch: vbi5