From: Michael Walle <mwalle@kernel.org>
To: Mattijs Korpershoek <mkorpershoek@baylibre.com>,
Tom Rini <trini@konsulko.com>,
Jerome Forissier <jerome.forissier@linaro.org>
Cc: u-boot@lists.denx.de, Michael Walle <mwalle@kernel.org>
Subject: [PATCH 1/3] fastboot: lift restrictions on !NET_LWIP for USB
Date: Wed, 12 Mar 2025 08:36:55 +0100 [thread overview]
Message-ID: <20250312073655.2281377-1-mwalle@kernel.org> (raw)
Fastboot works either over TCP, UDP or USB. The latter doesn't have
anything to do with networking, thus should work just fine with
regardless which network stack is selected. In practice, header symbols
are used inside common code paths. Add some ifdeffery to guard against
that.
This will make fastboot over USB work with the new LWIP stack.
Signed-off-by: Michael Walle <mwalle@kernel.org>
---
Alternatively, we could add the defines and stub functions to the lwip
header.
---
cmd/fastboot.c | 4 ++++
drivers/fastboot/Kconfig | 1 -
drivers/fastboot/fb_common.c | 4 ++++
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/cmd/fastboot.c b/cmd/fastboot.c
index d4cfc0c7a28..be84a482b81 100644
--- a/cmd/fastboot.c
+++ b/cmd/fastboot.c
@@ -16,6 +16,7 @@
#include <linux/printk.h>
#include <linux/stringify.h>
+#if CONFIG_IS_ENABLED(NET)
static int do_fastboot_udp(int argc, char *const argv[],
uintptr_t buf_addr, size_t buf_size)
{
@@ -55,6 +56,7 @@ static int do_fastboot_tcp(int argc, char *const argv[],
return CMD_RET_SUCCESS;
}
+#endif
static int do_fastboot_usb(int argc, char *const argv[],
uintptr_t buf_addr, size_t buf_size)
@@ -160,10 +162,12 @@ NXTARG:
fastboot_init((void *)buf_addr, buf_size);
+#if CONFIG_IS_ENABLED(NET)
if (!strcmp(argv[1], "udp"))
return do_fastboot_udp(argc, argv, buf_addr, buf_size);
if (!strcmp(argv[1], "tcp"))
return do_fastboot_tcp(argc, argv, buf_addr, buf_size);
+#endif
if (!strcmp(argv[1], "usb")) {
argv++;
argc--;
diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig
index 1eb460f5a02..70207573de2 100644
--- a/drivers/fastboot/Kconfig
+++ b/drivers/fastboot/Kconfig
@@ -1,6 +1,5 @@
menu "Fastboot support"
depends on CMDLINE
- depends on !NET_LWIP
config FASTBOOT
bool
diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c
index 12ffb463deb..68f92c4b887 100644
--- a/drivers/fastboot/fb_common.c
+++ b/drivers/fastboot/fb_common.c
@@ -183,11 +183,15 @@ void fastboot_handle_boot(int command, bool success)
switch (command) {
case FASTBOOT_COMMAND_BOOT:
fastboot_boot();
+#if CONFIG_IS_ENABLED(NET)
net_set_state(NETLOOP_SUCCESS);
+#endif
break;
case FASTBOOT_COMMAND_CONTINUE:
+#if CONFIG_IS_ENABLED(NET)
net_set_state(NETLOOP_SUCCESS);
+#endif
break;
case FASTBOOT_COMMAND_REBOOT:
--
2.39.5
next reply other threads:[~2025-03-12 7:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 7:36 Michael Walle [this message]
2025-03-12 7:41 ` [PATCH 1/3] fastboot: lift restrictions on !NET_LWIP for USB Michael Walle
2025-03-12 8:25 ` Jerome Forissier
2025-03-20 9:25 ` Mattijs Korpershoek
2025-03-28 9:06 ` Michael Walle
2025-03-28 15:59 ` Tom Rini
2025-03-28 17:07 ` Mattijs Korpershoek
2025-04-10 8:46 ` Mattijs Korpershoek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250312073655.2281377-1-mwalle@kernel.org \
--to=mwalle@kernel.org \
--cc=jerome.forissier@linaro.org \
--cc=mkorpershoek@baylibre.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox