Commit Graph

4871 Commits

Author SHA1 Message Date
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
Jason Zhu 2241fc0f8b common: spl: rkfw: support resource file in spl
Change-Id: I14d0afd6131cd523cd0218bb727b9a3b48397943
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 17:27:50 +08:00
Jason Zhu 189f3a8c31 spl: atf: pass kernel parameters through bl33_ep_info->args
Pass when enable CONFIG_SPL_KERNEL_BOOT.

Change-Id: Iee442466df59eeaa0f477f264f523b026e516168
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 16:35:12 +08:00
Jason Zhu e3460df72d common: spl: rkfw: support boot kernel in spl
Load kernel through android format, then jump to kernel through ATF.

Change-Id: Idc77461bae0e4300c146c68f6a7e4e157c29db7f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Jason Zhu dd04b7cb10 spl: add SPL_KERNEL_BOOT
Change-Id: I6460bf6fa4535c60d956bba6c3c2f00b6b61bf45
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Jason Zhu 49f617a949 spl: support SPL_KERNEL_ADDR & SPL_FDT_ADDR & SPL_RAMDISK_ADDR
Change-Id: I9c8d4ba9118c7c22504753a3c9de33706bea04fd
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Joseph Chen 1481bafe9d common: spl: enable D-cache by default to improve performance
Set CONFIG_SPL_SYS_MALLOC_F_LEN enough to promise the tlb buffer
can be malloc, actually this is a way to compatible all the current
boards without adding a new configure option.

I-cache has been setup at early assembly code by default.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I7e973299eddc358cd4c15846c5de154050bf9547
2020-02-20 17:14:04 +08:00
Joseph Chen aa1eec08bb rockchip: make boot_rkimg.c as basic mandory code
boot_rkimg.c is the basic code for rockchip platforms, such as
get boot devtype, setup download mode and get kernel dtb, etc.

CONFIG_RKIMG_BOOTLOADER actually makes no sense for rockchip
features any more, but we still leave it to compatile code
compilation since there is a lot of code depends on it. but it
maybe dropped in the future.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iab922cbf3a70e7eb1444678d6e902b9d8e106dd1
2020-02-19 13:21:10 +08:00
Joseph Chen 0f0484481c common: image-fdt: skip image_check_type() for fdt
default image mkimage conflicts with fit mkimage on param: -T "flat_dt"
and failed to build fdt uImage.

error message:
"./tools/mkimage: Can't set header for FIT Image support: Success"

It's fine to drop that since the fdt_check_header() follows it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I50554765bac7cc75df7ab5920e94cafe78d14bdc
2020-01-16 11:50:49 +08:00
Joseph Chen 5b8e7bf473 common: image-fit: support "data-offset" and "data-size"
It seems the U-Boot proper fit code misses this.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1e5255e20f4f309c083e601e6c2d0e37869bac20
2020-01-16 11:50:49 +08:00
Joseph Chen d04ada6cfd rockchip: clean boot_mode.c and boot_rkimg.c
Clean the code into where it belongs to.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia034b8c3d8b264796db72c7bf44bab95811ecb77
2020-01-09 14:27:25 +08:00
Joseph Chen e72b912575 common: rkimg: move rkimg boot code into bootrkp.c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I362e5ab0e1aee8b9126d51358ea1300d60d0a706
2020-01-09 14:17:53 +08:00
Michal Suchanek 92937b1f66 UPSTREAM: usb: Add nonblock argument to submit_int_msg
This will be used to implement non-blocking keyboard polling in case of
errors.

Conflicts:
	common/usb.c
	common/usb_kbd.c
	common/usb_storage.c
	include/usb.h

Change-Id: I4a951d779e2cf9e80380f93000a87a617453fb32
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 3437121c037f502a3b0faaec97059777034a1ead)
2020-01-07 17:25:00 +08:00
Frieder Schrempf e7093b518a UPSTREAM: usb: gadget: f_sdp: Allow SPL to load and boot FIT via SDP
Add support for loading u-boot FIT images over the USB SDP protocol in
the SPL

Change-Id: I41461b58c088a10eca6e48b0d49c76944c37c3fa
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
[Various build fixes]
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Tested-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 2c72ead7387404eba16c556d2f204c52c36c27f9)
2020-01-07 17:24:58 +08:00
Andrew F. Davis 09b32b41f2 UPSTREAM: spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU
The symbol CONFIG_SPL_DFU_SUPPORT in SPL build has the same
meaning as CONFIG_DFU in regular U-Boot. Drop the _SUPPORT
to allow for cleaner use in code.

Conflicts:
	arch/arm/mach-zynqmp/spl.c
	common/Makefile
	common/spl/Kconfig
	common/spl/spl_ram.c

Change-Id: I93f09d5953284d511df135e6e71c03c0552719a2
Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Lukasz Majewski <lukma@denx.de>
(cherry picked from commit 6536ca4d6676bf38e50784298e713edc30b9cde9)
2020-01-07 17:24:56 +08:00
Jean-Jacques Hiblot eccca8a35d UPSTREAM: Kconfig: rename CONFIG_SPL_USB_GADGET as CONFIG_SPL_USB_GADGET
The SPL option for USB gadget should be named after the option for u-boot
(CONFIG_USB_GADGET)

Conflicts:
	arch/arm/mach-imx/mx6/Kconfig
	arch/arm/mach-imx/spl.c
	configs/am335x_boneblack_vboot_defconfig
	configs/am335x_evm_usbspl_defconfig
	configs/am43xx_evm_defconfig
	configs/am43xx_hs_evm_defconfig
	configs/imx6q_logic_defconfig
	configs/mx6memcal_defconfig
	configs/mx6sabresd_defconfig
	configs/pico-hobbit-imx6ul_defconfig
	configs/pico-hobbit-imx7d_defconfig
	configs/pico-imx6ul_defconfig
	configs/pico-imx7d_defconfig
	configs/pico-pi-imx6ul_defconfig
	configs/pico-pi-imx7d_defconfig
	drivers/Makefile

Change-Id: I51305422f13cb7d743274f82c531000c0f93c144
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit f811e9763f4b6f6f5e3fe9c2fa30d2b6c62d289e)
2020-01-07 17:24:55 +08:00
Jean-Jacques Hiblot b95d44460f UPSTREAM: usb: gadget: Do not call board_usb_xxx() directly in USB gadget drivers
Add 2 functions to wrap the calls to board_usb_init() and
board_usb_cleanup().
This is a preparatory work for DM support for UDC drivers (DM_USB_GADGET).

Conflicts:
	cmd/fastboot.c
	cmd/rockusb.c
	cmd/usb_mass_storage.c

Change-Id: I2b3a567d9dff75a03176d76d9fd9775cd8a0792e
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit a06955ae1ef2a942f18025d4fefceea2c638a76f)
2020-01-07 17:24:53 +08:00
Sven Schwermer 3739bf7e20 UPSTREAM: usb: s/CONFIG_DM_USB/CONFIG_IS_ENABLED(DM_USB)/
This allows to disable the USB driver model in SPL because it checks
the CONFIG_SPL_DM_USB variable for SPL builds. Nothing changes for
regular non-SPL builds.

Conflicts:
	drivers/usb/host/ehci-atmel.c
	drivers/usb/host/xhci-fsl.c

Change-Id: If6c980c620cf97c1dd131f60953c305e34dba505
Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit fd09c205fc57b90a782cac33449ef172575d0a8c)
2020-01-07 17:24:53 +08:00
Andre Heider 8e33586e7c UPSTREAM: usb: gadget: sdp: add missing line breaks
Cosmetic change.

Change-Id: Ia6606d3e491c3032882476f00d4e306c30da8953
Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 24ccd0c8fd6285636edb94d0ece2cbcf062d64eb)
2020-01-07 17:24:47 +08:00
Sven Schwermer c8f2d7ee94 UPSTREAM: usb: Remove CMD_USB dependency for common code
Common USB code is built whenever USB is enabled (in non-SPL builds).
The USB uclass is built whenever (SPL_)DM_USB is enabled. Both need to
be independent from CMD_USB.

Change-Id: Idb5e7ffeea8cb325855cb2d1b6713d62fe438120
Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit ab5817027f9b4fce25f5f2a3e20577ac55bbd7e0)
2020-01-07 17:24:44 +08:00
Joseph Chen b6b05c7154 common: android: skip blk read and memcpy if image size is 0
blk_read() may return error code if image size is 0, it depends
on block layer implementation.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I29bab10835e9029780a957e871a600a6fbdf6068
2019-12-20 10:53:44 +08:00