Re: [U-Boot] [PATCH] ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig

2019-01-16 Thread Alexey Brodkin
Hi Tom,

> -Original Message-
> From: Tom Rini 
> Sent: Wednesday, January 16, 2019 7:25 PM
> To: Alexey Brodkin 
> Cc: u-boot@lists.denx.de; uboot-snps-...@synopsys.com; Michal Simek 
> ; Simon
> Glass 
> Subject: Re: [PATCH] ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig
> 
> On Wed, Jan 16, 2019 at 04:22:22PM +, Alexey Brodkin wrote:
> > Hi Tom,
> >
> > > -Original Message-
> > > From: Tom Rini 
> > > Sent: Wednesday, January 16, 2019 7:19 PM
> > > To: Alexey Brodkin 
> > > Cc: u-boot@lists.denx.de; uboot-snps-...@synopsys.com; Michal Simek 
> > > ;
> Simon
> > > Glass 
> > > Subject: Re: [PATCH] ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig
> > >
> > > On Wed, Jan 16, 2019 at 07:11:15PM +0300, Alexey Brodkin wrote:
> > >
> > > > Join the party of some ARM boards and drop more
> > > > items from include/configs/xxx.h.
> > > >
> > > > Signed-off-by: Alexey Brodkin 
> > > > Cc: Michal Simek 
> > > > Cc: Simon Glass 
> > > > Cc: Tom Rini 
> > > > ---
> >
> > [snip]
> >
> > > >  config ENV_OFFSET
> > > > hex "Environment Offset"
> > > > @@ -441,6 +441,7 @@ config ENV_OFFSET
> > > > default 0x88000 if ARCH_SUNXI
> > > > default 0xE if ARCH_ZYNQ
> > > > default 0x1E0 if ARCH_ZYNQMP
> > > > +   default 0
> > >
> > > Please make this "if ARC", thanks!
> >
> > Actually I don't like having here listed all the boards
> > because with more boards/arches moving ENV settings to Kconfig
> > we'll get here all of them listed at some point.
> > Why default ENV_OFFSET [as well as] ENV_SIZE are not set in
> > arch/soc/board top-level Kconfig?
> 
> I believe the answer is that having config FOO prompt in one place and N
> config FOO values results in lots of churn in the defconfig files when
> they get re-synced.  So yes, having N lines of default X if Y with the
> prompt is what we want, at least until everything is converted and then
> we can see if no, really, moving the defaults to some defined /
> consistent locations doesn't result in so much churn.

Ok that's fine by me.
Sending a re-spin.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig

2019-01-16 Thread Tom Rini
On Wed, Jan 16, 2019 at 04:22:22PM +, Alexey Brodkin wrote:
> Hi Tom,
> 
> > -Original Message-
> > From: Tom Rini 
> > Sent: Wednesday, January 16, 2019 7:19 PM
> > To: Alexey Brodkin 
> > Cc: u-boot@lists.denx.de; uboot-snps-...@synopsys.com; Michal Simek 
> > ; Simon
> > Glass 
> > Subject: Re: [PATCH] ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig
> > 
> > On Wed, Jan 16, 2019 at 07:11:15PM +0300, Alexey Brodkin wrote:
> > 
> > > Join the party of some ARM boards and drop more
> > > items from include/configs/xxx.h.
> > >
> > > Signed-off-by: Alexey Brodkin 
> > > Cc: Michal Simek 
> > > Cc: Simon Glass 
> > > Cc: Tom Rini 
> > > ---
> 
> [snip]
> 
> > >  config ENV_OFFSET
> > >   hex "Environment Offset"
> > > @@ -441,6 +441,7 @@ config ENV_OFFSET
> > >   default 0x88000 if ARCH_SUNXI
> > >   default 0xE if ARCH_ZYNQ
> > >   default 0x1E0 if ARCH_ZYNQMP
> > > + default 0
> > 
> > Please make this "if ARC", thanks!
> 
> Actually I don't like having here listed all the boards
> because with more boards/arches moving ENV settings to Kconfig
> we'll get here all of them listed at some point.
> Why default ENV_OFFSET [as well as] ENV_SIZE are not set in
> arch/soc/board top-level Kconfig?

I believe the answer is that having config FOO prompt in one place and N
config FOO values results in lots of churn in the defconfig files when
they get re-synced.  So yes, having N lines of default X if Y with the
prompt is what we want, at least until everything is converted and then
we can see if no, really, moving the defaults to some defined /
consistent locations doesn't result in so much churn.

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig

2019-01-16 Thread Alexey Brodkin
Hi Tom,

> -Original Message-
> From: Tom Rini 
> Sent: Wednesday, January 16, 2019 7:19 PM
> To: Alexey Brodkin 
> Cc: u-boot@lists.denx.de; uboot-snps-...@synopsys.com; Michal Simek 
> ; Simon
> Glass 
> Subject: Re: [PATCH] ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig
> 
> On Wed, Jan 16, 2019 at 07:11:15PM +0300, Alexey Brodkin wrote:
> 
> > Join the party of some ARM boards and drop more
> > items from include/configs/xxx.h.
> >
> > Signed-off-by: Alexey Brodkin 
> > Cc: Michal Simek 
> > Cc: Simon Glass 
> > Cc: Tom Rini 
> > ---

[snip]

> >  config ENV_OFFSET
> > hex "Environment Offset"
> > @@ -441,6 +441,7 @@ config ENV_OFFSET
> > default 0x88000 if ARCH_SUNXI
> > default 0xE if ARCH_ZYNQ
> > default 0x1E0 if ARCH_ZYNQMP
> > +   default 0
> 
> Please make this "if ARC", thanks!

Actually I don't like having here listed all the boards
because with more boards/arches moving ENV settings to Kconfig
we'll get here all of them listed at some point.
Why default ENV_OFFSET [as well as] ENV_SIZE are not set in
arch/soc/board top-level Kconfig?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig

2019-01-16 Thread Tom Rini
On Wed, Jan 16, 2019 at 07:11:15PM +0300, Alexey Brodkin wrote:

> Join the party of some ARM boards and drop more
> items from include/configs/xxx.h.
> 
> Signed-off-by: Alexey Brodkin 
> Cc: Michal Simek 
> Cc: Simon Glass 
> Cc: Tom Rini 
> ---
>  configs/emsdp_defconfig  | 1 +
>  configs/iot_devkit_defconfig | 1 +
>  configs/tb100_defconfig  | 1 +
>  env/Kconfig  | 4 +++-
>  include/configs/axs10x.h | 1 -
>  include/configs/emsdp.h  | 1 -
>  include/configs/hsdk.h   | 2 --
>  include/configs/iot_devkit.h | 1 -
>  include/configs/nsim.h   | 6 --
>  include/configs/tb100.h  | 6 --
>  10 files changed, 6 insertions(+), 18 deletions(-)
> 
> diff --git a/configs/emsdp_defconfig b/configs/emsdp_defconfig
> index 273334b05d..64281d0529 100644
> --- a/configs/emsdp_defconfig
> +++ b/configs/emsdp_defconfig
> @@ -3,6 +3,7 @@ CONFIG_ISA_ARCV2=y
>  CONFIG_CPU_ARCEM6=y
>  CONFIG_TARGET_EMSDP=y
>  CONFIG_SYS_TEXT_BASE=0x
> +CONFIG_ENV_SIZE=0x1000
>  CONFIG_SYS_CLK_FREQ=4000
>  # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
>  CONFIG_VERSION_VARIABLE=y
> diff --git a/configs/iot_devkit_defconfig b/configs/iot_devkit_defconfig
> index 1b6dd9e55a..24bbe3fc5d 100644
> --- a/configs/iot_devkit_defconfig
> +++ b/configs/iot_devkit_defconfig
> @@ -5,6 +5,7 @@ CONFIG_SYS_ICACHE_OFF=y
>  CONFIG_SYS_DCACHE_OFF=y
>  CONFIG_TARGET_IOT_DEVKIT=y
>  CONFIG_SYS_TEXT_BASE=0x
> +CONFIG_ENV_SIZE=0x1000
>  CONFIG_SYS_CLK_FREQ=1600
>  CONFIG_LOCALVERSION="-iotdk-1.0"
>  # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
> diff --git a/configs/tb100_defconfig b/configs/tb100_defconfig
> index f30053d4de..e3837d92e7 100644
> --- a/configs/tb100_defconfig
> +++ b/configs/tb100_defconfig
> @@ -1,6 +1,7 @@
>  CONFIG_ARC=y
>  CONFIG_TARGET_TB100=y
>  CONFIG_SYS_TEXT_BASE=0x8400
> +CONFIG_ENV_SIZE=0x800
>  CONFIG_SYS_CLK_FREQ=5
>  CONFIG_BOOTDELAY=3
>  CONFIG_USE_BOOTARGS=y
> diff --git a/env/Kconfig b/env/Kconfig
> index 9011109b47..8beaa7249a 100644
> --- a/env/Kconfig
> +++ b/env/Kconfig
> @@ -431,7 +431,7 @@ config ENV_EXT4_FILE
> It's a string of the EXT4 file name. This file use to store the
> environment (explicit path to the file)
>  
> -if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL
> +if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || 
> ARC
>  
>  config ENV_OFFSET
>   hex "Environment Offset"
> @@ -441,6 +441,7 @@ config ENV_OFFSET
>   default 0x88000 if ARCH_SUNXI
>   default 0xE if ARCH_ZYNQ
>   default 0x1E0 if ARCH_ZYNQMP
> + default 0

Please make this "if ARC", thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig

2019-01-16 Thread Alexey Brodkin
Join the party of some ARM boards and drop more
items from include/configs/xxx.h.

Signed-off-by: Alexey Brodkin 
Cc: Michal Simek 
Cc: Simon Glass 
Cc: Tom Rini 
---
 configs/emsdp_defconfig  | 1 +
 configs/iot_devkit_defconfig | 1 +
 configs/tb100_defconfig  | 1 +
 env/Kconfig  | 4 +++-
 include/configs/axs10x.h | 1 -
 include/configs/emsdp.h  | 1 -
 include/configs/hsdk.h   | 2 --
 include/configs/iot_devkit.h | 1 -
 include/configs/nsim.h   | 6 --
 include/configs/tb100.h  | 6 --
 10 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/configs/emsdp_defconfig b/configs/emsdp_defconfig
index 273334b05d..64281d0529 100644
--- a/configs/emsdp_defconfig
+++ b/configs/emsdp_defconfig
@@ -3,6 +3,7 @@ CONFIG_ISA_ARCV2=y
 CONFIG_CPU_ARCEM6=y
 CONFIG_TARGET_EMSDP=y
 CONFIG_SYS_TEXT_BASE=0x
+CONFIG_ENV_SIZE=0x1000
 CONFIG_SYS_CLK_FREQ=4000
 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
 CONFIG_VERSION_VARIABLE=y
diff --git a/configs/iot_devkit_defconfig b/configs/iot_devkit_defconfig
index 1b6dd9e55a..24bbe3fc5d 100644
--- a/configs/iot_devkit_defconfig
+++ b/configs/iot_devkit_defconfig
@@ -5,6 +5,7 @@ CONFIG_SYS_ICACHE_OFF=y
 CONFIG_SYS_DCACHE_OFF=y
 CONFIG_TARGET_IOT_DEVKIT=y
 CONFIG_SYS_TEXT_BASE=0x
+CONFIG_ENV_SIZE=0x1000
 CONFIG_SYS_CLK_FREQ=1600
 CONFIG_LOCALVERSION="-iotdk-1.0"
 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
diff --git a/configs/tb100_defconfig b/configs/tb100_defconfig
index f30053d4de..e3837d92e7 100644
--- a/configs/tb100_defconfig
+++ b/configs/tb100_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARC=y
 CONFIG_TARGET_TB100=y
 CONFIG_SYS_TEXT_BASE=0x8400
+CONFIG_ENV_SIZE=0x800
 CONFIG_SYS_CLK_FREQ=5
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
diff --git a/env/Kconfig b/env/Kconfig
index 9011109b47..8beaa7249a 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -431,7 +431,7 @@ config ENV_EXT4_FILE
  It's a string of the EXT4 file name. This file use to store the
  environment (explicit path to the file)
 
-if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL
+if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || 
ARC
 
 config ENV_OFFSET
hex "Environment Offset"
@@ -441,6 +441,7 @@ config ENV_OFFSET
default 0x88000 if ARCH_SUNXI
default 0xE if ARCH_ZYNQ
default 0x1E0 if ARCH_ZYNQMP
+   default 0
help
  Offset from the start of the device (or partition)
 
@@ -449,6 +450,7 @@ config ENV_SIZE
default 0x4 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
default 0x2 if ARCH_SUNXI || ARCH_ZYNQ
default 0x8000 if ARCH_ROCKCHIP || ARCH_ZYNQMP || ARCH_VERSAL
+   default 0x4000 if ARC
help
  Size of the environment storage area
 
diff --git a/include/configs/axs10x.h b/include/configs/axs10x.h
index 9452b06771..24afbc8fe5 100644
--- a/include/configs/axs10x.h
+++ b/include/configs/axs10x.h
@@ -62,7 +62,6 @@
 /*
  * Environment settings
  */
-#define CONFIG_ENV_SIZESZ_16K
 #define CONFIG_EXTRA_ENV_SETTINGS \
"upgrade=if mmc rescan && " \
"fatload mmc 0:1 ${loadaddr} u-boot-update.img && " \
diff --git a/include/configs/emsdp.h b/include/configs/emsdp.h
index 9a205edc7c..44614138f8 100644
--- a/include/configs/emsdp.h
+++ b/include/configs/emsdp.h
@@ -24,7 +24,6 @@
 /*
  * Environment
  */
-#define CONFIG_ENV_SIZESZ_4K
 #define CONFIG_BOOTFILE"app.bin"
 #define CONFIG_LOADADDRCONFIG_SYS_LOAD_ADDR
 
diff --git a/include/configs/hsdk.h b/include/configs/hsdk.h
index 94c88b29f1..4755567a2d 100644
--- a/include/configs/hsdk.h
+++ b/include/configs/hsdk.h
@@ -57,8 +57,6 @@
 /*
  * Environment settings
  */
-#define CONFIG_ENV_SIZESZ_16K
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
"upgrade=if mmc rescan && " \
"fatload mmc 0:1 ${loadaddr} u-boot-update.scr && " \
diff --git a/include/configs/iot_devkit.h b/include/configs/iot_devkit.h
index 4ffe1141d9..4b110bb9d8 100644
--- a/include/configs/iot_devkit.h
+++ b/include/configs/iot_devkit.h
@@ -77,7 +77,6 @@
 /*
  * Environment
  */
-#define CONFIG_ENV_SIZESZ_4K
 #define CONFIG_BOOTFILE"app.bin"
 #define CONFIG_LOADADDRCONFIG_SYS_LOAD_ADDR
 
diff --git a/include/configs/nsim.h b/include/configs/nsim.h
index c3f34a91e4..61217bbe79 100644
--- a/include/configs/nsim.h
+++ b/include/configs/nsim.h
@@ -24,12 +24,6 @@
 #define CONFIG_SYS_BOOTM_LEN   SZ_32M
 #define CONFIG_SYS_LOAD_ADDR   0x8200
 
-/*
- * Environment settings
- */
-#define CONFIG_ENV_SIZESZ_512
-#define CONFIG_ENV_OFFSET  0
-
 /*
  * Environment configuration
  */
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index 96e5b6315c..a761c37335 100644
---