openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Flashing Image using 'pflash' Tool
@ 2018-11-08 10:04 AKASH G J
  2018-11-09  3:51 ` Lei YU
  2018-11-12 18:43 ` Cédric Le Goater
  0 siblings, 2 replies; 6+ messages in thread
From: AKASH G J @ 2018-11-08 10:04 UTC (permalink / raw)
  To: openbmc

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

I tried to flash kernel image *fitImage.bin* to the flash memory address
*0x20100000* using the following command.

root@zaius:/var# *pflash -a 0x20100000 -f -p fitImage.bin *

It exited with following error.



*About to program "fitImage.bin" at 0x20100000..0x20371e20 !Programming &
Verifying...[                                                  ] 0%Flash
write error 3 for chunk at 0x20100000*

Please someone help to resolve the problem.

Thanks and Regards ,

Akash G J

[-- Attachment #2: Type: text/html, Size: 860 bytes --]

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

* Re: Flashing Image using 'pflash' Tool
  2018-11-08 10:04 Flashing Image using 'pflash' Tool AKASH G J
@ 2018-11-09  3:51 ` Lei YU
  2018-11-09  8:56   ` AKASH G J
  2018-11-12 18:43 ` Cédric Le Goater
  1 sibling, 1 reply; 6+ messages in thread
From: Lei YU @ 2018-11-09  3:51 UTC (permalink / raw)
  To: AKASH G J; +Cc: OpenBMC Maillist

On Thu, Nov 8, 2018 at 6:05 PM AKASH G J <akashgj91@gmail.com> wrote:
>
> I tried to flash kernel image fitImage.bin to the flash memory address 0x20100000 using the following command.
>
> root@zaius:/var# pflash -a 0x20100000 -f -p fitImage.bin
>
> It exited with following error.
>
> About to program "fitImage.bin" at 0x20100000..0x20371e20 !
> Programming & Verifying...
> [                                                  ] 0%Flash write error 3 for chunk at 0x20100000
>
> Please someone help to resolve the problem.

1. pflash defaults to operate on the PNOR chip. If you want to flash the BMC
   chip, you need "-b" argument.
2.To program a flash area, you need to erase before writing, so you need "-e"
   argument.

Putting together, you command should look like:
pflash -b -e -a 0x20100000 -f -p fitImage.bin

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

* Re: Flashing Image using 'pflash' Tool
  2018-11-09  3:51 ` Lei YU
@ 2018-11-09  8:56   ` AKASH G J
  2018-11-12 12:21     ` AKASH G J
  0 siblings, 1 reply; 6+ messages in thread
From: AKASH G J @ 2018-11-09  8:56 UTC (permalink / raw)
  To: Yu Lei; +Cc: openbmc

[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]

I tried the command *pflash -b -e -a 0x20100000 -f -p fitImage.bin*

It is showing the following error.





*WARNING: Erase at 0x20100000 for 0x00271e20 isn't erase block
aligned           About to erase 0x20100000..0x20371e20
!
Erasing...
[                                                  ] 0%mtd_erase: IOCTL to
kerntFailed to blocklevel_smart_erase(): 3 *

On Fri, Nov 9, 2018 at 9:22 AM Lei YU <mine260309@gmail.com> wrote:

> On Thu, Nov 8, 2018 at 6:05 PM AKASH G J <akashgj91@gmail.com> wrote:
> >
> > I tried to flash kernel image fitImage.bin to the flash memory address
> 0x20100000 using the following command.
> >
> > root@zaius:/var# pflash -a 0x20100000 -f -p fitImage.bin
> >
> > It exited with following error.
> >
> > About to program "fitImage.bin" at 0x20100000..0x20371e20 !
> > Programming & Verifying...
> > [                                                  ] 0%Flash write error
> 3 for chunk at 0x20100000
> >
> > Please someone help to resolve the problem.
>
> 1. pflash defaults to operate on the PNOR chip. If you want to flash the
> BMC
>    chip, you need "-b" argument.
> 2.To program a flash area, you need to erase before writing, so you need
> "-e"
>    argument.
>
> Putting together, you command should look like:
> pflash -b -e -a 0x20100000 -f -p fitImage.bin
>

[-- Attachment #2: Type: text/html, Size: 2137 bytes --]

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

* Re: Flashing Image using 'pflash' Tool
  2018-11-09  8:56   ` AKASH G J
@ 2018-11-12 12:21     ` AKASH G J
  2018-11-12 18:37       ` Adriana Kobylak
  0 siblings, 1 reply; 6+ messages in thread
From: AKASH G J @ 2018-11-12 12:21 UTC (permalink / raw)
  To: Yu Lei; +Cc: openbmc

[-- Attachment #1: Type: text/plain, Size: 1531 bytes --]

Is there any other utility in OpenBMC Linux for writing a file to a
specified address in flash memory?

On Fri, Nov 9, 2018 at 2:26 PM AKASH G J <akashgj91@gmail.com> wrote:

> I tried the command *pflash -b -e -a 0x20100000 -f -p fitImage.bin*
>
> It is showing the following error.
>
>
>
>
>
> *WARNING: Erase at 0x20100000 for 0x00271e20 isn't erase block
> aligned           About to erase 0x20100000..0x20371e20
> !
> Erasing...
> [                                                  ] 0%mtd_erase: IOCTL to
> kerntFailed to blocklevel_smart_erase(): 3 *
>
> On Fri, Nov 9, 2018 at 9:22 AM Lei YU <mine260309@gmail.com> wrote:
>
>> On Thu, Nov 8, 2018 at 6:05 PM AKASH G J <akashgj91@gmail.com> wrote:
>> >
>> > I tried to flash kernel image fitImage.bin to the flash memory address
>> 0x20100000 using the following command.
>> >
>> > root@zaius:/var# pflash -a 0x20100000 -f -p fitImage.bin
>> >
>> > It exited with following error.
>> >
>> > About to program "fitImage.bin" at 0x20100000..0x20371e20 !
>> > Programming & Verifying...
>> > [                                                  ] 0%Flash write
>> error 3 for chunk at 0x20100000
>> >
>> > Please someone help to resolve the problem.
>>
>> 1. pflash defaults to operate on the PNOR chip. If you want to flash the
>> BMC
>>    chip, you need "-b" argument.
>> 2.To program a flash area, you need to erase before writing, so you need
>> "-e"
>>    argument.
>>
>> Putting together, you command should look like:
>> pflash -b -e -a 0x20100000 -f -p fitImage.bin
>>
>

[-- Attachment #2: Type: text/html, Size: 2782 bytes --]

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

* Re: Flashing Image using 'pflash' Tool
  2018-11-12 12:21     ` AKASH G J
@ 2018-11-12 18:37       ` Adriana Kobylak
  0 siblings, 0 replies; 6+ messages in thread
From: Adriana Kobylak @ 2018-11-12 18:37 UTC (permalink / raw)
  To: AKASH G J; +Cc: Yu Lei, openbmc, openbmc

On 2018-11-12 06:21, AKASH G J wrote:
> Is there any other utility in OpenBMC Linux for writing a file to a
> specified address in flash memory?

The pflash error "isn't erase block aligned" appears when the check for
64k erase blocks is turned on, and the specified address (0x20100000 in
this case) isn't 64k aligned. There may be more details about if there's
a way to switch this check on and off in the skiboot mailing list
(https://github.com/open-power/skiboot) where the pflash tool 
originates.

An alternate tool would be "dd"
(http://man7.org/linux/man-pages/man1/dd.1.html).
The command could look like:
dd if=fitImage.bin of=/dev/mtd0 --skip=0x20100000 -bs=1

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

* Re: Flashing Image using 'pflash' Tool
  2018-11-08 10:04 Flashing Image using 'pflash' Tool AKASH G J
  2018-11-09  3:51 ` Lei YU
@ 2018-11-12 18:43 ` Cédric Le Goater
  1 sibling, 0 replies; 6+ messages in thread
From: Cédric Le Goater @ 2018-11-12 18:43 UTC (permalink / raw)
  To: openbmc

On 11/8/18 11:04 AM, AKASH G J wrote:
> I tried to flash kernel image /fitImage.bin/ to the flash memory address /0x20100000/ using the following command.


If you are trying to flash a custom BMC kernel only and bypassing 
the standard procedure to do so, you should update the correct
MTD device with dd or flashcp.

	# cat /proc/mtd 
	dev:    size   erasesize  name
	mtd0: 02000000 00010000 "bmc"
	mtd1: 00060000 00010000 "u-boot"
	mtd2: 00020000 00010000 "u-boot-env"
	mtd3: 00440000 00010000 "kernel"
	mtd4: 01740000 00010000 "rofs"
	mtd5: 00400000 00010000 "rwfs"
	mtd6: 02000000 00010000 "pnor"

I don't have a zaius but it should be roughly similar.  

Cheers,

C.


> root@zaius:/var# /pflash -a 0x20100000 -f -p fitImage.bin /
> 
> It exited with following error.
> 
> /About to program "fitImage.bin" at 0x20100000..0x20371e20 !
> Programming & Verifying...
> [                                                  ] 0%Flash write error 3 for chunk at 0x20100000/
> /
> /
> Please someone help to resolve the problem.
> //
> 
> Thanks and Regards ,
> 
> Akash G J

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

end of thread, other threads:[~2018-11-12 21:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 10:04 Flashing Image using 'pflash' Tool AKASH G J
2018-11-09  3:51 ` Lei YU
2018-11-09  8:56   ` AKASH G J
2018-11-12 12:21     ` AKASH G J
2018-11-12 18:37       ` Adriana Kobylak
2018-11-12 18:43 ` Cédric Le Goater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).