• «
  • 1
  • 2
  • »
  • Pages: 2/2     Go
主题 : 128M的mini2440NOR上预装的是不是64M的supervivi ?? 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 12148
精华: 0
发帖: 20
金钱: 105 两
威望: 21 点
贡献值: 0 点
综合积分: 40 分
注册时间: 2009-12-30
最后登录: 2010-01-13
10楼  发表于: 2010-01-07 12:38
回楼上。
对于那个ECC,好像是VIVI的检测机制和LINUX内核的不一样,无论有没有错内核检测都会有错,这个我试过。
还有那个bon,我也试过指导书的那个,我想可能是它的那个分区大小不是block的整数倍,而64M和128M的block的大小是不一样的。
级别: 新手上路
UID: 12148
精华: 0
发帖: 20
金钱: 105 两
威望: 21 点
贡献值: 0 点
综合积分: 40 分
注册时间: 2009-12-30
最后登录: 2010-01-13
11楼  发表于: 2010-01-07 13:04
k9f1208

secotr size = 512byte,block_pre_sector =32sector, block size = 512*32 =16K, device=4096block=64M


k9f1g08

secotr size = 2k, block_pre_sector =64sector, block size = 2*64 =128K, device=1024block=128M
级别: 新手上路
UID: 9769
精华: 0
发帖: 13
金钱: 80 两
威望: 25 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2009-10-13
最后登录: 2010-03-24
12楼  发表于: 2010-01-07 14:05
bon出错的完全明白了,感谢感谢!!

看来在supervivi源码不公开的情况下如果要修改nand分区要几个工作,

要求: vivi的MTD分区与linux的MTD分区要完全对应(是不是有这个要求?)
分区要求:
name            :       offset          size            flag
------------------------------------------------------------
vivi            :       0x00000000      0x00040000      0
param     :       0x00040000      0x00020000      0
kernel      :       0x00060000      0x00200000      0
root          :       0x00260000      03FDA 0000      0
usr           :       0x4000 0000     0x4000 0000     0   为了方便测试后64mb空间是否能正常读写,故usr从0x4000 0000开始


1.
我用的光盘带的supervivi-128烧写后执行part show显示如下
//------------------
Supervivi> part show
Number of partitions: 4
name            :       offset          size            flag
------------------------------------------------------------
vivi            :       0x00000000      0x00040000      0
param     :       0x00040000      0x00020000      0
kernel      :       0x00060000      0x00200000      0
root           :       0x00260000      0x3fd80000      0
Supervivi>
//-------------

由0x3fd80000 +0x260000=0x3FFE 0000可见,supervivi默认识别为64MB(0x4000 0000)(最后一小段跑哪了?)

那我们先:

Supervivi> part del root

Supervivi> part add root 0x00260000 0x3fda0000 0
root: offset = 0x00260000, size = 0x3fda0000, flag = 0

Supervivi> part add usr 0x40000000 0x80000000 0
usr: offset = 0x40000000, size = 0x80000000, flag = 0
Supervivi> part show
Number of partitions: 5
name            :       offset          size            flag
------------------------------------------------------------
vivi            :       0x00000000      0x00040000      0
param           :       0x00040000      0x00020000      0
kernel          :       0x00060000      0x00200000      0
root            :       0x00260000      0x3fda0000      0
usr             :       0x40000000      0x80000000      0    (可以完整分配到地址,而不像supervivi默认的那样最后少一小段)
Supervivi>

完成supervivi下分区

2.  linux下分区

首先是friendly源码:
static struct mtd_partition friendly_arm_default_nand_part[] = {
    [0] = {
        .name    = "supervivi",
        .size    = 0x00060000,
        .offset    = 0,
    },
    [1] = {
        .name    = "Kernel",
        .offset = 0x00060000,
        .size    = 0x00200000,
    },
    [2] = {
        .name    = "root",
        .offset = 0x00260000,
        .size    = 1024 * 1024 * 1024, //64U * 1024 * 1024 - 0x00260000,
    },
    [3] = {
        .name    = "nand",          
     .offset = 0x00000000,                     // 怎么能用0呢??
        .size    = 1024 * 1024 * 1024, //64U * 1024 * 1024 - 0x00260000,
    }
};
然后是楼主所显示的信息:
[root@FriendlyARM /]# cat /proc/mtd
dev:    size   erasesize  name              (附带一问:ersesize是什么东西)
mtd0: 00060000 00020000 "supervivi"
mtd1: 00200000 00020000 "Kernel"
mtd2: 07da0000 00020000 "root"
mtd3: 08000000 00020000 "nand"
[root@FriendlyARM /]#

//-----------------------------
分析:
linux下"supervivi" 大小为0x0006 0000 ,可见supervivi下分的前两区:"vivi"和"param"加起来对应linux下的"supervivi"

"kernel"分区对应,没有问题

"root"大小为 0x07da0000 ,与源码中的1024*1024*1024=0x4000 0000不等,这是为何

//----------------------------------------
分区修改操作:
源码改为:
static struct mtd_partition friendly_arm_default_nand_part[] = {
    [0] = {
        .name    = "supervivi",
        .size    = 0x00060000,
        .offset    = 0,
    },
    [1] = {
        .name    = "Kernel",
        .offset = 0x00060000,
        .size    = 0x00200000,
    },
    [2] = {
        .name    = "root",
        .offset = 0x00260000,
        .size    = 0x3FDA 0000,,
    },
    [3] = {
        .name    = "usr",          
        .offset = 0x40000000,                    
        .size    = 8000 0000,
    };
};

//----------------------------

以上supervivi下的分区已操作,修改过的内核我还没编译,先写下来再验证.

同时在内核编译时开hardECC设置

并在usr分区尝试写数据.

请大家到一起给意见.
级别: 新手上路
UID: 12148
精华: 0
发帖: 20
金钱: 105 两
威望: 21 点
贡献值: 0 点
综合积分: 40 分
注册时间: 2009-12-30
最后登录: 2010-01-13
13楼  发表于: 2010-01-07 14:42
内核源码肯定要改,supervivi-128M是64M分区信息,要用bon自己分区,这个分区要和内核对应。ECC,我想还是不能开吧

还有那个erase 是0x2000=128k 是k9f1g08的块的大小。那个part只是符号表,bon才是真正的分区。bon part info看真正的分区信息。bon修改分区后,我的part对应修改后不能保存,不知道楼上的能否。
[ 此帖被fengchen2008在2010-01-07 14:49重新编辑 ]
级别: 新手上路
UID: 9769
精华: 0
发帖: 13
金钱: 80 两
威望: 25 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2009-10-13
最后登录: 2010-03-24
14楼  发表于: 2010-01-07 15:04
杯具了...
我修改后的代码,同时已开ECC可以正常引导
static struct mtd_partition friendly_arm_default_nand_part[] = {
    [0] = {
        .name    = "supervivi",
        .size    = 0x00060000,
        .offset    = 0,
    },
    [1] = {
        .name    = "Kernel",
        .offset = 0x00060000,
        .size    = 0x00200000,
    },
    [2] = {
        .name    = "root",
        .offset = 0x00260000,
        .size    = 0x3FDA0000,
    },
    [3] = {
        .name    = "usr",          
        .offset = 0x40000000,                    
        .size    = 0x80000000,             嘿嘿..这里错了,再改下试试    }
};
//---------------------------
引导后运行如下.

[root@FriendlyARM /]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00060000 00020000 "supervivi"
mtd1: 00200000 00020000 "Kernel"
mtd2: 07da0000 00020000 "root"
mtd3: 00000000 00000000 "usr"               ---错了..[root@FriendlyARM /]#

/----------
我用新编的内核配 root_qtopia-128M.img, usr分区显示不正常,不知为何啊?


//----------------
我现在没用bon啊,可以正常引导,而且kasim大大说了可以不用bon不是?,我是直接按上面说part分区,然后part save ,掉电上电信息还在,


Supervivi> bon part show
doing partition
hmm bad size show
size = 0
check bad block
part = 0 end = 134217728
part0:
        offset = 0
        size = 134086656
        bad_block = 0
级别: 新手上路
UID: 9769
精华: 0
发帖: 13
金钱: 80 两
威望: 25 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2009-10-13
最后登录: 2010-03-24
15楼  发表于: 2010-01-07 15:30
[3] = {
        .name    = "usr",          
        .offset = 0x40000000,                    
        .size    = 0x40000000,            
  [3] = {
        .name    = "usr",          
        .offset = 0x40000000,                    
        .size    = 0x3f000000,
//----------------
上面两种都试了下,还是不行...

启动信息:
Scanning device for bad blocksde, 407K data, 128K init) inte
Creating 4 MTD partitions on "NAND 128MiB 3,3V 8-bit":
SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=
0x000000000000-0x000000060000 : "supervivi" entries: 2048 (order: 2, 16384 bytes) is b
0x000000060000-0x000000260000 : "Kernel"IPS (lpj=504832)registered new interface
0x000000260000-0x000040000000 : "root"che hash table entries: 512V06xx: regi
mtd: partition "root" extends beyond the end of device "NAND 128MiB 3,3V 8-bit"0000: i
k

//-------------mtd信息
[root@FriendlyARM /]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00060000 00020000 "supervivi"
mtd1: 00200000 00020000 "Kernel"
mtd2: 07da0000 00020000 "root"
mtd3: 00000000 00000000 "usr"
[root@FriendlyARM /]#
//-----------

usr就是没东西...郁闷了

原来怀疑qt那个映像太大了,我就把qt删减了一下做了映像,下载之后进shell错误还是如上.
[ 此帖被sailor163在2010-01-07 15:52重新编辑 ]
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
16楼  发表于: 2010-01-07 16:55
.offset = 0x40000000,  

你的NAND Flash有1G+?前面的root分区的大小也不对。你如果每次都那么粗心,那还是不要玩了
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 9769
精华: 0
发帖: 13
金钱: 80 两
威望: 25 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2009-10-13
最后登录: 2010-03-24
17楼  发表于: 2010-01-07 17:26
哈哈....刚刚也发现了我...现在可以了...虚心接受批评

[root@FriendlyARM /]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00060000 00020000 "supervivi"
mtd1: 00200000 00020000 "Kernel"
mtd2: 03000000 00020000 "root"
mtd3: 04da0000 00020000 "usr"

static struct mtd_partition friendly_arm_default_nand_part[] = {
    [0] = {
        .name    = "supervivi",
        .size    = 0x00060000,
        .offset    = 0,
    },
    [1] = {
        .name    = "Kernel",
        .offset = 0x00060000,
        .size    = 0x00200000,
    },
    [2] = {
        .name    = "root",
        .offset = 0x00260000,
        .size    = 0x3000000,
    },
     [3] = {
        .name    = "usr",          
        .offset = 0x3260000,                    
        .size    = 0x8000000,
    }

最后一个大小会自动调节^_^, 其实一开始part 时就多了个0,vivi居然没有报错,所以一直以这个值来改.....汗啊

接下来测试文件读写是否正常了
[ 此帖被sailor163在2010-01-07 17:37重新编辑 ]
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
18楼  发表于: 2010-01-07 17:50

 回 17楼(sailor163) 的帖子

对于程序设计来说,如果那里有一个问题,那一定会出现的。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
  • «
  • 1
  • 2
  • »
  • Pages: 2/2     Go