设为首页 加入收藏

TOP

Linux-2.6.38到Tiny6410的移植手册(二)
2014-11-24 14:49:04 来源: 作者: 【 】 浏览:106
Tags:Linux-2.6.38 Tiny6410 移植 手册
mtd->writesize = 2048 << (extid & 0x03);
extid >>= 2;
/* Calc oobsize */
- switch (extid & 0x03) {
- case 1:
- mtd->oobsize = 128;
- break;
- case 2:
- mtd->oobsize = 218;
- break;
- case 3:
- mtd->oobsize = 400;
- break;
- default:
+ if (extid & 0x10) {
mtd->oobsize = 436;
- break;
+ } else {
+ mtd->oobsize = __oobsz[(extid & 0x03)];
}
extid >>= 2;
/* Calc blocksize */
@@ -3099,16 +3113,21 @@


/* Calculate the address shift from the page size */
chip->page_shift = ffs(mtd->writesize) - 1;
+
/* Convert chipsize to number of pages per chip -1. */
- chip->pagemask = (chip->chipsize >> chip->page_shift) - 1;
+ if (!chip->pagemask) {
+ chip->pagemask = (chip->chipsize >> chip->page_shift) - 1;
+ }


chip->bbt_erase_shift = chip->phys_erase_shift =
ffs(mtd->erasesize) - 1;
- if (chip->chipsize & 0xffffffff)
- chip->chip_shift = ffs((unsigned)chip->chipsize) - 1;
- else {
- chip->chip_shift = ffs((unsigned)(chip->chipsize >> 32));
- chip->chip_shift += 32 - 1;
+ if (!chip->chip_shift) {
+ if (chip->chipsize & 0xffffffff)
+ chip->chip_shift = ffs((unsigned)chip->chipsize) - 1;
+ else {
+ chip->chip_shift = ffs((unsigned)(chip->chipsize >> 32));
+ chip->chip_shift += 32 - 1;
+ }
}


/* Set the bad block position */
@@ -3126,8 +3145,11 @@
*/
if ((chip->cellinfo & NAND_CI_CELLTYPE_MSK) &&
(*maf_id == NAND_MFR_SAMSUNG ||
- *maf_id == NAND_MFR_HYNIX))
- chip->options |= NAND_BBT_SCANLASTPAGE;
+ *maf_id == NAND_MFR_HYNIX)) {
+ if (mtd->writesize < 4096) {
+ chip->options |= NAND_BBT_SCANLASTPAGE;
+ }
+ }
else if ((!(chip->cellinfo & NAND_CI_CELLTYPE_MSK) &&
(*maf_id == NAND_MFR_SAMSUNG ||
*maf_id == NAND_MFR_HYNIX ||


然后修改drivers/mtd/nand/Kconfig和drivers/mtd/nand/Makefile文件
在drivers/mtd/nand/Kconfig 238行增加
config MTD_NAND_S3C
tristate "NAND Flash support for S3C SoC"
depends on (ARCH_S3C64XX || ARCH_S5P64XX || ARCH_S5PC1XX) && MTD_NAND
help
This enables the NAND flash controller on the S3C.


No board specfic support is done by this driver, each board
must advertise a platform_device for the driver to attach.


config MTD_NAND_S3C_DEBUG
bool "S3C NAND driver debug"
depends on MTD_NAND_S3C
help
Enable debugging of the S3C NAND driver


configMTD_NAND_S3C_HWECC
bool "S3C NAND Hardware ECC"
depends on MTD_NAND_S3C
help
Enable the use of the S3C's internal ECC generator when
using NAND. Early versions of the chip have had problems with
incorrect ECC generation, and if using these, the default of
software ECC is preferable.


If you lay down a device with the hardware ECC, then you will
currently not be able to switch to software, as there is no
implementation for ECC method used by the S3C



drivers/mtd/nand/Makefile中20行增加
obj-$(CONFIG_MTD_NAND_S3C) += s3c_nand.o


末尾再增加
S3C_NAND_MLC_SRC = $(shell ls drivers/mtd/nand/s3c_nand_mlc.c 2>/dev/null)
ifeq ($(S3C_NAND_MLC_SRC),)
obj-$(CONFIG_MT

首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Tiny6410 编译Linux内核的问题(L.. 下一篇Tiny6410 关于zImage 不能编译的..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: