]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
16 months agoexpo: Move cedit test into its own file and tidy
Simon Glass [Mon, 14 Aug 2023 22:40:26 +0000 (16:40 -0600)]
expo: Move cedit test into its own file and tidy

Move this test out so it can have its own file. Rename the test to use
a cedit_ prefix.

This allows us to drop the check for CONFIG_CMD_CEDIT in the test.

Also we don't need driver model objects for this test, so drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoexpo: Split out cedit into its own header
Simon Glass [Mon, 14 Aug 2023 22:40:25 +0000 (16:40 -0600)]
expo: Split out cedit into its own header

Before adding more functions to this interface, create a new header for
the configuration editor.

Fix up the expo header guard while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoexpo: Refactor menu_build() to return the object created
Simon Glass [Mon, 14 Aug 2023 22:40:24 +0000 (16:40 -0600)]
expo: Refactor menu_build() to return the object created

The caller reads the ID but menu_build() does this again. Add the ID as
a parameter to avoid this. Return the object created so that the caller
can adjust it.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoexpo: Provide a way to iterate through all scene objects
Simon Glass [Mon, 14 Aug 2023 22:40:23 +0000 (16:40 -0600)]
expo: Provide a way to iterate through all scene objects

For some operations it is necessary to process all objects in an expo.
Provide an iterator to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoabuf: Allow incrementing the size
Simon Glass [Mon, 14 Aug 2023 22:40:22 +0000 (16:40 -0600)]
abuf: Allow incrementing the size

Provide a convenience function to increment the size of the abuf.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoexpo: Make scene_obj_find() take a const scene
Simon Glass [Mon, 14 Aug 2023 22:40:21 +0000 (16:40 -0600)]
expo: Make scene_obj_find() take a const scene

This does not change the scene, so mark the pointer const.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoMerge branch '2023-08-24-enable-more-features-in-qemu-arm' into next
Tom Rini [Thu, 24 Aug 2023 21:42:48 +0000 (17:42 -0400)]
Merge branch '2023-08-24-enable-more-features-in-qemu-arm' into next

To quote the author:
Now that the driver for the Bochs VGA card emulated by QEMU is no longer
limited to x86 architectures, this series enables it on arm and arm64 virtual
machines to provide a graphical interface. In line with that series this also
enables console buffering and USB keyboard.

Tested with the Debian 12 installer using GRUB EFI:

  $ tools/buildman/buildman -o build/qemu_arm64 --boards=qemu_arm64 -w
  $ cd build/qemu_arm64
  $ curl -L -o debian.img \
      https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-12.0.0-arm64-netinst.iso
  $ qemu-system-aarch64 \
      -machine virt -cpu cortex-a53 -m 4G -smp 4 \
      -bios u-boot.bin \
      -serial stdio -device VGA \
      -nic user,model=virtio-net-pci \
      -device virtio-rng-pci \
      -device qemu-xhci,id=xhci -device usb-kbd -device usb-tablet \
      -drive if=virtio,file=debian.img,format=raw,readonly=on,media=cdrom

And with one using extlinux.conf:

    $ [...]
    $ curl -L -o head.img.gz \
        https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/SD-card-images/gtk/firmware.none.img.gz
    $ curl -L -o partition.img.gz \
        https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/SD-card-images/gtk/partition.img.gz
    $ zcat head.img.gz partition.img.gz >debian.img
    $ [...]

Both can get to a graphical installer just fine, in addition to U-Boot
video console showing up in a GTK window.

16 months agodoc: qemu: arm: Add a section on booting Linux distros
Alper Nebi Yasak [Mon, 14 Aug 2023 17:39:44 +0000 (20:39 +0300)]
doc: qemu: arm: Add a section on booting Linux distros

Add an example qemu-system-aarch64 command that can make U-Boot on QEMU
boot into the Debian Installer, along with resulting console messages
from U-Boot, based on the existing documentation section for the x86
version.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
16 months agoarm: qemu: Enable usb keyboard as an input device
Alper Nebi Yasak [Mon, 14 Aug 2023 17:39:43 +0000 (20:39 +0300)]
arm: qemu: Enable usb keyboard as an input device

Commit 02be57caf730 ("riscv: qemu: Enable usb keyboard as an input
device") adds PCI xHCI support to QEMU RISC-V virtual machines and
enables using a USB keyboard as one of the input devices. Similarly,
enable those for ARM virtual machines as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
16 months agoarm: qemu: Enable PRE_CONSOLE_BUFFER
Alper Nebi Yasak [Mon, 14 Aug 2023 17:39:42 +0000 (20:39 +0300)]
arm: qemu: Enable PRE_CONSOLE_BUFFER

Commit 608b80b5b855 ("riscv: qemu: Enable PRE_CONSOLE_BUFFER") enables
buffering console messages for QEMU RISC-V virtual machines so those
printed before the video console is available will still show up on the
display. Similarly, enable it for ARM virtual machines as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
16 months agoarm: qemu: Enable Bochs video support
Alper Nebi Yasak [Mon, 14 Aug 2023 17:39:41 +0000 (20:39 +0300)]
arm: qemu: Enable Bochs video support

Commit 716161663ec49 ("riscv: qemu: Enable Bochs video support") enables
a video console for QEMU RISC-V virtual machines using an emulated Bochs
VGA card. Similarly, enable it for ARM virtual machines as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
16 months agoMerge branch '2023-08-24-further-ufs-updates' into next
Tom Rini [Thu, 24 Aug 2023 19:39:55 +0000 (15:39 -0400)]
Merge branch '2023-08-24-further-ufs-updates' into next

- Cleanup and improve the UFS subsystem slightly, in preparation for
  supporting more platforms.

16 months agoufs: Implement cache management
Marek Vasut [Wed, 16 Aug 2023 15:05:55 +0000 (17:05 +0200)]
ufs: Implement cache management

Add function to flush and invalidate cache over request and response
queue entries, and perform flush and optional invalidate over block
layer data that are passed into the UFS layer. This makes it possible
to use UFS with caches enabled.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
16 months agoufs: Use utp_transfer_req_desc pointer in ufshcd_get_tr_ocs
Marek Vasut [Wed, 16 Aug 2023 15:05:54 +0000 (17:05 +0200)]
ufs: Use utp_transfer_req_desc pointer in ufshcd_get_tr_ocs

Use utp_transfer_req_desc pointer to reference to utrdl queue
instead of referencing the queue directly. This makes the code
more consistent. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
16 months agoufs: Pass hba pointer to ufshcd_prepare_req_desc_hdr()
Marek Vasut [Wed, 16 Aug 2023 15:05:53 +0000 (17:05 +0200)]
ufs: Pass hba pointer to ufshcd_prepare_req_desc_hdr()

Pass the hba pointer itself to ufshcd_prepare_req_desc_hdr()
instead of duplicating utp_transfer_req_desc access at each
call site. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
16 months agoufs: Handle UFS 3.0 controllers
Marek Vasut [Wed, 16 Aug 2023 15:05:52 +0000 (17:05 +0200)]
ufs: Handle UFS 3.0 controllers

Extend the version check to handle UFS 3.0 controllers as well.
Tested on R-Car S4 UFS 3.0 controller.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
16 months agoufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO
Marek Vasut [Wed, 16 Aug 2023 15:05:51 +0000 (17:05 +0200)]
ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO

Add UFSHCD_QUIRK_HIBERN_FASTAUTO quirk for host controllers which supports
auto-hibernate the capability but only FASTAUTO mode.

Ported from Linux kernel commit
2f11bbc2c7f3 ("scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTO")

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
16 months agoufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS
Marek Vasut [Wed, 16 Aug 2023 15:05:50 +0000 (17:05 +0200)]
ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS

Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS for host controllers which do not
support 64-bit addressing.

Ported from Linux kernel commit
6554400d6f66 ("scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS")
with ufs_scsi_buffer_aligned() based on U-Boot generic bounce buffer.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
16 months agoufs: Convert quirks to BIT() macro
Marek Vasut [Wed, 16 Aug 2023 15:05:49 +0000 (17:05 +0200)]
ufs: Convert quirks to BIT() macro

Use BIT() macro for quirks, no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
16 months agoMerge branch '2023-08-22-assorted-code-cleanups' into next
Tom Rini [Wed, 23 Aug 2023 14:40:47 +0000 (10:40 -0400)]
Merge branch '2023-08-22-assorted-code-cleanups' into next

- Assorted cleanups and fixes for a few tests, how we handle
  disks/partitions and bounce buffers.

16 months agonet: Fix the displayed value of bytes transferred
Siddharth Vadapalli [Mon, 14 Aug 2023 04:53:47 +0000 (10:23 +0530)]
net: Fix the displayed value of bytes transferred

In the case of NETLOOP_SUCCESS, the decimal value of the u32 variable
"net_boot_file_size" is printed using "%d", resulting in negative values
being reported for large file sizes. Fix this by using "%u" to print the
decimal value corresponding to the bytes transferred.

Fixes: 1411157d8578 ("net: cosmetic: Fixup var names related to boot file")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agoscsi: Add buffer_aligned check pass-through
Marek Vasut [Sun, 13 Aug 2023 23:50:00 +0000 (01:50 +0200)]
scsi: Add buffer_aligned check pass-through

Some devices have limited DMA capabilities and require that the
buffers passed to them fit specific properties. Add new optional
callback which can be used at driver level to indicate whether a
buffer alignment is suitable for the device DMA or not. This is
a pass-through callback from block uclass to drivers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agoblk: Add bounce buffer support to read/write operations
Marek Vasut [Sun, 13 Aug 2023 23:49:59 +0000 (01:49 +0200)]
blk: Add bounce buffer support to read/write operations

Some devices have limited DMA capabilities and require that the
buffers passed to them fit specific properties. Add new optional
callback which can be used at driver level to indicate whether a
buffer alignment is suitable for the device DMA or not, and
trigger use of generic bounce buffer implementation to help use
of unsuitable buffers at the expense of performance degradation.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodisk: dos: Infer MBR partition sector size from underlying drive sector size
Marek Vasut [Sun, 13 Aug 2023 23:48:45 +0000 (01:48 +0200)]
disk: dos: Infer MBR partition sector size from underlying drive sector size

Block devices with 4k sectors imply the MBR sectors are also 4k instead
of regular 512B. Avoid hard-coding the 512B sector size and isntead read
the current block device sector size from it, and if the sector size is
larger than 512B, use the block device sector size.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agocommon: bouncebuf: Add missing cast to dma_addr_t
Marek Vasut [Sun, 13 Aug 2023 23:47:47 +0000 (01:47 +0200)]
common: bouncebuf: Add missing cast to dma_addr_t

Fix the following warning produced on qemu-x86_64_defconfig:

"
common/bouncebuf.c: In function ‘bounce_buffer_stop’:
common/bouncebuf.c:82:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   82 |                 dma_unmap_single((dma_addr_t)state->bounce_buffer,
      |                                  ^
"

The warning is valid, the pointer has to be up-cast first.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Andrew Davis <afd@ti.com>
16 months agodisk: Make blk_get_ops() internal to blk uclass
Marek Vasut [Sun, 13 Aug 2023 23:46:48 +0000 (01:46 +0200)]
disk: Make blk_get_ops() internal to blk uclass

Move the macro into blk-uclass.c , since it is only used there.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agodisk: Move part_create_block_devices() to blk uclass
Marek Vasut [Sun, 13 Aug 2023 23:46:47 +0000 (01:46 +0200)]
disk: Move part_create_block_devices() to blk uclass

Move part_create_block_devices() to blk uclass and unexpose
the function. This can now be internal to the block uclass.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodisk: Switch part_blk_*() functions to disk_blk_*()
Marek Vasut [Sun, 13 Aug 2023 23:46:46 +0000 (01:46 +0200)]
disk: Switch part_blk_*() functions to disk_blk_*()

The behavior of the part_blk_*() functions is now identical
to disk_blk_*() functions, switch the former to the later.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodisk: Extend disk_blk_part_validate() with range checking
Marek Vasut [Sun, 13 Aug 2023 23:46:45 +0000 (01:46 +0200)]
disk: Extend disk_blk_part_validate() with range checking

Check whether access is out of bounds of the partition and
return an error. This way there is no danger of esp. write
or erase outside of the confines of partition.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodisk: Handle partition to block device offset conversion
Marek Vasut [Sun, 13 Aug 2023 23:46:44 +0000 (01:46 +0200)]
disk: Handle partition to block device offset conversion

Convert the read/write/erase offset from one within a partition
to one within a block device, to correctly access the data on
the block device for both write and erase operations.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodisk: Simplify disk_blk_{write, erase}() using blk_{write, erase}()
Marek Vasut [Sun, 13 Aug 2023 23:46:43 +0000 (01:46 +0200)]
disk: Simplify disk_blk_{write, erase}() using blk_{write, erase}()

These two functions are basically identical, just call the blk_*()
functions from disk_blk_*() functions. The only difference is that
the disk_blk_*() functions have to use parent block device as the
udevice implementing block device operations.

Add documentation on what those functions really do. The documentation
is not wrong even though it likely does look that way. The write/erase
functions really do not take into account the partition offset. This
will be fixed in the next patch.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodisk: Simplify disk_blk_read() using blk_read()
Marek Vasut [Sun, 13 Aug 2023 23:46:42 +0000 (01:46 +0200)]
disk: Simplify disk_blk_read() using blk_read()

The disk_blk_read() can be simplified using blk_read(), the only
things which needs to be handled are the read offset based on the
partition properties, and the block device ops which are coming
from the parent udevice, not the partition udevice.

The later is currently not implemented correctly as far as I can
tell, since the current code extracts block device descriptor from
the parent udevice which is OK, but extracts block device operations
from the partition udevice, which does not seem OK.

Switching to the blk_read() fixes that too.

The dev_get_blk() usage is simplified using UCLASS_PARTITION check.

Add non-confusing documentation what this really does.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodisk: Drop always true conditional check
Marek Vasut [Sun, 13 Aug 2023 23:46:41 +0000 (01:46 +0200)]
disk: Drop always true conditional check

if (device_get_uclass_id(dev) == UCLASS_PARTITION) is always
true, because this disk_blk_read() function calls dev_get_blk()
above and checks its return value for non-NULL. The dev_get_blk()
performs the same device_get_uclass_id(dev) check and returns NULL
if not UCLASS_PARTITION. Drop the duplicate check.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agotest: acpi: Handle both 32bit and 64bit ACPI tables
Marek Vasut [Sun, 13 Aug 2023 01:25:59 +0000 (03:25 +0200)]
test: acpi: Handle both 32bit and 64bit ACPI tables

Handle both 32bit and 64bit systems, i.e. sandbox and sandbox64
the same way drivers/cpu/cpu_sandbox.c sets those ACPI tables up.
This fixes "$ ./u-boot -Tc 'ut dm dm_test_acpi_write_tables'"
test failure on sandbox64.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agotest: Fix the help for the ut command
Marek Vasut [Sat, 12 Aug 2023 22:16:41 +0000 (00:16 +0200)]
test: Fix the help for the ut command

Drop the 'ut' prefix, this is superfluous and not present in
any of the other ut tests.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoMerge tag 'v2023.10-rc3' into next
Tom Rini [Mon, 21 Aug 2023 21:32:17 +0000 (17:32 -0400)]
Merge tag 'v2023.10-rc3' into next

Prepare v2023.10-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoPrepare v2023.10-rc3
Tom Rini [Mon, 21 Aug 2023 20:19:59 +0000 (16:19 -0400)]
Prepare v2023.10-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMerge tag 'dm-pull-20aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Mon, 21 Aug 2023 19:48:30 +0000 (15:48 -0400)]
Merge tag 'dm-pull-20aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm

sandbox64 fixes

16 months agotest: cpu: Handle both 32bit and 64bit CPUs
Marek Vasut [Sun, 13 Aug 2023 19:52:19 +0000 (21:52 +0200)]
test: cpu: Handle both 32bit and 64bit CPUs

Handle both 32bit and 64bit systems, i.e. sandbox and sandbox64
the same way drivers/cpu/cpu_sandbox.c does, that is in case
CONFIG_PHYS_64BIT is enabled, assume 64bit address width, else
assume 32bit address width. This fixes ut_dm_dm_test_cpu test
failure on sandbox64.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoconfigs: sandbox64: Enable PCI register multi-entry support
Marek Vasut [Sun, 13 Aug 2023 19:51:50 +0000 (21:51 +0200)]
configs: sandbox64: Enable PCI register multi-entry support

Align the sandbox64 defconfig with sandbox defconfig. Enable missing
PCI register multi-entry support. This fixes ut_dm_dm_test_pci_bus_to_phys
test .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoconfigs: sandbox64: Enable clock CCF driver
Marek Vasut [Sun, 13 Aug 2023 19:50:29 +0000 (21:50 +0200)]
configs: sandbox64: Enable clock CCF driver

Align the sandbox64 defconfig with sandbox defconfig. Enable missing
CCF and Sandbox CCF drivers. This fixes ut_dm_dm_test_clk_ccf test .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoconfigs: sandbox64: Enable video 12x22 font support
Marek Vasut [Sun, 13 Aug 2023 05:15:06 +0000 (07:15 +0200)]
configs: sandbox64: Enable video 12x22 font support

Align the sandbox64 defconfig with sandbox defconfig. Enable missing
12x22 font support. This fixes ut_dm_dm_test_video_text_12x22 test .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoconfigs: sandbox64: Enable video 16bpp and 24bpp support
Marek Vasut [Sun, 13 Aug 2023 05:15:05 +0000 (07:15 +0200)]
configs: sandbox64: Enable video 16bpp and 24bpp support

Align the sandbox64 defconfig with sandbox defconfig. Enable missing
16bpp and 24bpp video support. This fixes ut_dm_dm_test_video_bmp16
and ut_dm_dm_test_video_bmp24 tests .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoconfigs: sandbox64: Enable PINCTRL_SINGLE driver
Marek Vasut [Sun, 13 Aug 2023 03:32:09 +0000 (05:32 +0200)]
configs: sandbox64: Enable PINCTRL_SINGLE driver

Align the sandbox64 defconfig with sandbox defconfig. Enable missing
PINCTRL single driver. This fixes ut_dm_dm_test_pinctrl_single test .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agotest: dm: pinmux: Handle %pa in pinctrl-single mux output
Marek Vasut [Sun, 13 Aug 2023 03:32:08 +0000 (05:32 +0200)]
test: dm: pinmux: Handle %pa in pinctrl-single mux output

The pinctrl-single driver uses %pa to print register value
in its single_get_pin_muxing() output. Handle this properly
in the test based on CONFIG_PHYS_64BIT .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoconfigs: sandbox64: Enable BUTTON_ADC driver
Marek Vasut [Sun, 13 Aug 2023 03:05:52 +0000 (05:05 +0200)]
configs: sandbox64: Enable BUTTON_ADC driver

Align the sandbox64 defconfig with sandbox defconfig. Enable missing
BUTTON ADC driver. This fixes ut_dm_dm_test_button_keys_adc test .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoconfigs: sandbox64: Enable MC34708 driver
Marek Vasut [Sun, 13 Aug 2023 02:57:01 +0000 (04:57 +0200)]
configs: sandbox64: Enable MC34708 driver

Align the sandbox64 defconfig with sandbox defconfig. Enable missing
MC34708 PMIC driver. This fixes ut_dm_dm_test_power_pmic_mc34708_get test .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoconfigs: sandbox64: Increase console record size to 0x6000
Marek Vasut [Sun, 13 Aug 2023 01:17:54 +0000 (03:17 +0200)]
configs: sandbox64: Increase console record size to 0x6000

Align the sandbox64 defconfig with sandbox defconfig. Increase the
console record size. This fixes ut_bootstd_bootflow_cmd_scan_e .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoconfigs: sandbox64: Enable SF bootdev
Marek Vasut [Sun, 13 Aug 2023 00:15:53 +0000 (02:15 +0200)]
configs: sandbox64: Enable SF bootdev

Align the sandbox64 defconfig with sandbox defconfig. Enable missing
SPI NOT bootdev. This fixes ut_bootstd_bootdev_test_cmd_hunt test .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sun, 20 Aug 2023 15:09:11 +0000 (11:09 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh

16 months agoarm: rmobile: Fix off-by-one error in cpuinfo
Paul Barker [Fri, 18 Aug 2023 13:17:21 +0000 (14:17 +0100)]
arm: rmobile: Fix off-by-one error in cpuinfo

In rmobile_cpuinfo_idx() there is an off-by-one error in accessing the
rmobile_cpuinfo array.

At the end of the loop, i is equal to the array size, i.e.
rmobile_cpuinfo[i] accesses one entry past the end of the array. The
last entry in the array is a fallback value so the loop should count to
ARRAY_SIZE(rmobile_cpuinfo) - 1 instead, this will leave i equal to the
index of the fallback value if no match is found.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agoMerge tag 'doc-2023-10-rc3-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 19 Aug 2023 14:13:28 +0000 (10:13 -0400)]
Merge tag 'doc-2023-10-rc3-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request doc-2023-10-rc3-2

Documentation:

* csf_examples: csf.sh: Remove unneeded export ATF_LOAD_ADDR line
* printf() codes: correct format specifier for unsigned int
* Fix typos in clk.h, irq.h.
* Correct description of proftool

Other:

* Quieten test for erofs filesystem presence
* spl: don't assume NVMe partition 1 exists

16 months agodoc: csf_examples: csf.sh: Remove unneeded export ATF_LOAD_ADDR line
Fabio Estevam [Tue, 15 Aug 2023 13:48:01 +0000 (10:48 -0300)]
doc: csf_examples: csf.sh: Remove unneeded export ATF_LOAD_ADDR line

Originally, exporting the ATF_LOAD_ADDR was required, but since binman has
been used to generate the flash.bin, it is no longer needed to do
such manual export.

The ATF address is now passed via binman.

Remove the unneeded export ATF_LOAD_ADDR line.

Signed-off-by: Fabio Estevam <festevam@denx.de>
16 months agoirq: Fix typo in header comment
Paul Barker [Mon, 14 Aug 2023 19:13:35 +0000 (20:13 +0100)]
irq: Fix typo in header comment

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
16 months agoclk: Fix typo in header comment
Paul Barker [Mon, 14 Aug 2023 19:13:34 +0000 (20:13 +0100)]
clk: Fix typo in header comment

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
16 months agodoc: printf() codes: Fix format specifier for unsigned int
Siddharth Vadapalli [Mon, 14 Aug 2023 04:53:48 +0000 (10:23 +0530)]
doc: printf() codes: Fix format specifier for unsigned int

The format specifier for the "unsigned int" variable is documented as
"%d". However, it should be "%u". Thus, fix it.

Fixes: f5e9035043fb ("doc: printf() codes")
Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
16 months agodocs: fix wrong usage of proftool
Puhan Zhou [Sun, 13 Aug 2023 05:16:19 +0000 (13:16 +0800)]
docs: fix wrong usage of proftool

The usage of proftool in docs is incorrect. If proftool is used without
'-o' argument, it will show the usage like following

$ ./sandbox/tools/proftool -m sandbox/System.map -t trace -f funcgraph dump-ftrace >trace.dat
Must provide trace data, System.map file and output file
Usage: proftool [-cmtv] <cmd> <profdata>

Change '>' to '-o' to fix it.

Signed-off-by: Puhan Zhou <puh4n.zhou@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agospl: don't assume NVMe partition 1 exists
Heinrich Schuchardt [Tue, 15 Aug 2023 16:07:36 +0000 (18:07 +0200)]
spl: don't assume NVMe partition 1 exists

There is no requirement that a partition 1 exists in a partition table.
We should not try to retrieve information about it.

We should not even try reading with partition number
CONFIG_SYS_NVME_BOOT_PARTITION here as this is done in the fs_set_blk_dev()
call anyway.

Fixes: 8ce6a2e17577 ("spl: blk: Support loading images from fs")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agofs/erofs: Quieten test for filesystem presence
Simon Glass [Sun, 13 Aug 2023 14:26:40 +0000 (08:26 -0600)]
fs/erofs: Quieten test for filesystem presence

At present listing a partition produces lots of errors about this
filesystem:

   => part list mmc 4
   cannot find valid erofs superblock
   cannot find valid erofs superblock
   cannot read erofs superblock: -5
   [9 more similar lines]

Use debugging rather than errors when unable to find a signature, as is
done with other filesystems.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
16 months agoMerge branch '2023-08-18-assorted-updates' into next
Tom Rini [Fri, 18 Aug 2023 17:45:58 +0000 (13:45 -0400)]
Merge branch '2023-08-18-assorted-updates' into next

- Use built-in ffs/fls on ARM, fix a PIE issue in SPL on ARMv8, bcm283x
  and mediatek updates, whitespace fix in UFS uclass, make CI use
  "tools-only" defconfig for more tests, add TI TCA9554 GPIO support,
  cache alignment fix for SCSI, and fix a problem with
  SYS_MMCSD_RAW_MODE_ARGS_SECTOR in SPL.

16 months agorockchip: rk3566-anbernic-rgxx3: Rename defconfig to include SoC name
Jonas Karlman [Thu, 17 Aug 2023 21:52:48 +0000 (21:52 +0000)]
rockchip: rk3566-anbernic-rgxx3: Rename defconfig to include SoC name

Rename defconfig to include SoC name, use similar pattern as other
RK356x boards: <soc>-<name>.dts -> <name>-<soc>_defconfig

Suggested-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
16 months agoMerge tag 'tegra-for-2023.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 18 Aug 2023 14:05:04 +0000 (10:05 -0400)]
Merge tag 'tegra-for-2023.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-tegra

ARM: tegra: Changes for v2023.10-rc1

This adds support for various new Tegra30 boards (ASUS, LG and HTC) and
has some other minor enhancements, such as enabling the poweroff command
on several Tegra210 and Tegra186 boards.

16 months agoCI: Switch to tools-only from sandbox_spl for tooling tests
Tom Rini [Thu, 10 Aug 2023 16:52:24 +0000 (12:52 -0400)]
CI: Switch to tools-only from sandbox_spl for tooling tests

When running tools for various tests use the tools-only build rather
than sandbox_spl.  We used sandbox_spl here for historical reasons that
are no longer true.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agospl: mmc: Fix check of CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR
Elena Popa [Tue, 8 Aug 2023 13:42:15 +0000 (16:42 +0300)]
spl: mmc: Fix check of CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR

When Falcon Mode is enabled, SPL needs to check the value of
CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR. Unfortunately, it was using the
CONFIG_VAL(SYS_MMCSD_RAW_MODE_ARGS_SECTOR) which converts it into
CONFIG_SPL_SYS_MMCSD_RAW_MODE_ARGS_SECTOR when CONFIG_SPL_BUILD is
enabled. CONFIG_SPL_SYS_MMCSD_RAW_MODE_ARGS_SECTOR does not exist in
common/spl/Kconfig. Replaced with
defined(CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR).

Signed-off-by: Elena Popa <elena.popa@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agoscsi: Cache align temporary buffer
Marek Vasut [Mon, 7 Aug 2023 00:26:12 +0000 (02:26 +0200)]
scsi: Cache align temporary buffer

The temporary buffer may be passed to DMA capable device,
make sure it is cache aligned.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agogpio: pca953x: Add TI TCA9554 support
Marek Vasut [Sun, 6 Aug 2023 23:36:05 +0000 (01:36 +0200)]
gpio: pca953x: Add TI TCA9554 support

Add support for TI TCA9554, which is compatible with PCA9554 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agoufs: cdns: Drop extra space
Marek Vasut [Sun, 6 Aug 2023 18:18:42 +0000 (20:18 +0200)]
ufs: cdns: Drop extra space

Drop extra space before UCLASS. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agoarm: mediatek: add usb support for MT7988
Frank Wunderlich [Thu, 3 Aug 2023 18:00:01 +0000 (20:00 +0200)]
arm: mediatek: add usb support for MT7988

MT7988 has a t-phy and an x-phy controller. There is already a driver for
t-phy so we can add USB support for this phy type.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
16 months agoarm: dts: mediatek: convert gmac link mode to 2500base-x for r3
Frank Wunderlich [Thu, 3 Aug 2023 16:52:58 +0000 (18:52 +0200)]
arm: dts: mediatek: convert gmac link mode to 2500base-x for r3

Ethernet on Bananapi-r3 is broken after

commit bd70f3cea353 ("net: mediatek: add support for SGMII 1Gbps auto-negotiation mode")

because changes from this commit were not applied to bpi-r3 devicetree too:

commit aef54ea16cac ("arm: dts: medaitek: convert gmac link mode to 2500base-x")

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
16 months agoarm: bcm283x undefined reference to "print_cpuinfo"
Naveen Kumar Chaudhary [Thu, 3 Aug 2023 13:39:35 +0000 (19:09 +0530)]
arm: bcm283x undefined reference to "print_cpuinfo"

Builds for Raspberry Pi targets fail when CONFIG_DISPLAY_CPUINFO is
enabled and following error can be seen -
common/board_f.o:(.rodata.init_sequence_f+0x90):
    undefined reference to `print_cpuinfo'

Added implementation of function "print_cpuinfo"

Signed-off-by: Naveen Kumar Chaudhary <naveenchaudhary2010@hotmail.com>
16 months agoarmv8: Skip PIE in SPL due to load alignment fault.
Kevin Chen [Thu, 3 Aug 2023 08:12:18 +0000 (16:12 +0800)]
armv8: Skip PIE in SPL due to load alignment fault.

When PIE is enabled in start.S, u-boot/-spl use __rel_dyn_start
and _rel_dyn_end symbol to be loaded to and executed at a
different address than it was linked at.

u-boot-spl.lds is used in SPL build, but relocation information
section(.rela*) were discarded.
In line number 80 in arch/arm/cpu/armv8/u-boot-spl.lds
 /DISCARD/ : { *(.rela*) }

If PIE enabled in SPL, __rel_dyn_start which is defined as
.rel_dyn_start in sections.c will be apended to the end of
.bss section.

In our ASPEED case, size of .bss section would let .rel_dyn_start
without 8-byte alignment, leading to alignment fault when
executing ldp instuction in pie_fix_loop.

Signed-off-by: Kevin Chen <kevin_chen@aspeedtech.com>
16 months agoarm: Use builtins for ffs/fls
Sean Anderson [Mon, 31 Jul 2023 21:27:33 +0000 (17:27 -0400)]
arm: Use builtins for ffs/fls

Since ARMv5, the clz instruction allows for efficient implementation of
ffs/fls with builtins. Until ARMv7 (with Thumb-2), this instruction is
only available in ARM mode. LTO makes it difficult to force specific
functions to be in ARM mode, as it is effectively a form of very
aggressive inlining. To work around this, fls/ffs are implemented in
assembly for ARMv5 and ARMv6 when compiling U-Boot in Thumb mode.
Overall, this saves around 75 bytes per call.

This code is synced with v5.15 of the Linux kernel.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agoMerge branch '2023-08-17-ti-k3-am64-dt-resync' into next
Tom Rini [Thu, 17 Aug 2023 19:17:18 +0000 (15:17 -0400)]
Merge branch '2023-08-17-ti-k3-am64-dt-resync' into next

To quote the author:

This series syncs AM64 DT files from Linux v6.5-rc1.

Tested on AM642-EVM GP SR1.0 and AM642-SK-EVM HS-FS SR2.0.

16 months agoarm: dts: k3-am64: Sync DT with Linux v6.5-rc1
Roger Quadros [Sat, 5 Aug 2023 08:14:40 +0000 (11:14 +0300)]
arm: dts: k3-am64: Sync DT with Linux v6.5-rc1

Sync all am642-evm/am642-sk related DT files
with Linux v6.5-rc1.

- drop timer1 in favor of main_timer0 in am64-main.dtsi.
Need to delete clock & power domain properties of
main_timer1 in -r5.dts else won't boot. This is because
timer_init is done during rproc_start to start System Firmware,
but we can't do any clock/power-domain operations before
System Firmware starts.
- same constraint applies to main_uart0
- drop cpsw3g custom DT property 'mac_efuse' and custom
DT node cpsw-phy-sel as driver picks these from standard
property/node.
- include board dts file in -r5 dts file to avoid duplication
of nodes. Include -u-boot.dtsi on top.
- drop duplicate nodes in -r5 dts and -u-boot.dtsi

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Tested-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
16 months agodoc: board: ti: am64: Add boot flow diagram
Roger Quadros [Sat, 5 Aug 2023 08:14:39 +0000 (11:14 +0300)]
doc: board: ti: am64: Add boot flow diagram

Add documenatation and boot flow diagram for AM64 EVM/SoC.

Suggested-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com> #SK-AM64B
16 months agoRevert "ARM: dts: k3-am642-sk-u-boot: add PMIC node"
Roger Quadros [Sat, 5 Aug 2023 08:14:38 +0000 (11:14 +0300)]
Revert "ARM: dts: k3-am642-sk-u-boot: add PMIC node"

This reverts commit 28a4c3113445d4400639f357fae0def007a41093.

This node should be in the board DT file and should come from upstream.
Moreover, this PMIC is no present on all variants of am642-sk
and will need a separate board DT file.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com> #SK-AM64B
16 months agoboard: ti: am64x: Recognize AM64-HSEVM
Roger Quadros [Sat, 5 Aug 2023 08:14:37 +0000 (11:14 +0300)]
board: ti: am64x: Recognize AM64-HSEVM

AM64-HSEVM is AM64-GPEVM with High Security Device.

Gets rid of "Unidentified board claims AM64-HSEVM in eeprom header".

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Acked-by: Andrew Davis <afd@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com> #SK-AM64B
16 months agoMerge branch '2023-08-17-assorted-minor-fixes'
Tom Rini [Thu, 17 Aug 2023 19:01:11 +0000 (15:01 -0400)]
Merge branch '2023-08-17-assorted-minor-fixes'

- More MAINTAINERS updates, update CI to use a newer coreboot and make
  arm-ffa a bit less verbose by default.

16 months agoboard: rockchip: rk35xx: Add myself as reviewer to MAINTAINERS
Jonas Karlman [Thu, 17 Aug 2023 06:04:38 +0000 (06:04 +0000)]
board: rockchip: rk35xx: Add myself as reviewer to MAINTAINERS

Add myself as a reviewer for RK3566/RK3568/RK3588 boards that I have and
can help with review and testing of defconfig and device tree changes.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Acked-by: Eugen Hristev <eugen.hristev@collabora.com>
16 months agoboard: rockchip: rk35xx: Add device tree files to MAINTAINERS
Jonas Karlman [Thu, 17 Aug 2023 06:04:36 +0000 (06:04 +0000)]
board: rockchip: rk35xx: Add device tree files to MAINTAINERS

Update MAINTAINERS files for RK3566/RK3568/RK3588 boards to include
related device tree files. Also replace space with tabs.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Acked-by: Eugen Hristev <eugen.hristev@collabora.com>
16 months agodoc: rockchip: Add supported RK3566/RK3568 boards
Jonas Karlman [Thu, 17 Aug 2023 06:04:34 +0000 (06:04 +0000)]
doc: rockchip: Add supported RK3566/RK3568 boards

Update Rockchip documentation to include RK3566/RK3568 boards already
supported. Also list Pine64 boards under RK3566 and drop defconfig to
match other listed boards.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
16 months agoMAINTAINERS: Update UFS maintainer
Neha Malcom Francis [Thu, 17 Aug 2023 12:09:14 +0000 (17:39 +0530)]
MAINTAINERS: Update UFS maintainer

Dropping Faiz Abbas from the UFS maintainer list as his e-mail ID is no
longer valid.

Adding Bhupesh Sharma who has been using this framework working on
Qualcomm Snapdragon SoCs as well as sending out fixes.

Adding myself as well to support in reviewing and testing patches.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Acked-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agoCI: x86: coreboot: Update to latest coreboot
Simon Glass [Fri, 11 Aug 2023 18:17:43 +0000 (12:17 -0600)]
CI: x86: coreboot: Update to latest coreboot

Use a recent coreboot build for this test.

The coreboot commit is:

   6f5ead14b4 mb/google/nissa/var/joxer: Update eMMC DLL settings

This is build with default settings, i.e. QEMU x86 i440fx/piix4

Add some documentation as to how to update it next time.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agocorstone1000: update maintainers
Abdellatif El Khlifi [Fri, 11 Aug 2023 12:22:57 +0000 (13:22 +0100)]
corstone1000: update maintainers

Update MAINTAINERS of corstone1000 board.

Signed-off-by: Xueliang Zhong <xueliang.zhong@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
16 months agoarm_ffa: use debug logs
Abdellatif El Khlifi [Wed, 9 Aug 2023 11:47:30 +0000 (12:47 +0100)]
arm_ffa: use debug logs

replace info logs with debug logs

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoarm: Add arch/arm/dts/Makefile specifically to MAINTAINERS
Tom Rini [Mon, 7 Aug 2023 21:08:11 +0000 (17:08 -0400)]
arm: Add arch/arm/dts/Makefile specifically to MAINTAINERS

In order to reduce the number of people that are cc'd on a patch for
simply touching arch/arm/dts/Makefile (which is a big common file) add
an entry specifically to MAINTAINERS under the ARM entry.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoMerge tag 'u-boot-stm32-20230816' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Wed, 16 Aug 2023 15:23:58 +0000 (11:23 -0400)]
Merge tag 'u-boot-stm32-20230816' of https://source.denx.de/u-boot/custodians/u-boot-stm

DHSOM: Power cycle Buck3 in reset
DHCOM: Switch DWMAC RMII clock to MCO2
stm32f746: fix display pinmux
stm32mp: psci: Inhibit PDDS because CSTBYDIS is set
stm32mp1: DT alignment with v6.4
stm32mp1: add splashscreen with STMicroelectronics logo
stm32mp1: clk: remove error for disabled clock in stm32mp1_clk_get_parent
serial: stm32: Extend TC timeout

16 months agoserial: stm32: extend TC timeout
Valentin Caron [Fri, 4 Aug 2023 14:09:04 +0000 (16:09 +0200)]
serial: stm32: extend TC timeout

Waiting 150us TC bit couldn't be enough.

If TFA lets 16 bits in USART fifo, we has to wait 16 times 87 us (time
of 10 bits (1 byte in most use cases) at a baud rate of 115200).

Fixes: b4dbc5d65a67 ("serial: stm32: Wait TC bit before performing initialization")
Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
16 months agoARM: dts: stm32: Switch DWMAC RMII clock to MCO2 on DHCOM
Marek Vasut [Wed, 26 Jul 2023 23:58:07 +0000 (01:58 +0200)]
ARM: dts: stm32: Switch DWMAC RMII clock to MCO2 on DHCOM

The DHCOM SoM has two options for supplying ETHRX clock to the DWMAC
block and PHY. Either (1) ETHCK_K generates 50 MHz clock on ETH_CLK
pad for the PHY and the same 50 MHz clock are fed back to ETHRX via
internal eth_clk_fb clock connection OR (2) ETH_CLK is not used at
all, MCO2 generates 50 MHz clock on MCO2 output pad for the PHY and
the same MCO2 clock are fed back into ETHRX via ETH_RX_CLK input pad
using external pad-to-pad connection.

Option (1) has two downsides. ETHCK_K is supplied directly from either
PLL3_Q or PLL4_P, hence the PLL output is limited to exactly 50 MHz and
since the same PLL output is also used to supply SDMMC blocks, the
performance of SD and eMMC access is affected. The second downside is
that using this option, the EMI of the SoM is higher.

Option (2) solves both of those problems, so implement it here. In this
case, the PLL4_P is no longer limited and can be operated faster, at
100 MHz, which improves SDMMC performance (read performance is improved
from ~41 MiB/s to ~57 MiB/s with dd if=/dev/mmcblk1 of=/dev/null bs=64M
count=1). The EMI interference also decreases.

Ported from Linux kernel commit
73ab99aad50cd ("ARM: dts: stm32: Switch DWMAC RMII clock to MCO2 on DHCOM")

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
16 months agoboard: stm32mp1: add splash screen with stmicroelectronics logo
Patrick Delaunay [Mon, 10 Jul 2023 11:30:59 +0000 (13:30 +0200)]
board: stm32mp1: add splash screen with stmicroelectronics logo

Display the STMicroelectronics logo with features VIDEO_LOGO and
SPLASH_SCREEN on STMicroelectronics boards.

With CONFIG_SYS_VENDOR = "st", the logo st.bmp is selected, loaded at the
address indicated by splashimage and centered with "splashpos=m,m".

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
16 months agoARM: dts: stm32mp: alignment with v6.4
Patrick Delaunay [Mon, 10 Jul 2023 08:38:45 +0000 (10:38 +0200)]
ARM: dts: stm32mp: alignment with v6.4

Device tree alignment with Linux kernel v6.4.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
16 months agoARM: stm32: Inhibit PDDS because CSTBYDIS is set
Marek Vasut [Thu, 6 Jul 2023 21:32:27 +0000 (23:32 +0200)]
ARM: stm32: Inhibit PDDS because CSTBYDIS is set

The PWR_MPUCR CSTBYDIS bit is set, therefore the CA cores can never
enter CStandby state and would always end up in CStop state. Clear
the PDDS bit, which indicates the CA cores can enter CStandby state
as it makes little sense to keep it set with CSTBYDIS also set.

This does however fix a problem too. When both PWR_MPUCR and PWR_MCUCR
PDDS bits are set, then the chip enters CStandby state even though the
PWR_MCUCR CSTBYDIS is set. Clearing the PWR_MPUCR PDDS prevents that
from happening.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
16 months agoARM: dts: stm32: fix display pinmux for stm32f746-disco
Dario Binacchi [Mon, 3 Jul 2023 16:02:33 +0000 (18:02 +0200)]
ARM: dts: stm32: fix display pinmux for stm32f746-disco

As reported by the datasheet (DocID027590 Rev 4) for PG12:
- AF9  -> LCD_B4
- AF14 -> LCD_B1

So replace AF14 with AF9 for PG12 in the dts.

Fixes: fe63d3cfb77ef ("ARM: dts: stm32: Sync DT with v4.20 kernel for stm32f7")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
16 months agoclk: stm32mp1: remove error for disabled clock in stm32mp1_clk_get_parent
Patrick Delaunay [Fri, 23 Jun 2023 13:05:16 +0000 (15:05 +0200)]
clk: stm32mp1: remove error for disabled clock in stm32mp1_clk_get_parent

To disabled a clock in clock tree initialization for a mux of STM32MP15,
the selected clock source index is set with the latest possible index for
the number of bit used. Today this valid configuration cause a error
in U-Boot messages, for example with CLK_ETH_DISABLED, when this clock
is not needed for the used ETH PHY without crystal:

   no parents defined for clk id 123

This patch change the level of this message to avoid this trace for
valid clock tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
16 months agoARM: stm32: Power cycle Buck3 in reset on DHSOM
Marek Vasut [Wed, 17 May 2023 22:02:39 +0000 (00:02 +0200)]
ARM: stm32: Power cycle Buck3 in reset on DHSOM

In case the DHSOM is in suspend state and either reset button is pushed
or IWDG2 triggers a watchdog reset, then DRAM initialization could fail
as follows:

  "
  RAM: DDR3L 32bits 2x4Gb 533MHz
  DDR invalid size : 0x4, expected 0x40000000
  DRAM init failed: -22
  ### ERROR ### Please RESET the board ###
  "

Avoid this failure by not keeping any Buck regulators enabled during reset,
let the SoC and DRAMs power cycle fully. Since the change which keeps Buck3
VDD enabled during reset is ST specific, move this addition to ST specific
SPL board initialization so that it wouldn't affect the DHSOM .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
16 months agoMerge branch '2023-08-15-add-SGMII-support-for-TI-j7200' into next
Tom Rini [Wed, 16 Aug 2023 01:49:34 +0000 (21:49 -0400)]
Merge branch '2023-08-15-add-SGMII-support-for-TI-j7200' into next

To quote the author:
This series adds support for SGMII mode to the CPSW driver to enable the
functionality on TI's J7200 SoC.

Supporting SGMII mode also requires changes to the WIZ driver which acts
as a wrapper for the SerDes used by the CPSW MAC to transmit data to the
Ethernet PHY daughtercard mounted on the I2C GPIO Expander 2 connector
on the J7200 EVM.

Powering on and resetting the Ethernet PHY requires MDIO support which
is added to the CPSW driver.

For supporting DMA transactions from the MAIN CPSW instance to the A72
Host on J7200 SoC, the corresponding PSI-L endpoint information is added
for the J721E SoC, which is applicable to J7200 SoC as well.

The SGMII daughtercard used for testing SGMII mode has TI's DP83869 PHY.
Thus, enable the config for DP83869 driver functionality. Also, enable
GPIO HOG config.

16 months agoconfigs: j7200_evm_a72: Enable configs for SGMII support with MAIN CPSW0
Siddharth Vadapalli [Wed, 2 Aug 2023 08:17:29 +0000 (13:47 +0530)]
configs: j7200_evm_a72: Enable configs for SGMII support with MAIN CPSW0

The MAIN CPSW0 instance of CPSW Ethernet Switch on TI's J7200 SoC
supports SGMII mode. To enable support for utilizing the SGMII
daughtercard with TI's DP83869 PHY, enable the corresponding config.

Also, since the SGMII daughtercard is connected to the I2C GPIO
Expander 2 connector on the J7200 EVM, powering on the Ethernet PHY and
resetting it requires GPIO Hogging capability. Enable it as well.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
16 months agophy: ti: j721e-wiz: Add SGMII support in WIZ driver for J721E
Siddharth Vadapalli [Wed, 2 Aug 2023 08:17:28 +0000 (13:47 +0530)]
phy: ti: j721e-wiz: Add SGMII support in WIZ driver for J721E

Enable full rate divider configuration support for J721E_WIZ_16G for SGMII.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
16 months agophy: ti: phy-j721e-wiz: Add SGMII support in wiz driver for J7200
Siddharth Vadapalli [Wed, 2 Aug 2023 08:17:27 +0000 (13:47 +0530)]
phy: ti: phy-j721e-wiz: Add SGMII support in wiz driver for J7200

Select the same mac divider for SGMII too as the one being used for
QSGMII.

Enable full rate divider configuration support for J721E_WIZ_10G for
SGMII.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
16 months agonet: ti: am65-cpsw-nuss: Add logic to support MDIO reset
Suman Anna [Wed, 2 Aug 2023 08:17:26 +0000 (13:47 +0530)]
net: ti: am65-cpsw-nuss: Add logic to support MDIO reset

Enhance the AM65 CPSW NUSS driver to perform a MDIO reset using a GPIO
line. Logic is also added to perform a pre and post delay around reset
using the optional 'reset-delay-us' and 'reset-post-delay-us' properties.
This is similar to the reset being performed in the Linux kernel. The
reset is done once when the CPSW MDIO bus is being initialized.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>