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
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
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
Saving it for late use, eg: fit verified boot process.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6643fb643f2fd88795d80fc5bd21025b62dc6943
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
Load kernel through android format, then jump to kernel through ATF.
Change-Id: Idc77461bae0e4300c146c68f6a7e4e157c29db7f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
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
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
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
It seems the U-Boot proper fit code misses this.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1e5255e20f4f309c083e601e6c2d0e37869bac20
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)
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)
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)
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)
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)
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)
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)
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)
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
Unify single image load/memcpy to image_read(), containing
sha1 update.
Not support verify image by RK legacy mkbootimg tools.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ide88d2dda79f3335a6c34e41bdce56eac0d66408
Since this feature is stable and helpful to save boot time,
let't make it mandory.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I36f244c6d319d6b54ed3d54730352c8d5b4cc6bd
Need to pass androidboot.force_normal_boot=1 instead of
skip_initramfs when A/B supporting dynamic partition.
Change-Id: I1748690d04d4ef16e121d8dc88f69745a3cbb77d
Signed-off-by: Dayao Ji <jdy@rock-chips.com>
Rockchip platforms defines BCB message at the 16KB offset of
misc partition while the Google defines it at 0x0 offset.
From Android-Q, the 0x0 offset is mandary on Google VTS, so this
patch is a compatibility according to android image 'os_version'.
Android os version >= 10 is at 0x0 offset, otherwise at 16KB offset.
Change-Id: I54a7674e2dc2e0c29fc624f17b4453663c9ea462
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Rockchip platforms defines BCB message at the 16KB offset of
misc partition while the Google defines it at 0x0 offset.
From Android-Q, the 0x0 offset is mandary on Google VTS.
Change-Id: Iac36d421ed605684353c30bfe0e9982bdd5de065
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This issue happens on the SDK version < 8.1. The reason is we don't
read enough blocks from storage for kernel compressed type validation.
ANDROID_ROCKCHIP_LEGACY_PAGE_SIZE(16KB) is defined by rockchip legacy
mkboot tool(SDK version < 8.1) and larger than Google defined.
To compatible this, we malloc enough buffer but only read android
header and kernel image(1 block) from storage.
Change-Id: I9800e4150985adcd5dbd78c28c471604eb403eae
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The mode AVB_HASHTREE_ERROR_MODE_RESTART_AND_INVALIDATE will add
"androidboot.vbmeta.invalidate_on_error=yes" to cmdline, and kernel
will invalidate vbmeta if verified fail. This will modify the vbmeta.img
head and make uboot verify vbmeta.img fail in avb system. And in avb & ab
system, we can use the retry-count to change slot if verify fail without
modify the vbmeta. So just use the mode AVB_HASHTREE_ERROR_MODE_RESTART.
Change-Id: I98d60683d5365b996fcca2e85d4847d4a6df2ef6
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
- the partition disk layer takes over the responsibility of slot suffix
appending, we remove relative code to make file clean;
- put android a/b code together and name them to be eary understood,
this makes file esay to read.
Change-Id: Id8c838da682ce6098bd7192d7d7c64269f4e86ba
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
- The U-disk boot is only supported from U-Boot, the earlier preloader
doesn't support it;
- MMC1(SD) has higher priority than U-disk;
- Always boot into recovery mode and deliver "usbfwupdate" to cmdline;
- Usb driver may depend on clock/regulator init, so behind of them;
- Suggest to add ./dts/kern.dtb file to promise the kernel dtb always
to be loaded successfully even the native images are all damaged.
Change-Id: Ibbb2a061a727752277ac1b80abf362de5d94cca2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>