Commit Graph

17568 Commits

Author SHA1 Message Date
Joseph Chen a527a681cb rk1808: remove rkimg_bootdev
It's defined in rockchip-common.h now.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9e29b309f22a0a8d97a6b6111b59f594708280f8
2020-04-26 15:14:36 +08:00
Joseph Chen 8e2870c0cf rockchip: common: add rkimg_bootdev for dm ramdisk
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iea6b8cdd7c629be136e83de8e9626394a85b410d
2020-04-26 15:14:36 +08:00
Joseph Chen 2bc8e1106f Merge branch 'next-dev' into thunder-boot 2020-04-23 16:43:12 +08:00
Joseph Chen 374c241cf9 misc: add a common api to get device by capability
fix: ioctl() should return error code but not capability.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8030a1842692697f32f87e765ce3d68d1adb1c11
2020-04-23 16:17:06 +08:00
Joseph Chen 1cef1b20c4 dm: misc: merge generic header file into misc.h
Puting the generic function declaration together that the
caller don't need care too much about different header file.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib37d1550e5a747d8f18e30c428ea8f613f9cc006
2020-04-23 16:17:06 +08:00
Joseph Chen fd85085a4b Merge branch 'next-dev' into thunder-boot 2020-04-23 14:13:56 +08:00
Lei Chen f21c060e4b driver: input: update RK remote control driver
This patch updates the RC driver to accommodate the new framework

Signed-off-by: Lei Chen <lei.chen@rock-chips.com>
Change-Id: I3ff2b5844ce5f1776ac2f94b3cbd42eb5d73cc41
2020-04-23 10:23:19 +08:00
Joseph Chen 710cfa3daa Merge branch 'next-dev' into thunder-boot 2020-04-22 18:15:33 +08:00
Jason Zhu 6a8fa29e04 misc: otp: realize otp interface layer function
Realize otp read & write functions for application layer calling.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ic8f698b36fce4c1c6cd7a2848afd370567b43448
2020-04-22 18:08:19 +08:00
Jason Zhu f9519410b1 misc: otp: support rockchip secure otp version 2 driver
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I10a8cc92f2130c1f1957fd36fb924d9846707e65
2020-04-22 18:08:19 +08:00
Jason Zhu 5b7d32987c drivers: misc: use misc_mode to distinguish different device
The misc attach different device. We use the misc_mode to show
different device's capability.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ibce5bb0465e452a7e783c5859f1e8ab2bfd8b0c5
2020-04-22 18:08:19 +08:00
Joseph Chen 98894c7310 Merge branch 'next-dev' into thunder-boot 2020-04-21 16:19:07 +08:00
Joseph Chen 1f452cbf59 fit: support board sig verify require
Not allow non-signature image to boot if board requires
signature verify.

The board signature verify usually depends on otp/efuse
key is enabled or disabled.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4e4dd201e74712a53cb0f481463b48532e30bb40
2020-04-21 12:02:02 +08:00
Jason Zhu 9b54bc37d9 rockchip: rv1126: add CONFIG_SYS_NAND_U_BOOT_OFFS
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3ec5c590ca135349e8b014b5ca4968ddc4fb26a1
2020-04-21 11:33:40 +08:00
Jason Zhu 358df1d7ed rockchip: rv1126: add nand flash config
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ibe1b30b09e4579e9acfac41730c5e862db0a345f
2020-04-21 11:06:43 +08:00
Finley Xiao 2830381ba6 dt-bindings: clock: rv1126-cru: Delete PCLK_CAPTURE_PWM2
Change-Id: I33a4c2cc12d275fbc50bfb652bedb9fe83ad266d
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-04-17 16:49:13 +08:00
Joseph Chen c637f2321b Merge branch 'next-dev' into thunder-boot
Change-Id: I22ac688008080eac49169d752a94b66668f890fc

Conflicts:
	drivers/phy/Kconfig
	drivers/phy/Makefile
2020-04-16 15:48:00 +08:00
Frank Wang 4f6604d7ff phy: rockchip: add a new driver for type-c phy
This implements the Type-C PHY driver for Rockchip platform
with Cadence IP block.

Change-Id: I4d74aadbae10f743c9daec8f97aadb8458e740fc
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-04-15 15:44:22 +08:00
Frank Wang affb42ab85 phy: rockchip: add a new driver for Rockchip USB3 PHY
This implements the USB3.0 PHY driver for Rockchip platform
with Inno IP block.

Change-Id: I161915cf36fec441822f5f151f017ba8a7ecff9f
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2020-04-15 15:44:22 +08:00
Kever Yang ef78966da5 FROMLIST: usb: Migrate to support live DT for some driver
Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT.
This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use
ofnode as parameter instead of fdt offset. And all the drivers who use
these APIs update to use live dt APIs at the same time.

Change-Id: I41a3fa52e8fdb99f7fc36b1bc0eb21ae82f90e63
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(am from http://patchwork.ozlabs.org/patch/1248682/)
2020-04-15 15:44:22 +08:00
Jason Zhu cc05bcfa96 misc: decompress: realize decompress interface layer function
Realize decompress start & stop & is_complete functions for application layer
calling.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I996861e51706a9ecf97e3db53cf5fce097d9b547
2020-04-15 11:55:40 +08:00
Jason Zhu 74dce6fe82 misc: add IOCTL_REQ_CAPABILITY
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I1d1c6a93fd686d1a13450316b1edc09ce19b6dcf
2020-04-15 11:55:40 +08:00
Finley Xiao b77d2f1647 dt-bindings: clock: rv1126-cru: Rename some srst according to TRM V1.0
Change-Id: I329952664ef731bec67a57fa8c4c43dd65a38235
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-04-14 19:52:46 +08:00
Joseph Chen a873a53297 Merge branch 'next-dev' into thunder-boot 2020-04-14 14:16:56 +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
Marek Vasut f2413b2f2f UPSTREAM: fit: Add standalone image type handling
Just add IH_TYPE_STANDALONE to fit_get_image_type_property().

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I0e3dbfad3e15decb81665fabb8d25e1b71f4c7b7
(cherry picked from commit 0298d203754)
2020-04-14 12:45:33 +08:00
Joseph Chen f8f8bbc62f Merge branch 'next-dev' into thunder-boot 2020-04-10 12:05:09 +08:00
Joseph Chen 4181c9fa95 include: image: add rollback_index
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2f7f222e7453fb16598e3fabb861962c0600709f
2020-04-09 18:26:22 +08:00
Joseph Chen 7a1370759d fit: add rollback index protect support
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I3af0049532d7b34adadbbb1faf6c54aad6232f93
2020-04-09 18:26:22 +08:00
Joseph Chen f8ca9d164a spl: do cleanup before jumping to next stage
Cache/mmu/interrupt cleanup is recommand before jumping to
next stage to avoid some uncertain things.

Provide a arch/board-specific callback to do cleanup things.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic5e4e378ec9080e7af283741370bcd9c2dc897dc
2020-04-09 18:26:22 +08:00
Jason Zhu a001312388 rockchip: rv1126: change the rockusb PID
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I73a2876d860abafeb4440c3a675a191238ab795d
2020-04-08 17:09:13 +08:00
Joseph Chen 41bb8b737c Merge branch 'next-dev' into thunder-boot
Conflicts:
	common/spl/spl_rkfw.c
	drivers/pinctrl/pinctrl-rockchip.c
	make.sh

Change-Id: I93f4dbe1e067c3b938bf64c4964bd5e7023b1daf
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2020-04-07 21:18:08 +08:00
Joseph Chen aa415ed977 common: spl: fix cherry-pick sync conflict
fixes: (1cb393f common: spl: rkfw: support bing-up arm32 firmware)

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1b7f1a6269794ea9a4a508933381bbb8e3e7133b
2020-04-07 21:00:48 +08:00
Jason Zhu 1cb393f1c8 common: spl: rkfw: support bing-up arm32 firmware
1. the arm32 trust firmware is diffirent with arm64, support it.
2. add entry_point_os to indicate the uboot or kernel entry point.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I24d1601323e99f40e81d18f1937f762b2ecc137f
(cherry picked from commit a64fd729d4)

Change-Id: I3b1420989d158c52259365d90011524b047b5750
2020-04-07 17:47:16 +08:00
Joseph Chen 78e35b2b4f rockchip: rv1126: update bootcmd according to fit signature
only allow fit image if CONFIG_FIT_SIGNATURE is enabled.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I96b713a2a3eb0b148bda4215a99288b379d66efe
2020-04-04 19:43:13 +08:00
Jason Zhu 440eb126fa spl: rkfw: add boot_sector to seperate uboot and boot load-address
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I04e2b00a8615fee24ee7722ab7bb9ad4931f4332
2020-04-04 10:55:58 +08:00
Jason Zhu 2323b257d7 rockchip: spl: add get spl next stage driver
Use it to make sure which firmware can be bring up.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ib2cec8bf7c78fa436efade0518b07c3193170c7b
2020-04-04 10:55:58 +08:00
Jason Zhu 69e1ad7bcf spl: add spl next stage definition
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I822f0e92b158a673ce0d2e2265a5237f5870a58f
2020-04-04 10:55:58 +08:00
Jason Zhu c88ba1c4c3 spl: add next_stage to struct spl_image_info
Add next_stage to indicate the next boot stage is uboot or kernel.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I9104ede143c5a9c7f0bff6869e67d5e605e596ca
2020-04-04 10:55:58 +08:00
Joseph Chen a4d1e7eec0 Merge branch 'next-dev' into thunder-boot 2020-04-03 18:12:46 +08:00
Joseph Chen d871c07160 common: image-fit: add some common APIs
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I3df010d3b6a07efc7287779fe4a0a60ce9f1d2dc
2020-04-03 17:54:19 +08:00
Jianing Ren 6037440f12 include: usb: add naneng usb2.0 phy support
There are there rockchip USB2.0 PHYs can support USB BC1.2,
respectively Synopsys USB2.0 PHY, Innosilicon USB2.0 PHY and
Naneng USB2.0 PHY. So we rename the file to phy-rockchip-usb2.h.

Change-Id: I561efc178b5168965c41098dd5b749f3d5083851
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-04-03 14:45:36 +08:00
Joseph Chen 42c5849b56 Merge branch 'next-dev' into thunder-boot
Change-Id: I83b054613effee1a89bdcbffbc68ebf37abe7a2b
2020-04-02 09:02:11 +08:00
Lin Jinhan 6b5b88bc03 dm: crypto: add zero hash support
Change-Id: Ib0f74e9636a214918511715cdd4ef32ebe65463a
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-04-01 17:31:06 +08:00
Joseph Chen c8fa018b04 Merge branch 'next-dev' into thunder-boot 2020-03-30 19:32:22 +08:00
Lin Jinhan 1606a214ea crypto: rockchip: v2: optimize rk_hash_update
if data address and data len is meet crypto v2
hardware requirements, data will be calculated
without cache.

Change-Id: Ifc5acc5b449c581dbf3ac5f20ad6b8d932954aa7
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-03-30 19:10:13 +08:00
Jianqun Xu d23b7df185 dt-bindings: pinctrl: rockchip support RK_FUNC_{5,15}
Change-Id: I3fc8f58e033520f5211814bec84bd3142fd41760
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-30 18:20:04 +08:00
Joseph Chen 4103a11cae Merge branch 'next-dev' into thunder-boot 2020-03-30 18:02:29 +08:00
Joseph Chen 96f5441ec8 common: fit: support spl fit image check by tools/fit_check_sign
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0e03a90d50290e18c6fb2cd44516c352f3695290
2020-03-29 09:57:04 +08:00
Joseph Chen 4ab50248f6 rockchip: implement autoboot_command_fail_handle()
It's not friendly to handle the fail event in a bootcmd list,
let's handle this in C function.

Entering rockusb/fastboot mode after verified-boot failed.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib617582e1cc386f5c30abe1a8bbd2b5f353c0e49
2020-03-28 18:21:16 +08:00
Joseph Chen 7fc773a76d common: add autoboot_command_fail_handle() callback
Maybe user need to do some job when bootcmd failed, they
could override it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1c32c1ad37700e66d45fe033fbfa46d3f350205d
2020-03-28 18:21:16 +08:00
Joseph Chen 5f14e3de56 include: rsa: fix compile error
Fix for: CONFIG_SPL_FIT_SIGNATURE && !CONFIG_FIT_SIGNATURE

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8242d208db14aa9066bb8c6d430686f909258844
2020-03-28 18:16:08 +08:00
Finley Xiao 6ea30212cc clk: rockchip: rv1126: Rename I2S clocks
Change-Id: Idc6659013dde74f09e86a7120fc42348b87d63f8
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-03-28 16:41:12 +08:00
Joseph Chen e1e9b173e4 Merge branch 'next-dev' into thunder-boot 2020-03-28 15:01:31 +08:00
Joseph Chen 957222d7c6 common: image: support IMAGE_PARAM_INVAL as placeholder address flag
User maybe not want to set a fixed address, leave it to U-Boot.
This is a compatible method for different board and platforms.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I01accbc0f116856276610bfaea8de2f7e1275bb0
2020-03-27 18:07:52 +08:00
Joseph Chen 40d08d0f10 tools: mkimage: support pack empty file for multi image
Muilt image bootflow requires ramdisk as a mandory component,
so that we have to pack a empty ramdisk into multi image at
some time.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I551ae832fbc68514ead0a3337148593e3113394f
2020-03-27 18:02:55 +08:00
Joseph Chen c155446281 rockchip: common: set CONFIG_NR_DRAM_BANKS for SPL
SPL don't need so many dram banks.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie4a48361bb4911466e58ba859ffb51dcb616fbbb
2020-03-26 14:52:31 +08:00
Joseph Chen 3ec172ba59 pmic: rk8xx: update reg count for RK817/809
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I55e25a3f6ce46c6bfbdd440910824e527fdc4c58
2020-03-25 21:12:48 +08:00
Joseph Chen d45e0962c8 rockchip: rv1126: update address definition
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If3d04b4c6cb69adcb9e193fdbda6f4e8e94e2353
2020-03-25 16:23:52 +08:00
Joseph Chen 008ec9b4bc lib: rsa: add hardware crypto for FIT image checksum and rsa
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I526dd1b9a2a7e0050786f6006fd166f3dfb3a5c4
2020-03-24 21:00:32 +08:00
Joseph Chen c14e46abc4 dm: crypto: add API for multi regions checksum
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id364b123a189987458b72adca28f4f4e75e90291
2020-03-24 21:00:10 +08:00
Joseph Chen a1b6bf655e rockchip: common: add "boot_fit" and "boot_uimage" to bootcmd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I98845b9e57be4183e079e18c20f9f2e0a27ffac3
2020-03-19 09:54:27 +08:00
Joseph Chen 05e0f98eb3 driver: core: add dev_del_prop() api
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id016f2f3e2d4d80a7dbd72d02a038c07b3a0de26
2020-03-17 08:53:09 +08:00
Joseph Chen 583377c459 spl: fit: add fit config verify support
Do fit config verify if required.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I211f43c07d636ea8cff42cf9133bcab0aa86f8c6
2020-03-16 11:42:38 +08:00
Joseph Chen e750e261e7 image: chose fdt blob according to kernel dtb feature
gd_fdt_blob() is used in FIT verified boot to get the
"/signature" node added in U-Boot fdt blob.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I828dbff45a1f9b450fb6059e620eba13df3bf318
2020-03-16 11:42:38 +08:00
Joseph Chen acd4329027 common: fit: unify fit image align size
Set 512 as default align size in order to access any image
by block unit.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I372ca7ff567816cb8369aff9d1fbe9865fa6d933
2020-03-16 11:42:38 +08:00
Joseph Chen 7497bc3dae Merge branch 'next-dev' into thunder-boot
Change-Id: I35db1f0aa79575e972942b5c366f380fc8106343
2020-03-13 17:49:04 +08:00
Jason Zhu a64fd729d4 common: spl: rkfw: support bing-up arm32 firmware
1. the arm32 trust firmware is diffirent with arm64, support it.
2. add entry_point_os to indicate the uboot or kernel entry point.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I24d1601323e99f40e81d18f1937f762b2ecc137f
2020-03-13 09:26:17 +08:00
Jason Zhu 3f7db063ed rockchip: rv1126: add rv1126 spl building support
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I8dfdcdff0e40db41bba99d4224bb66331de14471
2020-03-13 09:26:17 +08:00
Finley Xiao 979aa338cb clk: rockchip: rv1126: Change SRST_MAC_PTPREF to SRST_GMAC_A
Change-Id: Ic19b2f7602be02b11f3631ee29baf0fa8cbca074
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-03-06 18:34:46 +08:00
Michal Simek c04fe8bf81 UPSTREAM: image: fit: Show firmware configuration property if present
SPL ATF support requires to have firmware property which should be also
listed by mkimage -l when images is created.

The patch is also using this macro in spl_fit to match keyword.

When image is created:
 Default Configuration: 'config'
 Configuration 0 (config)
  Description:  ATF with full u-boot
  Kernel:       unavailable
  Firmware:     atf
  FDT:          dtb

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
(cherry picked from commit 1f8e4bf55eb58bda715c1f8c8777081580f3246b)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6ddc0d39005e4d30fd03ff7d45d57b152377f2ba

Change-Id: I9ea4500329fc1f835860f204472ab8fb76f3e1bb
2020-03-06 18:18:20 +08:00
Jun Nie 0833bf5e4e UPSTREAM: SPL: Add signature verification when loading image
U-boot proper signature is not verified by SPL on most platforms
even config SPL_FIT_SIGNATURE is enabled. Only fsl-layerscape
platform support secure boot in platform specific code. So
verified boot cannot be achieved if u-boot proper is loaded by
SPL.

This patch add signature verification to u-boot proper images
when loading FIT image in SPL. It is tested on Allwinner bananapi
zero board with H2+ SoC.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
(cherry picked from commit 5c643db4cc95c6ac6457731cb5bb75d6896e415b)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8de83a4fd31ccdb2429e1eadec31b60642687149

Change-Id: Ie1933cbbea0f5f9a68512ad3d43244e55a387d55
2020-03-06 18:18:20 +08:00
Peng Fan b86dc4195f UPSTREAM: SPL: Add FIT data-position property support
For external data, FIT has a optional property "data-position" which
can set the external data to a fixed offset to FIT beginning.
Add the support for this property in SPL FIT.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: "Andrew F. Davis" <afd@ti.com>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: "tomas.melin@vaisala.com" <tomas.melin@vaisala.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: "Cooper Jr., Franklin" <fcooper@ti.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Rick Altherr <raltherr@google.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: York Sun <york.sun@nxp.com>
(cherry picked from commit a1be94b65410c7ebba5e7695478b6623579b410c)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1cdcfe0358e5a39fed3dfcf0554a7ba0e16729b8

Change-Id: I44c3454addd85d70e6fba8e26b66a0278c5c1081
2020-03-06 18:18:20 +08:00
Joseph Chen 066e9bcbb9 include: add rv1126 IRQ definitions
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1c3c44befe9b667efd1012c20c7ba9b82c922ba7
2020-03-05 14:33:07 +08:00
Joseph Chen 593e1e6d64 rockchip: dts: rv1126/1109: sync from kernel
sync from: a96b35a clk: rockchip: rv1126: Add support for otp

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I12db524cf784479de567515f47da99df611a48ad
2020-03-04 18:41:10 +08:00
Joseph Chen 1a4f6af8bf Merge branch 'next-dev' into thunder-boot 2020-03-02 09:43:23 +08:00
Joseph Chen dbfe5ed512 dm: misc: add ioctl request command definition
Available for caller to call misc_ioctl(...).

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ibac22caf80968ecc7f952d04aa2a1a0f8ad3417a
2020-03-02 09:19:32 +08:00
Joseph Chen 57be1825cb rockchip: clean kernel dtb code to kernel_dtb.c
Since there is a lot of code for kernel dtb feature, let's
move them into a individual file to make board.c clean.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4e01627c265807b1c0e26b432f0b4fc1db0d889e
2020-02-28 12:38:42 +08:00
Joseph Chen bc4ccd5396 rockchip: clean rockchip_read_dtb_file() api to boot_rkimg.c
rockchip_read_dtb_file() is top level api which reads dtb from
resource/fit/uImage/distro image, etc.

only leave code about resource image in resource_img.c.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2157ffc204ebd564aa9171de2b8167fbd6c94bcf
2020-02-28 12:38:42 +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 ac459efd10 common: fit: add entry and load address set api
Add FIT_MULTI_PROP definition.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5e98601799de88843f8110f118640339079905a5
2020-02-28 11:37:14 +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 ea8a3d10b6 common: board_f: save U-Boot fdt blob
Saving it for late use, eg: fit verified boot process.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6643fb643f2fd88795d80fc5bd21025b62dc6943
2020-02-28 11:17:03 +08:00
Frank Wang 73d7b075b0 usb: dwc3: amend UTMI/UTMIW phy interface setup
Let move 8/16-bit UTMI+ interface initialization into DWC3 core init
that is convenient for both DM_USB and u-boot traditional process.

Change-Id: I7fe45af396098749b2acf4a885dff875dcbc6f63
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2020-02-27 17:51:21 +08:00
Jean-Jacques Hiblot 94fbbf0f6d UPSTREAM: dm: Add a No-op uclass
This uclass is intended for devices that do not need any features from the
uclass, including binding children.
This will typically be used by devices that are used to bind child devices
but do not use dm_scan_fdt_dev() to do it. That is for example the case of
several USB wrappers that have 2 child devices (1 for device and 1 for
host) but bind only one at a any given time.

Change-Id: Iad9ba5f368bd2de9940cf069baf9bec9d668920c
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 07e33711fec4f1106f36805b5dc830da07c783c5)
2020-02-27 17:51:21 +08:00
Finley Xiao ba2ff15a2a clk: rockchip: rv1126: Fix usb clock name
Change-Id: I1a26d7093a0c3dfb32c90d0dabfdce7d0ea77dc7
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-02-26 17:02:53 +08:00
Joseph Chen 14569d2673 env: add board env set api
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib8f2b18349cf4f99b182dbdb409c6a2f7820a028
2020-02-25 14:18:15 +08:00
Jason Zhu ace0ade619 mmc: add func mmc_gpio_init_direct in spl
Sometimes we need to reconfigure the eMMC gpio state in spl without
pinctrl driver. So add func mmc_gpio_init_direct to initialize the
eMMC gpio in different platform.

Change-Id: I22500f8865a9e29e59be6ff224001bad899cec48
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Joseph Chen f95775d6f3 clk: rockchip: rename rv1109 to rv1126
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If2c870831fd1e3332c09f00aaa9e91a1f1523279
2020-02-21 10:34:48 +08:00
Joseph Chen e7c03ac680 rockchip: rename rv1109 to rv1126
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I37820775ebd7adeb2a29113c2c7d31cdf1186594
2020-02-21 10:31:33 +08:00
Joseph Chen 5ae165da66 include: rkimg: add resource partition macro
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9de7e165f61ad18591add0ffe4092e99845c2938
2020-01-16 11:14:13 +08:00
Joseph Chen 64c9242ba7 sysmem: add FIT image memory block
The same feature with AVB memory block.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1aff5ef703d16852b4bc0a0887b037476464034c
2020-01-16 11:14:13 +08:00
Joseph Chen 1b5fef7e38 dm: misc: add ioctl request command definition
Available for caller to call misc_ioctl(...).

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I985a6b2095ad8380f2675331f3f840b36001f8f5
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-01-15 10:24:23 +08:00
Frank Wang 9c946fbb24 usb: dwc3: add dis-u1u2-quirk to reject enter U1 and U2
The DWC3 with Innosilicon USB 3.0 PHY on Rockchip platforms
(e.g. rk3328, rk1808) has problem to exit to U0 state from
U1 or U2 state when DWC3 work as peripheral mode. This patch
adds a quirk to reject transition to U1 and U2 state to
workaround this issue.

Refer to commit aaa5c055cc06 ("usb: dwc3: add dis-u1u2-quirk to
reject enter U1 and U2") in Rockchip Linux Kernel-4.4 .

Change-Id: I1f4176caab3ccdc31ba7eb06684267833bf804db
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2020-01-15 08:17:17 +08:00
Joseph Chen cc11e1d368 rockchip: px30: set malloc length 32MB
AVB bootflow allocs large memory from system now.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2ed9c7e1d48d9ff3187f02eda03e7ad3089ed26e
2020-01-11 15:52:53 +08:00
Joseph Chen d04ada6cfd rockchip: clean boot_mode.c and boot_rkimg.c
Clean the code into where it belongs to.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia034b8c3d8b264796db72c7bf44bab95811ecb77
2020-01-09 14:27:25 +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
Jagan Teki e0c79ab406 UPSTREAM: usb: dwc3: Add phy interface for dwc3_uboot
U-Boot has two different variants of dwc3 initializations,
- with dm variant gadget, so the respective dm driver would
  call the dwc3_init in core.
- with non-dm variant gadget, so the usage board file would
  call dwc3_uboot_init in core.

The driver probe would handle all respective gadget properties
including phy interface via phy_type property and then trigger
dwc3_init for dm-variant gadgets.

So, to support the phy interface for non-dm variant gadgets,
the better option is dwc3_uboot_init since there is no
dedicated controller for non-dm variant gadgets.

This patch support for adding phy interface like 8/16-bit UTMI+
code for dwc3_uboot.

This change used Linux phy.h enum list, to make proper code
compatibility.

Conflicts:
	drivers/usb/dwc3/core.h

Change-Id: I626e2428b548a2624fead5418ecb8f7571c77e89
Cc: Marek Vasut <marex@denx.de>
Tested-by: Levin Du <djw@t-chip.com.cn>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 6b7ebff00190649d2136b34f6feebc0dbe85bfdc)
2020-01-07 17:25:04 +08:00
Sherry Sun 16dff7857a UPSTREAM: usb: udc: Introduce ->udc_set_speed() method
This patch was copied from kernel commit: 67fdfda4a99ed.

Sometimes, the gadget driver we want to run has max_speed lower than
what the UDC supports. In such situations, UDC might want to make sure
we don't try to connect on speeds not supported by the gadget
driver because that will just fail.

So here introduce a new optional ->udc_set_speed() method which can be
implemented by interested UDC drivers to achieve this purpose.

Change-Id: I8ce57970c9095a92553ee12520e3724bd029d6b6
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 8d94e184ffdef48b40942c12d9e7b0290e60a1ef)
2020-01-07 17:25:03 +08:00
Vignesh Raghavendra 0943909d36 UPSTREAM: usb: gadget: Add match_ep() op to usb_gadget_ops
Add match_ep() op to usb_gadget_ops similar to Linux kernel which is
useful in finding a suitable ep match for the function driver. This will
avoid adding more gadget_is_xxx() handling code to usb_ep_autoconfig().

Also sync usb_ep_caps struct thats is usually used in the match_ep()
callback by the gadget controller driver

Change-Id: I94fe5d1b3ae984cbf3f6e10f86020191d8ca8090
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 77dcbdf3c1ce96de19c00caca0766b5bbaa0cf28)
2020-01-07 17:25:03 +08:00
Jean-Jacques Hiblot 143fc13bc1 UPSTREAM: usb: xhci: move xhci.h to include usb
The xhci.h header file is currently located under drivers/usb/xhci
Move it to the include/usb folder to make it available to drivers that
are not under drivers/usb/xhci

Change-Id: I13705562893b30327708fbc321547bac79615785
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 1708a12377b98397606677e117f93f07d7cd2f7e)
2020-01-07 17:25:01 +08:00
Michal Suchanek 92937b1f66 UPSTREAM: usb: Add nonblock argument to submit_int_msg
This will be used to implement non-blocking keyboard polling in case of
errors.

Conflicts:
	common/usb.c
	common/usb_kbd.c
	common/usb_storage.c
	include/usb.h

Change-Id: I4a951d779e2cf9e80380f93000a87a617453fb32
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 3437121c037f502a3b0faaec97059777034a1ead)
2020-01-07 17:25:00 +08:00
Frieder Schrempf e7093b518a UPSTREAM: usb: gadget: f_sdp: Allow SPL to load and boot FIT via SDP
Add support for loading u-boot FIT images over the USB SDP protocol in
the SPL

Change-Id: I41461b58c088a10eca6e48b0d49c76944c37c3fa
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
[Various build fixes]
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Tested-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 2c72ead7387404eba16c556d2f204c52c36c27f9)
2020-01-07 17:24:58 +08:00
Patrick Delaunay acd7aca8c0 UPSTREAM: usb: dwc2: add support for STM32MP1
Add compatible "st,stm32mp1-hsotg" and associated driver data to manage
the usb33d-supply and the ST specific register for VBus sensing.

Change-Id: If60971ebf415cb708b04af38c7b61d5321a13181
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 931e9d7aa7228867eec7e33fd45718e6018cc96d)
2020-01-07 17:24:57 +08:00
Patrice Chotard 6187c34651 UPSTREAM: usb: dwc2_udc_otg: Add tx_fifo_sz array support
All TX fifo size can be different, add tx_fifo_sz_array[]
into dwc2_plat_otg_data to be able to set them.

tx_fifo_sz_array[] is 17 Bytes long and can contains max 16
tx fifo size (synopsys IP supports max 16 IN endpoints).
First entry of tx_fifo_sz_array[] is the number of valid
fifo size the array contains.

In case of tx_fifo_sz_array[] doesn't contains the same
number of element than max hardware endpoint, display
a warning message.

Compatibility with board which doesn't use tx_fifo_sz_array[]
(Rockchip rk322x/rk3128/rv1108/rk3288/rk3036) is kept.

Change-Id: If32954770f9571a1bb18376239ef9cff9a721178
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 763bb106f66c147b7d0c3046dbba66a07d7a9dd2)
2020-01-07 17:24:57 +08:00
Patrick Delaunay 3015f8bebd UPSTREAM: usb: dwc2: Add function for session B check
Add a new function to check the session B validity, to be use to check
cable connection.

Change-Id: I914d7353e926df26787261c99f07e5c58dbf24ff
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 2d76160f049c42087011cfa0e6e878aa2ed6b406)
2020-01-07 17:24:57 +08:00
Patrick Delaunay 5c4beedb87 UPSTREAM: usb: dwc2: Add force-b-session-valid support
Handle "force-b-session-valid" property from DT.

Change-Id: I5a0bf871506257b449897cb67732fef430704134
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 0fdd0bc621f060fcf60fd4ba48a2a32f338ffeac)
2020-01-07 17:24:57 +08:00
Marcel Ziswiler 2522005341 UPSTREAM: configs: move CONFIG_USB_EHCI_VF to Kconfig
Move CONFIG_USB_EHCI_VF to drivers/usb/host/Kconfig and update the one
and only user thereof being colibri_vf.

Change-Id: I69228893cb776f077e68a80ee236aeed6e7c2d26
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 20df4b570d164675da17bf23998e51271f5a79a3)
2020-01-07 17:24:56 +08:00
Andrew F. Davis 09b32b41f2 UPSTREAM: spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU
The symbol CONFIG_SPL_DFU_SUPPORT in SPL build has the same
meaning as CONFIG_DFU in regular U-Boot. Drop the _SUPPORT
to allow for cleaner use in code.

Conflicts:
	arch/arm/mach-zynqmp/spl.c
	common/Makefile
	common/spl/Kconfig
	common/spl/spl_ram.c

Change-Id: I93f09d5953284d511df135e6e71c03c0552719a2
Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Lukasz Majewski <lukma@denx.de>
(cherry picked from commit 6536ca4d6676bf38e50784298e713edc30b9cde9)
2020-01-07 17:24:56 +08:00
Jean-Jacques Hiblot 5277273c32 UPSTREAM: usb: host: replace xhci-keystone driver by the generic dwc3 driver
The keystone platforms can use the generic DC3 driver. Removing the
keystone-spcecific xchi driver and add the configuration options to enable
the generic DWC3 driver on all K2 platforms.

Conflicts:
	configs/k2e_evm_defconfig
	configs/k2e_hs_evm_defconfig
	configs/k2g_evm_defconfig
	configs/k2g_hs_evm_defconfig
	configs/k2hk_evm_defconfig
	configs/k2hk_hs_evm_defconfig
	configs/k2l_evm_defconfig
	configs/k2l_hs_evm_defconfig
	drivers/usb/host/xhci-keystone.c

Change-Id: I0d708152a220704d24b86c528ee7ace2b0b05a4a
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
(cherry picked from commit 4dd76d0f96ab18a2bda622ec4dac822e908dd069)
2020-01-07 17:24:55 +08:00
Lukasz Majewski 57521aaaf8 UPSTREAM: usb: composite: Move bitmap related operations to ./include/linux/bitmap.h
The BITMAP related operations can now be moved to ./include/linux/bitmap.h
file to mimic the Linux kernel directory tree.

This change also allows to remove the lin_gadget_compat.h header file
(which is a legacy code only for composite U-boot layer).
It was also possible to remove #includes from several USB gadget drivers.

Conflicts:
	include/usb/lin_gadget_compat.h

Change-Id: Id61d6f9cef89ca238f082f430f6d01ac1009aa07
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Agner <stefan.agner@toradex.com>
(cherry picked from commit 916fa097997a5e1b70768ce944de28e038d4bebf)
2020-01-07 17:24:55 +08:00
Jean-Jacques Hiblot 72d48a52ff UPSTREAM: dwc3: move phy operation to core.c
Those operations can be used for peripheral operation as well as host
operation.

Change-Id: Ifa3b83bd690cd11f6750fd893e6ac36b2a0214b3
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit d648a50c0a27452a5439e7982b23b97c64820430)
2020-01-07 17:24:54 +08:00
Jean-Jacques Hiblot 20828bbaa7 UPSTREAM: dm: usb: create a new UCLASS ID for USB gadget devices
UCLASS_USB_DEV_GENERIC was meant for USB devices connected to host
controllers, not gadget devices.
Adding a new UCLASS for gadget devices alone.

Also move the generic DM code for USB gadgets in a separate file for
clarity.

Conflicts:
	board/sunxi/board.c

Change-Id: I9bd01ad0814b81f7718927660a8ece4080c5f988
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 0131162439508801b9f8a330fa731f04273c9337)
2020-01-07 17:24:54 +08:00
Jean-Jacques Hiblot 256dc48f87 UPSTREAM: usb: udc: implement DM versions of usb_gadget_initialize()/_release()/_handle_interrupt()
When DM_USB_GADGET the platform code for the USB device must be replaced by
calls to a USB device driver.

usb_gadget_initialize() probes the USB device driver.
usb_gadget_release() removes the USB device driver.

Change-Id: I759a0d192d4baafeb188cfad4b3a08b5d2d05c23
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 ff8d75583487eb69bcb6f036088d979c76db3753)
2020-01-07 17:24:53 +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
Sven Schwermer 3739bf7e20 UPSTREAM: usb: s/CONFIG_DM_USB/CONFIG_IS_ENABLED(DM_USB)/
This allows to disable the USB driver model in SPL because it checks
the CONFIG_SPL_DM_USB variable for SPL builds. Nothing changes for
regular non-SPL builds.

Conflicts:
	drivers/usb/host/ehci-atmel.c
	drivers/usb/host/xhci-fsl.c

Change-Id: If6c980c620cf97c1dd131f60953c305e34dba505
Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit fd09c205fc57b90a782cac33449ef172575d0a8c)
2020-01-07 17:24:53 +08:00
Mugunthan V N 81cd885546 UPSTREAM: usb: common: add support to get maximum speed from dt
Add support to get maximum speed from dt so that usb drivers
makes use of it for DT parsing.

Change-Id: I3c809fd822813efbb5d7494c36803eb9f502e466
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
(rebase and fix errors)
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 59592b99d884f0524a29afe4a412bbed65cfc5b7)
2020-01-07 17:24:51 +08:00
Neil Armstrong 977da8af08 UPSTREAM: clk: Add get/enable/disable/release for a bulk of clocks
This patch adds a "bulk" API to the clock API in order to get/enable/disable
/release a group of clocks associated with a device.

This bulk API will avoid adding a copy of the same code to manage
a group of clocks in drivers.

Conflicts:
	drivers/clk/clk-uclass.c

Change-Id: I7f992b206662bf5f931a835d98b3e3cd0f4347f1
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit a855be87da49ba750e83ecc526235fe33099f76e)
2020-01-07 17:24:50 +08:00
Neil Armstrong 2a2b09e3d9 UPSTREAM: reset: fix bulk API when DM_RESET is disabled
In the commit "reset: Add get/assert/deassert/release for bulk of reset signals"
the disabled reset_release_bulk() and reset_get_bulk() used the wrong
struct clk_bulk instead of struct reset_ctl_bulk.

Change-Id: Id98f7a6f6f4d5f2fca88f71b6254ca3795888d85
Fixes: 0c28233903b5 ("reset: Add get/assert/deassert/release for bulk of reset signals")
Reported-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 1dd181ff2b3009405d12ad0b3782176490da2446)
2020-01-07 17:24:50 +08:00
Neil Armstrong d794029665 UPSTREAM: reset: Add get/assert/deassert/release for bulk of reset signals
This patch adds a "bulk" API to the reset API in order to get/deassert/
assert/release a group of reset signals associated with a device.

This bulk API will avoid adding a copy of the same code to manage
a group of reset signals in drivers.

Change-Id: Iabad4ac36791622b6560cff8aafc6bfbc4c9bde3
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 0c28233903b5af9a7f41b3200993cfa197b35719)
2020-01-07 17:24:50 +08:00
Maxime Ripard b466df35fb UPSTREAM: usb: gadget: usb_ether: Move settings to common
The usb_ether gadget duplicates the USB settings for the manufacturer,
product ID and vendor ID.

Make sure we use the common option so that we can expect a single VID/PID
couple for a single device.

Change-Id: I71cabacc3dcf5a7335996b2ddaf812e1c97b097b
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 10ac57fda3ff46a20af7ded6cc03d78e88032495)
2020-01-07 17:24:45 +08:00
Maxime Ripard 473221da5a UPSTREAM: usb: gadget: Make g_dnl USB settings common
The g_dnl USB settings for the vendor ID, product ID and manufacturer are
actually common settings that can and should be shared by all the gadgets.

Make them common by renaming them, and convert all the users.

Conflicts:
	configs/cgtqmx6eval_defconfig
	configs/dms-ba16-1g_defconfig
	configs/evb-rk3036_defconfig
	configs/evb-rk3229_defconfig
	configs/evb-rv1108_defconfig
	configs/fennec-rk3288_defconfig
	configs/stih410-b2260_defconfig

Change-Id: Ib855d37af9f539ef794a2519c75c027e67bd091c
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit a95aee6af70d8815547b81329125f2800c8ee37c)
2020-01-07 17:24:45 +08:00
Maxime Ripard 68e15c2b92 UPSTREAM: usb: gadget: usb_ether: Move the interfaces to Kconfig
We need to select an interface for the usb_ether gadget, and they haven't
been converted to Kconfig yet. Add a choice to make sure we have an option
selected, and convert all the users.

Change-Id: Idd2f234e7538672e2002d14eb2b11893f2751a66
Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit d2f0f4af4b655de9c63976be659288c88ae23953)
2020-01-07 17:24:44 +08:00
Maxime Ripard 74fae1c7e9 UPSTREAM: usb: gadget: Convert USB_ETHER to Kconfig
The USB Ethernet gadget option has not yet been moved to Kconfig, let's
deal with that.

Change-Id: Ie970ea4a67b81012f1c6382b38a04fac00c6ee75
Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 3f33d3c8f4cc1b19a4a74e185bd3b6910f30e00f)
2020-01-07 17:24:44 +08:00
Maxime Ripard 17c5fbc90d UPSTREAM: usb: gadget: Move USBNET_HOST_ADDR to Kconfig
While the USB Ethernet device address is already defined in Kconfig, the
host address isn't. Convert it.

Change-Id: I527f287a8714bd460a2261a9b4ba6be71e8ee436
Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit c163668a4abaeef3eaab22b4a5ac13d2d74f1306)
2020-01-07 17:24:44 +08:00
Ramon Fried f7f4c6d79a UPSTREAM: bug.h: introduce WARN_ONCE
Add WARN_ONCE definition to allow single time notification
of warnings to the user.
Taken from Linux kernel (4.17) with slight changes
(Removed __section(.data.once))

Change-Id: I815e26ffd253395ae7f3d120c83f0ee421bb627e
Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
[trini: Drop the musb and dwc3 compat versions]
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 948f32c8563568a76153f61ee4094c5aafe21eaf)
2020-01-07 17:24:43 +08:00
Bin Meng 7832d01e49 UPSTREAM: usb: sandbox: Fix emulator device select logic in usb_emul_find_devnum()
Current emulator select logic in usb_emul_find_devnum() is to test
the USB address. The USB address of the device being enumerated is
initialized to zero at the beginning of the enumeration process in
usb_setup_device(). At this point, the saved USB address in the
platform data has not been assigned to any valid USB address either.
This means: the logic will select an emulator device according to
its sequence of declaring order in the device tree. Take test.dts
for example, flash-stick@0 will be selected before flash-stick@1.
But unfortunately such logic is wrong.

In fact USB devices show up in a random order during the enumeration
which means usb_emul_find_devnum() may be called on port 3 for keyb@3
before on port 0 for flash-stick@0.

To fix this, we introduce a new emulator uclass specific platdata
to store the USB device's port number on its parent hub, and update
the logic to test the port number instead.

Change-Id: Idbe23382957153d66a4c45f5f7789e002cd65a2f
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 84aa8536f0197e439832f56cc7b554af488fc3c8)
2020-01-07 17:24:43 +08:00
Bin Meng 929b32f8c5 UPSTREAM: dm: usb: emul: Drop usb_emul_reset()
With the root hub unbinding in usb_stop(), there is no need to do
a Sandbox-specific reset operation. usb_emul_reset() is no longer
used anywhere, drop it.

Change-Id: I07087b328686bcf0020a938fcd4ea8ac74396b9b
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit ad56e4b684a97565cdce15c28df1ccff9032d594)
2020-01-07 17:24:43 +08:00
Bin Meng 8e28812768 UPSTREAM: usb: emul: Expose find_descriptor() as a public API
This can be useful outside of the sandbox usb emulation uclass
driver. Expose it as a public API with a proper prefix (usb_emul_).

Change-Id: Ic7819416c6e4b6201aaa7ea46d033002aed5ad06
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 848436a48d21447fc78bef67a4cbf11392536de2)
2020-01-07 17:24:42 +08:00
Bin Meng 879f76fc34 UPSTREAM: usb: emul: Remove maxpacketsize in usb_emul_setup_device()
This parameter is never used.

Change-Id: I83dd997f267bc0f7ccabd3ba360df68163e2e634
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 98b639fc503e16cffa902d3ab89b29b9b5dcbf57)
2020-01-07 17:24:42 +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
Rob Clark 1fa8dee876 UPSTREAM: efi_loader: add device-path utils
Helpers to construct device-paths from devices, partitions, files, and
for parsing and manipulating device-paths.

For non-legacy devices, this will use u-boot's device-model to construct
device-paths which include bus hierarchy to construct device-paths.  For
legacy devices we still fake it, but slightly more convincingly.

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

Change-Id: I9825d4132ec08bef46a3b5b7c6946a5636d73ce9
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2020-01-06 11:45:12 +08:00
Peter Jones 9fafdb851e UPSTREAM: efi: add some more device path structures
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit c80214ce1f39a9b9da32dbe941ff83051b03c080)

Change-Id: Ice059bac8f3e6f74c2d95ddca7a3116068484cd2
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2020-01-06 11:45:12 +08:00
Joseph Chen 2f602f70ef include: rk3036: update configures
- define CONFIG_PREBOOT empty;
- add ENV_MEM_LAYOUT_SETTINGS1 for 128M board;
- remove fdt_high to enable relocation skip by android_image_separate().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9390cf4dd000a0e7a154fd3c3e7b3138d2e63347
2019-12-23 14:48:39 +08:00
Joseph Chen 7ebffaaf20 dm: serial: add "serial_dev_" API for normal serial device
"serial_" API is designed for UART debug and "serial_stub_" API
is designed for stdio device(e.g. keyboard, video, lcd...).

We need new API for normal serial device, e.g. a UART working
with other peripheral device.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ifc2cb2ca9c1d4a395e89ceb5e059ec05a07b1967
2019-12-20 20:54:18 +08:00
Joseph Chen 27e62cd7db lib: avb: implement get_preloaded_partition callback
It works only when verification error is allowed, it avoids
AVB workflow to load the full partition which wastes time.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Icbcd48b7bf97d826663523099c944e269f17b709
2019-12-20 12:39:41 +08:00
Jon Lin fd25a27f53 clk: rockchip: rk3036: add HCLK_sfc
Change-Id: I18ce656c79e2a62190f356d889f39bb561659023
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-12-20 10:03:21 +08:00
Joseph Chen 6527836d2a common: android: rename and export load_android_image()
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I7398b83bff0fd0dedd77834ee2a8ff14f2ae11e0
2019-12-17 15:05:19 +08:00
Joseph Chen bc2416fb95 configs: rk322x: remove fdt_high
We place it at the address lower than 256MB, remove this in order
to enable relocation skip by android_image_separate().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9fbeb9372a99165cbca0c4dc20582a19316e6e48
2019-12-17 14:39:06 +08:00
Joseph Chen e7dc3ddef6 configs: rk3288: remove initrd/fdt high
We place them at the address lower than 256MB, remove this
in order to enable relocation skip by android_image_separate().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic1d5c949572902122547aad830761743dd7ecb05
2019-12-17 14:39:06 +08:00
Joseph Chen 1d09cf29cd lib: bidram: add 4GB+ memory size support
- On ARMv7: LPAE seems to be not friendly that brings a lot of
  compile errors.

- On ARMv8: MMU translate table is static defined by mem_map[]
  and max 4GB as usual. It is not created dynamically according
  to real memory size, that is different from ARMv7.

- 4GB memory is enough for U-Boot on both ARMv7 an ARMv8.

Considering all that, we decide to make max 4GB size to be visiable
for U-Boot, but still pass the real available memory size to kernel
by bidram_fixup() called at late before fixup "/memory" node.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Idd5fa769e940b0618446909f8f9edc39f596f072
2019-12-16 21:01:54 +08:00
Joseph Chen 36d452911c asm-generic: global data: use u64 for bi_dram start/size
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2c253633734e901caf6e3122b4b916f4eb6cd124
2019-12-16 21:01:05 +08:00
Finley Xiao 1f1e1246f6 clk: rockchip: rv1109: Add clock driver
Add basic clock for rv1109 which including cpu, bus, emmc clock init.

Change-Id: I093f9e75bf296b3cc7f0ee8f88496e42857a2d96
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-12-11 15:07:24 +08:00
Joseph Chen 9b4285f197 common.h: include stacktrace.h
dump_stack() is a common function for all modules, place head
file in common.h is convenient for them.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic36c826617116f204e6e416f09b00a8a2061a93f
2019-12-11 11:17:36 +08:00
Joseph Chen e1b9a8426d common: android: support decompress kernel for AVB bootflow
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If253d573384d697338f92b591b28efde9dab48bf
2019-12-10 12:47:52 +08:00
Joseph Chen 3f7fb06b24 common: android: make image separate load mandory
Since this feature is stable and helpful to save boot time,
let't make it mandory.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I36f244c6d319d6b54ed3d54730352c8d5b4cc6bd
2019-12-10 12:47:52 +08:00
Joseph Chen 1d2a3f6ca3 dm: crypto: move head file to crypto.h
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iac0f2e5eec7d0370182f7b6a2c904b4542bbbc37
2019-12-10 08:39:32 +08:00
Guochun Huang e2721f2989 drm/rockchip: lvds: Add support for MEDIA_BUS_FMT_RGB101010_1X7X5_SPWG/JEIDA bus format
Change-Id: I41b14d4a9fa2a19fb6df177eb92c0d2cf1c2fb3b
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2019-12-04 16:23:24 +08:00
Tony Xu 53bea680ec common: write keybox: always write storage flag to security sorage
Change-Id: Iaa536eb51216f46a35ae5999ed19ad5703509b6a
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-11-27 11:31:04 +08:00
Joseph Chen cc3d674144 linux: compiler-gcc: add __cacheline_aligned
Change-Id: I0cc437885aa3a1e6637c1aeee9df718ac61fa914
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-27 11:13:54 +08:00
Joseph Chen 270d4d86b3 core: read: add dev_read_s32_default()
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I174670da004001feafcec568e978d2dfd9f55ef9
2019-11-22 08:42:16 +08:00
Jason Zhu fd633ddcf6 android: add function android_bcb_write
Change-Id: Ie65068dc4fca751a9bcc959c56209aaf4729f638
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-11-22 08:41:53 +08:00
Joseph Chen b18d7a540c board: rockchip: add rv1109 evb support
Add basic support for rv1109 evb.

Change-Id: I88bd871880feffbe745e0d5ed22ec7f02e9caa75
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-19 16:27:41 +08:00
Joseph Chen 0dc037782d arm: rockchip: add RV1109 SOC support
RV1109 is a SoC from Rockchip, which embedded with a
dual-core ARM Cortex-A7 and a risc-v core.

Change-Id: I0e82c6f1487bd7f2948df81055b78553c139e144
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-19 16:18:27 +08:00
Joseph Chen b8dc613cbc Merge branch 'next-dev' into thunder-boot 2019-11-19 16:15:43 +08:00
Joseph Chen c092b1390d common: image: provide BCB offset according to android os version
Rockchip platforms defines BCB message at the 16KB offset of
misc partition while the Google defines it at 0x0 offset.

From Android-Q, the 0x0 offset is mandary on Google VTS.

Change-Id: Iac36d421ed605684353c30bfe0e9982bdd5de065
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-14 11:08:45 +08:00
Joseph Chen bcb84b5d64 dm: sysreset: support mode args for reboot/reset command
Support command like: reboot loader/bootloader/recovery, etc.
It depends on the node whose compatible is "syscon-reboot-mode".

Change-Id: I3ef497c6a4355a0d8be9a277bd77bbee43df57fb
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-12 19:34:04 +08:00
Kever Yang 191d31cd12 rockchip: update CONFIG_SPL_MAX_SIZE to 0x40000
We are using DRAM offset 0~0x40000 as SPL text size, Note that BSS,
STACK and MALLOC may using separate space.

Change-Id: I1d9128b339140569e427fad44dc0a2f3058deaf0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-12 09:59:47 +08:00
Yu YongZhen b754d47013 video/drm: rgb: add S888 mode support
Change-Id: I73c6cec7a35dd5e15110da429b836463cab0a193
Signed-off-by: Yu YongZhen <yuyz@rock-chips.com>
2019-11-05 14:23:48 +08:00
Joseph Chen fc474da559 lib: sha256: add sha256_csum()
Change-Id: I3b053f9c07df0d124cdbde9f905e309bcd11c84e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-05 12:24:10 +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 eb89f0a81d lib: avb: add partition slot append interface
Dump current slot information is helpful.

Change-Id: I872c29b9a67860703951a4e88e9549be17b94eed
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 5704c899ed fdtdec: support pack "kern.dtb" to the end of u-boot.bin
- It provides a way to promise kernel dtb can be loaded successfully
  even when the image is damaged.
- This makes developers easily to add what they what just like a "U-Boot" dtb.
- The kern.dtb file is pack into the end of u-boot.bin while ./dts/kern.dtb
  is exist.

Change-Id: I93a36a9c65ea8719e5610cdcbcc7708e5337c53f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 14:53:45 +08:00
Joseph Chen 9b32339749 fastboot: add Android-Q feature support
Add "fasboot getvar is-userspace" support.

The Android-Q document shows "not allow the flashing of dynamic partitions"
is not aimed at the physical partition(call "super") but its child partitions
(i.e. system, vendor, oem...).

Change-Id: I4e21a9728a1093b68a9d1a08420586f33dcf0117
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-28 09:45:19 +08:00
Joseph Chen 25c13168fe irq: virq: add parent irq enable/disable management
- disable virq chip by default;
- fix bank->use_count little than 0;

Change-Id: I69aa07cc2924dab40eea6524588869361ad8cf66
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-23 11:12:30 +08:00
Tony Xu 86574b32ce common: write_keybox: support write keybox by RKDevInfoWriteTool
Change-Id: I853663623f4550469b676239c44586e5efb6b21f
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-10-22 14:48:33 +08:00
Jason Zhu 15737894e4 mmc: add func mmc_gpio_init_direct in spl
Sometimes we need to reconfigure the eMMC gpio state in spl without
pinctrl driver. So add func mmc_gpio_init_direct to initialize the
eMMC gpio in different platform.

Change-Id: I5917c1bbe474f33dc8ba3f47b6368e4337ee2f35
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-10-18 09:59:04 +08:00
Jason Zhu b4761549e8 rockchip: rk1808: support spl build
Add some spl configs for spl build.

Change-Id: Idc0d3e89c3ac316a540bd6fc7571b68ee440952c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-10-15 08:49:07 +08:00
Lin Jinhan 434d6fd368 crypto: add crypto v2 TRNG support
Change-Id: I25d4e8115e3ab9060d3bc87db06de481e299d6ab
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-10-14 20:57:26 +08:00
Jason Zhu e1c38c9f84 rockchip: common: add mtd_blk spi nor scan support
Change-Id: I74b2c02bf9d23ffe8a3eada92f90132d0742fbea
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-10-09 09:13:32 +08:00
Jason Zhu 69fdc5969f lib: avb: update and modify the avb library
The commit point is updated to google external/avb/
which commit point is 868db2a514bbb02e166fb55b1592b27de8c9680c.

Change-Id: I10f7c0ac356a7666b518b62e59ccb62277668578
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-09-20 08:50:37 +08:00
Joseph Chen b073251d9c include: irq-platform: add IRQ_USB_OTG definition
Change-Id: Id2a85c67b2f29bf97d19fdb50e7a59ded47b1606
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-09-19 15:30:13 +08:00
Kever Yang f117ac95ec rockchip: px30: Update CONFIG_SPL_MAX_SIZE to 0x40000
We are going to update atf base to 0x40000, so that we can use space
0~0x40000 for SPL without relocate for support ATF.
0x40000 should be enough for SPL text, and we have separate BSS and
STACK.

Change-Id: I081d289f10a54d8a98e9f466e1730659f2c712a3
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-09-19 12:48:28 +08:00
Algea Cao 75eb6fceb5 video/drm: Add bridge get_timing interface
Some bridge can't get tv edid such as rk1000 cvbs, but
at present bridge can't provide timing without edid. So
we add get_timing interface to provide timing.

Change-Id: Id74802a3bff8140e3677f6633788aacd021afc91
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-09-17 10:37:51 +08:00
Joseph Chen c9c9fba95e include: compat: remove dump_stack(...)
- We have implement dump_stack() for both ARM and ARM64;
- It was brought back by careless on commit: (28386b6 UPSTREAM: lib: Add hexdump)

Change-Id: I8ebbd46862475485963d2ac835ea4031207d2153
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-09-12 11:30:39 +08:00
Alex Deymo 43d520f312 UPSTREAM: Update include/android_image.h from AOSP
This takes the latest changes from AOSP from the file
include/bootimg/bootimg.h from the repository:
https://android.googlesource.com/platform/system/tools/mkbootimg
and update the U-Boot version with the latest changes.

This file keeps the changes from AOSP to a minimum:
 * Comments were converted from C++ to C style.
 * Code inside __cplusplus #ifdef blocks were removed.
 * C++11 struct extensions replaced with a single struct.

Change-Id: Ifdfa7cc365a28e45ab7f192c121b49f6da99af36
Signed-off-by: Alex Deymo <deymo@google.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
(cherry picked from commit 0b6febfdb3cf9b4a51fa65fbd94f9ab2d7738f32)
2019-09-06 11:45:32 +08:00
Sandy Huang 94d85f7bdd drm/rockchip: add picture aspect ratio define
Change-Id: Ie1d8313afe5f24596a989f7c8f290c734815f036
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-08-29 18:10:28 +08:00
Joseph Chen 7733bf1789 configs: rk3066: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: I1c81f13946b3f8e74b2400f9d12be882e4387b38
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 90ba3aa2da configs: rk322x: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: Ie863ed0627dd8604c8dbc8b59ed8f4197c68bc93
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 1982131941 configs: rk3288: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: Ic5a2df1fbfec0e6d94f9904042db8961aa0abf4d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 56a40692c3 configs: rk3328: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: If806c7736ada2852931f8e06d137658d8cf3c0db
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 975da02e88 configs: rk3368: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: If88b142a81f5cd28f333b9dc901e70619b9ce12b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 99ae836464 configs: rk3399: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: I627ceab0440a1655524904a8c4b11905bcdc830d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 98c1299759 common: android: add android_image_memcpy_separate() interface
This is a encapsulation of android_image_load_separate(). It is used
for AVB boot/recovery.img which has been loaded to ram by AVB bootflow,
and we memcpy kernel/ramdisk/dtb to where we expect.

Change-Id: Iea4ea3404b84e9d3c091954ab27fb8c9d2ad84bc
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:03:08 +08:00
Jason Zhu 4dbf7962f3 rockchip: rk3308: add CONFIG_SYS_SPI_U_BOOT_OFFS
Change-Id: I300eb48b224adacab50121f8b3ad8ba469fc22ee
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-29 11:48:02 +08:00
Joseph Chen bd700d6b80 common: bootm: add bootm state param for arch_preboot_os()
- This makes arch_preboot_os() more flexsible;
- call arch_preboot_os() when BOOTM_STATE_OS_PREP;

Change-Id: Ia4ae3666b8180c993c761ef222acbcff5358ae97
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-23 12:48:57 +08:00
Jason Zhu cbe246677b rockchip: otp: add secure_conf_base & otp_mask_base to platdata
We add secure_conf_base & otp_mask_base to platdata to operate
the secure OTP.

Change-Id: Ie336b2cf61076aa82f7c1987cc3cec7166751452
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-21 12:58:49 +08:00
Jason Zhu 6e12c1dd66 rockchip: otp: move some definition to header file
Change-Id: I82b4afe1adbb5f91f3b3146c3cad14e2873b93c3
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-21 12:58:49 +08:00
Jason Zhu 4569f42498 rockchip: common: add mtd_blk spi nand scan support
Change-Id: Ibe59252b9648b61b733f7154ff91ccb90768715f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-13 14:26:17 +08:00
Joseph Chen 4f9cab2711 dm: fuel gauge: rename fuel_gauge_get_soc() to fuel_gauge_update_get_soc()
New name is more accurate about internal implementation..

Change-Id: I16891f5f614fbb17f1e65e04ef4d8a713c8624f3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 18:11:23 +08:00
Joseph Chen 0f9d23ea98 dm: key: allow power key to skip irq handler init
At sometime, its parent driver would setup the main interrupt(e.g. PMIC).

Change-Id: I8d24266c48f515fc92c3529a5b6aa7a18d181af1
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:32:47 +08:00
Joseph Chen ded32713dc power: pmic: register interrupt controller as a irq chip
So that the child drivers can request their irq through the
generic interrupt framework.

Include: RK805/808/816/817/818.

Change-Id: I5556f2e926e850ac6717a05166eab5e19566d531
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:32:43 +08:00
Joseph Chen 2c4e90c1f8 irq: add irq_handler_enable_suspend_only() interface
Change-Id: I3cda4c3a4ce5928be32eaa8b65ccd4e16946c116
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:26:04 +08:00
Joseph Chen 4176611909 irq: add virq irq-chip support
This patch support the device to add its interrupt controller as "irq chip"
into generic interrupt framework, the other driver can request its child
interrupt like a real hardware irq.

Example for PMIC:
    GIC-\
        |- ...
        |- GPIO-\
                |- ...
                |- PMIC-\
                        |_ virq_0
                        |_ virq_1
                        |_ virq_2
                        |...
                        |_ virq_n

Change-Id: I17716f3db494a85fc22b23ff18042771a6116da8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:26:04 +08:00
Joseph Chen cf34425241 irq: clean up code
Change-Id: I51c2713b7c42fa798fee6971a2c91d867042ef70
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:26:04 +08:00
Joseph Chen 0b84b74a16 rockchip: rk3308: more space for ramdisk image on aarch32
It seems ramdisk image needs more space.

Change-Id: Idcdd9ca5b568132381ee1951be603045e1d09d13
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 15:06:27 +08:00
Boris Brezillon 87a1a21db6 UPSTREAM: mtd: nand: Pass mode information to nand_page_io_req
The NAND sub-layers are likely to need the MTD_OPS_XXX mode information
in order to decide if they should enable/disable ECC or how they should
place the OOB bytes in the provided OOB buffer.

Add a field to nand_page_io_req to pass this information.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Change-Id: Idb70434140c0304cfc97d7f3c52cbeca349fdff8
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit f86787280b37e381f8d82f48583434d62dd16e27)
2019-08-07 17:36:08 +08:00
Sandy Huang a2d2b88ee1 video/drm: rockchip_display: add return value for automatic test
Change-Id: I6cd4f7d4bd738c7f4cf59af3a2daf46365e7c1e9
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-08-06 10:23:50 +08:00
Lin Jinhan e7846385ca crypto: add crypto v2 SHA512 support
Change-Id: Idee2ada3d5da6aef2a170509da2efa6b1f6e4a9d
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-08-05 17:46:03 +08:00