Discussion:
[U-Boot] Fw:How can I use yaffs2 in uboot
jackfriend
2010-06-07 02:39:07 UTC
Permalink
How can I use yaffs2 in uboot

I add CONFIG_YAFFS2 in /include/configs/smdk2410.h


my2440 # nand write 0x30008000 80000 40000

NAND write: device 0 offset 0x80000, size 0x40000

262144 bytes written: OK

my2440 #


my2440 # ymount /flash

yaffs: Mounting /flash

my2440 # ywrm a 0x30008000 40000

Error opening file: -1


I also need what parameters ?

thanks!
Wolfgang Denk
2010-06-07 06:44:01 UTC
Permalink
Dear jackfriend,
Post by jackfriend
How can I use yaffs2 in uboot
...
Post by jackfriend
my2440 # ymount /flash
yaffs: Mounting /flash
Looks good?
Post by jackfriend
my2440 # ywrm a 0x30008000 40000
Error opening file: -1
Maybe you try a "yls" first to check which files are present in your
file system. Then test if read accesses are working. I'm not sure if
write mode has been tested (or even implemented).

Also, it might make sense to enable YAFFS2_DEBUG while testing.

Best regards,

Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"It is better to have tried and failed than to have failed to try,
but the result's the same." - Mike Dennison
William Juul
2010-06-07 06:56:34 UTC
Permalink
Post by Wolfgang Denk
Dear jackfriend,
Post by jackfriend
How can I use yaffs2 in uboot
You have to use absolute path with all commands. eg "yls /flash/"
This path must match your mount points as configured in fs/yaffs/yaffscfg.c
Post by Wolfgang Denk
Post by jackfriend
my2440 # ywrm a 0x30008000 40000
Error opening file: -1
Maybe you try a "yls" first to check which files are present in your
file system. Then test if read accesses are working. I'm not sure if
write mode has been tested (or even implemented).
Write mode is in use and working.

Best regards
William Juul
Post by Wolfgang Denk
Also, it might make sense to enable YAFFS2_DEBUG while testing.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"It is better to have tried and failed than to have failed to try,
but the result's the same." - Mike Dennison
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
jackfriend
2010-06-08 01:49:58 UTC
Permalink
Thank you for your help

NOW with absolute path can write and read (small files)

but When I write large files,such as 50M (Nand flash size is 256M)

Display

yaffs: Could not allocate Tnodes
yaffs: Could not allocate Tnodes
yaffs: Could not allocate Tnodes
...
(Many)



and then restart

my2440 # yls /fash

yaffs: Mounting /flash

yaffs: Could not allocate Tnodes

Error mounting /flash, return value: -12

opendir failed
William Juul
2010-06-08 07:07:01 UTC
Permalink
Post by jackfriend
Thank you for your help
NOW with absolute path can write and read (small files)
Good.
but When I write large files,such as 50M (Nand flash size is 256M)
...
yaffs: Mounting /flash
yaffs: Could not allocate Tnodes
Error mounting /flash, return value: -12
opendir failed
I cannot recall having seen that error, but I don't think I have ever tried
with files larger than 20MB. Besides our out of tree port have started to
slightly move away from upstream U-boot.

I suggest you try to debug your problem. "yaffs_traceMask" in
fs/yaffs/yaffscfg.c is probably your friend.

Best regards
William Juul
Wolfgang Denk
2010-06-08 07:17:35 UTC
Permalink
Dear jackfriend,
Post by jackfriend
Thank you for your help
NOW with absolute path can write and read (small files)
but When I write large files,such as 50M (Nand flash size is 256M)
Display
yaffs: Could not allocate Tnodes
yaffs: Could not allocate Tnodes
yaffs: Could not allocate Tnodes
...
Sounds like a pretty clear error message - doesn't it?

Increase CONFIG_SYS_MALLOC_LEN in your bard config file.

[It might make sense to improve the error message in
fs/yaffs2/yaffs_guts.c to include information how many bytes were to
be allocated, so you get an idea on how uch to increase the malloc
arena size.]

Best regards,

Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"There is no distinctly American criminal class except Congress."
- Mark Twain
jackfriend
2010-06-09 03:47:38 UTC
Permalink
Sounds like a pretty clear error message - doesn't it?

Increase CONFIG_SYS_MALLOC_LEN in your bard config file.

[It might make sense to improve the error message in
fs/yaffs2/yaffs_guts.c to include information how many bytes were to
be allocated, so you get an idea on how uch to increase the malloc
arena size.]

Best regards,

Wolfgang Denk

thanks a lot


Change CONFIG_SYS_MALLOC_LEN ,Now I can write a yaffs2 file system image (59M) in nand flash (/flash/a )

but The Linux how to find the file system image?(the system support yaffs2)

set bootargs noinitrd root=/dev/mtdblock3 rootfstype=yaffs2 rw console=ttySAC0,115200 init=/linuxrc mem=64M

this way doesn't work

I use

my2440# nand write.yaffs 30008000 0x580000 3b00000

NAND write: device 0 offset 0x580000, size 0x3b00000

written: OK

my2440#tftp zImage.img

and then bootm linux can find the file system image
Wolfgang Denk
2010-06-09 07:30:49 UTC
Permalink
Dear jackfriend,
Post by Wolfgang Denk
Sounds like a pretty clear error message - doesn't it?
Increase CONFIG_SYS_MALLOC_LEN in your bard config file.
[It might make sense to improve the error message in
fs/yaffs2/yaffs_guts.c to include information how many bytes were to
be allocated, so you get an idea on how uch to increase the malloc
arena size.]
Best regards,
Wolfgang Denk
thanks a lot
Change CONFIG_SYS_MALLOC_LEN ,Now I can write a yaffs2 file system image (59M) in nand flash (/flash/a )
Please use quoting so one can see what was written by you and what was
written by others. And remove unneeded lines. See
http://www.netmeister.org/news/learn2quote.html
Post by Wolfgang Denk
but The Linux how to find the file system image?(the system support yaffs2)
set bootargs noinitrd root=/dev/mtdblock3 rootfstype=yaffs2 rw console=ttySAC0,115200 init=/linuxrc mem=64M
And how are your MTD partitions set up in Linux?

Best regards,

Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
(null cookie; hope that's ok)
jackfriend
2010-06-09 13:27:55 UTC
Permalink
Post by Wolfgang Denk
And how are your MTD partitions set up in Linux?
[*] MTD partitioning support
< > RedBoot partition table parsing
[*] Command line partition table parsing
< > TI AR7 partitioning support

static struct mtd_partition mini2440_default_nand_part[] __initdata = {
[0] = {
.name = "u-boot",
.size = SZ_256K + SZ_128K,
.offset = 0,
},
[1] = {
.name = "u-boot-env",
.size = SZ_128K,
.offset = SZ_256K + SZ_128K,
},
[2] = {
.name = "kernel",
/* 5 megabytes, for a kernel with no modules
* or a uImage with a ramdisk attached */
.size = 0x00500000,
.offset = SZ_512K,
},
[3] = {
.name = "root",
.offset = SZ_512K + 0x00500000,
.size = MTDPART_SIZ_FULL,
},
};

in /uboot/fs/yaffs2/yaffscfg.c
flashDev->startBlock =44;
flashDev->endBlock = 800;
jackfriend
2010-06-11 01:30:39 UTC
Permalink
Change CONFIG_SYS_MALLOC_LEN ,Now I can write a yaffs2 file system image (59M) in nand flash (/flash/a )

but The Linux how to find the file system image?(the system support yaffs2)
set bootargs noinitrd root=/dev/mtdblock3 rootfstype=yaffs2 rw console=ttySAC0,115200 init=/linuxrc mem=64M

this way doesn't work

I use

my2440# nand write.yaffs 30008000 0x580000 3b00000
NAND write: device 0 offset 0x580000, size 0x3b00000
written: OK

my2440#tftp zImage.img

and then bootm linux can find the file system image


[*] MTD partitioning support
< > RedBoot partition table parsing
[*] Command line partition table parsing
< > TI AR7 partitioning support
static struct mtd_partition mini2440_default_nand_part[] __initdata = {

[0] = {
.name = "u-boot",
.size = SZ_256K + SZ_128K,
.offset = 0,
},

[1] = {
.name = "u-boot-env",
.size = SZ_128K,
.offset = SZ_256K + SZ_128K,
},

[2] = {
.name = "kernel",
.size = 0x00500000,
.offset = SZ_512K,
},

[3] = {
.name = "root",
.offset = SZ_512K + 0x00500000,
.size = MTDPART_SIZ_FULL,
},
};

in /uboot/fs/yaffs2/yaffscfg.c flashDev->startBlock =44;
flashDev->endBlock = 800;

Loading...