TI中文支持网
TI专业的中文技术问题搜集分享网站

关于spi_flash驱动的问题

本人最近在做am335x spi flash的驱动,spi flash用的是w25q32,在board-am335xevm.c中的spi_init函数中增加了如下内容:

setup_pin_mux(spi0_pin_mux);
spi_register_board_info(am335x_spi0_slave_info,ARRAY_SIZE(am335x_spi0_slave_info));

由于我想区分一下spi flash的分区和nand的分区,所以修改了spi的分区表,改成了:

static struct mtd_partition am335x_spi_partitions[] = {
/* All the partition sizes are listed in terms of erase size */
{
.name = "hzf1",
.offset = 0, /* Offset = 0x0 */
.size = SZ_128K,
},
{
.name = "hzf2",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x20000 */
.size = 2 * SZ_128K,
},
{
.name = "hzf3",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x60000 */
.size = 2 * SZ_4K,
},
{
.name = "hzf4",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x62000 */
.size = 28 * SZ_128K,
},
{
.name = "File System",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x3E2000 */
.size = MTDPART_SIZ_FULL, /* size ~= 4.1 MiB */
}
};

修改之后,内核启动会出错,错误信息如下:

05.769324] oprofile: hardware counters not available
[ 105.774634] oprofile: using timer interrupt.
[ 105.779114] nf_conntrack version 0.5.0 (8010 buckets, 32040 max)
[ 105.785929] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 105.791633] TCP cubic registered
[ 105.795003] NET: Registered protocol family 17
[ 105.799650] can: controller area network core (rev 20090105 abi 8)
[ 105.806196] NET: Registered protocol family 29
[ 105.810859] can: raw protocol (rev 20090105)
[ 105.815325] can: broadcast manager protocol (rev 20090105 t)
[ 105.821266] Registering the dns_resolver key type
[ 105.826268] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[ 105.834284] ThumbEE CPU extension supported.
[ 105.838801] mux: Failed to setup hwmod io irq -22
[ 105.844415] Power Management for AM33XX family
[ 105.849288] Trying to load am335x-pm-firmware.bin (60 secs timeout)
[ 105.855980] Copied the M3 firmware to UMEM
[ 105.860335] Cortex M3 Firmware Version = 0x181
[ 105.870227] clock: disabling unused clocks to save power
[ 105.877940] Detected MACID=6c:ec:eb:64:7b:44
[ 105.883633] cpsw: Detected MACID = 6c:ec:eb:64:7b:46
[ 105.889934] omap_rtc am33xx-rtc: setting system clock to 2000-01-01 00:01:44 UTC (946684904)
[ 105.899239] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
[ 105.906633] Please append a correct "root=" boot option; here are the available partitions:
[ 105.915398] 1f00 128 mtdblock0 (driver?)
[ 105.920679] 1f01 256 mtdblock1 (driver?)
[ 105.925972] 1f02 8 mtdblock2 (driver?)
[ 105.931251] 1f03 3584 mtdblock3 (driver?)
[ 105.936536] 1f04 120 mtdblock4 (driver?)
[ 105.941823] 1f05 128 mtdblock5 (driver?)
[ 105.947098] 1f06 128 mtdblock6 (driver?)
[ 105.952382] 1f07 128 mtdblock7 (driver?)
[ 105.957660] 1f08 128 mtdblock8 (driver?)
[ 105.962944] 1f09 1920 mtdblock9 (driver?)
[ 105.968222] 1f0a 128 mtdblock10 (driver?)
[ 105.973596] 1f0b 5120 mtdblock11 (driver?)
[ 105.978966] 1f0c 251904 mtdblock12 (driver?)
[ 105.984342] 1f0d 2560 mtdblock13 (driver?)
[ 105.989711] b300 7761920 mmcblk0 driver: mmcblk
[ 105.995275] b301 321268 mmcblk0p1 00000000-0000-0000-0000-000000000000
[ 106.003103] b302 7430062 mmcblk0p2 00000000-0000-0000-0000-000000000000
[ 106.010915] Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 106.019546] Backtrace:[ 106.022141] [<c00181b4>] (dump_backtrace+0x0/0x10c) from [<c0476bf8>] (dump_stack+0x18/0x1c)
[ 106.030947] r6:00008000 r5:c0568790 r4:c06bca50 r3:c0670c8c
[ 106.036890] [<c0476be0>] (dump_stack+0x0/0x1c) from [<c0476e34>] (panic+0x64/0x194)
[ 106.044908] [<c0476dd0>] (panic+0x0/0x194) from [<c0611c88>] (mount_block_root+0x174/0x228)
[ 106.053630] r3:00000004 r2:00000000 r1:df02df68 r0:c0568790
[ 106.059548] r7:c063ff40
[ 106.062211] [<c0611b14>] (mount_block_root+0x0/0x228) from [<c0611fa4>] (prepare_namespace+0x94/0x1cc)
[ 106.071941] [<c0611f10>] (prepare_namespace+0x0/0x1cc) from [<c06118fc>] (kernel_init+0xf4/0x120)
[ 106.081198] r5:c064c190 r4:c064c190
[ 106.084965] [<c0611808>] (kernel_init+0x0/0x120) from [<c0040890>] (do_exit+0x0/0x65c)
[ 106.093232] r5:c0611808 r4:00000000

难道修改spi frlash的分区就无法启动了吗?我用的启动方式是从nand启动。求大神指教

leo chen:

感觉是ubifs问题,同时需要确认一下block(0,0)是不是nand

 VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)

Jian Zhou:

回复 leo chen:

看样子是修改之后和NAND分区有冲突了。

您是想通过NAND启动然后再加载SPI上的文件系统么?

centvideo centvideo:

回复 Jian Zhou:

您好,我现在想把spi flash的分区挂载到ubifs文件系统下的目录中使用,该怎么挂载呢?这是我的帖子。。。。求指点

http://www.deyisupport.com/question_answer/dsp_arm/davinci_digital_media_processors/f/39/p/99226/259958.aspx#259958

Jian Zhou:

回复 centvideo centvideo:

我已经在您发的帖子里给您回复了

bingliang chen:

回复 centvideo centvideo:

哥们,你的问题解决了嘛?我也是用spi flash中的分区挂载到ubi文件系统里面,错误打印跟你一摸一样的,请问你是怎么解决的?能否告知我?

赞(0)
未经允许不得转载:TI中文支持网 » 关于spi_flash驱动的问题
分享到: 更多 (0)