Re: Configure M5329 NAND for Freescale MCF5329EVB (uClinux-dist-20150808)

Greg Ungerer <[email protected]>
Newsgroups gmane.linux.uclinux.devel
Message-ID <[email protected]>
Hi Ted,

On 02/12/15 06:56, Ted Victorio wrote:
> I am unable to compile for the M5329 NAND using the configuration below.
>
> Distro:        uClinux-dist-20150808
> Tool:           m68k-uclinux-tools-20101118
> Platform:   Freescale MCF5329EVB
>
> # Linux/m68k 4.0.0-uc0 Kernel Configuration
[snip]
>
> Errors:
> drivers/mtd/nand/m5329.c: In function 5329_init:
> drivers/mtd/nand/m5329.c:85:2: error: lvalue required as left operand of
> assignment
> drivers/mtd/nand/m5329.c:90:4: error: lvalue required as left operand of
> assignment
> drivers/mtd/nand/m5329.c:92:4: error: lvalue required as left operand of
> assignment
> drivers/mtd/nand/m5329.c:131:2: error: implicit declaration of function
> add_mtd_partitions
>
> Do I need additional options? Or something else?

The definitions for register addresses were sanitized for Coldfire
hardware a few kernel revisions back. They are now all register
addresses (or offsets) - not access macros as some were.

You will need the patch below to fix this driver (compile tested
only). The include of mtdcore is a little ugly, but it should get
you going for now.

Regards
Greg



--- linux/drivers/mtd/nand/m5329.c.org	2015-12-03 00:19:18.324085936 +1000
+++ linux/drivers/mtd/nand/m5329.c	2015-12-03 00:27:49.644082361 +1000
@@ -27,6 +27,7 @@
  #include <linux/mtd/partitions.h>
  #include <asm/io.h>
  #include <asm/mcfsim.h>
+#include "../mtdcore.h"

  /*
   * MTD structure for M5329EVB board
@@ -82,14 +83,14 @@
  	struct nand_chip *this;

  	/* Setup NAND flash chip select signals */
-	MCF_FBCS2_CSAR = NAND_FLASH_ADDRESS;
-	MCF_FBCS2_CSCR = (MCF_FBCS_CSCR_PS_8
-			| MCF_FBCS_CSCR_BEM
-			| MCF_FBCS_CSCR_AA
-			| MCF_FBCS_CSCR_SBM
-			| MCF_FBCS_CSCR_WS(7));
-	MCF_FBCS2_CSMR = (MCF_FBCS_CSMR_BAM_16M
-			| MCF_FBCS_CSMR_V);
+	writel(NAND_FLASH_ADDRESS, MCF_FBCS2_CSAR);
+	writel(MCF_FBCS_CSCR_PS_8
+		| MCF_FBCS_CSCR_BEM
+		| MCF_FBCS_CSCR_AA
+		| MCF_FBCS_CSCR_SBM
+		| MCF_FBCS_CSCR_WS(7),
+		MCF_FBCS2_CSCR);
+	writel(MCF_FBCS_CSMR_BAM_16M | MCF_FBCS_CSMR_V, MCF_FBCS2_CSMR);

  	/* Allocate memory for MTD device structure and private data */
  	m5329_mtd = kmalloc (sizeof(struct mtd_info)+sizeof (struct nand_chip),


_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.