u-boot-brain/common
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
..
eeprom cmd: eeprom: add support for layout aware commands 2016-05-20 17:02:07 -04:00
init bootstage: call show_boot_progress also in SPL 2016-06-09 13:53:08 -04:00
spl sunxi: Support booting from SPI flash 2016-07-15 08:34:34 +02:00
autoboot.c autoboot: move bootdelay >= 0 check to abortboot() 2016-07-01 17:42:56 -04:00
bedbug.c Consolidate bool type 2013-04-01 16:33:52 -04:00
board_f.c board_f: Don't require CONFIG_SYS_MONITOR_BASE 2016-05-27 15:39:51 -04:00
board_info.c generic-board: allow showing custom board info 2015-08-13 07:19:36 -04:00
board_r.c dm: scsi: Rename CONFIG_CMD_SCSI to CONFIG_SCSI 2016-05-17 09:54:43 -06:00
bootm_os.c cosmetic: debug: Replace #ifdef DEBUG with debug() macro 2016-05-27 15:39:48 -04:00
bootm.c bootm: Align cache flush end address correctly 2016-06-12 23:49:38 +02:00
bootretry.c Rename bootretry functions and remove #ifdefs 2014-05-29 17:49:00 -04:00
bootstage.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
bouncebuf.c Fix a few printf argument verification warnings 2014-09-15 13:32:55 -04:00
cli_hush.c hush: Add rudimentary support for PS1 and PS2 2016-02-08 10:10:37 -05:00
cli_readline.c spl, common, serial: build SPL without serial support 2015-08-12 20:47:13 -04:00
cli_simple.c common: cli_simple: use strlcpy instead of strcpy 2016-01-13 21:05:26 -05:00
cli.c hush: complete renaming CONFIG_SYS_HUSH_PARSER to CONFIG_HUSH_PARSER 2016-06-24 17:24:34 -04:00
command.c Drop command-processing code when CONFIG_CMDLINE is disabled 2016-04-01 17:17:40 -04:00
console.c debug_uart: Remove duplicated carriage return handling 2016-03-27 09:12:26 -04:00
cros_ec.c cros_ec: Remove unused cros_ec_board_init() function 2015-04-18 11:11:16 -06:00
ddr_spd.c Add more SPDX-License-Identifier tags 2016-01-19 08:31:21 -05:00
dlmalloc.c malloc: improve memalign fragmentation fix 2016-05-23 11:50:17 -04:00
dlmalloc.src Consolidate bool type 2013-04-01 16:33:52 -04:00
edid.c edid: Add a function to read detailed monitor timings 2015-05-13 09:24:10 -07:00
env_attr.c env: Add regex support to env_attrs 2015-05-21 09:13:19 -04:00
env_callback.c common: env: initialize scalar variable 2016-01-04 12:25:35 -05:00
env_common.c env: Setup GD_FLG_ENV_DEFAULT flag when default environment are used 2016-06-06 11:23:27 +02:00
env_dataflash.c env: Add env_export() wrapper 2014-03-21 16:43:59 -04:00
env_eeprom.c env_eeprom invalidates gd->env_addr by setting it to an offset value 2016-04-11 12:44:37 -04:00
env_embedded.c nand_spl: remove nand_spl infrastructure 2014-06-05 17:01:59 -04:00
env_ext4.c common: Fix support for environment file in EXT4 2016-06-24 17:24:35 -04:00
env_fat.c dm: block: Rename device number member dev to devnum 2016-03-14 15:34:50 -06:00
env_flags.c tools: fix env_flags build 2016-02-15 20:58:25 +00:00
env_flash.c env_flash.c: Drop unused variables 2014-04-17 17:44:36 -04:00
env_mmc.c dm: env: mmc: Convert env_mmc to support CONFIG_BLK 2016-05-27 10:23:08 -06:00
env_nand.c nand: Embed mtd_info in struct nand_chip 2016-06-03 20:27:48 -05:00
env_nowhere.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
env_nvram.c env: Add env_export() wrapper 2014-03-21 16:43:59 -04:00
env_onenand.c env: Add env_export() wrapper 2014-03-21 16:43:59 -04:00
env_remote.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
env_sata.c common: env: support sata device 2016-04-18 12:29:14 -04:00
env_sf.c dm: spi: Read default speed and mode values from DT 2016-07-09 20:16:34 +05:30
env_ubi.c common: env_ubi: Clear environment buffer before reading 2016-06-13 06:41:20 +02:00
exports.c board/ls2085rdb: Export functions for standalone AQ FW load apps 2015-07-20 11:44:37 -07:00
fb_mmc.c common: block: fix compiler error with CONFIG_FASTBOOT_FLASH_MMC_DEV 2016-07-11 14:06:44 -06:00
fb_nand.c fastboot: sparse: implement reserve() 2016-06-27 16:37:39 -04:00
fdt_support.c fdt: Document the rest of struct of_bus 2016-05-25 23:13:38 +02:00
flash.c mpc8xx: remove SPD823TS board support 2015-01-05 12:08:51 -05:00
hash.c hash.c: Conditionally compile hash_command, static hash_show 2016-01-13 21:05:08 -05:00
hwconfig.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
ide.c dm: ide: Add support for driver-model block devices 2016-05-17 09:54:43 -06:00
image-android.c common: image: minimal android image iminfo support 2016-06-24 17:23:07 -04:00
image-fdt.c efi_loader: Call fdt preparation functions 2016-03-15 21:30:14 -04:00
image-fit.c common: image-fit: Cleanup spelling mistakes 2016-06-17 09:50:59 -04:00
image-sig.c image: Convert to use fdt_for_each_subnode macro 2015-02-16 12:41:41 -05:00
image-sparse.c fastboot: sparse: improve CHUNK_TYPE_FILL write performance 2016-06-27 16:37:39 -04:00
image.c image: Add boot_get_fpga() to load fpga with bootm 2016-05-24 13:17:59 +02:00
iomux.c Move console definitions into a new console.h file 2015-11-19 20:27:50 -07:00
iotrace.c common: Make sure arch-specific map_sysmem() is defined 2015-04-18 11:11:09 -06:00
kallsyms.c Add support for Linux-like kallsysms 2009-06-12 20:45:48 +02:00
Kconfig autoboot: remove CONFIG_ZERO_BOOTDELAY_CHECK 2016-07-01 17:42:55 -04:00
kgdb_stubs.c Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
kgdb.c Fix spelling of "occurred". 2016-05-02 18:37:09 -04:00
lcd_console_rotation.c common/lcd_console: introduce display/framebuffer rotation 2015-04-18 17:40:37 +02:00
lcd_console.c common/lcd_console: introduce display/framebuffer rotation 2015-04-18 17:40:37 +02:00
lcd_simplefb.c common/lcd_simplefb: Add support for 32bit organized framebuffers 2015-07-23 18:10:58 +02:00
lcd.c lcd: Fix compile warning in 64bit mode 2016-03-27 09:12:17 -04:00
lynxkdi.c checkpatch whitespace cleanups 2011-10-22 01:13:35 +02:00
main.c Drop use of CONFIG_SYS_GENERIC_BOARD in U-Boot 2016-05-27 15:39:54 -04:00
Makefile hush: complete renaming CONFIG_SYS_HUSH_PARSER to CONFIG_HUSH_PARSER 2016-06-24 17:24:34 -04:00
malloc_simple.c malloc_simple: Add a little more debugging 2016-03-17 10:27:23 +08:00
memsize.c Revert "common/memsize.c: Simplify RAM size detection" 2016-02-10 08:34:42 -05:00
menu.c Fix typo choosen in comments and printf logs 2016-03-27 09:12:23 -04:00
miiphyutil.c common: miiphyutil: avoid memory leak 2015-12-05 18:22:24 -05:00
s_record.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
sata.c dm: sata: Add support for driver-model block devices 2016-05-17 09:54:43 -06:00
scsi.c dm: scsi: if_typename should be scsi 2016-06-06 13:39:12 -04:00
splash_source.c splash_source: add support for ubifs formatted nand 2016-06-14 05:33:02 +02:00
splash.c lcd: split splash code into its own function 2015-02-10 13:31:58 +01:00
stdio.c stdio: Correct a build error with driver model 2016-01-21 20:42:36 -07:00
system_map.c Add support for Linux-like kallsysms 2009-06-12 20:45:48 +02:00
update.c update: tftp: dfu: Extend update_tftp() function to support DFU 2015-09-07 13:41:05 +02:00
usb_hub.c usb: hub: Don't continue on get_port_status failure 2016-05-06 20:06:56 +02:00
usb_kbd.c usb: kbd: Do not deregister usbkbd twice when using dm 2016-04-10 17:18:42 +02:00
usb_storage.c dm: blk: Add a easier way to create a named block device 2016-05-17 09:54:43 -06:00
usb.c usb: move CONFIG_USB_XHCI to Kconfig with renaming 2016-06-04 00:43:53 +02:00
xyzModem.c lib/crc16.c: Rename cyg_crc16() to crc16_ccitt() and add crc start value 2016-03-14 19:18:42 -04:00