Commit Graph

14 Commits

Author SHA1 Message Date
Yifeng Zhao 1b01cf5590 cmd: rockusb: reboot to boot ROM rockusb while using slc nand
The rockusb in u-boot could not support BLK_MTD_NAND and
BLK_MTD_SPI_NAND, need reboot to boot ROM.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I16d9f25d84322c9752e2e62451cd7b8c0aa16f02
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-11-05 17:01:02 +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
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
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
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
Jason Zhu 06c1e1b3ae cmd: rockusb: fix usb serial number bug
Some special characters will be treated as a path in windows environment,
such as '\\' and '/'. If the usb upload its serial number with these
special characters, the usb drive will unwork. So use '_' to replace them.

Change-Id: Ic249316f2b03b0dcb73680078f122e23003e6e3d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-27 08:31:20 +08:00
Shunqian Zheng 957c1cf2af usb: rockusb: Forbid data beyond 32MB reading
Simply return magic char if one is trying to read data beyond 32MB.

Fixes: 628c827 ("usb: rockusb: forbid reading data beyond addr 32MB")

Change-Id: If2cdf05dbf9d6dcdd4cf8f9605ab84480fbca32d
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
2019-03-14 19:24:48 +08:00
Jason Zhu 628c827194 usb: rockusb: forbid reading data beyond addr 32MB
Forbid reading data beyong addr 32MB to protect user data & firmware. Excess
partial is filled with 0xcc. The addr 32MB is quoted from pre-loader.

Change-Id: I96f4fb3bb0d88a309fef20650863011cd9f0dfd9
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-02-25 17:14:46 +08:00
Jason Zhu fc1a55637d rockush: add serialnumber to usb_device_descriptor
Change-Id: I498be22dd73ffa8e8844bd9ceedb294b5bba72ce
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-11-23 11:06:51 +08:00
Masahiro Yamada 90aa625c9a treewide: replace with error() with pr_err()
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)
2018-01-17 15:27:28 +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
Frank Wang aa9b1b59c9 cmd: rockusb: add rockusb command support
This patch add a new rockusb command support.

Rockusb command provides a way to upgrade firmware for Rockchip SoC
based devices, its design make use of USB Bulk-Only Transport based
on USB Mass Storage framework.

Change-Id: Idb04c62a8f6fb7ba84641bd4ee00f67920a7cfc8
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-11-03 11:57:11 +08:00
Frank Wang d5c4b898d3 Revert "usb: rockchip: add rockusb command"
Will make use of UMS framework to support rockusb command.

This reverts commit 301fce6(usb: rockchip: add rockusb command).

Change-Id: Iec2ed64212851a85e8570dcfaa5507a5b55c29c5
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-11-03 11:57:10 +08:00
Eddie Cai 301fce6d0e usb: rockchip: add rockusb command
this patch add rockusb command. the usage is
rockusb <USB_controller> <devtype> <dev[:part]>
e.g. rockusb 0 mmc 0

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

Changes in v7:
-none

Changes in v6:
-none

Changes in v5:
-none

Changes in v4:
-move USB_FUNCTION_ROCKUSB to drivers/usb/gadget/Kconfig
-modify the dependence

Changes in v3:
-fix comment from Simon and Lukasz
-fix checkpactch error
2017-09-12 16:04:28 +08:00