]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
15 months agotools: mkimage: Add StarFive SPL image support
Heinrich Schuchardt [Sun, 17 Sep 2023 11:47:30 +0000 (13:47 +0200)]
tools: mkimage: Add StarFive SPL image support

The StarFive JH7110 base boards require a header to be prefixed to the SPL
binary image. This has previously done with a vendor tool 'spl_tool'
published under a GPL-2-or-later license. Integrate this capability into
mkimage.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: Chanho Park <chanho61.park@samsung.com>
Tested-by: Milan P. Stanić <mps@arvanta.net>
15 months agostarfive: visionfive2: add mmc0 and nvme boot targets
Milan P. Stanić [Mon, 18 Sep 2023 08:32:29 +0000 (10:32 +0200)]
starfive: visionfive2: add mmc0 and nvme boot targets

boot from SDIO3.0 (mmc sdcard) first if it is plugged.
If mmc is not plugged try to boot from emmc if it is plugged.
If emmc is not plugged then try to boot from nvme.

Signed-off-by: Milan P. Stanić <mps@arvanta.net>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
15 months agoconfigs: NVMe/USB target boot devices on VisionFive 2
Heinrich Schuchardt [Thu, 7 Sep 2023 13:53:36 +0000 (15:53 +0200)]
configs: NVMe/USB target boot devices on VisionFive 2

Make NVMe and USB target boot devices on the StarFive VisionFive 2 board.
The boot devices are sorted by decreasing device speed.

CONFIG_PCI_INIT_R=y is set via [1]. 'start usb' is added to CONFIG_PREBOOT
by the same patch.

[1] [PATCH v1 1/2] configs: starfive: Enable PCIE auto enum and NVME/USB stuff for Starfive Visionfive 2
    https://lore.kernel.org/u-boot/TY3P286MB2611C9AD6E5BB3756A959E89981FA@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
15 months agoriscv: set fdtfile on VisionFive 2
Heinrich Schuchardt [Thu, 7 Sep 2023 11:21:28 +0000 (13:21 +0200)]
riscv: set fdtfile on VisionFive 2

Multiple revisions of the StarFive VisionFive 2 board exist. They can be
identified by reading their EEPROM.

Linux uses two differently named device-tree files. To load the correct
device-tree we need to set $fdtfile to the device-tree file name that
matches the board revision.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
15 months agoMerge branch '2023-09-19-tidy-up-some-kconfig-options' into next
Tom Rini [Tue, 19 Sep 2023 21:44:18 +0000 (17:44 -0400)]
Merge branch '2023-09-19-tidy-up-some-kconfig-options' into next

- Re-organize and tidy up some of our Kconfig options

15 months agoboot: Join ARCH_FIXUP_FDT_MEMORY with related options
Simon Glass [Thu, 14 Sep 2023 16:55:59 +0000 (10:55 -0600)]
boot: Join ARCH_FIXUP_FDT_MEMORY with related options

Move this to be with the other devicetree-fixup options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoboot: Drop CMD_MTDPARTS condition for FDT_FIXUP_PARTITIONS
Simon Glass [Thu, 14 Sep 2023 16:55:58 +0000 (10:55 -0600)]
boot: Drop CMD_MTDPARTS condition for FDT_FIXUP_PARTITIONS

This is not needed, so drop it. Also use a capital 'O' for the option,
while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoboot: Join FDT_FIXUP_PARTITIONS with related options
Simon Glass [Thu, 14 Sep 2023 16:55:57 +0000 (10:55 -0600)]
boot: Join FDT_FIXUP_PARTITIONS with related options

Move this to be with the other devicetree-fixup options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoMake ARCH_FIXUP_FDT_MEMORY depend on OF_LIBFDT
Simon Glass [Thu, 14 Sep 2023 16:55:56 +0000 (10:55 -0600)]
Make ARCH_FIXUP_FDT_MEMORY depend on OF_LIBFDT

We need CONFIG_OF_LIBFDT to be able to do fdt fixups, so add that
condition.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoMark DISTRO_DEFAULTS as deprecated
Simon Glass [Thu, 14 Sep 2023 16:55:55 +0000 (10:55 -0600)]
Mark DISTRO_DEFAULTS as deprecated

Standard boot has been in place for a while now. Quite a few problems
have been found and fixed. It seems like a good time to mark the
script-based approach as deprecated and encourage people to use standard
boot.

Update the DISTRO_DEFAULTS Kconfig to encourage people to move to
standard boot, which is able to boot Linux distributions automatically.

Add a short migration guide to make this easier.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoKconfig: Move TEXT_BASE et al under general setup
Simon Glass [Thu, 14 Sep 2023 16:55:54 +0000 (10:55 -0600)]
Kconfig: Move TEXT_BASE et al under general setup

These don't relate to booting. Move them out of there and into the same
place as the other related settings.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoboot: Make standard boot a menu
Simon Glass [Thu, 14 Sep 2023 16:55:53 +0000 (10:55 -0600)]
boot: Make standard boot a menu

Collect these options into a menu for easier viewing.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoKconfig: Move SPL_FIT under FIT
Simon Glass [Thu, 14 Sep 2023 16:55:52 +0000 (10:55 -0600)]
Kconfig: Move SPL_FIT under FIT

This option already depends on FIT, so put it under the same umbrella, so
that it appears in the FIT menu.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agospl: Drop SPL/TPL_RAM_SUPPORT option for SPL_LOAD_FIT_ADDRESS
Simon Glass [Thu, 14 Sep 2023 16:55:51 +0000 (10:55 -0600)]
spl: Drop SPL/TPL_RAM_SUPPORT option for SPL_LOAD_FIT_ADDRESS

All boards which actually define this address enable SPL_LOAD_FIT, or at
least just rely on the default value of 0. So drop the dependency.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agospl: Tidy up load address in spl_ram
Simon Glass [Thu, 14 Sep 2023 16:55:50 +0000 (10:55 -0600)]
spl: Tidy up load address in spl_ram

This CONFIG is used but is not given a value by some boards. Use
a default value of 0 explicitly, rather than relying on the 0 value
provided by CONFIG_SPL_LOAD_FIT_ADDRESS

This will allow us to make SPL_LOAD_FIT_ADDRESS depend on SPL_LOAD_FIT
as it should.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoKconfig: Create a menu for FIT
Simon Glass [Thu, 14 Sep 2023 16:55:49 +0000 (10:55 -0600)]
Kconfig: Create a menu for FIT

This is a major feature with a lot of options. Give it its own menu to
tidy up the 'make menuconfig' display. Drop the 'depends on FIT' pieces
which are now unnecessary, since they are now bracketed by an 'if FIT'.

Leave CONFIG_TIMESTAMP out since it affects legacy images too.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoboot: Rename Android-boot text
Simon Glass [Thu, 14 Sep 2023 16:55:48 +0000 (10:55 -0600)]
boot: Rename Android-boot text

Phrases like 'Enable support for' are pointless since this is an option
which enables things. Drop that part so it is easier to follow.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoboot: Move some other fdt-fixup options to the same menu
Simon Glass [Thu, 14 Sep 2023 16:55:47 +0000 (10:55 -0600)]
boot: Move some other fdt-fixup options to the same menu

Move more options relating to fixing up a device tree into the new
devicetree-fixup menu.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoMove fdt_simplefb to boot/
Simon Glass [Thu, 14 Sep 2023 16:55:46 +0000 (10:55 -0600)]
Move fdt_simplefb to boot/

This relates to booting, so move it there. Create a new Kconfig menu for
things related to devicetree fixup.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoboot: Move fdt_support to boot/
Simon Glass [Thu, 14 Sep 2023 16:55:45 +0000 (10:55 -0600)]
boot: Move fdt_support to boot/

This relates to booting since it fixes up the devicetree for the OS. Move
it into the boot/ directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agotest: Move POST under a renamed Testing section
Simon Glass [Thu, 14 Sep 2023 16:55:44 +0000 (10:55 -0600)]
test: Move POST under a renamed Testing section

Rename Unit tests to Testing, since it is a stretch to describe some of
the tests as unit tests. Move POST there as well, so it doesn't show up
by itself in the top-level menu.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoFWU: Avoid showing an unselectable menu option
Simon Glass [Thu, 14 Sep 2023 16:55:43 +0000 (10:55 -0600)]
FWU: Avoid showing an unselectable menu option

Use a menuconfig to avoid showing a menu which cannot be selected in many
cases.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
15 months agovideo: Move the BMP options
Simon Glass [Thu, 14 Sep 2023 16:55:42 +0000 (10:55 -0600)]
video: Move the BMP options

These appear prominently in the main menu at present. Move them to the
video Kconfig where they belong.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agovideo: Move bmp code to drivers/video
Simon Glass [Thu, 14 Sep 2023 16:55:41 +0000 (10:55 -0600)]
video: Move bmp code to drivers/video

This relates to graphics which is only active when CONFIG_VIDEO is
enabled. Move it into that directory.

For most boards there is no harm in compiling it always, since it if not
used it will be dropped by the linker. But for the EFI app this is not
the case, so retain use of the BMP Kconfig.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoKconfig: Move API into general setup
Simon Glass [Thu, 14 Sep 2023 16:55:40 +0000 (10:55 -0600)]
Kconfig: Move API into general setup

This is perhaps not a commonly used feature so should not have its own
option in the main menu. Move it under general setup.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agolib: rational: Move the Kconfigs into the correct place
Simon Glass [Thu, 14 Sep 2023 16:55:39 +0000 (10:55 -0600)]
lib: rational: Move the Kconfigs into the correct place

These should not be part of the 'system tables' menu. Move them outside
on their own.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 7d0f3fbb93c ("lib: rational: copy the rational fraction lib...")
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoMerge branch '2023-09-18-assorted-TI-platform-updates' into next
Tom Rini [Tue, 19 Sep 2023 15:14:03 +0000 (11:14 -0400)]
Merge branch '2023-09-18-assorted-TI-platform-updates' into next

- A few assorted DT updates and minor fixes for TI platforms

15 months agoarm: dts: k3-am642: Sync with kernel v6.6-rc1
Nishanth Menon [Mon, 11 Sep 2023 14:44:01 +0000 (09:44 -0500)]
arm: dts: k3-am642: Sync with kernel v6.6-rc1

Sync device tree with v6.6-rc1

Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agodt-bindings: ti-serdes: Deprecate header with constants with v6.6-rc1
Nishanth Menon [Mon, 11 Sep 2023 14:44:00 +0000 (09:44 -0500)]
dt-bindings: ti-serdes: Deprecate header with constants with v6.6-rc1

The constants to define the idle state of SERDES MUX were defined in
bindings header. They are used only in DTS and driver uses the dt property
to set the idle state making it unsuitable for bindings.
The constants are moved to header next to DTS ("arch/arm/boot/dts/")
and all the references to bindings header are removed.
So add a warning to mark this bindings header as deprecated.

We could probably drop this header, but let us wait for kernel to
cleanup.

Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoarm: dts: k3*: Use local header for SERDES MUX idle-state values
Nishanth Menon [Mon, 11 Sep 2023 14:43:59 +0000 (09:43 -0500)]
arm: dts: k3*: Use local header for SERDES MUX idle-state values

The DTS uses constants for SERDES MUX idle state values which were earlier
provided as bindings header. But they are unsuitable for bindings.
So move these constants in a header next to DTS.

NOTE: sync with v6.6-rc1 will bring in this change naturally.

Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoarm: dts: Introduce k3-serdes.h from v6.6-rc1
Nishanth Menon [Mon, 11 Sep 2023 14:43:58 +0000 (09:43 -0500)]
arm: dts: Introduce k3-serdes.h from v6.6-rc1

Introduce the new serdes header from kernel v6.6-rc1

The DTS uses constants for SERDES MUX idle state values which were earlier
provided as bindings header. But they are unsuitable for bindings.
So move these constants in a header next to DTS.

Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoarm: dts: k3-am625: Sync with kernel v6.6-rc1
Nishanth Menon [Mon, 11 Sep 2023 14:02:56 +0000 (09:02 -0500)]
arm: dts: k3-am625: Sync with kernel v6.6-rc1

Sync device tree with v6.6-rc1

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoarm: dts: k3-pinctrl: Sync with kernel v6.6-rc1
Nishanth Menon [Mon, 11 Sep 2023 14:02:55 +0000 (09:02 -0500)]
arm: dts: k3-pinctrl: Sync with kernel v6.6-rc1

Sync pinctrl header with v6.6-rc1

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agodrivers: misc: k3_avs: Add Linux compatibles to maintain sync
Reid Tonking [Thu, 7 Sep 2023 18:06:35 +0000 (13:06 -0500)]
drivers: misc: k3_avs: Add Linux compatibles to maintain sync

The ti,j7200-vtm and ti,j721e-vtm compatibles are used for voltage
and thermal monitoring (VTM) by (drivers/thermal/k3_j72xx_bandgap.c)
in Linux, but the same hardware is used for adaptive voltage scaling
(AVS) in u-boot, This brings both drivers in line with the same
compatibles.

Since the j7200 uses the config as the j721e, the data is inherited
from j721e vs creating a duplicate

Signed-off-by: Neha Francis <n-francis@ti.com>
Signed-off-by: Reid Tonking <reidt@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
15 months agotools: logos: Rename TI logo files
Nikhil M Jain [Fri, 1 Sep 2023 10:39:13 +0000 (16:09 +0530)]
tools: logos: Rename TI logo files

Change the file name from ti.gz and ti.bmp to ti_logos_414x97_32bpp to
help user understand the resolution and identify the logo files when
placed in the boot partition and update the splashfile name with the
same in .env file.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
15 months agoam33xx: ignore return value from usb_ether_init()
Trevor Woerner [Thu, 31 Aug 2023 02:49:50 +0000 (22:49 -0400)]
am33xx: ignore return value from usb_ether_init()

In 2cb43ef1c223 ("usb: ether: Fix error handling in usb_ether_init") the error
handling of usb_ether_init() was changed. Not a single other call site of this
function checks its return value, therefore follow suit in the am33xx code.

Do not cause the boot to halt if the usb gadget ethernet initialization fails:

initcall sequence 9ffdbd84 failed at call 808024b9 (err=-19)
### ERROR ### Please RESET the board ###

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Reviewed-by: Michal Suchánek <msuchanek@suse.de>
15 months agoMerge branch 'next' of git://source.denx.de/u-boot-usb into next
Tom Rini [Sat, 16 Sep 2023 16:14:08 +0000 (12:14 -0400)]
Merge branch 'next' of git://source.denx.de/u-boot-usb into next

- Rework gadget device handling

15 months agoboard: usb: Replace legacy usb_gadget_handle_interrupts()
Marek Vasut [Fri, 1 Sep 2023 09:50:03 +0000 (11:50 +0200)]
board: usb: Replace legacy usb_gadget_handle_interrupts()

The usb_gadget_handle_interrupts() is no longer used anywhere,
replace the remaining uses with dm_usb_gadget_handle_interrupts()
which takes udevice as a parameter.

Some of the UDC drivers currently ignore the index parameter altogether,
those also ignore the udevice and have to be reworked. Other like the
dwc3_uboot_handle_interrupt() had to be switched from index to udevice
look up to avoid breakage.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on khadas vim3
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agodm: usb: udc: Drop legacy udevice handler functions
Marek Vasut [Fri, 1 Sep 2023 09:50:02 +0000 (11:50 +0200)]
dm: usb: udc: Drop legacy udevice handler functions

Remove legacy functions limited by the dev_array array,
those are no longer used anywhere, all the code uses
plain udevice based access now.

The usb_gadget_handle_interrupts() is doing udevice look up
until all call sites use dm_usb_gadget_handle_interrupts().

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agousb: gadget: ether: Use plain udevice for UDC controller interaction
Marek Vasut [Fri, 1 Sep 2023 09:50:01 +0000 (11:50 +0200)]
usb: gadget: ether: Use plain udevice for UDC controller interaction

Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agousb: gadget: acm: Use plain udevice for UDC controller interaction
Marek Vasut [Fri, 1 Sep 2023 09:50:00 +0000 (11:50 +0200)]
usb: gadget: acm: Use plain udevice for UDC controller interaction

Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agothordown: Use plain udevice for UDC controller interaction
Marek Vasut [Fri, 1 Sep 2023 09:49:59 +0000 (11:49 +0200)]
thordown: Use plain udevice for UDC controller interaction

Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agosdp: Use plain udevice for UDC controller interaction
Marek Vasut [Fri, 1 Sep 2023 09:49:58 +0000 (11:49 +0200)]
sdp: Use plain udevice for UDC controller interaction

Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agospl: sdp: Detach the controller on error
Marek Vasut [Fri, 1 Sep 2023 09:49:57 +0000 (11:49 +0200)]
spl: sdp: Detach the controller on error

In case anything errors out during the SDP transfer, detach
the controller instead of bailing out right away. This way,
the controller can be reattached on next attempt.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agodfu: Use plain udevice for UDC controller interaction
Marek Vasut [Fri, 1 Sep 2023 09:49:56 +0000 (11:49 +0200)]
dfu: Use plain udevice for UDC controller interaction

Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agodfu: Detach the controller on error
Marek Vasut [Fri, 1 Sep 2023 09:49:55 +0000 (11:49 +0200)]
dfu: Detach the controller on error

In case anything errors out during the DFU registration, detach
the controller instead of bailing out right away. This way, the
controller can be reattached on next attempt.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agocmd: ums: Use plain udevice for UDC controller interaction
Marek Vasut [Fri, 1 Sep 2023 09:49:54 +0000 (11:49 +0200)]
cmd: ums: Use plain udevice for UDC controller interaction

Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on khadas vim3
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agocmd: thordown: Reorder variable declaration
Marek Vasut [Fri, 1 Sep 2023 09:49:53 +0000 (11:49 +0200)]
cmd: thordown: Reorder variable declaration

Move the variable declaration around to improve code readability.
No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agocmd: sdp: Reorder variable declaration
Marek Vasut [Fri, 1 Sep 2023 09:49:52 +0000 (11:49 +0200)]
cmd: sdp: Reorder variable declaration

Move the variable declaration around to improve code readability.
No functional change.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agocmd: rockusb: Use plain udevice for UDC controller interaction
Marek Vasut [Fri, 1 Sep 2023 09:49:51 +0000 (11:49 +0200)]
cmd: rockusb: Use plain udevice for UDC controller interaction

Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agocmd: fastboot: Use plain udevice for UDC controller interaction
Marek Vasut [Fri, 1 Sep 2023 09:49:50 +0000 (11:49 +0200)]
cmd: fastboot: Use plain udevice for UDC controller interaction

Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on khadas vim3
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agoconfigs: sandbox: Enable DM_USB_GADGET
Marek Vasut [Fri, 1 Sep 2023 09:49:49 +0000 (11:49 +0200)]
configs: sandbox: Enable DM_USB_GADGET

Switch sandbox to DM_USB_GADGET, DM is the future.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agousb: sandbox: Add DM_USB_GADGET support
Marek Vasut [Fri, 1 Sep 2023 09:49:48 +0000 (11:49 +0200)]
usb: sandbox: Add DM_USB_GADGET support

Remove local usb_gadget_register_driver()/usb_gadget_unregister_driver()
implementation which is implemented in udc-core.c instead if DM_USB_GADGET
is enabled. Add no-op dm_usb_gadget_handle_interrupts() implementation.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agodm: usb: udc: Factor out plain udevice handler functions
Marek Vasut [Fri, 1 Sep 2023 09:49:47 +0000 (11:49 +0200)]
dm: usb: udc: Factor out plain udevice handler functions

Pull the functionality of UDC uclass that operates on plain udevice
and does not use this dev_array array into separate functions and
expose those functions, so that as much code as possible can be
switched over to these functions and the dev_array can be dropped.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agoMerge branch '2023-09-14-remove-NEEDS_MANUAL_RELOC' into next
Tom Rini [Thu, 14 Sep 2023 20:23:49 +0000 (16:23 -0400)]
Merge branch '2023-09-14-remove-NEEDS_MANUAL_RELOC' into next

To quote the author:

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

This is a follow up on way over decade old commit
2e5167ccad93 ("Replace CONFIG_RELOC_FIXUP_WORKS by CONFIG_NEEDS_MANUAL_RELOC")
"
By now, the majority of architectures have working relocation
support, so the few remaining architectures have become exceptions.
To make this more obvious, we make working relocation now the default
case, and flag the remaining cases with CONFIG_NEEDS_MANUAL_RELOC.
"
It took a bit longer than expected, but now we can really sunset
CONFIG_NEEDS_MANUAL_RELOC.

Make it so.

15 months agopost: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:15 +0000 (23:30 +0200)]
post: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agowdt: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:14 +0000 (23:30 +0200)]
wdt: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agotimer: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:13 +0000 (23:30 +0200)]
timer: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agosysreset: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:12 +0000 (23:30 +0200)]
sysreset: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agospi: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:11 +0000 (23:30 +0200)]
spi: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agoserial: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:10 +0000 (23:30 +0200)]
serial: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agonet: phy: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:09 +0000 (23:30 +0200)]
net: phy: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agonet: miiphybb: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:08 +0000 (23:30 +0200)]
net: miiphybb: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agonet: eth: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:07 +0000 (23:30 +0200)]
net: eth: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agomtd: ubifs: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:06 +0000 (23:30 +0200)]
mtd: ubifs: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agosf: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:05 +0000 (23:30 +0200)]
sf: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agohwspinlock: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:04 +0000 (23:30 +0200)]
hwspinlock: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agogpio: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:03 +0000 (23:30 +0200)]
gpio: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocrypto: rsa: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:02 +0000 (23:30 +0200)]
crypto: rsa: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocpu: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:01 +0000 (23:30 +0200)]
cpu: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agofs: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:30:00 +0000 (23:30 +0200)]
fs: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agoimage: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:59 +0000 (23:29 +0200)]
image: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agoinitcall: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:58 +0000 (23:29 +0200)]
initcall: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agoenv: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:57 +0000 (23:29 +0200)]
env: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agodm: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:56 +0000 (23:29 +0200)]
dm: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocmd: pxe: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:55 +0000 (23:29 +0200)]
cmd: pxe: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocmd: onenand: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:54 +0000 (23:29 +0200)]
cmd: onenand: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocmd: nvedit: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:53 +0000 (23:29 +0200)]
cmd: nvedit: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocmd: i2c: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:52 +0000 (23:29 +0200)]
cmd: i2c: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocmd: date: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:51 +0000 (23:29 +0200)]
cmd: date: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocmd: bmp: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:50 +0000 (23:29 +0200)]
cmd: bmp: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocommon: stdio: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:49 +0000 (23:29 +0200)]
common: stdio: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocommon: hash: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:48 +0000 (23:29 +0200)]
common: hash: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocommon: event: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:47 +0000 (23:29 +0200)]
common: event: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocommon: malloc: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:46 +0000 (23:29 +0200)]
common: malloc: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocommon: hush: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:45 +0000 (23:29 +0200)]
common: hush: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocommon: board_r: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:44 +0000 (23:29 +0200)]
common: board_r: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agocommand: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:43 +0000 (23:29 +0200)]
command: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agoblkcache: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:42 +0000 (23:29 +0200)]
blkcache: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agoboot: Remove unused NEEDS_MANUAL_RELOC code bits
Marek Vasut [Wed, 6 Sep 2023 21:29:41 +0000 (23:29 +0200)]
boot: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agoMerge branch '2023-09-13-phy-improvements' into next
Tom Rini [Wed, 13 Sep 2023 22:02:28 +0000 (18:02 -0400)]
Merge branch '2023-09-13-phy-improvements' into next

- YT8511 and BCM54210E PHY support, cleanup and then use
  generic_phy_valid more, and then further clean up
  generic_{setup,shutdown}_phy()

15 months agophy: Refactor generic_{setup, shutdown}_phy() to reduce complexity
Jonas Karlman [Thu, 31 Aug 2023 23:07:11 +0000 (23:07 +0000)]
phy: Refactor generic_{setup, shutdown}_phy() to reduce complexity

Refactor generic_{setup,shutdown}_phy() to reduce complexity and
indentation. This have no intended functional change.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
15 months agophy: Return success from generic_setup_phy() when phy is not found
Jonas Karlman [Thu, 31 Aug 2023 23:07:10 +0000 (23:07 +0000)]
phy: Return success from generic_setup_phy() when phy is not found

Restore the old behavior of ehci_setup_phy() and ohci_setup_phy() to
return success when generic_phy_get_by_index() return -ENOENT.

Fixes: 84e561407a5f ("phy: Add generic_{setup,shutdown}_phy() helpers")
Fixes: 10005004db73 ("usb: ohci: Make usage of generic_{setup,shutdown}_phy() helpers")
Fixes: 083f8aa978a8 ("usb: ehci: Make usage of generic_{setup,shutdown}_phy() helpers")
Fixes: 75341e9c16aa ("usb: ehci: Remove unused ehci_{setup,shutdown}_phy() helpers")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
15 months agophy: Fix generic_setup_phy() return value on power on failure
Jonas Karlman [Thu, 31 Aug 2023 23:07:08 +0000 (23:07 +0000)]
phy: Fix generic_setup_phy() return value on power on failure

generic_phy_exit() typically return 0 for a struct phy that has been
initialized with a generic_phy_init() call.

generic_setup_phy() returns the value from a generic_phy_exit() call
when generic_phy_power_on() fails. This hides the failed state of the
power_on ops from the caller of generic_setup_phy().

Fix this by ignoring the return value of the generic_phy_exit() call and
return the value from the generic_phy_power_on() call.

Fixes: 84e561407a5f ("phy: Add generic_{setup,shutdown}_phy() helpers")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
15 months agovideo: rockchip: dw_mipi_dsi: Use generic_phy_valid() helper
Jonas Karlman [Thu, 31 Aug 2023 22:16:40 +0000 (22:16 +0000)]
video: rockchip: dw_mipi_dsi: Use generic_phy_valid() helper

The documentation for struct phy state that "The content of the
structure is managed solely by the PHY API and PHY drivers".

Change to use the generic_phy_valid() helper to check if phy is valid.

Fixes: b7d8d40346f2 ("video: rockchip: dw_mipi_dsi: Fix external phy existence check")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
15 months agonet: zynq: Use generic_phy_valid() helper
Jonas Karlman [Thu, 31 Aug 2023 22:16:38 +0000 (22:16 +0000)]
net: zynq: Use generic_phy_valid() helper

The documentation for struct phy state that "The content of the
structure is managed solely by the PHY API and PHY drivers".

Change to use the generic_phy_valid() helper to check if phy is valid.

Fixes: 10c50b1facbf ("net: zynq: Add support for PHY configuration in SGMII mode")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
15 months agoscsi: ceva: Use generic_phy_valid() helper
Jonas Karlman [Thu, 31 Aug 2023 22:16:37 +0000 (22:16 +0000)]
scsi: ceva: Use generic_phy_valid() helper

The documentation for struct phy state that "The content of the
structure is managed solely by the PHY API and PHY drivers".

Change to use the generic_phy_valid() helper to check if phy is valid.

Fixes: f6f5451d469b ("scsi: ceva: Enable PHY and reset support")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
15 months agousb: dwc3: Use generic_phy_valid() helper
Jonas Karlman [Thu, 31 Aug 2023 22:16:36 +0000 (22:16 +0000)]
usb: dwc3: Use generic_phy_valid() helper

The documentation for struct phy state that "The content of the
structure is managed solely by the PHY API and PHY drivers".

Change to use the generic_phy_valid() helper to check if phy is valid.
Also remove setting phy->dev to NULL now that generic_phy_get_by_name()
properly initialize phy->dev to NULL.

Fixes: 142d50fbce7c ("usb: dwc3: Add support for usb3-phy PHY configuration")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
15 months agophy: Set phy->dev to NULL when generic_phy_get_by_index_nodev() fails
Jonas Karlman [Thu, 31 Aug 2023 22:16:35 +0000 (22:16 +0000)]
phy: Set phy->dev to NULL when generic_phy_get_by_index_nodev() fails

Generic phy helpers typically use generic_phy_valid() to determine if
the helper should perform its function on a passed struct phy.
generic_phy_valid() treat any struct phy having phy->dev set as valid.

With generic_phy_get_by_index_nodev() setting phy->dev to a valid struct
udevice early, there can be situations where the struct phy is returned
as valid when initialization in fact failed and returned an error.

Fix this by setting phy->dev back to NULL when any of the calls to
of_xlate ops, device_get_supply_regulator or phy_alloc_counts fail. Also
extend the dm_test_phy_base test with a test where of_xlate ops fail.

Fixes: 72e5016f878d ("drivers: phy: add generic PHY framework")
Fixes: b9688df3cbf4 ("drivers: phy: Set phy->dev to NULL when generic_phy_get_by_index() fails")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
15 months agophy: Set phy->dev to NULL when generic_phy_get_by_name() fails
Jonas Karlman [Thu, 31 Aug 2023 22:16:33 +0000 (22:16 +0000)]
phy: Set phy->dev to NULL when generic_phy_get_by_name() fails

generic_phy_get_by_name() does not initialize phy->dev to NULL before
returning when dev_read_stringlist_search() fails. This can lead to an
uninitialized or reused struct phy erroneously be report as valid by
generic_phy_valid().

Fix this issue by initializing phy->dev to NULL, also extend the
dm_test_phy_base test with calls to generic_phy_valid().

Fixes: b9688df3cbf4 ("drivers: phy: Set phy->dev to NULL when generic_phy_get_by_index() fails")
Fixes: 868d58f69c7c ("usb: dwc3: Fix non-usb3 configurations")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>