All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] error in fw_printenv
@ 2009-09-16 12:53 Rahanesh
  2009-09-16 13:28 ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Rahanesh @ 2009-09-16 12:53 UTC (permalink / raw)
  To: u-boot

Hi All,

When i executed fw_printenv  on an embedded board , it threw an error


IOCTL error : Cannot  get MTD information!!  Any idea why this error 
occurred?

The contents of config file which i used  shown below



 # MTD device name   Device offset   Env. size   Flash sector size   
Number of sectors
   /dev/mtd0                      0x0000      0x1000      0x10000




Please help

Thanks
Rahanesh

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

* [U-Boot] error in fw_printenv
  2009-09-16 12:53 [U-Boot] error in fw_printenv Rahanesh
@ 2009-09-16 13:28 ` Wolfgang Denk
  2009-09-16 13:36   ` Rahanesh
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2009-09-16 13:28 UTC (permalink / raw)
  To: u-boot

Dear Rahanesh,

In message <4AB0DFCA.4040909@tataelxsi.co.in> you wrote:
> 
> When i executed fw_printenv  on an embedded board , it threw an error
> 
> 
> IOCTL error : Cannot  get MTD information!!  Any idea why this error 
> occurred?

Well, looking in the source code, I see a single place with a similar
error message:

 786         rc = ioctl (fd, MEMGETINFO, &mtdinfo);
 787         if (rc < 0) {
 788                 perror ("Cannot get MTD information");
 789                 return -1;
 790         }

But then, the error message would be:

Cannot get MTD information: XXX XXX XXX

with "XXX XXX XXX" giving an explanation of what goes wrong.

What was the "XXX XXX XXX" that got printed in your case?


> The contents of config file which i used  shown below
> 
> 
> 
>  # MTD device name   Device offset   Env. size   Flash sector size   
> Number of sectors
>    /dev/mtd0                      0x0000      0x1000      0x10000

Are you sure this is correct? Your environment size is only 4 KiB?
And your flash secor size is 64 KiB?

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
The so-called "desktop metaphor" of today's workstations  is  instead
an  "airplane-seat"  metaphor.  Anyone who has shuffled a lap full of
papers while seated between two portly passengers will recognize  the
difference -- one can see only a very few things at once.
                                                   - Fred Brooks, Jr.

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

* [U-Boot] error in fw_printenv
  2009-09-16 13:28 ` Wolfgang Denk
@ 2009-09-16 13:36   ` Rahanesh
  2009-09-16 13:42     ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Rahanesh @ 2009-09-16 13:36 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang

Cannot get MTD information: Inappropriate ioctl for device got printed


Thanks
Rahanesh


Wolfgang Denk wrote:
> Dear Rahanesh,
>
> In message <4AB0DFCA.4040909@tataelxsi.co.in> you wrote:
>   
>> When i executed fw_printenv  on an embedded board , it threw an error
>>
>>
>> IOCTL error : Cannot  get MTD information!!  Any idea why this error 
>> occurred?
>>     
>
> Well, looking in the source code, I see a single place with a similar
> error message:
>
>  786         rc = ioctl (fd, MEMGETINFO, &mtdinfo);
>  787         if (rc < 0) {
>  788                 perror ("Cannot get MTD information");
>  789                 return -1;
>  790         }
>
> But then, the error message would be:
>
> Cannot get MTD information: XXX XXX XXX
>
> with "XXX XXX XXX" giving an explanation of what goes wrong.
>
> What was the "XXX XXX XXX" that got printed in your case?
>
>
>   
>> The contents of config file which i used  shown below
>>
>>
>>
>>  # MTD device name   Device offset   Env. size   Flash sector size   
>> Number of sectors
>>    /dev/mtd0                      0x0000      0x1000      0x10000
>>     
>
> Are you sure this is correct? Your environment size is only 4 KiB?
> And your flash secor size is 64 KiB?
>
> Best regards,
>
> Wolfgang Denk
>
>   

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

* [U-Boot] error in fw_printenv
  2009-09-16 13:36   ` Rahanesh
@ 2009-09-16 13:42     ` Wolfgang Denk
  2009-09-17  4:32       ` Rahanesh
  2009-09-17 10:37       ` Rahanesh
  0 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Denk @ 2009-09-16 13:42 UTC (permalink / raw)
  To: u-boot

Dear Rahanesh,

please do not top post / full quote. Please make sure to read
http://www.netmeister.org/news/learn2quote.html


In message <4AB0E9C3.10105@tataelxsi.co.in> you wrote:
> 
> Cannot get MTD information: Inappropriate ioctl for device got printed

Well, that most certainly means that your /dev/mtd0 is not a NOR or
NAND flash device.

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 an old custom among my people. When a woman  saves  a  man's
life, he is grateful.
	-- Nona, the Kanuto which woman, "A Private Little War",
	   stardate 4211.8.

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

* [U-Boot] error in fw_printenv
  2009-09-16 13:42     ` Wolfgang Denk
@ 2009-09-17  4:32       ` Rahanesh
  2009-09-17 10:37       ` Rahanesh
  1 sibling, 0 replies; 7+ messages in thread
From: Rahanesh @ 2009-09-17  4:32 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,
> Well, that most certainly means that your /dev/mtd0 is not a NOR or
> NAND flash device.
>   
      I use mtd_debug utility to identify the /dev/mtd0 device. It said 
it is Nor flash.


Thanks
Rahanesh

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

* [U-Boot] error in fw_printenv
  2009-09-16 13:42     ` Wolfgang Denk
  2009-09-17  4:32       ` Rahanesh
@ 2009-09-17 10:37       ` Rahanesh
  2009-09-17 11:26         ` Detlev Zundel
  1 sibling, 1 reply; 7+ messages in thread
From: Rahanesh @ 2009-09-17 10:37 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

> Well, that most certainly means that your /dev/mtd0 is not a NOR or
> NAND flash device.
>
>   
       Now used the fw_printenv under tools/env directory of uboot. It 
does not have IOCTL error.
     
        On issuing a fw_printenv it showd following messages
 
         Bad data CRC, Using default environment and printed only few 
environment variables.

          Then i did a fw_setenv bootdelay 6. It showed some messgaes of 
erasing flash. But it actually erased my uboot itself.

          What might be the issue? config file?

           MTD device name   Device offset   Env. size        Flash 
sector size   Number of sectors
            /dev/mtd0                0x0000           
0x1000               0x10000


What does Device Offset mean?

/dev/mtd0 has both uboot as well as  environment variables. Environment 
variables lie at bottom of /dev/mtd0. Is that the meaning of device offset?

   #define CFG_ENV_ADDR        0xAD03F000   (Flash starts at 0xAD000000)
   #define CFG_ENV_SIZE        0x1000
   #define CFG_ENV_SECT_SIZE   0x10000


These are the macro that i found in include/configs/board.h

Please help

Thanks
Rahanesh




     
       
    
      
      
     

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

* [U-Boot] error in fw_printenv
  2009-09-17 10:37       ` Rahanesh
@ 2009-09-17 11:26         ` Detlev Zundel
  0 siblings, 0 replies; 7+ messages in thread
From: Detlev Zundel @ 2009-09-17 11:26 UTC (permalink / raw)
  To: u-boot

Hi Rahanesh,

>> Well, that most certainly means that your /dev/mtd0 is not a NOR or
>> NAND flash device.
>>
>>   
>        Now used the fw_printenv under tools/env directory of uboot. It 
> does not have IOCTL error.
>      
>         On issuing a fw_printenv it showd following messages
>  
>          Bad data CRC, Using default environment and printed only few 
> environment variables.

This should have made big warning signs flash up - if data crc was not
correct, it was 99% sure that your configuration wasn't ok.

>           Then i did a fw_setenv bootdelay 6. It showed some messgaes of 
> erasing flash. But it actually erased my uboot itself.

No big wonder here.

>           What might be the issue? config file?

Of course.

>            MTD device name   Device offset   Env. size        Flash 
> sector size   Number of sectors
>             /dev/mtd0                0x0000           
> 0x1000               0x10000
>
>
> What does Device Offset mean?

Offset is the offset into the area mapped by the device file.

> /dev/mtd0 has both uboot as well as  environment variables. Environment 
> variables lie at bottom of /dev/mtd0. Is that the meaning of device offset?

That would be the meaning.  You can always test by reading /dev/mtd0
directly from linux and inspect its contents, i.e. try

dd if=/dev/mtd0 bs=64k count=1 | hexdump -C | less

(or something comparable) and look for your environment.

>    #define CFG_ENV_ADDR        0xAD03F000   (Flash starts at 0xAD000000)
>    #define CFG_ENV_SIZE        0x1000
>    #define CFG_ENV_SECT_SIZE   0x10000
>
>
> These are the macro that i found in include/configs/board.h

This looks completly weird to me.  Can you tell me exactly what board
you are working with?  It looks like this cannot be a NOR flash..

Cheers
  Detlev

-- 
In God we trust.  All others we monitor
                       -- NSA motto
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

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

end of thread, other threads:[~2009-09-17 11:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-16 12:53 [U-Boot] error in fw_printenv Rahanesh
2009-09-16 13:28 ` Wolfgang Denk
2009-09-16 13:36   ` Rahanesh
2009-09-16 13:42     ` Wolfgang Denk
2009-09-17  4:32       ` Rahanesh
2009-09-17 10:37       ` Rahanesh
2009-09-17 11:26         ` Detlev Zundel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.