R: [uClinux-dev] NAND on m5329evb

Greg Ungerer gerg at snapgear.com
Fri Jun 8 01:49:12 EDT 2007


Hi Andrea,

Tarani, Andrea wrote:
> try this patch (Greg can you ad this to distribution??)

This patch is mangled by mime for me.
Can you resend in plain text?

Regards
Greg



> diff U3b 
> Z:/uClinux_linux-2.6.x_arch/m68knommu/platform/532x/config.c@@/main/anta_EMV_Mod3/1 
> Z:/wipe/linux-2.6.x/arch/m68knommu/platform/532x/config.c@@/main/anta_EMV_Mod3/2
> --- 
> Z:/uClinux_linux-2.6.x_arch/m68knommu/platform/532x/config.c@@/main/anta_EMV_Mod3/1 Fri 
> Sep 15 16:59:33 2006
> +++ 
> Z:/wipe/linux-2.6.x/arch/m68knommu/platform/532x/config.c@@/main/anta_EMV_Mod3/2 Mon 
> Oct 02 14:41:44 2006
> @@ -47,6 +47,21 @@
>  
>  /***************************************************************************/
>  
> +int sys_clk_khz = 0;
> +int sys_clk_mhz = 0;
> +
> +void wtm_init(void);
> +void scm_init(void);
> +void gpio_init(void);
> +void fbcs_init(void);
> +void sdramc_init(void);
> +int  clock_pll (int fsys, int flags);
> +int  clock_limp (int);
> +int  clock_exit_limp (void);
> +int  get_sys_clock (void);
> +
> +/***************************************************************************/
> +
>  /*
>   * DMA channel base address table.
>   */
> @@ -91,6 +106,9 @@
>  
>  void config_BSP(char *commandp, int size)
>  {
> + sys_clk_khz = get_sys_clock();
> + sys_clk_mhz = sys_clk_khz/1000;
> +
>   mcf_setimr(MCFSIM_IMR_MASKALL);
>  
>  #if defined(CONFIG_BOOTPARAM)
> @@ -168,24 +186,9 @@
>  
>  #define NAND_FLASH_ADDRESS (0xD0000000)
>  
> -int sys_clk_khz = 0;
> -int sys_clk_mhz = 0;
> -
> -void wtm_init(void);
> -void scm_init(void);
> -void gpio_init(void);
> -void fbcs_init(void);
> -void sdramc_init(void);
> -int  clock_pll (int fsys, int flags);
> -int  clock_limp (int);
> -int  clock_exit_limp (void);
> -int  get_sys_clock (void);
>  
>  asmlinkage void __init sysinit(void)
>  {
> - sys_clk_khz = clock_pll(0, 0);
> - sys_clk_mhz = sys_clk_khz/1000;
> - 
>   wtm_init();
>   scm_init();
>   gpio_init();
> @@ -234,14 +237,14 @@
>   /* Initialize latch to drive signals to inactive states */
>   *((u16 *)(0x10080000)) = 0xFFFF;
>  
> - /* External SRAM */
> - MCF_FBCS1_CSAR = EXT_SRAM_ADDRESS;
> - MCF_FBCS1_CSCR = (MCF_FBCS_CSCR_PS_16
> -   | MCF_FBCS_CSCR_AA
> -   | MCF_FBCS_CSCR_SBM
> -   | MCF_FBCS_CSCR_WS(1));
> - MCF_FBCS1_CSMR = (MCF_FBCS_CSMR_BAM_512K
> -   | MCF_FBCS_CSMR_V);
> +// /* External SRAM */
> +// MCF_FBCS1_CSAR = EXT_SRAM_ADDRESS;
> +// MCF_FBCS1_CSCR = (MCF_FBCS_CSCR_PS_16
> +//   | MCF_FBCS_CSCR_AA
> +//   | MCF_FBCS_CSCR_SBM
> +//   | MCF_FBCS_CSCR_WS(1));
> +// MCF_FBCS1_CSMR = (MCF_FBCS_CSMR_BAM_512K
> +//   | MCF_FBCS_CSMR_V);
>  
>   /* Boot Flash connected to FBCS0 */
>   MCF_FBCS0_CSAR = FLASH_ADDRESS;
> diff U3b 
> Z:/uClinux_linux-2.6.x_drivers/mtd/nand/m5329.c@@/main/anta_EMV_Mod3/1 
> Z:/wipe/linux-2.6.x/drivers/mtd/nand/m5329.c@@/main/anta_EMV_Mod3/2
> --- 
> Z:/uClinux_linux-2.6.x_drivers/mtd/nand/m5329.c@@/main/anta_EMV_Mod3/1 Fri 
> Sep 15 17:48:45 2006
> +++ 
> Z:/wipe/linux-2.6.x/drivers/mtd/nand/m5329.c@@/main/anta_EMV_Mod3/2 Fri 
> Sep 29 09:21:32 2006
> @@ -36,6 +36,9 @@
>  /*
>   * Values specific to the SPIA board (used with EP7212 processor)
>   */
> +#define NAND_FLASH_CE  ((u16 *)(0x10080000))
> +#define NCE_LOW_VAL   0xfbfb
> +#define NCE_HIGH_VAL  0xffff
>  #define NAND_FLASH_ADDRESS 0xd0000000 /* Fash address mapping */
>  
>  #define CLE_ADDR_BIT  4
> @@ -90,10 +93,12 @@
>    m5329_fio_base &= ~(1<<ALE_ADDR_BIT);
>    break;
>   case NAND_CTL_SETNCE:
> -  m5329_fio_base &= ~(1<<NCE_ADDR_BIT);
> +  *NAND_FLASH_CE = NCE_LOW_VAL;
> +//  m5329_fio_base &= ~(1<<NCE_ADDR_BIT);
>    break;
>   case NAND_CTL_CLRNCE:
> -  m5329_fio_base |= 1<NCE_ADDR_BIT;
> +  *NAND_FLASH_CE = NCE_HIGH_VAL;
> +//  m5329_fio_base |= 1<NCE_ADDR_BIT;
>    break;
>   }
>   /* Set address of NAND IO lines */
> @@ -135,6 +140,8 @@
>  
>   /* Link the private data with the MTD structure */
>   m5329_mtd->priv = this;
> +
> + *NAND_FLASH_CE = NCE_HIGH_VAL;
>  
>   /* Set address of NAND IO lines */
>   this->IO_ADDR_R = (void __iomem *) m5329_fio_base;
> 
> ------------------------------------------------------------------------
> *Da:* uclinux-dev-bounces at uclinux.org 
> [mailto:uclinux-dev-bounces at uclinux.org] *Per conto di 
> *Jeffrey.Johnston at idealindustries.com
> *Inviato:* mercoledì 30 maggio 2007 2.22
> *A:* uclinux-dev at uclinux.org
> *Oggetto:* [uClinux-dev] NAND on m5329evb
> 
> 
> Hi,
> Has anybody successfully setup a filesystem using the m5329evb NAND?
> 
> Freescale in their documentation for BSP says
> 
> "Known bugs, limitations, or technical issues
> 
> The jffs2/mtd implementation only works with very small files. The problem
> still has not been found."
> 
> I cannot get it to work for more than 1 small file.
> 
> #                                                                       
>                                          
> # ls -l /mnt                                                             
>                      
> drwxr-xr-x    2 500      500             0 May 23  2007 xxx             
>                      
> # cp /etc/busybox.conf /mnt                                             
>                      
> # umount /mnt                                                           
>                        
> # mount -t jffs2 /dev/mtdblock1 /mnt                                     
>                                    
> # ls -l /mnt                                                             
>                        
> -rw-r--r--    1 root     root           50 Nov 30 00:19 busybox.conf     
>                                        
> drwxr-xr-x    2 500      500             0 May 23  2007 xxx             
>                                          
> # cp /mnt/busybox.conf /mnt/busybox.conf1                               
>                                    
> # umount /mnt                                                           
>                                      
> # mount -t jffs2 /dev/mtdblock1 /mnt                                     
>                                        
> nand_read_ecc: Failed ECC read, page 0x00006ce1                         
>                                  
> nand_read_ecc: Failed ECC read, page 0x00006ce1                         
>                                        
> mtd->read(0x400 bytes from 0xd9c000) returned ECC error                 
>                                      
> jffs2_scan_inode_node(): CRC failed on node at 0x00d9c200: Read 
> 0x44883016,calculated 0x8038746a                      
> jffs2_scan_eraseblock(): Node at 0x00d9c244 {0x1985, 0xe001, 0x00000034) 
> has invalid CRC 0x80480940 (calculated 0xb34a2)
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d9c24c: 
> 0x8048 instead                                  
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d9c25c: 
> 0x3843 instead                                  
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d9c260: 
> 0x0c08 instead                                  
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d9c264: 
> 0x9910 instead                                  
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d9c268: 
> 0x0940 instead                                  
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d9c26c: 
> 0x6275 instead                                  
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d9c270: 
> 0x626f instead                                  
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d9c274: 
> 0x636f instead                                  
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d9c278: 
> 0x1185 instead                                  
> Further such events for this erase block will not be printed                
>                                        
> nand_read_ecc: Failed ECC read, page 0x00006ce1                         
>                                              
> nand_read_ecc: Failed ECC read, page 0x00006ce1                         
>                                            
> mtd->read(0x3c08 bytes from 0xd9c3f8) returned ECC error                 
>      
>                                        
> # ls -l /mnt                                                             
>                                            
> -rw-r--r--    1 root     root           50 Nov 30 00:19 busybox.conf     
>                                            
> drwxr-xr-x    2 500      500             0 May 23  2007 xxx             
>                                        
> #
> 
> I did find an indication that I needed a processor with a revision code of
> 3M29B or later due to a bug "Programmable address hold does not
> function correctly".  I have access to several M5329EVB and I found one that
> had the acceptable revision code.  The same problem occurred.
> 
> Any help would be greatly appreciated.
> jeff johnston
> 
> This message (including any attachments) contains confidential
> and/or proprietary information intended only for the addressee.
> Any unauthorized disclosure, copying, distribution or reliance on
> the contents of this information is strictly prohibited and may
> constitute a violation of law. If you are not the intended
> recipient, please notify the sender immediately by responding to
> this e-mail, and delete the message from your system. If you
> have any questions about this e-mail please notify the sender
> immediately.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev

-- 
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg at snapgear.com
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com


More information about the uClinux-dev mailing list