Commit Graph

22 Commits

Author SHA1 Message Date
Frank Wang 19652be07e gadget: rockusb: fix cmd exception for r/w vendor storage
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>
2019-06-17 14:24:47 +08:00
Jason Zhu af5a201234 usb: gadget: rockusb: test IF_TYPE_SD when read capacity
Since the sd card is similar to mmc device.

Change-Id: Ifb21a58f96f806388f5e2bb50b607678fce0d97b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-02-22 14:52:48 +08:00
Tony Xu 700a366893 drivers: usb: Add readback check when write keybox
Change-Id: I969012e391bd8b6b764d259379d610853cd163b5
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-01-31 11:08:44 +08:00
Jian Qiu c2ba77d93f lib: optee_client: Extract keymaster CA module
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>
2019-01-18 09:09:34 +08:00
Tony Xu dfbf26e839 lib: optee_client: move keybox code to write_keybox.c
Change-Id: Ifcd9962a8b802ee2bcbdbd0e88effb4485e5963a
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-01-16 18:10:16 +08:00
William Wu 26dd3474b3 usb: gadget: add SuperSpeed support to the Gadget Framework
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>
2018-10-16 15:22:02 +08:00
Tony Xu f18b06fb49 lib: optee_clientApi: Optimze the function write_keybox_to_secure_storage
Change-Id: Icb88355494eb23c9403fc078adb5f2f46c4a870c
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2018-10-16 09:22:57 +08:00
tony.xu 6f0347c8c3 usb: gadget: rockusb: write keybox to RPMB
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>
2018-08-20 17:33:46 +08:00
Frank Wang 0d0c32481d usb: gadget: rockusb: add vendor storage r/w cmd support
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>
2018-08-13 10:25:21 +08:00
Kever Yang 5fb597c27d rockchip: rockusb: only fix cmd for WL10/RL10
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>
2018-06-22 11:45:46 +08:00
Kever Yang e0023032d6 rockchip: rockusb: update for legacy tool
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>
2018-06-13 14:42:44 +08:00
Kever Yang d23ec8c4ae rockchip: rockusb: add copatible with legacy upgrade tool
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>
2018-06-04 18:09:42 +08:00
Frank Wang c0acb0f2ed usb: gadget: use google's vid and pid for fastboot
Using Google's VID and PID default for fastboot command.

Change-Id: I8deb275f0f6a925b8e0b9668b6ba59abd44b74a5
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2018-03-06 15:39:56 +08:00
Frank Wang 829f2b853d usb: gadget: add getting chip-info command for rockusb
This change adds getting chip-info command support for rockusb.

Change-Id: Ie158c94eb0591e658947f3b0c47f4fc0ec0333d1
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2018-02-06 18:00:30 +08:00
Frank Wang 5b081643b1 usb: gadget: reset to maskrom support for rockusb
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>
2018-02-02 16:49:57 +08:00
Frank Wang d7386f60fc usb: gadget: amend flash type for rockusb
Add more flash type support for rockusb command.

Change-Id: I8f2a2f6b5d1c3c5fb8824ce726cc3f0b6443d8ef
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2018-01-31 18:15:07 +08:00
Joseph Chen 866d7966e2 usb: rockusb: set boot normal mode before reset
Change-Id: I7b72a06fbf73a2dbf87fd7d1761dc036f3c40159
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-24 18:17:35 +08:00
Frank Wang d015bf411a usb: gadget: correct the capacity value for upgrade tools
Correct the current capacity to support the different storage
devices upgrade.

Change-Id: I2c96183f317f42944887d02af097ff8a8d29cd4e
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2018-01-23 09:35:09 +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 f16e43f88d usb: gadget: add a new rockusb gadget driver
This patch add a new rockusb gadget driver function.

For the design, simply embeding rockusb code into USB Mass Storage
function as using UMS framework can prominently improve upgrade speed
and devices stability.

This change does not affect the original USB Mass Storage function,
the rockusb process are just checked by IS_RKUSB_UMS_DNL macro which
only run when CONFIG_CMD_ROCKUSB was defined and rkusb_ums_dnl
composite driver was registed.

Change-Id: I9c2723200c7e02d947587037abcd7d3badf4256c
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-11-03 11:57:10 +08:00
Frank Wang 7a4b7544d7 Revert "usb: rockchip: add the rockusb gadget"
Instead of using fastboot framework it is better to use ums framework
to improve firmware upgrade speed. Will add a new rockusb driver next.

This reverts commit c7cd0ba("usb: rockchip: add the rockusb gadget").

Change-Id: Ie578ee94e247780d6f9b56156b0ccf737fa18cb9
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-11-03 11:57:10 +08:00
Eddie Cai c7cd0ba49a usb: rockchip: add the rockusb gadget
this patch implement rockusb protocol on the device side. this is based on USB
download gadget infrastructure. the rockusb function implements the rd, wl, rid
commands. it can work with rkdeveloptool

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

Changes in v7:
-none

Changes in v6:
-move some data to f_rockusb structure

Changes in v5:
-fix build error when build non-rockchip board
-fix checkpatch error

Changes in v4:
-use enum instead of macro define
-move some structure define and macro to f_rockusb.h
-add some function comment as Simon required
-address other comment from Simon
-fix build error as Lukasz point out

Changes in v3:
-split the macro to f_rockusb.h
-use ALLOC_CACHE_ALIGN_BUFFER to define cache safe struct inside the function.
-fix checkpatch error
2017-09-12 16:04:28 +08:00