Instead of having every board file to add its own g_dnl_bind_fixup()
implementation, move it to the common imx6 SPL code.
Change-Id: Id8ee1026cbd8cde4b0711829373f99ba58a6363b
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Łukasz Majewski <lukma@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 511db3bf5a27a2f7eca0f60b6adb1eff74bd6df6)
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 an help about the USBNET_DEVADDR Kconfig option to make it clearer what
it's about.
Change-Id: I633f3104bb6bffb703be52f50ee18085d4242f13
Acked-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 74e7997c70d80e4b3de0622fbff3e75f72b8c1ce)
The USBNET_DEVADDR has nothing to do with the USB download gadget, but
rather with the USB Ethernet gadget. Move it out of the if statement.
Change-Id: I03f4abb5326eff247cc1aaeb31ddb7b11b1b06c9
Acked-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 5506ff149d4aa4b76f162a71c2cf68c2b00d38e9)
This patch adds an interface to disable the power in dwc2 driver.
This new interface is called when the device is removed.
Change-Id: I4b00ce5f259abe07971753860fc801ff0ebfa0b0
Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 82e7975b85bea1c2acccf30e6fd11e1a48a7e783)
Common USB code is built whenever USB is enabled (in non-SPL builds).
The USB uclass is built whenever (SPL_)DM_USB is enabled. Both need to
be independent from CMD_USB.
Change-Id: Idb5e7ffeea8cb325855cb2d1b6713d62fe438120
Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit ab5817027f9b4fce25f5f2a3e20577ac55bbd7e0)
This allows building the SPL without driver model for USB. Since
CONFIG_SPL_DM_USB is enabled if and only if CONFIG_DM_USB was enabled
before, this patch does not change the build behaviour.
Change-Id: Icadae3860460b222d01a5cd36371df599724198a
Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 41a25f46044c5f9b57197cfcc931106a3b8327d7)
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)
By enabling BLK by default this is the next driver which needs to get
support for DM_USB. Adding generic DWC3 glue logic which only
parse nodes and read device mode. Based on it probe proper
host/peripheral DWC3 drivers for it.
Change-Id: I946ce3749b0323302426b9a08c70f37297654e33
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 49d674547c5bf668802b4b6a24218205fed957f0)
The patch is preparing dwc3 core for enabling DM_USB with peripheral
driver with using driver model support.
The driver will be bound by the DWC3 wrapper driver based on the
dr_mode device tree entry.
Change-Id: If18bda57dfccaa3df104df5defa326d930a8abbe
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
(Remove dwc3-omap changes)
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 23ba2d6372e45479106922c6241a7a09707bbe08)
devm_zalloc() is already defined in dm/device.h header, so
devm_zalloc can be removed from linux_compact.h beader file.
Change-Id: I33e25cbd18245d689d4599ef2a1e46603128c633
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 0ad3f771b69c0db837f40f6ffd5d41915fc07095)
Including <common.h> pulls in a lot of bloat. What this driver needs
is BIT(), so replace it with <linux/bitops.h>
Change-Id: Ib384a74db503c5fa324dcfd119a095595ba8c663
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 4bb3dac77234b43ce188e2bcb6b439351bea5134)
Add UniPhier platform specific glue layer to support USB3 Host mode
on Synopsys DWC3 IP.
Change-Id: I51194b1b15860f2813029b53ad7e5deec63344ff
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit dc04b35ef2c8c04cb362758ec467777348ef3f15)
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)
At present 'usb tree' shows that the root hub on the Sandbox USB
controller is at full speed. But its device descriptor says it's
USB 2.0, so let's report it as a high speed device.
Change-Id: I95758bc8e0b3730286d461ff1136b797b3a10abd
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 813f74ea47d0f77f809d85619153923a99b07222)
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)
At present the usb hub emulator always reports its downstream port
speed as full speed. Actually it is high speed for sandbox-flash,
and low speed for sandbox-keyb. We can determine the device speed
by checking its device descriptor bcdUSB field, and do the proper
hub port status report based on that.
Change-Id: I1b0848d856fb0e3351bfb5c678cc387d5bb5ca9f
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit d7771f0c5cd429286c7555360d779d21568e3ba0)
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)
1.Support RKNANDC_NAND, RKSFC_NAND and RKSFC_NOR;
2.Adjust Userdata part size to reasonable value.
Change-Id: I20a4264848ba4ccd8385e9dee36cd16391cd517e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
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>
Also, create disk objects for the disk itself, in addition to the
partitions. (UEFI terminology is a bit confusing, a "disk" object is
really a partition.) This helps grub properly identify the boot device
since it is trying to match up partition "disk" object with it's parent
device.
Now instead of seeing devices like:
/File(sdhci@07864000.blk)/EndEntire
/File(usb_mass_storage.lun0)/EndEntire
You see:
/ACPI(133741d0,0)/UnknownMessaging(1d)/EndEntire
/ACPI(133741d0,0)/UnknownMessaging(1d)/HD(0,800,64000,dd904a8c00000000,1,1)/EndEntire
/ACPI(133741d0,0)/UnknownMessaging(1d)/HD(1,64800,200000,dd904a8c00000000,1,1)/EndEntire
/ACPI(133741d0,0)/UnknownMessaging(1d)/HD(2,264800,19a000,dd904a8c00000000,1,1)/EndEntire
/ACPI(133741d0,0)/USB(0,0)/USB(0,0)/USB(0,0)/EndEntire
/ACPI(133741d0,0)/USB(0,0)/USB(0,0)/USB(0,0)/HD(0,800,60000,38ca680200000000,1,1)/EndEntire
/ACPI(133741d0,0)/USB(0,0)/USB(0,0)/USB(0,0)/HD(1,61000,155000,38ca680200000000,1,1)/EndEntire
/ACPI(133741d0,0)/USB(0,0)/USB(0,0)/USB(0,0)/HD(2,20fa800,1bbf8800,38ca680200000000,1,1)/EndEntire
/ACPI(133741d0,0)/USB(0,0)/USB(0,0)/USB(0,0)/HD(3,1b6800,1f44000,38ca680200000000,1,1)/EndEntire
This is on a board with single USB disk and single sd-card. The
UnknownMessaging(1d) node in the device-path is the MMC device,
but grub_efi_print_device_path() hasn't been updated yet for some
of the newer device-path sub-types.
This patch is inspired by a patch originally from Peter Jones, but
re-worked to use efi_device_path, so it doesn't much resemble the
original.
Signed-off-by: Rob Clark <robdclark@gmail.com>
[agraf: s/unsigned/unsigned int/]
Signed-off-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit 884bcf6f65c414dce3b3d2a91e2c9eba0e5e08f8)
Change-Id: I8d891a25dd321b718b0429d8b8a895cc4490f272
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>
Background:
- EDP software register bank is on the EDP 24m clock domain;
- CPU access EDP software register bank, need to go through EDP APB
read/write bus and EDP internal read/write bus;
- EDP APB read/write bus is on the EDP pclk clock domain;
- EDP internal read/write bus is on the EDP 24m clock domain;
- Asynchronous logic circuit is added between APB read/write bus and
Internal read/write bus;
Issue:
There is a bug on the Asynchronous logic circuit between APB read/write
bus and Internal read/write bus; This bug will be random to cause the
following wrong control/address signals sequence happen;
- For write, maybe wrong register address is wrote in;
- For read, maybe wrong register address is read out;
Workaround:
- For CPU write EDP register operation, write any register need
following three steps,
1): Read EDP_BASE+0x00 dummy register firstly, latch the dummy
register address on Reg_Address bus, to avoid next step write to
wrong register to cause function register overrun;
2): 1st time to write the EDP register you want to operate,
to latch the real write address on Reg_Address bus;
3): 2nd time to write the EDP register you want to operate,
to make sure the data is write on the real write address;
- For CPU read EDP register operation, read any register need following
two steps,
1): 1st time to read the EDP register you want to operate, to latch
the real read address on Reg_Address bus;
2): 2nd time to read the EDP register you want to operate, to make
sure the data is read out from the real read address;
Change-Id: I42613145b1d414321ac1aef290a35969a1461e36
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
This function is called to alloc buffer for storage driver
access, make sure the address is cacheline align.
Also better for any module which calls it.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I520d16ea28764671eb566cc96cab744ca6b13fc2
Should be the same as rk3368, otherwise the loader will
verify trust.img failed when secure boot is enabled.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I25ba5b7ad8a1673e09db1167ff780fe0c8c5a95f
"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
some pcb layout dual mipi/lvds channel maybe mistake. we can set
rockchip,dual-channel-swap = <1> to swap the dual channel at dts
file.
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I7398b83bff0fd0dedd77834ee2a8ff14f2ae11ea
blk_read() may return error code if image size is 0, it depends
on block layer implementation.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I29bab10835e9029780a957e871a600a6fbdf6068