Commit Graph

46286 Commits

Author SHA1 Message Date
Andy Ye 4d0fc66534 fastboot:support attestation commands
Change-Id: I984a107270991a9e9d60e907b9be4e0d0d462671
Signed-off-by: Andy Ye <andy.ye@rock-chips.com>
2017-11-20 10:32:55 +08:00
Shunqing Chen 6e7a7f7010 rockchip: rk3229: gva: add cw201x support.
Change-Id: Ic2717c89949d0361f4720dbcdc0fd6e6f098d078
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2017-11-20 10:32:54 +08:00
Shunqing Chen 384c6d153d fuel gauge: add cw201x support.
The CW2013 is a system-side used Fuel Gauging.

Change-Id: Iac7c2d72bef36710a3e8966f2e58741d2ec421d9
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2017-11-20 10:32:54 +08:00
Andy Ye 4aa617558f lib: optee_client: add attestation protocol support using optee
support attestation commands:
at-attest-dh,at-attest-uuid,at-get-ca-request,at-set-ca-request

Change-Id: I3fe94befa57a131e89dbe136c065a948b1631756
Signed-off-by: Andy Ye <andy.ye@rock-chips.com>
2017-11-20 10:32:54 +08:00
Weiwen Chen 90e877b59c android: load fdt from the oem partition
The fdt must be named of "kernel.dtb", and it's saved
in the root dir of the oem partition.

Change-Id: I70dc9cbbc295f23b08bf122df3b29bba7dacb82f
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
2017-11-20 10:32:54 +08:00
Weiwen Chen 8ce4d2843d android: add api for loading fdt
If user get the kernel fdt into the independent partition
which is the ext4 filesystem, we can use this api to load
fdt.

Change-Id: I4fa494beffecb41e8c0e4c02f1e782d0291e2d05
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
2017-11-20 10:32:54 +08:00
Jason Zhu bf17c6275d androidboot: boot the system without a/b avb
Support boot the system in the old mode, and there
is no need to differentiate the _a or _b slot
in the gpt table.

Change-Id: I162e34a9bd0120db051f709faec06daf3bc0aa9c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:32:54 +08:00
Jason Zhu b3b934b636 android: boot the system without a/b and avb
Change-Id: I9a6da661c9cf17e2e3190b55f18acd600f9b63f1
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:32:54 +08:00
Jason Zhu 9aed1a1336 androidboot: add some new info to cmdline
The android things system need some avb info
in the stage of u-boot, like VBH value and so
on.

Change-Id: Ia102931f3b0c912c7e1f34f668d8af0b45fa4a6e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:32:54 +08:00
Cody Xie 54fcf04fb5 gva_rk3229: Update README document.
Change-Id: I423d625f4f92e4762a32162772f3858f8069723a
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:32:34 +08:00
Francis Fan 00412ace71 gva_rk3229: add serialno init
Change-Id: I6fc41b5480adfbd8456032e844d4f22f30c413a5
Signed-off-by: Francis Fan <francis.fan@rock-chips.com>
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:29:58 +08:00
Cody Xie c9d8141cc6 gva_rk3229: Modify to bringup Android Things.
Change-Id: Ie13341380f3526478ca35643e52ebbee741f9269
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:29:57 +08:00
Francis Fan f795db4fde rockchip: rk3229: set CONFIG_ROCKCHIP_VENDOR_PARTITION to enable vendor api
Change-Id: I51fb6f6c66bf4e2ebb24a833184f336be640cf57
Signed-off-by: Francis Fan <francis.fan@rock-chips.com>
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:29:57 +08:00
Francis Fan 991297a54a rockchip: rk3229: set CONFIG_ROCKCHIP_BLOCK_API to enable block api
Change-Id: I16d20e39df54441739ee59084f737b44a3d6caf0
Signed-off-by: Francis Fan <francis.fan@rock-chips.com>
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:29:57 +08:00
Jason Zhu ceecd5fea6 lib: avb: support the atx and public_key verify
1.support the permanent attribute verify
2.support the PRK, PIK, PSK certificate verify
and then get the psk public_key, compare it with
public_key in vbmeta.

If the function is required, please open the macro
AVB_VBMETA_PUBLIC_KEY_VALIDATE.

Change-Id: Ifeab776c76f97fadd980671481ce27d203516673
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:29:57 +08:00
Jason Zhu 0916e43b54 fastboot: support fuse at-perm-attr writting efuse
In the android things system, the command of fuse at-perm-attr
is used to program the permanent attributes and its hash.The
permanent attributes is written in eMMC RPMB, and its hash is
writen in efuse.

Change-Id: Ib0745100063d18b56e2dfcb638e0c9f7e2ef9b0a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:29:57 +08:00
Jason Zhu fd717dcefe lib: avb: support write efuse
Write the permanent attributes hash to efuse.

Change-Id: Id11586a66f055e7eb1a66997814f351509d49b21
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:29:57 +08:00
Weiwen Chen 7b960a8a90 fastboot: mmc: add actual disk size to response
If GPT buf is invalid, it will send actual disk size
back. We can use this actual disk size to build correct
GPT partition.

Change-Id: Ia54112951b7b8daa6afe369bc16a037cdbe8db39
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
2017-11-20 10:29:57 +08:00
Weiwen Chen 271551c99a part: efi: add check gpt alternate_lba attribute
Change-Id: I00b4dc9fe0c75ed57110682a3dc0b3fbaa3cbcc7
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
2017-11-20 10:29:57 +08:00
Francis Fan 5d3e294359 rockchip: dts: rk322x: add efuse device node
Change-Id: I7054a931a4cf742bd23e89477324b1eb1d953b8f
Signed-off-by: Francis Fan <francis.fan@rock-chips.com>
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:29:56 +08:00
Cody Xie 1df1c8728f gva-rk3229: Enable rockchip efuse driver.
Change-Id: Icc10ec157c9c86ecb909d71766f0d16ae920b451
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:29:56 +08:00
Francis Fan b4fa32f0b6 rockchip: efuse: Support rk322x non-secure efuse.
Change-Id: Ia25df975d21d7c97cf090f0d374074c2c5cd1a58
Signed-off-by: Francis Fan <francis.fan@rock-chips.com>
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:29:56 +08:00
Francis Fan cd99aa8213 rockchip: rk322x: add PCLK_EFUSE_256 for dts file
Change-Id: I46c4f0f80b54a72acdba107ea290a45c231c3dda
Signed-off-by: Francis Fan <francis.fan@rock-chips.com>
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:29:56 +08:00
Cody Xie 24b70d1ee0 gva-rk3229: Enable vendor storage related api.
Change-Id: Iffb5761f2203592f9151c9c58d91e2678d9a781e
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:29:56 +08:00
Cody Xie 263629555d rockchip: bootmode: Init mmc device for fastboot mode.
This fixes issue that fastboot command failed with
"MMC device -1 not found"

Change-Id: Ifb136874aaf10dff3d3dc02043225407441085ca
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:26:13 +08:00
Jason Zhu e291f58fb4 lib: avb: modify load boot partition size
Load the boot image real size other than the
boot partition size. If not, the uboot can not
malloc a big buffer for the all boot partition.

Change-Id: Ifc8d7cc1f214b94f6018c68cb03e8e9ce89781de
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:26:13 +08:00
Cody Xie d7c30fe9d6 gva_rk3229: Add preboot commands.
1. Select eMMC as default device.
2. Enter fastboot mode if no partition table exists.

Change-Id: I4416076353f6d9dc8365153c1edec1924754b072
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:26:13 +08:00
Cody Xie d816b9732f evb_rk3229: Add preboot commands.
1. Select eMMC as default device.
2. Enter fastboot mode if no partition table exists.

Change-Id: Iebdf94c94605bd1165155bc7de027f364324cb19
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:26:13 +08:00
Cody Xie 0e3d235ecd androidboot: Pass "androidboot.serialno" to kernel cmdline.
Change-Id: Ia0b693f2652ab35b2e29b1c23335f962b3943050
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:26:12 +08:00
Cody Xie 374a999563 fastboot: usb: Add fastboot cmds to pass bootloadertest.
TEST:
python system/extra/tests/bootloader/bootloader.py --device-type iot

TODO:
"fastboot getvar all" is still NOT implemnted.
Functions should be implemented with actual state.

Change-Id: Ic757694622a5038a9766cedfde26c22935446347
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:26:12 +08:00
Frank Wang 8ddd5824c5 usb: gadget: add bos descriptor response for rockusb command
Rockchip upgrade tool use bcdUSB (0x0201) field distinguishing maskrom
or loader device at present. Unfortunately, it conflict with Windows 8
and beyond which request BOS descriptor in this case that bcdUSB is set
to 0x0201. This patch adds the HACK codes to fix it.

Change-Id: I6a186139f79ba27f5d9e099493e9e742a29bbe40
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-11-16 11:35:33 +08:00
Frank Wang ba437c8c98 usb: gadget: force rockchip vid and pid for rockusb
This change amend USB VID & PID to Rockchip for rockusb.

Change-Id: I3c94e442cc0190d2d3f13424470dd2d84af55eb0
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-11-14 12:43:08 +08:00
Frank Wang dd31eefe79 cmd: rockusb: fix upgrade failed when gpt partitions exist
We found rockusb upgraded failed when there had gpt partitions in
system caused by total sectors checking, this change expose all mmc
partitions for rockusb command.

Change-Id: I8847c3c7885d17d47189c55765f97abb4965e8b4
Reported-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-11-14 11:12:42 +08:00
Kever Yang b4a5485919 rockchip: rk3229: add gva som board support
gva-rk3229 is a som based board design for Android Things project.

Change-Id: I2e054407231a2549573d2302855c09b9795fdddd
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-11-14 11:11:45 +08:00
Kever Yang a2be733b20 rockchip: evb-rk3399: update defconfig after rebase
Change-Id: I81018850cc6612d2252558db53f864651c6f73d6
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-11-14 10:55:57 +08:00
Kever Yang bcf2399d4d rockchip: evb-rk3229: update defconfig after rebase
update defconfig after rebase from next-dev, mostly:
- add boot_android, avb

Change-Id: I44807f7ad51656fd350b5fe558ac47884c022934
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-11-14 10:55:57 +08:00
Kever Yang 89e3937034 rockchip: boot_mode: add rocovery mode
Add recovery mode as one of reboot mode.

Change-Id: I7288e8cc31eee213766dad45ed717aa16985abd5
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-11-14 10:55:57 +08:00
Wenping Zhang 9f7ea89d5d androidboot: add BOOT_RECOVERY support
if user input "reboot recovery" by adb or serial console,
uboot will load recovery ramfs image to run.

Change-Id: Ibad1709ed78938dbf1826446a0de5c822c6ce4e4
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
split boot_android and boot_mode int two commits.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-11-14 10:55:57 +08:00
Kever Yang 3f55bd17ec rockchip: bootmode: adapt fastboot cmd to google code
Google change the fastboot cmd, update it.

Change-Id: I50f03f8d4f2ba5679920553a055b24ecc0ba92b0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-11-14 10:55:57 +08:00
Jason Zhu 8fafb73c37 rockchip: rk322x: reserve memory for trsut TA
U-boot must reserve memory for trsut TA if
android system can call trust TA for security
service.So u-boot can reserve memory using
fixed parametar and obtaining parameter from
trust TA.

Change-Id: Idf869be3e041699914075ed5a2ce206e6dd262ff
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:56 +08:00
Jason Zhu ef52a073f0 fastboot: add missing brace in cb_flash()
In the function cb_flash, we call avb_read_flash_lock_state
in the conditional judgement, but we do not add brackets after
the return.This cause the fastboot can not work well.

Change-Id: Ib9bbd367d25bdc3e93e6db4444896caa114382a7
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:56 +08:00
Jason Zhu 82ee22d4d3 androidboot: support recovery and fastboot mode
The system must support recovery and fastboot
mode, so the u-boot must judge the boot command
in the misc partition.

Change-Id: I53c876eeefdc20ebe313a6a73d4cfac443fafa67
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:56 +08:00
Jason Zhu 4e1bbe849d fastboot: support oem fuse at-bootloader-vboot-key
Change-Id: Ifd5a0edeaf43cf1b359125db6168d7e102bcf0bf
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:56 +08:00
Jason Zhu cf7b148dc2 androidboot: free no use buffer
If excute avb_ab_flow() failed, the free the
no use buffer.

Change-Id: I874f3367eceb35424b069a04a1ec35c37b46e639
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:56 +08:00
Jason Zhu 708de1435a androidboot: close optee client when start kernel
Change-Id: I4b4626e8e2bc89c711988fe23245fa6e71ac7204
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:56 +08:00
Jason Zhu 52b8c717cf lib: avb: close optee client
Change-Id: Iee7c991f7c06acbb064e016e11338cbf846be20d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00
Hisping Lin 468df3b26a lib: optee_client: add read vboot key flag func
Change-Id: Id0405cc2b695f00b5d7586d01bd0b66279b24430
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:55 +08:00
Wenping Zhang 4a872f4aa8 rockchip: rk322x: speed up the emmc and the cpu.
increase the cpu frequence to 816M, and enable mmc ddr mode
for emmc.

Change-Id: I93d6b3c625c73d5e75accfb26559930dd299e0e9
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-11-14 10:55:55 +08:00
Jason Zhu fe83bbf40d lib: avb: add reed/write vbootkey hash
The android things require the soc-v key hash to be flashed
using the fastboot. So these function can be used in fastboot
to flash the key hash.

Change-Id: I6e00f2e1e371793b6f0868356ac0a51090adfe5e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00
Jason Zhu f74d184a88 lib: avb: add a permanent attribute flag
Add a flag to indicate the permanent attributes
have been written or not.

Change-Id: Id0b22158772bdf18466205df5f08cb0ddb820fbf
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00