移植Linux内核到norflash

发布时间 : 星期一 文章移植Linux内核到norflash更新完毕开始阅读

与前面不同的是,它打印了芯片的信息,如厂商ID、芯片ID等等。 这是我想不通的地方,也是我采用新内核的原因。

不过,在这片nor flash上使用jffs2文件系统却不成功,出现了大量的警告信息,提示说制作根文件系统时的erase block有问题。 s3c2440-flash.c源代码: /*

* $Id: s3c2410.c,v 1.00 2006/12/05 10:18:14 gleixner Exp $ *

* Handle mapping of the NOR flash on Cogent S3C2410 boards *

* Copyright 2002 SYSGO Real-Time Solutions GmbH * *

This program is free software; you can redistribute it and/or modify *

it under the terms of the GNU General Public License version 2 as

* published by the Free Software Foundation. */ /*

* Late Lee

*

This file is modified and the file name has changed to ‘s3c2440-flash.c’. *

The SMDK2440 board has only one flash bank which is a 64Mbit(4Mx16) SST SST39VF6401B; * 128 x 64 KiB blocks. *

* This code is GPLed. */

#include #include #include #include #include #include #include #include #ifdef CONFIG_MTD_PARTITIONS #include #endif

#define WINDOW_ADDR 0x01000000 /* physical properties of flash */

#define WINDOW_SIZE 0x800000 /* 8MB */ #define BUSWIDTH 2 /* 2*8 = 16 */

#define FLASH_BLOCKSIZE_MAIN 0x10000 /* 64KB(0x10000) 128 blocks */

#define FLASH_NUMBLOCKS_MAIN 128

/* can be “cfi_probe”, “jedec_probe”, “map_rom”, NULL }; */ #define PROBETYPES { “cfi_probe”, “jedec_probe”, “map_rom”, NULL }

#define MSG_PREFIX “S3C2440-NOR:” /* prefix for our printk()’s */

#define MTDID “s3c2440-nor” /* for mtdparts= partitioning */

#define DEBUG_FLASH #ifdef DEBUG_FLASH

#define flash_debug(fmt, args…) printk(KERN_NOTICE “## LL debug “ MSG_PREFIX fmt, ##args) #else

#define flash_debug(fmt, args…) #endif

static struct mtd_info *mymtd;

struct map_info s3c2440nor_map = {

.name = “NOR Flash(SST39VF6401B) on S3C2440″, .size = WINDOW_SIZE, .bankwidth = BUSWIDTH, .phys = WINDOW_ADDR, };

#ifdef CONFIG_MTD_PARTITIONS /*

* MTD partitioning stuff */

static struct mtd_partition static_partitions[] = { /*0: U-Boot: 0-0x30000 0x30000=192KB*/ {

.name = “U-Boot”, .size = 0x030000, .offset = 0x0, },

/*1: Kernel: 0x30000-0x240000 0x210000=2112KB=2.0625MB*/ {

.name = “Kernel”, .size = 0x210000, .offset = 0x30000,

联系合同范文客服:xxxxx#qq.com(#替换为@)