Commit graph

84899 commits

Author SHA1 Message Date
Jonas Karlman
d11f0dac30 mmc: rockchip_dw_mmc: Fix get_mmc_clk return value
The get_mmc_clk ops is expected to set a clock rate and return the
configured rate as an unsigned value. However, if clk_set_rate fails,
e.g. using a fixed rate clock, a negative error value is returned.

The mmc core will treat this as a valid unsigned rate and tries to
configure a divider based on this bogus clock rate.

Use 0 as the return value when setting clock rate fails, the mmc core
will configure to use bypass mode instead of using a bogus divider.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-03-19 13:20:21 +08:00
Jonas Karlman
42a502ad1a rockchip: tinker-rk3288: Use common BOOT_TARGET_DEVICES
Building U-Boot for Tinker Board with USB or NET Kconfig option disabled
result in the following build error:

  In file included from include/configs/rk3288_common.h:29,
                   from include/configs/tinker_rk3288.h:14,
                   from include/config.h:3,
                   from include/common.h:16,
                   from env/common.c:10:
  include/config_distro_bootcmd.h:302:9: error: expected '}' before 'BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB'
    302 |         BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  include/config_distro_bootcmd.h:302:9: note: in definition of macro 'BOOTENV_DEV_NAME_USB'
    302 |         BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  include/configs/tinker_rk3288.h:21:9: note: in expansion of macro 'BOOTENV_DEV_NAME'
     21 |         func(USB, usb, 0) \
        |         ^~~~
  include/config_distro_bootcmd.h:454:25: note: in expansion of macro 'BOOT_TARGET_DEVICES'
    454 |         "boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0"
        |                         ^~~~~~~~~~~~~~~~~~~
  include/config_distro_bootcmd.h:474:9: note: in expansion of macro 'BOOTENV_BOOT_TARGETS'
    474 |         BOOTENV_BOOT_TARGETS \
        |         ^~~~~~~~~~~~~~~~~~~~
  include/configs/rk3288_common.h:40:9: note: in expansion of macro 'BOOTENV'
     40 |         BOOTENV
        |         ^~~~~~~
  include/env_default.h:122:9: note: in expansion of macro 'CFG_EXTRA_ENV_SETTINGS'
    122 |         CFG_EXTRA_ENV_SETTINGS
        |         ^~~~~~~~~~~~~~~~~~~~~~
  In file included from env/common.c:32:
  include/env_default.h:29:36: note: to match this '{'
     29 | const char default_environment[] = {
        |                                    ^
  make[2]: *** [scripts/Makefile.build:256: env/common.o] Error 1

The BOOT_TARGET_DEVICES defined in rockchip-common.h include the same
devices as defined in tinker_rk3288.h, remove the board specific one to
fix building with USB or NET option disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-03-19 13:20:21 +08:00
Jonas Karlman
e259f39a12 rockchip: rk3588: Add boot device detection
Enable SPL on RK3588 to detect which device it was booted from.
Fixes use of same-as-spl in u-boot,spl-boot-order prop.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-03-19 13:20:21 +08:00
Jonas Karlman
67a1d773e7 clk: rockchip: rk3588: Fix clk_aux16m in clock driver
The rate and error value is not returned for aux16m clocks, fix this.

Fixes: 7a474df740 ("clk: rockchip: Add rk3588 clk support")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-03-19 13:17:28 +08:00
Peter Geis
a67e219d0c clk: rockchip: rk3568: Fix reset handler
The reset handler for rk3568 is missing its private data. This leads to
an abort when a reset is triggered.

  => reset
  resetting ...
  "Synchronous Abort" handler, esr 0x96000045
  elr: 0000000000a2bc04 lr : 0000000000a2bbd4 (reloc)
  elr: 00000000eff9bc04 lr : 00000000eff9bbd4
  x0 : 00000000fdd20000 x1 : 0000000014000001
  x2 : 000000000000fdb9 x3 : 00000000edf77e88
  x4 : 00000000edf50e78 x5 : 00000000edf77530
  x6 : 000000000000001d x7 : 00000000edf8a1d0
  x8 : 00000000ffffffd8 x9 : 0000000000000008
  x10: 000000000000000d x11: 0000000000000006
  x12: 000000000001869f x13: 0000000086c290c5
  x14: 000000009118e878 x15: 0000000000000000
  x16: 00000000eff9bbb8 x17: 0000000012f8c119
  x18: 00000000edf50dc0 x19: 0000000000000000
  x20: 0000000000000001 x21: 0000000000000000
  x22: 00000000edf85900 x23: 0000000000000001
  x24: 00000000effe8bbc x25: 0000000000000000
  x26: 00000000edf85940 x27: 0000000000000000
  x28: 0000000000000000 x29: 00000000edf3c8e0

  Code: d65f03c0 d5033fbf b9400661 529d9502 (b8216802)
  Resetting CPU ...

Add the missing dev_set_priv to the rk3568 clk driver to fix this.

Fixes: 4a262feba3 ("rockchip: rk3568: add clock driver")
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Tested-by: Jagan Teki <jagan@amarulasolutions.com> # radxa-cm3
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2023-03-19 13:17:28 +08:00
Jonas Karlman
073d911ae6 rockchip: rk3568-rock-3a: Sync device tree from linux
Running U-Boot from eMMC on a ROCK 3 Model A result in the following:

  U-Boot SPL 2023.04-rc3 (Mar 11 2023 - 17:24:48 +0000)
  Trying to boot from MMC1
  Card did not respond to voltage select! : -110
  spl: mmc init failed with error: -95
  SPL: failed to boot from all boot devices
  ### ERROR ### Please RESET the board ###

The sdhci node is missing in board device tree, sync device tree from
linux v6.3-rc1 to fix booting from eMMC. Also disable sdmmc2 and uart1
nodes related to using a WiFi and BT module in the M2 slot.

Fixes: b44c54f600 ("arm64: dts: rockchip: rk3568: Add Radxa ROCK 3 Model A board support")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-03-19 13:17:28 +08:00
Jonas Karlman
42f67fb51c rockchip: rk3568: Fix boot device detection
The boot source node path for emmc is using the old sdhci name.
Replace with correct mmc name and also add same-as-spl to boot order.

Fixes: 0d61f8e5f1 ("rockchip: rk3568: add boot device detection")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-03-19 13:17:28 +08:00
Jonas Karlman
8653e5d3b7 rockchip: Fix early use of bootph props
Running U-Boot on a ROCK 3 Model A result in the following:

  No serial driver found
  resetting ...
  no sysreset
  ### ERROR ### Please RESET the board ###

Replace bootph- props with u-boot,dm- props to fix this.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-03-19 13:17:28 +08:00
Tom Rini
318af47668 Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-coldfire 2023-03-15 12:03:17 -04:00
Tom Rini
016d414682 Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Per Andre:

[T]hese two patches containing just devicetree updates for
Allwinner boards.
I was still hoping for a review, since we cannot import the files from
the Linux tree verbatim, but managed to write some filter script that
convinced me that the changes are fine.
The files are from Linux v6.2-rc2, but are identical to the v6.2
release.
2023-03-15 12:01:55 -04:00
Angelo Dureghello
791840fdc4 board: m5253demo: remove floating point flash size calculation
This board is using floating point arithmetic to display
the SST39VF6401B flash size.

This actually generates errors with toolchains without
appropriate sw fp math functions available.

SST39VF6401B is the only flash for wich the size is displayed,
it's size is 8192KB and floating point calculation seems not
needed. Removing it.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
2023-03-15 01:52:15 +01:00
Angelo Dureghello
ec4322e70b m68k: add private libgcc ashrdi3
Add ashrdi3.c to private libgcc.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
2023-03-15 01:52:02 +01:00
Angelo Dureghello
36a5ebf841 board: amcore: fix config options namespace
Remove CONFIG_ namespace options from .h, moving them to
defconfig, while changing non-defconfig options to CFG_ namespace.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
2023-03-15 01:45:19 +01:00
Angelo Dureghello
7ff7b46e6c m68k: rename CONFIG_MCFTMR to CFG_MCFTMR
This is not a Kconfig option so changing to _CFG.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
2023-03-15 01:41:57 +01:00
Angelo Dureghello
12f5489297 m68k: dts: stmark2: set correct compatible field for spi nor
Fix error:

Invalid chip select 0:1 (err=-19)

update spi nor "compatible" property with "jedec,spi-nor"
to have spi nor properly bound as a child device.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
2023-03-15 01:38:19 +01:00
Angelo Dureghello
1e48392e32 arch: enable private libgcc for m68k
This patch fixes u-boot hanging on the first printf("%x", val).

Some toolchains built without multilib enabled may produce
u-boot freezing on first u64 shift operation, as in
lib/vsprintf.c number() function.
Using our private libgcc solves the issue.

Setting private libgcc enabled at architecture level to avoid
similar issues, it should not harm.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
2023-03-15 01:38:19 +01:00
Angelo Dureghello
461cca7997 board: stmark2: fix clock value
Fix totally blank console at boot, clock value must be decimal,
as for the 30Mhz external crystal.

Fixes: 26e5944ec9 ("stmark2: Migrate CONFIG_SYS_EXTRA_OPTIONS to Kconfig")
Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-03-15 01:38:19 +01:00
Angelo Dureghello
8fde9d13b9 m68k: add global variable sdhc_per_clk for m68k
The FSL eSDHC controller supports two reference clocks. They are
platform clock and periperhal clock. The global variable sdhc_clk
has already been used for platform clock.
ColdFire also uses eSHDC controller, as in arm and powerpc,
so adding sdhc_per_clk to arch_global_data.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
2023-03-15 01:38:19 +01:00
Angelo Dureghello
d157a5725a m68k: use longword-based jumps
Increasing of binary size requires longword-based jumps.

Signed-off-by: Angelo Durgehello <angelo.dureghello@timesys.com>
2023-03-15 01:38:19 +01:00
Angelo Dureghello
cc1c2a2423 board: amcore: fix u-boot mtd partition
Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
2023-03-15 01:38:19 +01:00
Tom Rini
88e08fc5f6 Prepare v2023.04-rc4
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-03-13 20:52:48 -04:00
Tom Rini
218cf0e096 Pull request for efi-2023-04-rc4
Documentation:
 
 * man-page for panic command
 
 UEFI:
 
 * Correct parameter check for SetVariable()
 
 Other:
 
  * Provide unit test for crc8
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmQPMpwACgkQxIHbvCwF
 GsQVQA//WHuCAJg1mjVjGtmhMS/eWMgJun4fipZhUbmCZ9cxnB3EXfyZxnQo3o1G
 huYbIB5zVMZSDiJdRk0v3xlOjjq/YQETygURdVZ+biXYbY2ggdJQy5ulGaWKXTnR
 ISczFvNr/1UyoS9r2lJkG4+xgetRDzhGx05iFUkIIDEJi6UlKzTq9yHrtsUViL42
 9XuNmRmWk/RMRUmO+tGLqASvDkPxDeltjLIL+sQEN8BAhKckRhhiGt7Ft/KNXBTz
 kHutHVsKhPSqrQRFbn9sUEmNoTZIVoa4zJlvAzKRD5leFt878SKPRCptmiXL90ao
 I2QKQBwINhrUFFxX+giut5FAtLNu4ut8zXo16mX65iefQ64Q8q4H7RQm+x8IDu77
 4L4qxu7RWFSgD971Kl2O8VSm0J5OAHFpaE7S9n8M34Dc++clC5dX7ooApzUCjBTT
 idQxxEn7RLDcqfIfg+3Fw+4zeNUAG8g6bSg3w5jnxfk+CCuJecxyzOzxXvZwcYFe
 lmnt3aZNv47jaDWLOGLAOnVpGn9d9nHeRItK7In1tfQt1dfkg3bJUa3aBLloEQ/w
 TdQDBrWll3IEMOZCFRjYzY+i6my5Os+Zuw+1Sb7KJnNjjg+DI14wMvMADvZFB4an
 rls8Amm8RMkOeVVufB+nDB/9qyvdtxZCudg2cjwFZmnvtE6nJvY=
 =0URM
 -----END PGP SIGNATURE-----

Merge tag 'efi-2023-04-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-04-rc4

Documentation:

* man-page for panic command

UEFI:

* Correct parameter check for SetVariable()

Other:

 * Provide unit test for crc8
2023-03-13 11:39:21 -04:00
Heinrich Schuchardt
d3970e04e7 efi_loader: describe term_get_char()
Add a function description.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-03-13 13:56:14 +01:00
Masahisa Kojima
26a35023c4 efi_loader: update SetVariable attribute check
UEFI specification v2.10 says that
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and
EFI_UNSUPPORTED should be returned in SetVariable variable service.
Current implementation returns EFI_INVALID_PARAMETER,
let's fix the return value.

Together with above change, this commit also updates the SetVariable
attribute check to be aligned with the EDK2 reference implementation.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-03-13 13:56:14 +01:00
Heinrich Schuchardt
5ee8d90f54 doc: man-page for panic command
Provide a man-page for the panic command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-13 13:56:14 +01:00
Vincent Stehlé
ac2ac69080 doc: uefi: fix links
Fix a couple of links so that they are rendered correctly with sphinx.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-03-13 13:56:14 +01:00
Heinrich Schuchardt
3080ddf970 test: unit test for crc8
Add a unit test for the crc8() function.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-13 13:56:14 +01:00
Tom Rini
1247fc7de8 Merge https://source.denx.de/u-boot/custodians/u-boot-usb
Two minimal Kconfig/Makefile fixes for USB.
2023-03-10 19:10:14 -05:00
Tom Rini
0e823300f5 Merge https://source.denx.de/u-boot/custodians/u-boot-sh
Assorted Renesas fixes below, namely MMC clocking breakage fix, clock
Kconfig fix, pin control unused symbols removal, and sysinfo fix and
enablement on now fixed platforms.
2023-03-10 19:09:59 -05:00
Tom Rini
6c1cdf158c fixes and tests for the fdt command
-----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAmQLmIQRHHNqZ0BjaHJv
 bWl1bS5vcmcACgkQfxc6PpAIreZ+pgf/YIoUDOMVFtAQ6gZqaF5fPvLUGb10aPpI
 UmjNU87MJ4DJ8DXMAf14MNU4QsEiiz9gZmmrcA9pQ5/fN4BdN4TGi9BSvC287wYv
 CZ5u0OQAz4GrY+3zq+sbj6R+qKHgSDzzMu+EPZcXjtqgY0rgMoThdbLCtkciNLrZ
 8NiINL10cI/RhhhN3mNje7aGzJNmU1KWqfcWBIr0f/c8b8MUKA6N4AQUhR8wABQC
 sR/mS6zBlgFGaOWOHAWt9xDvFEDKzfJerRAAlz9xEd0QirUF0GyQBJd5vTzkIaTT
 Lme8zMI6iy/yKs+wZcfchfYY3tkpyue5U61jKplJOPUEl2dfrBly/w==
 =yoN9
 -----END PGP SIGNATURE-----

Merge tag 'dm-pull-10mar23' of https://source.denx.de/u-boot/custodians/u-boot-dm

fixes and tests for the fdt command
2023-03-10 16:01:52 -05:00
Tam Nguyen
ae08097faa ARM: dts: renesas: Enable sysinfo on R-Car D3 Draak
Enable support for sysinfo on R-Car D3 Draak board. The sysinfo is used
e.g. to access and decode board-specific information and then in turn
used by board-info to print those information.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Tam Nguyen <tam.nguyen.xa@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Drop compatible from I2C node, this is in r8a77995.dtsi already.
        Drop status = "okay" from EEPROM node.
	Add dts: tag.
	Fix Kconfig EEPROM address to be 0x50 and match the DT, sync config.]
2023-03-10 17:46:09 +01:00
Tam Nguyen
c8eaebb426 ARM: dts: renesas: Enable sysinfo on R-Car V3H Condor/Condor-I
Add new sysinfo IDs for R-Car V3H Condor/Condor-I .

Enable support for sysinfo on R-Car V3H Condor/Condor-I. The sysinfo is
used e.g. to access and decode board-specific information and then in
turn used by board-info to print those information.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Tam Nguyen <tam.nguyen.xa@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Drop compatible from I2C node, this is in r8a77980.dtsi already.
        Drop status = "okay" from EEPROM node.
	Add dts: tag.
	Update the commit message, note the new sysinfo IDs.
	Fix Kconfig EEPROM address to be 0x50 and match the DT, sync config.]
2023-03-10 17:46:09 +01:00
Tam Nguyen
b791b9cf55 sysinfo: rcar3: Fix Draak and Eagle board code
Correct the board code ID based on the hardware documentation

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Tam Nguyen <tam.nguyen.xa@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-10 17:46:09 +01:00
Marek Vasut
ce46817215 pinctrl: renesas: Drop non-existent PFC info table entries
Remove PFC info table entries which are never instantiated,
since there are no drivers for those. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-10 17:46:09 +01:00
Marek Vasut
3efdf01fa4 clk: renesas: Always select DM_RESET to prevent inobvious failure of rst_gen3 subdriver
The CLK_RCAR_GEN3 registers two subdrivers, clk_gen3 and rst_gen3.
The former depends on the clock framework, which is always enabled
in this context of clock framework driver, while the later depends
on reset framework which may not always be enabled.

Ensure the reset framework is also always enabled to prevent inobvious
early boot time bind failure of the CPG driver, which leads to system
showing no activity and is difficult to debug.

Note that one possible approach to debug this is to use CONFIG_DEBUG_UART
and add debug printascii()s into the drivers/clk/renesas/clk-rcar-gen3.c .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-10 17:46:09 +01:00
Marek Vasut
f20a61af42 mmc: renesas-sdhi: Add proper probe error fail path
In case one of the calls in probe fail, trigger a fail path and
undo all the steps done in probe until the point of failure.
The current implementation failed to stop controller clock and
free claimed clock, so fix that. Furthermore, print return code
in error prints for easier debugging.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-10 17:45:47 +01:00
Marek Vasut
6ddffa89cb mmc: renesas-sdhi: Always configure default SDnH clock rate to 800 MHz
The prior stage bootloader might have left the SDnCKCR register in completely
arbitrary state before passing control to U-Boot, which includes the register
being populated with incorrect values. Currently the SDHI driver will attempt
to use clock framework to configure SDn clock, which may fail in case SDnCKCR
contains invalid values for the SDnH clock, because the clock framework would
not be able to determine SDnH clock rate and would get -EINVAL instead, which
in turn would not allow the clock framework to determine the correct SDn clock
divider ratio.

This failure occurs specifically in case SDnCKCR reads back 0x209 .

Correct the problem by first setting default SDnH clock rate to 800 MHz, thus
assuring the SDnCKCR SDnH bits are correct, and only afterward set up the SDn
clock rate to default 200 MHz.

Note that the SDHI driver may reconfigure SDnH clock later based on IOS
settings obtained from the attached card, the 800 MHz set up here is only
the default value.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-10 17:45:47 +01:00
Heinrich Schuchardt
4042ce73c8 usb: move CONFIG_USB_HUB_DEBOUNCE_TIMEOUT to USB
This configuration setting is only relevant if the board supports USB.
It should not be in the main menu but in the USB menu.

The setting is only relevant in USB host mode.

Fixes: 5454dea313 ("usb: hub: allow to increase HUB_DEBOUNCE_TIMEOUT")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2023-03-10 17:31:31 +01:00
Heinrich Schuchardt
fe61da8c75 usb: USB hubs require host mode
USB hubs run in host mode not in gadget mode. Hence, compiling usb_hub.c
should not be selected by CONFIG_USB_GADGET.

Suggested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2023-03-10 17:31:31 +01:00
Marek Vasut
aa89aebb17 test: cmd: fdt: Test fdt bootcpu
Add 'fdt bootcpu' test which works as follows:
- Create basic FDT, map it to sysmem
- Print the FDT bootcpu
- Set the FDT bootcpu and read the value back using 'fdt header get'
- Perform the previous step twice to validate bootcpu overwrite

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:48 -08:00
Marek Vasut
caec1be706 test: cmd: fdt: Test fdt rm
Add 'fdt rm' test which works as follows:
- Create fuller FDT, map it to sysmem
- Selectively delete nodes or properties by both path and aliases
- Verify created nodes or properties using fdt print command

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:48 -08:00
Marek Vasut
e7c7878455 test: cmd: fdt: Test fdt mknode
Add 'fdt mknode' test which works as follows:
- Create fuller FDT, map it to sysmem
- Create node either in / or subnode
- Attempt to create node over existing node, which fails
- Attempt to create subnodes in non-existing nodes or aliases
- Verify created nodes using fdt list command

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:48 -08:00
Marek Vasut
a6bcd977f9 test: cmd: fdt: Test fdt set
Add 'fdt set' test which works as follows:
- Create fuller FDT, map it to sysmem
- Set either existing property to overwrite it, or new property
- Test setting both single properties as well as string and integer arrays
- Test setting to non-existent nodes and aliases
- Verify set values using 'fdt get value'

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:48 -08:00
Marek Vasut
55d0f982f3 test: cmd: fdt: Test fdt get size
Add 'fdt get size' test which works as follows:
- Create fuller FDT, map it to sysmem
- Get size of various properties
- Get node count of available nodes
- Test non-existent nodes and properties

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:48 -08:00
Marek Vasut
1b025afca4 test: cmd: fdt: Test fdt get addr
Add 'fdt get addr' test which works as follows:
- Create fuller FDT, map it to sysmem
- Get address of various properties
- Compare addresses calculated by UT and fdt command

This test is special in that it has to go through gruesome remapping scheme
where the test calculates:
- pointer offsets of the generated FDT root and the property being tested
- map_sysmem() result of environment variable "fdtaddr" and the one set
  by the test matching address of property being tested
- difference between the later and the former, to obtain offset of the
  DT property from start of DT
The offsets must match in both the UT and the tested U-Boot, if they do
not, the test fails.

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:48 -08:00
Marek Vasut
4e22e12e3f test: cmd: fdt: Test fdt get name
Add 'fdt get name' test which works as follows:
- Create fuller FDT, map it to sysmem
- Get name of / node 0, 1 and /clk-test node 0
- Compare output and validate the node name
- Get name of / node 2 and /clk-test node 1
- Compare output and validate the node is not present
- Get name of / node -1 and /clk-test node -1
- Compare output and validate the node name equals node 0 name
- Check nonexistent node, verify the command errors out

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:48 -08:00
Marek Vasut
4efea813ef test: cmd: fdt: Test fdt resize
Add 'fdt resize' test which works as follows:
- Create simple FDT with extra size 0, map it to sysmem
- 'resize' the FDT by 0x2000 bytes
- Verify the new space has been added to the FDT

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:48 -08:00
Marek Vasut
79bcd809f4 test: cmd: fdt: Test fdt move
Add 'fdt move' test which works as follows:
- Create simple FDT, map it to sysmem
- 'move' the FDT into new zeroed out sysmem location
- Verify newly active FDT is in the new location
- Compare both locations

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:48 -08:00
Marek Vasut
e2d7daa6c9 test: cmd: fdt: Test both string and integer arrays in 'fdt get value'
The 'fdt get value' subcommand now supports extraction of integer value
from integer arrays, add test for it, including a test for special case
unindexed integer array read, which is handled as hash and treated as a
long string instead of integer.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:48 -08:00
Marek Vasut
ed14576b59 test: cmd: fdt: Test alias resolution in 'fdt get value'
The 'fdt' command help contains the following note:
"
Dereference aliases by omitting the leading '/', e.g. fdt print ethernet0.
"
Add test for it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-09 08:50:47 -08:00