Commit Graph

49639 Commits

Author SHA1 Message Date
Marek Vasut b27ae02dfd UPSTREAM: usb: xhci: Add Renesas R-Car xHCI driver
Add firmware V3, firmware loader and XHCI glue for the Renesas R-Car
Gen3 SoCs XHCI controller. Thus far only the R-Car Gen3 R8A7795 ES2.0+
and R8A7796 are supported.

Conflicts:
	drivers/usb/host/Kconfig
	drivers/usb/host/Makefile
	drivers/usb/host/xhci-rcar.c

Change-Id: I3c5417289b4e8b1a54b90a39fa7b426381b761fb
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit e1cc60c0d635408b18a31dcdc2002bba07da21a4)
2020-01-07 17:24:45 +08:00
Jon Nettleton 0e266cad6e UPSTREAM: mvebu: usb: xhci: a38x support
This makes the initial changes need to support the
a38x series of SOCs.  It adds the device-tree identifier
as well as changing the board_support function to take
the IO address designated by device-tree.

Change-Id: I9558197847260da87cd1b74101c7fa0e9c2f37ef
Signed-off-by: Jon Nettleton <jon@solid-run.com>
[baruch: use fdt_addr_t; update 37xx and 8K implementations]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit d3d036af8c0ee848c4113dc609bbd6ab26ebc6cb)
2020-01-07 17:24:45 +08:00
Marek Vasut ed0303ef9d UPSTREAM: usb: Drop the EHCI RCar Gen3
Since we use EHCI generic driver on RCar Gen3 , this driver is useless.
Remove it.

Conflicts:
	drivers/usb/host/ehci-rcar_gen3.c

Change-Id: I09967397444c5442c2466426672840e3398a03b5
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit c322d4b72ba02d7b531e4814c46ed2098f3397f1)
2020-01-07 17:24:45 +08:00
Maxime Ripard 0f3e8dc9d2 UPSTREAM: musb: sunxi: switch to the device model
The device model was implemented so far using a hook that needed to be
called from the board support, without DT support and only for the host.

Switch to probing both in peripheral and host mode through the DT.

Change-Id: Ieec474f3236f6c7e43e94735f1d544d36708bda0
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 3a61b080acee941a1b14b709b58ff9cde0b367bc)
2020-01-07 17:24:45 +08:00
Maxime Ripard 2646d32f70 UPSTREAM: sunxi: provide default USB gadget setup
All the Allwinner boards use the same manufacturer, VID and PID for the
gadgets. Make them the defaults to remove some boilerplate from our
defconfigs.

Change-Id: I53d0e6d45a60645af4b8c0a16afb81e4db97b9f6
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 e02687bda96cc8ed942e14b558796d3043d24b23)
2020-01-07 17:24:45 +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
Fabio Estevam f9cd3a6470 UPSTREAM: toradex: imx6: Move g_dnl_bind_fixup() into common SPL code
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)
2020-01-07 17:24:44 +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
Maxime Ripard 0c3f0a1ec7 UPSTREAM: usb: gadget: Document USBNET_DEVADDR
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)
2020-01-07 17:24:44 +08:00
Maxime Ripard 8f2649d868 UPSTREAM: usb: gadget: Move USBNET_DEVADDR option out of g_dnl
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)
2020-01-07 17:24:44 +08:00
Christophe Kerello 782be0c4f4 UPSTREAM: usb: dwc2: disable external vbus supply when the device is removed
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)
2020-01-07 17:24:44 +08:00
Sven Schwermer c8f2d7ee94 UPSTREAM: usb: Remove CMD_USB dependency for common code
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)
2020-01-07 17:24:44 +08:00
Sven Schwermer 7f10e9b86f UPSTREAM: usb: Introduce CONFIG_SPL_DM_USB
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)
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
Michal Simek e2f919a1c4 UPSTREAM: usb: dwc3: Add generic DWC3 glue logic driver
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)
2020-01-07 17:24:43 +08:00
Mugunthan V N 434f82ed08 UPSTREAM: usb: dwc3: Add dwc3_init/remove with DM_USB
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)
2020-01-07 17:24:43 +08:00
Mugunthan V N b6985a2105 UPSTREAM: drivers: usb: dwc3: remove devm_zalloc from linux_compact
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)
2020-01-07 17:24:43 +08:00
Masahiro Yamada 1488d4b92d UPSTREAM: usb: dwc3-uniphier: replace <common.h> with <linux/bitops.h>
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)
2020-01-07 17:24:43 +08:00
Masahiro Yamada ecf8ea9ffa UPSTREAM: usb: dwc3: add UniPhier specific glue layer
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)
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 20419987e8 UPSTREAM: usb: sandbox: Initialize root hub's device speed to high speed
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)
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 dc007f395f UPSTREAM: usb: emul: hub: Report the actual device speed of the emulation device
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)
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
Jon Lin 9cde1b1d03 test: storage: support rkflash
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>
2020-01-07 11:08:20 +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 a0955e7ebd UPSTREAM: efi_loader: use proper device-paths for partitions
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>
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
Wyon Bi 52db8715b4 video/drm: analogix_dp: Workaround async issue between pclk clock and 24m clock
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>
2020-01-02 17:14:31 +08:00
Joseph Chen faf4a351fc configs: rk1806: use rk1806-evb.dts
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6b0c8ea9882ae70945b33331f80137f4724a7f3e
2019-12-30 10:24:03 +08:00
Joseph Chen f4c9b02d9e rockchip: dts: add rk1806-evb.dts
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic0ef2210f190bb8e229c1d97eb3b78447335e56c
2019-12-30 10:24:03 +08:00
Joseph Chen 1ce69de6f2 lib: sysmem: promise sysmem_alloc_by_name() alloc cacheline align buffer
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
2019-12-24 21:04:55 +08:00
Joseph Chen 398d3e80fb make.sh: add sub command to build envtools
command:
	./make.sh env

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8736042dd31da17f9998dae969d5f607c42ec563
2019-12-24 20:52:18 +08:00
Jon Lin 771645931b configs: rk3036: enable CONFIG_RKSFC_NOR
Change-Id: I1c5ad37110d0bdc0f3847bd972fa7f7fb679b3fa
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Signed-off-by: Hans Yang <yhx@rock-chips.com>
2019-12-24 17:32:20 +08:00
Hans Yang 64ba9ad7e9 make.sh: support rk3036 build trust.img/uboot.img 512KB
Change-Id: I71360722bfbf16dcafd54b7a2d14fff2fc5bc5d1
Signed-off-by: Hans Yang <yhx@rock-chips.com>
2019-12-24 16:52:36 +08:00
Joseph Chen 85975b101c make.sh: add big endian sha256 for rk3368h
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
2019-12-24 16:04:00 +08:00
Joseph Chen ea9b5c12f7 configs: rk3036: remove unused modules
rk3036 is usual for linux os.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0ad8559eaa47d28ce979ddff05c50a376d63899a
2019-12-23 14:48:39 +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 5d5f363eb9 rockchip: board: init debug uart if not use pre-loader serial
Pre-loader serial has higher priority.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Idd736b78454f7bc662abe61d25bbfa3a3e4c0d90
2019-12-20 13:09:06 +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
Jason Zhu 260e24d205 rockchip: dts: rk3326: support eMMC hs200
Change-Id: Ib0cf27fe1a1fc3bc53d3440ead2631b53fc9f8b2
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-12-20 12:32:14 +08:00
Sandy Huang 289af5f4ba drm/rockchip: add dual channel swap config
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
2019-12-20 12:31:43 +08:00
Joseph Chen b6b05c7154 common: android: skip blk read and memcpy if image size is 0
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
2019-12-20 10:53:44 +08:00
Jon Lin 7edaca2270 rkflash: support SPI Nor gpt update
Change-Id: I8469f7141f2b4e62340e8f8b7b25038ab7d19f44
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-12-20 10:06:59 +08:00