* Magic bitmask 0x1985 not found
@ 2001-07-19 21:49 McNutt, Scott
2001-07-19 23:28 ` David Woodhouse
0 siblings, 1 reply; 5+ messages in thread
From: McNutt, Scott @ 2001-07-19 21:49 UTC (permalink / raw)
To: linux-mtd
If anyone can point me in the right direction in correcting
the following ... I'd be greatful :-)
Basically, I can only mount a jffs2 partition read-only.
I created a jffs2 image padded to the size of the entire mtd
partition ("Primary") using mkfs.jffs2 and programmed the flash
via simple boot monitor. I always observer the bitmask 0x1985
not found message, followed by an erase error, and the partition
ends up being mounted read-only.
The partition mask_flags are set to:
------------------------------------
MTD_CAP_NORFLASH | MTD_WRITEABLE
At boot time:
--------------------
ACP PMPPC: Found 1 x16 devices at 0x0 in 16-bit mode
JEDEC ID: 89 18
0: offset=0x0,size=0x20000,blocks=128
mtd: Giving out device 0 to ACP PMPPC
Creating 3 MTD partitions on "ACP PMPPC":
0x00000000-0x00200000 : "Boot"
mtd: Giving out device 1 to Boot
0x00200000-0x00e00000 : "Primary"
mtd: Giving out device 2 to Primary
0x00e00000-0x01000000 : "Monitor"
mtd: Giving out device 3 to Monitor
mtd: Giving out device 4 to mtdram test device
and /proc/mtd reports:
-----------------------
dev: size erasesize name
mtd0: 01000000 00020000 "ACP PMPPC"
mtd1: 00200000 00020000 "Boot"
mtd2: 00c00000 00020000 "Primary"
mtd3: 00200000 00020000 "Monitor"
mtd4: 00400000 00020000 "mtdram test device"
Upon mounting the partition I observe:
---------------------------------------
sh-2.03# mount -t jffs2 /dev/mtdblock/2 /usr
mtdblock_open
ok
mtdblock_release
ok
mount: block device /dev/mtdblock/2 is write-protected, mounting read-only
mtdblock_open
ok
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020000:
0xe002 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020004:
0x0a2d instead
<< etc. etc. >>
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005a0024:
0x2080 instead
Further such events for this erase block will not be printed
Eep. Child "halt" (ino #185) of dir ino #169 doesn't exist!
Erase at 0x00be0000 failed immediately: -30
Erase at 0x00bc0000 failed immediately: -30
<< etc. etc. >>
Erase at 0x005e0000 failed immediately: -30
Erase at 0x005c0000 failed immediately: -30
------------------------------
Any ideas?
--Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Magic bitmask 0x1985 not found
2001-07-19 21:49 Magic bitmask 0x1985 not found McNutt, Scott
@ 2001-07-19 23:28 ` David Woodhouse
0 siblings, 0 replies; 5+ messages in thread
From: David Woodhouse @ 2001-07-19 23:28 UTC (permalink / raw)
To: McNutt, Scott; +Cc: linux-mtd
smcnutt@artesyncp.com said:
> mount: block device /dev/mtdblock/2 is write-protected, mounting
> read-only
Why JFFS2 if it's readonly and the sectors are protected? Surely cramfs
would suffice? JFFS2 doesn't deal nicely with the read-only case ATM,
although it's simple enough to fix. That's not the main problem though.
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020000: 0xe002 instead
What's at offset 0x1fffc in the partition? 0x1985? What '-e' value was
given to mkfs.jffs2?
--
dwmw2
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Magic bitmask 0x1985 not found
@ 2001-07-20 13:47 McNutt, Scott
2001-07-20 15:09 ` David Woodhouse
0 siblings, 1 reply; 5+ messages in thread
From: McNutt, Scott @ 2001-07-20 13:47 UTC (permalink / raw)
To: linux-mtd
> From: David Woodhouse
>
> smcnutt@artesyncp.com said:
> > mount: block device /dev/mtdblock/2 is write-protected, mounting
> > read-only
>
> Why JFFS2 if it's readonly and the sectors are protected?
> Surely cramfs would suffice?
I don't want readonly ... my mistake ... I was
setting MTD_WRITEABLE vs. clearing it (duh!)
> > jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x00020000: 0xe002 instead
>
> What's at offset 0x1fffc in the partition? 0x1985?
Here's the dump:
01fff0 90 87 2f 34 2e 16 d5 26 bc c0 4e d1 ff ff 19 85
...
03fff0 84 00 03 00 de 72 b0 79 ff ff ff ff 19 85 e0 02
05fff0 ff ff ff ff ff ff ff ff ff ff 19 85 e0 02 00 00
So ... the offsets are jacked.
> What '-e' value was given to mkfs.jffs2?
I thought I used 131072. But based on the dump, I must have
fat-fingered 131071 :-(. I made a new image with -e 131072
and it looks good.
Thanks for the help!
--Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Magic bitmask 0x1985 not found
2001-07-20 13:47 McNutt, Scott
@ 2001-07-20 15:09 ` David Woodhouse
0 siblings, 0 replies; 5+ messages in thread
From: David Woodhouse @ 2001-07-20 15:09 UTC (permalink / raw)
To: McNutt, Scott; +Cc: linux-mtd
smcnutt@artesyncp.com said:
> I thought I used 131072. But based on the dump, I must have
> fat-fingered 131071 :-(. I made a new image with -e 131072 and it
> looks good.
Er, yes, that would confuse it quite a lot. Perhaps we ought to make
mkfs.jffs2 reject values which aren't a power of two?
--
dwmw2
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Magic bitmask 0x1985 not found
@ 2001-07-20 17:29 McNutt, Scott
0 siblings, 0 replies; 5+ messages in thread
From: McNutt, Scott @ 2001-07-20 17:29 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd
> From: David Woodhouse
>
> smcnutt@artesyncp.com said:
> > I thought I used 131072. But based on the dump, I must have
> > fat-fingered 131071 :-(. I made a new image with -e 131072 and it
> > looks good.
>
> Er, yes, that would confuse it quite a lot. Perhaps we ought to make
> mkfs.jffs2 reject values which aren't a power of two?
>
Here's a quicky:
case 'e':
{
unsigned int erase_mask;
erase_block_size = strtol(optarg, NULL, 0);
erase_mask = (unsigned)(-1)>>
((sizeof(erase_block_size)<<3) - ffs(erase_block_size )
+ 1);
if( erase_block_size & erase_mask ){
printf( "erase size must be power of 2\n");
exit(1);
}
}
break;
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-07-20 17:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-19 21:49 Magic bitmask 0x1985 not found McNutt, Scott
2001-07-19 23:28 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2001-07-20 13:47 McNutt, Scott
2001-07-20 15:09 ` David Woodhouse
2001-07-20 17:29 McNutt, Scott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox