Commit graph

85666 commits

Author SHA1 Message Date
Marek Vasut
d08c000821 ARM: imx: Enable SDP download in SPL on DH i.MX6 DHSOM
Enable SDP protocol support in SPL for DH i.MX6 DHSOM, now that those
components fit into the SPL due to LTO.

To start U-Boot via SDP upload on i.MX6 DHSOM based board, proceed as follows:
- Compile imx_usb [1] .
- Power off the i.MX6 DHSOM based board.
- Connect both USB-serial console and USB-OTG miniB ports to host PC.
- Switch board to USB boot mode.
- Power on the board.
- Verify using '$ dmesg' that a new device has been detected as follows:
    New USB device found, idVendor=15a2, idProduct=0054, bcdDevice= 0.01
    New USB device strings: Mfr=1, Product=2, SerialNumber=0
    Product: SE Blank ARIK
    Manufacturer: Freescale SemiConductor Inc

- Upload U-Boot SPL:
$ imx_usb u-boot-with-spl.imx

- Wait for SPL to come up, the following print ought to be the last on
  UART console:
SDP: handle requests...

- Upload U-Boot proper:
$ imx_usb u-boot.img

[1] https://github.com/boundarydevices/imx_usb_loader.git

Signed-off-by: Marek Vasut <marex@denx.de>
2023-04-04 09:35:39 +02:00
Tom Rini
02f8486b9f Merge https://source.denx.de/u-boot/custodians/u-boot-usb
- Two USB gadget fixes
2023-04-03 20:49:03 -04:00
Tom Rini
8ca4202595 mx6sx-udoo-neo-basic-u-boot.dtsi: Correct to bootph-all
Updating this was missed in the merge of the next branch back in to
master.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-04-03 20:48:24 -04:00
Marek Vasut
7f23470885 usb: gadget: f_sdp: Add missing spl_board_prepare_for_boot() call
The spl_board_prepare_for_boot() should be called before jump_to_image_no_args()
to perform board-specific deinitialization before jumping to the next stage.
This board-specific deinitialization can be very much anything, e.g. disable
dcache in case it was enabled, or such.

Add the missing spl_board_prepare_for_boot() call into f_sdp .

Signed-off-by: Marek Vasut <marex@denx.de>
2023-04-04 00:34:42 +02:00
Heinrich Schuchardt
063359444c usb: gadget: missing fallthrough in composite_setup()
Add a missing fallthrough macro. This fixes a -Wimplicit-fallthrough
warning.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-04-04 00:33:32 +02:00
Tom Rini
288fe30a23 Merge branch 'next'
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-04-03 16:45:41 -04:00
Tom Rini
fd4ed6b7e8 Prepare v2023.04
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-04-03 16:38:50 -04:00
Sinthu Raja
1f77f9176e arm: dts: k3-j721e-sk-u-boot: fix boot on j721e SK
J721e SK has been broken since at least March 2022.

The main-navss and mcu-navss nodes were renamed and this caused the
A72 SPL to fail early in the boot even before the serial port was
enabled. Fix this.

A later patch series between v2022.07 and v2022.10 additionally broke
boot on this board by introducing hbmc nodes which are not present on
this board. The right fix is to disable these by default in the SOC
dtsi file, but for now we can also disable them in the u-boot dtsi.

With both these fixed, we can now boot the j721e SK board fully from
mainline u-boot.

Fixes: 58d61fb5a7 ("arm: dts: k3-j721e-sk: Add initial A72 specific dts support")
Fixes: 297daac43a ("arm: dts: k3-j721e-mcu-wakeup: Add HyperBus Controller node")
Reported-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
[gadiyar@ti.com: update commit description]
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Bryan Brattlof <bb@ti.com>
2023-04-03 14:54:16 -04:00
Tom Rini
9876c8c147 Enable VPL tests
Minor changes with fdt command, vboot test, pinctrl
 -----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAmQp9F4RHHNqZ0BjaHJv
 bWl1bS5vcmcACgkQfxc6PpAIreYqlQgArZyGLcIoAKGXWwoo33JGd+9Bbg0MyMXw
 TeftXl16PWqyAADnModmiiRJfM8mex+Xzq9h3Qpu6ALN0ZQjQ9u2mcJMZAKqql30
 XvMACoKlb0t8xbsbaA8+iJbzX+uEF0RNgE55RsTfe1x1bVcqta5LGLVMpAYW28Ar
 ocIHycKswW8fofIqYpZwnAk7FEdgqiOoEc86B9KS6H9VPeFY3A8k9Lz/h90Ij487
 LFyM4acxR6IapP3AlB/ST1Iro7wdR5keUaC06rnqkJiWPaBsdOZfYZ5nERgWUABb
 RIDOdrxYGqNOa1vjiD3zivHu6QwfObPb/J2L3Py/ISSZOJW/QQiaRg==
 =Wqr4
 -----END PGP SIGNATURE-----

Merge tag 'dm-next-3apr23' of https://source.denx.de/u-boot/custodians/u-boot-dm into next

Enable VPL tests
Minor changes with fdt command, vboot test, pinctrl
2023-04-03 11:35:30 -04:00
Tom Rini
a25dcda452 Revert "disk: Use a helper function to reduce duplication"
Per Takahiro Akashi this is not an equivalent rework, so revert it.

This reverts commit d87bdb82ea.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-04-03 10:43:37 -04:00
Fabio Estevam
8b6de0545f pico-imx6: Pass the mmc alias to fix boot regression
Originally, the mmc aliases node was present in imx6qdl-pico.dtsi.

After the sync with Linux in commit d0399a46e7 ("imx6dl/imx6qdl:
synchronise device trees with linux"), the aliases node is gone as
the upstream version does not have it.

This causes a boot regression in which the eMMC card cannot be found anymore.

Fix it by passing the alias node in the u-boot.dtsi file to
restore the original behaviour where the eMMC (esdhc3) was
mapped to mmc0.

Fixes: d0399a46e7 ("imx6dl/imx6qdl: synchronise device trees with linux")
Signed-off-by: Fabio Estevam <festevam@denx.de>
2023-04-03 10:14:34 -04:00
Tom Rini
cfb4c33e89 Fixes for 2023.04
------------------
 
 CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/15831
 
 - fix for imx8mn_bsh_smm_s2
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQS2TmnA27QKhpKSZe309WXkmmjvpgUCZCrCRw8cc2JhYmljQGRl
 bnguZGUACgkQ9PVl5Jpo76ZNGQCfQhul9Qfy0jVXZl/vXDxPJrfv4hQAnjVsNLV9
 SNhV4PXn8+eTt4igrx8e
 =AMYS
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-imx-20230403' of https://source.denx.de/u-boot/custodians/u-boot-imx

Fixes for 2023.04
------------------

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/15831

- fix for imx8mn_bsh_smm_s2
2023-04-03 10:13:36 -04:00
Simon Glass
00be5197e8 test: Run the VPL tests with 'make check'
Update the script to run VPL tests as well as the others.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-03 06:53:53 +12:00
Simon Glass
8b60987899 CI: Ensure that vpl test is run
This is actually skipped at present due to the condition in the file.
Fix this by running all vpl tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-03 06:53:53 +12:00
Simon Glass
8511aabd98 vbe: Use the correct image filename in the test
At present this inadvertently relies on having a symlink to the correct
file from the current directory. Use the correct path to fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-03 06:53:53 +12:00
Simon Glass
74b75aa697 sandbox: Update the VBE firmware location
The image size was increased but the firmware-update part was not
updated. Correct this so that VBE firmware update can succeed with
sandbox_vpl.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 85c66dc95c ("sandbox: Expand size for VPL image")
2023-04-03 06:53:53 +12:00
Corentin Guillevic
9599ce514c doc: sandbox: replace sgdisk input with options
The input provided to sgdisk is in fact aimed for sfdisk. The use of
sgdisk and sfdisk, coming from different projects, is not the same.

So, this commit translates the sfdisk-formatted input into
sgdisk-compatible options. Partitions are not modified.

Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr>
2023-04-03 06:53:53 +12:00
Peter Hoyes
b4fae89c48 fdt: Make fdt addr -q quieter
64597346 "fdt: Add -q option to fdt addr for distro_bootcmd" introduced
the -q option for fdt addr, which sets the current working fdt address
without printing any output.

baf41410 "fdt: Show a message when the working FDT changes" made the
utility function set_working_fdt_addr (in cmd/fdt.c) output a message
on each invocation, even if called via fdt addr -q, in which case its
output is now slightly noisier.

To fix this, split out set_working_fdt_addr into set_working_fdt_addr
plus the static function set_working_fdt_addr_quiet.
set_working_fdt_addr_quiet can be called by "quiet" fdt cmd logic and
set_working_fdt_addr is exported (as before) to other boot logic. The
latter calls the former.

Remove the assertion from the fdt addr test case when calling with the
-q argument.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-03 06:53:53 +12:00
Quanyang Wang
d0bb00adcc pinctrl: fix pinctrl_gpio_get_pinctrl_and_offset for gpio-ranges array
Sometimes a multi-element array is used for "gpio-ranges" property in
dts file:

    qe_pio_e: gpio-controller@1460 {
        ......
        gpio-ranges = <&pinctrl1 0 20 10>, <&pinctrl2 10 50 20>;
        ......
    };

But the function pinctrl_gpio_get_pinctrl_and_offset can't handle this
case because the "index" argument passed to dev_read_phandle_with_args
is fixed to be "0". Use a loop to traverse the array to fix it.

Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
2023-04-03 06:53:53 +12:00
Marek Vasut
2fb74a1d13 cmd: fdt: Use env_set_hex() for "get addr" and "get size"
The 'fdt get addr' and 'env get size' is always assumed to be hex
value, drop the prefix, and outright switch to env_set_hex(). Since
this might break existing users who depend on the existing behavior
with 0x prefix, this is a separate patch.

Revert if this breaks anything.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-03 06:53:53 +12:00
David Sebek
86169cdcb0 rockchip: Fix incorrect constant name in RAM init code
A condition in the rk3399 RAM initialization code used the old
CONFIG_RAM_RK3399_LPDDR4 constant name. This commit changes the
condition to use the correct CONFIG_RAM_ROCKCHIP_LPDDR4 constant.

Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-02 12:57:12 -04:00
Roman Kopytin
90999b4569 test_vboot.py: include test of fdt_add_pubkey tool
Add test_fdt_add_pubkey test which provides simple functionality test
which contains such steps:
 create DTB and FIT files
 add keys with fdt_add_pubkey to DTB
 sign FIT image
 check with fit_check_sign that keys properly added to DTB file

Signed-off-by: Roman Kopytin <Roman.Kopytin@kaspersky.com>
Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2023-04-02 17:39:41 +12:00
Tom Rini
6c617e082d Pull request for efi-2023-04-rc6
Documentation:
 
 * describe skipping triggering a pipeline in Gitlab
 
 UEFI:
 
 * correct shortening of device-paths for boot options
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmQoFXUACgkQxIHbvCwF
 GsT+Kg/+J77C3UXUhd9xc1zDf1UXpWZ62gMatngK4p3dmu2kuN9e0E4k97wHDQpw
 6L56Re95P9gBZCjLHo7Fx4zo07znv6cQfl2ps28u+j7cd8OJcmxpdS+r00wlGu+y
 y5zNW9abW0U7neyc3FIDRWFwNRw4i+uSQ3k4184rPrSlJamAp7PkIb2uctcZhAmw
 G2/esIcSzzlhjMfLhUjAG9ibJSuBzcm+8DvS2my4qoiHFAXS3S3D0Clzmw9+nLYT
 PWRRRB8I/rOKMpwa6g8OvzB4XPiWH54LeEmTPUd1M5jZCKq6t1wbw3bwhrJA+IX8
 q0Bj9fpRGMK3WFMfhwK7DpxuBKUocEXj0a9pw1RJZvKKDRPpnQ9nOOo+zGinycQ1
 4+aA9sJML8Gr/91XvEwkKbNty1EJqq6RBk/+4/bfWZAFfWfzD4PyxRz9iY951D43
 LPqk00Z+qKToskHOjeKNrAv4ZNW3ass1fIAoSuiZ3oV5RO/ize/aCWHEMnlA9UL3
 4IaxhKZ2mpSV3PkUeaAbNyeusZyP+3aSijEGT7tqFqS/6EaWq3zkdHL/hpgwy/HD
 ylx/Co8+MycoGlRafISyZWm2RvFAQTxV7GAAAfgBu52JdIYmer28yigDQ4wjvkhG
 Q4f+rAgZNjQT8BTrS+CKfyWpUZXz8cgABVi2d7/4NWYlJQ+XkmU=
 =sS2b
 -----END PGP SIGNATURE-----

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

Pull request for efi-2023-04-rc6

Documentation:

* describe skipping triggering a pipeline in Gitlab

UEFI:

* correct shortening of device-paths for boot options
2023-04-01 10:55:06 -04:00
Heinrich Schuchardt
dfd4288173 efi_loader: remove duplicate assignment
Assigning the value of a variable to itself should be avoided.

Addresses-Coverity-ID: 451089 ("Evaluation order violation")
Fixes: 180b7118be ("efi_loader: fix device-path for USB devices")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-04-01 10:11:50 +02:00
Heinrich Schuchardt
a9203b0fef efi_loader: correct shortening of device-paths
We use short device-paths in boot options so that a file on a block device
can be found independent of the port into which the device is plugged.

Usb() device-path nodes only contain port and interface information and
therefore cannot identify a block device.
UsbWwi() device-path nodes contain the serial number of USB devices.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-04-01 10:11:50 +02:00
Heinrich Schuchardt
ffc1cfb8f4 doc: describe skipping triggering a pipeline in Gitlab
'git push -o ci.skip' can be used to push to Gitlab without triggering a
pipeline.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-01 10:11:50 +02:00
Heinrich Schuchardt
854aaf9024 scsi: typo supporedt
%s/supporedt/supported/

Fixes: edca8cf721 ("Convert CONFIG_SCSI_AHCI_PLAT et al to Kconfig")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-01 10:11:50 +02:00
Tom Rini
942ac73afc u-boot-imx-next-20230331 for next
---------------------------------
 
 CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/15819
 
 i.MX patches queued for next:
 
 - Conversions to DM_SERIAL
 - Fixes for Toradex boards
 - Gateworks Boards
 - i.MX8ULP
 - EQoS support / fixes, changes in boards
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQS2TmnA27QKhpKSZe309WXkmmjvpgUCZCaU0Q8cc2JhYmljQGRl
 bnguZGUACgkQ9PVl5Jpo76YCKgCgk4OueoIggmes+Ccj8bu1BcQbrfYAoJAgMeKE
 It0hrVAifD62TPb2rmHt
 =hFVG
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-imx-next-20230331' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

u-boot-imx-next-20230331 for next
---------------------------------

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/15819

i.MX patches queued for next:

- Conversions to DM_SERIAL
- Fixes for Toradex boards
- Gateworks Boards
- i.MX8ULP
- EQoS support / fixes, changes in boards
2023-03-31 12:50:34 -04:00
Tom Rini
897d634a98 Fixes for buildman and sysreset
-----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAmQl/ucRHHNqZ0BjaHJv
 bWl1bS5vcmcACgkQfxc6PpAIreaN+Af9E7rh1oM0fbZbEqwnIAT2RIDj3VEOTKf8
 UpNO+v86KPkChvHLnZKIW5Aa5rf6Goi4rppN59HdFUM6++13V7Gdp/cshu9b7j7R
 4NoOqI/k4/PPe6W5pU3f1GzV820LdV6NTKb3UPHz9FTAAjlY/KX41vNf5+kKdse7
 rxlr3i5L05/68ZPMjH3lLfn2pSh0ZizbImbqHZpxTTvAA9iG1cz0Pftpfzu6zXpg
 gqLeRk2d5dQUgQ0L216/e/L2OMnxMsDTBrhPFR+fK9rtb6b7sUCBajHTE/Lthj1R
 4IEinNS4MYJeTQ3MM5RQFajbpcmroU7a39IDOrjn/2owgzyQiub8AQ==
 =4ef+
 -----END PGP SIGNATURE-----

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

Fixes for buildman and sysreset
2023-03-31 12:02:41 -04:00
Tom Rini
b8deed53fe Merge branch '2023-03-30-assorted-general-upates' into next
- RTC cleanups / improvements, run_commandf() cleanups, fs bugfixes,
  socrates config fix, PCI MPS support, GPIO improvements, other code
  cleanups
2023-03-31 10:04:23 -04:00
Dario Binacchi
d8aba36d74 configs: imx8mn_bsh_smm_s2: remove console from bootargs
The Linux kernel device tree already specifies the device to be used for
boot console output with a stdout-path property under /chosen.

Commit 36b661dc91 ("Merge branch 'next'") re-added the console
setting that commit bede82f750 ("configs: imx8mn_bsh_smm_s2: remove
console from bootargs") had previously removed.

Fixes: 36b661dc91 ("Merge branch 'next'")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2023-03-31 10:51:14 +02:00
Jonathan Liu
a47164dfc1 sysreset: gpio: fix gpio_reboot_request return value
It should return -EINPROGRESS if successful otherwise sysreset-uclass
will continue to the next sysreset device.

Signed-off-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-31 08:32:52 +13:00
Simon Glass
49d8cc4cbe buildman: Correct overwriting of settings file
The toolchain test causes the settings file to be overwritten, which is
annoying for local development. Fix it by passing None as the filename.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-31 08:32:52 +13:00
Stefan Herbrechtsmeier
f98b112f9e test: fs: Check fat short file name
Ensure that a freshly written fat file with a lower case filename which
fits into the upper case 8.3 short filename is not mangeled with a tilde
and number.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2023-03-30 15:09:59 -04:00
Svyatoslav Ryhel
25df91520e input: button_kbd: make driver complementary to gpio buttons
Remove need of dts binding for button keyboard since it reuses
gpio-keys binding. Select gpio-keys driver if button keyboard
is selected since button keyboard can not operate on its own.

Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # HTC One X T30
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00
Svyatoslav Ryhel
a57adacf50 cmd: ums: abort mounting by pressing any key
This patch introduses config which allows interrupt run of usb
mass storage with any key. This is especially useful on devices
with limited input capabilities like tablets and smatphones which
have only gpio keys in direct access.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00
Evgeny Bachinin
49b7d69f56 test: exit: fix run_commandf() warnings
Fix warnings after adding printf-like attribute format for
run_commandf():
warning: too many arguments for format [-Wformat-extra-args]

Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00
Evgeny Bachinin
0d73c23842 test: fdt: fix run_commandf() warnings
Fix warnings both for 32bit and 64bit architecture after adding
printf-like attribute format for run_commandf():
warning: format ‘%x’ expects argument of type ‘unsigned int’, but
  argument 2 has type ‘ulong {aka long unsigned int}’ [-Wformat=]
  ret = run_commandf("fdt addr -c %08x", addr);
                     ^
Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru>
Cc: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fixup testcases added since patch was posted]
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-03-30 15:09:59 -04:00
Evgeny Bachinin
dd1f34a9b9 unit-test: cover run_commandf() by test-cases
As run_commandf() is variadic version of run_command() and just a wrapper,
hence apply similar run_command's test-cases.

Let's avoid warning about empty string passing:
warning: zero-length gnu_printf format string [-Wformat-zero-length]
   assert(run_commandf("") == 0);

Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00
Evgeny Bachinin
26f923c7cf cli: run_commandf(): small fixups
* vsnprintf() can truncate cmd, hence it makes no sense to launch such
command (it's broken). Moreover, it's better to signalize to the caller
about such case (for facilitating debugging or bug hunting).

* Fix kernel-doc warnings:
  include/command.h:264: info: Scanning doc for run_commandf
  include/command.h:268: warning: contents before sections
  include/command.h:271: warning: No description found for return value
                                  of 'run_commandf'

* Add printf-like format attribute to validate at compile-time the format
string against parameters's type.

* Fix compilation error in case of -Wall, -Werror, -Wextra:
error: variable ‘i’ set but not used [-Werror=unused-but-set-variable]

* Drop extra ret variable.

Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00
Chris Packham
0798a1ce0f drivers: rtc: add max313xx series rtc driver
Adding support for Analog Devices MAX313XX series RTCs.

This is ported from the Linux driver and adapted for use in u-boot.
Notable differences are
- handling of tm_year and tm_mon differ
- clock source support is omitted
- hwmon support for the MAX31328 and MAX31343 is omitted
- rtc_ops->reset is added

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00
Chris Packham
b5f045e12f include: kernel.h: port find_closest() from Linux
The find_closest() macro can be used to find an element in a sorted
array that is closest to an input value. Bring in this macro from
Linux v6.3-rc1-2-g8ca09d5fa354.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00
Simon Glass
d87bdb82ea disk: Use a helper function to reduce duplication
Reduce the duplicated code slightly by using a helper function to handle
the common code.

This reduces the code size very slightly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00
Marek Vasut
c61df34009 lib: Fix SYS_TIMER_COUNTS_DOWN description in Kconfig
The SYS_TIMER_COUNTS_DOWN description contains a typo,
s@rathe@&r@ , fix it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-30 15:09:59 -04:00
Rasmus Villemoes
e1c97949ee gpio: allow passing NULL to gpio_request_by_line_name() to search all gpio controllers
The API is more convenient to use if one doesn't have to know upfront
which gpio controller has a line with the name one is searching for,
and arrange to look that device up somehow. Or implement this loop
oneself.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00
Thomas Perrot
fdef6b982f rtc: m41t62: implements read8/write8 operations
These operations are required by dm_rtc_read and
dm_bootcount_get helpers.

Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00
Corentin GUILLEVIC
39409fac2c fs: ext4: fix files seen as symlink during deletion
The deletion process handles special case for symlinks whose target are
small enough that it fits in struct ext2_inode.b.symlink. So no block had
been allocated. But the check of file type wrongly considered regular
files as symlink. So, no block was freed. So, the EXT4 partition could be
corrupted because of no free block available.

Signed-off-by: Corentin GUILLEVIC <corentin.guillevic@smile.fr>
2023-03-30 15:09:59 -04:00
Stefan Herbrechtsmeier
fefd949157 fs: fat: do not mangle short filenames
Do not mangle lower or mixed case filenames which fit into the upper
case 8.3 short filename. This ensures FAT standard compatible short
filenames (SFN) to support systems without long filename (LFN) support
like boot roms (ex. SFN BOOT.BIN instead of BOOT~1.BIN for LFN
boot.bin).

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2023-03-30 15:09:59 -04:00
Stephen Carlson
447dfbc063 test: Add test for new command pci_mps
Adds a test for the new pci_mps command to ensure that it can set the
Maximum Payload Size (MPS) of all devices to 256 bytes in the sandbox
environment. Enables the pci_mps command in the sandbox environment so
that this test can be run.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
2023-03-30 15:09:59 -04:00
Stephen Carlson
713db6f6d3 drivers: pci: sandbox: Add stub sandbox PCI MPS support
Reports the sandbox swapcase PCI Express device to support a 256 byte
Maximum Payload Size for MPS tuning tests.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30 15:09:59 -04:00