aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-05-25WIP: Make lwIP defaultTEST/v2-lwipTom Rini2-1/+1
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-25WIP: Fix qemu_arm64_lwip_defconfig for buildmanTom Rini1-0/+3
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-25CI: add qemu_arm64_lwip to the test matrixJerome Forissier1-0/+7
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 <jerome.forissier@linaro.org>
2024-05-25MAINTAINERS: net-lwip: add myself as a maintainerJerome Forissier1-0/+11
Add myself as a maintainer for the lwIP network stack integration code and network commands. The library code itself (i.e., most files under lib/lwip/ except README, Makefile and integration files in u-boot) is unmodified from upstream and therefore does not need a maintainer. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-05-25test/py: net: add _lwip variants of dhcp, ping and tftpboot testsJerome Forissier1-4/+17
WHen NET_LWIP is enabled, the dhcp/ping/tftpboot commands are enabled via CMD_DHCP_LWIP, CMD_PING_LWIP and CMD_TFTPBOOT_LWIP, respectively; therefore the config annotations in the Python test scripts need to be cmd_dhcp_lwip, cmd_ping_lwip and cmd_tftpboot_lwip. The console output of the tftpboot command with lwIP is slightly different from the non-lwIP implementation. This is taken care of in test_net_tftpboot(). Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-05-25configs: add qemu_arm64_lwip_defconfigJerome Forissier1-0/+3
Add qemu_arm64_lwip_defconfig based on qemu_arm64_defconfig but with NET_LWIP instead of NET. The new file was obtained by doing: 1. make qemu_arm64_defconfig 2. make menuconfig Select NET_LWIP 3. make savedefconfig 4. diff -u defconfig configs/qemu_arm64_defconfig 5. Create configs/qemu_arm64_lwip_defconfig, use #include <> to inherit from configs/qemu_arm64_defconfig, append 'CONFIG_NET_LWIP=y' and '# CONFIG_DFU_TFTP is not set' to reflect the diff. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-05-25cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=yJerome Forissier1-2/+3
Support "bdinfo -e" when lwIP is selected. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-05-25test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=yJerome Forissier2-0/+6
Some sandbox tests make strong assumptions on how the network stack is implemented. For example, the ping tests assume that ARP resolution occurs upon sending out the ICMP packet. This is not always the case with the lwIP stack which can cache ARP information. Therefore, disable these tests when CONFIG_NET_LWIP is enabled. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-05-25net-lwip: add wget commandJerome Forissier9-119/+372
Add support for the wget command with NET_LWIP. About the small change in cmd/efidebug.c: when the wget command based on the lwIP stack is used the wget command has a built-in URL validation function since it needs to parse it anyways (in parse_url()). Therefore wget_validate_uri() doesn't exist. So, guard the call in efidebug.c with CONFIG_CMD_WGET. Based on code initially developed by Maxim U. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Co-developed-by: Maxim Uvarov <muvarov@gmail.com> Cc: Maxim Uvarov <muvarov@gmail.com>
2024-05-25net-lwip: add dns commandJerome Forissier5-0/+123
Add CONFIG_CMD_DNS_LWIP depending on CONFIG_NET_LWIP to provide the dns command using lwIP. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-05-25net-lwip: add ping commandJerome Forissier6-1/+190
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 <jerome.forissier@linaro.org>
2024-05-25net-lwip: add TFTP support and tftpboot commandJerome Forissier4-5/+223
Implement do_tftpb(). Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-05-25net-lwip: add DHCP support and dhcp commmandJerome Forissier15-7/+564
Add what it takes to enable NETDEVICES with NET_LWIP and enable DHCP as well as the dhcp command. - net-lwip/net-lwip.c is mostly empty for now. It will provide functions similar to net/net.c except based on the lwIP stack - include/net-lwip.h is a replacement for include/net.h which is unused when NET_LWIP is enabled. Declarations from the latter will be transferred to the former as needed when new network commands are ported on top of lwIP. - CMD_TFTPBOOT is selected by BOOTMETH_EFI due to this code having an implicit dependency on do_tftpb(). Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-05-25net-lwip: build lwIPJerome Forissier7-1/+301
Build the lwIP library when NET_LWIP is enabled. The following files are adaptation layers written specially for U-Boot: lib/lwip/u-boot/arch/cc.h lib/lwip/u-boot/arch/sys_arch.h (empty) lib/lwip/u-boot/limits.h (empty) lib/lwip/u-boot/lwipopts.h They were initially contributed by Maxim in a previous RFC patch series. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Co-developed-by: Maxim Uvarov <muvarov@gmail.com> Cc: Maxim Uvarov <muvarov@gmail.com>
2024-05-25Merge commit '4d3a200e672d7031fbaeb453a7f820ce3b6bd257' as 'lib/lwip/lwip'Tom Rini726-0/+221755
2024-05-25Squashed 'lib/lwip/lwip/' content from commit 0a0452b2c39bTom Rini726-0/+221755
git-subtree-dir: lib/lwip/lwip git-subtree-split: 0a0452b2c39bdd91e252aef045c115f88f6ca773
2024-05-25net: introduce alternative implementation as net-lwip/Jerome Forissier10-7/+26
Prepare the introduction of the lwIP (lightweight IP) TCP/IP stack by adding a new net-lwip/ directory and the NET_LWIP symbol. At this point, enabling NET_LWIP simply disables NET. Subsequent commits will introduce the lwIP code, re-work the NETDEVICE integration and port some of the NET commands and features to lwIP. SPL_NET cannot be enabled when NET_LWIP=y. SPL_NET pulls some symbols that are part of NET (such as arp_init(), arp_timeout_check(), arp_receive(), net_arp_wait_packet_ip()). lwIP support in SPL may be added later. Similarly, DFU_TFTP is not compatible with NET_LWIP because it depends on net_loop(), tftp_timeout_ms, tftp_timeout_count_max. Let's add a dependency on !NET_LWIP for now. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-05-24Merge patch series "FWU: Add support for FWU metadata version 2"Tom Rini21-216/+1152
Sughosh Ganu <sughosh.ganu@linaro.org> says: The following patch series adds support for version 2 of the FWU metadata. The version 2 metadata structure is defined in the latest revision of the FWU specification [1]. The earlier versions of these patches were migrating to a version 2 only support in U-Boot, similar to TF-A. However, based on feedback from ST [2], this series has been updated to support both versions. A platform would still be needed to enable one of the two versions of metadata through a config symbol. TF-A has code which reads the FWU metadata and boots the platform from the active partition. TF-A has decided to migrate the FWU code to a version 2 only support. These changes have been merged in upstream TF-A. These changes have been tested on the ST DK2 board, which uses the GPT based partitioning scheme. Both V1 and V2 metadata versions have been tested on the DK2 board. These changes need to be tested on platforms with MTD partitioned storage devices.
2024-05-24configs: fwu: re-enable FWU configsSughosh Ganu3-0/+9
Now that support for FWU metadata version 2 has been added, the feature can be enabled on platforms which had enabled it. A new config symbol for selecting the metadata version for the platform is also being added. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24MAINTAINERS: add entry for FWU multi bank update featureSughosh Ganu1-0/+8
Add an entry for the FWU Multi Bank Update feature. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24doc: fwu: make changes to reflect support for FWU metadata v2Sughosh Ganu2-7/+20
The FWU Update Agent in U-Boot supports both versions of the FWU metadata. Make changes in the documentation to reflect this. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24test: fwu: make changes to the FWU metadata access testSughosh Ganu1-6/+10
Make changes to the FWU metadata access tests corresponding to the changes in the FWU metadata access code. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24tools: mkfwumdata: add logic to append vendor data to the FWU metadataSughosh Ganu2-15/+91
The version 2 of the FWU metadata allows for appending opaque vendor specific data to the metadata structure. Add support for appending this data to the metadata. The vendor specific data needs to be provided through a file, passed through a command-line parameter. Make corresponding changes to the tool's manpage. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24tools: mkfwumdata: add support for metadata version 2Sughosh Ganu2-30/+127
Add support for generating the FWU metadata version 2. The tool now requires the version to be provided as a command-line option. Make corresponding changes to the tool's manpage. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24cmd: fwu: make changes for supporting FWU metadata version 2Sughosh Ganu1-21/+18
Add support for displaying data specific to FWU metadata version 2. Because the size of the v2 metadata structure is read from the structure itself, allocate memory for the metadata structure by first getting the size of the structure. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24fwu: mtd: obtain image information from version agnostic structureSughosh Ganu1-9/+5
Make changes to the functions used for generating the DFU's alt variable so that the FWU image information is obtained from the common version agnostic structure instead of reading the metadata. While here, also update the name of the field used for storing the image GUID in the FWU metadata. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24fwu: mtd: get MTD partition specific info from driverSughosh Ganu1-6/+11
Information about FWU images on MTD partitions is now stored with the corresponding driver instead of a global variable. Get this information from the driver. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24fwu: mtd: remove unused argument from function callSughosh Ganu1-3/+2
The third argument passed to the function gen_image_alt_info() is not used and is superfluous. Remove this unused argument from the function call. Fixes: 4898679e190 (FWU: Add FWU metadata access driver for MTD storage regions) Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24fwu: add config symbols for enabling FWU metadata versionsSughosh Ganu2-0/+16
Support has been added for version 2 of the FWU metadata structure. Add config symbols to enable either of the two versions. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24capsule: fwu: transition the platform state on a successful updateSughosh Ganu1-5/+9
Transition the platform to either Trial State or Regular State on a successful update. Do this by calling the fwu_state_machine_updates() API function. For version 1 of the FWU metadata, the transition to Trial State is done by starting the Trial State counter, while for version 2, in addition to the counter, the bank_state field of the FWU metadata is also updated to Valid. For transitioning the platform to Regular State, no action is needed with version 1 of the FWU metadata structure, while for version 2, the bank_state field is set to Accepted. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24fwu: make changes to access version agnostic structure fieldsSughosh Ganu2-67/+186
With addition of support for version 2 of the FWU metadata structure, the metadata information is collected into a version agnostic structure. Make changes to the FWU functions so that the information that was earlier obtained by reading the metadata structure is now obtained through this version agnostic structure. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24fwu: metadata: add functions for handling version specific metadata fieldsSughosh Ganu3-0/+484
Support is being added in U-Boot for version 2 of the FWU metadata. Support for this version is to co-exist with version 1 support. To achieve this, a common, version agnostic structure has been added to keep information provided by the FWU metadata structure. Add API's to handle the version specific FWU metadata fields. The version agnostic structure gets initialized at boot by reading the FWU metadata. Updates to the FWU metadata result in the API's getting called to populate the version specific fields of the strucure, before the metadata gets written to the storage media. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24fwu: metadata: add a version agnostic structureSughosh Ganu1-0/+18
The FWU specification now has two versions of the FWU metadata structure, and both are to be supported. Introduce a version agnostic structure for storing information about the FWU updatable images. This allows for a split of common version agnostic FWU code and version specific code. The version specific code is then responsible for arranging the data as per the corresponding metadata structure before it gets written to the metadata partitions. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24fwu: metadata: add support for version 2 of the structureSughosh Ganu1-6/+65
Add support for version 2 of the FWU metadata structure. The top level structure is kept separate through a config symbol. Most of the fields, primarily used for providing information on updatable images are common across the two versions. Also change a few existing structure members used for image identification to reflect the fact that these are GUIDs, and not UUIDs. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24drivers: fwu: mtd: allocate buffer for image info dynamicallySughosh Ganu2-25/+52
The FWU metadata access driver for MTD partitioned devices currently uses a statically allocated array for storing the updatable image information. This array depends on the number of banks and images per bank. With migration of the FWU metadata to version 2, these parameters are now obtained at runtime from the metadata. Make changes to the FWU metadata access driver for MTD devices to allocate memory for the image information dynamically in the driver's probe function, after having obtained the number of banks and images per bank by reading the metadata. Move the image information as part of the driver's private structure, instead of using a global variable. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24drivers: fwu: add the size parameter to the metadata access API'sSughosh Ganu4-22/+35
In version 2 of the metadata structure, the size of the structure cannot be determined statically at build time. The structure is now broken into the top level structure which contains a field indicating the total size of the structure. Add a size parameter to the metadata access API functions to indicate the number of bytes to be accessed. This is then used to either read the entire structure, or only the top level structure. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24tools: mkfwumdata: fix the size parameter to the fwrite callSughosh Ganu1-1/+1
The fwrite call returns the number of bytes transferred as part of the write only when the size parameter is 1. Pass the size parameter to the library call as 1 so that the correct number of bytes transferred are returned. Fixes: fdd56bfd3ad ("tools: Add mkfwumdata tool for FWU metadata image") Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24configs: fwu: remove FWU configs for metadata V2 supportSughosh Ganu3-7/+0
Support is to be added in the following commits for the FWU metadata version 2. Disable the FWU feature on platforms that enable it for the V2 addition work. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
2024-05-24Merge tag 'u-boot-imx-next-20240524' of ↵Tom Rini21-666/+799
https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/20834 - Allow signing i.MX8M flash.bin via binman, which is a much more elegant solution that using scripts. - Improve i.MX8M HAB documentation. - Increase PHY auto-negotiation timeout to 20s on MX8Menlo - Add bmode support for the MX53 Menlo board. - Update Update iMX8MM Menlo board configuration
2024-05-24imx: hab: add documentation about the required keys/certsClaudius Heine1-0/+17
For CST to find the certificates and keys for signing, some keys and certs need to be copied into the u-boot build directory. Signed-off-by: Claudius Heine <ch@denx.de>
2024-05-24ARM: imx: mx5: Simplify TFTP server layout on MX53 Menlo boardOlaf Mandel2-2/+2
By removing the "boot" directory in the "m53menlo/boot/fitImage" path, we simplify the TFTP server directory layout a bit. This also requires a change to the mmcload command as it (mis-)uses the same variable as the TFTP boot. Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com> Signed-off-by: Marek Vasut <marex@denx.de>
2024-05-24ARM: imx: mx5: Enable BMODE command on MX53 Menlo boardMarek Vasut1-0/+1
The board can do primary/secondary boot switching, enable the bmode command. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2024-05-24ARM: dts: imx8mm: Update iMX8MM Menlo board configurationMarek Vasut1-2/+26
Synchronize Toradex Verdin iMX8MM based MX8Menlo board configuration with Toradex Verdin iMX8MM and enable convenience commands like cat, hexdump, xxd. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2024-05-24ARM: imx: Increase PHY auto-negotiation timeout to 20s on MX8MenloMarek Vasut1-0/+3
The ethernet PHY on MX8Menlo board takes a while to come out of reset, increase the auto-negotiation timeout to prevent it from timing out in case the ethernet is used right after the board was reset. Signed-off-by: Marek Vasut <marex@denx.de>
2024-05-24ARM: imx: Add doc/imx/ to i.MX MAINTAINERS entryMarek Vasut1-0/+1
Make sure i.MX maintainers are CCed on doc/imx/ patches. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2024-05-24imx: hab: Use nxp_imx8mcst etype for i.MX8M flash.bin signingMarek Vasut4-235/+34
Update documentation and use nxp_imx8mcst binman etype for signing of flash.bin instead of previous horrible shell scripting. Reviewed-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Marek Vasut <marex@denx.de>
2024-05-24ARM: dts: imx: Wrap i.MX8M binman SPL and FIT nodes in CST node if IMX_HAB ↵Marek Vasut4-334/+424
enabled In case CONFIG_IMX_HAB is enabled, extend the binman image description for all of i.MX8M{Q,M,N,P} with CST wrapper node. This way, if CONFIG_IMX_HAB is enabled, binman will be automatically used to sign SPL and fitImage. Reviewed-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Marek Vasut <marex@denx.de>
2024-05-24ARM: dts: imx: Introduce SPL and FIT labels to i.MX8M DTs binman nodesMarek Vasut8-100/+84
Add binman_imx_spl and binman_imx_fit labels to nxp-imx8mimage {} and fit {} nodes respectively, so they can be referened in board DTs no matter how deep in the top level binman image description they are. Update current board DTs to use those labels. Reviewed-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Marek Vasut <marex@denx.de>
2024-05-24binman: Add nxp_imx8mcst etype for i.MX8M flash.bin signingMarek Vasut4-1/+215
Add new binman etype which allows signing both the SPL and fitImage sections of i.MX8M flash.bin using CST. There are multiple DT properties which govern the signing process, nxp,loader-address is the only mandatory one which sets the SPL signature start address without the imx8mimage header, this should be SPL text base. The key material can be configured using optional DT properties nxp,srk-table, nxp,csf-crt, nxp,img-crt, all of which default the key material names generated by CST tool scripts. The nxp,unlock property can be used to unlock CAAM access in SPL section. Reviewed-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Marek Vasut <marex@denx.de>
2024-05-22Merge patch series "Clean-up patch set for MbedTLS integration"WIP/22May2024-nextTom Rini21-48/+43
Raymond Mao <raymond.mao@linaro.org> says: This patch set is picked from the previously posted serie: "[RFC] Integrate MbedTLS v3.6 LTS with U-Boot" They are not directly related to MbedTLS integration, but the prerequisite for a few clean-up, refactoring and minor fixes. For V2, the linker script patch is dropped and added one patch to move the snprintf to stdio.h