TQM85xx: adapt for new flash types
PATCH 1/1 TQM85xx: adapt for new flash types
Old TQM85xx boards had 'M' type Spansion Flashes from the S29GLxxxM series while new boards have 'N' type Flashes from the S29GLxxxN series, which have bigger sectors: 2 x 128 instead of 2 x 64 KB.
We now change the configuration to the new flash types for all boards; this also works on old boards - we just waste two flash sectors for the environment which could be smaller there.
--- include/configs/TQM85xx.h | 13 ------------- 1 files changed, 0 insertions(+), 13 deletions(-)
include/configs/TQM85xx.h +0 -13
@@ -166,15 +166,6 @@#endif /* CONFIG_TQM8541 || CONFIG_TQM8555 || CONFIG_TQM8548 */ /* -* Old TQM85xx boards have 'M' type Spansion Flashes from the S29GLxxxM -* series while new boards have 'N' type Flashes from the S29GLxxxN -* series, which have bigger sectors: 2 x 128 instead of 2 x 64 KB. -*/ -#ifdef CONFIG_TQM8548 -#define CONFIG_TQM_FLASH_N_TYPE -#endif /* CONFIG_TQM8548 */ - -/* * Flash on the Local Bus */ #ifdef CONFIG_TQM_BIGFLASH
@@ -547,11 +538,7 @@*/ #define CONFIG_ENV_IS_IN_FLASH 1 -#ifdef CONFIG_TQM_FLASH_N_TYPE #define CONFIG_ENV_SECT_SIZE 0x40000/* 256K (one sector) for env */ -#else /* !CONFIG_TQM_FLASH_N_TYPE */ -#define CONFIG_ENV_SECT_SIZE 0x20000/* 128K (one sector) for env */ -#endif /* CONFIG_TQM_FLASH_N_TYPE */ #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)#define CONFIG_ENV_SIZE 0x2000#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR - CONFIG_ENV_SECT_SIZE)
Signature · 1 line
1.6.0.6
PATCH 1/1 TQM85xx: minor config file cleanup
Remove "saveenv" from "update" definition: the environment is outside the U-Boot image on TQM85xx and therefor not affected by updates.
Also "beautify" code a bit (vertical alignment).
--- include/configs/TQM85xx.h | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
include/configs/TQM85xx.h +3 -4
@@ -667,7 +667,7 @@#define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_ENV_BOOTFILE \ CONFIG_ENV_FDT_FILE \ - CONFIG_ENV_CONSDEV \ + CONFIG_ENV_CONSDEV \ "netdev=eth0\0" \ "nfsargs=setenv bootargs root=/dev/nfs rw " \ "nfsroot=$serverip:$rootpath\0" \
@@ -691,12 +691,11 @@"fdt_addr=ffec0000\0" \"kernel_addr=ffd00000\0" \"ramdisk_addr=ff800000\0" \ -CONFIG_ENV_UBOOT \ +CONFIG_ENV_UBOOT \"load=tftp 100000 $uboot\0" \"update=protect off $uboot_addr +$filesize;" \"erase $uboot_addr +$filesize;" \ -"cp.b 100000 $uboot_addr $filesize;" \ -"setenv filesize;saveenv\0" \ +"cp.b 100000 $uboot_addr $filesize" \"upd=run load update\0" \"" #define CONFIG_BOOTCOMMAND "run flash_self"
Signature · 1 line
1.6.0.6
PATCH 1/1 TQM85xx: minor config file cleanup
Dear Andy,
Quoted 9 lines · In message <[email protected]> you wrote:
Remove "saveenv" from "update" definition: the environment is outside the U-Boot image on TQM85xx and therefor not affected by updates.
Also "beautify" code a bit (vertical alignment).
Signed-off-by Wolfgang Denk <[email protected]>--- include/configs/TQM85xx.h | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
Applied directly, hope this is OK with you.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Boss, n.: According to the Oxford English Dictionary, in the Middle Ages the words "boss" and "botch" were largely synonymous, except that boss, in addition to meaning "a supervisor of workers" also meant "an ornamental stud."
PATCH 1/1 Redundant Environment: protect full sector size
In reply to Wolfgang DenkSeveral boards used different ways to specify the size of the protected area when enabling flash write protection for the sectors holding the environment variables: some used CONFIG_ENV_SIZE and CONFIG_ENV_SIZE_REDUND, some used CONFIG_ENV_SECT_SIZE, and some even a mix of both for the "normal" and the "redundant" areas.
Normally, this makes no difference at all. However, things are different when you have to deal with boards that can come with different types of flash chips, which may have different sector sizes.
Here we may have to chose CONFIG_ENV_SECT_SIZE such that it fits the biggest sector size, which may include several sectors on boards using the smaller sector flash types. In such a case, using CONFIG_ENV_SIZE or CONFIG_ENV_SIZE_REDUND to enable the protection may lead to the case that only the first of these sectors get protected, while the following ones aren't.
This is no real problem, but it can be confusing for the user - especially on boards that use CONFIG_ENV_SECT_SIZE to protect the "normal" areas, while using CONFIG_ENV_SIZE_REDUND for the "redundant" area.
To avoid such inconsistencies, I changed all sucn boards that I found to consistently use CONFIG_ENV_SECT_SIZE for protection. This should not cause any functional changes to the code.
--- board/lpd7a40x/flash.c | 4 ++-- board/mcc200/mcc200.c | 2 +- board/netphone/flash.c | 4 ++-- board/netta/flash.c | 4 ++-- board/netta2/flash.c | 4 ++-- board/netvia/flash.c | 4 ++-- board/pleb2/flash.c | 4 ++-- board/prodrive/pdnb3/flash.c | 2 +- board/rmu/flash.c | 6 +++--- board/samsung/smdk2400/flash.c | 4 ++-- board/sixnet/flash.c | 4 ++-- board/socrates/socrates.c | 2 +- board/tqc/tqm85xx/tqm85xx.c | 2 +- board/trab/flash.c | 4 ++-- drivers/mtd/cfi_flash.c | 2 +- 15 files changed, 26 insertions(+), 26 deletions(-)
board/lpd7a40x/flash.c +2 -2
@@ -98,12 +98,12 @@ ulong flash_init (void)flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR , -CONFIG_ENV_ADDR +CONFIG_ENV_SIZE -1 , &flash_info[0 ]); +CONFIG_ENV_ADDR +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#ifdef CONFIG_ENV_ADDR_REDUND flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif
board/mcc200/mcc200.c +1 -1
@@ -270,7 +270,7 @@ int misc_init_r (void)/* Redundant environment protection ON by default */ flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[CONFIG_SYS_MAX_FLASH_BANKS -1 ]); }
board/netphone/flash.c +2 -2
@@ -73,13 +73,13 @@ unsigned long flash_init(void)flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR , -CONFIG_ENV_ADDR +CONFIG_ENV_SIZE -1 , +CONFIG_ENV_ADDR +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#ifdef CONFIG_ENV_ADDR_REDUND flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif
board/netta/flash.c +2 -2
@@ -69,13 +69,13 @@ unsigned long flash_init(void)flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR , -CONFIG_ENV_ADDR +CONFIG_ENV_SIZE -1 , +CONFIG_ENV_ADDR +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#ifdef CONFIG_ENV_ADDR_REDUND flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif
board/netta2/flash.c +2 -2
@@ -70,13 +70,13 @@ unsigned long flash_init(void)flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR , -CONFIG_ENV_ADDR +CONFIG_ENV_SIZE -1 , +CONFIG_ENV_ADDR +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#ifdef CONFIG_ENV_ADDR_REDUND flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif
board/netvia/flash.c +2 -2
@@ -69,13 +69,13 @@ unsigned long flash_init(void)flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR , -CONFIG_ENV_ADDR +CONFIG_ENV_SIZE -1 , +CONFIG_ENV_ADDR +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#ifdef CONFIG_ENV_ADDR_REDUND flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif
board/pleb2/flash.c +2 -2
@@ -110,13 +110,13 @@ unsigned long flash_init (void)#ifdef CONFIG_ENV_ADDR flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR , -CONFIG_ENV_ADDR +CONFIG_ENV_SIZE -1 , &flash_info[0 ]); +CONFIG_ENV_ADDR +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif #ifdef CONFIG_ENV_ADDR_REDUND flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif
board/prodrive/pdnb3/flash.c +1 -1
@@ -78,7 +78,7 @@ unsigned long flash_init(void)/* Redundant environment protection ON by default */ flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[CONFIG_SYS_MAX_FLASH_BANKS -1 ]); flash_info[0 ].size = size;
board/rmu/flash.c +3 -3
@@ -85,18 +85,18 @@ unsigned long flash_init (void)/* ENV protection ON by default */ flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR , -CONFIG_ENV_ADDR +CONFIG_ENV_SIZE -1 , +CONFIG_ENV_ADDR +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif #if defined(CONFIG_ENV_ADDR_REDUND ) || defined(CONFIG_ENV_OFFSET_REDUND )debug ("Protect redundand environment: %08lx ... %08lx\n" , (ulong )CONFIG_ENV_ADDR_REDUND , - (ulong )CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE -1 ); + (ulong )CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 );flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif
board/samsung/smdk2400/flash.c +2 -2
@@ -98,12 +98,12 @@ ulong flash_init (void)flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR , -CONFIG_ENV_ADDR +CONFIG_ENV_SIZE -1 , &flash_info[0 ]); +CONFIG_ENV_ADDR +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#ifdef CONFIG_ENV_ADDR_REDUND flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif
board/sixnet/flash.c +2 -2
@@ -111,13 +111,13 @@ unsigned long flash_init (void)#ifdef CONFIG_ENV_ADDR flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR , -CONFIG_ENV_ADDR +CONFIG_ENV_SIZE -1 , &flash_info[0 ]); +CONFIG_ENV_ADDR +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif #ifdef CONFIG_ENV_ADDR_REDUND flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif
board/socrates/socrates.c +1 -1
@@ -136,7 +136,7 @@ int misc_init_r (void)/* Redundant environment protection ON by default */ flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[CONFIG_SYS_MAX_FLASH_BANKS -1 ]); }
board/tqc/tqm85xx/tqm85xx.c +1 -1
@@ -328,7 +328,7 @@ int misc_init_r (void)/* Redundant environment protection ON by default */ flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[CONFIG_SYS_MAX_FLASH_BANKS -1 ]);#endif
board/trab/flash.c +2 -2
@@ -108,12 +108,12 @@ ulong flash_init (void)flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR , -CONFIG_ENV_ADDR +CONFIG_ENV_SIZE -1 , &flash_info[0 ]); +CONFIG_ENV_ADDR +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#ifdef CONFIG_ENV_ADDR_REDUND flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif
drivers/mtd/cfi_flash.c +1 -1
@@ -2098,7 +2098,7 @@ unsigned long flash_init (void)#ifdef CONFIG_ENV_ADDR_REDUND flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SIZE_REDUND -1 , +CONFIG_ENV_ADDR_REDUND +CONFIG_ENV_SECT_SIZE -1 ,flash_get_info (CONFIG_ENV_ADDR_REDUND ));#endif
Signature · 1 line
1.6.0.6
PATCH 1/1 Redundant Environment: protect full sector size
Quoted 27 lines · On Friday 15 May 2009 00:16:03 Wolfgang Denk wrote:
Several boards used different ways to specify the size of the protected area when enabling flash write protection for the sectors holding the environment variables: some used
CONFIG_ENV_SIZEandCONFIG_ENV_SIZE_REDUND, some usedCONFIG_ENV_SECT_SIZE, and some even a mix of both for the "normal" and the "redundant" areas.Normally, this makes no difference at all. However, things are different when you have to deal with boards that can come with different types of flash chips, which may have different sector sizes.
Here we may have to chose
CONFIG_ENV_SECT_SIZEsuch that it fits the biggest sector size, which may include several sectors on boards using the smaller sector flash types. In such a case, usingCONFIG_ENV_SIZEorCONFIG_ENV_SIZE_REDUNDto enable the protection may lead to the case that only the first of these sectors get protected, while the following ones aren't.This is no real problem, but it can be confusing for the user - especially on boards that use
CONFIG_ENV_SECT_SIZEto protect the "normal" areas, while usingCONFIG_ENV_SIZE_REDUNDfor the "redundant" area.To avoid such inconsistencies, I changed all sucn boards that I found to consistently use
CONFIG_ENV_SECT_SIZEfor protection. This should not cause any functional changes to the code.
Quoted 6 lines
Signed-off-by Wolfgang Denk <[email protected]>Cc Paul RuhlandCc Pantelis Antoniou <[email protected]>Cc Stefan Roese <[email protected]>Cc Gary Jennejohn <[email protected]>Cc Dave Ellis <[email protected]>
Thanks.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
Wolfgang Denk
AppliedPATCH 1/1 Redundant Environment: protect full sector size
In reply to Wolfgang DenkHello,
Quoted 42 lines · In message <[email protected]> you wrote:
Several boards used different ways to specify the size of the protected area when enabling flash write protection for the sectors holding the environment variables: some used
CONFIG_ENV_SIZEandCONFIG_ENV_SIZE_REDUND, some usedCONFIG_ENV_SECT_SIZE, and some even a mix of both for the "normal" and the "redundant" areas.Normally, this makes no difference at all. However, things are different when you have to deal with boards that can come with different types of flash chips, which may have different sector sizes.
Here we may have to chose
CONFIG_ENV_SECT_SIZEsuch that it fits the biggest sector size, which may include several sectors on boards using the smaller sector flash types. In such a case, usingCONFIG_ENV_SIZEorCONFIG_ENV_SIZE_REDUNDto enable the protection may lead to the case that only the first of these sectors get protected, while the following ones aren't.This is no real problem, but it can be confusing for the user - especially on boards that use
CONFIG_ENV_SECT_SIZEto protect the "normal" areas, while usingCONFIG_ENV_SIZE_REDUNDfor the "redundant" area.To avoid such inconsistencies, I changed all sucn boards that I found to consistently use
CONFIG_ENV_SECT_SIZEfor protection. This should not cause any functional changes to the code.Signed-off-by Wolfgang Denk <[email protected]>Cc Paul RuhlandCc Pantelis Antoniou <[email protected]>Cc Stefan Roese <[email protected]>Cc Gary Jennejohn <[email protected]>Cc Dave Ellis <[email protected]>--- board/lpd7a40x/flash.c | 4 ++-- board/mcc200/mcc200.c | 2 +- board/netphone/flash.c | 4 ++-- board/netta/flash.c | 4 ++-- board/netta2/flash.c | 4 ++-- board/netvia/flash.c | 4 ++-- board/pleb2/flash.c | 4 ++-- board/prodrive/pdnb3/flash.c | 2 +-
Quoted 8 lines
board/rmu/flash.c | 6 +++--- board/samsung/smdk2400/flash.c | 4 ++-- board/sixnet/flash.c | 4 ++-- board/socrates/socrates.c | 2 +- board/tqc/tqm85xx/tqm85xx.c | 2 +- board/trab/flash.c | 4 ++-- drivers/mtd/cfi_flash.c | 2 +- 15 files changed, 26 insertions(+), 26 deletions(-)
Applied to master.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If that makes any sense to you, you have a big problem."
-- C. Durance, Computer Science 234PATCH 1/1 TQM85xx: adapt for new flash types
In reply to Wolfgang DenkDear Andy,
Quoted 4 lines · In message <[email protected]> you wrote:
Old TQM85xx boards had 'M' type Spansion Flashes from the S29GLxxxM series while new boards have 'N' type Flashes from the S29GLxxxN series, which have bigger sectors: 2 x 128 instead of 2 x 64 KB.
Quoted 8 lines
We now change the configuration to the new flash types for all boards; this also works on old boards - we just waste two flash sectors for the environment which could be smaller there.
Signed-off-by Wolfgang Denk <[email protected]>--- include/configs/TQM85xx.h | 13 ------------- 1 files changed, 0 insertions(+), 13 deletions(-)
Applied directly, hope this is OK with you.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de I think that all right-thinking people in this country are sick and tired of being told that ordinary decent people are fed up in this country with being sick and tired. I'm certainly not. But I'm sick and tired of being told that I am. - Monty Python