The cdev->config means the currently active configuration and
it might be null, fix it by adding null pointer check.
Change-Id: I18261653436186c342b447c24ef46a8acc42825f
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
It should be marked sense_data error when r/w vendor storage failed.
Change-Id: I7e298d4f700ac3ca9648e973258cff521c41ec03
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Since we use the pre-loader public key to verify permanent attribute, then
we do not need to write permanent attribute hash to otp & efuse.
Change-Id: Ic5e19fed2fc9405ab5bc7504dd930fd5f02d847c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Extract keymaster CA module from OpteeClientInterface
refactoring code for keymaster reads and writes form caller module
Change-Id: I1069fce0d29d9d9815f71e7f3b4d231754382acd
Signed-off-by: Jian Qiu <qiujian@rock-chips.com>
This patch implements the Binary Device Object Store (BOS)
Descriptor for SuperSpeed. It also add SuperSpeed Endpoint
Descriptors for fastboot and rockusb gadget.
Change-Id: I7d858e1b5117d403919f5fdacb40072a5fad336f
Signed-off-by: William Wu <william.wu@rock-chips.com>
Amend the maximum request length equate to the maximum transfer
size of endpoind.
Change-Id: I926c23ddf347f33cf166c51c80d099441978ca7e
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
The maximum transfer size supported should be 2^19 bytes
from Table 5-79 (P372) of the DWC OTG Databook V3.10.
Change-Id: I258b6c2119270fa2f31453af86f7eb179359e171
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
invoke function:
write_keybox_to_secure_storage(uint8_t *uboot_data, uint32_t len).
it only work when the chip support OPTEE_V1
Change-Id: If010b7cab6bab87485d9542af8c04544d27162cc
Signed-off-by: tony.xu <tony.xu@rock-chips.com>
The old implementation of cb_getvar is programed in one functions, this
make the cb_getvar huge. So separate cb_getvar in several functions.
Functions:
fb_getvar_all: Get all parameters by cmd fastboot
getvar all.
fb_getvar_single: Get one parameter by cmd fastboot
getvar xxx.
fb_read_var: Parse parameters
Change-Id: I1e795228f8129af82702f8f315cbad349ceec451
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
At present the vendor storage partition is small than 64K in the
design, so vendor storage r/w commands do not take multi-packet
into consideration, if it is needed, the codes should do a little
change in future. Besides, the RPMB r/w support need to be added
when its APIs get ready.
Change-Id: I621604c99b44c69eb3aff3e01b28a18f35303040
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
add RK_AVB_LIBAVB_ENABLE_ATH_UNLOCK config so we can
disable authenticated unlock function when we debug
and unlock devices quickly.
Change-Id: Id60be9ae6c17b59e107709a8041e8940743e5725
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This enables the following fastboot commands:
fastboot oem unlock
fastboot oem unlock_accept
fastboot oem lock
fastboot getvar oem-unlock
Android 8.1 need the oem unlock status attach to bootargs on boot.
Change-Id: Icc83451336a4dea2cbcf4927287de23bc8e28cb1
Signed-off-by: Jian Qiu <qiujian@rock-chips.com>
The definition of cmnd[7] is different for different cmd, so
we can not use the fixup for all cmd.
Change-Id: I0020de4974ecca6075e0512456787089139a67fd
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
It will run sleep_thread when call
fastboot_tx_write_str. So add wakeup_thread
to function tx_handler_ul when tx_handler okay.
Change-Id: I25996639bbed7228dc9bc4fb5184ddf2ee19a511
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Update data size for get_flash_id() and do_bad_block_test() so that
legacy tool can till work;
Add warning log for those not supported cmds from legacy tool;
Change-Id: I40e7f5d82a138bef6f8b0cef237c04483e663931
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Legacy upgrade tool may not set correct transfer size for cmds,
and for get flash info there no size in cmnd[7], fix it.
Change-Id: I4060d72bb1f814903ed3c5b6b13689609dc905c8
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
We found the following errors were reported when the rockusb
command is executed.
=============================
RKUSB: LUN 0, dev 0, hwpart 0, sector 0x0, count 0xe90000
"Synchronous Abort" handler, esr 0x96000010
ELR: 22e5e4
LR: 22e5dc
x0 : 0000000000000000 x1 : 0000000000000064
x2 : 0000000000000000 x3 : 00000000ff0c0000
x4 : 0000000000000000 x5 : 0000000000000037
x6 : 000000000000000a x7 : 0000000000000007
x8 : 0000000000000008 x9 : 0000000000000008
...
Resetting CPU ...
It is caused by the null pointer in bmRequestType.Receipent.Device
setup, theoretically, Receipent.Device setup should be handled after
the set_configuration request was finished, so skip it if the usb
configuration has not been set.
Change-Id: I42caf375e8d842ad626d85a6a2a21dfb07fb557a
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Using Google's VID and PID default for fastboot command.
Change-Id: I8deb275f0f6a925b8e0b9668b6ba59abd44b74a5
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Some message can not be complete transmission because
the fastboot can only transmit 64 bytes one time. So add
sleep_thread() to judge whether the data is complete
transmission before call fastboot_complete().
Change-Id: I9057ffc9ca4b92db8c9ab14e4650d386c5d06254
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
A GetDescriptor(BOS) request always requires the Device Capability
descriptors as part of the BOS information. This patch adds a generic
Device Capability descriptor header to fix it.
Fixes: 8ddd5824c ("usb: gadget: add bos descriptor response for rockusb command")
Change-Id: I6b5976c6f13a6991a7d00c8221ece2a740032a07
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
The commit point is updated to google external/avb/
which commit point is cf8c56208d2d9643804a7f123b196c7ebc9af276.
Change-Id: I5a10a8a45d3e9e2c9d20d9b3d44946073c9a49ff
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This change adds getting chip-info command support for rockusb.
Change-Id: Ie158c94eb0591e658947f3b0c47f4fc0ec0333d1
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Follow the subcode in reset command and add resetting to maskrom support.
Change-Id: I15bedef6b83b7282f3e1a9ff3663ec56cd3affc8
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Add more flash type support for rockusb command.
Change-Id: I8f2a2f6b5d1c3c5fb8824ce726cc3f0b6443d8ef
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Correct the current capacity to support the different storage
devices upgrade.
Change-Id: I2c96183f317f42944887d02af097ff8a8d29cd4e
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
cb_flashing() should be in the same MACRO of cb_flash().
Change-Id: Ic5641a1bf1fb0ab53ad98bdececd028f1e75a5e2
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Increase the buffer length to be just above maximum permissible value
of 128 kiB . This increases the performance of the UMS and alike by a
factor of 2 - 2.5 as the buffers are less fragmented.
Change-Id: I8b285031fd251b2ebf672c2295a19bfcba77d8c6
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit a8c402f45c758235916615757ac537db8e96fc31)
U-Boot widely uses error() as a bit noisier variant of printf().
This macro causes name conflict with the following line in
include/linux/compiler-gcc.h:
# define __compiletime_error(message) __attribute__((error(message)))
This prevents us from using __compiletime_error(), and makes it
difficult to fully sync BUILD_BUG macros with Linux. (Notice
Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().)
Let's convert error() into now treewide-available pr_err().
Done with the help of Coccinelle, excluing tools/ directory.
The semantic patch I used is as follows:
// <smpl>
@@@@
-error
+pr_err
(...)
// </smpl>
Change-Id: I921807c1770d36a91e692c48ab477558bb2ed0b8
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Re-run Coccinelle]
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 9b643e312d528f291966c1f30b0d90bf3b1d43dc)
During using dwc2 usb gadget, if usb message size is too small,
following cache misaligned warning is shown:
CACHE: Misaligned operation at range [bfdbcb00, bfdbcb04]
Align size of invalidating dcache before starting DMA to remove the
warning.
Change-Id: Ibd9040be45da03174d63313e302b994720c7edd3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit a939af0c748e2ea1eeb8cf47fa9771a95786de70)
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>
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>
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>
This change amend USB VID & PID to Rockchip for rockusb.
Change-Id: I3c94e442cc0190d2d3f13424470dd2d84af55eb0
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>