u-boot-brain/drivers/mtd
Siarhei Siamashka 19e99fb4ff sunxi: Support booting from SPI flash
Allwinner devices support SPI flash as one of the possible
bootable media type. The SPI flash chip needs to be connected
to SPI0 pins (port C) to make this work. More information is
available at:

    https://linux-sunxi.org/Bootable_SPI_flash

This patch adds the initial support for booting from SPI flash.
The existing SPI frameworks are not used in order to reduce the
SPL code size. Right now the SPL size grows by ~370 bytes when
CONFIG_SPL_SPI_SUNXI option is enabled.

While there are no popular Allwinner devices with SPI flash at
the moment, testing can be done using a SPI flash module (it
can be bought for ~2$ on ebay) and jumper wires with the boards,
which expose relevant pins on the expansion header. The SPI flash
chips themselves are very cheap (some prices are even listed as
low as 4 cents) and should not cost much if somebody decides to
design a development board with an SPI flash chip soldered on
the PCB.

Another nice feature of the SPI flash is that it can be safely
accessed in a device-independent way (since we know that the
boot ROM is already probing these pins during the boot time).
And if, for example, Olimex boards opted to use SPI flash instead
of EEPROM, then they would have been able to have U-Boot installed
in the SPI flash now and boot the rest of the system from the SATA
hard drive. Hopefully we may see new interesting Allwinner based
development boards in the future, now that the software support
for the SPI flash is in a better shape :-)

Testing can be done by enabling the CONFIG_SPL_SPI_SUNXI option
in a board defconfig, then building U-Boot and finally flashing
the resulting u-boot-sunxi-with-spl.bin binary over USB OTG with
a help of the sunxi-fel tool:

   sunxi-fel spiflash-write 0 u-boot-sunxi-with-spl.bin

The device needs to be switched into FEL (USB recovery) mode first.
The most suitable boards for testing are Orange Pi PC and Pine64.
Because these boards are cheap, have no built-in NAND/eMMC and
expose SPI0 pins on the Raspberry Pi compatible expansion header.
The A13-OLinuXino-Micro board also can be used.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-07-15 08:34:34 +02:00
..
nand mtd: nand: Drop a blank line in nand_wait() 2016-06-24 17:23:14 -04:00
onenand mtd, ubi, ubifs: resync with Linux-3.14 2014-08-25 19:25:55 -04:00
spi sunxi: Support booting from SPI flash 2016-07-15 08:34:34 +02:00
ubi mtd, ubi: set free_count to zero before walking through erase list 2016-04-22 11:47:37 +02:00
altera_qspi.c altera_qspi: allow ctrl-c to abort the erase ops 2015-12-28 09:32:43 +08:00
at45.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cfi_flash.c mtd: cfi: Unlock current sector instead of sector 0 before buffered write 2016-04-13 13:43:37 +02:00
cfi_mtd.c mtd, cfi, ubi: add missing writebufsize initialization 2014-11-19 07:54:04 +01:00
dataflash.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
ftsmc020.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
jedec_flash.c mtd: Handle 29LV800BT 2014-11-19 08:48:41 +01:00
Kconfig drivers: mtd: add Microchip PIC32 internal non-CFI flash driver. 2016-05-21 01:25:50 +02:00
Makefile drivers: mtd: add Microchip PIC32 internal non-CFI flash driver. 2016-05-21 01:25:50 +02:00
mtd_uboot.c mtd: uboot: Add meaningful error message 2015-11-12 13:17:28 -05:00
mtd-uclass.c dm: implement a MTD uclass 2015-11-12 08:26:58 +08:00
mtdconcat.c kbuild: force to define __UBOOT__ in all the C sources 2014-09-16 12:23:56 -04:00
mtdcore.c compat: Remove is_power_of_2() definition 2015-11-05 16:46:59 -05:00
mtdcore.h mtd, ubi, ubifs: resync with Linux-3.14 2014-08-25 19:25:55 -04:00
mtdpart.c mtd: Introduce mtd_block_isreserved() 2015-08-25 22:53:57 -05:00
mw_eeprom.c Update i386 code (sc520_cdp) 2008-09-09 11:48:53 +02:00
pic32_flash.c drivers: mtd: add Microchip PIC32 internal non-CFI flash driver. 2016-05-21 01:25:50 +02:00
st_smi.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
stm32_flash.c stm32: stm32_flash: add memory barrier during flash write 2016-04-11 20:48:23 -04:00
stm32_flash.h stm32: stm32f4: move flash driver to mtd driver location 2016-03-26 18:49:28 -04:00