[U-Boot-Users] Update for 5329

Stefan,
Here is the updates: 1. Update-CONFIG_MCFUART.patch 2. Added-common-define-CONFIG_CF_MII-for-do_mii.patch 3. Moved-sync-from-m5329evb.c-to-include-asm-m68k-io.patch 4. Added-uart_gpio_conf-for-port-configuration.patch 5. Update-timer.patch 6. Added-fsl_i2c-header-file.patch 7. Added-NAND-Flash-support-and-I2C-support.patch 8. Added-GPIO-enabled-for-I2C-signals.patch
Note: NAND support still partially incomplete, unable to read/write. Erase, bad, markbad, lock, unlock and info seems working.
Thanks,
Regards, TsiChung

Hi TsiChung,
I've ported u-boot 1.1.6 over to the LPC3180 (arm926ejs core) and have included NAND support. The nand_write_ecc function in drivers/nand/nand_base.c appears to be writing pages correctly, but the pointer to the source data in memory for nand_verify_pages does not seem to be updated correctly. Specifically, line 1707 in nand_base.c contains: this->data_poi = bufstart; However, the problem is that bufstart is never updated, and always points to the beginning of the data source, causing all nand_page_verify calls to compare the newest written pages in NAND flash to the beginning of the data source. After the first block NAND writing fails due to nand_verify_pages failing. To fix this I added in: bufstart += (1 << this->phys_erase_shift);
Have you seen this problem? Or has anyone else run into this problem? Or is there something I'm missing?
cheers, Craig
-----Original Message----- From: u-boot-users-bounces@lists.sourceforge.net [mailto:u-boot-users-bounces@lists.sourceforge.net] On Behalf Of Liew Tsi Chung-r5aahp Sent: Wednesday, August 01, 2007 9:13 AM To: u-boot-users@lists.sourceforge.net Cc: Stefan Roese; Wilson Callan Subject: [U-Boot-Users] Update for 5329
Stefan,
Here is the updates: 1. Update-CONFIG_MCFUART.patch 2. Added-common-define-CONFIG_CF_MII-for-do_mii.patch 3. Moved-sync-from-m5329evb.c-to-include-asm-m68k-io.patch 4. Added-uart_gpio_conf-for-port-configuration.patch 5. Update-timer.patch 6. Added-fsl_i2c-header-file.patch 7. Added-NAND-Flash-support-and-I2C-support.patch 8. Added-GPIO-enabled-for-I2C-signals.patch
Note: NAND support still partially incomplete, unable to read/write. Erase, bad, markbad, lock, unlock and info seems working.
Thanks,
Regards, TsiChung

Hi Craig,
On Wednesday 01 August 2007, Craig Day wrote:
I've ported u-boot 1.1.6 over to the LPC3180 (arm926ejs core) and have included NAND support. The nand_write_ecc function in drivers/nand/nand_base.c appears to be writing pages correctly, but the pointer to the source data in memory for nand_verify_pages does not seem to be updated correctly. Specifically, line 1707 in nand_base.c contains: this->data_poi = bufstart; However, the problem is that bufstart is never updated, and always points to the beginning of the data source, causing all nand_page_verify calls to compare the newest written pages in NAND flash to the beginning of the data source. After the first block NAND writing fails due to nand_verify_pages failing. To fix this I added in: bufstart += (1 << this->phys_erase_shift);
Thanks for the detailed explanation. But even better would be to send a patch (best with a signed-off line etc.). A patch sometimes explains a problem betten than such an explanation. And if you are correct and it fixes a real problem, the patch could be applied directly.
Have you seen this problem? Or has anyone else run into this problem? Or is there something I'm missing?
We are using the current NAND driver successfully on multiple boards.
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@denx.de =====================================================================

Hi Stefan,
Thanks for the tips (submitting patches). I took a look at the U-Boot 1.2.0 nand_base.c source file and it does have this fix implemented (slightly different code, but it's updating bufstart like it needs to be), so apparently someone else has run into the same issue. Are you using 1.2.0 or 1.1.6 (like I am)?
cheers, Craig
-----Original Message----- From: Stefan Roese [mailto:sr@denx.de] Sent: Wednesday, August 01, 2007 10:23 PM To: u-boot-users@lists.sourceforge.net Cc: Craig Day; 'Liew Tsi Chung-r5aahp'; 'Wilson Callan' Subject: Re: [U-Boot-Users] Update for 5329
Hi Craig,
On Wednesday 01 August 2007, Craig Day wrote:
I've ported u-boot 1.1.6 over to the LPC3180 (arm926ejs core) and have included NAND support. The nand_write_ecc function in drivers/nand/nand_base.c appears to be writing pages correctly, but the pointer to the source data in memory for nand_verify_pages does not seem
to
be updated correctly. Specifically, line 1707 in nand_base.c contains: this->data_poi = bufstart; However, the problem is that bufstart is never updated, and always points to the beginning of the data source, causing
all
nand_page_verify calls to compare the newest written pages in NAND flash
to
the beginning of the data source. After the first block NAND writing fails due to nand_verify_pages failing. To fix this I added in: bufstart += (1 << this->phys_erase_shift);
Thanks for the detailed explanation. But even better would be to send a patch (best with a signed-off line etc.). A patch sometimes explains a problem betten than such an explanation. And if you are correct and it fixes a real problem, the patch could be applied directly.
Have you seen this problem? Or has anyone else run into this problem? Or
is
there something I'm missing?
We are using the current NAND driver successfully on multiple boards.
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@denx.de =====================================================================

Hi Craig,
On Thursday 02 August 2007, Craig Day wrote:
Thanks for the tips (submitting patches). I took a look at the U-Boot 1.2.0 nand_base.c source file and it does have this fix implemented
Ufff. ;)
(slightly different code, but it's updating bufstart like it needs to be), so apparently someone else has run into the same issue. Are you using 1.2.0 or 1.1.6 (like I am)?
Later and greatest of course.
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@denx.de =====================================================================

Hi TsiChung,
please find some comments below.
On Wednesday 01 August 2007, Liew Tsi Chung-r5aahp wrote:
Here is the updates:
- Update-CONFIG_MCFUART.patch
- Added-common-define-CONFIG_CF_MII-for-do_mii.patch
diff --git a/common/cmd_mii.c b/common/cmd_mii.c index c3f43d7..181f2e7 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -438,7 +438,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) int rcode = 0; char *devname;
-#if defined(CONFIG_8xx) || defined(CONFIG_MCF532x) +#if defined(CONFIG_8xx) || defined(CONFIG_CF_DOMII)
Please add either a generic define name (not ColdFire specific) or even better add declare this mii_init() function as __weak__:
void __mii_init(void) { } int mii_init(void) __attribute__((weak, alias("__mii_init")));
This way we can get rid of these #defines completely.
- Moved-sync-from-m5329evb.c-to-include-asm-m68k-io.patch
Does not apply. I did some cleanup on your original patches, so please rebase your work on the u-boot-coldfire custodian repository.
- Added-uart_gpio_conf-for-port-configuration.patch
- Update-timer.patch
- Added-fsl_i2c-header-file.patch
- Added-NAND-Flash-support-and-I2C-support.patch
diff --git a/board/freescale/m5329evb/m5329evb.c b/board/freescale/m5329evb/m5329evb.c index 242eb1a..d23b1c2 100644 --- a/board/freescale/m5329evb/m5329evb.c +++ b/board/freescale/m5329evb/m5329evb.c @@ -26,6 +26,7 @@
#include <config.h> #include <common.h> +#include <asm/io.h> #include <asm/immap.h>
DECLARE_GLOBAL_DATA_PTR; @@ -86,3 +87,85 @@ int testdram(void)
return (0); }
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) +#include <nand.h> +#include <linux/mtd/mtd.h>
+#define SET_CLE 0x10 +#define CLR_CLE ~SET_CLE +#define SET_ALE 0x08 +#define CLR_ALE ~SET_ALE
+static void nand_hwcontrol(struct mtd_info *mtdinfo, int cmd) +{
Please move this NAND support into a separate file (board/freescale/m5329evb/nand.c).
- Added-GPIO-enabled-for-I2C-signals.patch
As already mentioned above, could you please rebase you patches on the current u-boot-coldfire repository? And please address the comments above and resubmit. I'll try to merge the patches soon, so that they can be applied to mainline before the new merge window closes.
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@denx.de =====================================================================

Stefan,
Attached are the patches based on u-boot-coldfire custodian repository.
Thanks.
Regards, TsiChung

On Monday 06 August 2007, Liew Tsi Chung-r5aahp wrote:
Attached are the patches based on u-boot-coldfire custodian repository.
Applied to the ColdFire repository.
Thanks.
One remark: Could you please add a "ColdFire" note to your first commit line in future patches? Like:
ColdFire: Added NAND support
instead of just:
Added NAND support
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@denx.de =====================================================================

Stefan,
Attached are the patches based on u-boot-coldfire custodian repository.
Thanks.
Regards, TsiChung

On Monday 06 August 2007, Liew Tsi Chung-r5aahp wrote:
Attached are the patches based on u-boot-coldfire custodian repository.
Applied to the ColdFire repository.
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@denx.de =====================================================================

Stefan,
Thanks! I will add ColdFire to my message subject and patch comments in the future.
Regards, TsiChung
-----Original Message----- From: Stefan Roese [mailto:sr@denx.de] Sent: Wednesday, August 08, 2007 3:03 AM To: u-boot-users@lists.sourceforge.net Cc: Liew Tsi Chung-r5aahp; Wilson Callan Subject: Re: [U-Boot-Users] Update for 5329 - part II
On Monday 06 August 2007, Liew Tsi Chung-r5aahp wrote:
Attached are the patches based on u-boot-coldfire custodian
repository.
Applied to the ColdFire repository.
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@denx.de =====================================================================

Stefan,
Here are the first patches for all CF timer update and MCF52x2 update.
Regards, TsiChung
participants (3)
-
Craig Day
-
Liew Tsi Chung-r5aahp
-
Stefan Roese