Unable to read or write from system SPI flash memory.

Andrew Jeffery andrew at aj.id.au
Thu Feb 14 09:43:23 AEDT 2019


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 at 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 at 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 at 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


More information about the openbmc mailing list