Skip to contentSkip to conversation

nios2: Calculate the env position from monitor size

PATCH New Marek Vasut 2 participants 19 messages Dec 15, 2015 – Dec 16, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 nios2: Calculate the env position from monitor size

Reorder the 10m50 and 3c120 config files such, that the environment position can be calculated from the monitor size. The environment is placed right after the monitor. This removes one more ad-hoc variable.

---
 include/configs/10m50_devboard.h | 26 +++++++++++++-------------
 include/configs/3c120_devboard.h | 26 +++++++++++++-------------
 2 files changed, 26 insertions(+), 26 deletions(-)
include/configs/10m50_devboard.h +13 -13
index 8a91cdb..c99177c 100644
@@ -54,19 +54,6 @@
 #define CONFIG_LMB
 
 /*
- * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
- * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
- * reset address, no? This will keep the environment in user region
- * of flash. NOTE: the monitor length must be multiple of sector size
- * (which is common practice).
- */
-#define CONFIG_ENV_IS_IN_FLASH
-
-#define CONFIG_ENV_SIZE			0x10000	/* 64k, 1 sector */
-#define CONFIG_ENV_OVERWRITE		/* Serial change Ok	*/
-#define CONFIG_ENV_ADDR			0xf4040000
-
-/*
  * MEMORY ORGANIZATION
  * -Monitor at top of sdram.
  * -The heap is placed below the monitor
@@ -83,6 +70,19 @@
 #define CONFIG_SYS_MALLOC_LEN		0x20000
 
 /*
+ * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
+ * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
+ * reset address, no? This will keep the environment in user region
+ * of flash. NOTE: the monitor length must be multiple of sector size
+ * (which is common practice).
+ */
+#define CONFIG_ENV_IS_IN_FLASH
+
+#define CONFIG_ENV_SIZE			0x10000	/* 64k, 1 sector */
+#define CONFIG_ENV_OVERWRITE		/* Serial change Ok	*/
+#define CONFIG_ENV_ADDR			(0xf4000000 + CONFIG_SYS_MONITOR_LEN)
+
+/*
  * MISC
  */
 #define CONFIG_SYS_LONGHELP		/* Provide extended help */
include/configs/3c120_devboard.h +13 -13
index 2ecdd5d..0f494e5 100644
@@ -57,19 +57,6 @@
 #define CONFIG_LMB
 
 /*
- * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
- * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
- * reset address, no? This will keep the environment in user region
- * of flash. NOTE: the monitor length must be multiple of sector size
- * (which is common practice).
- */
-#define CONFIG_ENV_IS_IN_FLASH
-
-#define CONFIG_ENV_SIZE			0x20000	/* 128k, 1 sector */
-#define CONFIG_ENV_OVERWRITE		/* Serial change Ok	*/
-#define CONFIG_ENV_ADDR			0xe2840000
-
-/*
  * MEMORY ORGANIZATION
  * -Monitor at top of sdram.
  * -The heap is placed below the monitor
@@ -86,6 +73,19 @@
 #define CONFIG_SYS_MALLOC_LEN		0x20000
 
 /*
+ * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
+ * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
+ * reset address, no? This will keep the environment in user region
+ * of flash. NOTE: the monitor length must be multiple of sector size
+ * (which is common practice).
+ */
+#define CONFIG_ENV_IS_IN_FLASH
+
+#define CONFIG_ENV_SIZE			0x20000	/* 128k, 1 sector */
+#define CONFIG_ENV_OVERWRITE		/* Serial change Ok	*/
+#define CONFIG_ENV_ADDR			(0xe2800000 + CONFIG_SYS_MONITOR_LEN)
+
+/*
  * MISC
  */
 #define CONFIG_SYS_LONGHELP		/* Provide extended help */
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/5 nios2: Up the monitor size to 512kiB

The monitor is growing much larger with various additions, like fitImage, command line completion, UBI etc. Make the monitor area larger so these features can be safely added.

---
 include/configs/10m50_devboard.h | 2 +-
 include/configs/3c120_devboard.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/configs/10m50_devboard.h +1 -1
index c99177c..68ef6e5 100644
@@ -63,7 +63,7 @@
 #define CONFIG_SYS_SDRAM_SIZE		0x08000000
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_MONITOR_IS_IN_RAM
-#define CONFIG_SYS_MONITOR_LEN		0x40000	/* Reserve 256k */
+#define CONFIG_SYS_MONITOR_LEN		0x80000	/* Reserve 512k */
 #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_SDRAM_BASE + \
 					 CONFIG_SYS_SDRAM_SIZE - \
 					 CONFIG_SYS_MONITOR_LEN)
include/configs/3c120_devboard.h +1 -1
index 0f494e5..00e8374 100644
@@ -66,7 +66,7 @@
 #define CONFIG_SYS_SDRAM_SIZE		0x08000000
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_MONITOR_IS_IN_RAM
-#define CONFIG_SYS_MONITOR_LEN		0x40000	/* Reserve 256k */
+#define CONFIG_SYS_MONITOR_LEN		0x80000	/* Reserve 512k */
 #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_SDRAM_BASE + \
 					 CONFIG_SYS_SDRAM_SIZE - \
 					 CONFIG_SYS_MONITOR_LEN)
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/5 nios2: Up the monitor size to 512kiB

Hi Marek,

Quoted 30 lines · Marek Vasut

The monitor is growing much larger with various additions, like fitImage, command line completion, UBI etc. Make the monitor area larger so these features can be safely added.

---
  include/configs/10m50_devboard.h | 2 +-
  include/configs/3c120_devboard.h | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
include/configs/10m50_devboard.h +1 -1
index c99177c..68ef6e5 100644
@@ -63,7 +63,7 @@
  #define CONFIG_SYS_SDRAM_SIZE		0x08000000
  #define CONFIG_NR_DRAM_BANKS		1
  #define CONFIG_MONITOR_IS_IN_RAM
-#define CONFIG_SYS_MONITOR_LEN		0x40000	/* Reserve 256k */
+#define CONFIG_SYS_MONITOR_LEN		0x80000	/* Reserve 512k */
  #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_SDRAM_BASE + \
  					 CONFIG_SYS_SDRAM_SIZE - \
  					 CONFIG_SYS_MONITOR_LEN)
include/configs/3c120_devboard.h +0 -0
index 0f494e5..00e8374 100644

include/configs/3c120_devboard.h line 72

Quoted 8 lines
include/configs/3c120_devboard.h +1 -1
@@ -66,7 +66,7 @@
  #define CONFIG_SYS_SDRAM_SIZE		0x08000000
  #define CONFIG_NR_DRAM_BANKS		1
  #define CONFIG_MONITOR_IS_IN_RAM
-#define CONFIG_SYS_MONITOR_LEN		0x40000	/* Reserve 256k */
+#define CONFIG_SYS_MONITOR_LEN		0x80000	/* Reserve 512k */
  #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_SDRAM_BASE + \
  					 CONFIG_SYS_SDRAM_SIZE - \
  					 CONFIG_SYS_MONITOR_LEN)

Thanks,
Thomas

#3 lore raw

PATCH 2/5 nios2: Up the monitor size to 512kiB

In reply to Marek Vasut

Hi Marek,

Quoted 11 lines · Marek Vasut

The monitor is growing much larger with various additions, like fitImage, command line completion, UBI etc. Make the monitor area larger so these features can be safely added.

---
  include/configs/10m50_devboard.h | 2 +-
  include/configs/3c120_devboard.h | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

Applied to u-boot-nios. Thanks.

Best regards,
Thomas

#4 lore raw

PATCH 3/5 nios2: Preconfigure $loadaddr variable

In reply to Marek Vasut

Preset the $loadaddr environment variable to some sane default, let's say half of the RAM. This variable is where the kernel is loaded using all sorts of .*load commands, so it's convenient to have it set.

---
 include/configs/10m50_devboard.h | 3 ++-
 include/configs/3c120_devboard.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
include/configs/10m50_devboard.h +2 -1
index 68ef6e5..608127f 100644
@@ -92,7 +92,8 @@
 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
 					sizeof(CONFIG_SYS_PROMPT) + \
 					 16)	/* Print buf size */
-#define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_LOAD_ADDR		0xcc000000	/* Half of RAM */
+#define CONFIG_LOADADDR			CONFIG_SYS_LOAD_ADDR
 #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MONITOR_BASE - \
 					 CONFIG_ENV_SIZE - \
include/configs/3c120_devboard.h +2 -1
index 00e8374..6c9dc3f 100644
@@ -95,7 +95,8 @@
 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
 					sizeof(CONFIG_SYS_PROMPT) + \
 					 16)	/* Print buf size */
-#define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_LOAD_ADDR		0xd4000000	/* Half of RAM */
+#define CONFIG_LOADADDR			CONFIG_SYS_LOAD_ADDR
 #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MONITOR_BASE - \
 					 CONFIG_ENV_SIZE - \
Signature · 1 line
2.1.4
#5 lore raw

PATCH 3/5 nios2: Preconfigure $loadaddr variable

Hi Marek,

Quoted 31 lines · Marek Vasut

Preset the $loadaddr environment variable to some sane default, let's say half of the RAM. This variable is where the kernel is loaded using all sorts of .*load commands, so it's convenient to have it set.

---
  include/configs/10m50_devboard.h | 3 ++-
  include/configs/3c120_devboard.h | 3 ++-
  2 files changed, 4 insertions(+), 2 deletions(-)
include/configs/10m50_devboard.h +2 -1
index 68ef6e5..608127f 100644
@@ -92,7 +92,8 @@
  #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
  					sizeof(CONFIG_SYS_PROMPT) + \
  					 16)	/* Print buf size */
-#define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_LOAD_ADDR		0xcc000000	/* Half of RAM */
+#define CONFIG_LOADADDR			CONFIG_SYS_LOAD_ADDR
  #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
  #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MONITOR_BASE - \
  					 CONFIG_ENV_SIZE - \
include/configs/3c120_devboard.h +0 -0
index 00e8374..6c9dc3f 100644

include/configs/3c120_devboard.h line 102

Quoted 9 lines
include/configs/3c120_devboard.h +2 -1
@@ -95,7 +95,8 @@
  #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
  					sizeof(CONFIG_SYS_PROMPT) + \
  					 16)	/* Print buf size */
-#define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_LOAD_ADDR		0xd4000000	/* Half of RAM */
+#define CONFIG_LOADADDR			CONFIG_SYS_LOAD_ADDR
  #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
  #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MONITOR_BASE - \
  					 CONFIG_ENV_SIZE - \

Thanks,
Thomas

#6 lore raw

PATCH 3/5 nios2: Preconfigure $loadaddr variable

In reply to Marek Vasut

Hi Marek,

Quoted 11 lines · Marek Vasut

Preset the $loadaddr environment variable to some sane default, let's say half of the RAM. This variable is where the kernel is loaded using all sorts of .*load commands, so it's convenient to have it set.

---
  include/configs/10m50_devboard.h | 3 ++-
  include/configs/3c120_devboard.h | 3 ++-
  2 files changed, 4 insertions(+), 2 deletions(-)

Applied to u-boot-nios. Thanks.

Best regards,
Thomas

#7 lore raw

PATCH 4/5 nios2: Enable support for fitImage

In reply to Marek Vasut

The uImage format is legacy for years now, enable support for the fitImage format, which allows combining multiple files (kernel and dtb) into a single file, offers better protection of the payload and so on.

---
 include/configs/10m50_devboard.h | 2 ++
 include/configs/3c120_devboard.h | 2 ++
 2 files changed, 4 insertions(+)
include/configs/10m50_devboard.h +2 -0
index 608127f..0aa79f7 100644
@@ -14,6 +14,8 @@
  */
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO_LATE
+#define CONFIG_OF_LIBFDT
+#define CONFIG_FIT
 
 /*
  * SERIAL
include/configs/3c120_devboard.h +2 -0
index 6c9dc3f..0054d8b 100644
@@ -14,6 +14,8 @@
  */
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO_LATE
+#define CONFIG_OF_LIBFDT
+#define CONFIG_FIT
 
 /*
  * SERIAL
Signature · 1 line
2.1.4
#8 lore raw

PATCH 4/5 nios2: Enable support for fitImage

Hi Marek,

Quoted 17 lines · Marek Vasut

The uImage format is legacy for years now, enable support for the fitImage format, which allows combining multiple files (kernel and dtb) into a single file, offers better protection of the payload and so on.

---
  include/configs/10m50_devboard.h | 2 ++
  include/configs/3c120_devboard.h | 2 ++
  2 files changed, 4 insertions(+)
include/configs/10m50_devboard.h +0 -0
index 608127f..0aa79f7 100644

include/configs/10m50_devboard.h line 17

Quoted 4 lines
include/configs/10m50_devboard.h +1 -0
@@ -14,6 +14,8 @@
   */
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO_LATE
+#define CONFIG_OF_LIBFDT

Already defined.

include/configs/3c120_devboard.h line 17

Quoted 13 lines
include/configs/10m50_devboard.h +1 -0
+#define CONFIG_FIT
 
  /*
   * SERIAL
include/configs/3c120_devboard.h +1 -0
index 6c9dc3f..0054d8b 100644
@@ -14,6 +14,8 @@
   */
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO_LATE
+#define CONFIG_OF_LIBFDT

Ditto.

include/configs/3c120_devboard.h line 21

Quoted 5 lines
include/configs/3c120_devboard.h +1 -0
+#define CONFIG_FIT
 
  /*
   * SERIAL

Thanks,
Thomas

#9 lore raw

PATCH 4/5 nios2: Enable support for fitImage

Quoted 43 lines · Thomas Chou

Hi Marek,

Quoted 18 lines · Marek Vasut

The uImage format is legacy for years now, enable support for the fitImage format, which allows combining multiple files (kernel and dtb) into a single file, offers better protection of the payload and so on.

---

  include/configs/10m50_devboard.h | 2 ++
  include/configs/3c120_devboard.h | 2 ++
  2 files changed, 4 insertions(+)
(quoted diff) +0 -0

b/include/configs/10m50_devboard.h index 608127f..0aa79f7 100644

include/configs/10m50_devboard.h line 20

Quoted 7 lines
include/configs/10m50_devboard.h +1 -0
@@ -14,6 +14,8 @@
 
   */
 
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO_LATE
 
+#define CONFIG_OF_LIBFDT

Already defined.

Quoted 12 lines
include/configs/10m50_devboard.h +1 -0
+#define CONFIG_FIT

/*

* SERIAL

(quoted diff) +0 -0

b/include/configs/3c120_devboard.h index 6c9dc3f..0054d8b 100644

include/configs/3c120_devboard.h +0 -0
@@ -14,6 +14,8 @@
 
Quoted 14 lines

include/configs/3c120_devboard.h line 20

Quoted 6 lines
include/configs/3c120_devboard.h +1 -0
   */
 
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO_LATE
 
+#define CONFIG_OF_LIBFDT

Ditto.

Quoted 5 lines
include/configs/3c120_devboard.h +1 -0
+#define CONFIG_FIT

/*

* SERIAL

The compiler is not complaining, is it really ?

Best regards,
Marek Vasut

#10 lore raw

PATCH 4/5 nios2: Enable support for fitImage

Hi Marek,

Quoted 53 lines · Marek Vasut
Quoted 52 lines · Thomas Chou

Hi Marek,

Quoted 18 lines · Marek Vasut

The uImage format is legacy for years now, enable support for the fitImage format, which allows combining multiple files (kernel and dtb) into a single file, offers better protection of the payload and so on.

---

   include/configs/10m50_devboard.h | 2 ++
   include/configs/3c120_devboard.h | 2 ++
   2 files changed, 4 insertions(+)
(quoted diff) +0 -0

b/include/configs/10m50_devboard.h index 608127f..0aa79f7 100644

include/configs/10m50_devboard.h line 20

Quoted 7 lines
include/configs/10m50_devboard.h +1 -0
@@ -14,6 +14,8 @@
 
    */
 
   #define CONFIG_DISPLAY_CPUINFO
   #define CONFIG_DISPLAY_BOARDINFO_LATE
 
+#define CONFIG_OF_LIBFDT

Already defined.

Quoted 11 lines
include/configs/10m50_devboard.h +1 -0
+#define CONFIG_FIT

/*

* SERIAL

(quoted diff) +0 -0

b/include/configs/3c120_devboard.h index 6c9dc3f..0054d8b 100644

include/configs/3c120_devboard.h line 20

Quoted 7 lines
include/configs/3c120_devboard.h +1 -0
@@ -14,6 +14,8 @@
 
    */
 
   #define CONFIG_DISPLAY_CPUINFO
   #define CONFIG_DISPLAY_BOARDINFO_LATE
 
+#define CONFIG_OF_LIBFDT

Ditto.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
include/configs/3c120_devboard.h +1 -0
+#define CONFIG_FIT

/*

* SERIAL

The compiler is not complaining, is it really ?

Hmm, it might be the compiler's problem.

It might be better to move CONFIG_FIT to the misc (the last) config section.

Best regards,
Thomas

#11 lore raw

PATCH 4/5 nios2: Enable support for fitImage

Quoted 60 lines · Thomas Chou

Hi Marek,

Quoted 57 lines · Marek Vasut
Quoted 56 lines · Thomas Chou

Hi Marek,

Quoted 18 lines · Marek Vasut

The uImage format is legacy for years now, enable support for the fitImage format, which allows combining multiple files (kernel and dtb) into a single file, offers better protection of the payload and so on.

---

   include/configs/10m50_devboard.h | 2 ++
   include/configs/3c120_devboard.h | 2 ++
   2 files changed, 4 insertions(+)
(quoted diff) +0 -0

b/include/configs/10m50_devboard.h index 608127f..0aa79f7 100644

include/configs/10m50_devboard.h line 20

Quoted 7 lines
include/configs/10m50_devboard.h +1 -0
@@ -14,6 +14,8 @@
 
    */
 
   #define CONFIG_DISPLAY_CPUINFO
   #define CONFIG_DISPLAY_BOARDINFO_LATE
 
+#define CONFIG_OF_LIBFDT

Already defined.

Quoted 11 lines
include/configs/10m50_devboard.h +1 -0
+#define CONFIG_FIT

/*

* SERIAL

(quoted diff) +0 -0

b/include/configs/3c120_devboard.h index 6c9dc3f..0054d8b 100644

include/configs/3c120_devboard.h line 20

Quoted 7 lines
include/configs/3c120_devboard.h +1 -0
@@ -14,6 +14,8 @@
 
    */
 
   #define CONFIG_DISPLAY_CPUINFO
   #define CONFIG_DISPLAY_BOARDINFO_LATE
 
+#define CONFIG_OF_LIBFDT

Ditto.

Quoted 4 lines
include/configs/3c120_devboard.h +1 -0
+#define CONFIG_FIT
   /*
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

* SERIAL

The compiler is not complaining, is it really ?

Hmm, it might be the compiler's problem.

It might be better to move CONFIG_FIT to the misc (the last) config section.

Apparently, if the macro is defined in the same file twice and it is the same, CPP will not complain.

#12 lore raw

PATCH 4/5 nios2: Enable support for fitImage

Hi Marek,

Quoted 65 lines · Marek Vasut
Quoted 64 lines · Thomas Chou

Hi Marek,

Quoted 60 lines · Marek Vasut
Quoted 43 lines · Thomas Chou

Hi Marek,

Quoted 18 lines · Marek Vasut

The uImage format is legacy for years now, enable support for the fitImage format, which allows combining multiple files (kernel and dtb) into a single file, offers better protection of the payload and so on.

---

    include/configs/10m50_devboard.h | 2 ++
    include/configs/3c120_devboard.h | 2 ++
    2 files changed, 4 insertions(+)
(quoted diff) +0 -0

b/include/configs/10m50_devboard.h index 608127f..0aa79f7 100644

include/configs/10m50_devboard.h line 20

Quoted 7 lines
include/configs/10m50_devboard.h +1 -0
@@ -14,6 +14,8 @@
 
     */
 
    #define CONFIG_DISPLAY_CPUINFO
    #define CONFIG_DISPLAY_BOARDINFO_LATE
 
+#define CONFIG_OF_LIBFDT

Already defined.

Quoted 12 lines
include/configs/10m50_devboard.h +1 -0
+#define CONFIG_FIT

/*

* SERIAL

(quoted diff) +0 -0

b/include/configs/3c120_devboard.h index 6c9dc3f..0054d8b 100644

include/configs/3c120_devboard.h +0 -0
@@ -14,6 +14,8 @@
 
Quoted 14 lines

include/configs/3c120_devboard.h line 20

Quoted 6 lines
include/configs/3c120_devboard.h +1 -0
     */
 
    #define CONFIG_DISPLAY_CPUINFO
    #define CONFIG_DISPLAY_BOARDINFO_LATE
 
+#define CONFIG_OF_LIBFDT

Ditto.

Quoted 5 lines
include/configs/3c120_devboard.h +1 -0
+#define CONFIG_FIT

/*

* SERIAL

The compiler is not complaining, is it really ?

Quoted 8 lines
Quoted 4 lines

Hmm, it might be the compiler's problem.

It might be better to move CONFIG_FIT to the misc (the last) config section.

Apparently, if the macro is defined in the same file twice and it is the same, CPP will not complain.

Please note that CONFIG_FIT is moved to Kconfig. So it should be added to defcofnig.

Best regards,
Thomas

#13 lore raw

PATCH 5/5 nios2: Soup up the shell experience

In reply to Marek Vasut

Enable command auto completion and enable $version variable. This makes working with U-Boot far more enjoyable.

---
 include/configs/10m50_devboard.h | 3 +++
 include/configs/3c120_devboard.h | 3 +++
 2 files changed, 6 insertions(+)
include/configs/10m50_devboard.h +3 -0
index 0aa79f7..72d455f0 100644
@@ -101,6 +101,9 @@
 					 CONFIG_ENV_SIZE - \
 					 CONFIG_SYS_MALLOC_LEN -	\
 					 0x10000)
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
 #define CONFIG_CMDLINE_EDITING
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
 
 #endif /* __CONFIG_H */
include/configs/3c120_devboard.h +3 -0
index 0054d8b..ed30d6f 100644
@@ -104,6 +104,9 @@
 					 CONFIG_ENV_SIZE - \
 					 CONFIG_SYS_MALLOC_LEN -	\
 					 0x10000)
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
 #define CONFIG_CMDLINE_EDITING
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
 
 #endif /* __CONFIG_H */
Signature · 1 line
2.1.4
#14 lore raw

PATCH 5/5 nios2: Soup up the shell experience

Hi Marek,

Quoted 15 lines · Marek Vasut

Enable command auto completion and enable $version variable. This makes working with U-Boot far more enjoyable.

---
  include/configs/10m50_devboard.h | 3 +++
  include/configs/3c120_devboard.h | 3 +++
  2 files changed, 6 insertions(+)
include/configs/10m50_devboard.h +0 -0
index 0aa79f7..72d455f0 100644

include/configs/10m50_devboard.h line 107

Quoted 7 lines
include/configs/10m50_devboard.h +3 -0
@@ -101,6 +101,9 @@
  					 CONFIG_ENV_SIZE - \
  					 CONFIG_SYS_MALLOC_LEN -	\
  					 0x10000)
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
  #define CONFIG_CMDLINE_EDITING
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "

This is the default value in common/cli_hush.c.

Quoted 7 lines
include/configs/10m50_devboard.h +0 -0
  #endif /* __CONFIG_H */
include/configs/3c120_devboard.h +0 -0
index 0054d8b..ed30d6f 100644

include/configs/3c120_devboard.h line 110

Quoted 7 lines
include/configs/3c120_devboard.h +3 -0
@@ -104,6 +104,9 @@
  					 CONFIG_ENV_SIZE - \
  					 CONFIG_SYS_MALLOC_LEN -	\
  					 0x10000)
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
  #define CONFIG_CMDLINE_EDITING
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "

Ditto.

include/configs/3c120_devboard.h line 112

Quoted 3 lines
include/configs/3c120_devboard.h +0 -0
  #endif /* __CONFIG_H */
 

Thanks,
Thomas

#15 lore raw

PATCH 5/5 nios2: Soup up the shell experience

Quoted 45 lines · Thomas Chou

Hi Marek,

Quoted 17 lines · Marek Vasut

Enable command auto completion and enable $version variable. This makes working with U-Boot far more enjoyable.

---

  include/configs/10m50_devboard.h | 3 +++
  include/configs/3c120_devboard.h | 3 +++
  2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/include/configs/10m50_devboard.h index 0aa79f7..72d455f0 100644

include/configs/10m50_devboard.h +0 -0
@@ -101,6 +101,9 @@
 

include/configs/10m50_devboard.h

Quoted 10 lines
include/configs/10m50_devboard.h +3 -0
  					 CONFIG_ENV_SIZE - \
  					 CONFIG_SYS_MALLOC_LEN -	\
  					 0x10000)
 
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
 
  #define CONFIG_CMDLINE_EDITING
 
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "

This is the default value in common/cli_hush.c.

Quoted 12 lines
  #endif /* __CONFIG_H */
(quoted diff) +0 -0

b/include/configs/3c120_devboard.h index 0054d8b..ed30d6f 100644

include/configs/3c120_devboard.h +0 -0
@@ -104,6 +104,9 @@
 
  					 CONFIG_ENV_SIZE - \
  					 CONFIG_SYS_MALLOC_LEN -	\
  					 0x10000)
 
Quoted 8 lines

include/configs/3c120_devboard.h

Quoted 6 lines
include/configs/3c120_devboard.h +3 -0
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
 
  #define CONFIG_CMDLINE_EDITING
 
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "

Ditto.

Oops, thanks, nice catch.

Can you pick 1-3 ? I will re-post 4,5 then.

Best regards,
Marek Vasut

#16 lore raw

PATCH 5/5 nios2: Soup up the shell experience

In reply to Thomas Chou
Quoted 45 lines · Thomas Chou

Hi Marek,

Quoted 17 lines · Marek Vasut

Enable command auto completion and enable $version variable. This makes working with U-Boot far more enjoyable.

---

  include/configs/10m50_devboard.h | 3 +++
  include/configs/3c120_devboard.h | 3 +++
  2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/include/configs/10m50_devboard.h index 0aa79f7..72d455f0 100644

include/configs/10m50_devboard.h +0 -0
@@ -101,6 +101,9 @@
 

include/configs/10m50_devboard.h

Quoted 10 lines
include/configs/10m50_devboard.h +3 -0
  					 CONFIG_ENV_SIZE - \
  					 CONFIG_SYS_MALLOC_LEN -	\
  					 0x10000)
 
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
 
  #define CONFIG_CMDLINE_EDITING
 
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "

This is the default value in common/cli_hush.c.

Quoted 12 lines
  #endif /* __CONFIG_H */
(quoted diff) +0 -0

b/include/configs/3c120_devboard.h index 0054d8b..ed30d6f 100644

include/configs/3c120_devboard.h +0 -0
@@ -104,6 +104,9 @@
 
  					 CONFIG_ENV_SIZE - \
  					 CONFIG_SYS_MALLOC_LEN -	\
  					 0x10000)
 
Quoted 8 lines

include/configs/3c120_devboard.h

Quoted 6 lines
include/configs/3c120_devboard.h +3 -0
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
 
  #define CONFIG_CMDLINE_EDITING
 
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "

Ditto.

Two patches are about to head your way.

Best regards,
Marek Vasut

#17 lore raw

PATCH 1/5 nios2: Calculate the env position from monitor size

In reply to Marek Vasut

Hi Marek,

Quoted 90 lines · Marek Vasut

Reorder the 10m50 and 3c120 config files such, that the environment position can be calculated from the monitor size. The environment is placed right after the monitor. This removes one more ad-hoc variable.

---
  include/configs/10m50_devboard.h | 26 +++++++++++++-------------
  include/configs/3c120_devboard.h | 26 +++++++++++++-------------
  2 files changed, 26 insertions(+), 26 deletions(-)
include/configs/10m50_devboard.h +13 -13
index 8a91cdb..c99177c 100644
@@ -54,19 +54,6 @@
  #define CONFIG_LMB
 
  /*
- * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
- * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
- * reset address, no? This will keep the environment in user region
- * of flash. NOTE: the monitor length must be multiple of sector size
- * (which is common practice).
- */
-#define CONFIG_ENV_IS_IN_FLASH
-
-#define CONFIG_ENV_SIZE			0x10000	/* 64k, 1 sector */
-#define CONFIG_ENV_OVERWRITE		/* Serial change Ok	*/
-#define CONFIG_ENV_ADDR			0xf4040000
-
-/*
   * MEMORY ORGANIZATION
   * -Monitor at top of sdram.
   * -The heap is placed below the monitor
@@ -83,6 +70,19 @@
  #define CONFIG_SYS_MALLOC_LEN		0x20000
 
  /*
+ * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
+ * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
+ * reset address, no? This will keep the environment in user region
+ * of flash. NOTE: the monitor length must be multiple of sector size
+ * (which is common practice).
+ */
+#define CONFIG_ENV_IS_IN_FLASH
+
+#define CONFIG_ENV_SIZE			0x10000	/* 64k, 1 sector */
+#define CONFIG_ENV_OVERWRITE		/* Serial change Ok	*/
+#define CONFIG_ENV_ADDR			(0xf4000000 + CONFIG_SYS_MONITOR_LEN)
+
+/*
   * MISC
   */
  #define CONFIG_SYS_LONGHELP		/* Provide extended help */
include/configs/3c120_devboard.h +6 -13
index 2ecdd5d..0f494e5 100644
@@ -57,19 +57,6 @@
  #define CONFIG_LMB
 
  /*
- * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
- * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
- * reset address, no? This will keep the environment in user region
- * of flash. NOTE: the monitor length must be multiple of sector size
- * (which is common practice).
- */
-#define CONFIG_ENV_IS_IN_FLASH
-
-#define CONFIG_ENV_SIZE			0x20000	/* 128k, 1 sector */
-#define CONFIG_ENV_OVERWRITE		/* Serial change Ok	*/
-#define CONFIG_ENV_ADDR			0xe2840000
-
-/*
   * MEMORY ORGANIZATION
   * -Monitor at top of sdram.
   * -The heap is placed below the monitor
@@ -86,6 +73,19 @@
  #define CONFIG_SYS_MALLOC_LEN		0x20000
 
  /*
+ * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
+ * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
+ * reset address, no? This will keep the environment in user region
+ * of flash. NOTE: the monitor length must be multiple of sector size
+ * (which is common practice).
+ */

include/configs/3c120_devboard.h line 91

Quoted 10 lines
include/configs/3c120_devboard.h +7 -0
+#define CONFIG_ENV_IS_IN_FLASH
+
+#define CONFIG_ENV_SIZE			0x20000	/* 128k, 1 sector */
+#define CONFIG_ENV_OVERWRITE		/* Serial change Ok	*/
+#define CONFIG_ENV_ADDR			(0xe2800000 + CONFIG_SYS_MONITOR_LEN)
+
+/*
   * MISC
   */
  #define CONFIG_SYS_LONGHELP		/* Provide extended help */

Thanks,
Thomas

#18 lore raw

PATCH 1/5 nios2: Calculate the env position from monitor size

In reply to Marek Vasut

Hi Marek,

Quoted 11 lines · Marek Vasut

Reorder the 10m50 and 3c120 config files such, that the environment position can be calculated from the monitor size. The environment is placed right after the monitor. This removes one more ad-hoc variable.

---
  include/configs/10m50_devboard.h | 26 +++++++++++++-------------
  include/configs/3c120_devboard.h | 26 +++++++++++++-------------
  2 files changed, 26 insertions(+), 26 deletions(-)

Applied to u-boot-nios. Thanks.