From: <mar...@us...> - 2007-08-20 15:43:08
|
Revision: 1246 http://hackndev.svn.sourceforge.net/hackndev/?rev=1246&view=rev Author: marex_z71 Date: 2007-08-20 08:43:00 -0700 (Mon, 20 Aug 2007) Log Message: ----------- PalmTX: add missing header to NAND driver Modified Paths: -------------- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c Modified: linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c =================================================================== --- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-08-18 20:22:12 UTC (rev 1245) +++ linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-08-20 15:43:00 UTC (rev 1246) @@ -25,6 +25,7 @@ #include <asm/io.h> #include <asm/sizes.h> #include <asm/arch/palmtx-gpio.h> +#include <asm/arch/palmtx-init.h> #include <asm/arch/pxa-regs.h> #include <asm/setup.h> #include <asm/memory.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-08-25 00:24:36
|
Revision: 1268 http://hackndev.svn.sourceforge.net/hackndev/?rev=1268&view=rev Author: marex_z71 Date: 2007-08-24 17:24:34 -0700 (Fri, 24 Aug 2007) Log Message: ----------- PalmTX: remove warning from MTD driver Modified Paths: -------------- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c Modified: linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c =================================================================== --- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-08-24 23:46:45 UTC (rev 1267) +++ linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-08-25 00:24:34 UTC (rev 1268) @@ -104,10 +104,12 @@ /* * read device ready pin */ +#if 0 static int palmtx_device_ready(struct mtd_info *mtd) { return GET_PALMTX_GPIO(NAND_READY); } +#endif /* * Main initialization routine This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-08-30 02:31:56
|
Revision: 1288 http://hackndev.svn.sourceforge.net/hackndev/?rev=1288&view=rev Author: marex_z71 Date: 2007-08-29 19:31:54 -0700 (Wed, 29 Aug 2007) Log Message: ----------- PalmTX: WORKING NAND Flash driver Modified Paths: -------------- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c Modified: linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c =================================================================== --- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-08-29 15:42:49 UTC (rev 1287) +++ linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-08-30 02:31:54 UTC (rev 1288) @@ -36,6 +36,12 @@ */ static struct mtd_info *palmtx_nand_mtd = NULL; +/* + * Control lines + */ +void __iomem *nand_ale = NULL; +void __iomem *nand_cle = NULL; + /* * Module stuff */ @@ -55,29 +61,27 @@ #endif /* - * hardware specific access to control-lines + * Hardware specific access to control-lines */ static void palmtx_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) { struct nand_chip *chip = mtd->priv; - unsigned long bits = 0; - if (ctrl & NAND_CTRL_CHANGE) { - /* Select chip */ - SET_PALMTX_GPIO(NAND_CS1_N, (ctrl & NAND_NCE) ? 0 : 1); - - /* Set control lines */ - if (ctrl & NAND_CLE) - bits |= 1<<25; - if (ctrl & NAND_ALE) - bits |= 1<<24; - iowrite32(bits, chip->IO_ADDR_W); - } - /* If there is a command for the chip, send it */ - if (cmd != NAND_CMD_NONE) - iowrite32((cmd & 0xff) | bits, chip->IO_ADDR_W); + if (cmd != NAND_CMD_NONE) { + switch ((ctrl & 0x6) >> 1) { + case 1: /* CLE */ + writeb(cmd, nand_cle); + break; + case 2: /* ALE */ + writeb(cmd, nand_ale); + break; + default: + printk("PalmTX NAND: invalid bit\n"); + break; + } + } } /* @@ -98,7 +102,6 @@ palmtx_nand_mtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL); if (!palmtx_nand_mtd) { printk("Unable to allocate palmtx NAND MTD device structure.\n"); - iounmap((void *)nandaddr); return -ENOMEM; } @@ -106,9 +109,22 @@ nandaddr = ioremap(PALMTX_PHYS_NAND_START, 0x1000); if (!nandaddr) { printk("Failed to ioremap NAND flash.\n"); + iounmap((void *)palmtx_nand_mtd); return -ENOMEM; } + /* Remap physical address of control lines */ + nand_ale = ioremap(PALMTX_PHYS_NAND_START | 1<<24, 0x1000); + if (!nand_ale) { + printk("Failed to ioremap NAND flash.\n"); + return -ENOMEM; + } + nand_cle = ioremap(PALMTX_PHYS_NAND_START | 1<<25, 0x1000); + if (!nand_cle) { + printk("Failed to ioremap NAND flash.\n"); + return -ENOMEM; + } + /* Get pointer to private data */ this = (struct nand_chip *)(&palmtx_nand_mtd[1]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-08-30 02:36:56
|
Revision: 1289 http://hackndev.svn.sourceforge.net/hackndev/?rev=1289&view=rev Author: marex_z71 Date: 2007-08-29 19:36:54 -0700 (Wed, 29 Aug 2007) Log Message: ----------- PalmTX: cosmetic corrections to NAND flash driver Modified Paths: -------------- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c Modified: linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c =================================================================== --- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-08-30 02:31:54 UTC (rev 1288) +++ linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-08-30 02:36:54 UTC (rev 1289) @@ -66,8 +66,6 @@ static void palmtx_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) { - struct nand_chip *chip = mtd->priv; - /* If there is a command for the chip, send it */ if (cmd != NAND_CMD_NONE) { switch ((ctrl & 0x6) >> 1) { @@ -78,7 +76,7 @@ writeb(cmd, nand_ale); break; default: - printk("PalmTX NAND: invalid bit\n"); + printk("PalmTX NAND: invalid control bit\n"); break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-08-30 02:41:22
|
Revision: 1290 http://hackndev.svn.sourceforge.net/hackndev/?rev=1290&view=rev Author: marex_z71 Date: 2007-08-29 19:41:10 -0700 (Wed, 29 Aug 2007) Log Message: ----------- PalmTX: correctly manager memory unmaping if something fails and do writes in more correct way Modified Paths: -------------- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c Modified: linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c =================================================================== --- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-08-30 02:36:54 UTC (rev 1289) +++ linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-08-30 02:41:10 UTC (rev 1290) @@ -70,10 +70,10 @@ if (cmd != NAND_CMD_NONE) { switch ((ctrl & 0x6) >> 1) { case 1: /* CLE */ - writeb(cmd, nand_cle); + iowrite8(cmd, nand_cle); break; case 2: /* ALE */ - writeb(cmd, nand_ale); + iowrite8(cmd, nand_ale); break; default: printk("PalmTX NAND: invalid control bit\n"); @@ -115,11 +115,16 @@ nand_ale = ioremap(PALMTX_PHYS_NAND_START | 1<<24, 0x1000); if (!nand_ale) { printk("Failed to ioremap NAND flash.\n"); + iounmap((void *)palmtx_nand_mtd); + iounmap((void *)nandaddr); return -ENOMEM; } nand_cle = ioremap(PALMTX_PHYS_NAND_START | 1<<25, 0x1000); if (!nand_cle) { printk("Failed to ioremap NAND flash.\n"); + iounmap((void *)palmtx_nand_mtd); + iounmap((void *)nandaddr); + iounmap((void *)nand_ale); return -ENOMEM; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-09-02 12:39:26
|
Revision: 1296 http://hackndev.svn.sourceforge.net/hackndev/?rev=1296&view=rev Author: marex_z71 Date: 2007-09-02 05:39:22 -0700 (Sun, 02 Sep 2007) Log Message: ----------- PalmTX: correct command delay according to datasheet Modified Paths: -------------- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c Modified: linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c =================================================================== --- linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-09-02 11:22:01 UTC (rev 1295) +++ linux4palm/linux/trunk/drivers/mtd/nand/palmtx.c 2007-09-02 12:39:22 UTC (rev 1296) @@ -149,8 +149,8 @@ this->IO_ADDR_W = nandaddr; this->cmd_ctrl = palmtx_hwcontrol; this->dev_ready = palmtx_device_ready; - /* 15 us command delay time */ - this->chip_delay = 15; + /* 10 us command delay time */ + this->chip_delay = 10; this->ecc.mode = NAND_ECC_SOFT; this->options = NAND_NO_AUTOINCR; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |