Re: [uClinux-dev] Configure M5329 NAND for Freescale MCF5329EVB (uClinux-dist-20150808)
Greg Ungerer <g...@uclinux.org> wrote: Hi Cristobal, On 03/12/15 01:13, Cristobal Chaves wrote: > First of all you have to compile the drivers if you wanna add the drivers, then you have to modify the kconfig file adding the names of the divers files *.o and *.c. Once you have added the files to the configure file you can patch the kernel and finally add the drivers configuring the kernel graphically or manually. Just follow the steps of bellow: This really makes no sense. And it seems unnecessary given the original poster was clearly already compiling the driver in the kernel tree. The m5329.c driver source in that tree is broken - the compile error messages give that. You don't add *.c or *.o names into a Kconfig. They would only ever go into a Makefile. Regards Greg > 1) Compile drivers > 2) Add names of files *.o and *.c to the respective KCONFIG > 3) Patch Kernel using Diff tool > 4) Compile Kernel > 5) Add drivers to the configuration of custom kernel > 6) Compile Kernel > 7) Done, you have your custom kernel with new drivers added. > > BR, > > Cristobal > >> To: uclinux-dev@uclinux.org >> From: g...@uclinux.org >> Date: Thu, 3 Dec 2015 00:33:30 +1000 >> Subject: Re: [uClinux-dev] Configure M5329 NAND for Freescale MCF5329EVB (uClinux-dist-20150808) >> >> 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] >> > >> >> 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 ___ ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] Configure M5329 NAND for Freescale MCF5329EVB (uClinux-dist-20150808)
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 #include #include +#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 uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] Configure M5329 NAND for Freescale MCF5329EVB (uClinux-dist-20150808)
Hi Cristobal, On 03/12/15 01:13, Cristobal Chaves wrote: > First of all you have to compile the drivers if you wanna add the drivers, > then you have to modify the kconfig file adding the names of the divers files > *.o and *.c. Once you have added the files to the configure file you can > patch the kernel and finally add the drivers configuring the kernel > graphically or manually. Just follow the steps of bellow: This really makes no sense. And it seems unnecessary given the original poster was clearly already compiling the driver in the kernel tree. The m5329.c driver source in that tree is broken - the compile error messages give that. You don't add *.c or *.o names into a Kconfig. They would only ever go into a Makefile. Regards Greg > 1) Compile drivers > 2) Add names of files *.o and *.c to the respective KCONFIG > 3) Patch Kernel using Diff tool > 4) Compile Kernel > 5) Add drivers to the configuration of custom kernel > 6) Compile Kernel > 7) Done, you have your custom kernel with new drivers added. > > BR, > > Cristobal > >> To: uclinux-dev@uclinux.org >> From: g...@uclinux.org >> Date: Thu, 3 Dec 2015 00:33:30 +1000 >> Subject: Re: [uClinux-dev] Configure M5329 NAND for Freescale MCF5329EVB >> (uClinux-dist-20150808) >> >> 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 >> #include >> #include >> +#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 >> uClinux-dev@uclinux.org >> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev >> This message was resent by uclinux-dev@uclinux.org >> To unsubscribe see: >> http://mailman.uclinux.org/mailman/options/uclinux-dev > > > ___ > uClinux-dev mailing list > uClinux-dev@uclinux.org > http://mailman.uclinux.org/mailman/listinfo/uclinux-dev > This message was resent by uclinux-dev@uclinux.org > To unsubscribe see: > http://mailman.uclinux.org/mailman/options/uclinux-dev > ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev