All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/22] Deal with exfat versus byteorder
@ 2025-05-01  1:04 Simon Glass
  2025-05-01  1:04 ` [PATCH v2 01/22] net: Use a forward declaration for cmd_tbl in net-common.h Simon Glass
                   ` (22 more replies)
  0 siblings, 23 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Adrian Alonso,
	Adriano Cordova, Daniel Palmer, Daniel Schultz, Emanuele Ghidoli,
	Fabio Estevam, Francesco Dolcini, Hanyuan Zhao,
	Heinrich Schuchardt, Ilko Iliev, Jason Liu, Joe Hershberger,
	Lukasz Majewski, Marek Vasut, Maxim Moskalets,
	NXP i.MX U-Boot Team, Oliver Graute, Otavio Salvador,
	Paweł Anikiel, Peng Fan, Phil Sutter, Ramon Fried,
	Stefan Roese, Stefano Babic, Stephen Warren, Stephen Warren,
	Sughosh Ganu, Svyatoslav Ryhel, Thierry Reding, Tim Harvey,
	Tom Warren, Tony Dinh, Viacheslav Bocharov, u-boot-amlogic

Since exfat has its own byteorder functions we need to be careful about
including the normal U-Boot byteorder headers in code included by exfat.

One chain for include/linux/byteorder/little_endian.h is like this:

In file included from arch/sandbox/include/asm/byteorder.h:19,
                 from arch/sandbox/include/asm/byteorder.h:19,
                 from include/compiler.h:132,
                 from include/env.h:12,
                 from include/command.h:13,
                 from include/net-common.h:7,
                 from include/net.h:6,
                 from include/efi.h:23,
                 from include/blk.h:12,
                 from include/part.h:9,
                 from include/fs_internal.h:11,
                 from fs/exfat/io.c:52:

This series tidies things up so that efi.h can include net.h as
required.

Changes in v2:
- Add patches for other files exposed by this change

Simon Glass (22):
  net: Use a forward declaration for cmd_tbl in net-common.h
  congatec: Include env.h to permit reading the environment
  dhelectronics: Include env.h to permit reading the environment
  imx8ulp_evk: Include env.h to permit reading the environment
  venice: Include env.h to permit reading the environment
  phytec: Include env.h to permit reading the environment
  ronetix: Include env.h to permit reading the environment
  toradex: Include env.h to permit reading the environment
  advantech: Include env.h in imx8qm_dmsse20_a1
  tegra: Include env.h to permit reading the environment
  synology: Include env.h to permit reading the environment
  amlogic: Include env.h to permit reading the environment
  freescale: Include env.h to permit reading the environment
  google: Include env.h to permit reading the environment
  liebherr: Include env.h to permit reading the environment
  technexion: Include env.h to permit reading the environment
  elf: Only use network environment-variables if net enabled
  net: Include byteorder in net6.h
  net: Include string.h in net-legacy.h
  net: Include env.h in pcap.c
  net: dc2114x: Include env.h to permit reading the environment
  net: Move env_get_ip() out of the header file

 arch/arm/mach-tegra/dt-setup.c                |  1 +
 board/Synology/ds414/ds414.c                  |  1 +
 .../imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c     |  1 +
 board/amlogic/jethub-j100/jethub-j100.c       |  1 +
 board/congatec/cgtqmx8/cgtqmx8.c              |  3 +-
 board/dhelectronics/common/dh_common.c        |  1 +
 board/freescale/imx8ulp_evk/imx8ulp_evk.c     |  1 +
 board/freescale/mx7dsabresd/mx7dsabresd.c     |  1 +
 board/gateworks/venice/venice.c               |  1 +
 board/google/chameleonv3/board.c              |  2 +
 board/liebherr/xea/xea.c                      |  1 +
 .../common/phytec_som_detection_blocks.c      |  1 +
 board/ronetix/imx8mq-cm/imx8mq_cm.c           |  1 +
 board/technexion/pico-imx7d/pico-imx7d.c      |  1 +
 board/toradex/colibri_imx7/colibri_imx7.c     |  1 +
 board/toradex/verdin-imx8mm/verdin-imx8mm.c   |  2 +-
 cmd/elf.c                                     | 41 ++++++++++---------
 drivers/net/dc2114x.c                         |  1 +
 include/net-common.h                          |  9 ++--
 include/net-legacy.h                          |  1 +
 include/net6.h                                |  1 +
 net/net-common.c                              |  6 +++
 net/pcap.c                                    |  1 +
 23 files changed, 53 insertions(+), 27 deletions(-)

-- 
2.43.0

base-commit: b5d6220dd2f4612912989f3c2b5a710f2248cb36
branch: fix-net2


^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH v2 01/22] net: Use a forward declaration for cmd_tbl in net-common.h
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 02/22] congatec: Include env.h to permit reading the environment Simon Glass
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Adriano Cordova,
	Heinrich Schuchardt, Joe Hershberger, Marek Vasut

We don't need to include command.h just for this declaration. It
eventually pulls in linux/byteorder which causes a conflict with exfat
which has its own byteorder functions.

Use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
---

(no changes since v1)

 include/net-common.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/net-common.h b/include/net-common.h
index 12c50e2a41e..f2613a41ad8 100644
--- a/include/net-common.h
+++ b/include/net-common.h
@@ -4,7 +4,6 @@
 #define __NET_COMMON_H__
 
 #include <asm/cache.h>
-#include <command.h>
 #include <env.h>
 #include <hexdump.h>
 #include <linux/if_ether.h>
@@ -13,6 +12,8 @@
 #include <rand.h>
 #include <time.h>
 
+struct cmd_tbl;
+
 #define DEBUG_NET_PKT_TRACE 0	/* Trace all packet data */
 
 /*
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
  2025-05-01  1:04 ` [PATCH v2 01/22] net: Use a forward declaration for cmd_tbl in net-common.h Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01 14:06   ` Tom Rini
  2025-05-01  1:04 ` [PATCH v2 03/22] dhelectronics: " Simon Glass
                   ` (20 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Marek Vasut,
	Oliver Graute

This file reads from the environment but does not include the correct
header. Update it.

Drop the unnecessary config.h while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/congatec/cgtqmx8/cgtqmx8.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/board/congatec/cgtqmx8/cgtqmx8.c b/board/congatec/cgtqmx8/cgtqmx8.c
index 054e4e10867..087ca007776 100644
--- a/board/congatec/cgtqmx8/cgtqmx8.c
+++ b/board/congatec/cgtqmx8/cgtqmx8.c
@@ -3,7 +3,8 @@
  * Copyright 2018 congatec AG
  * Copyright (C) 2019 Oliver Graute <oliver.graute@kococonnector.com>
  */
-#include <config.h>
+
+#include <env.h>
 #include <errno.h>
 #include <linux/libfdt.h>
 #include <fsl_esdhc.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 03/22] dhelectronics: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
  2025-05-01  1:04 ` [PATCH v2 01/22] net: Use a forward declaration for cmd_tbl in net-common.h Simon Glass
  2025-05-01  1:04 ` [PATCH v2 02/22] congatec: Include env.h to permit reading the environment Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 04/22] imx8ulp_evk: " Simon Glass
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Tom Rini, Jerome Forissier, Simon Glass

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/dhelectronics/common/dh_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/dhelectronics/common/dh_common.c b/board/dhelectronics/common/dh_common.c
index 32c50b4f0f5..24fe6ff50b4 100644
--- a/board/dhelectronics/common/dh_common.c
+++ b/board/dhelectronics/common/dh_common.c
@@ -5,6 +5,7 @@
  */
 
 #include <dm.h>
+#include <env.h>
 #include <i2c_eeprom.h>
 #include <net.h>
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 04/22] imx8ulp_evk: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (2 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 03/22] dhelectronics: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 05/22] venice: " Simon Glass
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Fabio Estevam, Jason Liu,
	NXP i.MX U-Boot Team, Peng Fan, Stefano Babic

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/freescale/imx8ulp_evk/imx8ulp_evk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/freescale/imx8ulp_evk/imx8ulp_evk.c b/board/freescale/imx8ulp_evk/imx8ulp_evk.c
index 0af61067263..4bf77a488cc 100644
--- a/board/freescale/imx8ulp_evk/imx8ulp_evk.c
+++ b/board/freescale/imx8ulp_evk/imx8ulp_evk.c
@@ -3,6 +3,7 @@
  * Copyright 2020 NXP
  */
 
+#include <env.h>
 #include <miiphy.h>
 #include <netdev.h>
 #include <asm/arch/imx8ulp-pins.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 05/22] venice: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (3 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 04/22] imx8ulp_evk: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 06/22] phytec: " Simon Glass
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Tom Rini, Jerome Forissier, Simon Glass, Tim Harvey

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/gateworks/venice/venice.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/gateworks/venice/venice.c b/board/gateworks/venice/venice.c
index 98b33624f04..f9bcdd8496e 100644
--- a/board/gateworks/venice/venice.c
+++ b/board/gateworks/venice/venice.c
@@ -3,6 +3,7 @@
  * Copyright 2021 Gateworks Corporation
  */
 
+#include <env.h>
 #include <fdt_support.h>
 #include <init.h>
 #include <led.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 06/22] phytec: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (4 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 05/22] venice: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 07/22] ronetix: " Simon Glass
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Daniel Schultz

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/phytec/common/phytec_som_detection_blocks.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/phytec/common/phytec_som_detection_blocks.c b/board/phytec/common/phytec_som_detection_blocks.c
index 5f3c27ef0c2..b44ff85972f 100644
--- a/board/phytec/common/phytec_som_detection_blocks.c
+++ b/board/phytec/common/phytec_som_detection_blocks.c
@@ -4,6 +4,7 @@
  * Author: Daniel Schultz <d.schultz@phytec.de>
  */
 
+#include <env.h>
 #include <malloc.h>
 #include <u-boot/crc.h>
 #include <net.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 07/22] ronetix: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (5 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 06/22] phytec: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 08/22] toradex: " Simon Glass
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Tom Rini, Jerome Forissier, Simon Glass, Ilko Iliev

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/ronetix/imx8mq-cm/imx8mq_cm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/ronetix/imx8mq-cm/imx8mq_cm.c b/board/ronetix/imx8mq-cm/imx8mq_cm.c
index fbee2c39771..602216854ba 100644
--- a/board/ronetix/imx8mq-cm/imx8mq_cm.c
+++ b/board/ronetix/imx8mq-cm/imx8mq_cm.c
@@ -3,6 +3,7 @@
  * Copyright 2018 NXP
  */
 
+#include <env.h>
 #include <miiphy.h>
 #include <asm-generic/gpio.h>
 #include <asm/arch/imx8mq_pins.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 08/22] toradex: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (6 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 07/22] ronetix: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 09/22] advantech: Include env.h in imx8qm_dmsse20_a1 Simon Glass
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Emanuele Ghidoli,
	Francesco Dolcini, Marek Vasut

Two files read from the environment but don't not include the correct
header. Update them.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/toradex/colibri_imx7/colibri_imx7.c   | 1 +
 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c
index 7de29e3abfb..69a8a18d3a7 100644
--- a/board/toradex/colibri_imx7/colibri_imx7.c
+++ b/board/toradex/colibri_imx7/colibri_imx7.c
@@ -4,6 +4,7 @@
  */
 
 #include <cpu_func.h>
+#include <env.h>
 #include <init.h>
 #include <net.h>
 #include <asm/arch/clock.h>
diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 9359e0ac6bf..066e8db678f 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -3,7 +3,7 @@
  * Copyright 2020-2021 Toradex
  */
 
-#include <config.h>
+#include <env.h>
 #include <init.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 09/22] advantech: Include env.h in imx8qm_dmsse20_a1
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (7 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 08/22] toradex: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-08 10:27   ` Oliver Graute
  2025-05-01  1:04 ` [PATCH v2 10/22] tegra: Include env.h to permit reading the environment Simon Glass
                   ` (13 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Oliver Graute

This file uses the environment but does not include the header file.
Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c b/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
index 50b35db5f6c..accd300df04 100644
--- a/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
+++ b/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
@@ -4,6 +4,7 @@
  * Copyright 2019-2023 Kococonnector GmbH
  */
 
+#include <env.h>
 #include <errno.h>
 #include <linux/libfdt.h>
 #include <asm/io.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 10/22] tegra: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (8 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 09/22] advantech: Include env.h in imx8qm_dmsse20_a1 Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 11/22] synology: " Simon Glass
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Stephen Warren,
	Stephen Warren, Svyatoslav Ryhel, Thierry Reding, Tom Warren

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 arch/arm/mach-tegra/dt-setup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-tegra/dt-setup.c b/arch/arm/mach-tegra/dt-setup.c
index f4ae602d523..96044ac78ce 100644
--- a/arch/arm/mach-tegra/dt-setup.c
+++ b/arch/arm/mach-tegra/dt-setup.c
@@ -3,6 +3,7 @@
  * Copyright (c) 2010-2016, NVIDIA CORPORATION.
  */
 
+#include <env.h>
 #include <fdtdec.h>
 #include <stdlib.h>
 #include <asm/arch-tegra/cboot.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 11/22] synology: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (9 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 10/22] tegra: Include env.h to permit reading the environment Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  3:21   ` Tony Dinh
  2025-05-02  8:17   ` Stefan Roese
  2025-05-01  1:04 ` [PATCH v2 12/22] amlogic: " Simon Glass
                   ` (11 subsequent siblings)
  22 siblings, 2 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Phil Sutter,
	Stefan Roese, Tony Dinh

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/Synology/ds414/ds414.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/Synology/ds414/ds414.c b/board/Synology/ds414/ds414.c
index 1a4cea87e1a..02d6a4a1ea8 100644
--- a/board/Synology/ds414/ds414.c
+++ b/board/Synology/ds414/ds414.c
@@ -4,6 +4,7 @@
  * Copyright (C) 2015 Phil Sutter <phil@nwl.cc>
  */
 
+#include <env.h>
 #include <init.h>
 #include <miiphy.h>
 #include <asm/global_data.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 12/22] amlogic: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (10 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 11/22] synology: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-08 16:18   ` Viacheslav
  2025-05-01  1:04 ` [PATCH v2 13/22] freescale: " Simon Glass
                   ` (10 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Viacheslav Bocharov,
	u-boot-amlogic

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/amlogic/jethub-j100/jethub-j100.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c
index b770a1f8c53..9e87fb9f9d7 100644
--- a/board/amlogic/jethub-j100/jethub-j100.c
+++ b/board/amlogic/jethub-j100/jethub-j100.c
@@ -5,6 +5,7 @@
  */
 
 #include <dm.h>
+#include <env.h>
 #include <init.h>
 #include <net.h>
 #include <asm/io.h>
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 13/22] freescale: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (11 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 12/22] amlogic: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 14/22] google: " Simon Glass
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Adrian Alonso,
	Fabio Estevam, Jason Liu, NXP i.MX U-Boot Team, Peng Fan,
	Stefano Babic

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/freescale/mx7dsabresd/mx7dsabresd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c
index 3db167c0dad..bef4f901ff7 100644
--- a/board/freescale/mx7dsabresd/mx7dsabresd.c
+++ b/board/freescale/mx7dsabresd/mx7dsabresd.c
@@ -3,6 +3,7 @@
  * Copyright (C) 2015 Freescale Semiconductor, Inc.
  */
 
+#include <env.h>
 #include <init.h>
 #include <net.h>
 #include <asm/arch/clock.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 14/22] google: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (12 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 13/22] freescale: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 15/22] liebherr: " Simon Glass
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Paweł Anikiel

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/google/chameleonv3/board.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/google/chameleonv3/board.c b/board/google/chameleonv3/board.c
index 4d3049689d3..d8ffdd25b38 100644
--- a/board/google/chameleonv3/board.c
+++ b/board/google/chameleonv3/board.c
@@ -2,6 +2,8 @@
 /*
  * Copyright 2022 Google LLC
  */
+
+#include <env.h>
 #include <net.h>
 #include <errno.h>
 #include "mercury_aa1.h"
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 15/22] liebherr: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (13 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 14/22] google: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  6:17   ` Lukasz Majewski
  2025-05-01  1:04 ` [PATCH v2 16/22] technexion: " Simon Glass
                   ` (7 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Lukasz Majewski

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/liebherr/xea/xea.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c
index 1d4f165fd13..9630e7f576b 100644
--- a/board/liebherr/xea/xea.c
+++ b/board/liebherr/xea/xea.c
@@ -13,6 +13,7 @@
  *
  */
 
+#include <env.h>
 #include <fdt_support.h>
 #include <init.h>
 #include <log.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 16/22] technexion: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (14 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 15/22] liebherr: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 17/22] elf: Only use network environment-variables if net enabled Simon Glass
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Otavio Salvador

This file reads from the environment but does not include the correct
header. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/technexion/pico-imx7d/pico-imx7d.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c
index d0f739c624a..cf6b7fcbd95 100644
--- a/board/technexion/pico-imx7d/pico-imx7d.c
+++ b/board/technexion/pico-imx7d/pico-imx7d.c
@@ -3,6 +3,7 @@
  * Copyright (C) 2017 NXP Semiconductors
  */
 
+#include <env.h>
 #include <init.h>
 #include <net.h>
 #include <asm/arch/clock.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 17/22] elf: Only use network environment-variables if net enabled
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (15 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 16/22] technexion: " Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-05 12:37   ` Jerome Forissier
  2025-05-01  1:04 ` [PATCH v2 18/22] net: Include byteorder in net6.h Simon Glass
                   ` (5 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Daniel Palmer,
	Maxim Moskalets, Sughosh Ganu

If there is no network support it doesn't make sense to try to read
these variables. Add a condition to handle this.

This is needed so that env_get_ip() is not called when it is no-longer
a static inline, but included in net/ code.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 cmd/elf.c | 41 ++++++++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/cmd/elf.c b/cmd/elf.c
index 6b49c613703..c94125dc4a9 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -242,30 +242,33 @@ int do_bootvx(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 		 * The following parameters are only needed if 'bootdev'
 		 * is an ethernet device, otherwise they are optional.
 		 */
-		tmp = env_get("ipaddr");
-		if (tmp) {
-			ptr += sprintf(build_buf + ptr, "e=%s", tmp);
-			tmp = env_get("netmask");
+		if (IS_ENABLED(CONFIG_NET) || IS_ENABLED(CONFIG_NET_LWIP)) {
+			tmp = env_get("ipaddr");
 			if (tmp) {
-				u32 mask = env_get_ip("netmask").s_addr;
-				ptr += sprintf(build_buf + ptr,
-					       ":%08x ", ntohl(mask));
-			} else {
-				ptr += sprintf(build_buf + ptr, " ");
+				ptr += sprintf(build_buf + ptr, "e=%s", tmp);
+				tmp = env_get("netmask");
+				if (tmp) {
+					u32 mask = env_get_ip("netmask").s_addr;
+
+					ptr += sprintf(build_buf + ptr,
+						       ":%08x ", ntohl(mask));
+				} else {
+					ptr += sprintf(build_buf + ptr, " ");
+				}
 			}
-		}
 
-		tmp = env_get("serverip");
-		if (tmp)
-			ptr += sprintf(build_buf + ptr, "h=%s ", tmp);
+			tmp = env_get("serverip");
+			if (tmp)
+				ptr += sprintf(build_buf + ptr, "h=%s ", tmp);
 
-		tmp = env_get("gatewayip");
-		if (tmp)
-			ptr += sprintf(build_buf + ptr, "g=%s ", tmp);
+			tmp = env_get("gatewayip");
+			if (tmp)
+				ptr += sprintf(build_buf + ptr, "g=%s ", tmp);
 
-		tmp = env_get("hostname");
-		if (tmp)
-			ptr += sprintf(build_buf + ptr, "tn=%s ", tmp);
+			tmp = env_get("hostname");
+			if (tmp)
+				ptr += sprintf(build_buf + ptr, "tn=%s ", tmp);
+		}
 
 		tmp = env_get("othbootargs");
 		if (tmp) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 18/22] net: Include byteorder in net6.h
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (16 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 17/22] elf: Only use network environment-variables if net enabled Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 19/22] net: Include string.h in net-legacy.h Simon Glass
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Joe Hershberger

This file uses byteorder but does not include the header file. Update
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 include/net6.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/net6.h b/include/net6.h
index 1ed989e584a..2709fe9c4dc 100644
--- a/include/net6.h
+++ b/include/net6.h
@@ -11,6 +11,7 @@
 #define __NET6_H__
 
 #include <net.h>
+#include <asm/byteorder.h>
 #include <linux/ctype.h>
 #include <linux/errno.h>
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 19/22] net: Include string.h in net-legacy.h
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (17 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 18/22] net: Include byteorder in net6.h Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-05 12:38   ` Jerome Forissier
  2025-05-01  1:04 ` [PATCH v2 20/22] net: Include env.h in pcap.c Simon Glass
                   ` (3 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Joe Hershberger,
	Marek Vasut

This file uses memcpy() but does not include the header file. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 include/net-legacy.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/net-legacy.h b/include/net-legacy.h
index 1f62ebff51d..a43ab9db589 100644
--- a/include/net-legacy.h
+++ b/include/net-legacy.h
@@ -17,6 +17,7 @@
 #include <log.h>
 #include <time.h>
 #include <linux/if_ether.h>
+#include <linux/string.h>
 
 struct bd_info;
 struct cmd_tbl;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 20/22] net: Include env.h in pcap.c
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (18 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 19/22] net: Include string.h in net-legacy.h Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 21/22] net: dc2114x: Include env.h to permit reading the environment Simon Glass
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Joe Hershberger,
	Ramon Fried

This file uses the environment but does not include the header file.
Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 net/pcap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/pcap.c b/net/pcap.c
index c959e3e4e51..d1d6f705cda 100644
--- a/net/pcap.c
+++ b/net/pcap.c
@@ -3,6 +3,7 @@
  * Copyright 2019 Ramon Fried <rfried.dev@gmail.com>
  */
 
+#include <env.h>
 #include <net.h>
 #include <net/pcap.h>
 #include <time.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 21/22] net: dc2114x: Include env.h to permit reading the environment
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (19 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 20/22] net: Include env.h in pcap.c Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  1:04 ` [PATCH v2 22/22] net: Move env_get_ip() out of the header file Simon Glass
  2025-05-01  2:02 ` [PATCH v2 00/22] Deal with exfat versus byteorder Marek Vasut
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Hanyuan Zhao,
	Joe Hershberger, Ramon Fried

This file uses the environment but does not include the header file.
Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 drivers/net/dc2114x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
index 7c0665faa8e..8fa549280aa 100644
--- a/drivers/net/dc2114x.c
+++ b/drivers/net/dc2114x.c
@@ -3,6 +3,7 @@
 #include <asm/io.h>
 #include <cpu_func.h>
 #include <dm.h>
+#include <env.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2 22/22] net: Move env_get_ip() out of the header file
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (20 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 21/22] net: dc2114x: Include env.h to permit reading the environment Simon Glass
@ 2025-05-01  1:04 ` Simon Glass
  2025-05-01  2:02 ` [PATCH v2 00/22] Deal with exfat versus byteorder Marek Vasut
  22 siblings, 0 replies; 47+ messages in thread
From: Simon Glass @ 2025-05-01  1:04 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Simon Glass, Adriano Cordova,
	Heinrich Schuchardt, Joe Hershberger, Marek Vasut, Ramon Fried

This function requires access to env.h but it is a lot to include just
for the env_get() function. It eventually pulls in linux/byteorder which
causes a conflict with exfat which has its own byteorder functions.

Move the function to a C file instead.

Add includes to some other files to keep the build working.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
---

(no changes since v1)

 include/net-common.h | 6 +-----
 net/net-common.c     | 6 ++++++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/net-common.h b/include/net-common.h
index f2613a41ad8..64b475b7292 100644
--- a/include/net-common.h
+++ b/include/net-common.h
@@ -4,7 +4,6 @@
 #define __NET_COMMON_H__
 
 #include <asm/cache.h>
-#include <env.h>
 #include <hexdump.h>
 #include <linux/if_ether.h>
 #include <linux/sizes.h>
@@ -464,10 +463,7 @@ int update_tftp(ulong addr, char *interface, char *devstring);
  *	0 to 255
  * Return: IP address, or 0 if invalid
  */
-static inline struct in_addr env_get_ip(char *var)
-{
-	return string_to_ip(env_get(var));
-}
+struct in_addr env_get_ip(char *var);
 
 int net_init(void);
 
diff --git a/net/net-common.c b/net/net-common.c
index 45288fe5f80..9ff06b165df 100644
--- a/net/net-common.c
+++ b/net/net-common.c
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <env.h>
 #include <net-common.h>
 
 void copy_filename(char *dst, const char *src, int size)
@@ -25,3 +26,8 @@ int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info)
 	wget_info = info ? info : &default_wget_info;
 	return wget_with_dns(dst_addr, uri);
 }
+
+struct in_addr env_get_ip(char *var)
+{
+	return string_to_ip(env_get(var));
+}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 00/22] Deal with exfat versus byteorder
  2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
                   ` (21 preceding siblings ...)
  2025-05-01  1:04 ` [PATCH v2 22/22] net: Move env_get_ip() out of the header file Simon Glass
@ 2025-05-01  2:02 ` Marek Vasut
  2025-05-01 12:07   ` Simon Glass
  22 siblings, 1 reply; 47+ messages in thread
From: Marek Vasut @ 2025-05-01  2:02 UTC (permalink / raw)
  To: Simon Glass, U-Boot Mailing List
  Cc: Tom Rini, Fabio Estevam, Heinrich Schuchardt

On 5/1/25 3:04 AM, Simon Glass wrote:
> Since exfat has its own byteorder functions we need to be careful about
> including the normal U-Boot byteorder headers in code included by exfat.

...

>    net: Use a forward declaration for cmd_tbl in net-common.h
>    congatec: Include env.h to permit reading the environment
>    dhelectronics: Include env.h to permit reading the environment
>    imx8ulp_evk: Include env.h to permit reading the environment
>    venice: Include env.h to permit reading the environment
>    phytec: Include env.h to permit reading the environment
>    ronetix: Include env.h to permit reading the environment
>    toradex: Include env.h to permit reading the environment
>    advantech: Include env.h in imx8qm_dmsse20_a1
>    tegra: Include env.h to permit reading the environment
>    synology: Include env.h to permit reading the environment
>    amlogic: Include env.h to permit reading the environment
>    freescale: Include env.h to permit reading the environment
>    google: Include env.h to permit reading the environment
>    liebherr: Include env.h to permit reading the environment
>    technexion: Include env.h to permit reading the environment
>    elf: Only use network environment-variables if net enabled
>    net: Include byteorder in net6.h
>    net: Include string.h in net-legacy.h
>    net: Include env.h in pcap.c
>    net: dc2114x: Include env.h to permit reading the environment
>    net: Move env_get_ip() out of the header file
> 
>   arch/arm/mach-tegra/dt-setup.c                |  1 +
>   board/Synology/ds414/ds414.c                  |  1 +
>   .../imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c     |  1 +
>   board/amlogic/jethub-j100/jethub-j100.c       |  1 +
>   board/congatec/cgtqmx8/cgtqmx8.c              |  3 +-
>   board/dhelectronics/common/dh_common.c        |  1 +
>   board/freescale/imx8ulp_evk/imx8ulp_evk.c     |  1 +
>   board/freescale/mx7dsabresd/mx7dsabresd.c     |  1 +
>   board/gateworks/venice/venice.c               |  1 +
>   board/google/chameleonv3/board.c              |  2 +
>   board/liebherr/xea/xea.c                      |  1 +
>   .../common/phytec_som_detection_blocks.c      |  1 +
>   board/ronetix/imx8mq-cm/imx8mq_cm.c           |  1 +
>   board/technexion/pico-imx7d/pico-imx7d.c      |  1 +
>   board/toradex/colibri_imx7/colibri_imx7.c     |  1 +
>   board/toradex/verdin-imx8mm/verdin-imx8mm.c   |  2 +-
>   cmd/elf.c                                     | 41 ++++++++++---------
>   drivers/net/dc2114x.c                         |  1 +
>   include/net-common.h                          |  9 ++--
>   include/net-legacy.h                          |  1 +
>   include/net6.h                                |  1 +
>   net/net-common.c                              |  6 +++
>   net/pcap.c                                    |  1 +
>   23 files changed, 53 insertions(+), 27 deletions(-)
There are no fs changes in this series , what does this series have to 
do with exfat ?

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 11/22] synology: Include env.h to permit reading the environment
  2025-05-01  1:04 ` [PATCH v2 11/22] synology: " Simon Glass
@ 2025-05-01  3:21   ` Tony Dinh
  2025-05-02  8:17   ` Stefan Roese
  1 sibling, 0 replies; 47+ messages in thread
From: Tony Dinh @ 2025-05-01  3:21 UTC (permalink / raw)
  To: Simon Glass
  Cc: U-Boot Mailing List, Tom Rini, Jerome Forissier, Phil Sutter,
	Stefan Roese

On Wed, Apr 30, 2025 at 6:05 PM Simon Glass <sjg@chromium.org> wrote:
>
> This file reads from the environment but does not include the correct
> header. Update it.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tony Dinh <mibodhi@gmail.com>

Thanks,
Tony
> ---
>
> (no changes since v1)
>
>  board/Synology/ds414/ds414.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/board/Synology/ds414/ds414.c b/board/Synology/ds414/ds414.c
> index 1a4cea87e1a..02d6a4a1ea8 100644
> --- a/board/Synology/ds414/ds414.c
> +++ b/board/Synology/ds414/ds414.c
> @@ -4,6 +4,7 @@
>   * Copyright (C) 2015 Phil Sutter <phil@nwl.cc>
>   */
>
> +#include <env.h>
>  #include <init.h>
>  #include <miiphy.h>
>  #include <asm/global_data.h>
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 15/22] liebherr: Include env.h to permit reading the environment
  2025-05-01  1:04 ` [PATCH v2 15/22] liebherr: " Simon Glass
@ 2025-05-01  6:17   ` Lukasz Majewski
  0 siblings, 0 replies; 47+ messages in thread
From: Lukasz Majewski @ 2025-05-01  6:17 UTC (permalink / raw)
  To: Simon Glass; +Cc: U-Boot Mailing List, Tom Rini, Jerome Forissier

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

On Wed, 30 Apr 2025 19:04:40 -0600
Simon Glass <sjg@chromium.org> wrote:

> This file reads from the environment but does not include the correct
> header. Update it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> (no changes since v1)
> 
>  board/liebherr/xea/xea.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c
> index 1d4f165fd13..9630e7f576b 100644
> --- a/board/liebherr/xea/xea.c
> +++ b/board/liebherr/xea/xea.c
> @@ -13,6 +13,7 @@
>   *
>   */
>  
> +#include <env.h>
>  #include <fdt_support.h>
>  #include <init.h>
>  #include <log.h>

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 00/22] Deal with exfat versus byteorder
  2025-05-01  2:02 ` [PATCH v2 00/22] Deal with exfat versus byteorder Marek Vasut
@ 2025-05-01 12:07   ` Simon Glass
  2025-05-01 14:17     ` Tom Rini
  0 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-01 12:07 UTC (permalink / raw)
  To: Marek Vasut
  Cc: U-Boot Mailing List, Tom Rini, Fabio Estevam, Heinrich Schuchardt

Hi Marek,

On Wed, 30 Apr 2025 at 20:02, Marek Vasut <marek.vasut@mailbox.org> wrote:
>
> On 5/1/25 3:04 AM, Simon Glass wrote:
> > Since exfat has its own byteorder functions we need to be careful about
> > including the normal U-Boot byteorder headers in code included by exfat.
>
> ...
>
> >    net: Use a forward declaration for cmd_tbl in net-common.h
> >    congatec: Include env.h to permit reading the environment
> >    dhelectronics: Include env.h to permit reading the environment
> >    imx8ulp_evk: Include env.h to permit reading the environment
> >    venice: Include env.h to permit reading the environment
> >    phytec: Include env.h to permit reading the environment
> >    ronetix: Include env.h to permit reading the environment
> >    toradex: Include env.h to permit reading the environment
> >    advantech: Include env.h in imx8qm_dmsse20_a1
> >    tegra: Include env.h to permit reading the environment
> >    synology: Include env.h to permit reading the environment
> >    amlogic: Include env.h to permit reading the environment
> >    freescale: Include env.h to permit reading the environment
> >    google: Include env.h to permit reading the environment
> >    liebherr: Include env.h to permit reading the environment
> >    technexion: Include env.h to permit reading the environment
> >    elf: Only use network environment-variables if net enabled
> >    net: Include byteorder in net6.h
> >    net: Include string.h in net-legacy.h
> >    net: Include env.h in pcap.c
> >    net: dc2114x: Include env.h to permit reading the environment
> >    net: Move env_get_ip() out of the header file
> >
> >   arch/arm/mach-tegra/dt-setup.c                |  1 +
> >   board/Synology/ds414/ds414.c                  |  1 +
> >   .../imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c     |  1 +
> >   board/amlogic/jethub-j100/jethub-j100.c       |  1 +
> >   board/congatec/cgtqmx8/cgtqmx8.c              |  3 +-
> >   board/dhelectronics/common/dh_common.c        |  1 +
> >   board/freescale/imx8ulp_evk/imx8ulp_evk.c     |  1 +
> >   board/freescale/mx7dsabresd/mx7dsabresd.c     |  1 +
> >   board/gateworks/venice/venice.c               |  1 +
> >   board/google/chameleonv3/board.c              |  2 +
> >   board/liebherr/xea/xea.c                      |  1 +
> >   .../common/phytec_som_detection_blocks.c      |  1 +
> >   board/ronetix/imx8mq-cm/imx8mq_cm.c           |  1 +
> >   board/technexion/pico-imx7d/pico-imx7d.c      |  1 +
> >   board/toradex/colibri_imx7/colibri_imx7.c     |  1 +
> >   board/toradex/verdin-imx8mm/verdin-imx8mm.c   |  2 +-
> >   cmd/elf.c                                     | 41 ++++++++++---------
> >   drivers/net/dc2114x.c                         |  1 +
> >   include/net-common.h                          |  9 ++--
> >   include/net-legacy.h                          |  1 +
> >   include/net6.h                                |  1 +
> >   net/net-common.c                              |  6 +++
> >   net/pcap.c                                    |  1 +
> >   23 files changed, 53 insertions(+), 27 deletions(-)
> There are no fs changes in this series , what does this series have to
> do with exfat ?

I found that in some situations, the exfat code includes
linux/byteorder.h instead of its own local byteorder, which is
implemented differently. This then causes build errors in the exfat
code. One way to trigger it is by adding '#include net.h' to
include/efi.h

Regards,
SImon

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-01  1:04 ` [PATCH v2 02/22] congatec: Include env.h to permit reading the environment Simon Glass
@ 2025-05-01 14:06   ` Tom Rini
  2025-05-01 15:04     ` Simon Glass
  0 siblings, 1 reply; 47+ messages in thread
From: Tom Rini @ 2025-05-01 14:06 UTC (permalink / raw)
  To: Simon Glass
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> This file reads from the environment but does not include the correct
> header. Update it.
> 
> Drop the unnecessary config.h while we are here.

Are you sure about that? It was explicitly added in commit
ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
includes") probably because of CFG_SYS_... usage.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 00/22] Deal with exfat versus byteorder
  2025-05-01 12:07   ` Simon Glass
@ 2025-05-01 14:17     ` Tom Rini
  2025-05-01 15:03       ` Simon Glass
  0 siblings, 1 reply; 47+ messages in thread
From: Tom Rini @ 2025-05-01 14:17 UTC (permalink / raw)
  To: Simon Glass
  Cc: Marek Vasut, U-Boot Mailing List, Fabio Estevam,
	Heinrich Schuchardt

[-- Attachment #1: Type: text/plain, Size: 4146 bytes --]

On Thu, May 01, 2025 at 06:07:15AM -0600, Simon Glass wrote:
> Hi Marek,
> 
> On Wed, 30 Apr 2025 at 20:02, Marek Vasut <marek.vasut@mailbox.org> wrote:
> >
> > On 5/1/25 3:04 AM, Simon Glass wrote:
> > > Since exfat has its own byteorder functions we need to be careful about
> > > including the normal U-Boot byteorder headers in code included by exfat.
> >
> > ...
> >
> > >    net: Use a forward declaration for cmd_tbl in net-common.h
> > >    congatec: Include env.h to permit reading the environment
> > >    dhelectronics: Include env.h to permit reading the environment
> > >    imx8ulp_evk: Include env.h to permit reading the environment
> > >    venice: Include env.h to permit reading the environment
> > >    phytec: Include env.h to permit reading the environment
> > >    ronetix: Include env.h to permit reading the environment
> > >    toradex: Include env.h to permit reading the environment
> > >    advantech: Include env.h in imx8qm_dmsse20_a1
> > >    tegra: Include env.h to permit reading the environment
> > >    synology: Include env.h to permit reading the environment
> > >    amlogic: Include env.h to permit reading the environment
> > >    freescale: Include env.h to permit reading the environment
> > >    google: Include env.h to permit reading the environment
> > >    liebherr: Include env.h to permit reading the environment
> > >    technexion: Include env.h to permit reading the environment
> > >    elf: Only use network environment-variables if net enabled
> > >    net: Include byteorder in net6.h
> > >    net: Include string.h in net-legacy.h
> > >    net: Include env.h in pcap.c
> > >    net: dc2114x: Include env.h to permit reading the environment
> > >    net: Move env_get_ip() out of the header file
> > >
> > >   arch/arm/mach-tegra/dt-setup.c                |  1 +
> > >   board/Synology/ds414/ds414.c                  |  1 +
> > >   .../imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c     |  1 +
> > >   board/amlogic/jethub-j100/jethub-j100.c       |  1 +
> > >   board/congatec/cgtqmx8/cgtqmx8.c              |  3 +-
> > >   board/dhelectronics/common/dh_common.c        |  1 +
> > >   board/freescale/imx8ulp_evk/imx8ulp_evk.c     |  1 +
> > >   board/freescale/mx7dsabresd/mx7dsabresd.c     |  1 +
> > >   board/gateworks/venice/venice.c               |  1 +
> > >   board/google/chameleonv3/board.c              |  2 +
> > >   board/liebherr/xea/xea.c                      |  1 +
> > >   .../common/phytec_som_detection_blocks.c      |  1 +
> > >   board/ronetix/imx8mq-cm/imx8mq_cm.c           |  1 +
> > >   board/technexion/pico-imx7d/pico-imx7d.c      |  1 +
> > >   board/toradex/colibri_imx7/colibri_imx7.c     |  1 +
> > >   board/toradex/verdin-imx8mm/verdin-imx8mm.c   |  2 +-
> > >   cmd/elf.c                                     | 41 ++++++++++---------
> > >   drivers/net/dc2114x.c                         |  1 +
> > >   include/net-common.h                          |  9 ++--
> > >   include/net-legacy.h                          |  1 +
> > >   include/net6.h                                |  1 +
> > >   net/net-common.c                              |  6 +++
> > >   net/pcap.c                                    |  1 +
> > >   23 files changed, 53 insertions(+), 27 deletions(-)
> > There are no fs changes in this series , what does this series have to
> > do with exfat ?
> 
> I found that in some situations, the exfat code includes
> linux/byteorder.h instead of its own local byteorder, which is
> implemented differently. This then causes build errors in the exfat
> code. One way to trigger it is by adding '#include net.h' to
> include/efi.h

Setting aside if it's a good idea to have efi.h include net.h, we should
unwind what the heck is going on. The build error is on CLUSTER_INVALID
somehow becoming weird. Looking harder at this, the problem I see is
that include/fs.h includes <rtc.h> (which in turn pulls in many things)
when it only needs <rtc_defs.h> for struct rtc_time. This however
exposes some other implicit includes. I'll go and take a look at hunting
these all down.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 00/22] Deal with exfat versus byteorder
  2025-05-01 14:17     ` Tom Rini
@ 2025-05-01 15:03       ` Simon Glass
  2025-05-01 15:35         ` Tom Rini
  0 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-01 15:03 UTC (permalink / raw)
  To: Tom Rini
  Cc: Marek Vasut, U-Boot Mailing List, Fabio Estevam,
	Heinrich Schuchardt

Hi Tom,

On Thu, 1 May 2025 at 08:17, Tom Rini <trini@konsulko.com> wrote:
>
> On Thu, May 01, 2025 at 06:07:15AM -0600, Simon Glass wrote:
> > Hi Marek,
> >
> > On Wed, 30 Apr 2025 at 20:02, Marek Vasut <marek.vasut@mailbox.org> wrote:
> > >
> > > On 5/1/25 3:04 AM, Simon Glass wrote:
> > > > Since exfat has its own byteorder functions we need to be careful about
> > > > including the normal U-Boot byteorder headers in code included by exfat.
> > >
> > > ...
> > >
> > > >    net: Use a forward declaration for cmd_tbl in net-common.h
> > > >    congatec: Include env.h to permit reading the environment
> > > >    dhelectronics: Include env.h to permit reading the environment
> > > >    imx8ulp_evk: Include env.h to permit reading the environment
> > > >    venice: Include env.h to permit reading the environment
> > > >    phytec: Include env.h to permit reading the environment
> > > >    ronetix: Include env.h to permit reading the environment
> > > >    toradex: Include env.h to permit reading the environment
> > > >    advantech: Include env.h in imx8qm_dmsse20_a1
> > > >    tegra: Include env.h to permit reading the environment
> > > >    synology: Include env.h to permit reading the environment
> > > >    amlogic: Include env.h to permit reading the environment
> > > >    freescale: Include env.h to permit reading the environment
> > > >    google: Include env.h to permit reading the environment
> > > >    liebherr: Include env.h to permit reading the environment
> > > >    technexion: Include env.h to permit reading the environment
> > > >    elf: Only use network environment-variables if net enabled
> > > >    net: Include byteorder in net6.h
> > > >    net: Include string.h in net-legacy.h
> > > >    net: Include env.h in pcap.c
> > > >    net: dc2114x: Include env.h to permit reading the environment
> > > >    net: Move env_get_ip() out of the header file
> > > >
> > > >   arch/arm/mach-tegra/dt-setup.c                |  1 +
> > > >   board/Synology/ds414/ds414.c                  |  1 +
> > > >   .../imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c     |  1 +
> > > >   board/amlogic/jethub-j100/jethub-j100.c       |  1 +
> > > >   board/congatec/cgtqmx8/cgtqmx8.c              |  3 +-
> > > >   board/dhelectronics/common/dh_common.c        |  1 +
> > > >   board/freescale/imx8ulp_evk/imx8ulp_evk.c     |  1 +
> > > >   board/freescale/mx7dsabresd/mx7dsabresd.c     |  1 +
> > > >   board/gateworks/venice/venice.c               |  1 +
> > > >   board/google/chameleonv3/board.c              |  2 +
> > > >   board/liebherr/xea/xea.c                      |  1 +
> > > >   .../common/phytec_som_detection_blocks.c      |  1 +
> > > >   board/ronetix/imx8mq-cm/imx8mq_cm.c           |  1 +
> > > >   board/technexion/pico-imx7d/pico-imx7d.c      |  1 +
> > > >   board/toradex/colibri_imx7/colibri_imx7.c     |  1 +
> > > >   board/toradex/verdin-imx8mm/verdin-imx8mm.c   |  2 +-
> > > >   cmd/elf.c                                     | 41 ++++++++++---------
> > > >   drivers/net/dc2114x.c                         |  1 +
> > > >   include/net-common.h                          |  9 ++--
> > > >   include/net-legacy.h                          |  1 +
> > > >   include/net6.h                                |  1 +
> > > >   net/net-common.c                              |  6 +++
> > > >   net/pcap.c                                    |  1 +
> > > >   23 files changed, 53 insertions(+), 27 deletions(-)
> > > There are no fs changes in this series , what does this series have to
> > > do with exfat ?
> >
> > I found that in some situations, the exfat code includes
> > linux/byteorder.h instead of its own local byteorder, which is
> > implemented differently. This then causes build errors in the exfat
> > code. One way to trigger it is by adding '#include net.h' to
> > include/efi.h
>
> Setting aside if it's a good idea to have efi.h include net.h, we should
> unwind what the heck is going on. The build error is on CLUSTER_INVALID
> somehow becoming weird. Looking harder at this, the problem I see is
> that include/fs.h includes <rtc.h> (which in turn pulls in many things)
> when it only needs <rtc_defs.h> for struct rtc_time. This however
> exposes some other implicit includes. I'll go and take a look at hunting
> these all down.

OK. I wonder if we could drop the special byteorder macros in exfat?

Regards,
SImon

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-01 14:06   ` Tom Rini
@ 2025-05-01 15:04     ` Simon Glass
  2025-05-01 15:33       ` Tom Rini
  0 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-01 15:04 UTC (permalink / raw)
  To: Tom Rini
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

Hi Tom,

On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
>
> On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > This file reads from the environment but does not include the correct
> > header. Update it.
> >
> > Drop the unnecessary config.h while we are here.
>
> Are you sure about that? It was explicitly added in commit
> ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> includes") probably because of CFG_SYS_... usage.

Well I assumed it wouldn't build if it had it, but perhaps that is
incorrect? I understood that CFG_ things had to be values and you
couldn't #idef them?

Regards,
Simon

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-01 15:04     ` Simon Glass
@ 2025-05-01 15:33       ` Tom Rini
  2025-05-02 13:11         ` Simon Glass
  0 siblings, 1 reply; 47+ messages in thread
From: Tom Rini @ 2025-05-01 15:33 UTC (permalink / raw)
  To: Simon Glass
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

On Thu, May 01, 2025 at 09:04:45AM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > > This file reads from the environment but does not include the correct
> > > header. Update it.
> > >
> > > Drop the unnecessary config.h while we are here.
> >
> > Are you sure about that? It was explicitly added in commit
> > ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> > includes") probably because of CFG_SYS_... usage.
> 
> Well I assumed it wouldn't build if it had it, but perhaps that is
> incorrect? I understood that CFG_ things had to be values and you
> couldn't #idef them?

The cases where in that series I added config.h were for good reason,
either failure to build or tricky size change reasons. All were
intentional. An audit-and-remove of config.h would be it's own series as
yes, there's perhaps not the need now as whatever complex chain was
unwound.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 00/22] Deal with exfat versus byteorder
  2025-05-01 15:03       ` Simon Glass
@ 2025-05-01 15:35         ` Tom Rini
  0 siblings, 0 replies; 47+ messages in thread
From: Tom Rini @ 2025-05-01 15:35 UTC (permalink / raw)
  To: Simon Glass
  Cc: Marek Vasut, U-Boot Mailing List, Fabio Estevam,
	Heinrich Schuchardt

[-- Attachment #1: Type: text/plain, Size: 4768 bytes --]

On Thu, May 01, 2025 at 09:03:18AM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Thu, 1 May 2025 at 08:17, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Thu, May 01, 2025 at 06:07:15AM -0600, Simon Glass wrote:
> > > Hi Marek,
> > >
> > > On Wed, 30 Apr 2025 at 20:02, Marek Vasut <marek.vasut@mailbox.org> wrote:
> > > >
> > > > On 5/1/25 3:04 AM, Simon Glass wrote:
> > > > > Since exfat has its own byteorder functions we need to be careful about
> > > > > including the normal U-Boot byteorder headers in code included by exfat.
> > > >
> > > > ...
> > > >
> > > > >    net: Use a forward declaration for cmd_tbl in net-common.h
> > > > >    congatec: Include env.h to permit reading the environment
> > > > >    dhelectronics: Include env.h to permit reading the environment
> > > > >    imx8ulp_evk: Include env.h to permit reading the environment
> > > > >    venice: Include env.h to permit reading the environment
> > > > >    phytec: Include env.h to permit reading the environment
> > > > >    ronetix: Include env.h to permit reading the environment
> > > > >    toradex: Include env.h to permit reading the environment
> > > > >    advantech: Include env.h in imx8qm_dmsse20_a1
> > > > >    tegra: Include env.h to permit reading the environment
> > > > >    synology: Include env.h to permit reading the environment
> > > > >    amlogic: Include env.h to permit reading the environment
> > > > >    freescale: Include env.h to permit reading the environment
> > > > >    google: Include env.h to permit reading the environment
> > > > >    liebherr: Include env.h to permit reading the environment
> > > > >    technexion: Include env.h to permit reading the environment
> > > > >    elf: Only use network environment-variables if net enabled
> > > > >    net: Include byteorder in net6.h
> > > > >    net: Include string.h in net-legacy.h
> > > > >    net: Include env.h in pcap.c
> > > > >    net: dc2114x: Include env.h to permit reading the environment
> > > > >    net: Move env_get_ip() out of the header file
> > > > >
> > > > >   arch/arm/mach-tegra/dt-setup.c                |  1 +
> > > > >   board/Synology/ds414/ds414.c                  |  1 +
> > > > >   .../imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c     |  1 +
> > > > >   board/amlogic/jethub-j100/jethub-j100.c       |  1 +
> > > > >   board/congatec/cgtqmx8/cgtqmx8.c              |  3 +-
> > > > >   board/dhelectronics/common/dh_common.c        |  1 +
> > > > >   board/freescale/imx8ulp_evk/imx8ulp_evk.c     |  1 +
> > > > >   board/freescale/mx7dsabresd/mx7dsabresd.c     |  1 +
> > > > >   board/gateworks/venice/venice.c               |  1 +
> > > > >   board/google/chameleonv3/board.c              |  2 +
> > > > >   board/liebherr/xea/xea.c                      |  1 +
> > > > >   .../common/phytec_som_detection_blocks.c      |  1 +
> > > > >   board/ronetix/imx8mq-cm/imx8mq_cm.c           |  1 +
> > > > >   board/technexion/pico-imx7d/pico-imx7d.c      |  1 +
> > > > >   board/toradex/colibri_imx7/colibri_imx7.c     |  1 +
> > > > >   board/toradex/verdin-imx8mm/verdin-imx8mm.c   |  2 +-
> > > > >   cmd/elf.c                                     | 41 ++++++++++---------
> > > > >   drivers/net/dc2114x.c                         |  1 +
> > > > >   include/net-common.h                          |  9 ++--
> > > > >   include/net-legacy.h                          |  1 +
> > > > >   include/net6.h                                |  1 +
> > > > >   net/net-common.c                              |  6 +++
> > > > >   net/pcap.c                                    |  1 +
> > > > >   23 files changed, 53 insertions(+), 27 deletions(-)
> > > > There are no fs changes in this series , what does this series have to
> > > > do with exfat ?
> > >
> > > I found that in some situations, the exfat code includes
> > > linux/byteorder.h instead of its own local byteorder, which is
> > > implemented differently. This then causes build errors in the exfat
> > > code. One way to trigger it is by adding '#include net.h' to
> > > include/efi.h
> >
> > Setting aside if it's a good idea to have efi.h include net.h, we should
> > unwind what the heck is going on. The build error is on CLUSTER_INVALID
> > somehow becoming weird. Looking harder at this, the problem I see is
> > that include/fs.h includes <rtc.h> (which in turn pulls in many things)
> > when it only needs <rtc_defs.h> for struct rtc_time. This however
> > exposes some other implicit includes. I'll go and take a look at hunting
> > these all down.
> 
> OK. I wonder if we could drop the special byteorder macros in exfat?

Potentially. I'll leave it to Marek to comment on how much pain and
future pain that might cause.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 11/22] synology: Include env.h to permit reading the environment
  2025-05-01  1:04 ` [PATCH v2 11/22] synology: " Simon Glass
  2025-05-01  3:21   ` Tony Dinh
@ 2025-05-02  8:17   ` Stefan Roese
  1 sibling, 0 replies; 47+ messages in thread
From: Stefan Roese @ 2025-05-02  8:17 UTC (permalink / raw)
  To: Simon Glass, U-Boot Mailing List
  Cc: Tom Rini, Jerome Forissier, Phil Sutter, Tony Dinh

On 01.05.25 03:04, Simon Glass wrote:
> This file reads from the environment but does not include the correct
> header. Update it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
> 
> (no changes since v1)
> 
>   board/Synology/ds414/ds414.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/board/Synology/ds414/ds414.c b/board/Synology/ds414/ds414.c
> index 1a4cea87e1a..02d6a4a1ea8 100644
> --- a/board/Synology/ds414/ds414.c
> +++ b/board/Synology/ds414/ds414.c
> @@ -4,6 +4,7 @@
>    * Copyright (C) 2015 Phil Sutter <phil@nwl.cc>
>    */
>   
> +#include <env.h>
>   #include <init.h>
>   #include <miiphy.h>
>   #include <asm/global_data.h>

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-01 15:33       ` Tom Rini
@ 2025-05-02 13:11         ` Simon Glass
  2025-05-02 14:06           ` Tom Rini
  0 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-02 13:11 UTC (permalink / raw)
  To: Tom Rini
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

Hi Tom,

On Thu, 1 May 2025 at 09:33, Tom Rini <trini@konsulko.com> wrote:
>
> On Thu, May 01, 2025 at 09:04:45AM -0600, Simon Glass wrote:
> > Hi Tom,
> >
> > On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > > > This file reads from the environment but does not include the correct
> > > > header. Update it.
> > > >
> > > > Drop the unnecessary config.h while we are here.
> > >
> > > Are you sure about that? It was explicitly added in commit
> > > ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> > > includes") probably because of CFG_SYS_... usage.
> >
> > Well I assumed it wouldn't build if it had it, but perhaps that is
> > incorrect? I understood that CFG_ things had to be values and you
> > couldn't #idef them?
>
> The cases where in that series I added config.h were for good reason,
> either failure to build or tricky size change reasons. All were
> intentional. An audit-and-remove of config.h would be it's own series as
> yes, there's perhaps not the need now as whatever complex chain was
> unwound.

Oh dear, OK. I'll respin the series.

Hmm but I see you have sent a series that does some similar tweak[1].
What was the goal there?

Regards,
Simon

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=455004

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-02 13:11         ` Simon Glass
@ 2025-05-02 14:06           ` Tom Rini
  2025-05-02 14:52             ` Simon Glass
  0 siblings, 1 reply; 47+ messages in thread
From: Tom Rini @ 2025-05-02 14:06 UTC (permalink / raw)
  To: Simon Glass
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

[-- Attachment #1: Type: text/plain, Size: 1564 bytes --]

On Fri, May 02, 2025 at 07:11:56AM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Thu, 1 May 2025 at 09:33, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Thu, May 01, 2025 at 09:04:45AM -0600, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > > > > This file reads from the environment but does not include the correct
> > > > > header. Update it.
> > > > >
> > > > > Drop the unnecessary config.h while we are here.
> > > >
> > > > Are you sure about that? It was explicitly added in commit
> > > > ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> > > > includes") probably because of CFG_SYS_... usage.
> > >
> > > Well I assumed it wouldn't build if it had it, but perhaps that is
> > > incorrect? I understood that CFG_ things had to be values and you
> > > couldn't #idef them?
> >
> > The cases where in that series I added config.h were for good reason,
> > either failure to build or tricky size change reasons. All were
> > intentional. An audit-and-remove of config.h would be it's own series as
> > yes, there's perhaps not the need now as whatever complex chain was
> > unwound.
> 
> Oh dear, OK. I'll respin the series.
> 
> Hmm but I see you have sent a series that does some similar tweak[1].
> What was the goal there?

I fixed your problem. Please don't bother re-spinning this series, it's
not clear what problems it's solving correctly.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-02 14:06           ` Tom Rini
@ 2025-05-02 14:52             ` Simon Glass
  2025-05-02 15:04               ` Tom Rini
  0 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-02 14:52 UTC (permalink / raw)
  To: Tom Rini
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

Hi Tom,

On Fri, 2 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
>
> On Fri, May 02, 2025 at 07:11:56AM -0600, Simon Glass wrote:
> > Hi Tom,
> >
> > On Thu, 1 May 2025 at 09:33, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Thu, May 01, 2025 at 09:04:45AM -0600, Simon Glass wrote:
> > > > Hi Tom,
> > > >
> > > > On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > > >
> > > > > On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > > > > > This file reads from the environment but does not include the correct
> > > > > > header. Update it.
> > > > > >
> > > > > > Drop the unnecessary config.h while we are here.
> > > > >
> > > > > Are you sure about that? It was explicitly added in commit
> > > > > ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> > > > > includes") probably because of CFG_SYS_... usage.
> > > >
> > > > Well I assumed it wouldn't build if it had it, but perhaps that is
> > > > incorrect? I understood that CFG_ things had to be values and you
> > > > couldn't #idef them?
> > >
> > > The cases where in that series I added config.h were for good reason,
> > > either failure to build or tricky size change reasons. All were
> > > intentional. An audit-and-remove of config.h would be it's own series as
> > > yes, there's perhaps not the need now as whatever complex chain was
> > > unwound.
> >
> > Oh dear, OK. I'll respin the series.
> >
> > Hmm but I see you have sent a series that does some similar tweak[1].
> > What was the goal there?
>
> I fixed your problem. Please don't bother re-spinning this series, it's
> not clear what problems it's solving correctly.

OK thanks. The problem was trying to include net.h in include/efi.h:

https://patchwork.ozlabs.org/project/uboot/cover/20250501010456.3930701-1-sjg@chromium.org/

So long as that works, we're fine. Having said that, even if it were a
problem, we could always refactor things to put the Ethernet decls in
a separate header.

Regards,
Simon

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-02 14:52             ` Simon Glass
@ 2025-05-02 15:04               ` Tom Rini
  2025-05-03  2:10                 ` Simon Glass
  0 siblings, 1 reply; 47+ messages in thread
From: Tom Rini @ 2025-05-02 15:04 UTC (permalink / raw)
  To: Simon Glass
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

[-- Attachment #1: Type: text/plain, Size: 2568 bytes --]

On Fri, May 02, 2025 at 08:52:37AM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Fri, 2 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Fri, May 02, 2025 at 07:11:56AM -0600, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Thu, 1 May 2025 at 09:33, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Thu, May 01, 2025 at 09:04:45AM -0600, Simon Glass wrote:
> > > > > Hi Tom,
> > > > >
> > > > > On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > > > >
> > > > > > On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > > > > > > This file reads from the environment but does not include the correct
> > > > > > > header. Update it.
> > > > > > >
> > > > > > > Drop the unnecessary config.h while we are here.
> > > > > >
> > > > > > Are you sure about that? It was explicitly added in commit
> > > > > > ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> > > > > > includes") probably because of CFG_SYS_... usage.
> > > > >
> > > > > Well I assumed it wouldn't build if it had it, but perhaps that is
> > > > > incorrect? I understood that CFG_ things had to be values and you
> > > > > couldn't #idef them?
> > > >
> > > > The cases where in that series I added config.h were for good reason,
> > > > either failure to build or tricky size change reasons. All were
> > > > intentional. An audit-and-remove of config.h would be it's own series as
> > > > yes, there's perhaps not the need now as whatever complex chain was
> > > > unwound.
> > >
> > > Oh dear, OK. I'll respin the series.
> > >
> > > Hmm but I see you have sent a series that does some similar tweak[1].
> > > What was the goal there?
> >
> > I fixed your problem. Please don't bother re-spinning this series, it's
> > not clear what problems it's solving correctly.
> 
> OK thanks. The problem was trying to include net.h in include/efi.h:
> 
> https://patchwork.ozlabs.org/project/uboot/cover/20250501010456.3930701-1-sjg@chromium.org/

Adding headers to headers needs extra care (so that we don't end up with
massive implicit include chains).

> So long as that works, we're fine. Having said that, even if it were a
> problem, we could always refactor things to put the Ethernet decls in
> a separate header.

Yes, if there's some problem down the line then some refactoring is
likely the thing to look at, not adding more headers to C files (the
right path is to unwind the header chain and fix C files, your series
doesn't remove env.h from any header).

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-02 15:04               ` Tom Rini
@ 2025-05-03  2:10                 ` Simon Glass
  2025-05-03 16:30                   ` Tom Rini
  0 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-03  2:10 UTC (permalink / raw)
  To: Tom Rini
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

Hi Tom,

On Fri, 2 May 2025 at 09:04, Tom Rini <trini@konsulko.com> wrote:
>
> On Fri, May 02, 2025 at 08:52:37AM -0600, Simon Glass wrote:
> > Hi Tom,
> >
> > On Fri, 2 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Fri, May 02, 2025 at 07:11:56AM -0600, Simon Glass wrote:
> > > > Hi Tom,
> > > >
> > > > On Thu, 1 May 2025 at 09:33, Tom Rini <trini@konsulko.com> wrote:
> > > > >
> > > > > On Thu, May 01, 2025 at 09:04:45AM -0600, Simon Glass wrote:
> > > > > > Hi Tom,
> > > > > >
> > > > > > On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > > > > >
> > > > > > > On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > > > > > > > This file reads from the environment but does not include the correct
> > > > > > > > header. Update it.
> > > > > > > >
> > > > > > > > Drop the unnecessary config.h while we are here.
> > > > > > >
> > > > > > > Are you sure about that? It was explicitly added in commit
> > > > > > > ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> > > > > > > includes") probably because of CFG_SYS_... usage.
> > > > > >
> > > > > > Well I assumed it wouldn't build if it had it, but perhaps that is
> > > > > > incorrect? I understood that CFG_ things had to be values and you
> > > > > > couldn't #idef them?
> > > > >
> > > > > The cases where in that series I added config.h were for good reason,
> > > > > either failure to build or tricky size change reasons. All were
> > > > > intentional. An audit-and-remove of config.h would be it's own series as
> > > > > yes, there's perhaps not the need now as whatever complex chain was
> > > > > unwound.
> > > >
> > > > Oh dear, OK. I'll respin the series.
> > > >
> > > > Hmm but I see you have sent a series that does some similar tweak[1].
> > > > What was the goal there?
> > >
> > > I fixed your problem. Please don't bother re-spinning this series, it's
> > > not clear what problems it's solving correctly.
> >
> > OK thanks. The problem was trying to include net.h in include/efi.h:
> >
> > https://patchwork.ozlabs.org/project/uboot/cover/20250501010456.3930701-1-sjg@chromium.org/
>
> Adding headers to headers needs extra care (so that we don't end up with
> massive implicit include chains).
>
> > So long as that works, we're fine. Having said that, even if it were a
> > problem, we could always refactor things to put the Ethernet decls in
> > a separate header.
>
> Yes, if there's some problem down the line then some refactoring is
> likely the thing to look at, not adding more headers to C files (the
> right path is to unwind the header chain and fix C files, your series
> doesn't remove env.h from any header).

I hope we haven't got confused here.

My series removed env.h from being *transitively* included. I had to
add it to C files due to that.

Your series doesn't help with including net.h in efi.h - you can try
that and see that it still fails.

But as I said, we can move the decls into a separate file.

Regards,
Simon

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-03  2:10                 ` Simon Glass
@ 2025-05-03 16:30                   ` Tom Rini
  2025-05-03 16:37                     ` Tom Rini
  0 siblings, 1 reply; 47+ messages in thread
From: Tom Rini @ 2025-05-03 16:30 UTC (permalink / raw)
  To: Simon Glass
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

[-- Attachment #1: Type: text/plain, Size: 3807 bytes --]

On Fri, May 02, 2025 at 08:10:30PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Fri, 2 May 2025 at 09:04, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Fri, May 02, 2025 at 08:52:37AM -0600, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Fri, 2 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Fri, May 02, 2025 at 07:11:56AM -0600, Simon Glass wrote:
> > > > > Hi Tom,
> > > > >
> > > > > On Thu, 1 May 2025 at 09:33, Tom Rini <trini@konsulko.com> wrote:
> > > > > >
> > > > > > On Thu, May 01, 2025 at 09:04:45AM -0600, Simon Glass wrote:
> > > > > > > Hi Tom,
> > > > > > >
> > > > > > > On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > > > > > >
> > > > > > > > On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > > > > > > > > This file reads from the environment but does not include the correct
> > > > > > > > > header. Update it.
> > > > > > > > >
> > > > > > > > > Drop the unnecessary config.h while we are here.
> > > > > > > >
> > > > > > > > Are you sure about that? It was explicitly added in commit
> > > > > > > > ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> > > > > > > > includes") probably because of CFG_SYS_... usage.
> > > > > > >
> > > > > > > Well I assumed it wouldn't build if it had it, but perhaps that is
> > > > > > > incorrect? I understood that CFG_ things had to be values and you
> > > > > > > couldn't #idef them?
> > > > > >
> > > > > > The cases where in that series I added config.h were for good reason,
> > > > > > either failure to build or tricky size change reasons. All were
> > > > > > intentional. An audit-and-remove of config.h would be it's own series as
> > > > > > yes, there's perhaps not the need now as whatever complex chain was
> > > > > > unwound.
> > > > >
> > > > > Oh dear, OK. I'll respin the series.
> > > > >
> > > > > Hmm but I see you have sent a series that does some similar tweak[1].
> > > > > What was the goal there?
> > > >
> > > > I fixed your problem. Please don't bother re-spinning this series, it's
> > > > not clear what problems it's solving correctly.
> > >
> > > OK thanks. The problem was trying to include net.h in include/efi.h:
> > >
> > > https://patchwork.ozlabs.org/project/uboot/cover/20250501010456.3930701-1-sjg@chromium.org/
> >
> > Adding headers to headers needs extra care (so that we don't end up with
> > massive implicit include chains).
> >
> > > So long as that works, we're fine. Having said that, even if it were a
> > > problem, we could always refactor things to put the Ethernet decls in
> > > a separate header.
> >
> > Yes, if there's some problem down the line then some refactoring is
> > likely the thing to look at, not adding more headers to C files (the
> > right path is to unwind the header chain and fix C files, your series
> > doesn't remove env.h from any header).
> 
> I hope we haven't got confused here.
> 
> My series removed env.h from being *transitively* included. I had to
> add it to C files due to that.

Yes, which may or may not be helpful. A transitive include in a C file
is not terrible, otherwise many files will have 20+ includes. A
transitive include in header file, which in turn pulls in another which
pulls in another, is a problem. And the header should be unwound and C
files then fixed.

> Your series doesn't help with including net.h in efi.h - you can try
> that and see that it still fails.

Perhaps I took it out too quickly then, I'd have sworn I build sandbox
with that change added.

> But as I said, we can move the decls into a separate file.

Yes, that might be the right answer, depending on the problem. I'm not
sure adding more headers to headers is good in general.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-03 16:30                   ` Tom Rini
@ 2025-05-03 16:37                     ` Tom Rini
  2025-05-03 21:27                       ` Simon Glass
  0 siblings, 1 reply; 47+ messages in thread
From: Tom Rini @ 2025-05-03 16:37 UTC (permalink / raw)
  To: Simon Glass
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

[-- Attachment #1: Type: text/plain, Size: 4082 bytes --]

On Sat, May 03, 2025 at 10:30:35AM -0600, Tom Rini wrote:
> On Fri, May 02, 2025 at 08:10:30PM -0600, Simon Glass wrote:
> > Hi Tom,
> > 
> > On Fri, 2 May 2025 at 09:04, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Fri, May 02, 2025 at 08:52:37AM -0600, Simon Glass wrote:
> > > > Hi Tom,
> > > >
> > > > On Fri, 2 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > > >
> > > > > On Fri, May 02, 2025 at 07:11:56AM -0600, Simon Glass wrote:
> > > > > > Hi Tom,
> > > > > >
> > > > > > On Thu, 1 May 2025 at 09:33, Tom Rini <trini@konsulko.com> wrote:
> > > > > > >
> > > > > > > On Thu, May 01, 2025 at 09:04:45AM -0600, Simon Glass wrote:
> > > > > > > > Hi Tom,
> > > > > > > >
> > > > > > > > On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > > > > > > >
> > > > > > > > > On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > > > > > > > > > This file reads from the environment but does not include the correct
> > > > > > > > > > header. Update it.
> > > > > > > > > >
> > > > > > > > > > Drop the unnecessary config.h while we are here.
> > > > > > > > >
> > > > > > > > > Are you sure about that? It was explicitly added in commit
> > > > > > > > > ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> > > > > > > > > includes") probably because of CFG_SYS_... usage.
> > > > > > > >
> > > > > > > > Well I assumed it wouldn't build if it had it, but perhaps that is
> > > > > > > > incorrect? I understood that CFG_ things had to be values and you
> > > > > > > > couldn't #idef them?
> > > > > > >
> > > > > > > The cases where in that series I added config.h were for good reason,
> > > > > > > either failure to build or tricky size change reasons. All were
> > > > > > > intentional. An audit-and-remove of config.h would be it's own series as
> > > > > > > yes, there's perhaps not the need now as whatever complex chain was
> > > > > > > unwound.
> > > > > >
> > > > > > Oh dear, OK. I'll respin the series.
> > > > > >
> > > > > > Hmm but I see you have sent a series that does some similar tweak[1].
> > > > > > What was the goal there?
> > > > >
> > > > > I fixed your problem. Please don't bother re-spinning this series, it's
> > > > > not clear what problems it's solving correctly.
> > > >
> > > > OK thanks. The problem was trying to include net.h in include/efi.h:
> > > >
> > > > https://patchwork.ozlabs.org/project/uboot/cover/20250501010456.3930701-1-sjg@chromium.org/
> > >
> > > Adding headers to headers needs extra care (so that we don't end up with
> > > massive implicit include chains).
> > >
> > > > So long as that works, we're fine. Having said that, even if it were a
> > > > problem, we could always refactor things to put the Ethernet decls in
> > > > a separate header.
> > >
> > > Yes, if there's some problem down the line then some refactoring is
> > > likely the thing to look at, not adding more headers to C files (the
> > > right path is to unwind the header chain and fix C files, your series
> > > doesn't remove env.h from any header).
> > 
> > I hope we haven't got confused here.
> > 
> > My series removed env.h from being *transitively* included. I had to
> > add it to C files due to that.
> 
> Yes, which may or may not be helpful. A transitive include in a C file
> is not terrible, otherwise many files will have 20+ includes. A
> transitive include in header file, which in turn pulls in another which
> pulls in another, is a problem. And the header should be unwound and C
> files then fixed.
> 
> > Your series doesn't help with including net.h in efi.h - you can try
> > that and see that it still fails.
> 
> Perhaps I took it out too quickly then, I'd have sworn I build sandbox
> with that change added.

Yeah, I guess I removed it too quick and missed fixing
drivers/usb/gadget/epautoconf.c still, along with whatever the right
answer is for unwinding the exfat oddity. Likely seeing what the pain is
over using the normal byteswap headers instead.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-03 16:37                     ` Tom Rini
@ 2025-05-03 21:27                       ` Simon Glass
  2025-05-05 14:43                         ` Tom Rini
  0 siblings, 1 reply; 47+ messages in thread
From: Simon Glass @ 2025-05-03 21:27 UTC (permalink / raw)
  To: Tom Rini
  Cc: U-Boot Mailing List, Jerome Forissier, Marek Vasut, Oliver Graute

Hi Tom,

On Sat, 3 May 2025 at 10:37, Tom Rini <trini@konsulko.com> wrote:
>
> On Sat, May 03, 2025 at 10:30:35AM -0600, Tom Rini wrote:
> > On Fri, May 02, 2025 at 08:10:30PM -0600, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Fri, 2 May 2025 at 09:04, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Fri, May 02, 2025 at 08:52:37AM -0600, Simon Glass wrote:
> > > > > Hi Tom,
> > > > >
> > > > > On Fri, 2 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > > > >
> > > > > > On Fri, May 02, 2025 at 07:11:56AM -0600, Simon Glass wrote:
> > > > > > > Hi Tom,
> > > > > > >
> > > > > > > On Thu, 1 May 2025 at 09:33, Tom Rini <trini@konsulko.com> wrote:
> > > > > > > >
> > > > > > > > On Thu, May 01, 2025 at 09:04:45AM -0600, Simon Glass wrote:
> > > > > > > > > Hi Tom,
> > > > > > > > >
> > > > > > > > > On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > > > > > > > > > > This file reads from the environment but does not include the correct
> > > > > > > > > > > header. Update it.
> > > > > > > > > > >
> > > > > > > > > > > Drop the unnecessary config.h while we are here.
> > > > > > > > > >
> > > > > > > > > > Are you sure about that? It was explicitly added in commit
> > > > > > > > > > ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> > > > > > > > > > includes") probably because of CFG_SYS_... usage.
> > > > > > > > >
> > > > > > > > > Well I assumed it wouldn't build if it had it, but perhaps that is
> > > > > > > > > incorrect? I understood that CFG_ things had to be values and you
> > > > > > > > > couldn't #idef them?
> > > > > > > >
> > > > > > > > The cases where in that series I added config.h were for good reason,
> > > > > > > > either failure to build or tricky size change reasons. All were
> > > > > > > > intentional. An audit-and-remove of config.h would be it's own series as
> > > > > > > > yes, there's perhaps not the need now as whatever complex chain was
> > > > > > > > unwound.
> > > > > > >
> > > > > > > Oh dear, OK. I'll respin the series.
> > > > > > >
> > > > > > > Hmm but I see you have sent a series that does some similar tweak[1].
> > > > > > > What was the goal there?
> > > > > >
> > > > > > I fixed your problem. Please don't bother re-spinning this series, it's
> > > > > > not clear what problems it's solving correctly.
> > > > >
> > > > > OK thanks. The problem was trying to include net.h in include/efi.h:
> > > > >
> > > > > https://patchwork.ozlabs.org/project/uboot/cover/20250501010456.3930701-1-sjg@chromium.org/
> > > >
> > > > Adding headers to headers needs extra care (so that we don't end up with
> > > > massive implicit include chains).
> > > >
> > > > > So long as that works, we're fine. Having said that, even if it were a
> > > > > problem, we could always refactor things to put the Ethernet decls in
> > > > > a separate header.
> > > >
> > > > Yes, if there's some problem down the line then some refactoring is
> > > > likely the thing to look at, not adding more headers to C files (the
> > > > right path is to unwind the header chain and fix C files, your series
> > > > doesn't remove env.h from any header).
> > >
> > > I hope we haven't got confused here.
> > >
> > > My series removed env.h from being *transitively* included. I had to
> > > add it to C files due to that.
> >
> > Yes, which may or may not be helpful. A transitive include in a C file
> > is not terrible, otherwise many files will have 20+ includes. A
> > transitive include in header file, which in turn pulls in another which
> > pulls in another, is a problem. And the header should be unwound and C
> > files then fixed.
> >
> > > Your series doesn't help with including net.h in efi.h - you can try
> > > that and see that it still fails.
> >
> > Perhaps I took it out too quickly then, I'd have sworn I build sandbox
> > with that change added.
>
> Yeah, I guess I removed it too quick and missed fixing
> drivers/usb/gadget/epautoconf.c still, along with whatever the right
> answer is for unwinding the exfat oddity. Likely seeing what the pain is
> over using the normal byteswap headers instead.

OK, are you thinking of taking a look at that? Or do you think it
would be better to change exfat to use the linux/byteorder stuff
(which I somewhat prefer)?

Regards,
Simon

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 17/22] elf: Only use network environment-variables if net enabled
  2025-05-01  1:04 ` [PATCH v2 17/22] elf: Only use network environment-variables if net enabled Simon Glass
@ 2025-05-05 12:37   ` Jerome Forissier
  0 siblings, 0 replies; 47+ messages in thread
From: Jerome Forissier @ 2025-05-05 12:37 UTC (permalink / raw)
  To: Simon Glass, U-Boot Mailing List
  Cc: Tom Rini, Daniel Palmer, Maxim Moskalets, Sughosh Ganu



On 5/1/25 03:04, Simon Glass wrote:
> If there is no network support it doesn't make sense to try to read
> these variables. Add a condition to handle this.
> 
> This is needed so that env_get_ip() is not called when it is no-longer
> a static inline, but included in net/ code.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> (no changes since v1)
> 
>  cmd/elf.c | 41 ++++++++++++++++++++++-------------------
>  1 file changed, 22 insertions(+), 19 deletions(-)
[...]

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>

Thanks,
-- 
Jerome

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 19/22] net: Include string.h in net-legacy.h
  2025-05-01  1:04 ` [PATCH v2 19/22] net: Include string.h in net-legacy.h Simon Glass
@ 2025-05-05 12:38   ` Jerome Forissier
  0 siblings, 0 replies; 47+ messages in thread
From: Jerome Forissier @ 2025-05-05 12:38 UTC (permalink / raw)
  To: Simon Glass, U-Boot Mailing List; +Cc: Tom Rini, Joe Hershberger, Marek Vasut



On 5/1/25 03:04, Simon Glass wrote:
> This file uses memcpy() but does not include the header file. Update it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> (no changes since v1)
> 
>  include/net-legacy.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/net-legacy.h b/include/net-legacy.h
> index 1f62ebff51d..a43ab9db589 100644
> --- a/include/net-legacy.h
> +++ b/include/net-legacy.h
> @@ -17,6 +17,7 @@
>  #include <log.h>
>  #include <time.h>
>  #include <linux/if_ether.h>
> +#include <linux/string.h>
>  
>  struct bd_info;
>  struct cmd_tbl;

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>

Thanks,
-- 
Jerome

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 02/22] congatec: Include env.h to permit reading the environment
  2025-05-03 21:27                       ` Simon Glass
@ 2025-05-05 14:43                         ` Tom Rini
  0 siblings, 0 replies; 47+ messages in thread
From: Tom Rini @ 2025-05-05 14:43 UTC (permalink / raw)
  To: Simon Glass, Marek Vasut
  Cc: U-Boot Mailing List, Jerome Forissier, Oliver Graute

[-- Attachment #1: Type: text/plain, Size: 4844 bytes --]

On Sat, May 03, 2025 at 03:27:50PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Sat, 3 May 2025 at 10:37, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sat, May 03, 2025 at 10:30:35AM -0600, Tom Rini wrote:
> > > On Fri, May 02, 2025 at 08:10:30PM -0600, Simon Glass wrote:
> > > > Hi Tom,
> > > >
> > > > On Fri, 2 May 2025 at 09:04, Tom Rini <trini@konsulko.com> wrote:
> > > > >
> > > > > On Fri, May 02, 2025 at 08:52:37AM -0600, Simon Glass wrote:
> > > > > > Hi Tom,
> > > > > >
> > > > > > On Fri, 2 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > > > > >
> > > > > > > On Fri, May 02, 2025 at 07:11:56AM -0600, Simon Glass wrote:
> > > > > > > > Hi Tom,
> > > > > > > >
> > > > > > > > On Thu, 1 May 2025 at 09:33, Tom Rini <trini@konsulko.com> wrote:
> > > > > > > > >
> > > > > > > > > On Thu, May 01, 2025 at 09:04:45AM -0600, Simon Glass wrote:
> > > > > > > > > > Hi Tom,
> > > > > > > > > >
> > > > > > > > > > On Thu, 1 May 2025 at 08:06, Tom Rini <trini@konsulko.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Wed, Apr 30, 2025 at 07:04:27PM -0600, Simon Glass wrote:
> > > > > > > > > > > > This file reads from the environment but does not include the correct
> > > > > > > > > > > > header. Update it.
> > > > > > > > > > > >
> > > > > > > > > > > > Drop the unnecessary config.h while we are here.
> > > > > > > > > > >
> > > > > > > > > > > Are you sure about that? It was explicitly added in commit
> > > > > > > > > > > ab61cc7d98f6 ("board: congatec: Remove <common.h> and add needed
> > > > > > > > > > > includes") probably because of CFG_SYS_... usage.
> > > > > > > > > >
> > > > > > > > > > Well I assumed it wouldn't build if it had it, but perhaps that is
> > > > > > > > > > incorrect? I understood that CFG_ things had to be values and you
> > > > > > > > > > couldn't #idef them?
> > > > > > > > >
> > > > > > > > > The cases where in that series I added config.h were for good reason,
> > > > > > > > > either failure to build or tricky size change reasons. All were
> > > > > > > > > intentional. An audit-and-remove of config.h would be it's own series as
> > > > > > > > > yes, there's perhaps not the need now as whatever complex chain was
> > > > > > > > > unwound.
> > > > > > > >
> > > > > > > > Oh dear, OK. I'll respin the series.
> > > > > > > >
> > > > > > > > Hmm but I see you have sent a series that does some similar tweak[1].
> > > > > > > > What was the goal there?
> > > > > > >
> > > > > > > I fixed your problem. Please don't bother re-spinning this series, it's
> > > > > > > not clear what problems it's solving correctly.
> > > > > >
> > > > > > OK thanks. The problem was trying to include net.h in include/efi.h:
> > > > > >
> > > > > > https://patchwork.ozlabs.org/project/uboot/cover/20250501010456.3930701-1-sjg@chromium.org/
> > > > >
> > > > > Adding headers to headers needs extra care (so that we don't end up with
> > > > > massive implicit include chains).
> > > > >
> > > > > > So long as that works, we're fine. Having said that, even if it were a
> > > > > > problem, we could always refactor things to put the Ethernet decls in
> > > > > > a separate header.
> > > > >
> > > > > Yes, if there's some problem down the line then some refactoring is
> > > > > likely the thing to look at, not adding more headers to C files (the
> > > > > right path is to unwind the header chain and fix C files, your series
> > > > > doesn't remove env.h from any header).
> > > >
> > > > I hope we haven't got confused here.
> > > >
> > > > My series removed env.h from being *transitively* included. I had to
> > > > add it to C files due to that.
> > >
> > > Yes, which may or may not be helpful. A transitive include in a C file
> > > is not terrible, otherwise many files will have 20+ includes. A
> > > transitive include in header file, which in turn pulls in another which
> > > pulls in another, is a problem. And the header should be unwound and C
> > > files then fixed.
> > >
> > > > Your series doesn't help with including net.h in efi.h - you can try
> > > > that and see that it still fails.
> > >
> > > Perhaps I took it out too quickly then, I'd have sworn I build sandbox
> > > with that change added.
> >
> > Yeah, I guess I removed it too quick and missed fixing
> > drivers/usb/gadget/epautoconf.c still, along with whatever the right
> > answer is for unwinding the exfat oddity. Likely seeing what the pain is
> > over using the normal byteswap headers instead.
> 
> OK, are you thinking of taking a look at that? Or do you think it
> would be better to change exfat to use the linux/byteorder stuff
> (which I somewhat prefer)?

Yes, I would like to hear Marek's thoughts on changing exfat to use the
normal byteswap functions.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 09/22] advantech: Include env.h in imx8qm_dmsse20_a1
  2025-05-01  1:04 ` [PATCH v2 09/22] advantech: Include env.h in imx8qm_dmsse20_a1 Simon Glass
@ 2025-05-08 10:27   ` Oliver Graute
  0 siblings, 0 replies; 47+ messages in thread
From: Oliver Graute @ 2025-05-08 10:27 UTC (permalink / raw)
  To: Simon Glass; +Cc: U-Boot Mailing List, Tom Rini, Jerome Forissier

On 30/04/25, Simon Glass wrote:
> This file uses the environment but does not include the header file.
> Update it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> (no changes since v1)
> 
>  board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c b/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
> index 50b35db5f6c..accd300df04 100644
> --- a/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
> +++ b/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
> @@ -4,6 +4,7 @@
>   * Copyright 2019-2023 Kococonnector GmbH
>   */
>  
> +#include <env.h>
>  #include <errno.h>
>  #include <linux/libfdt.h>
>  #include <asm/io.h>
> -- 
> 2.43.0

Acked-by: Oliver Graute <oliver.graute@kococonnector.com>

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v2 12/22] amlogic: Include env.h to permit reading the environment
  2025-05-01  1:04 ` [PATCH v2 12/22] amlogic: " Simon Glass
@ 2025-05-08 16:18   ` Viacheslav
  0 siblings, 0 replies; 47+ messages in thread
From: Viacheslav @ 2025-05-08 16:18 UTC (permalink / raw)
  To: u-boot-amlogic, sjg, U-Boot Mailing List; +Cc: Tom Rini, Jerome Forissier



01/05/2025 04.04, Simon Glass via groups.io wrote:
> This file reads from the environment but does not include the correct
> header. Update it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> (no changes since v1)
> 
>   board/amlogic/jethub-j100/jethub-j100.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c
> index b770a1f8c53..9e87fb9f9d7 100644
> --- a/board/amlogic/jethub-j100/jethub-j100.c
> +++ b/board/amlogic/jethub-j100/jethub-j100.c
> @@ -5,6 +5,7 @@
>    */
>   
>   #include <dm.h>
> +#include <env.h>
>   #include <init.h>
>   #include <net.h>
>   #include <asm/io.h>

Reviewed-by: Viacheslav Bocharov <adeep@lexina.in>


^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2025-05-08 16:19 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-01  1:04 [PATCH v2 00/22] Deal with exfat versus byteorder Simon Glass
2025-05-01  1:04 ` [PATCH v2 01/22] net: Use a forward declaration for cmd_tbl in net-common.h Simon Glass
2025-05-01  1:04 ` [PATCH v2 02/22] congatec: Include env.h to permit reading the environment Simon Glass
2025-05-01 14:06   ` Tom Rini
2025-05-01 15:04     ` Simon Glass
2025-05-01 15:33       ` Tom Rini
2025-05-02 13:11         ` Simon Glass
2025-05-02 14:06           ` Tom Rini
2025-05-02 14:52             ` Simon Glass
2025-05-02 15:04               ` Tom Rini
2025-05-03  2:10                 ` Simon Glass
2025-05-03 16:30                   ` Tom Rini
2025-05-03 16:37                     ` Tom Rini
2025-05-03 21:27                       ` Simon Glass
2025-05-05 14:43                         ` Tom Rini
2025-05-01  1:04 ` [PATCH v2 03/22] dhelectronics: " Simon Glass
2025-05-01  1:04 ` [PATCH v2 04/22] imx8ulp_evk: " Simon Glass
2025-05-01  1:04 ` [PATCH v2 05/22] venice: " Simon Glass
2025-05-01  1:04 ` [PATCH v2 06/22] phytec: " Simon Glass
2025-05-01  1:04 ` [PATCH v2 07/22] ronetix: " Simon Glass
2025-05-01  1:04 ` [PATCH v2 08/22] toradex: " Simon Glass
2025-05-01  1:04 ` [PATCH v2 09/22] advantech: Include env.h in imx8qm_dmsse20_a1 Simon Glass
2025-05-08 10:27   ` Oliver Graute
2025-05-01  1:04 ` [PATCH v2 10/22] tegra: Include env.h to permit reading the environment Simon Glass
2025-05-01  1:04 ` [PATCH v2 11/22] synology: " Simon Glass
2025-05-01  3:21   ` Tony Dinh
2025-05-02  8:17   ` Stefan Roese
2025-05-01  1:04 ` [PATCH v2 12/22] amlogic: " Simon Glass
2025-05-08 16:18   ` Viacheslav
2025-05-01  1:04 ` [PATCH v2 13/22] freescale: " Simon Glass
2025-05-01  1:04 ` [PATCH v2 14/22] google: " Simon Glass
2025-05-01  1:04 ` [PATCH v2 15/22] liebherr: " Simon Glass
2025-05-01  6:17   ` Lukasz Majewski
2025-05-01  1:04 ` [PATCH v2 16/22] technexion: " Simon Glass
2025-05-01  1:04 ` [PATCH v2 17/22] elf: Only use network environment-variables if net enabled Simon Glass
2025-05-05 12:37   ` Jerome Forissier
2025-05-01  1:04 ` [PATCH v2 18/22] net: Include byteorder in net6.h Simon Glass
2025-05-01  1:04 ` [PATCH v2 19/22] net: Include string.h in net-legacy.h Simon Glass
2025-05-05 12:38   ` Jerome Forissier
2025-05-01  1:04 ` [PATCH v2 20/22] net: Include env.h in pcap.c Simon Glass
2025-05-01  1:04 ` [PATCH v2 21/22] net: dc2114x: Include env.h to permit reading the environment Simon Glass
2025-05-01  1:04 ` [PATCH v2 22/22] net: Move env_get_ip() out of the header file Simon Glass
2025-05-01  2:02 ` [PATCH v2 00/22] Deal with exfat versus byteorder Marek Vasut
2025-05-01 12:07   ` Simon Glass
2025-05-01 14:17     ` Tom Rini
2025-05-01 15:03       ` Simon Glass
2025-05-01 15:35         ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.