Boot using SPI-NOR device

Sascha Hauer s.hauer at pengutronix.de
Wed Jul 8 05:32:00 PDT 2015


On Wed, Jul 08, 2015 at 08:31:02AM +0200, joacim.zetterling at westermo.se wrote:
>    Hi
> 
>    I have some problem booting a linux from a spi-nor device (Spansion,
>    s25fl512s). There is no trouble booting up barebox from the first
>    partition.
>    When I debugged our system (ARM based) I find out that when we probe the
>    file system, we get -22 as a result code from a memmap(s->fd, PROT_READ)
>    function call.
>    With further investigations I see that memmap is set to 0 with no ops is
>    defined, witch probably means that I do not have any memory mapped spi.
> 
>    I add my partitions like this
>     addpart -n /dev/s25fl512s
>    2048k(barebox),24M(primary),24M(reserved),2048k(config),4096k(barebox-environment)
> 
>    And my dts section for the spi looks like this
>     ...
>     ...
>     spi: spi at 10600 {
>       spi-flash at 0 {
>          #address-cells = <1>;
>          #size-cells = <1>;
>          compatible = "s25fl512s", "nor-jedec";
>          spi-max-frequency = <20000000>;
>          reg = <0>; /* Chip select 0 */
>      };
>    };
>    ...
>    ...
> 
>    I also have all the configurations for spi, mtd and env in place.
>    And I have no issues reading/writing/erasing the spi flash.
> 
>    My simple question is. How do I enable memory mapped spi-nor support in
>    barebox?

That's not possible because spi-nor is never memory mapped. The good
news is that you won't need this. What exactly are you doing to get the
memmap error? Are you trying to use the 'go' command to start something
from spi-nor? Use bootm instead.

Regards,
 Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list