This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

请教IPNC DM368的内核分区和文件系统分区大小如何修改?



工程师好!

         我们使用的是APPRO的IPNC DM368,由于在内核中添加了较多配置选项,所以造成内核大小超过默认的最大值0x400000=4.19M,所以我们需要修改内核分区和文件系统分区的大小,以下是原始的nand烧写命令和启动参数:

tftpboot 0x80700000 uImage_ipnc_dm368;

tftpboot 0x82000000 ipnc_dm368_ubifs

nand erase 0x500000 0x400000;nand write 0x80700000 0x500000 0x400000;
nand erase 0x900000 0x2800000;nand write 0x82000000 0x900000 0x2800000;reset

setenv bootcmd 'nboot 0x80700000 0 0x500000;bootm 0x80700000'

setenv bootargs 'mem=48M console=ttyS1,115200n8 noinitrd ip=dhcp rw ubi.mtd=3,2048 rootfstype=ubifs
root=ubi0:rootfs cmemk.phys_start=0x83000000 cmemk.phys_end=0x88000000 cmemk.phys_start_1=0x00001000
cmemk.phys_end_1=0x00008000 cmemk.pools_1=1x28672 cmemk.allowOverlap=1 cmemk.useHeapIfPoolUnavailable=1
nohz=off highres=off clocksource=acpi_pm lpj=1077248 eth=$(ethaddr) quiet'

希望将内核大小设置为0x500000,所以修改nand命令为:

nand erase 0x500000 0x500000;nand write 0x80700000 0x500000 0x500000;
nand erase 0x1000000 0x2800000;nand write 0x82000000 0x1000000 0x2800000;

但是烧写之后,启动IPNC,报出如下错误:

Starting kernel ...

[ 0.778231] UBI error: compare_lebs: unsupported on-flash UBI format
[ 0.778262]
[ 0.786448] UBI error: ubi_init: cannot attach mtd3
[ 0.876703] Error: Driver 'davinci-mcbsp' is already registered, aborting...
[ 3.441952] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 3.450305] Backtrace:
[ 3.452778] Function entered at [<c002f518>] from [<c0387194>]
[ 3.458614] r7:00008000 r6:c2813000 r5:c00252c8 r4:c043c600
[ 3.464395] Function entered at [<c038717c>] from [<c0387200>]
[ 3.470283] Function entered at [<c0387198>] from [<c0008f8c>]
[ 3.476124] r3:00000000 r2:00000000 r1:c2825f78 r0:c03ad849
[ 3.481864] Function entered at [<c0008d28>] from [<c00090e4>]
[ 3.487701] Function entered at [<c0009050>] from [<c00084b4>]
[ 3.493571] r5:c0024a64 r4:c043be18
[ 3.497169] Function entered at [<c00083a4>] from [<c00443cc>]
[ 3.503038] r5:c00083a4 r4:00000000

我怀疑还是内核分区和文件系统分区大小的问题,所以想请教各位高手应该如何修改才能增大内核和文件系统的分区大小?

                                       谢谢!!!

  • 你好,

    请尝试修改下面部分的代码:

    5.1/Source/dvsdk_ipnctools/ipnc_psp_03_21_00_04/kernel/arch/arm/mach-davinci/board-dm368-ipnc.c

    static struct mtd_partition davinci_nand_partitions[] = {
     {
      /* UBL (a few copies) plus U-Boot */
      .name  = "bootloader",
      .offset  = 0,
      .size  = 24 * NAND_BLOCK_SIZE,
      .mask_flags = 0,
     }, {
      /* U-Boot environment */
      .name  = "params",
      .offset  = MTDPART_OFS_APPEND,
      .size  = 16 * NAND_BLOCK_SIZE,
      .mask_flags = 0,
     }, {
      .name  = "kernel",
      .offset  = MTDPART_OFS_APPEND,
             .size  = SZ_2M + SZ_2M,
      .mask_flags = 0,

     }, {
      .name  = "filesystem1",
      .offset  = MTDPART_OFS_APPEND,
      .size  = SZ_32M + SZ_8M ,
      .mask_flags = 0,
     }, {
      .name  = "data1",
      .offset  = MTDPART_OFS_APPEND,
      .size  = SZ_8M,
      .mask_flags = 0,
     },{
                    .name           = "filesystem2",
                    .offset         = MTDPART_OFS_APPEND,
                    .size           =  SZ_32M + SZ_8M ,
                    .mask_flags     = 0,
            },
     {
                    .name           = "data2",
                    .offset         = MTDPART_OFS_APPEND,
                    .size           = MTDPART_SIZ_FULL,
                    .mask_flags     = 0,
            },

     /* two blocks with bad block table (and mirror) at the end */
    };