Skip to contentSkip to conversation

flash unlock on VPB

DISCUSSION stiger 2 participants 3 messages Feb 5, 2005 Memory technology devices (MTD)

lore
Share & tools
lore

stiger

author
#0 lore raw

hello,

i'm using VPB + kernel 2.6.9
but i found the flash cannot write, it should be unlocked first.

if not use root filesystem in flash, I can use flash_unlock to unlock the flash.
but if burn root filesystem into flash, i have to change the kernel code.

i add these code at driver/mtd/mtdpart.c->add_mtd_partitions()

        if((slave->mtd.flags & MTD_WRITEABLE) && slave->mtd.unlock ){
            slave->mtd.unlock(&(slave->mtd), 0, slave->mtd.size );
        }

now, it works.
but i think it's a stupid way to do this.
is there any other way to do this ?

#1 lore raw
Quoted 11 lines · stiger

hello,

i'm using VPB + kernel 2.6.9
but i found the flash cannot write, it should be unlocked first.

if not use root filesystem in flash, I can use flash_unlock to unlock the flash.
but if burn root filesystem into flash, i have to change the kernel code.

i add these code at driver/mtd/mtdpart.c->add_mtd_partitions()

Quoted 7 lines
        if((slave->mtd.flags & MTD_WRITEABLE) && slave->mtd.unlock ){
            slave->mtd.unlock(&(slave->mtd), 0, slave->mtd.size );
        }

now, it works.
but i think it's a stupid way to do this.
is there any other way to do this ?

The unlock is usually called from the map driver in that case.

Nicolas

author
#2 lore raw

thx.

Is there any code to real call unlock?

i see many map drivers only set
.mask_flags = MTD_WRITEABLE
and then call add_mtd_partitions()
but i didn't see any real unlock in map drivers.

so, how can they do when they want to use writeable root filesystem in flash ?

----- Original Message -----
From: "Nicolas Pitre" <[email protected]>
To: "stiger" <[email protected]>
Cc: <[email protected]>
Sent: Saturday, February 05, 2005 10:39 AM
Subject: Re: flash unlock on VPB

Quoted 25 lines · stiger
Quoted 12 lines

hello,

i'm using VPB + kernel 2.6.9
but i found the flash cannot write, it should be unlocked first.

if not use root filesystem in flash, I can use flash_unlock to unlock the flash.
but if burn root filesystem into flash, i have to change the kernel code.

i add these code at driver/mtd/mtdpart.c->add_mtd_partitions()

Quoted 7 lines
        if((slave->mtd.flags & MTD_WRITEABLE) && slave->mtd.unlock ){
            slave->mtd.unlock(&(slave->mtd), 0, slave->mtd.size );
        }

now, it works.
but i think it's a stupid way to do this.
is there any other way to do this ?

The unlock is usually called from the map driver in that case.

Nicolas