platform/kernel/u-boot.git
18 months agoide: Correct LBA setting
Simon Glass [Tue, 25 Apr 2023 16:54:51 +0000 (10:54 -0600)]
ide: Correct LBA setting

Fix a longstanding bug where the LBA is calculated as the size of the
media instead of the number of blocks. This was perhaps not noticed
earlier since it prints the correct value first, before setting the wrong
value.

Drop the unnecessary blksz variable while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 68e6f221ed0 ("block: ide: Fix block read/write with driver model")

18 months agoide: Use a single local blk_desc for ide_ident()
Simon Glass [Tue, 25 Apr 2023 16:54:50 +0000 (10:54 -0600)]
ide: Use a single local blk_desc for ide_ident()

We only use one member of the ide_dev_desc[] array at a time and it does
not stick around outside ide_probe(). Use a single element instead.

Copy over the missing members of blk_desc at the same, since this was
missing from the previous code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 68e6f221ed0 ("block: ide: Fix block read/write with driver model")

18 months agoide: Move all blk_desc init into ide_ident()
Simon Glass [Tue, 25 Apr 2023 16:54:49 +0000 (10:54 -0600)]
ide: Move all blk_desc init into ide_ident()

Rather than having the caller fill some of this in, do it all in the
ide_ident() function, since it knows all the values.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Make ide_ident() return an error code
Simon Glass [Tue, 25 Apr 2023 16:54:48 +0000 (10:54 -0600)]
ide: Make ide_ident() return an error code

Update ide_ident() to indicate whether it finds a device or not. Use
that to decide whether to create a block device for it, rather than
looking DEV_TYPE_UNKNOWN.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Use desc consistently for struct blk_desc
Simon Glass [Tue, 25 Apr 2023 16:54:47 +0000 (10:54 -0600)]
ide: Use desc consistently for struct blk_desc

Most of the code uses 'desc' as the variable name for a blk descriptor.
Change ide to do the same.

Tidy up some extra brackets and types while we are here.

Leave the code in ide_probe() alone since it is about to be refactored.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Combine the two loops in ide_probe()
Simon Glass [Tue, 25 Apr 2023 16:54:46 +0000 (10:54 -0600)]
ide: Combine the two loops in ide_probe()

The two loops in this function operate on the same ide_dev_desc[] array.
Combine them to reduce duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Move ide_init() entirely within ide_probe()
Simon Glass [Tue, 25 Apr 2023 16:54:45 +0000 (10:54 -0600)]
ide: Move ide_init() entirely within ide_probe()

Now that ide_probe() is the only caller of ide_init(), move all the code
into the probe function, so it is easier to refactor it.

Move ide_dev_desc[] into ide_probe() to, since it is the only user.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Move setting of vendor strings into ide_probe()
Simon Glass [Tue, 25 Apr 2023 16:54:44 +0000 (10:54 -0600)]
ide: Move setting of vendor strings into ide_probe()

The current implementation adds this information in the block device's
probe() function, which is called in the blk_probe_or_unbind() in
ide_probe().

It is simpler to do this in ide_probe() itself, since the effect is the
same. This helps to consolidate use of ide_dev_desc[] which we would like
to remove.

Use strlcpy() to keep checkpatch happy.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Make ide_bus_ok a local variable
Simon Glass [Tue, 25 Apr 2023 16:54:43 +0000 (10:54 -0600)]
ide: Make ide_bus_ok a local variable

This is only used in one place now, so make it a local variable.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Move bus init into a function
Simon Glass [Tue, 25 Apr 2023 16:54:42 +0000 (10:54 -0600)]
ide: Move bus init into a function

Move this code into a separate function which returns whether the bus was
found, or not.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Avoid preprocessor for CONFIG_LBA48
Simon Glass [Tue, 25 Apr 2023 16:54:41 +0000 (10:54 -0600)]
ide: Avoid preprocessor for CONFIG_LBA48

Use IS_ENABLED() instead for all conditions. Add the 'lba48' flag into
struct blk_desc always, since it uses very little space. Use a bool so
the meaning is clearer.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
18 months agoide: Avoid preprocessor for CONFIG_ATAPI
Simon Glass [Tue, 25 Apr 2023 16:54:40 +0000 (10:54 -0600)]
ide: Avoid preprocessor for CONFIG_ATAPI

Use IS_ENABLED() instead for all conditions.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Simplify success condition
Simon Glass [Tue, 25 Apr 2023 16:54:39 +0000 (10:54 -0600)]
ide: Simplify success condition

Change the if() to remove extra brackets and check for the positive case
first, i.e. when a device is found. Exit the loop in that case, with the
retry logic in the 'else' part.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Refactor confusing loop code
Simon Glass [Tue, 25 Apr 2023 16:54:38 +0000 (10:54 -0600)]
ide: Refactor confusing loop code

This code is hard to follow as it uses #ifdef in a strange way. Adjust
it to avoid the preprocessor. Drop the special return for the non-ATAPI
case since we can rely on tries becoming 0 and exiting the loop.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Change the retries variable
Simon Glass [Tue, 25 Apr 2023 16:54:37 +0000 (10:54 -0600)]
ide: Change the retries variable

Use a 'tries' variable which starts at the number of tries we want to do,
rather than a 'retries' one that stops at either 1 or 2. This will make it
easier to refactor the code to avoid the horrible #ifdefs

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Make function static
Simon Glass [Tue, 25 Apr 2023 16:54:36 +0000 (10:54 -0600)]
ide: Make function static

Only one function is called from outside this file. Make all the others
static.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Correct use of ATAPI
Simon Glass [Tue, 25 Apr 2023 16:54:35 +0000 (10:54 -0600)]
ide: Correct use of ATAPI

The use of atapi_read() was incorrect dropped. Fix this so that it will
be used when needed. Use a udevice for the first argument of atapi_read()
so it is consistent with ide_read().

This requires much of the ATAPI code to be brought out from behind the
existing #ifdef. It will still be removed by the compiler if it is not
needed.

Add an atapi flag to struct blk_desc so the information can be retained.

Fixes: 145df842b44 ("dm: ide: Add support for driver-model block devices")
Fixes: d0075059e4d ("ide: Drop non-DM code for BLK")
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Create a prototype for ide_set_reset()
Simon Glass [Tue, 25 Apr 2023 16:54:34 +0000 (10:54 -0600)]
ide: Create a prototype for ide_set_reset()

This is used by a board so should be in the header file. Add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Drop weak functions
Simon Glass [Tue, 25 Apr 2023 16:54:33 +0000 (10:54 -0600)]
ide: Drop weak functions

These are not used from outside this file anymore. Make them static and
remove them from the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Move a few functions further up the file
Simon Glass [Tue, 25 Apr 2023 16:54:32 +0000 (10:54 -0600)]
ide: Move a few functions further up the file

Move these functions so they appear before they are used.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Drop ide_device_present()
Simon Glass [Tue, 25 Apr 2023 16:54:31 +0000 (10:54 -0600)]
ide: Drop ide_device_present()

This function is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Move ide_init() into probing
Simon Glass [Tue, 25 Apr 2023 16:54:30 +0000 (10:54 -0600)]
ide: Move ide_init() into probing

At present the code does ide_init() as a separate operation, then calls
device_probe() to copy over the information. We can call ide_init() from
probe just as easily.

The only difference is that using 'ide init' twice will do nothing.
However it already fails to copy over the new data in that case, so the
effect is the same. For now, unbind the block devices and remove the IDE
device, which causes the bus to be probed again. Later patches will fix
this up fully, so that all blk_desc data is copied across.

Since ide_reset() is only called from ide_init(), there is no need to init
the ide_dev_desc[] array. This is already done at the end of ide_init() so
drop this code.

The call to uclass_first_device() is now within the probe() function of
the same device, so does nothing. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Drop init for not using BLK
Simon Glass [Tue, 25 Apr 2023 16:54:29 +0000 (10:54 -0600)]
ide: Drop init for not using BLK

ALl boards use CONFIG_BLK now so this code is not used. Drop it and the
header-file #ifdef

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Drop CONFIG_START_IDE
Simon Glass [Tue, 25 Apr 2023 16:54:28 +0000 (10:54 -0600)]
ide: Drop CONFIG_START_IDE

This is not used by any board. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Use mdelay() for long delays
Simon Glass [Tue, 25 Apr 2023 16:54:27 +0000 (10:54 -0600)]
ide: Use mdelay() for long delays

Rather than using very large numbers with udelay(), use mdelay(), which
is easier to follow.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoide: Move ATA_CURR_BASE to C file
Simon Glass [Tue, 25 Apr 2023 16:54:26 +0000 (10:54 -0600)]
ide: Move ATA_CURR_BASE to C file

This is not used outside one C file. Move it out of the header to
reduce its visbility.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoMerge branch '2023-04-26-enable-bootstd-for-all-rockchip'
Tom Rini [Wed, 26 Apr 2023 17:29:49 +0000 (13:29 -0400)]
Merge branch '2023-04-26-enable-bootstd-for-all-rockchip'

- Merge Simon's series that enables bootstd and the distro bootmeth
  there for all of Rockchip.

18 months agorockchip: Use the same boot_targets for all boards
Simon Glass [Mon, 24 Apr 2023 01:49:52 +0000 (13:49 +1200)]
rockchip: Use the same boot_targets for all boards

It doesn't really matter if we mention things which are not present. For
example, if 'nvme' is included but the board does not support it, it just
continues with the next item in the list.

It is simpler to use the same target list for all boards, so drop the
different one for rk3399.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agorockchip: Move to standard boot
Simon Glass [Mon, 24 Apr 2023 01:49:51 +0000 (13:49 +1200)]
rockchip: Move to standard boot

Drop the distro-boot scripts and use standard boot instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Jonas Karlman <jonas@kwiboo.se>
18 months agobootstd: Use blk uclass device numbers to set efi bootdev
Mathew McBride [Mon, 24 Apr 2023 01:49:50 +0000 (13:49 +1200)]
bootstd: Use blk uclass device numbers to set efi bootdev

When loading a file from a block device, efiload_read_file
was using the seq_num of the device (e.g "35" of virtio_blk#35)
instead of the block device id (e.g what you get from running
the corresponding device scan command, like "virtio 0")

This cause EFI booting from these devices to fail as an
invalid device number is passed to blk_get_device_part_str:

  Scanning bootdev 'virtio-blk#35.bootdev':
  distro_efi_read_bootflow_file start (efi,fname=<NULL>)
  distro_efi_read_bootflow_file start (efi,fname=<NULL>)
  setting bootdev virtio, 35, efi/boot/bootaa64.efi, 00000000beef9a40, 170800
  efi_dp_from_name calling blk_get_device_part_str
  dev=virtio devnr=35 path=efi/boot/bootaa64.efi
  blk_get_device_part_str (virtio,35)
  blk_get_device_by_str (virtio, 35)
  ** Bad device specification virtio 35 **
  Using default device tree: dtb/qemu-arm.dtb
  No device tree available
  0  efi          ready   virtio       1  virtio-blk#35.bootdev.par efi/boot/bootaa64.efi
  ** Booting bootflow 'virtio-blk#35.bootdev.part_1' with efi
  blk_get_device_part_str (virtio,0:1)
  blk_get_device_by_str (virtio, 0)
  No UEFI binary known at beef9a40 (image buf=00000000beef9a40,addr=0000000000000000)
  Boot failed (err=-22)

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobootstd: Adjust code ordering to work around compiler quirk
Simon Glass [Mon, 24 Apr 2023 01:49:49 +0000 (13:49 +1200)]
bootstd: Adjust code ordering to work around compiler quirk

At present when debugging is off, bootdev_find_in_blk() sometimes fails
to find a valid bootflow, e.g. with virtio. Accessing the 'blk' variable
later in the function seems to correct it.

Move the 'ret' check before the debug statement and set the block device
again aftewards, to work around this.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobootstd: Show a message sometimes if no bootflows are found
Simon Glass [Mon, 24 Apr 2023 01:49:48 +0000 (13:49 +1200)]
bootstd: Show a message sometimes if no bootflows are found

Enable some messages that might provide hints, but only for
CMD_BOOTFLOW_FULL since otherwise the -l flag is not available.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
18 months agobootstd: Report missing labels only when asked
Simon Glass [Mon, 24 Apr 2023 01:49:47 +0000 (13:49 +1200)]
bootstd: Report missing labels only when asked

Use the -l flag to indicate whether to report missing uclasses.

Also try to be more helpful when no devices are found. For example, when
we see something 'scsi0' requested and nothing was found, this indicates
that there are no SCSI devices, so show a suitable message.

Move messages out of the low-level functions so that silent operation
is possible.

This means they are never reported unless BOOTSTD_FULL is enabled, since
the -l flag cannot otherwise be set.

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobootstd: Support booting EFI where multiple options exist
Simon Glass [Mon, 24 Apr 2023 01:49:46 +0000 (13:49 +1200)]
bootstd: Support booting EFI where multiple options exist

The current EFI implementation has a strange quirk where it watches
loaded files and uses the last-loaded file to determine the device that
is being booted from.

This is confusing with bootstd, where multiple options may exist. Even
loading a device tree will cause it to go wrong. There is no API for
passing this information, since the only entry into booting an EFI image
is the 'bootefi' command.

To work around this, call efi_set_bootdev() for EFI images, if possible,
just before booting.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agovirtio: Ensure PCI is set up first
Simon Glass [Mon, 24 Apr 2023 01:49:45 +0000 (13:49 +1200)]
virtio: Ensure PCI is set up first

Sometimes virtio may rely on PCI, or at least that is what the
distro_bootcmd script suggests. Add this in.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobootstd: Tweak bootflow logic for device tree
Simon Glass [Mon, 24 Apr 2023 01:49:44 +0000 (13:49 +1200)]
bootstd: Tweak bootflow logic for device tree

We should only store the FDT filename if we were able to determine one.
Adjust the logic for this.

This corrects the case where no FDT is needed to boot, such as with EFI
using ACPI.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoMerge branch '2023-04-25-assorted-updates-and-fixes'
Tom Rini [Wed, 26 Apr 2023 12:24:34 +0000 (08:24 -0400)]
Merge branch '2023-04-25-assorted-updates-and-fixes'

- A few TI, mpc8379erdb and vexpress64 updates, some arm64 core updates,
  test cleanups, Xen cleanups, assorted code and Kconfig cleanups (many
  in preparation for using clang on ARM), psci pre-reloc fixes, enable
  PCI bus mastering for ATA devices, and a gpio-uclass bugfix

18 months agogpio-uclass: fix off-by-one in gpio_request_list_by_name_nodev()
Rasmus Villemoes [Wed, 19 Apr 2023 10:10:13 +0000 (12:10 +0200)]
gpio-uclass: fix off-by-one in gpio_request_list_by_name_nodev()

By the time we jump to the err label, count represents the number of
gpios we've successfully requested. So by subtracting one, we fail to
free the most recently requested.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoxen: Limit execution to EL1 only
Michal Simek [Tue, 18 Apr 2023 12:51:56 +0000 (14:51 +0200)]
xen: Limit execution to EL1 only

Xen core_init() is calling HVC which should be called from EL1 level that's
why do Xen initialization only when U-Boot runs in EL1.

Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoxen: Add dependency on armv8
Michal Simek [Tue, 18 Apr 2023 12:51:55 +0000 (14:51 +0200)]
xen: Add dependency on armv8

U-Boot currently implements hypervisor calls only for ARM64 that's why add
dependency on ARM64. The hardware functionality is also available on
ARMv7a, but currently not supported by U-Boot, hence it is not added to the
list of dependencies here.

Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoarm: omap3: Directly use SMC #1 in lowlevel_init.S
Pali Rohár [Thu, 13 Apr 2023 20:34:43 +0000 (22:34 +0200)]
arm: omap3: Directly use SMC #1 in lowlevel_init.S

Since commit de39dc71625d ("arm: armv7-a: Compile and tune for armv7-a
instead of armv5") is used -march=armv7-a option for Omap3 platforms.

With directive ".arch_extension sec" it is possible for -march=armv7-a to
directly use ARM SMC instruction.

So enable ".arch_extension sec" in Omap3 lowlevel_init.S and replace hand
assembled ".word 0xe1600071" by "SMC #1".

Since commit 51d063865064 ("arm: omap-common: add secure smc entry") same
pattern is already used in arch/arm/cpu/armv7/omap-common/lowlevel_init.S.

Signed-off-by: Pali Rohár <pali@kernel.org>
18 months agotools: env: update lock path in README
John Keeping [Wed, 12 Apr 2023 11:24:26 +0000 (12:24 +0100)]
tools: env: update lock path in README

Commit aeb40f1166e0 ("tools: env: use /run to store lockfile") updated the
path to the lockfile but did not update the documentation to match.

Use the new path in the documentation.

Fixes: aeb40f1166 ("tools: env: use /run to store lockfile")
Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoata: pci: enable bus mastering
Christian Gmeiner [Tue, 11 Apr 2023 15:07:02 +0000 (17:07 +0200)]
ata: pci: enable bus mastering

The non DM code path already would enable pci bus mastering. Do the
same for the DM code path.

Fixes AHCI problems I am seeing on an Intel Apollolake device.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[trini: Use ahci_dev not dev in the calls]
Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agompc8379erdb: Convert to using DM_SERIAL
Sinan Akman [Fri, 7 Apr 2023 22:03:44 +0000 (18:03 -0400)]
mpc8379erdb: Convert to using DM_SERIAL

  Convert to DM_SERIAL for mpc8379erdb.

Signed-off-by: Sinan Akman <sinan@writeme.com>
18 months agoqemu: dfu: Correct memset call in set_dfu_alt_info
Tom Rini [Thu, 6 Apr 2023 13:58:40 +0000 (09:58 -0400)]
qemu: dfu: Correct memset call in set_dfu_alt_info

When building with clang, we see:
board/emulation/common/qemu_dfu.c:51:24: warning: 'memset' call operates on objects of type 'char' while the size is based on a different type 'char *' [-Wsizeof-pointer-memaccess]

As we're calling memset with the length set to the size of the pointer
and not the size of the buffer. Correct this with a call of the size of
the buffer itself.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
18 months agoapi: Rework menu, and make it depend on CC_IS_GCC
Tom Rini [Thu, 6 Apr 2023 13:48:58 +0000 (09:48 -0400)]
api: Rework menu, and make it depend on CC_IS_GCC

We can only use the old U-Boot API for standalone applications when
building U-Boot with GCC as it relies upon the "gd is a register" trick
that only GCC supports. Further, rework the rest of the options so that
they are in the API menu and only visible if API support is enabled.

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agosysreset: psci: add psci_sysreset_get_status
Peng Fan [Thu, 6 Apr 2023 10:23:19 +0000 (18:23 +0800)]
sysreset: psci: add psci_sysreset_get_status

Add weak function psci_sysreset_get_status for platform to define
their own reset status with CONFIG_SYSRESET enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agosysreset: psci: enable DM_FLAG_PRE_RELOC
Peng Fan [Thu, 6 Apr 2023 10:23:18 +0000 (18:23 +0800)]
sysreset: psci: enable DM_FLAG_PRE_RELOC

It is possible that cpu core may reset before relocation with PSCI reset

Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agofirmware: psci: enable DM_FLAG_PRE_RELOC
Peng Fan [Thu, 6 Apr 2023 10:23:17 +0000 (18:23 +0800)]
firmware: psci: enable DM_FLAG_PRE_RELOC

It is possible that cpu core may reset before relocation with PSCI reset

Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agoxen: Fix Kconfig dependencies
Michal Simek [Thu, 6 Apr 2023 08:04:15 +0000 (10:04 +0200)]
xen: Fix Kconfig dependencies

XEN config can be enabled by other platforms (even it doesn't need to make
sense) that's why fix dependencies. XEN (xenbus.c) requires sscanf (also
pvblock needs it). And PVBLOCK is inside drivers/xen folder which requires
XEN to be enabled.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
18 months agopytest: Use --lazy with umount
Tom Rini [Thu, 6 Apr 2023 02:19:39 +0000 (22:19 -0400)]
pytest: Use --lazy with umount

Sometimes when doing tests on real hardware we sometimes run in to the
case where some of these mounts haven't been fully flushed.  Using the
--lazy option with umount will allow us to continue while letting the OS
handle flushing the data out still.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agousb: gadget: f_mass_storage: Rework do_request_sense slightly
Tom Rini [Wed, 5 Apr 2023 23:48:57 +0000 (19:48 -0400)]
usb: gadget: f_mass_storage: Rework do_request_sense slightly

When building with clang, it notes that sdinfo may be unused
uninitialized in some cases. This appears to be true from reading the
code, and we can simply set the variable to zero to start with and be as
correct as before.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
18 months agoboot/image-board.c: Silence warning in select_ramdisk
Tom Rini [Wed, 5 Apr 2023 23:48:56 +0000 (19:48 -0400)]
boot/image-board.c: Silence warning in select_ramdisk

When building with clang we get a warning that rdaddr could be
uninitialized in one case. While this cannot functionally happen, we can
easily silence the warning.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoarmv7: Use isb/dsb directly in start.S
Tom Rini [Wed, 5 Apr 2023 23:48:55 +0000 (19:48 -0400)]
armv7: Use isb/dsb directly in start.S

Toolchains which do not directly support using "isb" and "dsb" directly
are no longer functionally supported in U-Boot. Furthermore, clang has
for a long time warned about using the alternate form that we were.
Update the code.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoarm: Centralize fixed register logic
Tom Rini [Wed, 5 Apr 2023 23:48:54 +0000 (19:48 -0400)]
arm: Centralize fixed register logic

When building for ARM64, we need to pass -ffixed-x18 and otherwise pass
-ffixed-r9. Rather than having this logic in two places, we can do this
once in arch/arm/config.mk. Further, while gcc will ignore being passed
both -ffixed-r9 and -ffixed-x18 and simply use -ffixed-x18, clang will
note that -ffixed-r9 is not used. Remove this duplication to also remove
the warning.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoclang: Don't look for libgcc
Tom Rini [Wed, 5 Apr 2023 23:48:53 +0000 (19:48 -0400)]
clang: Don't look for libgcc

In the case of using clang to build, and having not already enabled the
private libgcc, do not look for it, as it will not be found nor
required.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoclang: Add $(CLANG_TARGET) to LDPPFLAGS
Tom Rini [Wed, 5 Apr 2023 23:48:52 +0000 (19:48 -0400)]
clang: Add $(CLANG_TARGET) to LDPPFLAGS

When we invoke $(CPP) to make u-boot.lds we have LDPPFLAGS available to
set other required flags here. As this file is for the target and not
the host, we must ensure that CPP knows what the target architecture is.
For this, pass in $(CLANG_TARGET).

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoarm: Only support ARM64_CRC32 when using GCC
Tom Rini [Wed, 5 Apr 2023 23:48:51 +0000 (19:48 -0400)]
arm: Only support ARM64_CRC32 when using GCC

Today, only gcc has __builtin_aarch64_crc32b (clang-16 does not, for
example). Make this option depend on CC_IS_GCC.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agofs: yaffs2: Make yaffsfs_deviceList static
Bin Meng [Wed, 5 Apr 2023 14:40:22 +0000 (22:40 +0800)]
fs: yaffs2: Make yaffsfs_deviceList static

yaffsfs_deviceList is only referenced in yaffsfs.c

Signed-off-by: Bin Meng <bmeng@tinylab.org>
18 months agotest: move unit tests into a sub-menu
Heinrich Schuchardt [Mon, 3 Apr 2023 18:27:43 +0000 (20:27 +0200)]
test: move unit tests into a sub-menu

The main configuration menu should not contain detail settings.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agotest: improve configuration for Kconfig test options
Heinrich Schuchardt [Mon, 3 Apr 2023 10:04:39 +0000 (12:04 +0200)]
test: improve configuration for Kconfig test options

* Fix dependencies
* Provide labels that are easier to grasp.
* Fix typo %s/whgch/which/
* Fix type %s/Is/is/

Fixes: 29784d62eded ("test: Add some tests for kconfig.h")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoarm64: interrupts: print FAR_ELx on sync exceptions
Pavel Skripkin [Sun, 2 Apr 2023 16:27:34 +0000 (19:27 +0300)]
arm64: interrupts: print FAR_ELx on sync exceptions

Default synchronous exceptions handler prints only esr and register
dump. Sometimes it requiers to see an address which caused exceptions
to understand what's going on

ARM ARM in section D13.2.41 states that FAR_EL2 will contain meanfull
value in case of ESR.EC holds 0x20, 0x21, 0x24, 0x25, 0x22, 0x34 or
0x35. Same applies for EL1.

This patch adds function whivh determine current EL, gets correct FAR
register and prints it on panic.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
18 months agoconfigs: Create minimal vexpress_fvp_defconfig
Peter Hoyes [Fri, 31 Mar 2023 08:58:13 +0000 (09:58 +0100)]
configs: Create minimal vexpress_fvp_defconfig

The vexpress64 board family now relies on OF_CONTROL and
OF_HAS_PRIOR_STAGE, so platform-specific configuration requirements
are minimal.

The vexpress_aemv8a_semi_defconfig file defines many flags that are not
needed for a minimal boot, such as flash memory configuration.

Therefore create vexpress_fvp_defconfig which contains the minimum
configuration required to boot on an Arm v8a FVP.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
18 months agovexpress64: Enable VIRTIO_MMIO and RTC_PL031 in the base model
Peter Hoyes [Fri, 31 Mar 2023 08:58:12 +0000 (09:58 +0100)]
vexpress64: Enable VIRTIO_MMIO and RTC_PL031 in the base model

The Arm EBBR (Embedded Base Boot Requirements) require that the time
and basic networking EFI interfaces are available and working, so long
as the hardware has an RTC and network interface.

Arm FVPs typically have a memory-mapped PL031 RTC and a VIRTIO_NET
device defined in the device tree, so "imply" these in the Kconfig for
the FVP base model to simplify creating EBBR-compliant firmware.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
18 months agovexpress64: Use OF_HAS_PRIOR_STAGE for BASE_FVP variant
Peter Hoyes [Fri, 31 Mar 2023 08:58:11 +0000 (09:58 +0100)]
vexpress64: Use OF_HAS_PRIOR_STAGE for BASE_FVP variant

BASE_FVP now typically uses a devicetree provided by a prior boot stage
(typically Arm TF-A), so imply this option by default when
TARGET_VEXPRESS64_BASE_FVP is selected.

OF_HAS_PRIOR_STAGE selects OF_BOARD so this change is minor, but aligns
TARGET_VEXPRESS64_BASE_FVP with TARGET_VEXPRESS64_BASER_FVP.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
18 months agoinclude: configs: am64x_evm: Change to using .env
Nikhil M Jain [Thu, 30 Mar 2023 08:54:09 +0000 (14:24 +0530)]
include: configs: am64x_evm: Change to using .env

Move to using .env file for setting up environment variables for am64x.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
18 months agoarch: mach-k3: j721s2_init: Disable the firewalls
Jayesh Choudhary [Tue, 28 Mar 2023 13:02:01 +0000 (18:32 +0530)]
arch: mach-k3: j721s2_init: Disable the firewalls

Some firewalls enabled by ROM are still left on. So some
address space is inaccessible to the bootloader. For example,
in OSPI boot mode we get an exception and the system hangs.
Therefore, disable all the firewalls left on by the ROM.

Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agosoc: soc_ti_k3: fix revision array bounds checks
Rasmus Villemoes [Fri, 24 Mar 2023 07:44:29 +0000 (08:44 +0100)]
soc: soc_ti_k3: fix revision array bounds checks

If rev is equal to the array size, we'll access the array
one-past-the-end.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Bryan Brattlof <bb@ti.com>
18 months agoarmv8: enable HAFDBS for other ELx when FEAT_HAFDBS is present
meitao [Fri, 17 Mar 2023 16:22:53 +0000 (00:22 +0800)]
armv8: enable HAFDBS for other ELx when FEAT_HAFDBS is present

u-boot could be run at EL1/EL2/EL3. so we set it as same as EL1 does.
otherwise it will hang when enable mmu, that is what we encounter
in our SOC.

Signed-off-by: meitao <meitaogao@asrmicro.com>
[ Paul: pick from the Android tree. Rebase to the upstream ]
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Link: https://android.googlesource.com/platform/external/u-boot/+/3bf38943aeab4700c2319bff2a1477d99c6afd2f
18 months agoarm64: Use level-2 for largest block mappings when FEAT_HAFDBS is present
Marc Zyngier [Fri, 17 Mar 2023 16:22:52 +0000 (00:22 +0800)]
arm64: Use level-2 for largest block mappings when FEAT_HAFDBS is present

In order to make invalidation by VA more efficient, set the largest
block mapping to 2MB, mapping it onto level-2. This has no material
impact on u-boot's runtime performance, and allows a huge speedup
when cleaning the cache.

Signed-off-by: Marc Zyngier <maz@kernel.org>
[ Paul: pick from the Android tree. Rebase to the upstream ]
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Link: https://android.googlesource.com/platform/external/u-boot/+/417a73581a72ff6d6ee4b0938117b8a23e32f7e8
18 months agoarm64: Use FEAT_HAFDBS to track dirty pages when available
Marc Zyngier [Fri, 17 Mar 2023 16:22:51 +0000 (00:22 +0800)]
arm64: Use FEAT_HAFDBS to track dirty pages when available

Some recent arm64 cores have a facility that allows the page
table walker to track the dirty state of a page. This makes it
really efficient to perform CMOs by VA as we only need to look
at dirty pages.

Signed-off-by: Marc Zyngier <maz@kernel.org>
[ Paul: pick from the Android tree. Rebase to the upstream ]
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Link: https://android.googlesource.com/platform/external/u-boot/+/3c433724e6f830a6b2edd5ec3d4a504794887263
18 months agoMerge branch '2023-04-25-use-bounce-buffers-for-VIRTIO_F_IOMMU_PLATFORM'
Tom Rini [Tue, 25 Apr 2023 18:22:40 +0000 (14:22 -0400)]
Merge branch '2023-04-25-use-bounce-buffers-for-VIRTIO_F_IOMMU_PLATFORM'

To quote the author:
These patches will use bounce buffers when VIRTIO_F_IOMMU_PLATFORM
feature is in a virtio device.

This feature can be tested with qemu with -device virtio-iommu-pci.  So
that when a -device virtio-blk-pci with iommu_platform=true, it will
uses the bounce buffer instead.

18 months agovirtio: Use bounce buffers when VIRTIO_F_IOMMU_PLATFORM is set
Will Deacon [Wed, 29 Mar 2023 14:25:00 +0000 (22:25 +0800)]
virtio: Use bounce buffers when VIRTIO_F_IOMMU_PLATFORM is set

Devices advertising the VIRTIO_F_IOMMU_PLATFORM feature require
platform-specific handling to configure their DMA transactions.

When handling virtio descriptors for such a device, use bounce
buffers to ensure that the underlying buffers are always aligned
to and padded to PAGE_SIZE in preparation for platform specific
handling at page granularity.

Signed-off-by: Will Deacon <willdeacon@google.com>
[ Paul: pick from the Android tree. Rebase to the upstream ]
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Link: https://android.googlesource.com/platform/external/u-boot/+/1eff171e613ee67dca71dbe97be7282e2db17011
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agovirtio: Allocate bounce buffers for devices with VIRTIO_F_IOMMU_PLATFORM
Will Deacon [Wed, 29 Mar 2023 14:24:59 +0000 (22:24 +0800)]
virtio: Allocate bounce buffers for devices with VIRTIO_F_IOMMU_PLATFORM

In preparation for bouncing virtio data for devices advertising the
VIRTIO_F_IOMMU_PLATFORM feature, allocate an array of bounce buffer
structures in the vring, one per descriptor.

Signed-off-by: Will Deacon <willdeacon@google.com>
[ Paul: pick from the Android tree. Rebase to the upstream ]
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Link: https://android.googlesource.com/platform/external/u-boot/+/3e052749e7c50c4c1a6014e645ae3b9be3710c07
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agovirtio: Add helper functions to attach/detach vring descriptors
Will Deacon [Wed, 29 Mar 2023 14:24:58 +0000 (22:24 +0800)]
virtio: Add helper functions to attach/detach vring descriptors

Move the attach and detach logic for manipulating vring descriptors
out into their own functions so that we can later extend these to
bounce the data for devices with VIRTIO_F_IOMMU_PLATFORM set.

Signed-off-by: Will Deacon <willdeacon@google.com>
[ Paul: pick from the Android tree. Rebase to the upstream ]
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Link: https://android.googlesource.com/platform/external/u-boot/+/f73258a4bfe968c5f935db45f2ec5cc0104ee796
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agovirtio: Allocate virtqueue in page-size units
Will Deacon [Wed, 29 Mar 2023 14:24:57 +0000 (22:24 +0800)]
virtio: Allocate virtqueue in page-size units

In preparation for explicit bouncing of virtqueue pages for devices
advertising the VIRTIO_F_IOMMU_PLATFORM feature, introduce a couple
of wrappers around virtqueue allocation and freeing operations,
ensuring that buffers are handled in terms of page-size units.

Signed-off-by: Will Deacon <willdeacon@google.com>
[ Paul: pick from the Android tree. Rebase to the upstream ]
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Link: https://android.googlesource.com/platform/external/u-boot/+/b4bb5227d4cf4fdfcd8b4e1ff2692d3a54d1482a
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agovirtio: pci: Tear down VQs in virtio_pci_reset()
Will Deacon [Wed, 29 Mar 2023 14:24:56 +0000 (22:24 +0800)]
virtio: pci: Tear down VQs in virtio_pci_reset()

The pages backing the virtqueues for virtio PCI devices are not freed
on reset, despite the virtqueue structure being freed as part of the
driver '->priv_auto' destruction at ->remove() time.

Call virtio_pci_del_vqs() from virtio_pci_reset() to free the virtqueue
pages before freeing the virtqueue structure itself.

Signed-off-by: Will Deacon <willdeacon@google.com>
[ Paul: pick from the Android tree. Rebase to the upstream ]
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Link: https://android.googlesource.com/platform/external/u-boot/+/5ed54ccd83cbffd0d8719ce650604b4e44b5b0d8
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agovirtio: Expose VIRTIO_F_IOMMU_PLATFORM in device features
Will Deacon [Wed, 29 Mar 2023 14:24:55 +0000 (22:24 +0800)]
virtio: Expose VIRTIO_F_IOMMU_PLATFORM in device features

If we detect the VIRTIO_F_IOMMU_PLATFORM transport feature for a device,
then expose it in the device features.

Signed-off-by: Will Deacon <willdeacon@google.com>
[ Paul: pick from the Android tree. Rebase to the upstream ]
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Link: https://android.googlesource.com/platform/external/u-boot/+/9693bd26bfcfe77d6a1295a561420e08c5daf019
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoMerge branch '2023-04-24-TI-platform-updates'
Tom Rini [Mon, 24 Apr 2023 22:09:22 +0000 (18:09 -0400)]
Merge branch '2023-04-24-TI-platform-updates'

- Merge in assorted K3 updates, and re-sync all of the device trees for
  TI platforms with v6.3-rc6

18 months agoarm: mach-k3: am642: move do_dt_magic() after sysfw loading
Christian Gmeiner [Tue, 28 Mar 2023 14:13:14 +0000 (16:13 +0200)]
arm: mach-k3: am642: move do_dt_magic() after sysfw loading

Makes it possible to use e.g mcu_spi0 for custom board detection.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
18 months agoinclude: configs: j721e_evm: Fix name_fdt for J7200
Neha Malcom Francis [Fri, 14 Apr 2023 11:03:52 +0000 (16:33 +0530)]
include: configs: j721e_evm: Fix name_fdt for J7200

Currently, name_fdt is not set for J7200, fix this so right DTB is
picked during boot.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
18 months agoarm: mach-k3: common: re-locate authentication for atf/optee
Manorit Chawdhry [Fri, 14 Apr 2023 04:18:01 +0000 (09:48 +0530)]
arm: mach-k3: common: re-locate authentication for atf/optee

For setting up the master firewalls present in the K3 SoCs, the arm64
clusters need to be powered on.

Re-locates the code for atf/optee authentication.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agoremoteproc: ti_k3_arm64: Change the startup of arm64 core
Manorit Chawdhry [Fri, 14 Apr 2023 04:18:00 +0000 (09:48 +0530)]
remoteproc: ti_k3_arm64: Change the startup of arm64 core

Configuring master firewalls require the power of the cluster to be
enabled before configuring them, change the load of rproc to configure
the gtc clocks and start the cluster along with configuring the boot
vector.

The start of rproc will only start the core.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agoarm: dts: k3-am625-r5-sk: add a53 cluster power
Manorit Chawdhry [Fri, 14 Apr 2023 04:17:59 +0000 (09:47 +0530)]
arm: dts: k3-am625-r5-sk: add a53 cluster power

adds a53 cluster to control from the rproc driver

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agoarm: dts: k3-am62a7-r5-sk: add a53 cluster power domain node
Manorit Chawdhry [Fri, 14 Apr 2023 04:17:58 +0000 (09:47 +0530)]
arm: dts: k3-am62a7-r5-sk: add a53 cluster power domain node

adds a53 cluster to control from the rproc driver

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agoarm: dts: k3-am642-r5: add a53 cluster power domain node
Manorit Chawdhry [Fri, 14 Apr 2023 04:17:57 +0000 (09:47 +0530)]
arm: dts: k3-am642-r5: add a53 cluster power domain node

adds a53 cluster to control from the rproc driver

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agoarm: dts: k3-am642-r5-sk: add a53 cluster power domain node
Manorit Chawdhry [Fri, 14 Apr 2023 04:17:56 +0000 (09:47 +0530)]
arm: dts: k3-am642-r5-sk: add a53 cluster power domain node

adds a53 cluster to control from the rproc driver

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agoarm: dts: k3-j7200-r5: add a72 cluster power domain node
Manorit Chawdhry [Fri, 14 Apr 2023 04:17:55 +0000 (09:47 +0530)]
arm: dts: k3-j7200-r5: add a72 cluster power domain node

adds a72 cluster to control from the rproc driver

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agoarm: dts: k3-j721e-r5: add a72 cluster power domain node
Manorit Chawdhry [Fri, 14 Apr 2023 04:17:54 +0000 (09:47 +0530)]
arm: dts: k3-j721e-r5: add a72 cluster power domain node

adds a72 cluster to control from the rproc driver

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agoarm: dts: k3-j721e-r5-sk: add a72 cluster power domain node
Manorit Chawdhry [Fri, 14 Apr 2023 04:17:53 +0000 (09:47 +0530)]
arm: dts: k3-j721e-r5-sk: add a72 cluster power domain node

adds a72 cluster to control from the rproc driver

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agoarm: dts: k3-j721s2-r5: add a72 cluster power domain node
Manorit Chawdhry [Fri, 14 Apr 2023 04:17:52 +0000 (09:47 +0530)]
arm: dts: k3-j721s2-r5: add a72 cluster power domain node

adds a72 cluster to control from the rproc driver

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
18 months agoarm: mach-k3: Remove empty sys_proto.h include
Andrew Davis [Thu, 6 Apr 2023 16:38:21 +0000 (11:38 -0500)]
arm: mach-k3: Remove empty sys_proto.h include

This header file is now empty, remove it.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
18 months agoarm: mach-k3: Move J721s2 SPL init functions to mach-k3
Andrew Davis [Thu, 6 Apr 2023 16:38:20 +0000 (11:38 -0500)]
arm: mach-k3: Move J721s2 SPL init functions to mach-k3

This matches AM64 and J721e and removes the need to forward
declare k3_spl_init(), k3_mem_init(), and check_rom_loaded_sysfw()
in sys_proto.h.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
18 months agoarm: mach-k3: Move sdelay() and wait_on_value() declaration
Andrew Davis [Thu, 6 Apr 2023 16:38:19 +0000 (11:38 -0500)]
arm: mach-k3: Move sdelay() and wait_on_value() declaration

These probably should be in some system wide header given their use.
Until then move them out of K3 sys_proto.h so we can finish cleaning
that header out.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
18 months agoarm: mach-k3: Remove unused fdt_disable_node()
Andrew Davis [Thu, 6 Apr 2023 16:38:18 +0000 (11:38 -0500)]
arm: mach-k3: Remove unused fdt_disable_node()

This function is not used currently; remove it.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
18 months agoarm: mach-k3: Add weak do_board_detect() to common file
Andrew Davis [Thu, 6 Apr 2023 16:38:17 +0000 (11:38 -0500)]
arm: mach-k3: Add weak do_board_detect() to common file

This matches how it was done for pre-K3 TI platforms and it allows
us to move the forward declaration out of sys_proto.h.

It also removes the need for K3_BOARD_DETECT as one is free to simply
override the weak function in their board files as needed.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
18 months agoarm: mach-k3: Move sysfw-loader.h out of mach includes
Andrew Davis [Thu, 6 Apr 2023 16:38:16 +0000 (11:38 -0500)]
arm: mach-k3: Move sysfw-loader.h out of mach includes

This header is only used locally by K3 init files, no need to have it
up with the global mach includes. Move into local includes.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
18 months agoarm: mach-k3: Make release_resources_for_core_shutdown() common
Andrew Davis [Thu, 6 Apr 2023 16:38:15 +0000 (11:38 -0500)]
arm: mach-k3: Make release_resources_for_core_shutdown() common

This function is the same for each device when it needs to shutdown
the R5 core. Move this to the common section and move the remaining
device specific ID list to the device hardware include.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
18 months agoconfigs: j721s2_evm.h: Remove refrences to J7200 EVM
Andrew Davis [Thu, 6 Apr 2023 16:38:14 +0000 (11:38 -0500)]
configs: j721s2_evm.h: Remove refrences to J7200 EVM

The J7200 EVM will not include this file, this J7200 checks look
to be a copy/paste errora from j721e_evm.h, which J7200 *can* include.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
18 months agoconfigs: j721x_evm: Remove unneeded check for SYS_K3_SPL_ATF
Andrew Davis [Thu, 6 Apr 2023 16:38:13 +0000 (11:38 -0500)]
configs: j721x_evm: Remove unneeded check for SYS_K3_SPL_ATF

The TARGET_x_R5_EVM check is already enough to limit these defines to
only the correct builds. Remove the extra outer check.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>