[Linux-arm-nuc900] NUC900 nand driver Patch

Wan ZongShun mcuos.com at gmail.com
Thu Apr 29 11:07:41 EDT 2010


Thanks a lot, wait for me checking it.

在 2010年4月29日 下午10:52,Wills Wang <wills.wang.cn at gmail.com> 写道:
> There is a patch for NUC900 nand driver, it fix up the bug access for
> incorrect register address and NULL pointer.
>
> --- linux-2.6.34-rc5/drivers/mtd/nand/nuc900_nand.c 2010-04-29
> 14:35:04.000000000 +0000
> +++ linux-2.6.34-rc5/drivers/mtd/nand/nuc900_nand.c 2010-04-29
> 14:42:22.000000000 +0000
> @@ -132,7 +153,7 @@
> {
> unsigned int val;
> spin_lock(&nand->lock);
> - val = __raw_readl(REG_SMISR);
> + val = __raw_readl(nand->reg + REG_SMISR);
> val &= READYBUSY;
> spin_unlock(&nand->lock);
>
> @@ -150,6 +171,19 @@
> return ready;
> }
>
> +static void nuc900_nand_select_chip(struct mtd_info *mtd, int chipnr)
> +{
> + switch (chipnr) {
> + case -1:
> + break;
> + case 0:
> + break;
> +
> + default:
> + BUG();
> + }
> +}
> +
> static void nuc900_nand_command_lp(struct mtd_info *mtd, unsigned int
> command,
> int column, int page_addr)
> {
> @@ -240,7 +274,6 @@
> ;
> }
>
> -
> static void nuc900_nand_enable(struct nuc900_nand *nand)
> {
> unsigned int val;
> @@ -250,7 +283,7 @@
> val = __raw_readl(nand->reg + REG_FMICSR);
>
> if (!(val & NAND_EN))
> - __raw_writel(val | NAND_EN, REG_FMICSR);
> + __raw_writel(val | NAND_EN, nand->reg + REG_FMICSR);
>
> val = __raw_readl(nand->reg + REG_SMCSR);
>
> @@ -286,7 +319,7 @@
> goto fail1;
> }
> clk_enable(nuc900_nand->clk);
> -
> + chip->select_chip = nuc900_nand_select_chip;
> chip->cmdfunc = nuc900_nand_command_lp;
> chip->dev_ready = nuc900_nand_devready;
> chip->read_byte = nuc900_nand_read_byte;
>
> --
> 欢迎加入"NUC900 Linux BSP开发社区".
> NUC900 Linux相关问题请发问题邮件至:
> NUC900 at googlegroups.com
> 取消订阅请发邮件:
> NUC900+unsubscribe at googlegroups.com
> 新手请熟读社区首页:
> https://groups.google.com/group/NUC900?hl=zh-CN
>



-- 
*linux-arm-kernel mailing list
mail addr:linux-arm-kernel at lists.infradead.org
you can subscribe by:
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

* linux-arm-NUC900 mailing list
mail addr:NUC900 at googlegroups.com
main web: https://groups.google.com/group/NUC900
you can subscribe it by sending me mail:
mcuos.com at gmail.com



More information about the linux-arm-kernel mailing list