Commit Graph

4891 Commits

Author SHA1 Message Date
Rick Chen ade0ea07bd UPSTREAM: riscv: Modify generic codes to support RISC-V
Support common commands bdinfo and image format,
also modify common generic flow for RISC-V.

Signed-off-by: Rick Chen <rick@andestech.com>
Signed-off-by: Rick Chen <rickchen36@gmail.com>
Signed-off-by: Greentime Hu <green.hu@gmail.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Change-Id: Id58d17cd58433fdadc8ce7ee78d72035f84adb53
(cherry picked from commit 068feb9b86d991283c43b56e36094f4e6f484d04)
2020-04-14 12:45:33 +08:00
Jason Zhu 342d050ebb spl: fit: support boot standalone firmware
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ib3e35cfba0bb52141c8948de994f5e6c9661887f
2020-04-14 12:45:33 +08:00
Marek Vasut f2413b2f2f UPSTREAM: fit: Add standalone image type handling
Just add IH_TYPE_STANDALONE to fit_get_image_type_property().

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I0e3dbfad3e15decb81665fabb8d25e1b71f4c7b7
(cherry picked from commit 0298d203754)
2020-04-14 12:45:33 +08:00
Joseph Chen e7be2a072c Kconfig: disable CLI for verified-boot
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I09acae3dda1a886629d0f9901b4c95059cdd8b42
2020-04-10 14:17:32 +08:00
Joseph Chen 22c7c1a827 spl: fit: support load multiple backup of images
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I29bce60f1b958baedbd2b45e86a611b89547c0d8
2020-04-10 10:22:22 +08:00
Joseph Chen 7a1370759d fit: add rollback index protect support
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I3af0049532d7b34adadbbb1faf6c54aad6232f93
2020-04-09 18:26:22 +08:00
Joseph Chen f8ca9d164a spl: do cleanup before jumping to next stage
Cache/mmu/interrupt cleanup is recommand before jumping to
next stage to avoid some uncertain things.

Provide a arch/board-specific callback to do cleanup things.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic5e4e378ec9080e7af283741370bcd9c2dc897dc
2020-04-09 18:26:22 +08:00
Jason Zhu 4ef4c8bf6e spl: rkfw: goto boot next stage directly if find used uboot
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ia32663b91e1360bc491f1db364900eb5b27892f9
2020-04-08 19:09:09 +08:00
Joseph Chen aa415ed977 common: spl: fix cherry-pick sync conflict
fixes: (1cb393f common: spl: rkfw: support bing-up arm32 firmware)

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1b7f1a6269794ea9a4a508933381bbb8e3e7133b
2020-04-07 21:00:48 +08:00
Joseph Chen 6ba9d88bbb fit: drop images->verify condition from verify process
fit verify process should not depend on this condition, because
it's set by env variable "verify" which maybe can be updated by
fw_setenv tool in userspace.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ibcce0d388de64f3809e5e302d1c5cffc01e6c290
2020-04-07 19:35:27 +08:00
Joseph Chen 568848617e common: spl: set default address for entry_point_os
Could be override in boot_from_devices().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ifbfac5903ec61e65739732949f9e6b8a2704155d
(cherry picked from commit f8ca32e1ca)
2020-04-07 17:47:16 +08:00
Jason Zhu 605bf846bd common: spl: jump next process depend on entry_point_os
The spl can bring up uboot & kernel, and their entry points are diffirent,
so pass their entry points by entry_point_os.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I625d135d219cfbfb620ff1e3d0de5278143f4079
(cherry picked from commit 78628ac9a9)
2020-04-07 17:47:16 +08:00
Jason Zhu 1cb393f1c8 common: spl: rkfw: support bing-up arm32 firmware
1. the arm32 trust firmware is diffirent with arm64, support it.
2. add entry_point_os to indicate the uboot or kernel entry point.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I24d1601323e99f40e81d18f1937f762b2ecc137f
(cherry picked from commit a64fd729d4)

Change-Id: I3b1420989d158c52259365d90011524b047b5750
2020-04-07 17:47:16 +08:00
Jason Zhu fcb65c6194 spl: rkfw: support bring up different next stage
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Idfca034d4d3eb5a4f757678e62efd7765bf89840
2020-04-04 10:55:58 +08:00
Jason Zhu 440eb126fa spl: rkfw: add boot_sector to seperate uboot and boot load-address
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I04e2b00a8615fee24ee7722ab7bb9ad4931f4332
2020-04-04 10:55:58 +08:00
Jason Zhu e8b9592f0e common: spl: call the spl_next_stage() to get next stage process
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ibfe81766fcbfe002978b7d225a5602a8eeb89c12
2020-04-04 10:55:58 +08:00
Joseph Chen d871c07160 common: image-fit: add some common APIs
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I3df010d3b6a07efc7287779fe4a0a60ce9f1d2dc
2020-04-03 17:54:19 +08:00
Joseph Chen 2dc02ea380 common: bootm: support host sign check for armv7 fit image
including: fdt, u-boot, op-tee.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ieb3dc15383f47626ef125b5d64e96b90a0a67cc6
2020-04-03 17:54:19 +08:00
Joseph Chen 92a42bc5fe common: image-fit: support hardware crypto hash
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2117282d9bece0fbf61802b36771fc0d1b909058
2020-04-01 17:30:41 +08:00
Joseph Chen d07cb2b8b1 common: board_r: add ENV_MEM_LAYOUT_SETTINGS1 into mininum env
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I865256861668c424806a83d9327b662e480ad737
2020-04-01 17:30:41 +08:00
Joseph Chen 96f5441ec8 common: fit: support spl fit image check by tools/fit_check_sign
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0e03a90d50290e18c6fb2cd44516c352f3695290
2020-03-29 09:57:04 +08:00
Joseph Chen 37526a5172 common: support disable CLI for verified-boot
Not allow any interactive from CLI.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I207da3f2c54df1a81100c404f045023ac763da73
2020-03-28 18:21:16 +08:00
Joseph Chen 7fc773a76d common: add autoboot_command_fail_handle() callback
Maybe user need to do some job when bootcmd failed, they
could override it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1c32c1ad37700e66d45fe033fbfa46d3f350205d
2020-03-28 18:21:16 +08:00
Joseph Chen 957222d7c6 common: image: support IMAGE_PARAM_INVAL as placeholder address flag
User maybe not want to set a fixed address, leave it to U-Boot.
This is a compatible method for different board and platforms.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I01accbc0f116856276610bfaea8de2f7e1275bb0
2020-03-27 18:07:52 +08:00
Joseph Chen 40d08d0f10 tools: mkimage: support pack empty file for multi image
Muilt image bootflow requires ramdisk as a mandory component,
so that we have to pack a empty ramdisk into multi image at
some time.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I551ae832fbc68514ead0a3337148593e3113394f
2020-03-27 18:02:55 +08:00
Joseph Chen 594e14a437 common: spl: support enable D-cache for 32-bit platform
- Initial gd->bd->bi_dram[] for arm32.
- Add a configure to enable/disable SPL D-cache.
- Please make sure CONFIG_SPL_SYS_MALLOC_F_LEN is large
  enough for TLB and bd_t buffer while enabling dcache

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I85f2169fe44b44e16edb15a9538df516037e9823
2020-03-26 14:56:18 +08:00
Jason Zhu cc668fbca4 driver: Makefile: support PWM in spl
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3ca97f634acae8c2d9de0b5e003776bccb14cd1b
2020-03-23 17:00:24 +08:00
Jason Zhu 2d7c904f27 driver: Makefile: support adc in SPL
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I915becbf9597aa070001d3368d8daf9079565fc9
2020-03-23 17:00:24 +08:00
Joseph Chen 7460c07a1d common: android: simplify fdt/ramdisk skip reloc
bootm_board_start() takes over it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8a9e3287ad5ca5964809f689bd204cbc2e37468f
2020-03-19 09:54:27 +08:00
Joseph Chen 5cadaea8d7 common: android: replace do_bootm() with do_bootm_states()
Avoid dead nested when android_bootloader_boot_kernel() is called
in board_do_bootm(), this bootflow maybe:

CLI command "bootm" => do_bootm() => board_do_bootm() =>
android_bootloader_boot_kernel() => do_bootm().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I441d91c986921008752d403a72b7bfa57140d7c8
2020-03-19 09:54:27 +08:00
Joseph Chen 583377c459 spl: fit: add fit config verify support
Do fit config verify if required.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I211f43c07d636ea8cff42cf9133bcab0aa86f8c6
2020-03-16 11:42:38 +08:00
Joseph Chen ce72132898 common: fit: add "data-position" support for data get
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I19dadae361c336ac691ed7eef6d78cee5ec645e0
2020-03-16 11:42:38 +08:00
Joseph Chen acd4329027 common: fit: unify fit image align size
Set 512 as default align size in order to access any image
by block unit.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I372ca7ff567816cb8369aff9d1fbe9865fa6d933
2020-03-16 11:42:38 +08:00
Joseph Chen c15f307504 arm: Kconfig: default select SKIP_RELOCATE_UBOOT if !ARM64
Remove select from rockchip Kconfig.

Some 32-bit platforms needs relocation to support non-compressed
kernel image.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0b60b79d7c67c5bd8439bd55bb277522c74a8bdd
2020-03-13 17:35:40 +08:00
Joseph Chen 15f6b6d065 common: android: correct 32-bit non-compressed kernel address
The page size should be reserved before kernel load address.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iaa13fbc9a7a2872c5fb32a388ce96dd94654fc3d
2020-03-13 17:35:40 +08:00
Joseph Chen 591f14a84b common: android: correct address setting api
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic9026d00abc0855aae18cc1a8018ed3549a9482b
2020-03-13 17:35:40 +08:00
Joseph Chen b92c7cf400 spl: fit: add images information print
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I25e0b72b7f71158a2dbbc7c13e76a5d321e88acf
2020-03-06 18:22:00 +08:00
Ben Whitten f3219d9510 UPSTREAM: spl: fit: verify images prior to post processing
Verification of hashes needs to take place before any image post
processing, thus matching full FIT image processing.
This allows mechanisms such as encryption be applied to images
prior to fit generation at the spl level.

Signed-off-by: Ben Whitten <ben.whitten@lairdtech.com>
(cherry picked from commit d154ca60036f060375ff3d80b2f1fbd2cd7de115)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1b923bbd8caaf411c502e7c9a1da0ed27bd50057

Change-Id: I93e96c8d5585fa30b841805e8f470669fa3c03e5
2020-03-06 18:18:20 +08:00
Michal Simek c04fe8bf81 UPSTREAM: image: fit: Show firmware configuration property if present
SPL ATF support requires to have firmware property which should be also
listed by mkimage -l when images is created.

The patch is also using this macro in spl_fit to match keyword.

When image is created:
 Default Configuration: 'config'
 Configuration 0 (config)
  Description:  ATF with full u-boot
  Kernel:       unavailable
  Firmware:     atf
  FDT:          dtb

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
(cherry picked from commit 1f8e4bf55eb58bda715c1f8c8777081580f3246b)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6ddc0d39005e4d30fd03ff7d45d57b152377f2ba

Change-Id: I9ea4500329fc1f835860f204472ab8fb76f3e1bb
2020-03-06 18:18:20 +08:00
Jun Nie 0833bf5e4e UPSTREAM: SPL: Add signature verification when loading image
U-boot proper signature is not verified by SPL on most platforms
even config SPL_FIT_SIGNATURE is enabled. Only fsl-layerscape
platform support secure boot in platform specific code. So
verified boot cannot be achieved if u-boot proper is loaded by
SPL.

This patch add signature verification to u-boot proper images
when loading FIT image in SPL. It is tested on Allwinner bananapi
zero board with H2+ SoC.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
(cherry picked from commit 5c643db4cc95c6ac6457731cb5bb75d6896e415b)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8de83a4fd31ccdb2429e1eadec31b60642687149

Change-Id: Ie1933cbbea0f5f9a68512ad3d43244e55a387d55
2020-03-06 18:18:20 +08:00
Peng Fan b86dc4195f UPSTREAM: SPL: Add FIT data-position property support
For external data, FIT has a optional property "data-position" which
can set the external data to a fixed offset to FIT beginning.
Add the support for this property in SPL FIT.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: "Andrew F. Davis" <afd@ti.com>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: "tomas.melin@vaisala.com" <tomas.melin@vaisala.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: "Cooper Jr., Franklin" <fcooper@ti.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Rick Altherr <raltherr@google.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: York Sun <york.sun@nxp.com>
(cherry picked from commit a1be94b65410c7ebba5e7695478b6623579b410c)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1cdcfe0358e5a39fed3dfcf0554a7ba0e16729b8

Change-Id: I44c3454addd85d70e6fba8e26b66a0278c5c1081
2020-03-06 18:18:20 +08:00
Joseph Chen d3a605e34d common: image: support reloc image at the given address
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia15f4dfa96602554f5c293dbf383f84a83a05950
2020-02-28 12:38:42 +08:00
Joseph Chen 277a68daf9 common: bootm: add bootm_board_start()
There maybe some board routine before bootm common
flow. The board can override this __weak function.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6660f4ef27f3889d2dbc29594ad164a12ec6c934
2020-02-28 11:37:15 +08:00
Joseph Chen 998aeb5fa7 common: bootm: add board_do_bootm()
There maybe some board routine before do_bootm_states().
The board can override this __weak function.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iab6a6742a02dae681e4d3221dc7cfffd2c3df98c
2020-02-28 11:37:15 +08:00
Joseph Chen ac459efd10 common: fit: add entry and load address set api
Add FIT_MULTI_PROP definition.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5e98601799de88843f8110f118640339079905a5
2020-02-28 11:37:14 +08:00
Joseph Chen 01918c3fa9 common: android: update image end get for android v2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4b2cddec072657d69b294dbddf300cf4d0471695
2020-02-28 11:37:14 +08:00
Joseph Chen c01d448924 sysmem: simplify the memblk name
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Icfe908ade21d1d8f568db796298f67ba9f013da6
2020-02-28 11:22:04 +08:00
Joseph Chen 98de7945ac common: bootm: improve decompess image message
Make it more meaningful.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie26745d6c007cc1bae91ebf2fad88feb1742e8bb
2020-02-28 11:20:58 +08:00
Joseph Chen ea8a3d10b6 common: board_f: save U-Boot fdt blob
Saving it for late use, eg: fit verified boot process.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6643fb643f2fd88795d80fc5bd21025b62dc6943
2020-02-28 11:17:03 +08:00
Joseph Chen fc722856eb common: board_r: add minimum nowhere env for board init.
Storage env or kernel dtb load depends on bootdev, while bootdev
depends on env varname: devtype, devnum and rkimg_bootdev, etc.
So we have to use nowhere env firstly and cover the storage env
after it is loaded.

Providing a minimum and necessary nowhere env for board init to
avoid covering the other varnames in storage env.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8362c24376e7530f15335f26197a7cddbcae579c
2020-02-25 14:18:15 +08:00