summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* dm: usb: Avoid time delays in sandbox testsSimon Glass2015-11-191-1/+9
| | | | | | | Currently the USB tests take around two seconds to run. Remove these unnecessary time delays so that the tests run quickly. Signed-off-by: Simon Glass <sjg@chromium.org>
* common/board_f.c: move mark_bootstage after arch_cpu_init_dmThomas Chou2015-11-191-1/+1
| | | | | | | | | As mark_bootstage() uses timer, it should go after driver model is initialized. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: stdio: Plumb in the new keyboard uclassSimon Glass2015-11-191-1/+30
| | | | | | | | | | | When driver model is used for keyboards we must scan the available keyboards and register them with stdio. Add code to do this. At some point (once LCD/video is converted) we should be able to convert stdio to driver model and avoid these dual data structures. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: input: Create a keyboard uclassSimon Glass2015-11-191-6/+0
| | | | | | | | | Add a uclass for keyboard input, mirroring the existing stdio methods. This is enabled by a new CONFIG_DM_KEYBOARD option. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: usb: Add support for USB keyboards with driver modelSimon Glass2015-11-192-8/+56
| | | | | | | | Switch USB keyboards over to use driver model instead of scanning with the horrible usb_get_dev_index() function. This involves creating a new uclass for keyboards, although so far there is no API. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'zynq' of git://www.denx.de/git/u-boot-microblazeTom Rini2015-11-192-0/+6
|\
| * common: mii: Do not allow to exceed max phy limitMichal Simek2015-11-191-0/+5
| | | | | | | | | | | | | | | | Phy can have addresses 0-31. Check this boundary to ensure that user can't call commands on phy address 32 and more. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * tools: zynqimage: Add Xilinx Zynq boot header generation to mkimageNathan Rossi2015-11-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As with other platforms vendors love to create their own boot header formats. Xilinx is no different and for the Zynq platform/SoC there exists the "boot.bin" which is read by the platforms bootrom. This format is described to a useful extent within the Xilinx Zynq TRM. This implementation adds support for the 'zynqimage' to mkimage. The implementation only considers the most common boot header which is un-encrypted and packed directly after the boot header itself (no XIP, etc.). However this implementation does take into consideration the other fields of the header for image dumping use cases (vector table and register initialization). Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* | env_ubi.c: Correct pointer error in env loadKevin Smith2015-11-191-2/+1
|/ | | | | | | | | | | | | | The variable "buf" in this function is a char array, and the function ubi_volume_read is expecting a char *. In the call, the address of the pointer is being taken, incorrectly passing a char **. The compiler warning was being silenced by the cast. Remove the address operator and the cast. Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Tom Rini <trini@konsulko.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Heiko Schocher <hs@denx.de>
* itest: add missing break statements to evalexp()Stephen Warren2015-11-181-3/+9
| | | | | | | | | | The commit mentioned below replaced return statements inside a switch so that other code could be called after the switch. However, it didn't add any break statements, causing the cases to run together. Fix this. Reported-by: Coverity (CID 132282, 132283) Fixes: 7861204c9af7 ("itest: make memory access work under sandbox") Signed-off-by: Stephen Warren <swarren@nvidia.com>
* common: add CMD_GPIO to KconfigThomas Chou2015-11-181-0/+6
| | | | | | | Add CMD_GPIO to Kconfig and run tools/moveconfig.py . Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Simon Glass <sjg@chromium.org>
* spl: mmc: add support for BOOT_DEVICE_MMC2Nikita Kiryanov2015-11-182-9/+34
| | | | | | | | | | | Currently the mmc device that SPL looks at is always mmc0, regardless of the BOOT_DEVICE_MMCx value. This forces some boards to implement hacks in order to boot from other mmc devices. Make SPL take into account the correct mmc device. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: announce boot devicesNikita Kiryanov2015-11-181-0/+79
| | | | | | | | | | | | | Now that we support alternative boot devices, it can sometimes be unclear which boot devices was actually used. Provide a function to announce which boot devices are attempted during boot. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* spl: add support for alternative boot deviceNikita Kiryanov2015-11-181-4/+29
| | | | | | | | | | | | | | Introduce spl_boot_list array, which defines a list of boot devices that SPL will try before hanging. By default this list will consist of only spl_boot_device(), but board_boot_order() can be overridden by board code to populate the array with custom values. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* common: spl: move image load to its own functionNikita Kiryanov2015-11-181-67/+50
| | | | | | | | | | | | | Refactor spl image load code out of board_init_r and into its own function. This is a preparation for supporting alternative boot devices. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: change return values of spl_*_load_image()Nikita Kiryanov2015-11-189-48/+91
| | | | | | | | | | | | | | | | | | | | | | | Make spl_*_load_image() functions return a value instead of hanging if a problem is encountered. This enables main spl code to make the decision whether to hang or not, thus preparing it to support alternative boot devices. Some boot devices (namely nand and spi) do not hang on error. Instead, they return normally and SPL proceeds to boot the contents of the load address. This is considered a bug and is rectified by hanging on error for these devices as well. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Ian Campbell <ijc@hellion.org.uk> Cc: Hans De Goede <hdegoede@redhat.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Jagan Teki <jteki@openedev.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* spl: mmc: get rid of emmc boot code duplicationNikita Kiryanov2015-11-181-36/+18
| | | | | | | | | | | | | | | | | Get rid of emmc boot code duplication in spl_mmc_load_image() using a switch case fallthrough into MMCSD_MODE_RAW. Since the #ifdef CONFIG_SUPPORT_EMMC_BOOT check is not really necessary, remove it in the process. No functional changes. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Paul Kocialkowski <contact@paulk.fr> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: mmc: move fs boot into its own functionNikita Kiryanov2015-11-181-30/+51
| | | | | | | | | | | | | | | | Move the code that handles fs boot out of spl_mmc_load_image() and into its own function to reduce the #ifdef complexity of spl_mmc_load_image(). No functional changes. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Paul Kocialkowski <contact@paulk.fr> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: mmc: get rid of #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION checkNikita Kiryanov2015-11-181-4/+9
| | | | | | | | | | | | | | | | | | Implement defaults for the raw partition image loading so that the #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION in spl_mmc_load_image() will no longer be necessary. This change makes it possible for mmc_load_image_raw_partition() and mmc_load_image_raw_sector() to coexist. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Paul Kocialkowski <contact@paulk.fr> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: mmc: remove #ifdef CONFIG_SPL_OS_BOOT checkNikita Kiryanov2015-11-183-8/+21
| | | | | | | | | | | | | | | | | | | Implement default versions of falcon mode functions to make the CONFIG_SPL_OS_BOOT check in spl_mmc_load_image() unnecessary, thus reducing its #ifdef complexity. No functional changes. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Paul Kocialkowski <contact@paulk.fr> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Guillaume GARDET <guillaume.gardet@free.fr> Cc: Suriyan Ramasami <suriyan.r@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: mmc: refactor device location code to its own functionNikita Kiryanov2015-11-181-22/+55
| | | | | | | | | | | | | | | | | | | Simplify spl_mmc_load_image() code by moving the part that finds the mmc device into its own function spl_mmc_find_device(), available in two flavors: DM and non-DM. This refactor fixes a bug in which an error in the device location sequence does not necessarily aborts the rest of the code. With this refactor, we fail the moment there is an error. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Paul Kocialkowski <contact@paulk.fr> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: mmc: add break statements in spl_mmc_load_image()Nikita Kiryanov2015-11-181-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original intention of the mmc load_image() function was to try multiple boot modes before failing. This is evident by the lack of break statements in the switch, and the following line in the default case: puts("spl: mmc: no boot mode left to try\n"); This implementation is problematic because: - The availability of alternative boot modes is very arbitrary since it depends on the specific order of the switch cases. If your boot mode happens to be the first case, then you'll have a bunch of other boot modes as alternatives. If it happens to be the last case, then you have none. - Opting in/out is tied to config options, so the only way for you to prevent an alternative boot mode from being attempted is to give up on the feature completely. - This implementation makes the code more complicated and difficult to understand. Address these issues by inserting a break statements between the cases to make the function try only one boot mode. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Paul Kocialkowski <contact@paulk.fr> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: nand: remove code duplicationNikita Kiryanov2015-11-181-15/+16
| | | | | | | | | | | | | | | Remove code duplication in spl_nand_load_image(). No functional changes. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Scott Wood <scottwood@freescale.com> Cc: Igor Grinberg <grinberg@compulab.co.il> Acked-by: Scott Wood <scottwood@freescale.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de> [trini: Add back cast to unsigned long of spl_image.load_addr] Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2015-11-161-10/+115
|\
| * splash_source: add support for filesystem formatted sataNikita Kiryanov2015-11-161-0/+20
| | | | | | | | | | | | | | | | | | Add support for loading splashimage from filesystem formatted sata storage. Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
| * splash_source: add support for filesystem formatted usbNikita Kiryanov2015-11-161-1/+30
| | | | | | | | | | | | | | | | | | Add support for loading splash image from USB drive formatted with a filesystem. Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
| * splash_source: add support for filesystem formatted mmcNikita Kiryanov2015-11-161-1/+57
| | | | | | | | | | | | | | | | | | Add support for loading splash image from an SD card formatted with a filesystem. Update boards to maintain original behavior where needed. Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
| * splash_source: rename *_read() to *_read_raw()Nikita Kiryanov2015-11-161-9/+9
| | | | | | | | | | | | | | | | | | | | Rename raw read functions to *_read_raw() in preparation for supporting read_fs() feature. Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
* | Merge branch 'series1_v2' of git://git.denx.de/u-boot-sparcTom Rini2015-11-133-124/+470
|\ \
| * | sparc: leon3: Moved GRLIB core header files to common include/grlib directoryDaniel Hellstrom2015-11-131-2/+19
| | | | | | | | | | | | Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
| * | sparc: Kconfig: Move the CMD_AMBAPP command to KconfigFrancois Retief2015-11-132-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an initr function in the board_r.c file for the AMBA Plug&Play command. Add a Kconfig entry for the ambapp command and remove all CONFIG_CMD_AMBAPP defines from the board configuration headers. Add a Kconfig entry to display the AMBA Plug&Play information on startup. This option is off by default. Remove relevent define from board configuration headers. Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>
| * | sparc: leon3: Reimplemented AMBA Plug&Play scanning routines.Daniel Hellstrom2015-11-131-124/+418
| | | | | | | | | | | | Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
* | | x86: Move timer_init() call a bit earlierBin Meng2015-11-132-3/+2
|/ / | | | | | | | | | | | | | | | | | | Currently timer_init() is called in board_r.c which is quite late. Some vgabios execution requires we set up the i8254 timer correctly, but video initialization comes before timer_init(). Move the call to board_f.c. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* | board_init: Change the logic to setup malloc_baseFabio Estevam2015-11-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to commit 5ba534d247d418 ("arm: Switch 32-bit ARM to using generic global_data setup") we used to have assembly code that configured the malloc_base address. Since this commit we use the board_init_f_mem() function in C to setup malloc_base address. In board_init_f_mem() there was a deliberate choice to support only early malloc() or full malloc() in SPL, but not both. Adapt this logic to allow both to be used, one after the other, in SPL. This issue has been observed in a Congatec board, where we need to retrieve the manufacturing information from the SPI NOR (the SPI API calls malloc) prior to configuring the DRAM. In this case as malloc_base was not configured we always see malloc to fail. With this change we are able to use malloc in SPL prior to DRAM gets initialized. Also update the CONFIG_SYS_SPL_MALLOC_START entry in the README file. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | common: Simplify get_clocks() #ifdefPeng Fan2015-11-121-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_clocks is wrapped by CONFIG_FSL_CLK and CONFIG_M68K in seperate piece code. They can be merged into one snippet. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Cc: "angelo@sysam.it" <angelo@sysam.it> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: "Andreas Bießmann" <andreas.devel@googlemail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Angelo Dureghello <angelo@sysam.it>
* | mmc: Use lldiv() for 64-bit division in write_raw_image()Siarhei Siamashka2015-11-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes compilation problems when using a hardfloat toolchain on ARM, which manifest themselves as "libgcc.a(_udivmoddi4.o) uses VFP register arguments, u-boot does not". These problems have been reported in the U-Boot mailing list: http://lists.denx.de/pipermail/u-boot/2015-October/230314.html http://lists.denx.de/pipermail/u-boot/2015-October/231908.html Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | gpt: add optional parameter type in gpt commandPatrick Delaunay2015-11-121-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | code under flag CONFIG_PARTITION_TYPE_GUID add parameter "type" to select partition type guid example of use with gpt command : partitions = uuid_disk=${uuid_gpt_disk}; \ name=boot,size=0x6bc00,uuid=${uuid_gpt_boot}; \ name=root,size=0x7538ba00,uuid=${uuid_gpt_root}, \ type=0fc63daf-8483-4772-8e79-3d69d8477de4; gpt write mmc 0 $partitions Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
* | sparse: Rename the file and headerMaxime Ripard2015-11-124-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The Android sparse image format is currently supported through a file called aboot, which isn't really such a great name, since the sparse image format is only used for transferring data with fastboot. Rename the file and header to a file called "sparse", which also makes it consistent with the header defining the image structures. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | fastboot: nand: Add pre erase and write hooksMaxime Ripard2015-11-121-0/+18
| | | | | | | | | | | | | | | | | | | | | | Some devices might need to do some per-partition initialization (ECC/Randomizer settings change for example) before actually accessing it. Add some hooks before the write and erase operations to let the boards define what they need to do if needed. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | fastboot: Implement NAND backendMaxime Ripard2015-11-122-1/+201
| | | | | | | | | | | | | | | | | | So far the fastboot code was only supporting MMC-backed devices for its flashing operations (flash and erase). Add a storage backend for NAND-backed devices. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* | sparse: Implement several chunks flashingMaxime Ripard2015-11-121-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fastboot client will split the sparse images into several chunks if the image that it tries to flash is bigger than what the device can handle. In such a case, the bootloader is supposed to retain the last offset to which it wrote to, so that it can resume the writes at the right offset when flashing the next chunk. Retain the last offset we used, and use the session ID to know if we need it or not. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | fastboot: Implement flashing session counterMaxime Ripard2015-11-122-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fastboot flash command that writes an image to a partition works in several steps: 1 - Retrieve the maximum size the device can download through the "max-download-size" variable 2 - Retrieve the partition type through the "partition-type:%s" variable, that indicates whether or not the partition needs to be erased (even though the fastboot client has minimal support for that) 3a - If the image is smaller than what the device can handle, send the image and flash it. 3b - If the image is larger than what the device can handle, create a sparse image, and split it in several chunks that would fit. Send the chunk, flash it, repeat until we have no more data to send. However, in the 3b case, the subsequent transfers have no particular identifiers, the protocol just assumes that you would resume the writes where you left it. While doing so works well, it also means that flashing two subsequent images on the same partition (for example because the user made a mistake) would not work withouth flashing another partition or rebooting the board, which is not really intuitive. Since we have always the same pattern, we can however maintain a counter that will be reset every time the client will retrieve max-download-size, and incremented after each buffer will be flashed, that will allow us to tell whether we should simply resume the flashing where we were, or start back at the beginning of the partition. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | sparse: Implement storage abstractionMaxime Ripard2015-11-122-31/+91
| | | | | | | | | | | | | | | | | | | | | | The current sparse image parser relies heavily on the MMC layer, and doesn't allow any other kind of storage medium to be used. Rework the parser to support any kind of storage medium, as long as there is an implementation for it. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | fastboot: Move fastboot response functions to fastboot coreMaxime Ripard2015-11-122-45/+32
| | | | | | | | | | | | | | | | | | | | The functions and a few define to generate a fastboot message to be sent back to the host were so far duplicated among the users. Move them all to a common place. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | sparse: Simplify multiple logicMaxime Ripard2015-11-121-4/+10
| | | | | | | | | | | | | | | | | | To check the alignment of the image blocks to the storage blocks, the current code uses a convoluted syntax, while a simple mod also does the work. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | sparse: Refactor chunk parsing functionMaxime Ripard2015-11-121-133/+239
| | | | | | | | | | | | | | | | | | | | | | | | The chunk parsing code was duplicating a lot of code among the various chunk types, while all of them could be covered by generic and simple functions. Refactor the current code to reuse as much code as possible and hopefully make the chunk parsing loop more readable and concise. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | sparse: Move main header parsing to a function of its ownMaxime Ripard2015-11-121-21/+24
|/ | | | | | | | | | | The current sparse image format parser is quite tangled, with a lot of code duplication. Start refactoring it by moving the header parsing function to a function of its own. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* Merge branch 'master' of git://git.denx.de/u-boot-niosTom Rini2015-11-062-4/+9
|\
| * nios2: use common sequence for reserve_ubootThomas Chou2015-11-061-2/+2
| | | | | | | | | | | | | | Use common sequence for reserve_uboot, as the result is the same. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
| * nios2: use dram bank in board infoThomas Chou2015-11-061-2/+7
| | | | | | | | | | | | | | | | Use dram bank in board info, so that it displays correct memory values in bdinfo command. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
OpenPOWER on IntegriCloud