* [U-Boot] [PATCH v3] env: Added support to save env to spi through Kconfig
@ 2018-07-18 7:11 Michal Simek
2018-07-18 12:28 ` Maxime Ripard
0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2018-07-18 7:11 UTC (permalink / raw)
To: u-boot
From: Vipul Kumar <vipul.kumar@xilinx.com>
This patch added support to enable CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET
and CONFIG_ENV_SECT_SIZE through Kconfig for Zynq and Zynqmp.
Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
Changes in v3:
- Fix also bitmain config which was failing
Changes in v2:
- Changed if condition of ENV_SIZE for Zynqmp
- Changed if condition for ENV_SECT_SIZE
configs/bitmain_antminer_s9_defconfig | 1 +
env/Kconfig | 28 ++++++++++++++++++++++++++++
include/configs/bitmain_antminer_s9.h | 3 ---
include/configs/xilinx_zynqmp.h | 3 ---
include/configs/zynq-common.h | 13 -------------
5 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/configs/bitmain_antminer_s9_defconfig b/configs/bitmain_antminer_s9_defconfig
index 40bce4e37482..f59c767242f1 100644
--- a/configs/bitmain_antminer_s9_defconfig
+++ b/configs/bitmain_antminer_s9_defconfig
@@ -4,6 +4,7 @@ CONFIG_SYS_BOARD="antminer_s9"
CONFIG_SYS_CONFIG_NAME="bitmain_antminer_s9"
CONFIG_ARCH_ZYNQ=y
CONFIG_SYS_TEXT_BASE=0x4000000
+CONFIG_ENV_OFFSET=0x300000
CONFIG_SPL=y
CONFIG_DEBUG_UART_BASE=0xe0001000
CONFIG_DEBUG_UART_CLOCK=50000000
diff --git a/env/Kconfig b/env/Kconfig
index 8618376f252f..b37dcd78eb75 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -480,6 +480,34 @@ config ENV_SIZE
endif
+if ARCH_ZYNQMP || ARCH_ZYNQ
+
+config ENV_OFFSET
+ hex "Environment Offset"
+ depends on !ENV_IS_NOWHERE
+ default 0x1E00000 if ARCH_ZYNQMP
+ default 0xE0000 if ARCH_ZYNQ
+ help
+ Offset from the start of the device (or partition)
+
+config ENV_SIZE
+ hex "Environment Size"
+ default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
+ default 0x8000 if ARCH_ZYNQMP
+ default 0x20000 if ARCH_ZYNQ
+ help
+ Size of the environment storage area.
+
+config ENV_SECT_SIZE
+ hex "Environment Sector-Size"
+ depends on !ENV_IS_NOWHERE
+ default 0x40000 if ARCH_ZYNQMP
+ default 0x20000 if ARCH_ZYNQ
+ help
+ Size of the sector containing the environment.
+
+endif
+
config USE_DEFAULT_ENV_FILE
bool "Create default environment from file"
help
diff --git a/include/configs/bitmain_antminer_s9.h b/include/configs/bitmain_antminer_s9.h
index 226750215e75..a9f45f19295a 100644
--- a/include/configs/bitmain_antminer_s9.h
+++ b/include/configs/bitmain_antminer_s9.h
@@ -9,9 +9,6 @@
#define CONFIG_SYS_SDRAM_BASE 0x00000000
#define CONFIG_SYS_SDRAM_SIZE 0x40000000
-#define CONFIG_ENV_SIZE 0x20000
-#define CONFIG_ENV_OFFSET 0x300000
-
#define CONFIG_BOOTP_SERVERIP
#define CONFIG_EXTRA_ENV_SETTINGS \
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index ebc6c6f3e020..ef242c796253 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -99,9 +99,6 @@
# define PARTS_DEFAULT
#endif
-/* Do not preserve environment */
-#define CONFIG_ENV_SIZE 0x8000
-
/* Monitor Command Prompt */
/* Console I/O Buffer Size */
#define CONFIG_SYS_CBSIZE 2048
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index a6f2aceea1de..c41dc2c9070e 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -121,22 +121,9 @@
# define CONFIG_SYS_EEPROM_SIZE 1024 /* Bytes */
#endif
-/* Total Size of Environment Sector */
-#ifndef CONFIG_ENV_SIZE
-# define CONFIG_ENV_SIZE (128 << 10)
-#endif
-
/* Allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
-/* Environment */
-#ifndef CONFIG_ENV_IS_NOWHERE
-# define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE
-# ifndef CONFIG_ENV_OFFSET
-# define CONFIG_ENV_OFFSET 0xE0000
-# endif
-#endif
-
/* enable preboot to be loaded before CONFIG_BOOTDELAY */
#define CONFIG_PREBOOT
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v3] env: Added support to save env to spi through Kconfig
2018-07-18 7:11 [U-Boot] [PATCH v3] env: Added support to save env to spi through Kconfig Michal Simek
@ 2018-07-18 12:28 ` Maxime Ripard
2018-07-18 14:04 ` Michal Simek
0 siblings, 1 reply; 5+ messages in thread
From: Maxime Ripard @ 2018-07-18 12:28 UTC (permalink / raw)
To: u-boot
1;5202;0c
On Wed, Jul 18, 2018 at 09:11:35AM +0200, Michal Simek wrote:
> From: Vipul Kumar <vipul.kumar@xilinx.com>
>
> This patch added support to enable CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET
> and CONFIG_ENV_SECT_SIZE through Kconfig for Zynq and Zynqmp.
>
> Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> Changes in v3:
> - Fix also bitmain config which was failing
>
> Changes in v2:
> - Changed if condition of ENV_SIZE for Zynqmp
> - Changed if condition for ENV_SECT_SIZE
>
> configs/bitmain_antminer_s9_defconfig | 1 +
> env/Kconfig | 28 ++++++++++++++++++++++++++++
> include/configs/bitmain_antminer_s9.h | 3 ---
> include/configs/xilinx_zynqmp.h | 3 ---
> include/configs/zynq-common.h | 13 -------------
> 5 files changed, 29 insertions(+), 19 deletions(-)
>
> diff --git a/configs/bitmain_antminer_s9_defconfig b/configs/bitmain_antminer_s9_defconfig
> index 40bce4e37482..f59c767242f1 100644
> --- a/configs/bitmain_antminer_s9_defconfig
> +++ b/configs/bitmain_antminer_s9_defconfig
> @@ -4,6 +4,7 @@ CONFIG_SYS_BOARD="antminer_s9"
> CONFIG_SYS_CONFIG_NAME="bitmain_antminer_s9"
> CONFIG_ARCH_ZYNQ=y
> CONFIG_SYS_TEXT_BASE=0x4000000
> +CONFIG_ENV_OFFSET=0x300000
> CONFIG_SPL=y
> CONFIG_DEBUG_UART_BASE=0xe0001000
> CONFIG_DEBUG_UART_CLOCK=50000000
> diff --git a/env/Kconfig b/env/Kconfig
> index 8618376f252f..b37dcd78eb75 100644
> --- a/env/Kconfig
> +++ b/env/Kconfig
> @@ -480,6 +480,34 @@ config ENV_SIZE
>
> endif
>
> +if ARCH_ZYNQMP || ARCH_ZYNQ
> +
> +config ENV_OFFSET
> + hex "Environment Offset"
> + depends on !ENV_IS_NOWHERE
> + default 0x1E00000 if ARCH_ZYNQMP
> + default 0xE0000 if ARCH_ZYNQ
> + help
> + Offset from the start of the device (or partition)
> +
> +config ENV_SIZE
> + hex "Environment Size"
> + default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
> + default 0x8000 if ARCH_ZYNQMP
> + default 0x20000 if ARCH_ZYNQ
> + help
> + Size of the environment storage area.
These two are already defined in Kconfig, you can probably just add a
default <value> if ARCH_ZYNQ* there.
Maxime
--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180718/ffa6faee/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v3] env: Added support to save env to spi through Kconfig
2018-07-18 12:28 ` Maxime Ripard
@ 2018-07-18 14:04 ` Michal Simek
2018-07-18 15:25 ` Maxime Ripard
0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2018-07-18 14:04 UTC (permalink / raw)
To: u-boot
On 18.7.2018 14:28, Maxime Ripard wrote:
> 1;5202;0c
> On Wed, Jul 18, 2018 at 09:11:35AM +0200, Michal Simek wrote:
>> From: Vipul Kumar <vipul.kumar@xilinx.com>
>>
>> This patch added support to enable CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET
>> and CONFIG_ENV_SECT_SIZE through Kconfig for Zynq and Zynqmp.
>>
>> Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> Changes in v3:
>> - Fix also bitmain config which was failing
>>
>> Changes in v2:
>> - Changed if condition of ENV_SIZE for Zynqmp
>> - Changed if condition for ENV_SECT_SIZE
>>
>> configs/bitmain_antminer_s9_defconfig | 1 +
>> env/Kconfig | 28 ++++++++++++++++++++++++++++
>> include/configs/bitmain_antminer_s9.h | 3 ---
>> include/configs/xilinx_zynqmp.h | 3 ---
>> include/configs/zynq-common.h | 13 -------------
>> 5 files changed, 29 insertions(+), 19 deletions(-)
>>
>> diff --git a/configs/bitmain_antminer_s9_defconfig b/configs/bitmain_antminer_s9_defconfig
>> index 40bce4e37482..f59c767242f1 100644
>> --- a/configs/bitmain_antminer_s9_defconfig
>> +++ b/configs/bitmain_antminer_s9_defconfig
>> @@ -4,6 +4,7 @@ CONFIG_SYS_BOARD="antminer_s9"
>> CONFIG_SYS_CONFIG_NAME="bitmain_antminer_s9"
>> CONFIG_ARCH_ZYNQ=y
>> CONFIG_SYS_TEXT_BASE=0x4000000
>> +CONFIG_ENV_OFFSET=0x300000
>> CONFIG_SPL=y
>> CONFIG_DEBUG_UART_BASE=0xe0001000
>> CONFIG_DEBUG_UART_CLOCK=50000000
>> diff --git a/env/Kconfig b/env/Kconfig
>> index 8618376f252f..b37dcd78eb75 100644
>> --- a/env/Kconfig
>> +++ b/env/Kconfig
>> @@ -480,6 +480,34 @@ config ENV_SIZE
>>
>> endif
>>
>> +if ARCH_ZYNQMP || ARCH_ZYNQ
>> +
>> +config ENV_OFFSET
>> + hex "Environment Offset"
>> + depends on !ENV_IS_NOWHERE
>> + default 0x1E00000 if ARCH_ZYNQMP
>> + default 0xE0000 if ARCH_ZYNQ
>> + help
>> + Offset from the start of the device (or partition)
>> +
>> +config ENV_SIZE
>> + hex "Environment Size"
>> + default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
>> + default 0x8000 if ARCH_ZYNQMP
>> + default 0x20000 if ARCH_ZYNQ
>> + help
>> + Size of the environment storage area.
>
> These two are already defined in Kconfig, you can probably just add a
> default <value> if ARCH_ZYNQ* there.
we just follow the same style which SUNXI and ROCKCHIP are using.
I am happy to create a patch on the top of this one to merge these 3
together because it will require some testing.
I have already some patches depends on this one.
Thanks,
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v3] env: Added support to save env to spi through Kconfig
2018-07-18 14:04 ` Michal Simek
@ 2018-07-18 15:25 ` Maxime Ripard
2018-07-19 6:46 ` Michal Simek
0 siblings, 1 reply; 5+ messages in thread
From: Maxime Ripard @ 2018-07-18 15:25 UTC (permalink / raw)
To: u-boot
On Wed, Jul 18, 2018 at 04:04:37PM +0200, Michal Simek wrote:
> On 18.7.2018 14:28, Maxime Ripard wrote:
> > 1;5202;0c
> > On Wed, Jul 18, 2018 at 09:11:35AM +0200, Michal Simek wrote:
> >> From: Vipul Kumar <vipul.kumar@xilinx.com>
> >>
> >> This patch added support to enable CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET
> >> and CONFIG_ENV_SECT_SIZE through Kconfig for Zynq and Zynqmp.
> >>
> >> Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
> >> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> >> ---
> >>
> >> Changes in v3:
> >> - Fix also bitmain config which was failing
> >>
> >> Changes in v2:
> >> - Changed if condition of ENV_SIZE for Zynqmp
> >> - Changed if condition for ENV_SECT_SIZE
> >>
> >> configs/bitmain_antminer_s9_defconfig | 1 +
> >> env/Kconfig | 28 ++++++++++++++++++++++++++++
> >> include/configs/bitmain_antminer_s9.h | 3 ---
> >> include/configs/xilinx_zynqmp.h | 3 ---
> >> include/configs/zynq-common.h | 13 -------------
> >> 5 files changed, 29 insertions(+), 19 deletions(-)
> >>
> >> diff --git a/configs/bitmain_antminer_s9_defconfig b/configs/bitmain_antminer_s9_defconfig
> >> index 40bce4e37482..f59c767242f1 100644
> >> --- a/configs/bitmain_antminer_s9_defconfig
> >> +++ b/configs/bitmain_antminer_s9_defconfig
> >> @@ -4,6 +4,7 @@ CONFIG_SYS_BOARD="antminer_s9"
> >> CONFIG_SYS_CONFIG_NAME="bitmain_antminer_s9"
> >> CONFIG_ARCH_ZYNQ=y
> >> CONFIG_SYS_TEXT_BASE=0x4000000
> >> +CONFIG_ENV_OFFSET=0x300000
> >> CONFIG_SPL=y
> >> CONFIG_DEBUG_UART_BASE=0xe0001000
> >> CONFIG_DEBUG_UART_CLOCK=50000000
> >> diff --git a/env/Kconfig b/env/Kconfig
> >> index 8618376f252f..b37dcd78eb75 100644
> >> --- a/env/Kconfig
> >> +++ b/env/Kconfig
> >> @@ -480,6 +480,34 @@ config ENV_SIZE
> >>
> >> endif
> >>
> >> +if ARCH_ZYNQMP || ARCH_ZYNQ
> >> +
> >> +config ENV_OFFSET
> >> + hex "Environment Offset"
> >> + depends on !ENV_IS_NOWHERE
> >> + default 0x1E00000 if ARCH_ZYNQMP
> >> + default 0xE0000 if ARCH_ZYNQ
> >> + help
> >> + Offset from the start of the device (or partition)
> >> +
> >> +config ENV_SIZE
> >> + hex "Environment Size"
> >> + default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
> >> + default 0x8000 if ARCH_ZYNQMP
> >> + default 0x20000 if ARCH_ZYNQ
> >> + help
> >> + Size of the environment storage area.
> >
> > These two are already defined in Kconfig, you can probably just add a
> > default <value> if ARCH_ZYNQ* there.
>
> we just follow the same style which SUNXI and ROCKCHIP are using.
We should definitely merge these two yeah.
> I am happy to create a patch on the top of this one to merge these 3
> together because it will require some testing. I have already some
> patches depends on this one.
But that can also happen as a second step, you're right.
Maxime
--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180718/9e073385/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v3] env: Added support to save env to spi through Kconfig
2018-07-18 15:25 ` Maxime Ripard
@ 2018-07-19 6:46 ` Michal Simek
0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2018-07-19 6:46 UTC (permalink / raw)
To: u-boot
On 18.7.2018 17:25, Maxime Ripard wrote:
> On Wed, Jul 18, 2018 at 04:04:37PM +0200, Michal Simek wrote:
>> On 18.7.2018 14:28, Maxime Ripard wrote:
>>> 1;5202;0c
>>> On Wed, Jul 18, 2018 at 09:11:35AM +0200, Michal Simek wrote:
>>>> From: Vipul Kumar <vipul.kumar@xilinx.com>
>>>>
>>>> This patch added support to enable CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET
>>>> and CONFIG_ENV_SECT_SIZE through Kconfig for Zynq and Zynqmp.
>>>>
>>>> Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>> ---
>>>>
>>>> Changes in v3:
>>>> - Fix also bitmain config which was failing
>>>>
>>>> Changes in v2:
>>>> - Changed if condition of ENV_SIZE for Zynqmp
>>>> - Changed if condition for ENV_SECT_SIZE
>>>>
>>>> configs/bitmain_antminer_s9_defconfig | 1 +
>>>> env/Kconfig | 28 ++++++++++++++++++++++++++++
>>>> include/configs/bitmain_antminer_s9.h | 3 ---
>>>> include/configs/xilinx_zynqmp.h | 3 ---
>>>> include/configs/zynq-common.h | 13 -------------
>>>> 5 files changed, 29 insertions(+), 19 deletions(-)
>>>>
>>>> diff --git a/configs/bitmain_antminer_s9_defconfig b/configs/bitmain_antminer_s9_defconfig
>>>> index 40bce4e37482..f59c767242f1 100644
>>>> --- a/configs/bitmain_antminer_s9_defconfig
>>>> +++ b/configs/bitmain_antminer_s9_defconfig
>>>> @@ -4,6 +4,7 @@ CONFIG_SYS_BOARD="antminer_s9"
>>>> CONFIG_SYS_CONFIG_NAME="bitmain_antminer_s9"
>>>> CONFIG_ARCH_ZYNQ=y
>>>> CONFIG_SYS_TEXT_BASE=0x4000000
>>>> +CONFIG_ENV_OFFSET=0x300000
>>>> CONFIG_SPL=y
>>>> CONFIG_DEBUG_UART_BASE=0xe0001000
>>>> CONFIG_DEBUG_UART_CLOCK=50000000
>>>> diff --git a/env/Kconfig b/env/Kconfig
>>>> index 8618376f252f..b37dcd78eb75 100644
>>>> --- a/env/Kconfig
>>>> +++ b/env/Kconfig
>>>> @@ -480,6 +480,34 @@ config ENV_SIZE
>>>>
>>>> endif
>>>>
>>>> +if ARCH_ZYNQMP || ARCH_ZYNQ
>>>> +
>>>> +config ENV_OFFSET
>>>> + hex "Environment Offset"
>>>> + depends on !ENV_IS_NOWHERE
>>>> + default 0x1E00000 if ARCH_ZYNQMP
>>>> + default 0xE0000 if ARCH_ZYNQ
>>>> + help
>>>> + Offset from the start of the device (or partition)
>>>> +
>>>> +config ENV_SIZE
>>>> + hex "Environment Size"
>>>> + default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
>>>> + default 0x8000 if ARCH_ZYNQMP
>>>> + default 0x20000 if ARCH_ZYNQ
>>>> + help
>>>> + Size of the environment storage area.
>>>
>>> These two are already defined in Kconfig, you can probably just add a
>>> default <value> if ARCH_ZYNQ* there.
>>
>> we just follow the same style which SUNXI and ROCKCHIP are using.
>
> We should definitely merge these two yeah.
>
>> I am happy to create a patch on the top of this one to merge these 3
>> together because it will require some testing. I have already some
>> patches depends on this one.
>
> But that can also happen as a second step, you're right.
As I said here it is.
https://lists.denx.de/pipermail/u-boot/2018-July/335266.html
Please test. I just build it for zynq/zynqmp.
Thanks,
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-07-19 6:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18 7:11 [U-Boot] [PATCH v3] env: Added support to save env to spi through Kconfig Michal Simek
2018-07-18 12:28 ` Maxime Ripard
2018-07-18 14:04 ` Michal Simek
2018-07-18 15:25 ` Maxime Ripard
2018-07-19 6:46 ` Michal Simek
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.