fix: ioctl() should return error code but not capability.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8030a1842692697f32f87e765ce3d68d1adb1c11
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
This patch updates the RC driver to accommodate the new framework
Signed-off-by: Lei Chen <lei.chen@rock-chips.com>
Change-Id: I3ff2b5844ce5f1776ac2f94b3cbd42eb5d73cc41
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
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
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>
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>
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/)
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)
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)
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
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
only allow fit image if CONFIG_FIT_SIGNATURE is enabled.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I96b713a2a3eb0b148bda4215a99288b379d66efe
Use it to make sure which firmware can be bring up.
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ib2cec8bf7c78fa436efade0518b07c3193170c7b
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
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>
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>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Saving it for late use, eg: fit verified boot process.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6643fb643f2fd88795d80fc5bd21025b62dc6943
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>
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)
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>
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>
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>
AVB bootflow allocs large memory from system now.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2ed9c7e1d48d9ff3187f02eda03e7ad3089ed26e
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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>
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>
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>
"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
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
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
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
- 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
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
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
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>
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>
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>
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>
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>
- 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>
- 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>
- 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>
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>
- disable virq chip by default;
- fix bank->use_count little than 0;
Change-Id: I69aa07cc2924dab40eea6524588869361ad8cf66
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
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>
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>
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>
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>
- 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>
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)
Since AVB use sysmem alloc, we can decrease malloc size.
Change-Id: I1c81f13946b3f8e74b2400f9d12be882e4387b38
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Since AVB use sysmem alloc, we can decrease malloc size.
Change-Id: Ie863ed0627dd8604c8dbc8b59ed8f4197c68bc93
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Since AVB use sysmem alloc, we can decrease malloc size.
Change-Id: Ic5a2df1fbfec0e6d94f9904042db8961aa0abf4d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Since AVB use sysmem alloc, we can decrease malloc size.
Change-Id: If806c7736ada2852931f8e06d137658d8cf3c0db
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Since AVB use sysmem alloc, we can decrease malloc size.
Change-Id: If88b142a81f5cd28f333b9dc901e70619b9ce12b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Since AVB use sysmem alloc, we can decrease malloc size.
Change-Id: I627ceab0440a1655524904a8c4b11905bcdc830d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
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>
- 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>
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>
New name is more accurate about internal implementation..
Change-Id: I16891f5f614fbb17f1e65e04ef4d8a713c8624f3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
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>
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>
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>
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)