Ye Li [Thu, 19 Sep 2024 04:01:27 +0000 (12:01 +0800)]
imx9: clock: Update clock init function and sequence
Since we use SPEED GRADE fuse to set A55 frequency, remove the
set_arm_core_low_drive_clk function which has hard coded frequency.
And adjust clock_init called sequence and split it to early and late
functions.
Set the authen register in early function, because CCF driver checks
NS bit.
Set bus and core clock in late function, because the fuse read and
SoC type/rev depend on ELE.
Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Ye Li [Thu, 19 Sep 2024 04:01:26 +0000 (12:01 +0800)]
imx9: soc: Add function to get target voltage mode
Replace the static CONFIG_IMX9_LOW_DRIVE_MODE with runtime target
voltage mode by checking the part's SPEED GRADE fuse.
SPL will configure to highest A55 speed which is indicated by the SPEED
fuse and select corresponding voltage mode.
Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Ye Li [Thu, 19 Sep 2024 04:01:20 +0000 (12:01 +0800)]
imx9: soc: Configure TRDC for M33 TCM access
On OSCCA part, M33 TCM is used for ROM PATCH and protected by ELE ROM.
So after release TRDC, we need to configure TRDC for M33 TCM,
otherwise A55 can't access the TCM.
Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com>
Tom Rini [Wed, 18 Sep 2024 19:07:19 +0000 (13:07 -0600)]
Merge patch series "Fix various bugs"
Simon Glass <sjg@chromium.org> says:
This series includes the patches needed to make make the EFI 'boot' test
work. That test has now been split off into a separate series along with
the EFI patches.
This series fixes these problems:
- sandbox memory-mapping conflict with PCI
- the fix for that causes the mbr test to crash as it sets up pointers
instead of addresses for its 'mmc' commands
- the mmc and read commands which cast addresses to pointers
- a tricky bug to do with USB keyboard and stdio
- a few other minor things
Simon Glass [Sun, 1 Sep 2024 22:26:32 +0000 (16:26 -0600)]
test: mbr: Use a constant for the block size
It isn't that important to factor out constants in tests, but in this
case we have 0x200 and 512 used. The commands don't use the constant
as they use a block count ('1'). It doesn't create more code to use a
constant, so create one.
Simon Glass [Sun, 1 Sep 2024 22:26:31 +0000 (16:26 -0600)]
test: mbr: Unmap the buffers after use
This tests maps some local variables into sandbox's address space. Make
sure to unmap them afterwards.
Note that the normal approach with sandbox is to use a fixed memory
address in the RAM, to avoid needing to create a map for transient local
variables.
Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 04291ee0aba ("cmd: mbr: Allow 4 MBR partitions without need...")
Simon Glass [Sun, 1 Sep 2024 22:26:25 +0000 (16:26 -0600)]
sandbox: Unmap old tags
So far unmapping has not been implemented. This means that if one test
maps a pointer to an address with map_sysmem(), then a second test can
use that same pointer, by mapping the address back to a pointer with
map_to_sysmem(). This is not really desirable, even if it doesn't
cause any problems at the moment.
Simon Glass [Sun, 1 Sep 2024 22:26:23 +0000 (16:26 -0600)]
sandbox: Change the range used for memory-mapping tags
Sandbox keeps a table of addresses which map to pointers which are
outside its emulated DRAM. The current range from 10000000 conflicts
with the PCI range, meaning that if PCI mapping is on, that particular
address can be decoded by PCI instead of the table.
Fix this by moving the range up to the top of memory. Update the docs
while we are here.
Simon Glass [Sun, 1 Sep 2024 22:26:22 +0000 (16:26 -0600)]
test: mbr: Adjust test to drop 0x
U-Boot commands typically don't need 0x to specify hex, since they use
hex by default. Adding 0x in this test is confusing since it suggests
that it is necessary. Drop it from the file.
Also use the %#x construct to get the 0x when needed.
Simon Glass [Sun, 1 Sep 2024 22:26:20 +0000 (16:26 -0600)]
dm: usb: Deal with USB keyboard persisting across tests
Clear any USB-keyboard devices before running a unit test, to avoid
using a stale udevice pointer in stdio. Add a long comment to explain
this situation and why this solution seems best, at least for now.
Tomas Paukrt [Mon, 2 Sep 2024 18:49:17 +0000 (20:49 +0200)]
cmd: mmc: Allow using partition name in mmc erase command
The mmc erase command currently requires blk# and cnt parameters
which can be obtained using the part start and part size commands
if the entire partition needs to be erased.
Simplify the use of the mmc erase command by allowing the partition
name to be specified directly.
Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Marek Vasut [Mon, 2 Sep 2024 13:37:09 +0000 (15:37 +0200)]
mmc: Hide mmc speed command under mmc command
The mmc speed command configuration option keeps showing up in
Kconfig directly in 'Command line interface'. Move MMC_SPEED_MODE_SET
under CMD_MMC to make it show up alongside the MMC command.
Tom Rini [Mon, 26 Aug 2024 17:01:40 +0000 (11:01 -0600)]
doc/develop/sending_patches.rst: Reword where our git tree is slightly
We shouldn't have had the link to our git tree be contained within "``"
as that meant that it did not work as a link, so remove those. And
rather than make this a link plus text, keep this as a link within the
text for overall clarity.
Suggested-by: Quentin Schulz <quentin.schulz@cherry.de> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Fri, 13 Sep 2024 19:44:00 +0000 (13:44 -0600)]
Merge patch series "Bump new hush commits and fix old hush test behavior"
Francis Laniel <francis.laniel@amarulasolutions.com> says:
Hi!
With this series, I bumped the new hush to get the latest commits from upstream.
Also, I added back a reverted commit which goal was to fix a bad behavior in
old hush test.
I had to tweak a bit this commit, but everything worked both locally and in the
CI.
Francis Laniel [Tue, 3 Sep 2024 17:09:43 +0000 (19:09 +0200)]
cli: modern_hush: Add upstream commits up to 13 July 2024
This commit adds the following hush busybox upstream commits: 23da5c4b716b ("hush: do not exit interactive shell on some redirection errors") 14e28c18ca1a ("hush: fix "exec 3>FILE" aborting if 3 is exactly the next free fd") 6c38d0e9da2d ("hush: avoid duplicate fcntl(F_SETFD, FD_CLOEXEC) during init") 758b21402abc ("hush: detect when terminating "done"/"fi" is missing") 2639f3bc72ac ("hush: set G.ifs sooner (prevents segfault)")
Adding specific ifdef and endif guard was needed for 2639f3bc72ac.
Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
Ion Agorria [Tue, 3 Sep 2024 17:09:42 +0000 (19:09 +0200)]
test: hush: dollar: fix bugous behavior
The dollar test was merged with bugous console behavior, and
instead of fixing it, this behavior was just workarounded.
This was done to keep compatibility with the existing behavior.
It seems like without the fix the ut_assert_skipline(); didn't clear
console and running ut_assert_skipline(); many times would give always
OK. With e58bafc35fe3 ("lib: membuff: fix readline not returning line in case of overflow")
the line is cleared correctly and next assert fails because now there
is nothing to clean which is correct if we look the this a bit above
the failing assert:
if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
/*
* For some strange reasons, the console is not empty after
* running above command.
* So, we reset it to not have side effects for other tests.
*/
console_record_reset_enable();
} else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
ut_assert_console_end();
}
Which further confirms that tests workaround the old problem and now
that problem is fixed we can remove the whole if blocks and simply
place ut_assert_console_end() right after ut_assert_skipline() without
any conditional and will pass green.
So this part of code goes from:
ut_assert_skipline();
ut_assert_skipline();
if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
/* See above comments. */
console_record_reset_enable();
} else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
ut_assert_console_end();
}
to become:
ut_assert_skipline();
if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
ut_assert_skipline();
}
ut_assert_console_end();
The if block mentioned above that calls console_record_reset_enable() is
completely removed as fixed by e58bafc35fe3.
* Use generated UUIDs in UEFI capsules:
- efi: define struct efi_guid
- lib: uuid: add UUID v5 support
- efi: add a helper to generate dynamic UUIDs
- doc: uefi: document dynamic UUID generation
- sandbox: switch to dynamic UUIDs
- lib: uuid: supporting building as part of host tools
- include: export uuid.h
- tools: mkeficapsule: use u-boot UUID library
- tools: mkeficapsule: support generating dynamic GUIDs
- test: lib/uuid: add unit tests for dynamic UUIDs
- test: lib/uuid: add tests for UUID version/variant bits
* Minor code clean-up
- shorten efi_bootmgr_release_uridp_resource()
- rename efi_bootmgr_image_return_notify
- return the correct error in efi_bootmgr_release_uridp()
- Kconfig: clean up the efi configuration status
- Use puts() in cout so that console recording works
- Put back copyright message in helloworld.c
Tom Rini [Fri, 13 Sep 2024 14:18:54 +0000 (08:18 -0600)]
Merge tag 'doc-2024-10-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request doc-2024-10-rc4
* doc/develop/sending_patches.rst: Clarify when to use which branch
* doc/arch/m68k.rst: Update toolchain comment
* doc/arch/mips.rst: Update toolchain list
* doc: Update rST to not reference the old wiki
* doc/mkeficapsule.1: Update homepage link
* bootcount: Update to point to current documentation
* binman: Update links for sending patches
Tom Rini [Mon, 26 Aug 2024 16:49:54 +0000 (10:49 -0600)]
doc: Update rST to not reference the old wiki
In two places we had references to the old wiki pages instead of links
to the relevant part of our documentation. Update (and slightly reword)
these spots.
Tom Rini [Mon, 26 Aug 2024 16:39:17 +0000 (10:39 -0600)]
doc/develop/sending_patches.rst: Clarify when to use which branch
The previous wording on the paragraph about what branch to use when
submitting patches did not reflect how / when the next branch is
currently used. Reword this to note that master should be used for bug
and regression fixes, always, and that next should be used once it
opens, with -rc2.
Reported-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Simon Glass [Mon, 2 Sep 2024 01:18:12 +0000 (19:18 -0600)]
efi_loader: Use puts() in cout so that console recording works
At present EFI output to the console uses fputs() which bypasses the
console-recording feature. This makes it impossible for tests to check
the output of an EFI app.
There doesn't seem to be any need to do this bypass, so adjust it to
simply use the puts() function.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Caleb Connolly [Fri, 30 Aug 2024 12:34:40 +0000 (13:34 +0100)]
test: lib/uuid: add unit tests for dynamic UUIDs
Add some basic unit tests to validate that the UUID generation behaves
as expected. This matches the implementation in efi_loader for sandbox
and a Qualcomm board and should catch any regressions.
Caleb Connolly [Fri, 30 Aug 2024 12:34:39 +0000 (13:34 +0100)]
tools: mkeficapsule: support generating dynamic GUIDs
Add support for generating GUIDs that match those generated internally
by U-Boot for capsule update fw_images when using dynamic UUIDs.
Dynamic UUIDs in U-Boot work by taking a namespace UUID and hashing it
with the board compatible and fw_image name. This feature just provides
a way to determine the UUIDs for a particular board without having to
actually boot U-Boot on it.
Caleb Connolly [Fri, 30 Aug 2024 12:34:35 +0000 (13:34 +0100)]
sandbox: switch to dynamic UUIDs
Migrate sandbox over to generating it's capsule update image GUIDs
dynamically from the namespace and board/image info. Update the
reference and tests to use the new GUIDs.
Caleb Connolly [Fri, 30 Aug 2024 12:34:33 +0000 (13:34 +0100)]
efi: add a helper to generate dynamic UUIDs
Introduce a new helper efi_capsule_update_info_gen_ids() which populates
the capsule update fw images image_type_id field. This allows for
determinstic UUIDs to be used that can scale to a large number of
different boards and board variants without the need to maintain a big
list.
We call this from efi_fill_image_desc_array() to populate the UUIDs
lazily on-demand.
Caleb Connolly [Fri, 30 Aug 2024 12:34:32 +0000 (13:34 +0100)]
lib: uuid: add UUID v5 support
Add support for generating version 5 UUIDs, these are determistic and work
by hashing a "namespace" UUID together with some unique data. One intended
usecase is to allow for dynamically generate payload UUIDs for UEFI
capsule updates, so that supported boards can have their own UUIDs
without needing to hardcode them.
In addition, move the common bit twiddling code from gen_ran_uuid into a
separate function and rewrite it not to use clrsetbits (which is not
available when building as part of host tools).
Ilias Apalodimas [Fri, 30 Aug 2024 11:45:27 +0000 (14:45 +0300)]
Kconfig: clean up the efi configuration status
The EFI_LOADER and EFI config options are randomly scattered under lib/
making it cumbersome to navigate and enable options, unless you really
know what you are doing. On top of that the existing options are in
random order instead of a logical one.
So let's move things around a bit and move them under boot/. Present a
generic UEFI entry where people can select Capsules, Protocols,
Services, and an option to compile U-Boot as an EFI for X86
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Ilias Apalodimas [Mon, 12 Aug 2024 20:56:38 +0000 (23:56 +0300)]
efi_loader: return the correct error in efi_bootmgr_release_uridp()
There's currently a chance for this function to overwrite an error if
one occurred and the subsequent call to
efi_uninstall_multiple_protocol_interfaces() succedded. Although this
is an EFI event and we can't do much let's at least set and return
the correct error
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
We use this event when returning from an EFI HTTP booted image.
The name is a bit confusing since it suggests we always run it,
rename it to make it clearer
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini [Thu, 12 Sep 2024 15:03:40 +0000 (09:03 -0600)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into next
CI result shows no issue:
https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/22315
----------------------------------------------------------------
- Aspeed: Add AST2700 board (Ibex RISC-V core) support
- Add timer, dram controller, network support
- Sophgo: Add clock controller support for Milk-V Duo
- Improve i.MX8M boot time by enabling MMU and D-cache very early.
- Don't drop the enable bit once set on the i.MX PWM driver.
- Enable DM_RNG so that the kaslr-seed property is set in the dt
allowing Linux KASLR.
Changing the duty-cycle should not blindly override (and clear) the
enable (EN) bit if it has already been set. For instance, a PWM
backlight can be enabled and set to a specific intensity using two
operations. The order of these operations should not matter.
Marek Vasut [Thu, 5 Sep 2024 15:35:00 +0000 (17:35 +0200)]
ARM: imx: Enable MMU and dcache very early on i.MX8M
Enable MMU and caches very early on in the boot process on i.MX8M
in U-Boot proper. This allows board_init_f to run with icache and
dcache enabled, which saves some 700 milliseconds of boot time on
i.MX8M Plus based device.
The _image_binary_end symbol was aligned to the 8-bytes boundary.
However, the SPL device tree (u-boot-spl.dtb) is concatenated right
after the binary (u-boot-spl-nodtb.bin) wihtout the consideration of
the 8-bytes alignment restriction.
After then, for the SPL_SEPARATE_BSS case, fdtdec_setup() searching
for the DTB by _image_binary_end will return the "Missing DTB" error.
As the real DTB starting point does not align to a 8-bytes address
like _image_binary_end does.
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Add support of Aspeed AST2700 SoC. AST2700 is based on ARM64 so modify
the DMA address related code to fit both ARM and ARM64. Besides, the
RMII/RGMII mode control register is moved from SCU500 to MAC50 so
initialize the register in ftgmac100_start correspondingly.
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com> Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Jacky Chou [Fri, 28 Jun 2024 09:38:50 +0000 (17:38 +0800)]
net: ftgmac100: Modify desc. size to cache line
The TX/RX descriptor size is 16 byte.
When the cache line size is larger than 16 bytes, descriptors
flushed to RAM will flush more than one descriptor.
It is possible that it may mistakenly flush to other descriptor
that has been updated by MAC in RAM.
To avoid this issue, align the descriptors to cache line size.
Only one desc will be flushed or invalidated at a time.
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com> Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Jacky Chou [Thu, 27 Jun 2024 06:26:00 +0000 (14:26 +0800)]
net: ftgmac100: Fixed the cache coherency issues of rx memory
When executing TFTP, the ARP will be replied to after receiving
the ARP. U-boot's ARP routine modifies the data in the receive
packet in response to the ARP packet and then copies it
into the transmit packet.
At this point, the received packet cache is inconsistent.
It is possible that the cache will perform a writeback action to
affect the MAC receiving packets.
Avoid the same problem that occurs in other networking protocols.
In the free_pkt function, ensure cache and memory consistency.
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com> Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Daniel Schultz [Fri, 30 Aug 2024 09:09:40 +0000 (02:09 -0700)]
configs: phycore_am62x_*_defconfig: Set PHYTEC as Manufacturer
Commit 371b379edbf3 ("configs: Make USB_GADGET_MANUFACTURER
consistent over all PHYTEC boards") made the USB_GADGET_MANUFACTURER
value consistent over all PHYTEC boards.
Update the phyCORE-AM62x defconfigs to make this config consistent
as well.
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Daniel Schultz [Fri, 30 Aug 2024 09:09:38 +0000 (02:09 -0700)]
configs: Add phycore_am62x_r5_usbdfu_defconfig
This config includes the phycore_am62x_r5_defconfig file as well as
the am62x_r5_usbdfu.config fragment. We need another defconfig
because the AM62x has not enough internal SRAM to support all boot
sources. The normal phycore_am62x_r5_defconfig should allow to boot
from MMC and OSPI while this new defconfig allows to boot from USB.
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>