All of lore.kernel.org
 help / color / mirror / Atom feed
* Unable to read or write from system SPI flash memory.
@ 2019-02-13  8:54 AKASH G J
  2019-02-13 22:43 ` Andrew Jeffery
  0 siblings, 1 reply; 12+ messages in thread
From: AKASH G J @ 2019-02-13  8:54 UTC (permalink / raw)
  To: openbmc

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

Hi all,

We have a test board containing BMC Aspeed AST-2500. It contains BMC flash
memory, SPI1 flash memory and SPI2 flash memory. we are using zaius machine
configuration for building Linux. When I am trying to write to SPI1 flash
at address 30000000 using pflash tool, the modified data is not reflected
after reboot. Same with SPI2 flash. With pflash tool I am able to write
data permanently to BMC flash memory. The device tree for SPI devices is
following.

&fmc {
    status = "okay";

    flash@0 {
        status = "okay";
        label = "bmc";
        m25p,fast-read;
        spi-max-frequency = <50000000>;
#include "openbmc-flash-layout.dtsi"
    };
};

&spi1 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_spi1_default>;

    flash@0 {
        status = "okay";
        label = "pnor";
        m25p,fast-read;
        spi-max-frequency = <100000000>;
    };
};

&spi2 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_spi2ck_default
             &pinctrl_spi2cs0_default
             &pinctrl_spi2cs1_default
             &pinctrl_spi2miso_default
             &pinctrl_spi2mosi_default>;

    flash@0 {
        status = "okay";
    };
};

Please someone help to resolve the problem.


Thanks in advance.

Akash

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

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-13  8:54 Unable to read or write from system SPI flash memory AKASH G J
@ 2019-02-13 22:43 ` Andrew Jeffery
  2019-02-14  4:29   ` AKASH G J
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Jeffery @ 2019-02-13 22:43 UTC (permalink / raw)
  To: AKASH G J, openbmc

On Wed, 13 Feb 2019, at 19:24, AKASH G J wrote:
> Hi all,
> 
> We have a test board containing BMC Aspeed AST-2500. It contains BMC flash
> memory, SPI1 flash memory and SPI2 flash memory. we are using zaius machine
> configuration for building Linux. When I am trying to write to SPI1 flash
> at address 30000000 using pflash tool, the modified data is not reflected
> after reboot. Same with SPI2 flash. With pflash tool I am able to write
> data permanently to BMC flash memory. The device tree for SPI devices is
> following.
> 
> &fmc {
>     status = "okay";
> 
>     flash@0 {
>         status = "okay";
>         label = "bmc";
>         m25p,fast-read;
>         spi-max-frequency = <50000000>;
> #include "openbmc-flash-layout.dtsi"
>     };
> };
> 
> &spi1 {
>     status = "okay";
>     pinctrl-names = "default";
>     pinctrl-0 = <&pinctrl_spi1_default>;
> 
>     flash@0 {
>         status = "okay";
>         label = "pnor";
>         m25p,fast-read;
>         spi-max-frequency = <100000000>;
>     };
> };
> 
> &spi2 {
>     status = "okay";
>     pinctrl-names = "default";
>     pinctrl-0 = <&pinctrl_spi2ck_default
>              &pinctrl_spi2cs0_default
>              &pinctrl_spi2cs1_default
>              &pinctrl_spi2miso_default
>              &pinctrl_spi2mosi_default>;
> 
>     flash@0 {
>         status = "okay";
>     };
> };

How are you invoking pflash? You should not be using the /dev/mem backend
when you have the flash controller and devices enabled via the devicetree. You
should be using the mtd backend instead.

Andrew

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-13 22:43 ` Andrew Jeffery
@ 2019-02-14  4:29   ` AKASH G J
  2019-02-14 23:28     ` Andrew Jeffery
  0 siblings, 1 reply; 12+ messages in thread
From: AKASH G J @ 2019-02-14  4:29 UTC (permalink / raw)
  To: Andrew Jeffery; +Cc: openbmc

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

I am using the following command to write data to SPI1 flash.
*pflash -e -a 0 -f -p <filename>*

On Thu, Feb 14, 2019 at 4:13 AM Andrew Jeffery <andrew@aj.id.au> wrote:

> On Wed, 13 Feb 2019, at 19:24, AKASH G J wrote:
> > Hi all,
> >
> > We have a test board containing BMC Aspeed AST-2500. It contains BMC
> flash
> > memory, SPI1 flash memory and SPI2 flash memory. we are using zaius
> machine
> > configuration for building Linux. When I am trying to write to SPI1 flash
> > at address 30000000 using pflash tool, the modified data is not reflected
> > after reboot. Same with SPI2 flash. With pflash tool I am able to write
> > data permanently to BMC flash memory. The device tree for SPI devices is
> > following.
> >
> > &fmc {
> >     status = "okay";
> >
> >     flash@0 {
> >         status = "okay";
> >         label = "bmc";
> >         m25p,fast-read;
> >         spi-max-frequency = <50000000>;
> > #include "openbmc-flash-layout.dtsi"
> >     };
> > };
> >
> > &spi1 {
> >     status = "okay";
> >     pinctrl-names = "default";
> >     pinctrl-0 = <&pinctrl_spi1_default>;
> >
> >     flash@0 {
> >         status = "okay";
> >         label = "pnor";
> >         m25p,fast-read;
> >         spi-max-frequency = <100000000>;
> >     };
> > };
> >
> > &spi2 {
> >     status = "okay";
> >     pinctrl-names = "default";
> >     pinctrl-0 = <&pinctrl_spi2ck_default
> >              &pinctrl_spi2cs0_default
> >              &pinctrl_spi2cs1_default
> >              &pinctrl_spi2miso_default
> >              &pinctrl_spi2mosi_default>;
> >
> >     flash@0 {
> >         status = "okay";
> >     };
> > };
>
> How are you invoking pflash? You should not be using the /dev/mem backend
> when you have the flash controller and devices enabled via the devicetree.
> You
> should be using the mtd backend instead.
>
> Andrew
>

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

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-14  4:29   ` AKASH G J
@ 2019-02-14 23:28     ` Andrew Jeffery
  2019-02-15  5:33       ` AKASH G J
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Jeffery @ 2019-02-14 23:28 UTC (permalink / raw)
  To: AKASH G J; +Cc: openbmc

On Thu, 14 Feb 2019, at 14:59, AKASH G J wrote:
> I am using the following command to write data to SPI1 flash.
> *pflash -e -a 0 -f -p <filename>*
> 
> On Thu, Feb 14, 2019 at 4:13 AM Andrew Jeffery <andrew@aj.id.au> wrote:
> 
> > On Wed, 13 Feb 2019, at 19:24, AKASH G J wrote:
> > > Hi all,
> > >
> > > We have a test board containing BMC Aspeed AST-2500. It contains BMC
> > flash
> > > memory, SPI1 flash memory and SPI2 flash memory. we are using zaius
> > machine
> > > configuration for building Linux. When I am trying to write to SPI1 flash
> > > at address 30000000 using pflash tool, the modified data is not reflected
> > > after reboot. 

A reboot of what? The host or the BMC? Does this mean that the expected data
is present after the pflash but before the reboot of whichever system you're
talking about here?

What are the versions of the BMC kernel and pflash tool that you're using?

Andrew

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-14 23:28     ` Andrew Jeffery
@ 2019-02-15  5:33       ` AKASH G J
  2019-02-18  2:45         ` Andrew Jeffery
  0 siblings, 1 reply; 12+ messages in thread
From: AKASH G J @ 2019-02-15  5:33 UTC (permalink / raw)
  To: Andrew Jeffery; +Cc: openbmc

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

I just powered off the entire board. After that the data is not present in
the SPI1 flash. But before power-off it was there.

We are using OpenBMC Linux version 4.18.7 and pflash v6.1

On Fri, Feb 15, 2019 at 4:58 AM Andrew Jeffery <andrew@aj.id.au> wrote:

> On Thu, 14 Feb 2019, at 14:59, AKASH G J wrote:
> > I am using the following command to write data to SPI1 flash.
> > *pflash -e -a 0 -f -p <filename>*
> >
> > On Thu, Feb 14, 2019 at 4:13 AM Andrew Jeffery <andrew@aj.id.au> wrote:
> >
> > > On Wed, 13 Feb 2019, at 19:24, AKASH G J wrote:
> > > > Hi all,
> > > >
> > > > We have a test board containing BMC Aspeed AST-2500. It contains BMC
> > > flash
> > > > memory, SPI1 flash memory and SPI2 flash memory. we are using zaius
> > > machine
> > > > configuration for building Linux. When I am trying to write to SPI1
> flash
> > > > at address 30000000 using pflash tool, the modified data is not
> reflected
> > > > after reboot.
>
> A reboot of what? The host or the BMC? Does this mean that the expected
> data
> is present after the pflash but before the reboot of whichever system
> you're
> talking about here?
>
> What are the versions of the BMC kernel and pflash tool that you're using?
>
> Andrew
>

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

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-15  5:33       ` AKASH G J
@ 2019-02-18  2:45         ` Andrew Jeffery
  2019-02-18  4:33           ` AKASH G J
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Jeffery @ 2019-02-18  2:45 UTC (permalink / raw)
  To: AKASH G J; +Cc: openbmc



On Fri, 15 Feb 2019, at 16:03, AKASH G J wrote:
> I just powered off the entire board. After that the data is not present in
> the SPI1 flash. But before power-off it was there.

How were you verifying the data was there before the poweroff?

> 
> We are using OpenBMC Linux version 4.18.7 and pflash v6.1

Thanks for the versions. Should be handy as we dig deeper.

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-18  2:45         ` Andrew Jeffery
@ 2019-02-18  4:33           ` AKASH G J
  2019-02-19  0:03             ` Andrew Jeffery
  0 siblings, 1 reply; 12+ messages in thread
From: AKASH G J @ 2019-02-18  4:33 UTC (permalink / raw)
  To: Andrew Jeffery; +Cc: openbmc

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

I wrote a bootable version of OpenBMC Linux image in system SPI flash.

I tried to boot it before power-off, it was successfully booted. Then I
tried to boot the same, that time it was unsuccessful.

Do I need to make any change in the Linux device tree for resolving this
issue?

On Mon, Feb 18, 2019 at 8:15 AM Andrew Jeffery <andrew@aj.id.au> wrote:

>
>
> On Fri, 15 Feb 2019, at 16:03, AKASH G J wrote:
> > I just powered off the entire board. After that the data is not present
> in
> > the SPI1 flash. But before power-off it was there.
>
> How were you verifying the data was there before the poweroff?
>
> >
> > We are using OpenBMC Linux version 4.18.7 and pflash v6.1
>
> Thanks for the versions. Should be handy as we dig deeper.
>

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

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-18  4:33           ` AKASH G J
@ 2019-02-19  0:03             ` Andrew Jeffery
  2019-02-19  4:22               ` AKASH G J
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Jeffery @ 2019-02-19  0:03 UTC (permalink / raw)
  To: AKASH G J; +Cc: openbmc



On Mon, 18 Feb 2019, at 15:04, AKASH G J wrote:
> I wrote a bootable version of OpenBMC Linux image in system SPI flash. 
> 
> I tried to boot it before power-off, it was successfully booted. Then I 
> tried to boot the same, that time it was unsuccessful.

But you just said you flashed an OpenBMC image to the system flash. 
That's never going to work. You need the host firmware on the host
flash to successfully boot the host, and OpenBMC is not the host
firmware.

Am I understanding you correctly?

> 
> Do I need to make any change in the Linux device tree for resolving this issue?
> 
> On Mon, Feb 18, 2019 at 8:15 AM Andrew Jeffery <andrew@aj.id.au> wrote:
> > 
> >  
> >  On Fri, 15 Feb 2019, at 16:03, AKASH G J wrote:
> >  > I just powered off the entire board. After that the data is not present in
> >  > the SPI1 flash. But before power-off it was there.
> >  
> >  How were you verifying the data was there before the poweroff?
> >  
> >  > 
> >  > We are using OpenBMC Linux version 4.18.7 and pflash v6.1
> >  
> >  Thanks for the versions. Should be handy as we dig deeper.
> >  
>

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-19  0:03             ` Andrew Jeffery
@ 2019-02-19  4:22               ` AKASH G J
  2019-02-19 23:22                 ` Andrew Jeffery
  0 siblings, 1 reply; 12+ messages in thread
From: AKASH G J @ 2019-02-19  4:22 UTC (permalink / raw)
  To: Andrew Jeffery; +Cc: openbmc

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

I flashed OpenBMC image to system flash using pflash. After power-off, I
tried to boot the BMC (Aspeed AST-2500) from the system flash. For that I
used the command *bootm <system flash address>* in u-boot prompt. That
gives error "no image found".

On Tue, Feb 19, 2019 at 5:33 AM Andrew Jeffery <andrew@aj.id.au> wrote:

>
>
> On Mon, 18 Feb 2019, at 15:04, AKASH G J wrote:
> > I wrote a bootable version of OpenBMC Linux image in system SPI flash.
> >
> > I tried to boot it before power-off, it was successfully booted. Then I
> > tried to boot the same, that time it was unsuccessful.
>
> But you just said you flashed an OpenBMC image to the system flash.
> That's never going to work. You need the host firmware on the host
> flash to successfully boot the host, and OpenBMC is not the host
> firmware.
>
> Am I understanding you correctly?
>
> >
> > Do I need to make any change in the Linux device tree for resolving this
> issue?
> >
> > On Mon, Feb 18, 2019 at 8:15 AM Andrew Jeffery <andrew@aj.id.au> wrote:
> > >
> > >
> > >  On Fri, 15 Feb 2019, at 16:03, AKASH G J wrote:
> > >  > I just powered off the entire board. After that the data is not
> present in
> > >  > the SPI1 flash. But before power-off it was there.
> > >
> > >  How were you verifying the data was there before the poweroff?
> > >
> > >  >
> > >  > We are using OpenBMC Linux version 4.18.7 and pflash v6.1
> > >
> > >  Thanks for the versions. Should be handy as we dig deeper.
> > >
> >
>

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

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-19  4:22               ` AKASH G J
@ 2019-02-19 23:22                 ` Andrew Jeffery
  2019-02-20  4:31                   ` AKASH G J
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Jeffery @ 2019-02-19 23:22 UTC (permalink / raw)
  To: AKASH G J; +Cc: openbmc

On Tue, 19 Feb 2019, at 14:53, AKASH G J wrote:
> I flashed OpenBMC image to system flash using pflash. After power-off, 
> I tried to boot the BMC (Aspeed AST-2500) from the system flash. For 
> that I used the command *bootm <system flash address>* in u-boot 
> prompt. That gives error "no image found".

Akash, I can't help you any further if you do not give me the exact commands
you are using to flash the system and verify your claims. For instance, there's
no reason to abstract `<system flash address>` here and it's value is actually
crucial to understanding what you are trying to do.

Please, literally copy and paste the output of your console into your response.
Please do not edit it, do not type it out by hand, do not invent or abstract the
commands that you're executing. Without that I'm going to leave it for
someone else to help.

That said, bootm expects a kernel image in memory, not the address of the
system flash. As far as I'm aware, if you're providing anything other than the
kernel address it won't work. If you want to just start executing instructions
at some random address, the `go` command is what you need:

```
root@witherspoon:~# reboot -ff
Rebooting.[42291.288011] reboot: Restarting system



U-Boot 2016.07 (Feb 19 2019 - 10:48:12 +0000)

       Watchdog enabled
DRAM:  496 MiB
Flash: 32 MiB
In:    serial
Out:   serial
Err:   serial
Net:   aspeednic#0
Hit any key to stop autoboot:  0
ast#
ast# help go
go - start application at address 'addr'

Usage:
go addr [arg ...]
    - start application at address 'addr'
      passing 'arg' as arguments
ast# go 0
## Starting application at 0x00000000 ...


U-Boot 2016.07 (Feb 19 2019 - 10:48:12 +0000)

       Watchdog enabled
DRAM:  496 MiB
Flash: 32 MiB
In:    serial
Out:   serial
Err:   serial
Net:   aspeednic#0
Hit any key to stop autoboot:  0
ast#
```


Andrew

> 
> On Tue, Feb 19, 2019 at 5:33 AM Andrew Jeffery <andrew@aj.id.au> wrote:
> > 
> >  
> >  On Mon, 18 Feb 2019, at 15:04, AKASH G J wrote:
> >  > I wrote a bootable version of OpenBMC Linux image in system SPI flash. 
> >  > 
> >  > I tried to boot it before power-off, it was successfully booted. Then I 
> >  > tried to boot the same, that time it was unsuccessful.
> >  
> >  But you just said you flashed an OpenBMC image to the system flash. 
> >  That's never going to work. You need the host firmware on the host
> >  flash to successfully boot the host, and OpenBMC is not the host
> >  firmware.
> >  
> >  Am I understanding you correctly?
> >  
> >  > 
> >  > Do I need to make any change in the Linux device tree for resolving this issue?
> >  > 
> >  > On Mon, Feb 18, 2019 at 8:15 AM Andrew Jeffery <andrew@aj.id.au> wrote:
> >  > > 
> >  > > 
> >  > > On Fri, 15 Feb 2019, at 16:03, AKASH G J wrote:
> >  > > > I just powered off the entire board. After that the data is not present in
> >  > > > the SPI1 flash. But before power-off it was there.
> >  > > 
> >  > > How were you verifying the data was there before the poweroff?
> >  > > 
> >  > > > 
> >  > > > We are using OpenBMC Linux version 4.18.7 and pflash v6.1
> >  > > 
> >  > > Thanks for the versions. Should be handy as we dig deeper.
> >  > > 
> >  >
> >  
>

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-19 23:22                 ` Andrew Jeffery
@ 2019-02-20  4:31                   ` AKASH G J
  2019-02-21  0:31                     ` Andrew Jeffery
  0 siblings, 1 reply; 12+ messages in thread
From: AKASH G J @ 2019-02-20  4:31 UTC (permalink / raw)
  To: Andrew Jeffery; +Cc: openbmc

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

Andrew, Sorry for the inconvenience.

For flashing the kernel image, I used the command

$
*pflash -e -a 0 -f -p fitImage.bin*

and for flashing root file system

*$ pflash -e -a 8388608 -f -p obmc.rootfs.cpio.lzma.u-boot*

After power-off I used the command* bootm 0x30000000 0x30800000 *in u-boot
prompt.

On Wed, Feb 20, 2019 at 4:52 AM Andrew Jeffery <andrew@aj.id.au> wrote:

> On Tue, 19 Feb 2019, at 14:53, AKASH G J wrote:
> > I flashed OpenBMC image to system flash using pflash. After power-off,
> > I tried to boot the BMC (Aspeed AST-2500) from the system flash. For
> > that I used the command *bootm <system flash address>* in u-boot
> > prompt. That gives error "no image found".
>
> Akash, I can't help you any further if you do not give me the exact
> commands
> you are using to flash the system and verify your claims. For instance,
> there's
> no reason to abstract `<system flash address>` here and it's value is
> actually
> crucial to understanding what you are trying to do.
>
> Please, literally copy and paste the output of your console into your
> response.
> Please do not edit it, do not type it out by hand, do not invent or
> abstract the
> commands that you're executing. Without that I'm going to leave it for
> someone else to help.
>
> That said, bootm expects a kernel image in memory, not the address of the
> system flash. As far as I'm aware, if you're providing anything other than
> the
> kernel address it won't work. If you want to just start executing
> instructions
> at some random address, the `go` command is what you need:
>
> ```
> root@witherspoon:~# reboot -ff
> Rebooting.[42291.288011] reboot: Restarting system
>
>
>
> U-Boot 2016.07 (Feb 19 2019 - 10:48:12 +0000)
>
>        Watchdog enabled
> DRAM:  496 MiB
> Flash: 32 MiB
> In:    serial
> Out:   serial
> Err:   serial
> Net:   aspeednic#0
> Hit any key to stop autoboot:  0
> ast#
> ast# help go
> go - start application at address 'addr'
>
> Usage:
> go addr [arg ...]
>     - start application at address 'addr'
>       passing 'arg' as arguments
> ast# go 0
> ## Starting application at 0x00000000 ...
>
>
> U-Boot 2016.07 (Feb 19 2019 - 10:48:12 +0000)
>
>        Watchdog enabled
> DRAM:  496 MiB
> Flash: 32 MiB
> In:    serial
> Out:   serial
> Err:   serial
> Net:   aspeednic#0
> Hit any key to stop autoboot:  0
> ast#
> ```
>
>
> Andrew
>
> >
> > On Tue, Feb 19, 2019 at 5:33 AM Andrew Jeffery <andrew@aj.id.au> wrote:
> > >
> > >
> > >  On Mon, 18 Feb 2019, at 15:04, AKASH G J wrote:
> > >  > I wrote a bootable version of OpenBMC Linux image in system SPI
> flash.
> > >  >
> > >  > I tried to boot it before power-off, it was successfully booted.
> Then I
> > >  > tried to boot the same, that time it was unsuccessful.
> > >
> > >  But you just said you flashed an OpenBMC image to the system flash.
> > >  That's never going to work. You need the host firmware on the host
> > >  flash to successfully boot the host, and OpenBMC is not the host
> > >  firmware.
> > >
> > >  Am I understanding you correctly?
> > >
> > >  >
> > >  > Do I need to make any change in the Linux device tree for resolving
> this issue?
> > >  >
> > >  > On Mon, Feb 18, 2019 at 8:15 AM Andrew Jeffery <andrew@aj.id.au>
> wrote:
> > >  > >
> > >  > >
> > >  > > On Fri, 15 Feb 2019, at 16:03, AKASH G J wrote:
> > >  > > > I just powered off the entire board. After that the data is not
> present in
> > >  > > > the SPI1 flash. But before power-off it was there.
> > >  > >
> > >  > > How were you verifying the data was there before the poweroff?
> > >  > >
> > >  > > >
> > >  > > > We are using OpenBMC Linux version 4.18.7 and pflash v6.1
> > >  > >
> > >  > > Thanks for the versions. Should be handy as we dig deeper.
> > >  > >
> > >  >
> > >
> >
>

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

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

* Re: Unable to read or write from system SPI flash memory.
  2019-02-20  4:31                   ` AKASH G J
@ 2019-02-21  0:31                     ` Andrew Jeffery
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Jeffery @ 2019-02-21  0:31 UTC (permalink / raw)
  To: AKASH G J; +Cc: openbmc

Hi Akash,

There's a bit to unpack here.

On Wed, 20 Feb 2019, at 15:02, AKASH G J wrote:
> Andrew, Sorry for the inconvenience.
> 
> For flashing the kernel image, I used the command
> 
> $ *pflash -e -a 0 -f -p fitImage.bin
> *
> *
> *
> and for flashing root file system
> *
> *
> *$ *pflash -e -a *8388608* -f -p obmc.rootfs.cpio.lzma.u-boot**
> **
> **
> ** **After power-off I used the command** *bootm 0x30000000 0x30800000* 
> **in u-boot prompt.
> 

What is the error output of the command? Can you copy/paste it?

Also, can you paste the output of `md.l 0x30000000` and the output of
`hexdump -C fitImage.bin | head` ? 

But I have to ask, *why* are you flashing OpenBMC artifacts to memory on SPI1?

I don't know if this helps, but here's a description of the ASPEEDAST2500 flash
architecture:

1. The BMC has 3 flash controllers attached to the AHB:
  a. 0x1e620000 - "Firmware SPI Memory Controller" (FMC): BMC firmware controller
  b. 0x1e630000 - "SPI Flash Controller 1" (SPI1): Host firmware controller 1
  c. 0x1e631000 - "SPI Flash Controller 2" (SPI2): Host firmware controller 2

2. Each of the three flash controllers has multiple chip-select lines
  a. FMC: Up to 3 chip select lines
  b. SPI1: Up to 2 chip select lines
  c. SPI2: Up to 2 chip select lines

3. The AHB has a memory mapping for the chips of each flash controller, with each
region being subdivided to cater to the chip selects. These sub-ranges are
configurable in each flash controller. The controller mappings and their default
sub-ranges are:

  a. 0x00000000 - 0x0fffffff: FMC
  b. 0x20000000 - 0x2fffffff: FMC
    1. 0x20000000 - 0x27ffffff: CS0
    2. 0x28000000 - 0x29ffffff: CS1
    3. 0x2a000000 - 0x2bffffff: CS2
  c. 0x30000000 - 0x37ffffff: SPI1
    1. 0x30000000 - 0x31ffffff: CS0
    2. 0x32000000 - 0x37ffffff: CS1
  d. 0x38000000 - 0x3fffffff: SPI2
    1. 0x38000000 - 0x39ffffff: CS0
    2. 0x3a000000 - 0x3fffffff: CS1

So there are a couple of answers that I can think of to my question about
why you might be flashing OpenBMC artefacts to a chip behind SPI1:

1. You just want to test a new build without disturbing the BMC flash image
2. You want BMC flash redundancy

For 1, there are many ways you can go about testing images without
trying to do something awkward like flash the artefacts to a chip behind
SPI1:

a. Use QEMU: https://github.com/openbmc/docs/blob/master/cheatsheet.md#using-qemu
  1. We have a fork at https://github.com/openbmc/qemu
  2. Most of the patches are upstream, so you can just e.g.
     `sudo apt install qemu-system-arm` on Debian based systems
b. If you're wanting to test kernel changes on hardware, then I recommend
     setting yourself up so you can netboot kernels on the BMC
c. If you're wanting to test userspace changes, then you can just
    drop the binary into an already running userspace

For 2, you need to be populating CS1 of the FMC; this has the benefit
(perhaps?) of the AST2500's auto-failover mechanism where if the
hardware gets a watchdog event on boot it automagically flips CS0 and
CS1 on the FMC (along with the memory mappings) so you fall-back to
booting from the second chip.

Hope that helps?

Andrew

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

end of thread, other threads:[~2019-02-21  0:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-13  8:54 Unable to read or write from system SPI flash memory AKASH G J
2019-02-13 22:43 ` Andrew Jeffery
2019-02-14  4:29   ` AKASH G J
2019-02-14 23:28     ` Andrew Jeffery
2019-02-15  5:33       ` AKASH G J
2019-02-18  2:45         ` Andrew Jeffery
2019-02-18  4:33           ` AKASH G J
2019-02-19  0:03             ` Andrew Jeffery
2019-02-19  4:22               ` AKASH G J
2019-02-19 23:22                 ` Andrew Jeffery
2019-02-20  4:31                   ` AKASH G J
2019-02-21  0:31                     ` Andrew Jeffery

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.