Commit Graph

643 Commits

Author SHA1 Message Date
Jason Zhu 656558394a cmd: bootfit: add slot info to bootargs
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Iac5eb54568c03239183425ef8ac9c51f7d774cd6
2020-10-23 14:17:29 +08:00
Joseph Chen c42dfcf531 cmd: boot fit: support a/b system
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I37452ec5ce107f864594c94411dc59a422c7cf47
2020-10-22 19:38:57 +08:00
Joseph Chen 745aeb1a7d common: android: add boot_img_hdr_v3 and vendor boot support
Android Header v3 and vendor boot partition are introduced
from Android-11(R).

Header populate:
  Header v3 is no longer compatible with v0/1/2 header, we
  add populate_andr_img_hdr() to merge boot and vendor_boot
  partition header into struct andr_img_hdr in order to
  compatible with v0/1/2 header.

resource.img:
  The second_addr and second_size fields are removed in v3,
  so we require resource partition to restore resource.img.

A/B system:
  If not A/B system, the boot.img header version is 3 and
  recovery header is version 2.

AVB load image:
  - If allow verification error: the image is loaded by
    ops->get_preloaded_partition() which auto populates
    boot_img_hdr_v3.
  - If not allow verification error: the image is full loaded
    by ops->read_from_partition() which doesn't populate
    boot_img_hdr_v3, we need to fix it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2afce53c43d782fc57baa01acf9c05518b580840
2020-09-18 14:41:37 +08:00
Jon Lin 177c873697 cmd: rockusb: Add block continue write flag
1.It's good for Nand devices P/E align
2.But actually 0x200 sector(USB limit) is aligned with Nand flash block size

Change-Id: I69510161c32e15ee739c99d36f0294d59df554dd
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-08 17:51:23 +08:00
Lin Jinhan cd694b63d4 cmd: crypto: drop RSA test when rsa driver not compiled
Change-Id: Iad42b1f35e3029a97158a1b16e7ca86f3c6e4b5f
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-07-23 10:04:14 +08:00
Joseph Chen b704ab33c2 cmd: add "always" attribute for some commands
They are basic commands even in critical cost down version

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0ad56056133226c25cbcfb70e54d519eb7582341
2020-06-17 15:21:41 +08:00
Alex Marginean 8a2d844d7d UPSTREAM: net: introduce MDIO DM class for MDIO devices
Adds UCLASS_MDIO DM class supporting MDIO buses that are probed as
stand-alone devices.  Useful in particular for systems that support
DM_ETH and have a stand-alone MDIO hardware block shared by multiple
Ethernet interfaces.

Signed-off-by: Alex Marginean <alexm.osslist@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I8e106f4360aa46289e0ed551f8f685cad9dc6269
2020-06-02 16:10:47 +08:00
Joseph Chen 11a331d232 cmd: source: update terminal value
According to commit:
(40d08d0 tools: mkimage: support pack empty file for multi image)

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie370e9137b7441bd75582c95b3f60d76d8945629
2020-06-02 16:04:50 +08:00
Joseph Chen f6aff21fa1 cmd: rockusb: import U_BOOT_CMD_ALWAYS
rockusb command is required for usbplug feature in the furture.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9998ba07e2f7faddae6a830987bea2d6018f431a
2020-05-22 16:46:40 +08:00
Joseph Chen 3d8049ad2f common: add U_BOOT_CMD_ALWAYS() support
This function is used to support some special U-Boot commands with
U_BOOT_CMD_ALWAYS() declared even when CONFIG_CMDLINE is disabled.

It's used when developers requires a critial u-boot.bin by disabling
the U_BOOT_CMD() and using a simple CLI instead.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I768637592a4d85c7fea00564e96fb80f21ab65fe
2020-05-22 16:46:40 +08:00
Joseph Chen a1daefc8e6 rockchip: fit: refactor code
- update coding style;
- verify dtb or resource signature before use.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iff763d5ab9e9f3b5e4ef5cc59065cd1ad782fcf0
2020-05-14 09:25:40 +08:00
Joseph Chen 90b678f6a0 cmd: charge: clean code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ief810522d1bd55eccce6d096d3a945fac61fa00a
2020-04-21 16:19:25 +08:00
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
Joseph Chen 36c668870e cmd: bootuimage: update return code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9bd10b448b409fe9e74c7b4c56f5ec7ec3cd4a85
2020-04-10 10:22:08 +08:00
Joseph Chen b72261dd0f cmd: bootfit: update return code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Icaa55c9a7be873d413e91d742bbedecb707447a1
2020-04-10 10:22:08 +08:00
Lin Jinhan 80ca1a53eb cmd: crypto: add hash performance evaluate
Change-Id: I493ff0bf3a08e24f427b89d21ea7e6e8731f2e9f
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-03-30 19:10:13 +08:00
Joseph Chen bfbe87590f cmd: bootuimage: return -1 as error code
support autoboot to traverse all bootcmd list.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I03f10a5982c4a9bb0eee429f756dd19c027c3371
2020-03-28 18:25:32 +08:00
Joseph Chen e2c45c31e9 cmd: bootfit: return -1 as error code
support autoboot to traverse all bootcmd list.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ibb35c20fb9ffcf58130aaeaea072c2dd6bc46256
2020-03-28 18:25:32 +08:00
Joseph Chen a86a723e2e rockchip: uimage: fix alloc and free ramdisk sysmem
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I84d965caff7c0d733792bcf2387d751808991c0d
2020-03-27 16:12:20 +08:00
Joseph Chen 909b972800 cmd: net: support tftp/tftpbootm/tftpflash commands
- tftp: download image.
- tftpbootm: download and bootm the aosp/uImage/FIT Image.
- tftpflash: download and flash the Image to partition.

rename "tftpboot" to "tftp" since there are so many tftpxxx commands,
the "tftp" cmd can't be recoganize as "tftpboot" by CLI shell.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0128cd41a8fc9105016ae0417241348eb4a6f637
2020-03-19 09:58:11 +08:00
Joseph Chen a4696473d2 cmd: bootrkp: simplify fdt/ramdisk skip reloc
bootm_board_start() takes over it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie1df21ee3ff929a5fa7163216d90315277f6cfd5
2020-03-19 09:54:27 +08:00
Joseph Chen e39c2b5d45 cmd: add "boot_uimage" command for legacy uImage
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie7b55ff4f63957312895c0f57fd405d3389f2ad7
2020-03-19 09:54:27 +08:00
Joseph Chen 72c88b4aea cmd: add "boot_fit" command for FIT image
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I09f936cf5cefb0b9f2334a6590b5dfb4d85151a3
2020-03-19 09:54:27 +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 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 408bf4b932 cmd_source: fix compile error
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4c532326f70bcda71543f6768d3ca136bb7c7d0b
2020-01-16 11:10:58 +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
Joseph Chen 73ec4e0398 cmd: move "rkimgtest" to individual file
The command is used for all image type, it should not depend on bootrkp.c

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8d27318485c7e7ffb8c4e06112396fa18e8b2dc0
2020-01-08 18:04:09 +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
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
Rob Clark 2f0750eb18 UPSTREAM: efi_loader: refactor boot device and loaded_image handling
Get rid of the hacky fake boot-device and duplicate device-path
constructing (which needs to match what efi_disk and efi_net do).
Instead convert over to use efi_device_path helpers to construct
device-paths, and use that to look up the actual boot device.

Also, extract out a helper to plug things in properly to the
loaded_image.  In a following patch we'll want to re-use this in
efi_load_image() to handle the case of loading an image from a
file_path.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit 95c5553ea268144056c4bafc318b9e8b5c096a6c)

Change-Id: Iaa6a9865f2cbd15d6537d200bd86662fa4baf5a0
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2020-01-06 11:45:12 +08:00
Lin Jinhan 8609b717aa cmd: crypto: unifiy hash output variable
rk1808 is not support SHA512.

Change-Id: Ica8c1a04553e862915417c36db6362df049e002e
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-12-10 08:39:32 +08:00
Joseph Chen 2eb7260f2e cmd: fdt: use gd->fdt_blob as default fdt address
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I16a413bcbca17842cd560367ebae6454a63354f2
2019-12-03 20:23:51 +08:00
Joseph Chen 27d36fbda0 cmd: crypto: make foo_data[] cacheline aligned
Crypto-v1 needs flush_dcache() for SHA, this avoids the warning
message "CACHE: Misaligned operation at range ...".

Change-Id: Ie766af60db83ec1f290103c2059863fa50d0a0ad
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-27 11:13:54 +08:00
Joseph Chen f501ba4438 cmd: boot: add mode args for "reset"
- Add "reboot" command as alias of "reset";
- Support command like: reboot loader/bootloader/recovery, etc.

Change-Id: I9748664aeca052a775a3f88f7fdf9b3923941026
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-12 19:34:04 +08:00
Joseph Chen c6666740ee common: android/rkimg: remove/clean android a/b (slot) code
- 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>
2019-11-04 15:43:46 +08:00
Joseph Chen 0ed06f16e2 rockchip: support boot from U-disk
- 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>
2019-11-04 14:53:45 +08:00
Joseph Chen f988e29580 cmd: nvedit: add "env update ..." sub command
It supports to add/append/replace variable(s).

Change-Id: I1219e67e3dc778a634689516503e311d0577f35d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-24 09:12:10 +08:00
Joseph Chen 535b44c04d cmd: rockusb: forbid to flash mmc 1(sdcard)
Change-Id: I186bfe127e6146aab1df52f8bafb20da9d1647d2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-16 10:01:39 +08:00
Lin Jinhan c9d107b5b9 dm: crypto: add TRNG test
Change-Id: Id88d07ff36d20fa19e4be969673f88384f2f658e
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-10-14 20:57:26 +08:00
Joseph Chen 35ca3e037c cmd: bootrkp: fix always detect sdcard successfully
fixes:(1476830 cmd: bootrkp: clean up code)

Change-Id: I437174085875b70bd72768f900b7c64c33163822
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-14 20:45:38 +08:00
YouMin Chen e1f97ec39a driver: ram: rockchip: rename sdram_common.* to sdram.*
Change-Id: Idc6edee2906297d3ab681a36dc58c79283c0eb57
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2019-10-09 18:10:19 +08:00
Jason Zhu df57b34bfa fastboot: remove 'default y' from RK_AVB_LIBAVB_ENABLE_ATH_UNLOCK
Open RK_AVB_LIBAVB_ENABLE_ATH_UNLOCK if need advanced security requirements.

Change-Id: Ie01c6342d379b672fe69e367262496d97b5890e9
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-09-20 11:17:38 +08:00
Joseph Chen df3ff3726e cmd: android: round up image header size
Change-Id: I79e1b31ae2d018c0a8da030482f2ac0be44cb177
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-09-03 08:53:08 +08:00
Jason Zhu 2b4182c1ed cmd: rk_secure_storage: dump data which is written in OTP or efuse
Change-Id: I644add22f3aaed546d727de7727d3230ae1a6c01
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-21 12:58:49 +08:00
zain wang d38ae1a6d6 fastboot: export CONFIG_RK_AVB_LIBAVB_ENABLE_ATH_UNLOCK
Relate to commit 46a8a26905
("fastboot: add RK_AVB_LIBAVB_ENABLE_ATH_UNLOCK config")
Export config can help us select it easily.

Change-Id: I43a210f1efb35ff679102c8686cbca219d2def97
Signed-off-by: zain wang <wzz@rock-chips.com>
2019-08-20 11:00:56 +08:00
Jon Lin c4d5fc6337 cmd: mtd: fix compiler error
Change-Id: Idc4bcd902c02b5dbd6f5aac631f3977f257f606f
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-08-07 17:37:14 +08:00
Jon Lin b99d850cbd Revert "cmd: mtd: Use the subcmd infrastructure to declare mtd sub-commands"
This reverts commit 9671243e8d10defb06f2ea24fac138c87697d7fc.

Change-Id: Ie34f9feb06aa0525c9fa59d79ecf687a9a572491
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-08-07 17:37:09 +08:00
Jon Lin b62a0f65a9 Revert "cmd: mtd: fix compilation warning for help when SYS_LONGHELP=n"
This reverts commit a645831ca0962532660e4db3155a8be85e5ca312.

Change-Id: Ida32a1a893b88503cffe432705d5d02921dfab09
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-08-07 17:37:05 +08:00
Lin Jinhan e7b6c6a93f dm: crypto: add SHA512 test
Change-Id: If7bb7bb559a9d4d5e70e1f27eabb8995c85872d9
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-08-05 17:51:21 +08:00