[PATHv2 0/9] net fixes prior lwip

Add small net fixes prior lwip patches.
v2: - rebase on the top of master tree with descriptions fixes suggested in review comments.
Maxim Uvarov (9): test_net: print out net list net: sandbox: fix NULL pointer derefences net/smc911x: fix return from smc911x_send sandbox: eth-raw-os: successful return code is 0 driver/net/rtl8139: remove debug print mach-socfpga: do not overlap defines with lwip bcm_ns3: use device specific naming for variables omap3: use device specific naming for mem_init Makefile: add dtbs to clean
Makefile | 3 ++- arch/arm/include/asm/arch-omap3/mem.h | 2 +- arch/arm/mach-omap2/omap3/board.c | 2 +- arch/arm/mach-omap2/omap3/emif4.c | 4 ++-- arch/arm/mach-omap2/omap3/sdrc.c | 6 +++--- arch/arm/mach-socfpga/include/mach/handoff_soc64.h | 6 ------ arch/arm/mach-socfpga/wrap_handoff_soc64.c | 9 +++++++++ arch/sandbox/cpu/eth-raw-os.c | 2 +- drivers/net/rtl8139.c | 2 +- drivers/net/sandbox.c | 3 +++ drivers/net/smc911x.c | 2 +- include/configs/bcm_ns3.h | 6 +++--- test/py/tests/test_net.py | 2 ++ 13 files changed, 29 insertions(+), 20 deletions(-)

Printing net list is useful in CI log files.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org --- test/py/tests/test_net.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/test/py/tests/test_net.py b/test/py/tests/test_net.py index b2241ae6a4..cd5b791a6a 100644 --- a/test/py/tests/test_net.py +++ b/test/py/tests/test_net.py @@ -96,6 +96,8 @@ def test_net_pre_commands(u_boot_console): if init_pci: u_boot_console.run_command('pci enum')
+ u_boot_console.run_command('net list') + @pytest.mark.buildconfigspec('cmd_dhcp') def test_net_dhcp(u_boot_console): """Test the dhcp command.

On Mon, Dec 25, 2023 at 3:41 PM Maxim Uvarov maxim.uvarov@linaro.org wrote:
Printing net list is useful in CI log files.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
test/py/tests/test_net.py | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org

Add additional checks for NULL pointers.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org --- drivers/net/sandbox.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c index 13022addb6..d91935e032 100644 --- a/drivers/net/sandbox.c +++ b/drivers/net/sandbox.c @@ -65,6 +65,9 @@ int sandbox_eth_arp_req_to_reply(struct udevice *dev, void *packet, struct ethernet_hdr *eth_recv; struct arp_hdr *arp_recv;
+ if (!priv) + return -EAGAIN; + if (ntohs(eth->et_protlen) != PROT_ARP) return -EAGAIN;

On 12/25/23 10:39, Maxim Uvarov wrote:
Add additional checks for NULL pointers.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
drivers/net/sandbox.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c index 13022addb6..d91935e032 100644 --- a/drivers/net/sandbox.c +++ b/drivers/net/sandbox.c @@ -65,6 +65,9 @@ int sandbox_eth_arp_req_to_reply(struct udevice *dev, void *packet, struct ethernet_hdr *eth_recv; struct arp_hdr *arp_recv;
- if (!priv)
return -EAGAIN;
When can priv be NULL?
--Sean
if (ntohs(eth->et_protlen) != PROT_ARP) return -EAGAIN;

On Tue, 26 Dec 2023 at 04:43, Sean Anderson seanga2@gmail.com wrote:
On 12/25/23 10:39, Maxim Uvarov wrote:
Add additional checks for NULL pointers.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
drivers/net/sandbox.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c index 13022addb6..d91935e032 100644 --- a/drivers/net/sandbox.c +++ b/drivers/net/sandbox.c @@ -65,6 +65,9 @@ int sandbox_eth_arp_req_to_reply(struct udevice *dev,
void *packet,
struct ethernet_hdr *eth_recv; struct arp_hdr *arp_recv;
if (!priv)
return -EAGAIN;
When can priv be NULL?
--Sean
Function struct eth_sandbox_priv *priv = dev_get_priv(dev) can return NULL. If you ask why it doesn't return NULL without lwip patches and can return NULL with lwip patch while there is no clear code dependency.. Then I can not say right now and need additional investigation. But anyway the return code of dev_dev_priv() has to be checked I think.
BR, Maxim.
if (ntohs(eth->et_protlen) != PROT_ARP) return -EAGAIN;

On 12/26/23 01:18, Maxim Uvarov wrote:
On Tue, 26 Dec 2023 at 04:43, Sean Anderson <seanga2@gmail.com mailto:seanga2@gmail.com> wrote:
On 12/25/23 10:39, Maxim Uvarov wrote: > Add additional checks for NULL pointers. > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org>> > --- > drivers/net/sandbox.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c > index 13022addb6..d91935e032 100644 > --- a/drivers/net/sandbox.c > +++ b/drivers/net/sandbox.c > @@ -65,6 +65,9 @@ int sandbox_eth_arp_req_to_reply(struct udevice *dev, void *packet, > struct ethernet_hdr *eth_recv; > struct arp_hdr *arp_recv; > > + if (!priv) > + return -EAGAIN; > + When can priv be NULL? --Sean
Function struct eth_sandbox_priv *priv = dev_get_priv(dev) can return NULL. If you ask why it doesn't return NULL without lwip patches and can return NULL with lwip patch while there is no clear code dependency.. Then I can not say right now and need additional investigation. But anyway the return code of dev_dev_priv() has to be checked I think.
If you set priv_auto to a nonzero value, dev_get_priv will always return non-null and does not need to be checked. So this is a NACK from me until you can justify this.
--Sean

On Tue, 26 Dec 2023 at 12:25, Sean Anderson seanga2@gmail.com wrote:
On 12/26/23 01:18, Maxim Uvarov wrote:
On Tue, 26 Dec 2023 at 04:43, Sean Anderson <seanga2@gmail.com <mailto:
seanga2@gmail.com>> wrote:
On 12/25/23 10:39, Maxim Uvarov wrote: > Add additional checks for NULL pointers. > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org <mailto:
maxim.uvarov@linaro.org>>
> --- > drivers/net/sandbox.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c > index 13022addb6..d91935e032 100644 > --- a/drivers/net/sandbox.c > +++ b/drivers/net/sandbox.c > @@ -65,6 +65,9 @@ int sandbox_eth_arp_req_to_reply(struct udevice
*dev, void *packet,
> struct ethernet_hdr *eth_recv; > struct arp_hdr *arp_recv; > > + if (!priv) > + return -EAGAIN; > + When can priv be NULL? --Sean
Function struct eth_sandbox_priv *priv = dev_get_priv(dev) can return NULL. If you ask why it doesn't return NULL without lwip
patches and can return NULL with lwip patch while there is no clear code dependency..
Then I can not say right now and need additional investigation. But
anyway the return code of dev_dev_priv() has to be checked I think.
If you set priv_auto to a nonzero value, dev_get_priv will always return non-null and does not need to be checked. So this is a NACK from me until you can justify this.
--Sean
Ok. I will remove this patch from v3 patchset and send it separately with a more detailed description.
BR, Maxim.

return value of smc911x_send is ignored, but on sucesseful send we need return 0 and or error -ETIMEOUT, not opposite.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Tom Rini trini@konsulko.com --- drivers/net/smc911x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 5c5ad8b84a..616b7ce174 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -403,7 +403,7 @@ static int smc911x_send(struct udevice *dev, void *packet, int length)
ret = smc911x_send_common(priv, packet, length);
- return ret ? 0 : -ETIMEDOUT; + return ret ? -ETIMEDOUT : 0; }
static int smc911x_recv(struct udevice *dev, int flags, uchar **packetp)

On Mon, Dec 25, 2023 at 3:41 PM Maxim Uvarov maxim.uvarov@linaro.org wrote:
return value of smc911x_send is ignored, but on sucesseful send we need return 0 and or error -ETIMEOUT, not opposite.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Tom Rini trini@konsulko.com
drivers/net/smc911x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org

all network drivers return 0 on the successful transmission.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Simon Glass sjg@chromium.org --- arch/sandbox/cpu/eth-raw-os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sandbox/cpu/eth-raw-os.c b/arch/sandbox/cpu/eth-raw-os.c index e59b96be5f..92c35aed95 100644 --- a/arch/sandbox/cpu/eth-raw-os.c +++ b/arch/sandbox/cpu/eth-raw-os.c @@ -256,7 +256,7 @@ int sandbox_eth_raw_os_send(void *packet, int length, strerror(errno)); return -errno; } - return retval; + return 0; }
int sandbox_eth_raw_os_recv(void *packet, int *length,

debug print delays reset of the driver. Finally I see bunch of "rx error FFFF" errors in the screen. CI can not handle many prints. While network works fine there
Reproduced with: make CROSS_COMPILE=sh2-linux- r2dplus_defconfig all qemu-system-sh4 -M r2d -nographic -serial null \ -serial mon:stdio -net user,tftp=`pwd` \ -net nic,model=rtl8139 -kernel ./u-boot.bin
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org --- drivers/net/rtl8139.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index 106bc1c7ae..d8f24ec81a 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -453,7 +453,7 @@ static int rtl8139_recv_common(struct rtl8139_priv *priv, unsigned char *rxdata, RTL_STS_RXBADALIGN)) || (rx_size < ETH_ZLEN) || (rx_size > ETH_FRAME_LEN + 4)) { - printf("rx error %hX\n", rx_status); + debug("rx error %hX\n", rx_status); /* this clears all interrupts still pending */ rtl8139_reset(priv); return 0;

On Mon, Dec 25, 2023 at 3:42 PM Maxim Uvarov maxim.uvarov@linaro.org wrote:
debug print delays reset of the driver. Finally I see bunch of "rx error FFFF" errors in the screen. CI can not handle many prints. While network works fine there
Reproduced with: make CROSS_COMPILE=sh2-linux- r2dplus_defconfig all qemu-system-sh4 -M r2d -nographic -serial null \ -serial mon:stdio -net user,tftp=`pwd` \ -net nic,model=rtl8139 -kernel ./u-boot.bin
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
drivers/net/rtl8139.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org

Fix compilation issue with overlapping lwip and march defines.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org --- arch/arm/mach-socfpga/include/mach/handoff_soc64.h | 6 ------ arch/arm/mach-socfpga/wrap_handoff_soc64.c | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-socfpga/include/mach/handoff_soc64.h b/arch/arm/mach-socfpga/include/mach/handoff_soc64.h index 902fc6bfb5..9b85e5865b 100644 --- a/arch/arm/mach-socfpga/include/mach/handoff_soc64.h +++ b/arch/arm/mach-socfpga/include/mach/handoff_soc64.h @@ -78,12 +78,6 @@
#ifndef __ASSEMBLY__ #include <asm/types.h> -enum endianness { - LITTLE_ENDIAN = 0, - BIG_ENDIAN, - UNKNOWN_ENDIANNESS -}; - int socfpga_get_handoff_size(void *handoff_address); int socfpga_handoff_read(void *handoff_address, void *table, u32 table_len); #endif diff --git a/arch/arm/mach-socfpga/wrap_handoff_soc64.c b/arch/arm/mach-socfpga/wrap_handoff_soc64.c index e7cb5ea89c..df0701ec85 100644 --- a/arch/arm/mach-socfpga/wrap_handoff_soc64.c +++ b/arch/arm/mach-socfpga/wrap_handoff_soc64.c @@ -10,6 +10,15 @@ #include <errno.h> #include "log.h"
+#ifndef __ASSEMBLY__ +#include <asm/types.h> +enum endianness { + LITTLE_ENDIAN = 0, + BIG_ENDIAN, + UNKNOWN_ENDIANNESS +}; +#endif + static enum endianness check_endianness(u32 handoff) { switch (handoff) {

On Mon, Dec 25, 2023 at 3:42 PM Maxim Uvarov maxim.uvarov@linaro.org wrote:
Fix compilation issue with overlapping lwip and march defines.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
arch/arm/mach-socfpga/include/mach/handoff_soc64.h | 6 ------ arch/arm/mach-socfpga/wrap_handoff_soc64.c | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

Use device specific naming for variables so as to not overlap with common function names.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Tom Rini trini@konsulko.com Reviewed-by: Peter Robinson pbrobinson@gmail.com --- include/configs/bcm_ns3.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/configs/bcm_ns3.h b/include/configs/bcm_ns3.h index 47de4bc201..7c6e0725a6 100644 --- a/include/configs/bcm_ns3.h +++ b/include/configs/bcm_ns3.h @@ -45,11 +45,11 @@ #define PCIE_ARGS "pcie_args=pci=pcie_bus_safe pcie_ports=native vfio_pci.disable_idle_d3=1\0"
#ifdef CONFIG_BCM_SF2_ETH -#define ETH_ADDR "ethaddr=00:0A:F7:95:65:A4\0" +#define BCM_ETH_ADDR "ethaddr=00:0A:F7:95:65:A4\0" #define NET_ARGS "bgmac_platform.ethaddr=${ethaddr} " \ "ip=${ipaddr}::${gatewayip}:${netmask}::${ethif}:off" #else -#define ETH_ADDR +#define BMC_ETH_ADDR #define NET_ARGS #endif
@@ -749,7 +749,7 @@ OS_LOG_LEVEL \ EXTRA_ARGS \ PCIE_ARGS \ - ETH_ADDR \ + BMC_ETH_ADDR \ RESERVED_MEM \ SETBOOTARGS \ UPDATEME_FLASH_PARAMS \

Use device specific naming for functions so as to not overlap with common function names.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Tom Rini trini@konsulko.com --- arch/arm/include/asm/arch-omap3/mem.h | 2 +- arch/arm/mach-omap2/omap3/board.c | 2 +- arch/arm/mach-omap2/omap3/emif4.c | 4 ++-- arch/arm/mach-omap2/omap3/sdrc.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap3/mem.h b/arch/arm/include/asm/arch-omap3/mem.h index 569779c55e..fce3568eca 100644 --- a/arch/arm/include/asm/arch-omap3/mem.h +++ b/arch/arm/include/asm/arch-omap3/mem.h @@ -475,7 +475,7 @@ enum { #ifndef __ASSEMBLY__
/* Function prototypes */ -void mem_init(void); +void omap3_mem_init(void);
u32 is_mem_sdr(void); u32 mem_ok(u32 cs); diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c index 8b70251457..c76a95dd5d 100644 --- a/arch/arm/mach-omap2/omap3/board.c +++ b/arch/arm/mach-omap2/omap3/board.c @@ -216,7 +216,7 @@ void s_init(void) void board_init_f(ulong dummy) { early_system_init(); - mem_init(); + omap3_mem_init(); /* * Save the boot parameters passed from romcode. * We cannot delay the saving further than this, diff --git a/arch/arm/mach-omap2/omap3/emif4.c b/arch/arm/mach-omap2/omap3/emif4.c index 7e5a281922..4fbfb387ab 100644 --- a/arch/arm/mach-omap2/omap3/emif4.c +++ b/arch/arm/mach-omap2/omap3/emif4.c @@ -159,10 +159,10 @@ int dram_init_banksize(void) }
/* - * mem_init() - + * omap3_mem_init() - * - Initialize memory subsystem */ -void mem_init(void) +void omap3_mem_init(void) { do_emif4_init(); } diff --git a/arch/arm/mach-omap2/omap3/sdrc.c b/arch/arm/mach-omap2/omap3/sdrc.c index 5d43e7c9cf..f2a0769b9d 100644 --- a/arch/arm/mach-omap2/omap3/sdrc.c +++ b/arch/arm/mach-omap2/omap3/sdrc.c @@ -4,7 +4,7 @@ * * This file has been created after exctracting and consolidating * the SDRC related content from mem.c and board.c, also created - * generic init function (mem_init). + * generic init function (omap3_mem_init). * * Copyright (C) 2004-2010 * Texas Instruments Incorporated - https://www.ti.com/ @@ -232,11 +232,11 @@ int dram_init_banksize(void) }
/* - * mem_init - + * map3_mem_init - * - Init the sdrc chip, * - Selects CS0 and CS1, */ -void mem_init(void) +void omap3_mem_init(void) { /* only init up first bank here */ do_sdrc_init(CS0, EARLY_INIT);

On 12/25/23 10:39, Maxim Uvarov wrote:
Use device specific naming for functions so as to not overlap with common function names.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Tom Rini trini@konsulko.com
arch/arm/include/asm/arch-omap3/mem.h | 2 +- arch/arm/mach-omap2/omap3/board.c | 2 +- arch/arm/mach-omap2/omap3/emif4.c | 4 ++-- arch/arm/mach-omap2/omap3/sdrc.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap3/mem.h b/arch/arm/include/asm/arch-omap3/mem.h index 569779c55e..fce3568eca 100644 --- a/arch/arm/include/asm/arch-omap3/mem.h +++ b/arch/arm/include/asm/arch-omap3/mem.h @@ -475,7 +475,7 @@ enum { #ifndef __ASSEMBLY__
/* Function prototypes */ -void mem_init(void); +void omap3_mem_init(void);
u32 is_mem_sdr(void); u32 mem_ok(u32 cs); diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c index 8b70251457..c76a95dd5d 100644 --- a/arch/arm/mach-omap2/omap3/board.c +++ b/arch/arm/mach-omap2/omap3/board.c @@ -216,7 +216,7 @@ void s_init(void) void board_init_f(ulong dummy) { early_system_init();
- mem_init();
- omap3_mem_init(); /*
- Save the boot parameters passed from romcode.
- We cannot delay the saving further than this,
diff --git a/arch/arm/mach-omap2/omap3/emif4.c b/arch/arm/mach-omap2/omap3/emif4.c index 7e5a281922..4fbfb387ab 100644 --- a/arch/arm/mach-omap2/omap3/emif4.c +++ b/arch/arm/mach-omap2/omap3/emif4.c @@ -159,10 +159,10 @@ int dram_init_banksize(void) }
/*
- mem_init() -
*/
- omap3_mem_init() -
- Initialize memory subsystem
-void mem_init(void) +void omap3_mem_init(void) { do_emif4_init(); } diff --git a/arch/arm/mach-omap2/omap3/sdrc.c b/arch/arm/mach-omap2/omap3/sdrc.c index 5d43e7c9cf..f2a0769b9d 100644 --- a/arch/arm/mach-omap2/omap3/sdrc.c +++ b/arch/arm/mach-omap2/omap3/sdrc.c @@ -4,7 +4,7 @@
- This file has been created after exctracting and consolidating
- the SDRC related content from mem.c and board.c, also created
- generic init function (mem_init).
- generic init function (omap3_mem_init).
- Copyright (C) 2004-2010
- Texas Instruments Incorporated - https://www.ti.com/
@@ -232,11 +232,11 @@ int dram_init_banksize(void) }
/*
- mem_init -
- map3_mem_init -
nit: omap3
- Init the sdrc chip,
- Selects CS0 and CS1,
*/ -void mem_init(void) +void omap3_mem_init(void) { /* only init up first bank here */ do_sdrc_init(CS0, EARLY_INIT);

On Tue, 26 Dec 2023 at 04:49, Sean Anderson seanga2@gmail.com wrote:
On 12/25/23 10:39, Maxim Uvarov wrote:
Use device specific naming for functions so as to not overlap with common function names.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Tom Rini trini@konsulko.com
arch/arm/include/asm/arch-omap3/mem.h | 2 +- arch/arm/mach-omap2/omap3/board.c | 2 +- arch/arm/mach-omap2/omap3/emif4.c | 4 ++-- arch/arm/mach-omap2/omap3/sdrc.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap3/mem.h
b/arch/arm/include/asm/arch-omap3/mem.h
index 569779c55e..fce3568eca 100644 --- a/arch/arm/include/asm/arch-omap3/mem.h +++ b/arch/arm/include/asm/arch-omap3/mem.h @@ -475,7 +475,7 @@ enum { #ifndef __ASSEMBLY__
/* Function prototypes */ -void mem_init(void); +void omap3_mem_init(void);
u32 is_mem_sdr(void); u32 mem_ok(u32 cs); diff --git a/arch/arm/mach-omap2/omap3/board.c
b/arch/arm/mach-omap2/omap3/board.c
index 8b70251457..c76a95dd5d 100644 --- a/arch/arm/mach-omap2/omap3/board.c +++ b/arch/arm/mach-omap2/omap3/board.c @@ -216,7 +216,7 @@ void s_init(void) void board_init_f(ulong dummy) { early_system_init();
mem_init();
omap3_mem_init(); /* * Save the boot parameters passed from romcode. * We cannot delay the saving further than this,
diff --git a/arch/arm/mach-omap2/omap3/emif4.c
b/arch/arm/mach-omap2/omap3/emif4.c
index 7e5a281922..4fbfb387ab 100644 --- a/arch/arm/mach-omap2/omap3/emif4.c +++ b/arch/arm/mach-omap2/omap3/emif4.c @@ -159,10 +159,10 @@ int dram_init_banksize(void) }
/*
- mem_init() -
*/
- omap3_mem_init() -
- Initialize memory subsystem
-void mem_init(void) +void omap3_mem_init(void) { do_emif4_init(); } diff --git a/arch/arm/mach-omap2/omap3/sdrc.c
b/arch/arm/mach-omap2/omap3/sdrc.c
index 5d43e7c9cf..f2a0769b9d 100644 --- a/arch/arm/mach-omap2/omap3/sdrc.c +++ b/arch/arm/mach-omap2/omap3/sdrc.c @@ -4,7 +4,7 @@
- This file has been created after exctracting and consolidating
- the SDRC related content from mem.c and board.c, also created
- generic init function (mem_init).
- generic init function (omap3_mem_init).
- Copyright (C) 2004-2010
- Texas Instruments Incorporated - https://www.ti.com/
@@ -232,11 +232,11 @@ int dram_init_banksize(void) }
/*
- mem_init -
- map3_mem_init -
nit: omap3
thanks, will add to v3.
- Init the sdrc chip,
- Selects CS0 and CS1,
*/ -void mem_init(void) +void omap3_mem_init(void) { /* only init up first bank here */ do_sdrc_init(CS0, EARLY_INIT);

CI test checks that generated dtb has to be cleaned up.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index 220411a293..ab603191ad 100644 --- a/Makefile +++ b/Makefile @@ -2165,7 +2165,8 @@ CLEAN_FILES += include/autoconf.mk* include/bmp_logo.h include/bmp_logo_data.h \ mkimage-out.spl.mkimage mkimage.spl.mkimage imx-boot.map \ itb.fit.fit itb.fit.itb itb.map spl.map mkimage-out.rom.mkimage \ mkimage.rom.mkimage mkimage-in-simple-bin* rom.map simple-bin* \ - idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb + idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb \ + ./*/*.dtb *.dtb
# Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include/generated spl tpl vpl \

Hi Maxim,
On Mon, Dec 25, 2023 at 3:42 PM Maxim Uvarov maxim.uvarov@linaro.org wrote:
CI test checks that generated dtb has to be cleaned up.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index 220411a293..ab603191ad 100644 --- a/Makefile +++ b/Makefile @@ -2165,7 +2165,8 @@ CLEAN_FILES += include/autoconf.mk* include/bmp_logo.h include/bmp_logo_data.h \ mkimage-out.spl.mkimage mkimage.spl.mkimage imx-boot.map \ itb.fit.fit itb.fit.itb itb.map spl.map mkimage-out.rom.mkimage \ mkimage.rom.mkimage mkimage-in-simple-bin* rom.map simple-bin* \
idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb
idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb \
./*/*.dtb *.dtb
# Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include/generated spl tpl vpl \ -- 2.30.2
Shouldn't this be handled with CLEAN_FILES in arch/xxx/dts ?
Regards, Simon

On Tue, 26 Dec 2023 at 15:50, Simon Glass sjg@chromium.org wrote:
Hi Maxim,
On Mon, Dec 25, 2023 at 3:42 PM Maxim Uvarov maxim.uvarov@linaro.org wrote:
CI test checks that generated dtb has to be cleaned up.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index 220411a293..ab603191ad 100644 --- a/Makefile +++ b/Makefile @@ -2165,7 +2165,8 @@ CLEAN_FILES += include/autoconf.mk*
include/bmp_logo.h include/bmp_logo_data.h \
mkimage-out.spl.mkimage mkimage.spl.mkimage imx-boot.map \ itb.fit.fit itb.fit.itb itb.map spl.map
mkimage-out.rom.mkimage \
mkimage.rom.mkimage mkimage-in-simple-bin* rom.map
simple-bin* \
idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb
idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb \
./*/*.dtb *.dtb
# Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include/generated spl tpl vpl \ -- 2.30.2
Shouldn't this be handled with CLEAN_FILES in arch/xxx/dts ?
Regards, Simon
I don't know. It looks like CLEAN_FILES is almost not used inside ./arch directory. Only 1 place where it appears:
fgrep -r CLEAN_FILES ./arch/ ./arch/arm/mach-rmobile/Makefile:CLEAN_FILES += u-boot-spl.scif
BR, Maxim.

On Tue, Dec 26, 2023 at 06:27:58PM +0600, Maxim Uvarov wrote:
On Tue, 26 Dec 2023 at 15:50, Simon Glass sjg@chromium.org wrote:
Hi Maxim,
On Mon, Dec 25, 2023 at 3:42 PM Maxim Uvarov maxim.uvarov@linaro.org wrote:
CI test checks that generated dtb has to be cleaned up.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index 220411a293..ab603191ad 100644 --- a/Makefile +++ b/Makefile @@ -2165,7 +2165,8 @@ CLEAN_FILES += include/autoconf.mk*
include/bmp_logo.h include/bmp_logo_data.h \
mkimage-out.spl.mkimage mkimage.spl.mkimage imx-boot.map \ itb.fit.fit itb.fit.itb itb.map spl.map
mkimage-out.rom.mkimage \
mkimage.rom.mkimage mkimage-in-simple-bin* rom.map
simple-bin* \
idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb
idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb \
./*/*.dtb *.dtb
# Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include/generated spl tpl vpl \ -- 2.30.2
Shouldn't this be handled with CLEAN_FILES in arch/xxx/dts ?
Regards, Simon
I don't know. It looks like CLEAN_FILES is almost not used inside ./arch directory. Only 1 place where it appears:
fgrep -r CLEAN_FILES ./arch/ ./arch/arm/mach-rmobile/Makefile:CLEAN_FILES += u-boot-spl.scif
I see that our top-level clean target is missing dtb related targets like the linux kernel has, and that's how this should be fixed.

On Tue, 26 Dec 2023 at 20:26, Tom Rini trini@konsulko.com wrote:
On Tue, Dec 26, 2023 at 06:27:58PM +0600, Maxim Uvarov wrote:
On Tue, 26 Dec 2023 at 15:50, Simon Glass sjg@chromium.org wrote:
Hi Maxim,
On Mon, Dec 25, 2023 at 3:42 PM Maxim Uvarov maxim.uvarov@linaro.org wrote:
CI test checks that generated dtb has to be cleaned up.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index 220411a293..ab603191ad 100644 --- a/Makefile +++ b/Makefile @@ -2165,7 +2165,8 @@ CLEAN_FILES += include/autoconf.mk*
include/bmp_logo.h include/bmp_logo_data.h \
mkimage-out.spl.mkimage mkimage.spl.mkimage
imx-boot.map \
itb.fit.fit itb.fit.itb itb.map spl.map
mkimage-out.rom.mkimage \
mkimage.rom.mkimage mkimage-in-simple-bin* rom.map
simple-bin* \
idbloader-spi.img lib/efi_loader/helloworld_efi.S
*.itb
idbloader-spi.img lib/efi_loader/helloworld_efi.S
*.itb \
./*/*.dtb *.dtb
# Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include/generated spl tpl vpl \ -- 2.30.2
Shouldn't this be handled with CLEAN_FILES in arch/xxx/dts ?
Regards, Simon
I don't know. It looks like CLEAN_FILES is almost not used inside ./arch directory. Only 1 place where it appears:
fgrep -r CLEAN_FILES ./arch/ ./arch/arm/mach-rmobile/Makefile:CLEAN_FILES += u-boot-spl.scif
I see that our top-level clean target is missing dtb related targets like the linux kernel has, and that's how this should be fixed.
-- Tom
If I understand right you just refers to kernel's top level Makefile clean: find -o -name '*.dtb' -o -name '*.dtbo' \
-o -name '*.dtb.S' -o -name '*.dtbo.S' \ | xargs rm -rf
I will fix it in that way in v3.
BR, Maxim.
participants (4)
-
Maxim Uvarov
-
Sean Anderson
-
Simon Glass
-
Tom Rini