configs: keystone2: Remove unused SPL_MALLOC_F_SIZE and KEYSTONE_SPL_STACK_SIZE
Subsystems (6)
PATCH 1/3 configs: keystone2: Remove unused SPL_MALLOC_F_SIZE and KEYSTONE_SPL_STACK_SIZE
These are leftover definitions. While here cleanup some leftover comments.
--- include/configs/ti_armv7_keystone2.h | 22 ---------------------- 1 file changed, 22 deletions(-)
include/configs/ti_armv7_keystone2.h +0 -22
@@ -9,23 +9,10 @@#ifndef __CONFIG_KS2_EVM_H#define __CONFIG_KS2_EVM_H -/* U-Boot Build Configuration */ - -/* SoC Configuration */ -/* Memory Configuration */ #define CFG_SYS_LPAE_SDRAM_BASE 0x800000000#define CFG_MAX_RAM_BANK_SIZE (2 << 30)/* 2GB */ -#ifdef CONFIG_SYS_MALLOC_F_LEN -#define SPL_MALLOC_F_SIZE CONFIG_SYS_MALLOC_F_LEN -#else -#define SPL_MALLOC_F_SIZE 0 -#endif - -/* SPL SPI Loader Configuration */ -#define KEYSTONE_SPL_STACK_SIZE (8 * 1024) -/* SRAM scratch space entries */ #define SRAM_SCRATCH_SPACE_ADDR 0xc0c23fc
@@ -53,8 +40,6 @@#define CFG_KSNET_SERDES_SGMII2_BASE KS2_SGMII_SERDES2_BASE#define CFG_KSNET_SERDES_LANES_PER_SGMII KS2_LANES_PER_SGMII_SERDES -/* EEPROM definitions */ -/* NAND Configuration */ #define CFG_SYS_NAND_MASK_CLE 0x4000#define CFG_SYS_NAND_MASK_ALE 0x2000
@@ -63,13 +48,6 @@#define CFG_SYS_NAND_LARGEPAGE #define CFG_SYS_NAND_BASE_LIST { 0x30000000, } - - -/* U-Boot general configuration */ - -/* EDMA3 */ - -/* Now for the remaining common defines */ #include <configs/ti_armv7_common.h>
Signature · 1 line
2.39.2
PATCH 2/3 configs: keystone2: Do not include hardware.h
This is a hacky way to have this file included in all source files that include common.h, instead just include from the files that need it.
--- drivers/memory/ti-aemif.c | 1 + drivers/soc/ti/keystone_serdes.c | 1 + include/configs/ti_armv7_keystone2.h | 1 - 3 files changed, 2 insertions(+), 1 deletion(-)
drivers/memory/ti-aemif.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <asm/arch/hardware.h> #include <asm/ti-common/ti-aemif.h> #define AEMIF_WAITCYCLE_CONFIG (KS2_AEMIF_CNTRL_BASE + 0x4)
drivers/soc/ti/keystone_serdes.c +1 -0
@@ -8,6 +8,7 @@#include <errno.h> #include <common.h> +#include <asm/io.h> #include <asm/ti-common/keystone_serdes.h> #include <linux/bitops.h>
include/configs/ti_armv7_keystone2.h +0 -1
@@ -52,7 +52,6 @@#include <configs/ti_armv7_common.h> /* we may include files below only after all above definitions */ -#include <asm/arch/hardware.h> #include <asm/arch/clock.h> #ifndef CONFIG_SOC_K2G #define CFG_SYS_HZ_CLOCK ks_clk_get_rate(KS2_CLK1_6)
Signature · 1 line
2.39.2
Re: [PATCH 2/3] configs: keystone2: Do not include hardware.h
Quoted 27 lines · Andrew Davis
This is a hacky way to have this file included in all source files that include
common.h, instead just include from the files that need it.Signed-off-by Andrew Davis <[email protected]>--- drivers/memory/ti-aemif.c | 1 + drivers/soc/ti/keystone_serdes.c | 1 + include/configs/ti_armv7_keystone2.h | 1 - 3 files changed, 2 insertions(+), 1 deletion(-)drivers/memory/ti-aemif.c +1
-0@@ -7,6 +7,7 @@*/ #include <common.h> +#include <asm/arch/hardware.h> #include <asm/ti-common/ti-aemif.h> #define AEMIF_WAITCYCLE_CONFIG (KS2_AEMIF_CNTRL_BASE + 0x4)drivers/soc/ti/keystone_serdes.c +0
-0
drivers/soc/ti/keystone_serdes.c line 14
Quoted 7 lines
drivers/soc/ti/keystone_serdes.c +1
-0@@ -8,6 +8,7 @@#include <errno.h> #include <common.h> +#include <asm/io.h> #include <asm/ti-common/keystone_serdes.h> #include <linux/bitops.h>
Is there going to be a follow-up to remove common.h from these files then? Thanks.
Signature · 1 line
Tom
Re: [PATCH 2/3] configs: keystone2: Do not include hardware.h
Quoted 30 lines · Tom Rini
Quoted 28 lines · Andrew Davis
This is a hacky way to have this file included in all source files that include
common.h, instead just include from the files that need it.Signed-off-by Andrew Davis <[email protected]>--- drivers/memory/ti-aemif.c | 1 + drivers/soc/ti/keystone_serdes.c | 1 + include/configs/ti_armv7_keystone2.h | 1 - 3 files changed, 2 insertions(+), 1 deletion(-)drivers/memory/ti-aemif.c +1
-0@@ -7,6 +7,7 @@*/ #include <common.h> +#include <asm/arch/hardware.h> #include <asm/ti-common/ti-aemif.h> #define AEMIF_WAITCYCLE_CONFIG (KS2_AEMIF_CNTRL_BASE + 0x4)drivers/soc/ti/keystone_serdes.c +0
-0@@ -8,6 +8,7 @@
Quoted 10 lines
drivers/soc/ti/keystone_serdes.c line 14
Quoted 6 lines
drivers/soc/ti/keystone_serdes.c +1
-0#include <errno.h> #include <common.h> +#include <asm/io.h> #include <asm/ti-common/keystone_serdes.h> #include <linux/bitops.h> Is there going to be a follow-up to remove
common.hfrom these files then? Thanks.
Yes I can take a look at that next.
Wasn't there some automation around this? Dropping headers from common.h one at a time until it disappears IIRC.
Andrew
Re: [PATCH 2/3] configs: keystone2: Do not include hardware.h
Quoted 37 lines · Andrew Davis
Quoted 27 lines · Tom Rini
Quoted 25 lines · Andrew Davis
This is a hacky way to have this file included in all source files that include
common.h, instead just include from the files that need it.Signed-off-by Andrew Davis <[email protected]>--- drivers/memory/ti-aemif.c | 1 + drivers/soc/ti/keystone_serdes.c | 1 + include/configs/ti_armv7_keystone2.h | 1 - 3 files changed, 2 insertions(+), 1 deletion(-)drivers/memory/ti-aemif.c +1
-0@@ -7,6 +7,7 @@*/ #include <common.h> +#include <asm/arch/hardware.h> #include <asm/ti-common/ti-aemif.h> #define AEMIF_WAITCYCLE_CONFIG (KS2_AEMIF_CNTRL_BASE + 0x4)drivers/soc/ti/keystone_serdes.c +0
-0@@ -8,6 +8,7 @@Quoted 8 lines
drivers/soc/ti/keystone_serdes.c line 13
Quoted 5 lines
drivers/soc/ti/keystone_serdes.c +1
-0#include <errno.h> #include <common.h> +#include <asm/io.h> #include <asm/ti-common/keystone_serdes.h> #include <linux/bitops.h> Is there going to be a follow-up to remove
common.hfrom these files then? Thanks.
Quoted 4 lines
Yes I can take a look at that next.
Wasn't there some automation around this? Dropping headers from
common.hone at a time until it disappears IIRC.
Simon has posted a python tool he wrote that partially did this, but I wasn't quite happy with the results at the time. It might work out better now, or on top of the series I posted to remove it from include/
Signature · 1 line
Tom
Re: [PATCH 2/3] configs: keystone2: Do not include hardware.h
Hi Tom,
Quoted 39 lines · Tom Rini
Quoted 37 lines · Andrew Davis
Quoted 35 lines · Tom Rini
Quoted 25 lines · Andrew Davis
This is a hacky way to have this file included in all source files that include
common.h, instead just include from the files that need it.Signed-off-by Andrew Davis <[email protected]>--- drivers/memory/ti-aemif.c | 1 + drivers/soc/ti/keystone_serdes.c | 1 + include/configs/ti_armv7_keystone2.h | 1 - 3 files changed, 2 insertions(+), 1 deletion(-)drivers/memory/ti-aemif.c +1
-0@@ -7,6 +7,7 @@*/ #include <common.h> +#include <asm/arch/hardware.h> #include <asm/ti-common/ti-aemif.h> #define AEMIF_WAITCYCLE_CONFIG (KS2_AEMIF_CNTRL_BASE + 0x4)drivers/soc/ti/keystone_serdes.c +0
-0drivers/soc/ti/keystone_serdes.c line 12
Quoted 5 lines
drivers/soc/ti/keystone_serdes.c +1
-0@@ -8,6 +8,7 @@#include <errno.h> #include <common.h> +#include <asm/io.h> #include <asm/ti-common/keystone_serdes.h> #include <linux/bitops.h> Is there going to be a follow-up to remove
common.hfrom these files then? Thanks.
Quoted 8 lines
Quoted 4 lines
Yes I can take a look at that next.
Wasn't there some automation around this? Dropping headers from
common.hone at a time until it disappears IIRC.Simon has posted a python tool he wrote that partially did this, but I wasn't quite happy with the results at the time. It might work out better now, or on top of the series I posted to remove it from
include/
My tool inserts #includes based on the symbols referenced in a file. For example, reference to strcpy() or memcmp() would result in the script adding '#include <linux/string.h>' to the top of the file.
I still believe this is a reasonable approach. My original series to handle this was posted at [1] over 3 years ago. It foundered in part due to the number of files it touched, but I still believe the principle of 'include what you use' makes sense in U-Boot.
Other problems are that in a few cases it results in some ugly code, or misordering of includes
On the plus side, it gets us past this problem. We shouldn't make perfect an enemy of good and I am disappointed that we are still trying to get this over the line.
Regards,
Simon
[1] https://patchwork.ozlabs.org/project/uboot/list/?series=193754&state=*
Re: [PATCH 2/3] configs: keystone2: Do not include hardware.h
Quoted 47 lines · Simon Glass
Hi Tom,
Quoted 44 lines · Tom Rini
Quoted 41 lines · Andrew Davis
Quoted 27 lines · Tom Rini
Quoted 25 lines · Andrew Davis
This is a hacky way to have this file included in all source files that include
common.h, instead just include from the files that need it.Signed-off-by Andrew Davis <[email protected]>--- drivers/memory/ti-aemif.c | 1 + drivers/soc/ti/keystone_serdes.c | 1 + include/configs/ti_armv7_keystone2.h | 1 - 3 files changed, 2 insertions(+), 1 deletion(-)drivers/memory/ti-aemif.c +1
-0@@ -7,6 +7,7 @@*/ #include <common.h> +#include <asm/arch/hardware.h> #include <asm/ti-common/ti-aemif.h> #define AEMIF_WAITCYCLE_CONFIG (KS2_AEMIF_CNTRL_BASE + 0x4)drivers/soc/ti/keystone_serdes.c +0
-0@@ -8,6 +8,7 @@Quoted 8 lines
drivers/soc/ti/keystone_serdes.c line 13
Quoted 5 lines
drivers/soc/ti/keystone_serdes.c +1
-0#include <errno.h> #include <common.h> +#include <asm/io.h> #include <asm/ti-common/keystone_serdes.h> #include <linux/bitops.h> Is there going to be a follow-up to remove
common.hfrom these files then? Thanks.Yes I can take a look at that next.
Wasn't there some automation around this? Dropping headers from
common.hone at a time until it disappears IIRC.
Quoted 7 lines
Quoted 3 lines
Simon has posted a python tool he wrote that partially did this, but I wasn't quite happy with the results at the time. It might work out better now, or on top of the series I posted to remove it from
include/My tool inserts #includes based on the symbols referenced in a file. For example, reference to
strcpy()ormemcmp()would result in the script adding '#include <linux/string.h>' to the top of the file.
But that's not how we typically work, nor is it how the kernel works. In a semi-current kernel tree:
$ git grep -l '<linux/string.h>' *.c | wc -l
2177
$ git grep -l '<linux/string.h>' *.h | wc -l
146
$ git grep -l 'memset(' *.c | wc -l
6957So most C files that call memset(..) get <linux/string.h> indirectly. Which is why I'm trying to clean up the header files first.
Quoted 11 lines
I still believe this is a reasonable approach. My original series to handle this was posted at [1] over 3 years ago. It foundered in part due to the number of files it touched, but I still believe the principle of 'include what you use' makes sense in U-Boot.
Other problems are that in a few cases it results in some ugly code, or misordering of includes
On the plus side, it gets us past this problem. We shouldn't make perfect an enemy of good and I am disappointed that we are still trying to get this over the line.
What makes this hard to get over the line is the less clear examples. Dealing with <config.h> and CFG symbols gets pretty odd. And the failure in https://source.denx.de/u-boot/u-boot/-/jobs/739662 was just really odd.
Signature · 1 line
Tom
Re: [PATCH 2/3] configs: keystone2: Do not include hardware.h
In reply to Andrew DavisQuoted 4 lines · Andrew Davis
This is a hacky way to have this file included in all source files that include
common.h, instead just include from the files that need it.Signed-off-by Andrew Davis <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom
PATCH 3/3 ARM: keystone2: Remove unneeded inclusions of common.h
In reply to Andrew Davis--- arch/arm/mach-keystone/clock.c | 1 - arch/arm/mach-keystone/cmd_clock.c | 2 +- arch/arm/mach-keystone/cmd_mon.c | 1 - arch/arm/mach-keystone/cmd_poweroff.c | 1 - arch/arm/mach-keystone/ddr3.c | 2 +- arch/arm/mach-keystone/ddr3_spd.c | 2 +- arch/arm/mach-keystone/include/mach/mux-k2g.h | 1 - arch/arm/mach-keystone/init.c | 1 - arch/arm/mach-keystone/keystone.c | 1 - arch/arm/mach-keystone/mon.c | 1 - arch/arm/mach-keystone/msmc.c | 1 - arch/arm/mach-keystone/psc.c | 1 - 12 files changed, 3 insertions(+), 12 deletions(-)
arch/arm/mach-keystone/clock.c +0 -1
@@ -6,7 +6,6 @@* Texas Instruments Incorporated, <www.ti.com> */ -#include <common.h> #include <asm/arch/clock.h> #include <asm/arch/clock_defs.h> #include <linux/bitops.h>
arch/arm/mach-keystone/cmd_clock.c +1 -1
@@ -6,7 +6,7 @@* Texas Instruments Incorporated, <www.ti.com> */ -#include <common.h> +#include <vsprintf.h> #include <command.h> #include <asm/arch/hardware.h> #include <asm/arch/clock.h>
arch/arm/mach-keystone/cmd_mon.c +0 -1
@@ -6,7 +6,6 @@* Texas Instruments Incorporated, <www.ti.com> */ -#include <common.h> #include <command.h> #include <image.h> #include <mach/mon.h>
arch/arm/mach-keystone/cmd_poweroff.c +0 -1
@@ -6,7 +6,6 @@* Texas Instruments Incorporated, <www.ti.com> */ -#include <common.h> #include <command.h> #include <asm/arch/mon.h> #include <asm/arch/psc_defs.h>
arch/arm/mach-keystone/ddr3.c +1 -1
@@ -9,7 +9,7 @@#include <cpu_func.h> #include <env.h> #include <asm/io.h> -#include <common.h> +#include <vsprintf.h> #include <asm/arch/msmc.h> #include <asm/arch/ddr3.h> #include <asm/arch/psc_defs.h>
arch/arm/mach-keystone/ddr3_spd.c +1 -1
@@ -5,8 +5,8 @@* (C) Copyright 2015-2016 Texas Instruments Incorporated, <www.ti.com> */ -#include <common.h> #include <log.h> +#include <string.h> #include <i2c.h> #include <ddr_spd.h>
arch/arm/mach-keystone/include/mach/mux-k2g.h +0 -1
@@ -9,7 +9,6 @@#ifndef __ASM_ARCH_MUX_K2G_H#define __ASM_ARCH_MUX_K2G_H -#include <common.h> #include <asm/io.h> #define K2G_PADCFG_REG (KS2_DEVICE_STATE_CTRL_BASE + 0x1000)
arch/arm/mach-keystone/init.c +0 -1
@@ -6,7 +6,6 @@* Texas Instruments Incorporated, <www.ti.com> */ -#include <common.h> #include <cpu_func.h> #include <init.h> #include <ns16550.h>
arch/arm/mach-keystone/keystone.c +0 -1
@@ -6,7 +6,6 @@* Texas Instruments Incorporated, <www.ti.com> */ -#include <common.h> #include <env.h> #include <init.h> #include <asm/io.h>
arch/arm/mach-keystone/mon.c +0 -1
@@ -8,7 +8,6 @@#include <hang.h> #include <image.h> #include <asm/unaligned.h> -#include <common.h> #include <command.h> #include <mach/mon.h> #include <spl.h>
arch/arm/mach-keystone/msmc.c +0 -1
@@ -6,7 +6,6 @@* Texas Instruments Incorporated, <www.ti.com> */ -#include <common.h> #include <asm/arch/msmc.h> struct mpax {
arch/arm/mach-keystone/psc.c +0 -1
@@ -6,7 +6,6 @@* Texas Instruments Incorporated, <www.ti.com> */ -#include <common.h> #include <linux/delay.h> #include <linux/errno.h> #include <asm/io.h>
Signature · 1 line
2.39.2
Re: [PATCH 3/3] ARM: keystone2: Remove unneeded inclusions of common.h
Quoted 16 lines · Andrew Davis
Signed-off-by Andrew Davis <[email protected]>--- arch/arm/mach-keystone/clock.c | 1 - arch/arm/mach-keystone/cmd_clock.c | 2 +- arch/arm/mach-keystone/cmd_mon.c | 1 - arch/arm/mach-keystone/cmd_poweroff.c | 1 - arch/arm/mach-keystone/ddr3.c | 2 +- arch/arm/mach-keystone/ddr3_spd.c | 2 +- arch/arm/mach-keystone/include/mach/mux-k2g.h | 1 - arch/arm/mach-keystone/init.c | 1 - arch/arm/mach-keystone/keystone.c | 1 - arch/arm/mach-keystone/mon.c | 1 - arch/arm/mach-keystone/msmc.c | 1 - arch/arm/mach-keystone/psc.c | 1 - 12 files changed, 3 insertions(+), 12 deletions(-)
missing commit message
Re: [PATCH 3/3] ARM: keystone2: Remove unneeded inclusions of common.h
In reply to Andrew DavisQuoted 2 lines · Andrew Davis
Signed-off-by Andrew Davis <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom
Quoted 8 lines · Andrew Davis
These are leftover definitions. While here cleanup some leftover comments.
Signed-off-by Andrew Davis <[email protected]>--- include/configs/ti_armv7_keystone2.h | 22 ---------------------- 1 file changed, 22 deletions(-)
Quoted 4 lines · Andrew Davis
These are leftover definitions. While here cleanup some leftover comments.
Signed-off-by Andrew Davis <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom