public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* partition doesn't end on an erase block -> eraseall - permission denied
@ 2005-05-10 11:15 Marcus Mikolaiczyk
  2005-05-11  7:42 ` Marcus Mikolaiczyk
  0 siblings, 1 reply; 2+ messages in thread
From: Marcus Mikolaiczyk @ 2005-05-10 11:15 UTC (permalink / raw)
  To: linux-mtd

Hi all,

Our board uses a NOR Flash (mtd0,1) and a NAND flash 2Gbit Samsung
(256MByte). The NAND is now beeing recognised by the kernel but has some
problems with finding an eraseblock on the NAND.
Pagesize (2K + 64)Bytes
Blocksize(128K + 4K)Bytes (=eraseblocksize 0x21000)

Maybe to make a partition which ends up on an eraseblock could be a
solution?
nanddump is working.

dmesg:
...
devfs: v1.12a (20020514) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
Dummy keyboard driver installed.
pty: 256 Unix98 ptys configured
12:34:56:78:99:9A
12:34:56:78:99:9A
physmap flash device: 2000000 at a8000000
Triboard Flash: Found 2 x16 devices at 0x0 in 32-bit mode
 Intel/Sharp Extended Query Table at 0x0031
cfi_cmdset_0001: Erase suspend on write enabled
Using buffer write method
Creating 2 MTD partitions on "Triboard Flash":
0x00000000-0x00500000 : "Kernel + BOLO"
mtd: Giving out device 0 to Kernel + BOLO
0x00500000-0x02000000 : "User_Flash"
mtd: Giving out device 1 to User_Flash
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB
3,3V 8-bit)
Creating 1 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x00000000-0x10000000 : "BTU NAND flash partition 1"
mtd: partition "BTU NAND flash partition 1" doesn't end on an erase
block -- force read-only
mtd: Giving out device 2 to BTU NAND flash partition 1
...

nanddump /dev/mtd/2 test_mtd2_dump_02 0x0 0x400

Jan  1 00:08:21 10 daemon.info klogd: MTD_open
Jan  1 00:08:21 10 daemon.info klogd: MTD_ioctl
Jan  1 00:08:23 10 daemon.info klogd: MTD_read
Jan  1 00:08:23 10 daemon.info klogd: nand_read_ecc: from = 0x00000000,
len = 512
Jan  1 00:08:23 10 daemon.warn klogd: Reading data from NAND FLASH
without ECC is not recommended
Jan  1 00:08:24 10 daemon.info klogd: MTD_ioctl
Jan  1 00:08:24 10 daemon.info klogd: nand_read_oob: from = 0x00000000,
len = 16
Jan  1 00:08:24 10 daemon.info klogd: MTD_read
Jan  1 00:08:24 10 daemon.info klogd: nand_read_ecc: from = 0x00000200,
len = 512
Jan  1 00:08:24 10 daemon.warn klogd: Reading data from NAND FLASH
without ECC is not recommended
Jan  1 00:08:24 10 daemon.info klogd: MTD_ioctl
Jan  1 00:08:24 10 daemon.info klogd: nand_read_oob: from = 0x00000200,
len = 16
Jan  1 00:08:24 10 daemon.info klogd: MTD_close
Jan  1 00:08:24 10 daemon.info klogd: nand_sync: called

bash-2.05a# eraseall -j /dev/mtd/2
eraseall: /dev/mtd/2: Permission denied

Jan  1 00:10:31 10 daemon.info klogd: MTD_open

bash-2.05a# unlock /dev/mtd/2
Could not open mtd device: /dev/mtd/2

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: partition doesn't end on an erase block -> eraseall - permission denied
  2005-05-10 11:15 partition doesn't end on an erase block -> eraseall - permission denied Marcus Mikolaiczyk
@ 2005-05-11  7:42 ` Marcus Mikolaiczyk
  0 siblings, 0 replies; 2+ messages in thread
From: Marcus Mikolaiczyk @ 2005-05-11  7:42 UTC (permalink / raw)
  To: m.mikolaiczyk; +Cc: linux-mtd

Greetings,

I'm not 100% sure but I think I found the problem. The nand drivers used
doesn't recognise the 2k pagesize. I've got a linux where the chip is
not supported an I change the necessary values to the apropriate ones in
nand_ids.c. The chip is recognised but the programs probably interprete
this as a 512k pagesize.

A small test Programm brought some more clarity in the whole situation.
At first we wrote some bytes with a ICD in the NAND.
A Linux Test application - I used a standard read command (see below)-
could read out the appropriate code but nanddump could not.

Testprogramm reading the first page:
Code (READ1_1 = 0x0 ; READ1_2 = 0x30):
...
 // Read first Page
 printf("Trying to read the first Page\n\n");
 nand_mem_write(CLE,READ1_1);
 nand_mem_write(ALE,0); //Collumn address bit 0-7
 nand_mem_write(ALE,0); //Collumn address bit 8-11
 nand_mem_write(ALE,0); //Row address bit 0-7
 nand_mem_write(ALE,0); //Row address bit 8-15
 nand_mem_write(ALE,0); //Row address bit 16
 nand_mem_write(CLE,READ1_2);
 for (i=0 ; i<264; i++) {
        Address=i*8;
        printf(" Addr %x:  %x %x %x %x %x %x %x %x
\n",Address,nand_mem_read(),n
and_mem_read(),nand_mem_read(),nand_mem_read(),nand_mem_read(),nand_mem_read(),n
and_mem_read(),nand_mem_read());

Output:
Standard Test - Reading NAND Flash device ID
Maker Code ec
Device Code da
Don't Care 80
Multi Plane Code 15
 Trying to read the first Page

 Addr 0:  2 2 2 2 0 0 0 0
 Addr 8:  1 ff ff ff 2 ff ff ff
 Addr 10:  4 ff ff ff 8 ff ff ff
 Addr 18:  10 ff ff ff 20 ff ff ff
 Addr 20:  40 ff ff ff 80 ff ff ff
 Addr 28:  ff ff ff ff ff ff ff ff
 Addr 30:  ff ff ff ff ff ff ff ff
 Addr 38:  ff ff ff ff ff ff ff ff
 Addr 40:  ff ff ff ff ff ff ff ff
 Addr 48:  ff ff ff ff ff ff ff ff
 Addr 50:  ff ff ff ff ff ff ff ff
 ....

The values 1,2,4,8,10,20,40,80 have been written by the in cirquit
debugger test programm.

nanddump - whatever this is I've got no clue
0x00000000: 0c ff ff ff ff ff ff ff ff ab ab ab ab ab ab ab
0x00000010: ab ab ab ab ab ab ab ab ab ff ff ff ff ff ff ff
0x00000020: ff ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00
0x00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000040: 00 00 00 00 00 00 00 00 00 41 41 41 41 41 41 41
0x00000050: 41 41 41 41 41 41 41 41 41 46 46 46 46 46 46 46
0x00000060: 46 46 46 46 46 46 46 46 46 41 41 41 41 41 41 41
0x00000070: 41 41 41 41 41 41 41 41 41 4a 4a 4a 4a 4a 4a 4a
0x00000080: 4a 4a 4a 4a 4a 4a 4a 4a 4a 00 00 00 00 00 00 00
0x00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000000c0: 00 00 00 00 00 00 00 00 00 01 01 01 01 01 01 01
....

So this thread is closed with this information.

Regards Marcus.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-05-11  7:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-10 11:15 partition doesn't end on an erase block -> eraseall - permission denied Marcus Mikolaiczyk
2005-05-11  7:42 ` Marcus Mikolaiczyk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox