summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-10-17Merge patch series "Cleanup dma device in spl and move dma channel[0]"Tom Rini
Prasanth Babu Mantena <[email protected]> says: The channel allocation and deallocation for dma copy was happening on every dma transfer. This is a overhead for transactions like NAND, which does page reads recursively for complete data. So, moving the dma allocation to probe and implement corresponding remove function and cleanup dma device while exiting from spl. Enable SPL_DM_DEVICE_REMOVE, for device removal capability in SPL. Link: https://lore.kernel.org/r/[email protected]
2024-10-17dma: ti: k3-udma: Move DMA channel[0] allocation to probe and add udma_remove()Santhosh Kumar K
Currently, the allocation of DMA channel[0] for memcpy is happening in udma_transfer() for every transfer, which leads to a huge overhead for each transfer, especially in case of nand page reads. So, move this allocation to udma_probe(), as a result, the allocation is done once during probe. Introduce udma_remove() for the cleanup of allocated channel during probe. Signed-off-by: Santhosh Kumar K <[email protected]> Signed-off-by: Prasanth Babu Mantena <[email protected]>
2024-10-17dma: ti: k3-udma: Move udma_probe() below all APIsSanthosh Kumar K
The udma_probe() function was placed above many important APIs related to bcdma, pktdma, which restricts these APIs to be accessed during probe. So, move udma_probe() below all of them. Signed-off-by: Santhosh Kumar K <[email protected]> Signed-off-by: Prasanth Babu Mantena <[email protected]>
2024-10-17configs: k3: Enable device removal in SPLPrasanth Babu Mantena
Enable CONFIG_SPL_DM_DEVICE_REMOVE in a72 and r5. Signed-off-by: Prasanth Babu Mantena <[email protected]>
2024-10-17mach-k3: common.c: Remove dma device in spl exitPrasanth Babu Mantena
While exiting from spl, remove any dma device active through spl_board_prepare_for_boot(). This is required for cleaning up any dma channels being used in spl and avoid issues with overlapping channel allocation in the next stage bootloaders. Signed-off-by: Prasanth Babu Mantena <[email protected]>
2024-10-17arm: dts: k3-j722s-binman: Add support for HS-SEUdit Kumar
J722S SOC have two variants as HS-FS and HS-SE. Add binman support for HS-SE variant. Signed-off-by: Udit Kumar <[email protected]> [[email protected]: Fix load-dm-data entry and indentation] Signed-off-by: Jayesh Choudhary <[email protected]> Reviewed-by: Bryan Brattlof <[email protected]>
2024-10-17arm: mach-k3: j784s4: Add clk and power support for wkup_uartBhavya Kapoor
Add clk and device data which can be used by wkup_uart driver to configure clocks and PSC. Signed-off-by: Bhavya Kapoor <[email protected]> Reviewed-by: Bryan Brattlof <[email protected]>
2024-10-17cmd: irq: Move do_irqinfo() prototype to a header fileAndy Shevchenko
Move do_irqinfo() prototype to a header file, otherwise compiler is not happy: arch/x86/lib/interrupts.c:130:5: warning: no previous prototype for ‘do_irqinfo’ [-Wmissing-prototypes] Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Simon Glass <[email protected]> [trini: Add 'struct cmd_tbl;' to irq_func.h] Signed-off-by: Tom Rini <[email protected]>
2024-10-17arm: mach-k3: am62: fixup thermal cooling device cpusParth Pancholi
AM62x devices now support CPU throttling based on thermal alerts with a Linux commit 10e7bfd8114c ("arm64: dts: ti: k3-am62: Enable CPU freq throttling on thermal alert"). However, this functionality does not work correctly across all variants of the AM62x SoCs which have different numbers of Cortex-A CPU cores: AM62x1 (1 core), AM62x2 (2 cores), and AM62x4 (4 cores). On single-core and dual-core AM62x devices, the following error is observed in the Linux kernel: OF: /thermal-zones/main0-thermal/cooling-maps/map0: could not find phandle 94 OF: /thermal-zones/main1-thermal/cooling-maps/map0: could not find phandle 94 This commit adds a fixup to dynamically adjust the cooling-device nodes in the thermal zones based on the actual number of CPU cores available. This resolves the issue of CPU throttling not working correctly on single-core and dual-core AM62x devices, while maintaining the functionality for AM62x quad-core devices. A similar approach is implemented for example on i.MX8MM SoC. Signed-off-by: Parth Pancholi <[email protected]>
2024-10-17lib: fdtdec: Parse the gzip/lzo headers only when dependencies have metLad Prabhakar
It might happen that CONFIG_GZIP and CONFIG_LZO are enabled but we might have CONFIG_MULTI_DTB_FIT_LZO enabled in this case in the code path of uncompress_blob() we parse the gzip headers first which results in `Error: Bad gzipped data` being printed. To avoid this parse the gzip/lzo headers only when dependencies have met. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2024-10-17Extend usage for OF_OVERLAY_LIST beyond SPLJan Kiszka
Allow to use OF_OVERLAY_LIST also for the case that the overlays just need be built, e.g. when they will be picked up by binman as artifacts of the final U-Boot image. The IOT2050 boards have such a need when switching to OF_UPSTREAM. Signed-off-by: Jan Kiszka <[email protected]> Reviewed-by: Sumit Garg <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-10-17Makefile: Drop SPL_FIT_SOURCE supportMarek Vasut
The SPL_FIT_SOURCE is long superseded by SPL_FIT_GENERATOR which is long superseded by binman, drop SPL_FIT_SOURCE support as there are no more users. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Peter Robinson <[email protected]>
2024-10-17Merge tag 'u-boot-stm32-20241017' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-stm CI: https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/22732 - stm32mp: fix boot issue with OP-TEE - stm32mp: Add script to install U-Boot from SD/eMMC to SPI NOR on DH STM32MP15xx - stm32mp: Switch to using upstream DT on DH STM32 DHSOM - stm32mp: Generate u-boot.itb using binman on DH STM32 DHSOM
2024-10-17Merge tag 'u-boot-dfu-20241017' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dfu u-boot-dfu-20241017 CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/22742 Usb Gadget: - Fix cdns3 endpoint configuration by setting maxpacket - Fix dwc3 cache handling when using DMA Fastboot: - Make AVB_VERIFY depends on FASTBOOT
2024-10-16Merge https://source.denx.de/u-boot/custodians/u-boot-usbTom Rini
2024-10-17MAINTAINERS: add TCPM sectionSebastian Reichel
Add new section for USB TypeC Port Manager (TCPM) support, which is needed to figure out cable orientation of USB-C plus and to do USB PD communication. Signed-off-by: Sebastian Reichel <[email protected]> Acked-by: Marek Vasut <[email protected]>
2024-10-17rockchip: rock5b-rk3588: Enable USB-C PD supportSebastian Reichel
Now that all code has been prepared update the default configuration to make use of it. Reviewed-by: Kever Yang <[email protected]> Tested-by: Soeren Moch <[email protected]> Tested-by: Anand Moon <[email protected]> Reviewed-by: Jonas Karlman <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2024-10-17rockchip: rk3588-rock-5b: Add USB-C controller to u-boot.dtsiSebastian Reichel
Add USB-C controller (fusb302), which will be used by U-Boot to initialize USB-PD. This is needed, because USB-PD communication must happen within 5 seconds after the USB-C connector got plugged. On my Rock 5B it often takes 5 seconds to jump to the Linux binary, so it must happen before Linux is initialized. This adds the DT node to the U-Boot specific file, since the Linux kernel DT currently does not describe it to avoid a system reset. The plan is to add it to the Linux DT with status = 'fail' and then let U-Boot mark it as status = 'okay' if it properly dealt with early USB-PD initialization. Until the Kernel DT has the node, let's add it in U-Boot to get things going. Reviewed-by: Kever Yang <[email protected]> Tested-by: Soeren Moch <[email protected]> Tested-by: Anand Moon <[email protected]> Reviewed-by: Jonas Karlman <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2024-10-17board: rock5b-rk3588: enable USB-C in operating systemSebastian Reichel
Since older U-Boot releases do not negotiate USB PD, the kernel DT may not enable the USB-C controller by default to avoid a regression. The plan is to upstream it with 'status = "fail";' instead. U-Boot should then mark it as 'status = "okay";' if it negotiated USB PD. Currently existing upstream kernel DTs do not yet have the USB-C controller at all, so we ignore any failures. Reviewed-by: Kever Yang <[email protected]> Tested-by: Soeren Moch <[email protected]> Tested-by: Anand Moon <[email protected]> Reviewed-by: Jonas Karlman <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2024-10-17usb: tcpm: fusb302: add driverSebastian Reichel
Now that the TCPM framework exists we can introduce fusb302 driver using it. This chip is a very common USB-C controller chip with PD support, which can be found in the Radxa Rock 5B among many other boards. Apart from Power Delivery, it also handles detection of the cable orientation. That can be used to control a mux for connecting the right USB3 lane pair to the USB3 controller. The driver is originally from the Linux kernel, but has been adapted to the requirements of U-Boot and its TCPM framework. Co-developed-by: Wang Jie <[email protected]> Signed-off-by: Wang Jie <[email protected]> Tested-by: Soeren Moch <[email protected]> Tested-by: Anand Moon <[email protected]> Reviewed-by: Jonas Karlman <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2024-10-17usb: tcpm: add core frameworkSebastian Reichel
This adds TCPM framework in preparation for fusb302 support, which can handle USB power delivery messages. This is needed to solve issues with devices, that are running from a USB-C port supporting USB-PD, but not having a battery. Such a device currently boots to the kernel without interacting with the power-supply at all. If there are no USB-PD message replies within 5 seconds, the power-supply assumes the peripheral is not capable of USB-PD. It usually takes more than 5 seconds for the system to reach the kernel and probe the I2C based fusb302 chip driver. Thus the system always runs into this state. The power-supply's solution to fix this error state is a hard reset, which involves removing the power from VBUS. Boards without a battery (or huge capacitors) will reset at this point resulting in a boot loop. This imports the TCPM framework from the kernel. The porting has originally been done by Rockchip using hardware timers and the Linux kernel's TCPM code from some years ago. I had a look at upgrading to the latest TCPM kernel code, but that beast became a lot more complex due to adding more USB-C features. I believe these features are not needed in U-Boot and with multiple kthreads and hrtimers being involved it is non-trivial to port them. Instead I worked on stripping down features from the Rockchip port to an even more basic level. Also the TCPM code has been reworked to avoid complete use of any timers (Rockchip used SoC specific hardware timers + IRQ to implement delayed work mechanism). Instead the delayed state changes are handled directly from the poll loop. Note, that (in contrast to the original Rockchip port) the state machine has the same hard reset quirk, that the kernel has - i.e. it avoids disabling the CC pin resistors for devices that are not self-powered. Without that quirk, the Radxa Rock 5B will not just end up doing a machine reset when a hard reset is triggered, but will not even recover, because the CPU will loose power and the FUSB302 will keep this state because of leak voltage arriving through the RX serial pin (assuming a serial adapter is connected). This also includes a 'tcpm' command, which can be used to get information about the current state and the negotiated voltage and current. Co-developed-by: Wang Jie <[email protected]> Signed-off-by: Wang Jie <[email protected]> Tested-by: Soeren Moch <[email protected]> Tested-by: Anand Moon <[email protected]> Reviewed-by: Jonas Karlman <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2024-10-16Merge patch series "some serial rx buffer patches"Tom Rini
Rasmus Villemoes <[email protected]> says: Some small improvements to the serial rx buffer feature. CI seems happy: https://github.com/u-boot/u-boot/pull/674 Link: https://lore.kernel.org/r/[email protected]
2024-10-16serial: embed the rx buffer in struct serial_dev_privRasmus Villemoes
The initialization of upriv->buf doesn't check for a NULL return. But there's actually no point in doing a separate, unconditional malloc() in post_probe; we can just make serial_dev_priv contain the rx buffer itself, and let the (larger) allocation be handled by the driver core when it allocates the ->per_device_auto. The total run-time memory used is mostly the same, we reduce the code size a little, and as a bonus, struct serial_dev_priv does not contain the unused members when !SERIAL_RX_BUFFER. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-10-16serial: add build-time sanity check of CONFIG_SERIAL_RX_BUFFER_SIZERasmus Villemoes
The help text says it must be a power of 2, and the implementation does rely on that. Enforce it. A violation gives a wall of text, but the last few lines should be reasonably obvious: drivers/serial/serial-uclass.c:334:9: note: in expansion of macro ‘BUILD_BUG_ON_NOT_POWER_OF_2’ 334 | BUILD_BUG_ON_NOT_POWER_OF_2(CONFIG_SERIAL_RX_BUFFER_SIZE); Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-10-16serial: do not overwrite not-consumed characters in rx bufferRasmus Villemoes
Before the previous patch, pasting a string of length x > CONFIG_SERIAL_RX_BUFFER_SIZE results in getting the last (x%CONFIG_SERIAL_RX_BUFFER_SIZE) characters from that string. With the previous patch, one instead gets the last CONFIG_SERIAL_RX_BUFFER_SIZE characters repeatedly until the ->rd_ptr catches up. Both behaviours are counter-intuitive, and happen because the code that checks for a character available from the hardware does not account for whether there is actually room in the software buffer to receive it. Fix that by adding such accounting. This also brings the software buffering more in line with how most hardware FIFOs behave (first received characters are kept, overflowing characters are dropped). Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-10-16serial: fix circular rx buffer edge caseRasmus Villemoes
The current implementation of the circular rx buffer falls into a common trap with circular buffers: It keeps the head/tail indices reduced modulo the buffer size. The problem with that is that it makes it impossible to distinguish "buffer full" from "buffer empty", because in both situations one has head==tail. This can easily be demonstrated: Build sandbox with RX_BUFFER enabled, set the RX_BUFFER_SIZE to 32, and try pasting the string 01234567890123456789012345678901 Nothing seems to happen, but in reality, all characters have been read and put into the buffer, but then tstc ends up believing nothing is in the buffer anyway because upriv->rd_ptr == upriv->wr_ptr. A better approach is to let the indices be free-running, and only reduce them modulo the buffer size when accessing the array. Then "empty" is head-tail==0 and "full" is head-tail==size. This does rely on the buffer size being a power-of-two and the free-running indices simply wrapping around to 0 when incremented beyond the maximal positive value. Incidentally, that change from signed to unsigned int also improves code generation quite a bit: In C, (signed int)%(signed int) is defined to have the sign of the dividend (so (-35) % 32 is -3, not 29), and hence despite the modulus being a power-of-two, x % 32 does not actually compile to the same as a simple x & 31 - on x86 with -Os, it seems that gcc ends up emitting an idiv instruction, which is quite expensive. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-10-16stm32mp: cosmetic: remove empty comment block in configs filePatrick Delaunay
This is cosmetic change. Remove the empty comment blocks remaining after conversion to Kconfig of CONFIG_SYS_MAX_NAND_DEVICE and CONFIG_SERVERIP. Signed-off-by: Patrick Delaunay <[email protected]>
2024-10-16ARM: stm32: Add script to install U-Boot from SD/eMMC to SPI NOR on DH ↵Marek Vasut
STM32MP15xx DHSOM Make the dh_update_sd_to_sf script generic, rename it to dh_update_block_to_sf and implement two specific dh_update_sd_to_sf and dh_update_emmc_to_sf scripts which load U-Boot from either SD or eMMC and install it into SPI NOR. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2024-10-16stm32mp: fix name of optee reserved memory nodePatrick Delaunay
In OP-TEE, the "optee_core@" node is reserved, appended in non secure device tree (see mark_tzdram_as_reserved() function under CFG_DT) so this name must be checked in optee_get_reserved_memory(). We keep the check on /reserved-memory/optee@ node to have backward compatibility with STMT32Image booting, when the reserved node is already present in U-Boot or SPL device tree with name "optee@". This patch solves a boot issue on board with OP-TEE for U-Boot compiled with stm32mp15_defconfig and without secure configuration device tree (stm32mp157c-dk2.dts for example). Fixes: 5fe9e0deabb1 ("stm32mp: allow calling optee_get_reserved_memory() from U-Boot") Signed-off-by: Patrick Delaunay <[email protected]>
2024-10-16doc: clarify scmi device tree for stm32mp15 boardsPatrick Delaunay
Clarify the usage of SCMI specific device tree to use with stm32mp15_defconfig and with OP-TEE. Signed-off-by: Patrick Delaunay <[email protected]>
2024-10-16ARM: stm32mp: enable data cache after LMB configuration for STM32MP1Patrick Delaunay
Move the stm32mp1 data cache reconfiguration after the lmb init call board_r::initr_lmb to allow parsing of the reserved region with no-map tag. After this patch the DDR is not fully mapped up to arch_early_init_r() call, only the relocation region is mapped, but it is enough for the first board_r initialization phases; later, when arch_early_init_r() is called, the LMB is already initialized and the function lmb_is_reserved_flags() function is functional, this LMB function is called in the weak function dram_bank_mmu_setup() when dcache_enable() is executed. Without this change, as LMB is not initialized when it is used in dram_bank_mmu_setup, the OP-TEE region is mapped cache-able by U-Boot and we have some firewall violation since "LMB memory map global and persistent" series. Fixes: ed17a33fed29 ("lmb: make LMB memory map persistent and global") Signed-off-by: Patrick Delaunay <[email protected]>
2024-10-16stm32mp: compute ram_top based on the optee base address only for STM32MP1Patrick Delaunay
Reserved memory for OP-TEE is located at end of DDR for STM32MP1 SoC only (STM32MP13 and STM32MP15) and the OP-TEE reserved memory is located at the beginning of DDR for STM32MP25 SoC, before CONFIG_TEXT_BASE and with reserved memory for companion coprocessor. So the ram_top is limited by OP-TEE reserved memory only for STM32MP1 SoC. This patch solves an issue for ram_top value on STM32MP25 SoC because the generic reserved memory management, based on LMB, is no more used before relocation. Fixes: 8242f14a3e6f ("stm32mp: compute ram_top based on the optee base address") Signed-off-by: Patrick Delaunay <[email protected]>
2024-10-16ARM: dts: stm32: Generate u-boot.itb using binman on DH STM32 DHSOMMarek Vasut
Describe the u-boot.its generation in stm32mp15xx-dhsom-u-boot.dtsi binman {} DT node as a replacement for current CONFIG_SPL_FIT_SOURCE use, dispose of both u-boot-dhcom.its and u-boot-dhcor.its. Use fdt-SEQ/config-SEQ to generate a list of fdt-N fitImage images {} and matching configuration {} node entries. The configuration node entry names no longer encode _somrevN_boardrevN suffix, which was never really used, so drop this functionality by default. Rework board_fit_config_name_match() to match on the new configuration node entry names. Users who do need the match on _somrevN_boardrevN can either replace the fdt-SEQ/config-SEQ with fixed fdt-N/config-N nodes which each encode the matching 'description = "NAME_somrevN_boardrevN"' to restore the old behavior verbatim, or better use SPL DT overlays for U-Boot control DT the same way e.g. i.MX8MP DHCOM does to support multiple SoM and board variants. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2024-10-16ARM: dts: stm32: Switch to using upstream DT on DH STM32 DHSOMMarek Vasut
Enable OF_UPSTREAM to use upstream DT and add st/ prefix to the DEFAULT_DEVICE_TREE. And thereby directly build DTB from dts/upstream/src/ including *-u-boot.dtsi from arch/$(ARCH)/dts/ directory. The previous setup used generic SoC prefix like stm32mp15xx-dhco* for generic DTs which could be used on any STM32MP15xx DHSOM variant. The new setup uses specific SoC prefix stm32mp157c-dhco* to match Linux DT names. Since the hardware present on STM32MP153 and STM32MP157 is not enabled in the board configuration and not supported by U-Boot except for the DSI host, using the existing Linux DTs poses no issue even on plain STM32MP151A based SoMs. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2024-10-16ARM: dts: stm32: Duplicate cpu0-opp-table node into stm32mp15-u-boot.dtsiMarek Vasut
The cpu0-opp-table {} node does not exist in upstream Linux stm32mp151.dtsi file, in order to enable conversion to OF_UPSTREAM, duplicate the node from current U-Boot stm32mp151.dtsi into stm32mp15-u-boot.dtsi. This makes STM32 DTs buildable even with OF_UPSTREAM enabled. No functional change, since the current U-Boot stm32mp151.dtsi already contains the cpu0-opp-table {} node, stm32mp15-u-boot.dtsi is applied at the end, and does not bring in any new content. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2024-10-16ARM: stm32: Update MAINTAINERS file globs for STM32MP DHSOMMarek Vasut
Update the MAINTAINERS file glob to cover all of STM32MP DHSOM related files. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2024-10-16Merge patch series "Introduce the lwIP network stack"Tom Rini
Jerome Forissier <[email protected]> says: 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] [3] as an alternative to the current implementation in net/, selectable with Kconfig, and ultimately keep only lwIP if possible. Some reasons for doing so are: - Make the support of HTTPS in the wget command easier. Javier T. and Raymond M. (CC'd) have some additional lwIP and Mbed TLS patches to do so. With that it becomes possible to fetch and launch a distro installer such as Debian etc. using a secure, authenticated connection directly from the U-Boot shell. Several use cases: * Authentication: prevent MITM attack (third party replacing the binary with a different one) * Confidentiality: prevent third parties from grabbing a copy of the image as it is being downloaded * Allow connection to servers that do not support plain HTTP anymore (this is becoming more and more common on the Internet these days) - Possibly benefit from additional features implemented in lwIP - Less code to maintain in U-Boot Prior to applying this series, the lwIP stack needs to be added as a Git subtree with the following command: $ git subtree add --squash --prefix lib/lwip/lwip \ https://github.com/lwip-tcpip/lwip.git STABLE-2_2_0_RELEASE Notes 1. A number of features are currently incompatible with NET_LWIP: DFU_TFTP, FASTBOOT, SPL_NET, ETH_SANDBOX, ETH_SANDBOX_RAW, DM_ETH. They all make assumptions on how the network stack is implemented and/or pull sybols that are not trivially exported from lwIP. Some interface rework may be needed. 2. Due to the above, and in order to provide some level of testing of the lwIP code in CI even when the legacy NET is the default, a new QEMU configuration is introduced (qemu_arm64_lwip_defconfig) which is based on qemu_arm64_defconfig with NET_LWIP and CMD_*_LWIP enabled. In addition to that, this series has some [TESTING] patches which make NET_LWIP the default. [1] https://lore.kernel.org/all/[email protected]/ [2] https://www.nongnu.org/lwip/ [3] https://en.wikipedia.org/wiki/LwIP Link: https://lore.kernel.org/r/[email protected]
2024-10-16MAINTAINERS: net: lwip: add myself as a maintainerJerome Forissier
Add myself as a maintainer for the lwIP network stack integration code and network commands as well as the sandbox ethernet driver for lwIP. Signed-off-by: Jerome Forissier <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2024-10-16CI: add qemu_arm64_lwip to the test matrixJerome Forissier
Build and run qemu_arm64_lwip_defconfig in CI. This tests the lightweight IP (lwIP) implementation of the dhcp, tftpboot and ping commands. Signed-off-by: Jerome Forissier <[email protected]>
2024-10-16net: lwip: add TFTP_BLOCKSIZEJerome Forissier
Add support for setting the TFTP block size. The default value (1468) is fine for Ethernet and allows a better throughput than the TFTP default (512), if the server supports the blksize option of course. I tested this change with qemu_arm64_lwip_defconfig. The throughput is now 875 KiB/s vs. 313 KiB/s before. That is still a low number, but I think we can't expect more without implementing the windowsize option. Signed-off-by: Jerome Forissier <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2024-10-16net: lwip: tftp: add support of blksize option to clientJerome Forissier
The TFTP protocol uses a default block size of 512 bytes. This value is sub-optimal for ethernet devices, which have a MTU (Maximum Transmission Unit) of 1500 bytes. When taking into acount the overhead of the IP and UDP layers, this leaves 1468 bytes for the TFTP payload. This patch introduces a new function: tftp_client_set_blksize() which may be used to change the block size from the default. It has to be called after tftp_client_init() and before tftp_get(). If the server does not support the option, the client will still accept to receive 512-byte blocks. Submitted upstream: https://savannah.nongnu.org/patch/index.php?10462 Signed-off-by: Jerome Forissier <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2024-10-16configs: add qemu_arm64_lwip_defconfigJerome Forissier
Add qemu_arm64_lwip_defconfig which #include's qemu_arm64_defconfig and selects NET_LWIP instead of NET. This config has all the supported net commands enabled. Signed-off-by: Jerome Forissier <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2024-10-16test: boot: fix bootflow_cmd_label for when DSA_SANDBOX is disabledJerome Forissier
When DSA_SANDBOX is not set, the sandbox tests fail as follows: $ ./test/py/test.py --build-dir=$(pwd) -k bootdev_test_any [...] Scanning for bootflows with label '9' [...] Cannot find '9' (err=-19) This is due to the device list containing two less entries than expected. Therefore, look for label '7' when DSA_SANDBOX is disabled. The actual use case is NET_LWIP=y (to be introduced in later patches) which implies DSA_SANDBOX=n for the time being. Signed-off-by: Jerome Forissier <[email protected]>
2024-10-16cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=yJerome Forissier
Support "bdinfo -e" when lwIP is selected. Signed-off-by: Jerome Forissier <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2024-10-16test: boot: fix bootdev_test_any for when DSA_SANDBOX is disabledJerome Forissier
When DSA_SANDBOX is not set, the sandbox tests fail as follows: $ ./test/py/test.py --build-dir=$(pwd) -k bootdev_test_any [...] Test: bootdev_test_any: bootdev.c test/boot/bootdev.c:156, bootdev_test_any(): "mmc2" = media->name: Expected "mmc2", got "mmc0" [...] This is due to the device list containing two less entries than expected. Therefore, adjust the expected index to be two less when DSA_SANDBOX is disabled. The actual use case is NET_LWIP=y (to be introduced in later patches) which implies DSA_SANDBOX=n for the time being. Signed-off-by: Jerome Forissier <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-10-16net: lwip: add wget commandJerome Forissier
Add support for the wget command with NET_LWIP. The command normally expects a URL: wget [loadaddr] url, but it also accepts the legacy syntax: wget [loadaddr] [server:]file. The server IP may alternatively be supplied via ${httpserverip} which has higher priority than ${serverip}. Based on code initially developed by Maxim U. Signed-off-by: Jerome Forissier <[email protected]> Co-developed-by: Maxim Uvarov <[email protected]> Cc: Maxim Uvarov <[email protected]> Signed-off-by: Jerome Forissier <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2024-10-16sandbox: add dummy driver ETH_SANDBOX_LWIPJerome Forissier
Introduce ETH_SANDBOX_LWIP which enables a mock driver similar to ETH_SANDOX but without the dependencies on the legacy network stack (NET) so that it may be enabled when the lwIP stack (NET_LWIP) is introduced. The driver does nothing at this stage but its presence will allow dm_test_iommu_noiommu [1] to pass. [1] ./u-boot -T -c "ut dm dm_test_iommu_noiommu" Signed-off-by: Jerome Forissier <[email protected]> Acked-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-10-16net: split cmd/net.c into cmd/net.c and cmd/net-common.cJerome Forissier
Extract some code from cmd/net.c that will be useful in a subsequent commit to implement wget with NET_LWIP. Signed-off-by: Jerome Forissier <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2024-10-16net: lwip: add dns commandJerome Forissier
Add CMD_DNS when NET_LWIP is enabled to provide the dns command using lwIP. Signed-off-by: Jerome Forissier <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2024-10-16net: lwip: add ping commandJerome Forissier
Add support for the the ping command with NET_LWIP. The implementation is derived from lwIP's contrib/apps/ping/ping.c. Signed-off-by: Jerome Forissier <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>