<div dir="ltr"><div dir="ltr"><div>I am using the following command to write data to SPI1 flash.</div></div><div dir="ltr"><i>pflash -e -a 0 -f -p <filename></i><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 14, 2019 at 4:13 AM Andrew Jeffery <<a href="mailto:andrew@aj.id.au">andrew@aj.id.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 13 Feb 2019, at 19:24, AKASH G J wrote:<br>
> Hi all,<br>
> <br>
> We have a test board containing BMC Aspeed AST-2500. It contains BMC flash<br>
> memory, SPI1 flash memory and SPI2 flash memory. we are using zaius machine<br>
> configuration for building Linux. When I am trying to write to SPI1 flash<br>
> at address 30000000 using pflash tool, the modified data is not reflected<br>
> after reboot. Same with SPI2 flash. With pflash tool I am able to write<br>
> data permanently to BMC flash memory. The device tree for SPI devices is<br>
> following.<br>
> <br>
> &fmc {<br>
> status = "okay";<br>
> <br>
> flash@0 {<br>
> status = "okay";<br>
> label = "bmc";<br>
> m25p,fast-read;<br>
> spi-max-frequency = <50000000>;<br>
> #include "openbmc-flash-layout.dtsi"<br>
> };<br>
> };<br>
> <br>
> &spi1 {<br>
> status = "okay";<br>
> pinctrl-names = "default";<br>
> pinctrl-0 = <&pinctrl_spi1_default>;<br>
> <br>
> flash@0 {<br>
> status = "okay";<br>
> label = "pnor";<br>
> m25p,fast-read;<br>
> spi-max-frequency = <100000000>;<br>
> };<br>
> };<br>
> <br>
> &spi2 {<br>
> status = "okay";<br>
> pinctrl-names = "default";<br>
> pinctrl-0 = <&pinctrl_spi2ck_default<br>
> &pinctrl_spi2cs0_default<br>
> &pinctrl_spi2cs1_default<br>
> &pinctrl_spi2miso_default<br>
> &pinctrl_spi2mosi_default>;<br>
> <br>
> flash@0 {<br>
> status = "okay";<br>
> };<br>
> };<br>
<br>
How are you invoking pflash? You should not be using the /dev/mem backend<br>
when you have the flash controller and devices enabled via the devicetree. You<br>
should be using the mtd backend instead.<br>
<br>
Andrew<br>
</blockquote></div>