編輯:初級開發
NAND Flash ECC校驗的原理
http://blog.ednchina.com/lIEal/17736/message.ASPx 驅動設置好以後,進行參數配置。
比較了一下2.6.24和2.6.29內核以後,發現2.6.29內核中6410(其他類似)中的所有platform_device都定義在了 /arch/arm/mach-s3c6410/mach-smdk6410.c 以及 /arch/arm/plat-s3c64xx/dev-xxx.c(比如:dev-fb.c)中。 因此,在Mach-smdk6410.c中添加注冊信息: * NAND分區
* 一共分為4個區,其中第3個分區存放android的文件系統
* 第4個分區存放android文件系統data文件夾的內容
* 因此在UBOOT的參數設置為root=/dev/mtdblock2 struct mtd_partition s3c_partition_info[] = { .name = "Bootloader",
.offset = 0,
.size = (256*SZ_1K),
.mask_flags = MTD_CAP_NANDFlash, {
.name = "Kernel",
.offset = (256*SZ_1K), /* Block number is 0x10 */
.size = (5*SZ_1M) - (256*SZ_1K),
// .mask_flags = MTD_CAP_NANDFlash, //- chachi {
.name = "File System",
.offset = (5*SZ_1M), /* Block number is 0x10 */
.size = (90*SZ_1M), //gzy
// .mask_flags = MTD_CAP_NANDFlash, //- chachi {
.name = "Data",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL, }; struct s3c_nand_mtd_info s3c_nand_mtd_part_info = {
.chip_nr = 1,
.mtd_part_nr = ARRAY_SIZE(s3c_partition_info),
.partition = s3c_partition_info,
}; static struct resource s3c_nand_resource[] = {
[0] = {
.start = S3C24XX_PA_NAND,
.end = S3C24XX_PA_NAND + S3C24XX_SZ_NAND - 1,
.flags = IORESOURCE_MEM, }; struct platform_device s3c_device_nand = {
.name = "s3c-nand",
.id = -1,
.num_resources = ARRAY_SIZE(s3c_nand_resource),
.resource = s3c_nand_resource,
.dev = {
.platform_data = &s3c_nand_mtd_part_info };
/* end change by chachi */ static struct platform_device *smdk6410_devices[] __initdata = { &s3c_device_nand, //+ chachi };NAND的PHY地址定義為:
#define S3C24XX_PA_NAND (0x70200000)
#define S3C24XX_SZ_NAND SZ_1M 最後配置menuconfig(我更喜歡用xconfig ^_^):
<*> Memory Technology Device (MTD) support --->
[*] MTD partitioning support
<*> RedBoot partition table parsing │ │
│ │ (-1) Location of RedBoot partition table │ │
│ │ [*] Include unallocated Flash regions │ │
│ │ [ ] Force read-only for RedBoot system images │ │
│ │ [*] Command line partition table parsing │
<*> Direct char device Access to MTD devices │ │
│ │ -*- Common interface to block layer for MTD 'translation layers│ │
│ │ <*> Caching block device Access to MTD devices │ │ RAM/ROM/Flash chip drivers --->
<*> Detect flash chips by Common Flash Interface (CFI) probe │ │
│ │ <*> Detect non-CFI AMD/JEDEC-compatible Flash chips │ │
│ │ [ ] Flash chip driver advanced configuration options │ │
│ │ <*> Support for Intel/Sharp Flash chips │ │
│ │ <*> Support for AMD/Fujitsu/Spansion Flash chips │ │
│ │ < > Support for ST (Advanced Architecture) Flash chips │ │
│ │ < > Support for RAM chips in bus mapping │ │
│ │ <*> Support for ROM chips in bus mapping │ │
│ │ < > Support for absent chips in bus mapping │ │ │ └────────────────────────────────────────────────── <*> NAND Device Support --->
--- NAND Device Support │ │
│ │ [*] Verify NAND page writes │ │
│ │ [ ] NAND ECC Smart Media byte order │ │
│ │ [ ] Enable chip ids for obsolete ancIEnt NAND devices │ │
│ │ < > GPIO NAND Flash driver │ │
│ │ <*> NAND Flash support for S3C SoC │ │
│ │ [ ] S3C NAND driver debug │ │
│ │ [*] S3C MTD NO ECC warning │ │
│ │ [ ] S3C NAND Hardware ECC │ │
│ │ [*] Large (2K) page nand Support Enable │ │ │ │ < > Support for generic platform NAND driver │ │
│ └───────────────────────────────────────────────────────────────
在uboot中配置bootargs參數:
root=/dev/mtdblock2 rootfstype=jffs2
啟動內核後顯示:
S3C NAND Driver, (c) 2007 Samsung Electronics
<6>NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
<4>NAND_ECC_NONE selected by board driver. This is not recommended !!
<5>Creating 4 MTD partitions on "NAND 128MiB 3,3V 8-bit":
<5>0x000000000000-0x000000040000 : "Bootloader"
<5>0x000000040000-0x000000500000 : "Kernel"
<5>0x000000500000-0x000005f00000 : "File System"
<5>0x000005f00000-0x000008000000 : "data"
install NAND DRIVE = 0
......
VFS: Mounted root (jffs2 filesystem) on device 31:2.
<6>Freeing init memory: 88K
<4>Warning: unable to open an initial console.
<0>Kernel panic - not syncing: Attempted to kill init!
表示NAND驅動移植成功
JFFS2文件系統等,在之後的文章中寫
在android平台中可以使用第三方外部JAR庫文件,在Eclipse開發環境中,僅僅3步就可以使用第三方.jar文件:1.在Package Explorer(包浏覽器
第一部分:arsc文件漢化目前市面上最流行的漢化方式,就是漢化這部分主文件。我們開始吧:首先,打開androidResEdit1.3然後把resources.arsc文
網上關於獲取未安裝的APK圖標的文章滿天飛,但都是轉帖,運行後的效果卻是獲取到android的默認小機器人圖標.那個暴寒....現提供解決方法如下,廢話不說,上效果圖,
ps:對於軟件開發人員來說,保護代碼安全也是比較重要的因素之一,不過目前來說Google Android平台選擇了Java Dalvik VM的方式使其程序很容易破解和