[PATCH v9 20/37] net-lwip: add DHCP support and dhcp commmand

Simon Glass sjg at chromium.org
Thu Aug 29 16:05:03 CEST 2024


Hi Jerome,

On Fri, 23 Aug 2024 at 07:49, Jerome Forissier
<jerome.forissier at linaro.org> wrote:
>
> Add what it takes to enable NETDEVICES with NET_LWIP and enable DHCP as
> well as the dhcp command. 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 at linaro.org>
> ---
>  board/engicam/imx8mp/icore_mx8mp.c            |   2 +-
>  .../imx8mp_debix_model_a.c                    |   2 +-
>  board/ti/am335x/board.c                       |   3 +-
>  board/xilinx/common/board.c                   |   3 +-
>  boot/Kconfig                                  |   3 +-
>  cmd/Kconfig                                   |  91 +++---
>  cmd/Makefile                                  |   6 +-
>  cmd/elf.c                                     |   2 +-
>  cmd/net-lwip.c                                |  13 +
>  common/board_r.c                              |   4 +-
>  common/usb_kbd.c                              |   2 +-
>  drivers/net/Kconfig                           |   2 +-
>  include/net-lwip.h                            |   3 +
>  lib/tiny-printf.c                             |   3 +-
>  net/Makefile                                  |  14 +-
>  net/lwip/Makefile                             |   5 +
>  net/lwip/dhcp.c                               | 125 ++++++++
>  net/lwip/eth_internal.h                       |  35 +++
>  net/lwip/net-lwip.c                           | 286 ++++++++++++++++++
>  net/lwip/tftp.c                               |  11 +
>  20 files changed, 560 insertions(+), 55 deletions(-)
>  create mode 100644 cmd/net-lwip.c
>  create mode 100644 net/lwip/Makefile
>  create mode 100644 net/lwip/dhcp.c
>  create mode 100644 net/lwip/eth_internal.h
>  create mode 100644 net/lwip/net-lwip.c
>  create mode 100644 net/lwip/tftp.c
>
> diff --git a/board/engicam/imx8mp/icore_mx8mp.c b/board/engicam/imx8mp/icore_mx8mp.c
> index e2ed70caa43..bfdc447c478 100644
> --- a/board/engicam/imx8mp/icore_mx8mp.c
> +++ b/board/engicam/imx8mp/icore_mx8mp.c
> @@ -33,7 +33,7 @@ static void setup_fec(void)
>         setbits_le32(&gpr->gpr[1], BIT(22));
>  }
>
> -#if CONFIG_IS_ENABLED(NET)
> +#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)

How about making NET mean 'net', rather than having two options?

Perhaps the existing NET needs to be renamed to NET_INTERNAL or
something like that?

>  int board_phy_config(struct phy_device *phydev)
>  {
>         if (phydev->drv->config)
> diff --git a/board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c b/board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c
> index 112770ba493..c709d017483 100644
> --- a/board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c
> +++ b/board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c
> @@ -29,7 +29,7 @@ static void setup_fec(void)
>         setbits_le32(&gpr->gpr[1], BIT(22));
>  }
>
> -#if CONFIG_IS_ENABLED(NET)
> +#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
>  int board_phy_config(struct phy_device *phydev)
>  {

[..]

Regards,
Simon


More information about the U-Boot mailing list