ftsmc020: enhanced features and unnested structures
PATCH v2 1/1 ftsmc020: enhanced features and unnested structures
1. Enhance ftsmc020 according to datasheets.
2. Fix relocation related declaration.
---
Changes for v2:
- Remove assembly register offsets for support lowlevel_init.S.
- The nested structure of register offsets has been rewrote.
- Fix relocation related declaration.
Note:
This patch should be applied after patch "[U-Boot,v2,4/4] ftsmc020: move ftsmc020 static mem controller to
driver/mtd"
(/patch/87862/) is applied.
drivers/mtd/ftsmc020.c | 7 +++---- include/faraday/ftsmc020.h | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 10 deletions(-)
drivers/mtd/ftsmc020.c +0 -4
@@ -27,12 +27,10 @@ struct ftsmc020_config {unsigned int timing; }; -static struct ftsmc020_config config[] =CONFIG_SYS_FTSMC020_CONFIGS ; - -static struct ftsmc020 *smc = (struct ftsmc020 *)CONFIG_FTSMC020_BASE ; - static void ftsmc020_setup_bank(unsigned int bank, struct ftsmc020_config
*cfg)
{
+ struct ftsmc020 *smc = (struct ftsmc020 *)CONFIG_FTSMC020_BASE;
+
if (bank > 3) {
printf("bank # %u invalid\n", bank); return;
@@ -44,6 +42,7 @@ static void ftsmc020_setup_bank(unsigned int bank, struct ftsmc020_config *cfg)
void ftsmc020_init(void)
{
+ struct ftsmc020_config config[] = CONFIG_SYS_FTSMC020_CONFIGS;
int i;
for (i = 0; i < ARRAY_SIZE(config); i++)
include/faraday/ftsmc020.h +13 -6
@@ -25,13 +25,15 @@#ifndef __ASSEMBLY__ +struct ftsmc020_bank { +unsigned int cr; +unsigned int tpr; +}; +struct ftsmc020 { -struct { -unsigned int cr;/* 0x00, 0x08, 0x10, 0x18 */ -unsigned int tpr;/* 0x04, 0x0c, 0x14, 0x1c */ - } bank[4 ]; -unsigned int pad[8 ];/* 0x20 - 0x3c */ -unsigned int ssr;/* 0x40 */ +struct ftsmc020_bank bank[4 ];/* 0x00 - 0x1c */ +unsigned int pad[8 ];/* 0x20 - 0x3c */ +unsigned int ssr;/* 0x40 */ };void ftsmc020_init (void );
@@ -46,6 +48,10 @@ void ftsmc020_init(void);#define FTSMC020_BANK_WPROT (1 << 11) +#define FTSMC020_BANK_TYPE1 (1 << 10) +#define FTSMC020_BANK_TYPE2 (1 << 9) +#define FTSMC020_BANK_TYPE3 (1 << 8) +#define FTSMC020_BANK_SIZE_32K (0xb << 4)#define FTSMC020_BANK_SIZE_64K (0xc << 4)#define FTSMC020_BANK_SIZE_128K (0xd << 4)
@@ -57,6 +63,7 @@ void ftsmc020_init(void);#define FTSMC020_BANK_SIZE_8M (0x3 << 4)#define FTSMC020_BANK_SIZE_16M (0x4 << 4)#define FTSMC020_BANK_SIZE_32M (0x5 << 4) +#define FTSMC020_BANK_SIZE_64M (0x6 << 4)#define FTSMC020_BANK_MBW_8 (0x0 << 0)#define FTSMC020_BANK_MBW_16 (0x1 << 0)
Signature · 16 lines
1.7.3.5 CONFIDENTIALITY NOTICE: This e-mail (and its attachments) may contain confidential and legally privileged information or information protected from disclosure. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein is strictly prohibited. In this case, please immediately notify the sender by return e-mail, delete the message (and any accompanying documents) and destroy all printed hard copies. Thank you for your cooperation. Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.
PATCH v2 1/1 ftsmc020: enhanced features and unnested structures
Dear "Macpaul Lin",
Quoted 4 lines · In message <[email protected]> you wrote:
1. Enhance ftsmc020 according to datasheets.
2. Fix relocation related declaration.Signed-off-by Macpaul Lin <[email protected]>
...
Quoted 4 lines
CONFIDENTIALITY NOTICE:
This e-mail (and its attachments) may contain confidential and legally privileged information or information protected from disclosure. If you
...
Message ignored as instructed.
Best regards,
Wolfgang Denk
Signature · 4 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 Due to lack of disk space, this fortune database has been discontinued.
PATCH v3 1/3 ftsmc020: fix relocation
In reply to Macpaul LinAvoid relocation problem by fix global declaration.
---
Changes for v2:
- Remove assembly register offsets for support lowlevel_init.S.
- The nested structure of register offsets has been rewrote.
- Fix relocation related declaration.
Changes for v3:
- Split this patch into 3 different patches according to Wolfgang's suggestion
- Fix gloable declarations to avoid problem in relocation.
- Un-nested the register structure.
- Add missing definitions in header according to datasheet.
drivers/mtd/ftsmc020.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/mtd/ftsmc020.c +3 -4
@@ -27,12 +27,10 @@ struct ftsmc020_config {unsigned int timing; }; -static struct ftsmc020_config config[] =CONFIG_SYS_FTSMC020_CONFIGS ; - -static struct ftsmc020 *smc = (struct ftsmc020 *)CONFIG_FTSMC020_BASE ; -static void ftsmc020_setup_bank (unsigned int bank,struct ftsmc020_config *cfg) { +struct ftsmc020 *smc = (struct ftsmc020 *)CONFIG_FTSMC020_BASE ; +if (bank >3 ) {printf ("bank # %u invalid\n" , bank);return ;
@@ -44,6 +42,7 @@ static void ftsmc020_setup_bank(unsigned int bank, struct ftsmc020_config *cfg)void ftsmc020_init (void ) { +struct ftsmc020_config config[] =CONFIG_SYS_FTSMC020_CONFIGS ;int i;for (i =0 ; i <ARRAY_SIZE (config); i++)
Signature · 1 line
1.7.3.5
Wolfgang Denk
AppliedPATCH v3 1/3 ftsmc020: fix relocation
Dear Macpaul Lin,
Quoted 14 lines · In message <[email protected]> you wrote:
Avoid relocation problem by fix global declaration.
Signed-off-by Macpaul Lin <[email protected]>---
Changes for v2:
- Remove assembly register offsets for supportlowlevel_init.S.
- The nested structure of register offsets has been rewrote.
- Fix relocation related declaration.
Changes for v3:
- Split this patch into 3 different patches according to Wolfgang's suggestion
- Fix gloable declarations to avoid problem in relocation.
- Un-nested the register structure.
- Add missing definitions in header according to datasheet.
Quoted 2 lines
drivers/mtd/ftsmc020.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
Applied, thanks.
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 I really hate this damned machine It never does quite what I want I wish that they would sell it. But only what I tell it.
PATCH v3 2/3 ftsmc020: un-nest the register structure in header
In reply to Macpaul LinUn-nestted the register structure in ftsmc020.h
---
Changes for v2:
- Remove assembly register offsets for support lowlevel_init.S.
- The nested structure of register offsets has been rewrote.
- Fix relocation related declaration.
Changes for v3:
- Split this patch into 3 different patches according to Wolfgang's suggestion
- Fix gloable declarations to avoid problem in relocation.
- Un-nested the register structure.
- Add missing definitions in header according to datasheet.
include/faraday/ftsmc020.h | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-)
include/faraday/ftsmc020.h +8 -6
@@ -25,13 +25,15 @@#ifndef __ASSEMBLY__ +struct ftsmc020_bank { +unsigned int cr; +unsigned int tpr; +}; +struct ftsmc020 { -struct { -unsigned int cr;/* 0x00, 0x08, 0x10, 0x18 */ -unsigned int tpr;/* 0x04, 0x0c, 0x14, 0x1c */ - } bank[4 ]; -unsigned int pad[8 ];/* 0x20 - 0x3c */ -unsigned int ssr;/* 0x40 */ +struct ftsmc020_bank bank[4 ];/* 0x00 - 0x1c */ +unsigned int pad[8 ];/* 0x20 - 0x3c */ +unsigned int ssr;/* 0x40 */ };void ftsmc020_init (void );
Signature · 1 line
1.7.3.5
Wolfgang Denk
AppliedPATCH v3 2/3 ftsmc020: un-nest the register structure in header
Dear Macpaul Lin,
Quoted 14 lines · In message <[email protected]> you wrote:
Un-nestted the register structure in
ftsmc020.hSigned-off-by Macpaul Lin <[email protected]>---
Changes for v2:
- Remove assembly register offsets for supportlowlevel_init.S.
- The nested structure of register offsets has been rewrote.
- Fix relocation related declaration.
Changes for v3:
- Split this patch into 3 different patches according to Wolfgang's suggestion
- Fix gloable declarations to avoid problem in relocation.
- Un-nested the register structure.
- Add missing definitions in header according to datasheet.
Quoted 2 lines
include/faraday/ftsmc020.h | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-)
Applied, thanks.
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 Men will always be men -- no matter where they are. -- Harry Mudd, "Mudd's Women", stardate 1329.8
PATCH v3 3/3 ftsmc020: add missing definitions
In reply to Macpaul LinAdd missing definitions in header file according to datasheet.
---
Changes for v2:
- Remove assembly register offsets for support lowlevel_init.S.
- The nested structure of register offsets has been rewrote.
- Fix relocation related declaration.
Changes for v3:
- Split this patch into 3 different patches according to Wolfgang's suggestion
- Fix gloable declarations to avoid problem in relocation.
- Un-nested the register structure.
- Add missing definitions in header according to datasheet.
include/faraday/ftsmc020.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
include/faraday/ftsmc020.h +5 -0
@@ -48,6 +48,10 @@ void ftsmc020_init(void);#define FTSMC020_BANK_WPROT (1 << 11) +#define FTSMC020_BANK_TYPE1 (1 << 10) +#define FTSMC020_BANK_TYPE2 (1 << 9) +#define FTSMC020_BANK_TYPE3 (1 << 8) +#define FTSMC020_BANK_SIZE_32K (0xb << 4)#define FTSMC020_BANK_SIZE_64K (0xc << 4)#define FTSMC020_BANK_SIZE_128K (0xd << 4)
@@ -59,6 +63,7 @@ void ftsmc020_init(void);#define FTSMC020_BANK_SIZE_8M (0x3 << 4)#define FTSMC020_BANK_SIZE_16M (0x4 << 4)#define FTSMC020_BANK_SIZE_32M (0x5 << 4) +#define FTSMC020_BANK_SIZE_64M (0x6 << 4)#define FTSMC020_BANK_MBW_8 (0x0 << 0)#define FTSMC020_BANK_MBW_16 (0x1 << 0)
Signature · 1 line
1.7.3.5
Wolfgang Denk
AppliedPATCH v3 3/3 ftsmc020: add missing definitions
Dear Macpaul Lin,
Quoted 14 lines · In message <[email protected]> you wrote:
Add missing definitions in header file according to datasheet.
Signed-off-by Macpaul Lin <[email protected]>---
Changes for v2:
- Remove assembly register offsets for supportlowlevel_init.S.
- The nested structure of register offsets has been rewrote.
- Fix relocation related declaration.
Changes for v3:
- Split this patch into 3 different patches according to Wolfgang's suggestion
- Fix gloable declarations to avoid problem in relocation.
- Un-nested the register structure.
- Add missing definitions in header according to datasheet.
Quoted 2 lines
include/faraday/ftsmc020.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 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 Tactical? TACTICAL!?!? Hey, buddy, we went from kilotons to megatons several minutes ago. We don't need no stinkin' tactical nukes. (By the way, do you have change for 10 million people?) - lwall