Skip to contentSkip to conversation

How to Change the DDR3 Speed to low in U-boot

U-Boot Balaji Sivakumar 1 participant 2 messages Feb 27, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Balaji Sivakumar

#1 lore raw
In reply to a message not in the archive

Hi,

I have verified the lowlwevel_init.s file but there are not initializing DDR3. They do only following instructions,

"Invalidate_dcache

Init L2 cache

Init AIPS

Init Clock"

And in the "mx6q_saberlite.C" board file they are just doing "dram_init" , this function does only banks and its size.

I want to control the speed of the DDR3 Bus , Can anyone guide me?

Thanks,
Balaji S

-----Original Message-----
From: Balaji Sivakumar, ERS, HCLTech
Sent: Monday, February 27, 2012 4:40 PM
To: 'u-boot-owner at lists.denx.de'
Subject: How to Change the DDR3 Speed to low in U-boot

Hi,

Am working on Freescale's IMX6 based Custom Board. I have done some changes according to my board specific design.

But I want currently to set the DDR3 speed to low, I have gone through the lowlevel_init.s file but am not sure which register to change.

Can you please guide me at which place I have to change?

Thanks
Balaji S

-----Original Message-----
From: [email protected] [mailto:u-boot-bounces at lists.denx.de] On Behalf Of u-boot-request at lists.denx.de
Sent: Monday, February 27, 2012 4:30 PM
To: u-boot at lists.denx.de
Subject: U-Boot Digest, Vol 45, Issue 34

Send U-Boot mailing list submissions to
u-boot at lists.denx.de

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.denx.de/mailman/listinfo/u-boot
or, via email, send a message with subject or body 'help' to
u-boot-request at lists.denx.de

You can reach the person managing the list at
u-boot-owner at lists.denx.de

When replying, please edit your Subject line so it is more specific than "Re: Contents of U-Boot digest..."

Today's Topics:

1. [PATCH 2/3] SPEAr: Configure FSMC driver for NAND interface (Amit Virdi)
2. [PATCH 3/3] mtd/NAND: Remove obsolete SPEAr specific NAND drivers (Amit Virdi)
3. Re: [PATCH 2/3] SPEAr: Configure FSMC driver for NAND interface (Stefan Roese)
4. Re: [PATCH] USB:host: Attribute packed removed from usb structures (Amit Virdi)
5. Re: [PATCH 2/3] SPEAr: Configure FSMC driver for NAND interface (Amit Virdi)
6. Re: [PATCH v4 07/13] davinci: Use correct #ifdef around gdata/bdata (Sughosh Ganu)
7. Re: [PATCH 03/11] st_smi: Return error in case TFF is not set (Stefan Roese)
8. Re: [PATCH v4 07/13] davinci: Use correct #ifdef around gdata/bdata (Christian Riesch)
9. Re: [PATCH v4 07/13] davinci: Use correct #ifdef around gdata/bdata (Sughosh Ganu)

----------------------------------------------------------------------

Message: 1
Date: Mon, 27 Feb 2012 15:08:23 +0530
From: Amit Virdi <[email protected]>
Subject: [U-Boot] [PATCH 2/3] SPEAr: Configure FSMC driver for NAND
interface
To: <[email protected]>
Cc: armando.visconti at st.com, shiraz.hashim at st.com, Amit Virdi
<[email protected]>, scottwood at freescale.com, sr at denx.de
Message-ID: <[email protected]>
Content-Type: text/plain

From: Vipin KUMAR <[email protected]>

Since FSMC is a standard IP and it supports different memory interfaces, it is supported independent of spear platform and spear is configured to use that driver for interfacing with the NAND device

---
 arch/arm/include/asm/arch-spear/hardware.h |    8 ++++----
 board/spear/spear300/spear300.c            |    7 ++++---
 board/spear/spear310/spear310.c            |    7 ++++---
 board/spear/spear320/spear320.c            |    7 ++++---
 board/spear/spear600/spear600.c            |    7 ++++---
 include/configs/spear-common.h             |    2 +-
 include/configs/spear3xx.h                 |    4 ++++
 include/configs/spear6xx.h                 |    3 +++
 8 files changed, 28 insertions(+), 17 deletions(-)
arch/arm/include/asm/arch-spear/hardware.h +4 -4
index 818f36c..a6517b2 100644
@@ -37,15 +37,15 @@
 
 #if defined(CONFIG_SPEAR600)
 #define CONFIG_SYS_I2C_BASE                    (0xD0200000)
-#define CONFIG_SPEAR_FSMCBASE                  (0xD1800000)
+#define CONFIG_SYS_FSMC_BASE                   (0xD1800000)
 
 #elif defined(CONFIG_SPEAR300)
 #define CONFIG_SYS_I2C_BASE                    (0xD0180000)
-#define CONFIG_SPEAR_FSMCBASE                  (0x94000000)
+#define CONFIG_SYS_FSMC_BASE                   (0x94000000)
 
 #elif defined(CONFIG_SPEAR310)
 #define CONFIG_SYS_I2C_BASE                    (0xD0180000)
-#define CONFIG_SPEAR_FSMCBASE                  (0x44000000)
+#define CONFIG_SYS_FSMC_BASE                   (0x44000000)
 
 #undef CONFIG_SYS_NAND_CLE
 #undef CONFIG_SYS_NAND_ALE
@@ -57,7 +57,7 @@
 
 #elif defined(CONFIG_SPEAR320)
 #define CONFIG_SYS_I2C_BASE                    (0xD0180000)
-#define CONFIG_SPEAR_FSMCBASE                  (0x4C000000)
+#define CONFIG_SYS_FSMC_BASE                   (0x4C000000)
 
 #define CONFIG_SPEAR_EMIBASE                   (0x40000000)
 #define CONFIG_SPEAR_RASBASE                   (0xB3000000)
board/spear/spear300/spear300.c +4 -3
index 60ee544..32bcb77 100644
@@ -24,10 +24,10 @@
 #include <common.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -46,13 +46,14 @@ int board_nand_init(struct nand_chip *nand)
        struct misc_regs *const misc_regs_p =
            (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
        if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
             MISC_SOCCFG30) ||
            ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
             MISC_SOCCFG31)) {
 
-               return spear_nand_init(nand);
+               return fsmc_nand_init(nand);
        }
-
+#endif
        return -1;
 }
board/spear/spear310/spear310.c +4 -3
index 03dfe16..8b58218 100644
@@ -25,10 +25,10 @@
 #include <common.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -47,13 +47,14 @@ int board_nand_init(struct nand_chip *nand)
        struct misc_regs *const misc_regs_p =
            (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
        if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
             MISC_SOCCFG30) ||
            ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
             MISC_SOCCFG31)) {
 
-               return spear_nand_init(nand);
+               return fsmc_nand_init(nand);
        }
-
+#endif
        return -1;
 }
board/spear/spear320/spear320.c +4 -3
index 2ba2dbb..172ad35 100644
@@ -25,10 +25,10 @@
 #include <common.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -47,13 +47,14 @@ int board_nand_init(struct nand_chip *nand)
        struct misc_regs *const misc_regs_p =
            (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
        if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
             MISC_SOCCFG30) ||
            ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
             MISC_SOCCFG31)) {
 
-               return spear_nand_init(nand);
+               return fsmc_nand_init(nand);
        }
-
+#endif
        return -1;
 }
board/spear/spear600/spear600.c +4 -3
index eef9a37..7cf63d6 100644
@@ -24,10 +24,10 @@
 #include <common.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -46,8 +46,9 @@ int board_nand_init(struct nand_chip *nand)
        struct misc_regs *const misc_regs_p =
            (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
        if (!(readl(&misc_regs_p->auto_cfg_reg) & MISC_NANDDIS))
-               return spear_nand_init(nand);
-
+               return fsmc_nand_init(nand);
+#endif
        return -1;
 }
include/configs/spear-common.h +1 -1
index 516b78e..c37305f 100644
@@ -90,7 +90,7 @@
 /* NAND FLASH Configuration */
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_PARTITIONS
-#define CONFIG_NAND_SPEAR                      1
+#define CONFIG_NAND_FSMC
 #define CONFIG_SYS_MAX_NAND_DEVICE             1
 #define CONFIG_MTD_NAND_VERIFY_WRITE
 
include/configs/spear3xx.h +4 -0
index bd5d111..5bdd874 100644
@@ -117,6 +117,10 @@
 
 #endif
 
+/* NAND flash configuration */
+#define CONFIG_SYS_FSMC_NAND_SP
+#define CONFIG_SYS_FSMC_NAND_8BIT
+
 #if defined(CONFIG_SPEAR300)
 #define CONFIG_SYS_NAND_BASE                   0x80000000
 
include/configs/spear6xx.h +3 -0
index 8de7ebd..1e06c72 100644
@@ -38,6 +38,9 @@
 #define CONFIG_PL01x_PORTS                     { (void *)CONFIG_SYS_SERIAL0, \
                                                (void *)CONFIG_SYS_SERIAL1 }
 
+/* NAND flash configuration */
+#define CONFIG_SYS_FSMC_NAND_SP
+#define CONFIG_SYS_FSMC_NAND_8BIT
 #define CONFIG_SYS_NAND_BASE                   (0xD2000000)
 
 #endif  /* __CONFIG_H */

--
1.7.2.2

------------------------------

Message: 2
Date: Mon, 27 Feb 2012 15:08:24 +0530
From: Amit Virdi <[email protected]>
Subject: [U-Boot] [PATCH 3/3] mtd/NAND: Remove obsolete SPEAr specific
NAND drivers
To: <[email protected]>
Cc: armando.visconti at st.com, shiraz.hashim at st.com, Amit Virdi
<[email protected]>, scottwood at freescale.com, sr at denx.de
Message-ID: <[email protected]>
Content-Type: text/plain

From: Vipin KUMAR <[email protected]>

Since, SPEAr platform uses generic FSMC driver now, so spear specific files drivers/mtd/nand/spr_nand.c, arch/arm/include/asm/arch-spear/spr_nand.h are removed

---
 arch/arm/include/asm/arch-spear/spr_nand.h |   57 -------------
 drivers/mtd/nand/spr_nand.c                |  124 ----------------------------
 2 files changed, 0 insertions(+), 181 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-spear/spr_nand.h
 delete mode 100644 drivers/mtd/nand/spr_nand.c
arch/arm/include/asm/arch-spear/spr_nand.h deleted +0 -57

57 lines not on this page · raw message

drivers/mtd/nand/spr_nand.c deleted +0 -124

124 lines not on this page · raw message

--
1.7.2.2

------------------------------

Message: 3
Date: Mon, 27 Feb 2012 11:02:18 +0100
From: Stefan Roese <[email protected]>
Subject: Re: [U-Boot] [PATCH 2/3] SPEAr: Configure FSMC driver for
NAND interface
To: u-boot at lists.denx.de
Cc: armando.visconti at st.com, shiraz.hashim at st.com, Amit Virdi
<[email protected]>, scottwood at freescale.com
Message-ID: <[email protected]>
Content-Type: Text/Plain; charset="iso-8859-1"

Hi Amit,

please find a few comments below.

Quoted 24 lines · On Monday 27 February 2012 10:38:23 Amit Virdi wrote:

From: Vipin KUMAR <[email protected]>

Since FSMC is a standard IP and it supports different memory interfaces, it is supported independent of spear platform and spear is configured to use that driver for interfacing with the NAND device

---
 arch/arm/include/asm/arch-spear/hardware.h |    8 ++++----
 board/spear/spear300/spear300.c            |    7 ++++---
 board/spear/spear310/spear310.c            |    7 ++++---
 board/spear/spear320/spear320.c            |    7 ++++---
 board/spear/spear600/spear600.c            |    7 ++++---
 include/configs/spear-common.h             |    2 +-
 include/configs/spear3xx.h                 |    4 ++++
 include/configs/spear6xx.h                 |    3 +++
 8 files changed, 28 insertions(+), 17 deletions(-)
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-spear/hardware.h index 818f36c..a6517b2 100644

arch/arm/include/asm/arch-spear/hardware.h line 40

Quoted 5 lines
arch/arm/include/asm/arch-spear/hardware.h +1 -1
@@ -37,15 +37,15 @@
 
 #if defined(CONFIG_SPEAR600)
 #define CONFIG_SYS_I2C_BASE                  (0xD0200000)
-#define CONFIG_SPEAR_FSMCBASE                        (0xD1800000)
+#define CONFIG_SYS_FSMC_BASE                 (0xD1800000)

Please remove the parentheses here as they are not needed. Should be done to all those defines, perhaps in a cosmetic cleanup patch at some time as well:

+#define CONFIG_SYS_FSMC_BASE 0xD1800000

Quoted 153 lines
arch/arm/include/asm/arch-spear/hardware.h +3 -3
 #elif defined(CONFIG_SPEAR300)
 #define CONFIG_SYS_I2C_BASE                  (0xD0180000)
-#define CONFIG_SPEAR_FSMCBASE                        (0x94000000)
+#define CONFIG_SYS_FSMC_BASE                 (0x94000000)
 
 #elif defined(CONFIG_SPEAR310)
 #define CONFIG_SYS_I2C_BASE                  (0xD0180000)
-#define CONFIG_SPEAR_FSMCBASE                        (0x44000000)
+#define CONFIG_SYS_FSMC_BASE                 (0x44000000)
 
 #undef CONFIG_SYS_NAND_CLE
 #undef CONFIG_SYS_NAND_ALE
@@ -57,7 +57,7 @@
 
 #elif defined(CONFIG_SPEAR320)
 #define CONFIG_SYS_I2C_BASE                  (0xD0180000)
-#define CONFIG_SPEAR_FSMCBASE                        (0x4C000000)
+#define CONFIG_SYS_FSMC_BASE                 (0x4C000000)
 
 #define CONFIG_SPEAR_EMIBASE                 (0x40000000)
 #define CONFIG_SPEAR_RASBASE                 (0xB3000000)
(quoted diff) +0 -0

b/board/spear/spear300/spear300.c index 60ee544..32bcb77 100644

board/spear/spear300/spear300.c +4 -3
@@ -24,10 +24,10 @@
 #include <common.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -46,13 +46,14 @@ int board_nand_init(struct nand_chip *nand)
      struct misc_regs *const misc_regs_p =
          (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
      if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
           MISC_SOCCFG30) ||
          ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
           MISC_SOCCFG31)) {
 
-             return spear_nand_init(nand);
+             return fsmc_nand_init(nand);
      }
-
+#endif
      return -1;
 }
(quoted diff) +0 -0

b/board/spear/spear310/spear310.c index 03dfe16..8b58218 100644

board/spear/spear310/spear310.c +4 -3
@@ -25,10 +25,10 @@
 #include <common.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -47,13 +47,14 @@ int board_nand_init(struct nand_chip *nand)
      struct misc_regs *const misc_regs_p =
          (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
      if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
           MISC_SOCCFG30) ||
          ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
           MISC_SOCCFG31)) {
 
-             return spear_nand_init(nand);
+             return fsmc_nand_init(nand);
      }
-
+#endif
      return -1;
 }
(quoted diff) +0 -0

b/board/spear/spear320/spear320.c index 2ba2dbb..172ad35 100644

board/spear/spear320/spear320.c +4 -3
@@ -25,10 +25,10 @@
 #include <common.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -47,13 +47,14 @@ int board_nand_init(struct nand_chip *nand)
      struct misc_regs *const misc_regs_p =
          (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
      if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
           MISC_SOCCFG30) ||
          ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
           MISC_SOCCFG31)) {
 
-             return spear_nand_init(nand);
+             return fsmc_nand_init(nand);
      }
-
+#endif
      return -1;
 }
(quoted diff) +0 -0

b/board/spear/spear600/spear600.c index eef9a37..7cf63d6 100644

board/spear/spear600/spear600.c +4 -3
@@ -24,10 +24,10 @@
 #include <common.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -46,8 +46,9 @@ int board_nand_init(struct nand_chip *nand)
      struct misc_regs *const misc_regs_p =
          (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
      if (!(readl(&misc_regs_p->auto_cfg_reg) & MISC_NANDDIS))
-             return spear_nand_init(nand);
-
+             return fsmc_nand_init(nand);
+#endif
      return -1;
 }
(quoted diff) +0 -0

b/include/configs/spear-common.h index 516b78e..c37305f 100644

include/configs/spear-common.h line 95

Quoted 7 lines
include/configs/spear-common.h +1 -1
@@ -90,7 +90,7 @@
 /* NAND FLASH Configuration */
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_PARTITIONS
-#define CONFIG_NAND_SPEAR                    1
+#define CONFIG_NAND_FSMC
 #define CONFIG_SYS_MAX_NAND_DEVICE           1
 #define CONFIG_MTD_NAND_VERIFY_WRITE

I suggest that you remove this last define. Most likely it was added for debugging purpose only. It slows down the speed and it brakes UBI support.

Quoted 20 lines
include/configs/spear3xx.h +4 -0
index bd5d111..5bdd874 100644
@@ -117,6 +117,10 @@
 
 #endif
 
+/* NAND flash configuration */
+#define CONFIG_SYS_FSMC_NAND_SP
+#define CONFIG_SYS_FSMC_NAND_8BIT
+
 #if defined(CONFIG_SPEAR300)
 #define CONFIG_SYS_NAND_BASE                 0x80000000
 
include/configs/spear6xx.h +0 -0
index 8de7ebd..1e06c72 100644

include/configs/spear6xx.h line 38

Quoted 1 line
include/configs/spear6xx.h +0 -0
@@ -38,6 +38,9 @@
 #define CONFIG_PL01x_PORTS                   { (void

*)CONFIG_SYS_SERIAL0, \

include/configs/spear6xx.h line 39

Quoted 1 line
include/configs/spear6xx.h +0 -0
                                              (void

*)CONFIG_SYS_SERIAL1 }

include/configs/spear6xx.h line 42

Quoted 4 lines
include/configs/spear6xx.h +3 -0
+/* NAND flash configuration */
+#define CONFIG_SYS_FSMC_NAND_SP
+#define CONFIG_SYS_FSMC_NAND_8BIT

You also need the following define for this to work with the latest NAND subsystem:

#define CONFIG_MTD_ECC_SOFT

Not sure about SPEAr3xx. Most likely this needs it as well.

Thanks,
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

------------------------------

Message: 4
Date: Mon, 27 Feb 2012 15:32:14 +0530
From: Amit Virdi <[email protected]>
Subject: Re: [U-Boot] [PATCH] USB:host: Attribute packed removed from
usb structures
To: Mike Frysinger <[email protected]>
Cc: Armando VISCONTI <[email protected]>, "u-boot at lists.denx.de"
<[email protected]>, "sr at denx.de" <[email protected]>, Shiraz HASHIM <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed

Hello Mike,

Quoted 5 lines · Mike Frysinger
Quoted 2 lines · On Friday 24 February 2012 06:58:40 Amit Virdi wrote:

Packed attribute is forcing a bytewise write on device registers, there by, resulting in a misbehavior on gcc-4.4.1.

so use a compiler that isn't broken ?

It doesn't seem like compiler issue (on ARM).

Thanks
Amit Virdi

------------------------------

Message: 5
Date: Mon, 27 Feb 2012 15:45:11 +0530
From: Amit Virdi <[email protected]>
Subject: Re: [U-Boot] [PATCH 2/3] SPEAr: Configure FSMC driver for
NAND interface
To: Stefan Roese <[email protected]>
Cc: Armando VISCONTI <[email protected]>, "u-boot at lists.denx.de"
<[email protected]>, "scottwood at freescale.com"
<[email protected]>, Shiraz HASHIM <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed

Hello Stefan,

Quoted 30 lines · Stefan Roese

Hi Amit,

please find a few comments below.

Quoted 25 lines · On Monday 27 February 2012 10:38:23 Amit Virdi wrote:

From: Vipin KUMAR<[email protected]>

Since FSMC is a standard IP and it supports different memory interfaces, it is supported independent of spear platform and spear is configured to use that driver for interfacing with the NAND device

---
  arch/arm/include/asm/arch-spear/hardware.h |    8 ++++----
  board/spear/spear300/spear300.c            |    7 ++++---
  board/spear/spear310/spear310.c            |    7 ++++---
  board/spear/spear320/spear320.c            |    7 ++++---
  board/spear/spear600/spear600.c            |    7 ++++---
  include/configs/spear-common.h             |    2 +-
  include/configs/spear3xx.h                 |    4 ++++
  include/configs/spear6xx.h                 |    3 +++
  8 files changed, 28 insertions(+), 17 deletions(-)
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-spear/hardware.h index 818f36c..a6517b2 100644

arch/arm/include/asm/arch-spear/hardware.h +0 -0
@@ -37,15 +37,15 @@
 
Quoted 8 lines

arch/arm/include/asm/arch-spear/hardware.h line 40

Quoted 4 lines
arch/arm/include/asm/arch-spear/hardware.h +1 -1
  #if defined(CONFIG_SPEAR600)
  #define CONFIG_SYS_I2C_BASE                        (0xD0200000)
-#define CONFIG_SPEAR_FSMCBASE                       (0xD1800000)
+#define CONFIG_SYS_FSMC_BASE                        (0xD1800000)

Please remove the parentheses here as they are not needed. Should be done to all those defines, perhaps in a cosmetic cleanup patch at some time as well:

Yes. I'll be sending a separate cleanup commit.

Quoted 3 lines

+#define CONFIG_SYS_FSMC_BASE 0xD1800000

Quoted 1 line
arch/arm/include/asm/arch-spear/hardware.h +0 -0
  #elif defined(CONFIG_SPEAR300)

<snip>

Quoted 7 lines
Quoted 7 lines
(quoted diff) +0 -0

b/include/configs/spear-common.h index 516b78e..c37305f 100644

include/configs/spear-common.h +0 -0
@@ -90,7 +90,7 @@
  /* NAND FLASH Configuration */
  #define CONFIG_MTD_DEVICE
Quoted 9 lines

include/configs/spear-common.h line 95

Quoted 5 lines
include/configs/spear-common.h +1 -1
  #define CONFIG_MTD_PARTITIONS
-#define CONFIG_NAND_SPEAR                   1
+#define CONFIG_NAND_FSMC
  #define CONFIG_SYS_MAX_NAND_DEVICE         1
  #define CONFIG_MTD_NAND_VERIFY_WRITE

I suggest that you remove this last define. Most likely it was added for debugging purpose only. It slows down the speed and it brakes UBI support.

Ok.

Quoted 32 lines
Quoted 20 lines
include/configs/spear3xx.h +4 -0
index bd5d111..5bdd874 100644
@@ -117,6 +117,10 @@
 
  #endif
 
+/* NAND flash configuration */
+#define CONFIG_SYS_FSMC_NAND_SP
+#define CONFIG_SYS_FSMC_NAND_8BIT
+
  #if defined(CONFIG_SPEAR300)
  #define CONFIG_SYS_NAND_BASE                       0x80000000
 
include/configs/spear6xx.h +0 -0
index 8de7ebd..1e06c72 100644

include/configs/spear6xx.h line 38

Quoted 1 line
include/configs/spear6xx.h +0 -0
@@ -38,6 +38,9 @@
  #define CONFIG_PL01x_PORTS                 { (void

*)CONFIG_SYS_SERIAL0, \

include/configs/spear6xx.h line 39

Quoted 1 line
include/configs/spear6xx.h +0 -0
                                             (void

*)CONFIG_SYS_SERIAL1 }

include/configs/spear6xx.h line 42

Quoted 4 lines
include/configs/spear6xx.h +3 -0
+/* NAND flash configuration */
+#define CONFIG_SYS_FSMC_NAND_SP
+#define CONFIG_SYS_FSMC_NAND_8BIT

You also need the following define for this to work with the latest NAND subsystem:

Quoted 4 lines

#define CONFIG_MTD_ECC_SOFT

Not sure about SPEAr3xx. Most likely this needs it as well.

Ok. I'll verify the image after the making the changes you suggested and then get back.

Thanks
Amit Virdi

------------------------------

Message: 6
Date: Mon, 27 Feb 2012 15:46:13 +0530
From: Sughosh Ganu <[email protected]>
Subject: Re: [U-Boot] [PATCH v4 07/13] davinci: Use correct #ifdef
around gdata/bdata
To: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>, U-Boot Mailing List
<[email protected]>, hs at denx.de
Message-ID: <20120227101613.GA2183@Hardy>
Content-Type: text/plain; charset="iso-8859-1"

hi Simon,

Quoted 39 lines · Simon Glass

Hi Sughosh,

Quoted 25 lines · Sughosh Ganu
include/configs/spear6xx.h +0 -0
 hi Simon,
 
Quoted 22 lines · Simon Glass

This fixes the following warnings in an SPL build when libcommon is in use:

spl.c:37: warning: 'gdata' defined but not used
spl.c:38: warning: 'bdata' defined but not used

---
Changes in v4:
- Add new patch to fix davinci build warnings

?arch/arm/cpu/arm926ejs/davinci/spl.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

arch/arm/cpu/arm926ejs/davinci/spl.c +0 -0
index b1eff26..2861907 100644
@@ -32,10 +32,12 @@
 

?#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT

Quoted 10 lines
Quoted 6 lines

+#ifdef CONFIG_SPL_SPI_LOAD ?DECLARE_GLOBAL_DATA_PTR;
?/* Define global data structure pointer to it*/ ?static gd_t gdata __attribute__ ((section(".data"))); ?static bd_t bdata __attribute__ ((section(".data"))); +#endif

?Can you specify which boards you get this warning for. With your ?patch to add libcommon to hawkboard's spl image, this is now also ?needed for hawkboard which uses CONFIG_SPL_NAND_LOAD.

Quoted 2 lines

Perhaps it is any davinci board, with SPI? I don't have any of these - I was just fixing what I thought was a minor #ifdef bug in the code.

I checked the configs for all the davinci boards, and cam_enc_4xx, da850* and hawkboard use spl. Out of these the da850* use a spi flash, while cam_enc_4xx and hawkboard both use a nand. So we should not be using the CONFIG_SPL_SPI_LOAD check to exclude the gdata and bdata objects -- these are now needed after adding the libcommon support to the hawkboard.

Also, the cam_enc_4xx board which uses a spl does not have CONFIG_SPL_LIBCOMMON_SUPPORT and CONFIG_SPL_LIBGENERIC_SUPPORT defined and this patchset does not add these defines for the board. Was adding these defines for the board missed out. If so, then this patch would no longer be needed.

-sughosh

------------------------------

Message: 7
Date: Mon, 27 Feb 2012 11:26:18 +0100
From: Stefan Roese <[email protected]>
Subject: Re: [U-Boot] [PATCH 03/11] st_smi: Return error in case TFF
is not set
To: Amit Virdi <[email protected]>
Cc: armando.visconti at st.com, u-boot at lists.denx.de,
shiraz.hashim at st.com
Message-ID: <[email protected]>
Content-Type: Text/Plain; charset="iso-8859-15"

Quoted 21 lines · On Friday 24 February 2012 13:23:06 Amit Virdi wrote:

Curently the code makes wrong assumption that the Transfer finished flag shall be set within the stipulated time. However, there may occur a scenario in which the TFF flag is not set. Return error in that case.

---
 drivers/mtd/st_smi.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)
drivers/mtd/st_smi.c +1 -1
index 82f1fe1..ec19b0d 100644
@@ -58,13 +58,15 @@ static struct flash_dev flash_ids[] = {
  *
  * Wait until TFF is set in status register
  */
-static void smi_wait_xfer_finish(int timeout)
+static int smi_wait_xfer_finish(int timeout)
 {

drivers/mtd/st_smi.c static struct flash_dev flash_ids[] = { · line 69

Quoted 10 lines
drivers/mtd/st_smi.c +5 -3
-     while (timeout--) {
+     do {
              if (readl(&smicntl->smi_sr) & TFF)
-                     break;
+                     return 0;
              udelay(1000);
-     }
+     } while (timeout--);
+
+     return -1;

Somewhat unrelated to the patch topic, but I don't really like this kind of timeout loops. Since it always adds at least 1ms delay after initial failing test. Better use something like this:

static int smi_wait_xfer_finish(int timeout)

{
        ulong start = get_timer(0);

        while (get_timer(start) < timeout) {
                if (readl(&smicntl->smi_sr) & TFF)
                        return 0;

                /* Try again after 100usec */
                udelay(100);
        }

        return -1;
}

You could tune this udelay(100) down more or even remove it completely.

But such a change could be done in a addon cleanup patch, changing all timeout loops this way. I suggest you take a look at my version, here these loops are changes. In the designware networking driver as well, iirc.

Thanks,
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

------------------------------

Message: 8
Date: Mon, 27 Feb 2012 11:39:42 +0100
From: Christian Riesch <[email protected]>
Subject: Re: [U-Boot] [PATCH v4 07/13] davinci: Use correct #ifdef
around gdata/bdata
To: Sughosh Ganu <[email protected]>
Cc: Tom Rini <[email protected]>, U-Boot Mailing List
<[email protected]>, hs at denx.de
Message-ID:
<CABkLObrRUcyio2n3gOVf7Q89iXKfiBdemwHXNsJ4PEAjn3gG3A@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi,

Quoted 29 lines · Sughosh Ganu
drivers/mtd/st_smi.c +0 -0
 hi Simon,
 
Quoted 26 lines · Simon Glass

Hi Sughosh,

Quoted 23 lines · Sughosh Ganu

hi Simon,

Quoted 20 lines · Simon Glass

This fixes the following warnings in an SPL build when libcommon is in use:

spl.c:37: warning: 'gdata' defined but not used
spl.c:38: warning: 'bdata' defined but not used

---
Changes in v4:
- Add new patch to fix davinci build warnings

?arch/arm/cpu/arm926ejs/davinci/spl.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

arch/arm/cpu/arm926ejs/davinci/spl.c +0 -0
index b1eff26..2861907 100644
@@ -32,10 +32,12 @@
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

?#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT

+#ifdef CONFIG_SPL_SPI_LOAD ?DECLARE_GLOBAL_DATA_PTR;
?/* Define global data structure pointer to it*/ ?static gd_t gdata __attribute__ ((section(".data"))); ?static bd_t bdata __attribute__ ((section(".data"))); +#endif

In arch/arm/cpu/arm926ejs/davinci/spl.c gdata and bdata are used for serial_init() to allow output to the console from the SPL. However, this is only the case when LIBCOMMON is used. LIBCOMMON is required for booting from SPI, but not for booting from NAND. Up to now davinci boards that boot from NAND with SPL did not use LIBCOMMON but used the puts and putc functions defined in spl.c for console output.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

?Can you specify which boards you get this warning for. With your ?patch to add libcommon to hawkboard's spl image, this is now also ?needed for hawkboard which uses CONFIG_SPL_NAND_LOAD.

Simon's patch is for the hawkboard, since due to another patch in his patchset LIBCOMMON is enabled in hawkboard's SPL. Now we have a board that boots from NAND with SPL and has LIBCOMMON enabled (Simon, I did not check the rest of your patchset, why do you need LIBCOMMON on the hawkboard at all?)

However, the patch fixes the warning, but now we use putc and puts from LIBCOMMON without initializing them. Thus it breaks the console output of the hawkboard SPL.

So the correct solution would be to keep the ifdefs around the definition of gdata and bdata as they are, but change board_init_f() like this:

void board_init_r(gd_t *id, ulong dummy)
{

#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
        mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
                        CONFIG_SYS_MALLOC_LEN);

        gd = &gdata;
        gd->bd = &bdata;
        gd->flags |= GD_FLG_RELOC;
        gd->baudrate = CONFIG_BAUDRATE;
        serial_init();          /* serial communications setup */
        gd->have_console = 1;
#endif
#ifdef CONFIG_SPL_NAND_LOAD
        nand_init();
        puts("Nand boot...\n");
        nand_boot();
#endif
#ifdef CONFIG_SPL_SPI_LOAD
        puts("SPI boot...\n");
        spi_boot();

#endif
}

Regards, Christian

------------------------------

Message: 9
Date: Mon, 27 Feb 2012 16:26:28 +0530
From: Sughosh Ganu <[email protected]>
Subject: Re: [U-Boot] [PATCH v4 07/13] davinci: Use correct #ifdef
around gdata/bdata
To: Christian Riesch <[email protected]>
Cc: Tom Rini <[email protected]>, U-Boot, hs at denx.de, List

        <[email protected]>

Message-ID: <20120227105628.GA2991@Hardy>
Content-Type: text/plain; charset="iso-8859-1"

hi Christian,

Quoted 3 lines · Christian Riesch

Hi,

On Mon, Feb 27, 2012 at 11:16 AM, Sughosh Ganu <[email protected]> wrote:

<snip>

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

?arch/arm/cpu/arm926ejs/davinci/spl.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

arch/arm/cpu/arm926ejs/davinci/spl.c +0 -0
index b1eff26..2861907 100644
@@ -32,10 +32,12 @@
 

?#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT

+#ifdef CONFIG_SPL_SPI_LOAD ?DECLARE_GLOBAL_DATA_PTR;
?/* Define global data structure pointer to it*/ ?static gd_t gdata __attribute__ ((section(".data"))); ?static bd_t bdata __attribute__ ((section(".data"))); +#endif

<snip>

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

?Can you specify which boards you get this warning for. With your ?patch to add libcommon to hawkboard's spl image, this is now also ?needed for hawkboard which uses CONFIG_SPL_NAND_LOAD.

Simon's patch is for the hawkboard, since due to another patch in his patchset LIBCOMMON is enabled in hawkboard's SPL. Now we have a board that boots from NAND with SPL and has LIBCOMMON enabled (Simon, I did not check the rest of your patchset, why do you need LIBCOMMON on the hawkboard at all?)

LIBCOMMON is now needed as the generic relocation based functions are part of the libcommon.o, which are being enabled in the same patchset for all arm boards. So if i understand correct, all arm board based spl's now need libcommon and libgeneric.

The only thing i see is that libcommon and libgeneric are not defined for cam_enc_4xx board which uses spl, and this patchset does not add it either. Not sure whether it got missed.

Quoted 7 lines

However, the patch fixes the warning, but now we use putc and puts from LIBCOMMON without initializing them. Thus it breaks the console output of the hawkboard SPL.

So the correct solution would be to keep the ifdefs around the definition of gdata and bdata as they are, but change board_init_f() like this:

I have a patch for this, which i will send today. There is only one question i have though.

Quoted 6 lines

void board_init_r(gd_t *id, ulong dummy)
{
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
CONFIG_SYS_MALLOC_LEN);

Can you please explain why we need the mem_malloc_init. I did not include this, and spl boots up just fine on my board.

-sughosh

------------------------------

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

End of U-Boot Digest, Vol 45, Issue 34
**************************************

::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------

#2 lore raw

[U-Boot] REg : EIM Registers Configuration Required or Not to access NOR Flash in Flash_Header.s File

In reply to a message not in the archive

Hi,

Am using IMX6 processor based board. I am customizing U-boot for my design.

In my board I have NOR Flash which is connected via EIM CS0 port. My question do I have to add any DCD Settings for EIM registers, because IMX6 RM document they mentioned You can use DCD for configuring EIM and MMDC. But they also mentioned " the EIM default settings allow the core to interface to a NOR flash device immediately out of reset. This allows the Chip to interface with any NOR flash device,but has the cost of slow performance"

What they are meaning here "it cost of slow performance"

Can anyone guide me??

Thank,

Balaji S

-

::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------