Re: [RFC PATCH] ubifs: Call ubifs_iput when ubifs_iget is used

2024-08-06 Thread Michael Nazzareno Trimarchi
Hi Heiko On Tue, Aug 6, 2024 at 6:29 AM Heiko Schocher wrote: > > Hello Michael, > > On 05.08.24 19:31, Michael Trimarchi wrote: > > The inode should be freed after a reference is get to avoid > > memory leak > > > > Signed-off-by: Michael Trimarchi > > --- > > fs/ubifs/ubifs.c | 9 ++--- >

Re: [PATCH v2] config: Add 'update_bootimg' command to update flash.bin on Phytec's imx8mm

2024-08-06 Thread Lukasz Majewski
Hi Fabio, > Hi Lukasz, > > On Mon, Aug 5, 2024 at 5:42 AM Lukasz Majewski wrote: > > > + "update_offset=0x42\0" \ > > + "update_filename=flash.bin\0" \ > > + "hostname=/srv/tftp/\0" \ > > + "update_bootimg=" > > \ > > + "mmc dev ${mmcdev} ; " \

[PATCH v3] config: Add 'update_bootimg' command to update flash.bin on Phytec's imx8mm

2024-08-06 Thread Lukasz Majewski
This command allows easy update on SD card or eMMC of the flash.bin generated (with binman) during u-boot build. Signed-off-by: Lukasz Majewski --- Changes for v2: - Remove 'update_mmc_part' variable - Change path for hostname - Use full version of dhcp command (${loadaddr} added) Changes for v3

Re: [PATCH] cmd: bcb: Fix segfault on invalid block device

2024-08-06 Thread Mattijs Korpershoek
Hi, On Wed, 24 Jul 2024 11:51:06 +0200, Mattijs Korpershoek wrote: > When blk_get_dev() fails, block NULL and gets de-referenced in > the error path by a printf(), resulting in a crash. > > This can be reproduced on sandbox with: > > $ ./u-boot --command "bcb load mmc 0 0" > > [...] Thanks, Ap

Re: [PATCH v2] boot: android: fix booting without a ramdisk

2024-08-06 Thread Mattijs Korpershoek
Hi, On Mon, 29 Jul 2024 23:36:57 +0200, Michael Walle wrote: > android_image_get_ramdisk() will return an error if there is no ramdisk. > Using the android image without a ramdisk worked until commit > 1ce8e10f3b4b ("image: Fix up ANDROID_BOOT_IMAGE ramdisk code") because > the return code wasn't

[PATCH] cmd: sf: prevent overwriting the reserved memory

2024-08-06 Thread Prasad Kummari
Added LMB API to prevent SF command from overwriting reserved memory areas. The current SPI code does not use LMB APIs for loading data into memory addresses. To resolve this, LMB APIs were added to check the load address of an SF command and ensure it does not overwrite reserved memory addresses.

Re: [PATCH v2 1/2] spi: sunxi: fix CDR2 calculation

2024-08-06 Thread Andre Przywara
On Thu, 18 Jul 2024 22:42:52 +0200 Michael Walle wrote: Hi, > The CDR2 divider calculation always yield a frequency greater than the > requested one. Use DIV_ROUND_UP() to keep the frequency equal or below > the requested one. This way, we can also drop the "if div > 0" check > because we know f

Re: [PATCH v2 2/2] spi: sunxi: fix clock divider calculation for max frequency setting

2024-08-06 Thread Andre Przywara
On Thu, 18 Jul 2024 22:42:53 +0200 Michael Walle wrote: > If the maximum frequency is requested, we still fall into the CDR2 > handling. But there the minimal divider is 2. For the sun6i and sun8i we > can do better with the CDR1 setting where the minimal divider is 1: > SPI_CLK = MOD_CLK / 2 ^

Re: [PATCH 2/2] rockchip: Use files from dts/upstream

2024-08-06 Thread Quentin Schulz
Hi Jonas, On 7/25/24 11:46 AM, Jonas Karlman wrote: Most Rockchip aarch64 targets have now migrated to use OF_UPSTREAM, however a few of the old dtsi and dt-bindings files still remain. Remove remaining common dtsi and header files that can be included directly from dts/upstream to prevent poss

Re: [PATCH v3] config: Add 'update_bootimg' command to update flash.bin on Phytec's imx8mm

2024-08-06 Thread Fabio Estevam
Hi Lukasz, On Tue, Aug 6, 2024 at 5:11 AM Lukasz Majewski wrote: > > This command allows easy update on SD card or eMMC of the flash.bin > generated (with binman) during u-boot build. > > Signed-off-by: Lukasz Majewski > --- > Changes for v2: > - Remove 'update_mmc_part' variable > - Change path

[PATCH v2 01/39] nvmxip: Drop the message on probe

2024-08-06 Thread Simon Glass
We should not need to announce this device. Drop the message. Signed-off-by: Simon Glass --- (no changes since v1) drivers/mtd/nvmxip/nvmxip-uclass.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nvmxip/nvmxip-uclass.c b/drivers/mtd/nvmxip/nvmxip-uclass.c i

[PATCH v2 02/39] nvmxip: Avoid probing on boot

2024-08-06 Thread Simon Glass
Devices should be probed when they are used, not before. Drop this boot-time probing. Signed-off-by: Simon Glass --- (no changes since v1) drivers/mtd/nvmxip/nvmxip-uclass.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/mtd/nvmxip/nvmxip-uclass.c b/drivers/mtd/nvmxip/nvmxi

[PATCH v2 03/39] bootstd: Add UT_TESTF_CONSOLE_REC to bootflow tests

2024-08-06 Thread Simon Glass
Quite a few tests use console recording without indicating this, using the UT_TESTF_CONSOLE_REC flag. Fix this to avoid strange failures. Signed-off-by: Simon Glass --- (no changes since v1) test/boot/bootflow.c | 59 +++- 1 file changed, 31 insertions(+

[PATCH v2 04/39] test/py: Fix some pylint warnings in test_ut.py

2024-08-06 Thread Simon Glass
Tidy up most of these warnings. Remaining are four of these: R0914: Too many local variables which can only by fixed by splitting things into functions, so that is left for another time. Part of this change was done by the flynt tool. Signed-off-by: Simon Glass --- (no changes since v1)

Re: [PATCH v4 0/7] usb: gadget: atmel: Code refactor and DM_USB_GADGET support

2024-08-06 Thread Mattijs Korpershoek
Hi, On Thu, 25 Jul 2024 17:31:54 +0200, Zixun LI wrote: > Changes in v4: > - Release clocks if probe failed > - Add missing endpoint data free > - Addressed comments > > Changes in v3: > - Separate code refactor into individual commits > - Extract the controller point from udevice private data in

[PATCH v2 06/39] bootstd: Create a function to reset USB

2024-08-06 Thread Simon Glass
Set up a function for this, since it needs to be used from multiple test files. Signed-off-by: Simon Glass --- (no changes since v1) test/boot/bootdev.c| 19 ++- test/boot/bootstd_common.c | 12 test/boot/bootstd_common.h | 8 3 files changed, 26

[PATCH v2 05/39] scripts: Update pylint.base

2024-08-06 Thread Simon Glass
There have been quite a few changes in the Python scripts, so update the pylint baseline. Signed-off-by: Simon Glass --- (no changes since v1) scripts/pylint.base | 461 ++-- 1 file changed, 271 insertions(+), 190 deletions(-) diff --git a/scripts/pylin

[PATCH v2 08/39] log: Add a new log category for the console

2024-08-06 Thread Simon Glass
Add a new category which covers the console, including the stdio drivers. Signed-off-by: Simon Glass --- (no changes since v1) common/console.c | 2 ++ common/log.c | 1 + include/log.h| 2 ++ 3 files changed, 5 insertions(+) diff --git a/common/console.c b/common/console.c index 63f7

[PATCH v2 07/39] usb: Drop old non-DM code

2024-08-06 Thread Simon Glass
The driver model deadline for USB was in 2019, so drop the old USB keyboard code, to avoid needing to deal with the extra code path. Drop the unnecessary #ifdef around USB_KBD_BOOT_REPORT_SIZE while we are here. Signed-off-by: Simon Glass --- (no changes since v1) cmd/usb.c | 20 ---

[PATCH v2 09/39] usb: Add DEV_FLAGS_DM to stdio for USB keyboard

2024-08-06 Thread Simon Glass
This device contains a pointer to struct udevice so set the flag indicating that, just to be tidy. Signed-off-by: Simon Glass --- (no changes since v1) common/usb_kbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index b834b2f703d..1d

[PATCH v2 10/39] dm: usb: Deal with USB keyboard persisting across tests

2024-08-06 Thread Simon Glass
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. Signed-off-by: Simon Glass --- (no changes since v1) common/console.c | 34 +

[PATCH v2 11/39] test: mbr: Adjust test to use lower-case hex

2024-08-06 Thread Simon Glass
Switch to lower-case hex which is more commonly used in U-Boot. Signed-off-by: Simon Glass --- (no changes since v1) test/cmd/mbr.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/cmd/mbr.c b/test/cmd/mbr.c index 235b363290e..4c884af10c7 100644 --- a/test/cmd/mb

[PATCH v2 12/39] test: mbr: Adjust test to drop 0x

2024-08-06 Thread Simon Glass
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. Signed-off-by: Simon Glass --- (no changes since v1)

[PATCH v2 14/39] sandbox: Update cpu to use logging

2024-08-06 Thread Simon Glass
Use log_debug() instead of including the function name in the string. Add one more debug for PCI. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/cpu/cpu.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandb

[PATCH v2 13/39] sandbox: Change the range used for memory-mapping tags

2024-08-06 Thread Simon Glass
Sandbox keeps a table of addresses which map to pointers which are outside its emulated DRAM. The current range from 1000 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

[PATCH v2 16/39] sandbox: Add some debugging to pci_io

2024-08-06 Thread Simon Glass
Add a little debugging to this driver. Convert the existing debugging to use logging. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/lib/pci_io.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/sandbox/lib/pci_io.c b/arch/sandbox/lib/pci_io.

[PATCH v2 15/39] sandbox: Unmap old tags

2024-08-06 Thread Simon Glass
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

[PATCH v2 17/39] sandbox: Implement reference counting for address mapping

2024-08-06 Thread Simon Glass
An address may be mapped twice and unmapped twice. Delete the mapping only when the last user unmaps it. Fix a missing comment while here. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/cpu/cpu.c | 14 ++ arch/sandbox/include/asm/state.h | 3 +++ 2 fi

[PATCH v2 18/39] mmc: Use map_sysmem() with buffers in the mmc command

2024-08-06 Thread Simon Glass
The current implementation casts an address to a pointer. Make it more sandbox-friendly by using map_sysmem(). Rename the variable to 'ptr' since it is a pointer, not an address. Signed-off-by: Simon Glass --- (no changes since v1) cmd/mmc.c | 15 +-- 1 file changed, 9 insertions(

[PATCH v2 19/39] read: Use map_sysmem() with buffers in the read command

2024-08-06 Thread Simon Glass
The current implementation casts an address to a pointer. Make it more sandbox-friendly by using map_sysmem(). Rename the variable to 'ptr' since it is a pointer, not an address. Signed-off-by: Simon Glass --- (no changes since v1) cmd/read.c | 10 ++ 1 file changed, 6 insertions(+),

[PATCH v2 20/39] cmd: Fix memory-mapping in cmp command

2024-08-06 Thread Simon Glass
This unmaps a different address from what was mapped. Fix it. Signed-off-by: Simon Glass --- (no changes since v1) cmd/mem.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cmd/mem.c b/cmd/mem.c index 274348068c2..4d6fde28531 100644 --- a/cmd/me

[PATCH v2 21/39] test: mbr: Unmap the buffers after use

2024-08-06 Thread Simon Glass
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 --- (no chang

[PATCH v2 23/39] test: mbr: Use RAM for the buffers

2024-08-06 Thread Simon Glass
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. Update this test to use this approach. Signed-off-by: Simon Glass --- (no changes since v1) test/cmd/mbr.c | 12 +++- 1 file changed, 7 inserti

[PATCH v2 24/39] test: mbr: Drop a duplicate test

2024-08-06 Thread Simon Glass
The test currently runs twice as it is declared twice. Unwind this. Signed-off-by: Simon Glass --- (no changes since v1) test/cmd/mbr.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/test/cmd/mbr.c b/test/cmd/mbr.c index 81ca6f15b2a..f1fc44051df 100644 --- a/test/cmd/mbr.c +++ b/tes

[PATCH v2 22/39] test: mbr: Use a constant for the block size

2024-08-06 Thread Simon Glass
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. Signed-off-by: Simon Glass --- (no changes since v1) test/cm

[PATCH v2 26/39] efi_loader: Put back copyright message

2024-08-06 Thread Simon Glass
This was lost in a later commit, so add it back. Signed-off-by: Simon Glass Fixes: dd860b90ff4 ("efi_loader: print boot device and file path in") --- (no changes since v1) lib/efi_loader/helloworld.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/efi_loader/helloworld.c b/lib/efi_l

[PATCH v2 25/39] efi: Use puts() in cout so that console recording works

2024-08-06 Thread Simon Glass
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 Re

[PATCH v2 28/39] efi_loader: Shorten the app rules

2024-08-06 Thread Simon Glass
We have quite a few apps now, so create a way to specify them as a list rather than repeating the same rules again and again. Signed-off-by: Simon Glass --- (no changes since v1) lib/efi_loader/Makefile | 31 +-- 1 file changed, 9 insertions(+), 22 deletions(-) dif

[PATCH v2 27/39] efi_loader: Rename and move CMD_BOOTEFI_HELLO_COMPILE

2024-08-06 Thread Simon Glass
This is not actually a command so the name is confusing. Use BOOTEFI_HELLO_COMPILE instead. Put it in the efi_loader directory with the other such config options. Signed-off-by: Simon Glass --- (no changes since v1) arch/arm/lib/Makefile| 2 +- arch/riscv/lib/Makefile |

[PATCH v2 30/39] efi: Show the vendor in helloworld

2024-08-06 Thread Simon Glass
Show the vendor name so it is clear that this app has been built by U-Boot. Signed-off-by: Simon Glass --- (no changes since v1) lib/efi_loader/helloworld.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c index 586177de0c8..f1202

[PATCH v2 29/39] efi_loader: Shorten the app rules further

2024-08-06 Thread Simon Glass
Add a way to factor out the CFLAGS changes for each app, since they are all the same. Signed-off-by: Simon Glass --- (no changes since v1) lib/efi_loader/Makefile | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makef

[PATCH v2 31/39] Revert "bootdev: avoid infinite probe loop"

2024-08-06 Thread Simon Glass
This turns out to be insufficient to fix the problem, since when bootdev_next_prio() exits, the caller has no idea that this really is the end. Nor is it, since there may be other devices which should be checked. The caller iterates which calls iter_incr() which calls bootdev_next_prio() again, wh

[PATCH v2 32/39] bootstd: Make bootdev_next_prio() continue after failure

2024-08-06 Thread Simon Glass
When a device fails to probe, the next device should be tried, until either we find a suitable device or run out of devices. A device should never be tried twice. When we run out of devices of a particular priority, the hunter should be used to generate devices of the next priority. Only if all at

[PATCH v2 33/39] efi: Use the same filename for all sandbox builds

2024-08-06 Thread Simon Glass
Sandbox is not a real architecture, but within U-Boot it is real enough. We should not need to pretend it is x86 or ARM anywhere in the code. Also we want to be able to locate the sandbox app using a single filename, 'bootsbox.efi', to avoid needing tests to produce different files on each host ar

[PATCH v2 34/39] bootstd: Add debugging for efi bootmeth

2024-08-06 Thread Simon Glass
Add a little debugging so we can see what is happening. Signed-off-by: Simon Glass --- (no changes since v1) boot/bootmeth_efi.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c index 39232eb2e25..99887a89f02 100644 --- a

[PATCH v2 35/39] efi: Disable ANSI output for tests

2024-08-06 Thread Simon Glass
We don't want ANSI characters written in tests since it is a pain to check the output with ut_assert_nextline() et al. Provide a way to tests to request that ANSI characters not be sent. Add a proper function comment while we are here, to encourage others. Signed-off-by: Simon Glass --- (no ch

[PATCH v2 36/39] efi: Add a test app

2024-08-06 Thread Simon Glass
Add a simple app to use for testing. This is intended to do whatever it needs to for testing purposes. For now it just prints a message and exits boot services. Signed-off-by: Simon Glass --- (no changes since v1) lib/efi_loader/Kconfig | 10 ++ lib/efi_loader/Makefile | 1 + lib/efi_l

[PATCH v2 37/39] efi: Avoid using sandbox virtio devices

2024-08-06 Thread Simon Glass
While sandbox supports virtio it cannot support actually using the block devices to read files, since there is nothing on the other end of the 'virtqueue'. A recent change makes EFI probe all block devices, whether used or not. This is apparently required by EFI, although it violates U-Boot's lazy

[PATCH v2 38/39] test: Set up an image suitable for EFI testing

2024-08-06 Thread Simon Glass
Create a new disk for use with tests, which contains the new 'testapp' EFI app specifically intended for testing the EFI loader. Attach it to the USB device, since most testing is currently done with mmc. Initially this image will be used to test the EFI bootmeth. Fix a stale comment in prep_mmc

[PATCH v2 39/39] efi: Add a test for the efi bootmeth

2024-08-06 Thread Simon Glass
Add a simple test of booting with the EFI bootmeth, which runs the app and checks that it can call 'exit boot-services' (to check that all the device-removal code doesn't break anything) and then exit back to U-Boot. This uses a disk image containing the testapp, ready for execution by sandbox whe

Re: [PATCH 1/2] rockchip: px30/rk3326: Use soc dtsi files from dts/upstream

2024-08-06 Thread Quentin Schulz
Hi Jonas, On 7/25/24 11:46 AM, Jonas Karlman wrote: The commit f087f7fd277d ("rockchip: px30/rk3326: migrate to OF_UPSTREAM") migrated px30/rk3326 boards to use OF_UPSTREAM, however the soc dtsi and dt-bindings files remained. Remove the remaining px30/rk3326 soc dtsi and dt-bindings to ensure

Re: [PATCH v2 01/14] rockchip: Move the default timer init to a common file

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: Rather than repeating the same code in two files (SPL and TPL), move it to a shared filed. Signed-off-by: Simon Glass Reviewed-by: Dragan Simic --- (no changes since v1) arch/arm/include/asm/arch-rockchip/timer.h | 3 ++ arch/arm/mach-roc

[PATCH v2 00/39] efi: Add a test for EFI bootmeth

2024-08-06 Thread Simon Glass
The test coverage for the EFI bootmeth is incomplete since it does not actually boot the application. This series creates a simple test for this purpose. It includes a surprising number patches to make this work: - sandbox memory-mapping conflict with PCI - the fix for that causes the mbr test to

Re: [PATCH v2 03/14] spl: Remove some #ifdefs in spl_parse_image_header()

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: This function has a number of unnecessary #ifdefs so remove them. Signed-off-by: Simon Glass Reviewed-by: Sean Anderson --- (no changes since v1) common/spl/spl.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(

Re: [PATCH v2 04/14] spl: Remove remaining #ifdef in spl_parse_image_header()

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: Define spl_set_header_raw_uboot() always so we can drop the last #ifdef in this function. Signed-off-by: Simon Glass Reviewed-by: Sean Anderson --- Changes in v2: - Avoid changing comment common/spl/spl.c | 10 -- 1 file changed, 4

Re: [PATCH v2 02/14] spl: Correct use of CMD_BOOTI and CMD_BOOTZ

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: These should have a CONFIG_ prefix. Add it. Signed-off-by: Simon Glass Fixes: 7a0d88076b9 ("Add in the ability to load and boot an uncompr...") Reviewed-by: Sean Anderson --- (no changes since v1) common/spl/spl.c | 4 ++-- 1 file changed,

Re: [PATCH] usb: gadget: ether: Handle gadget driver registration in start and stop

2024-08-06 Thread Mattijs Korpershoek
Hi Zixun, Thank you for the patch. On ven., juil. 26, 2024 at 10:31, Zixun LI wrote: > Revert part of 718f1d41 to move > usb_gadget_register_driver()/usb_gadget_unregister_driver() > back to usb_eth_start()/usb_eth_stop(). > > usb_gadget_register_driver() will initialize the USB controller whi

Re: [PATCH v2 05/14] mmc: Use logging instead of printf()

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: The code makes quite a few uses of __func__ which puts the function name into the resulting SPL image. Use the log subsystem instead, to reduce size. The CONFIG_LOGF_FUNC option can be used to enable the function name. If I didn't misread the

Re: [PATCH v2 06/14] mmc: Use logging instead of pr_err()

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: Use the log subsystem instead of dev, to avoid including function names in the code. The CONFIG_LOGF_FUNC option can be used to enable the function name. Signed-off-by: Simon Glass Reviewed-by: Sean Anderson --- (no changes since v1) drive

Re: [PATCH v2 07/14] log: Avoid including function names by default

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: Unless function names are requested, the logging system should not compile these into the code. Adjust the macros to handle this. This means that turning on function names at runtime won't work unless CONFIG_LOGF_FUNC is enabled. We could perhaps

Re: [PATCH v2 08/14] spl: mmc: Drop checks for CONFIG_SPL_LIBCOMMON_SUPPORT

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: This check is not needed now, since printf() resolved to nothing if not available. Drop the #ifdefs Signed-off-by: Simon Glass Reviewed-by: Sean Anderson Reviewed-by: Quentin Schulz Thanks! Quentin

Pull request: u-boot-sunxi/master for v2024.10

2024-08-06 Thread Andre Przywara
Hi Tom, please pull the sunxi/master branch, containing some more changes for 2024.10. This updates the "old style" DTs to that of Linux v6.10, matching what OF_UPSTREAM is at now. Hopefully we won't need to do this (manually) anymore. Since this brings in the DT for a new board (Tanix TX1), also

Re: [PATCH v2 10/14] spl: mmc: Adjust args of spl_mmc_find_device()

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: At present spl_mmc_load() is the only caller of this function, passing it a boot_device, an index into the available MMC devices. Pass the device number instead, since it is known by the caller and simplifies the code. Signed-off-by: Simon Glass

Re: [PATCH v2 11/14] spl: mmc: Try to clean up raw-mode options

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: Make the raw-mode options depend on SPL_SYS_MMCSD_RAW_MODE in a more direct way. This makes it easier to understand the options with 'make menuconfig'. There are three different ways of specifying the offset: - sector offset - partition number -

Re: [PATCH v2 12/14] spl: Use unified inline functions for spl_load_info

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: Rather than declaring completely separate functions, put the code for each case into the same function. This makes it easier to read. Signed-off-by: Simon Glass Reviewed-by: Sean Anderson Reviewed-by: Quentin Schulz Thanks! Quentin

Re: [PATCH v2 14/14] blk: Correct comment for blk_get_devnum_by_uclass_idname()

2024-08-06 Thread Quentin Schulz
Hi Simon, On 7/21/24 5:25 PM, Simon Glass wrote: Update the comment to match the function. Fix the indentation while we are here. Signed-off-by: Simon Glass Reviewed-by: Sean Anderson Reviewed-by: Quentin Schulz Thanks! Quentin

Re: [PATCH v2 01/10] pinctrl: rockchip: Use syscon_regmap_lookup_by_phandle()

2024-08-06 Thread Quentin Schulz
Hi Jonas, On 8/3/24 12:56 AM, Jonas Karlman wrote: Use syscon_regmap_lookup_by_phandle() to simplify the code. Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang Reviewed-by: Quentin Schulz Thanks! Quentin

Re: [PATCH 1/3] test_fs: Allow running unprivileged

2024-08-06 Thread Mattijs Korpershoek
Hi Richard, Thank you for the patch. On ven., août 02, 2024 at 11:33, Richard Weinberger wrote: > There is no need to mount the filesystem on the host side. > All filesystem tools offer some way to fill the fs without mounting. > > So, create the content on the host side, create and fill the fs

Re: [PATCH 2/3] test_fs: Rename mount dir to scratch

2024-08-06 Thread Mattijs Korpershoek
Hi Richard, Thank you for the patch. On ven., août 02, 2024 at 11:33, Richard Weinberger wrote: > Since no mounting happens anymore, rename the "mnt" > directory to "scratch" and the related variables. > > Signed-off-by: Richard Weinberger > --- > test/py/tests/test_fs/conftest.py | 66 ++

Re: [GIT PULL] xilinx patches for v2024.07-rc3

2024-08-06 Thread Tom Rini
On Tue, Aug 06, 2024 at 08:02:37AM +0200, Michal Simek wrote: > Hi Tom, > > please pull these patches to your tree. I created tag yesterday and push it > to gitlab to see issues and rc2 has been created that's why apologize that > my tag is using rc2. There are new mini defconfigs but they can't

Re: [PATCH v2 02/10] pinctrl: rockchip: Add a pin_to_bank() helper

2024-08-06 Thread Quentin Schulz
Hi Jonas, On 8/3/24 12:56 AM, Jonas Karlman wrote: Add a pin_to_bank() helper that can locate a pin bank based on the pin offset, to be used in get_gpio_mux() and gpio_request_enable() ops. Reset ctrl->nr_pins to 0 so that pin_to_bank() can locate a bank after the second probe in U-Boot proper.

Re: [PATCH 2/3] test_fs: Rename mount dir to scratch

2024-08-06 Thread Richard Weinberger
Mattijs, Am Dienstag, 6. August 2024, 17:32:58 CEST schrieb Mattijs Korpershoek: > Hi Richard, > > Thank you for the patch. > > On ven., août 02, 2024 at 11:33, Richard Weinberger wrote: > > > Since no mounting happens anymore, rename the "mnt" > > directory to "scratch" and the related variab

Re: Pull request: u-boot-sunxi/master for v2024.10

2024-08-06 Thread Tom Rini
On Tue, Aug 06, 2024 at 03:38:23PM +0100, Andre Przywara wrote: > Hi Tom, > > please pull the sunxi/master branch, containing some more changes for > 2024.10. > This updates the "old style" DTs to that of Linux v6.10, matching what > OF_UPSTREAM is at now. Hopefully we won't need to do this (manu

Re: [PATCH v7 00/20] Introduce the lwIP network stack

2024-08-06 Thread Simon Glass
Hi Tom, On Fri, 2 Aug 2024 at 12:32, Tom Rini wrote: > > On Fri, Aug 02, 2024 at 06:26:27PM +0200, Jerome Forissier wrote: > > > This is a rework of a patch series by Maxim Uvarov: "net/lwip: add lwip > > library for the network stack" [1]. The goal is to introduce the lwIP TCP/IP > > stack [2] [

Re: [PATCH v7 00/20] Introduce the lwIP network stack

2024-08-06 Thread Tom Rini
On Tue, Aug 06, 2024 at 03:12:47PM -0600, Simon Glass wrote: > Hi Tom, > > On Fri, 2 Aug 2024 at 12:32, Tom Rini wrote: > > > > On Fri, Aug 02, 2024 at 06:26:27PM +0200, Jerome Forissier wrote: > > > > > This is a rework of a patch series by Maxim Uvarov: "net/lwip: add lwip > > > library for the

Re: [PATCH v4 1/5] x86: provide mb() macro

2024-08-06 Thread Simon Glass
On Fri, 2 Aug 2024 at 03:25, Philip Oberfichtner wrote: > > Implement a x86 memory barrier mb(). Furthermore, remove the previously > used mfence() function, which does the same thing. > > The mb() macro is now equivalent to Linux (v6.9): > linux/arch/x86/include/asm/barrier.h > > Signed-off-by: P

Re: [PATCH 1/4] x86: Fix ptrdiff_t for x86_64

2024-08-06 Thread Simon Glass
On Fri, 2 Aug 2024 at 04:08, Richard Weinberger wrote: > > sbrk() assumes ptrdiff_t is large enough to enlarge/shrink the heap > by LONG_MIN/LONG_MAX. > So, use the long type, also to match the rest of the Linux ecosystem. > > Signed-off-by: Richard Weinberger > --- > arch/x86/include/asm/posix_

Re: [PATCH] dm: core: Show device sequence instead in dm_dump_tree()

2024-08-06 Thread Simon Glass
On Fri, 2 Aug 2024 at 03:31, Zixun LI wrote: > > Currently uclass index is shown in DM tree dump which ignores alias > sequence numbering. The result could be confusing since these 2 numbers > could be different. Show device sequence number instead as it's more > meaningful. > > Also update docume

Re: [PATCH 30/40] sandbox: iommu: remove lmb allocation in the driver

2024-08-06 Thread Simon Glass
Hi Sughosh, On Fri, 2 Aug 2024 at 01:44, Sughosh Ganu wrote: > > On Mon, 29 Jul 2024 at 20:58, Simon Glass wrote: > > > > Hi Sughosh, > > > > On Mon, 29 Jul 2024 at 02:52, Sughosh Ganu wrote: > > > > > > On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > > > > > > > Hi Sughosh, > > > > > > >

Re: [PATCH 3/4] dlmalloc: Fix integer overflow in sbrk()

2024-08-06 Thread Simon Glass
On Fri, 2 Aug 2024 at 04:08, Richard Weinberger wrote: > > Make sure that the new break is within mem_malloc_start > and mem_malloc_end before making progress. > ulong new = old + increment; can overflow for extremely large > increment values and memset() can get wrongly called. > > Signed-off-by:

Re: Selecting serial device for console

2024-08-06 Thread Simon Glass
Hi Fiona, On Thu, 1 Aug 2024 at 08:07, Fiona Klute wrote: > > Hi everyone, > > how can I configure which of the available serial devices U-Boot will > use for its serial console? > > Background: I have a device based on a Raspberry Pi CM4, which has 6 > UARTs (UART1 is a mini UART, the others PL0

Re: [PATCH 1/1] Makefile: don't use CFLAGS for environment text file

2024-08-06 Thread Simon Glass
On Fri, 2 Aug 2024 at 07:50, Heinrich Schuchardt wrote: > > We use KCPPFLAGS to let the user set flags when invoking the C precompiler. > These should also be used when generating the environment text file. > > Reported-by: Dave Jones > Signed-off-by: Heinrich Schuchardt > --- > Makefile | 2 +-

Re: [PATCH 2/4] dlmalloc: Fix integer overflow in request2size()

2024-08-06 Thread Simon Glass
On Fri, 2 Aug 2024 at 04:08, Richard Weinberger wrote: > > req is of type size_t, casting it to long opens the door > for an integer overflow. > Values between LONG_MAX - (SIZE_SZ + MALLOC_ALIGN_MASK) - 1 and LONG_MAX > cause and overflow such that request2size() returns MINSIZE. > > Fix by removi

Re: [PATCH 23/40] lmb: add a flags parameter to the API's

2024-08-06 Thread Simon Glass
Hi Sughosh, On Mon, 5 Aug 2024 at 05:55, Sughosh Ganu wrote: > > On Mon, 29 Jul 2024 at 20:56, Simon Glass wrote: > > > > Hi Sughosh, > > > > On Mon, 29 Jul 2024 at 02:40, Sughosh Ganu wrote: > > > > > > On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > > > > > > > Hi Sughosh, > > > > > > >

Re: [PATCH 1/3] dm: core: fdtaddr: Avoid multiple calls to fdt_parent_offset()

2024-08-06 Thread Simon Glass
On Sun, 4 Aug 2024 at 09:06, Jonas Karlman wrote: > > Use of fdt_parent_offset() is very expensive as detailed by the function > documentation: > > NOTE: This function is expensive, as it must scan the device tree > structure from the start to nodeoffset, *twice*. > > Re-use the returned value

Re: [PATCH 1/2] bootstage: Fix unstash of records from SPL

2024-08-06 Thread Simon Glass
On Sat, 3 Aug 2024 at 08:16, Tom Rini wrote: > > On Sat, Aug 03, 2024 at 12:41:44PM +, Jonas Karlman wrote: > > > The commit b81e31a1e6c5 ("bootstash: Do not provide a default address > > for all") changed a bootstage unstash call to bootstage stash, this > > has resulted in bootstage records

Re: [PATCH 4/4] dlmalloc: Make sure allocation size is within malloc area

2024-08-06 Thread Simon Glass
Hi Richard, On Fri, 2 Aug 2024 at 04:08, Richard Weinberger wrote: > > Since U-Boot does not support memory overcommit we can > enforce that the allocation size is within the malloc area. > This is a simple and efficient hardening measure to mitigate > further integer overflows in dlmalloc. > > S

Re: [PATCH] cmd: bind: Use device sequence instead for driver bind/unbind

2024-08-06 Thread Simon Glass
On Fri, 2 Aug 2024 at 03:31, Zixun LI wrote: > > Currently uclass index is used for bind/unbind which ignores alias > sequence numbering. Use device sequence number instead as it's > the number explicitly set in the DT. > > Also update documentation to use sequence number. > > Signed-off-by: Zixun

Re: [PATCH] cmd: sf: prevent overwriting the reserved memory

2024-08-06 Thread Simon Glass
Hi Prasad, On Tue, 6 Aug 2024 at 06:08, Prasad Kummari wrote: > > Added LMB API to prevent SF command from overwriting reserved > memory areas. The current SPI code does not use LMB APIs for > loading data into memory addresses. To resolve this, LMB APIs > were added to check the load address of

Re: [PATCH 05/14] initcall: Adjust the failure message and return value

2024-08-06 Thread Simon Glass
Hi Michal, On Fri, 2 Aug 2024 at 03:21, Michal Simek wrote: > > Hi Simon, > > On 3/22/24 11:22, Michal Simek wrote: > > Hi Simon, > > > > út 22. 8. 2023 v 5:18 odesílatel Simon Glass > > napsal: > > > > Move the failure message outside the loop, so it is easier to f

Re: [PATCH] usb: gadget: udc: Fix duplicate uclass name

2024-08-06 Thread Simon Glass
On Fri, 2 Aug 2024 at 03:31, Zixun LI wrote: > > Currently both USB host uclass and USB gadget uclass are using the same > name "usb" which break uclass functions like uclass_get_by_name(). > > Rename the uclass to "usb_gadget" to fix, also makes bind/unbind by class > index (or sequence) working.

Re: [PATCH 2/2] bootstage: Do not sort records

2024-08-06 Thread Simon Glass
Hi Jonas, On Sat, 3 Aug 2024 at 06:42, Jonas Karlman wrote: > > The timer counter on Rockchip SoCs may be reset in TF-A, this may cause > the bootstage records to be printed out of order and with an incorrect > elapsed time. Eek can we just fix TF-A? That seems like a bug. > > Fix this by not s

Re: [PATCH 2/3] dm: core: ofnode: Avoid multiple calls to ofnode_get_parent()

2024-08-06 Thread Simon Glass
On Sun, 4 Aug 2024 at 09:06, Jonas Karlman wrote: > > Until a live tree is used in U-Boot proper after relocation, use of > ofnode_get_parent() will trigger a call to the very expensive > fdt_parent_offset() as detailed by the function documentation: > > NOTE: This function is expensive, as it m

Re: [PATCH v2 2/3] tools: binman: Add a property to pass a key directory to mkimage

2024-08-06 Thread Simon Glass
Hi Paul, On Mon, 5 Aug 2024 at 07:35, Paul HENRYS wrote: > > The property 'fit,keys-directory' can be added to the configuration file > passed to binman to specify a directory where keys are stored and can be > used by mkimage to sign and cipher data. Environmental things like directories are be

Re: [PATCH v7 00/20] Introduce the lwIP network stack

2024-08-06 Thread Simon Glass
Hi Tom, On Tue, 6 Aug 2024 at 15:19, Tom Rini wrote: > > On Tue, Aug 06, 2024 at 03:12:47PM -0600, Simon Glass wrote: > > Hi Tom, > > > > On Fri, 2 Aug 2024 at 12:32, Tom Rini wrote: > > > > > > On Fri, Aug 02, 2024 at 06:26:27PM +0200, Jerome Forissier wrote: > > > > > > > This is a rework of a

Re: [PATCH 3/3] dm: core: regmap: Avoid multiple calls to ofnode_get_parent()

2024-08-06 Thread Simon Glass
On Sun, 4 Aug 2024 at 09:06, Jonas Karlman wrote: > > Until a live tree is used in U-Boot proper after relocation, use of > ofnode_get_parent() will trigger a call to the very expensive > fdt_parent_offset(), as detailed by the function documentation: > > NOTE: This function is expensive, as it

Re: [PATCH v2 1/3] aes: Allow to store randomly generated IV in the FIT

2024-08-06 Thread Simon Glass
Hi Paul, On Mon, 5 Aug 2024 at 07:35, Paul HENRYS wrote: > > When the initialisation vector is randomly generated, its value shall be > stored in the FIT together with the encrypted data. The changes allow to > store the IV in the FIT also in the case where the key is not stored in > the DTB but

Re: [PATCH v2 3/3] tools: binman: Add tests for FIT with data encrypted by mkimage

2024-08-06 Thread Simon Glass
Hi Paul, On Mon, 5 Aug 2024 at 07:35, Paul HENRYS wrote: > > Test the property 'fit,keys-directory' which, when a cipher node is > present, encrypts the data stored in the FIT. > > Signed-off-by: Paul HENRYS > --- > tools/binman/ftest.py | 39 + > tools/binm

[PATCH 1/1] efi_loader: correct description of efi_get_distro_fdt_name

2024-08-06 Thread Heinrich Schuchardt
Use the correct function name. Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_fdt.c b/lib/efi_loader/efi_fdt.c index c5ecade3aeb..f882622fdad 100644 --- a/lib/efi_loader/efi_fdt.c +++ b/lib/ef

Re: [PATCH v7 00/20] Introduce the lwIP network stack

2024-08-06 Thread Jerome Forissier
On 8/6/24 23:51, Simon Glass wrote: > Hi Tom, > > On Tue, 6 Aug 2024 at 15:19, Tom Rini wrote: >> >> On Tue, Aug 06, 2024 at 03:12:47PM -0600, Simon Glass wrote: >>> Hi Tom, >>> >>> On Fri, 2 Aug 2024 at 12:32, Tom Rini wrote: On Fri, Aug 02, 2024 at 06:26:27PM +0200, Jerome Forissi

  1   2   >