Amitesh Singh | 4 Sep 2006 08:07
Picon

Can I change 'RedBoot Config' using MTD driver. ?

Hi all
  My Task is to set "Boot script" (RedBoot config) value via a linux
command.

As on RedBoot prompt,we set configurations using 'fconfig',is there any
Linux tool which does the same ?

 i tried to do it in my way.

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00020000 "RedBoot"
mtd1: 00f80000 00020000 "unallocated"
mtd2: 00001000 00020000 "RedBoot config"
mtd3: 00020000 00020000 "FIS directory"

First i copied 'mtd2' using 'dd' and then changed the binary using 'hexedit'
(just changed Boot script).
Before booting,I unlocked RedBoot partitions.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0x50000000  0x50000000  0x00040000  0x00000000
RedBoot config    0x50FC0000  0x50FC0000  0x00001000  0x00000000
FIS directory     0x50FE0000  0x50FE0000  0x00020000  0x00000000
RedBoot> fis unlock RedBoot
... Unlock from 0x50000000-0x50040000: ..
RedBoot> fis unlock "RedBoot config"
... Unlock from 0x50fc0000-0x50fc1000: .
RedBoot> fis unlock "FIS directory"
(Continue reading)

Gary Thomas | 4 Sep 2006 14:24
Favicon

Re: Can I change 'RedBoot Config' using MTD driver. ?

Amitesh Singh wrote:
> Hi all
>  My Task is to set "Boot script" (RedBoot config) value via a linux
> command.
>
> As on RedBoot prompt,we set configurations using 'fconfig',is there any
> Linux tool which does the same ?
>
> i tried to do it in my way.
>
> # cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00040000 00020000 "RedBoot"
> mtd1: 00f80000 00020000 "unallocated"
> mtd2: 00001000 00020000 "RedBoot config"
> mtd3: 00020000 00020000 "FIS directory"
>
>
> First i copied 'mtd2' using 'dd' and then changed the binary using 
> 'hexedit'
> (just changed Boot script).
> Before booting,I unlocked RedBoot partitions.
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> RedBoot> fis list
> Name              FLASH addr  Mem addr    Length      Entry point
> RedBoot           0x50000000  0x50000000  0x00040000  0x00000000
> RedBoot config    0x50FC0000  0x50FC0000  0x00001000  0x00000000
> FIS directory     0x50FE0000  0x50FE0000  0x00020000  0x00000000
> RedBoot> fis unlock RedBoot
> ... Unlock from 0x50000000-0x50040000: ..
(Continue reading)

Amitesh Singh | 4 Sep 2006 15:36
Picon

Re: Can I change 'RedBoot Config' using MTD driver. ?

Hi Gary
 Thanks,
Well,instead of changing RedBoot,I have modified the code
'mtdpart.c".(linux-2.6.x/drivers/mtd)

  if ((slave->mtd.flags & MTD_WRITEABLE) &&
                   (slave->mtd.size % slave->mtd.erasesize)) {
               //      slave->mtd.flags &= ~MTD_WRITEABLE;
                       slave->mtd.flags &=MTD_WRITEABLE;
                       printk ("mtd: partition \"%s\" doesn't end on
an erase block -- force read-only---Hacked ;-)\n",
                               parts[i].name);
               }

Now,I am able to read/write "RedBoot config" partition. ;-)

Thanks for the help

--
Amitesh
http://www.amitesh.info

On 9/4/06, Gary Thomas <gary <at> mlbassoc.com> wrote:
> Amitesh Singh wrote:
> > Hi all
> >  My Task is to set "Boot script" (RedBoot config) value via a linux
> > command.
> >
> > As on RedBoot prompt,we set configurations using 'fconfig',is there any
> > Linux tool which does the same ?
(Continue reading)


Gmane