summaryrefslogtreecommitdiff
path: root/common/cmd_fpga.c
Commit message (Collapse)AuthorAgeLines
* fpga: Protect GZIP usage when LOADMK is enabledMichal Simek2015-01-21-0/+5
| | | | | | | | | | | For case where CMD_FPGA_LOADMK is enabled and GZIP disable. Warning log: common/built-in.o: In function `do_fpga': /mnt/disk/u-boot/common/cmd_fpga.c:218: undefined reference to `gunzip' Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* bootm: make use of legacy image format configurableHeiko Schocher2014-06-05-0/+2
| | | | | | | | | | | | | | | | | | | | make the use of legacy image format configurable through the config define CONFIG_IMAGE_FORMAT_LEGACY. When relying on signed FIT images with required signature check the legacy image format should be disabled. Therefore introduce this new define and enable legacy image format if CONFIG_FIT_SIGNATURE is not set. If CONFIG_FIT_SIGNATURE is set disable per default the legacy image format. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Lars Steubesand <lars.steubesand@philips.com> Cc: Mike Pearce <mike@kaew.be> Cc: Wolfgang Denk <wd@denx.de> Cc: Tom Rini <trini@ti.com> Cc: Michal Simek <monstr@monstr.eu> Acked-by: Simon Glass <sjg@chromium.org>
* fpga: Added support to load bit stream from SD/MMCSiva Durga Prasad Paladugu2014-05-20-0/+40
| | | | | | | | | | | | Added support to load a bitstream image in chunks by reading it in chunks from SD/MMC. Command format: loadfs [dev] [address] [image size] [blocksize] <interface> [<dev[:part]>] <filename> Example: fpga loadfs 0 1000000 3dbafc 4000 mmc 0 fpga.bin Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* fpga: Add support to load partial bitstreamsMichal Simek2014-05-20-0/+33
| | | | | | | | | | | | | Added support to load partial bitstreams. The partial bitstreams can be loaded using the below commands Commands: fpga loadp <dev> <addr> <size> fpga loadbp <dev> <addr> <size> The full bit streams can be loaded using the old commands(fpga load and fpga loadb). Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* fpga: Define bitstream type based on command selectionMichal Simek2014-05-20-4/+6
| | | | | | | | | | Clean up partial, full and compressed bitstream handling. U-Boot supports full bitstream loading and partial based on detection which is not 100% correct. Extending fpga_load/fpga_loadbitstream() with one more argument which stores bitstream type. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* fpga: Guard the LOADMK functionality with CMD_FPGA_LOADMKSiva Durga Prasad Paladugu2014-05-20-0/+8
| | | | | | | | | Guard the LOADMK functionality with config to provide an option to enable or disable it. Enable it for all platforms in mainline which enable CONFIG_CMD_FPGA. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* fpga: Add support for gzip images with bitstreamsMichal Simek2013-11-06-3/+19
| | | | | | | | | | | | | | | | | | | Here is the set of command which has been performed to proof this feature. gzip < fpga.bin > fpga.bin.gz mkimage -A arm -O u-boot -T firmware -C gzip \ -a 20000000 -n "zc702_fpga_bin" -d fpga.bin.gz fpga.bin.gz.ub tftp 100000 fpga.bin.gz.ub fpga loadmk 0 100000 This flow should speedup loading bitstream data from external memory and save image footprint in non volatile memory. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-18/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* Merge branch 'u-boot/master' into 'u-boot-arm/master'Albert ARIBAUD2013-05-30-2/+2
|\ | | | | | | | | | | Conflicts: common/cmd_fpga.c drivers/usb/host/ohci-at91.c
| * image: Rename fit_image_check_hashes() to fit_image_verify()Simon Glass2013-05-14-1/+1
| | | | | | | | | | | | | | | | | | This is the main entry point to the FIT image verification code. We will be using it to handle image verification with signatures, so rename the function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* | cmd: fpga: Do not include net.hMichal Simek2013-05-06-3/+0
| | | | | | | | | | | | | | There is no reason to include net.h header in fpga code. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com>
* | cmd: fpga: Move fpga_loadbitstream to fpga.cMichal Simek2013-05-06-94/+0
| | | | | | | | | | | | | | | | | | In bitstream decoding you can directly check device which you want to load and in fpga.c are fpga_validate and fpga_dev_info functions which should be used for it. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com>
* | cmd: fpga: Clean coding styleMichal Simek2013-05-06-106/+107
|/ | | | | | | No functional changes. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com>
* Convert cmd_usage() calls in common to use a return valueSimon Glass2012-03-06-2/+2
| | | | | | | | | Change all files in common/ to use CMD_RET_USAGE instead of calling cmd_usage() directly. I'm not completely sure about this patch since the code since impact is small (100 byte or so on ARM) and it might need splitting into smaller patches. But for now here it is. Signed-off-by: Simon Glass <sjg@chromium.org>
* FPGA: use debug() instead of module debug printfStefano Babic2012-01-05-31/+28
| | | | | | Replace also __FUNCTION__ with standard __func__ Signed-off-by: Stefano Babic <sbabic@denx.de>
* fpga: constify to fix build warningWolfgang Denk2011-08-01-1/+1
| | | | | | | | | | | | | | | Fix compiler warning: cmd_fpga.c:318: warning: passing argument 3 of 'fit_image_get_data' from incompatible pointer type Adding the needed 'const' here entails a whole bunch of additonal changes all over the FPGA code. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Andre Schwarz <andre.schwarz@matrix-vision.de> Cc: Murray Jensen <Murray.Jensen@csiro.au> Acked-by: Andre Schwarz<andre.schwarz@matrix-vision.de>
* cmd_fpga: cleanup help and check parametersStefano Babic2010-10-19-11/+39
| | | | | | | | The usage and help for the fpga command is wrong and incomplete, and the parameters are not checked before to be passed to the underlying subfunction. Signed-off-by: Stefano Babic <sbabic@denx.de>
* cmd_usage(): simplify return code handlingWolfgang Denk2010-07-24-10/+2
| | | | | | | | | | | | | | | | Lots of code use this construct: cmd_usage(cmdtp); return 1; Change cmd_usage() let it return 1 - then we can replace all these ocurrances by return cmd_usage(cmdtp); This fixes a few places with incorrect return code handling, too. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-04-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hush shell dynamically allocates (and re-allocates) memory for the argument strings in the "char *argv[]" argument vector passed to commands. Any code that modifies these pointers will cause serious corruption of the malloc data structures and crash U-Boot, so make sure the compiler can check that no such modifications are being done by changing the code into "char * const argv[]". This modification is the result of debugging a strange crash caused after adding a new command, which used the following argument processing code which has been working perfectly fine in all Unix systems since version 6 - but not so in U-Boot: int main (int argc, char **argv) { while (--argc > 0 && **++argv == '-') { /* ====> */ while (*++*argv) { switch (**argv) { case 'd': debug++; break; ... default: usage (); } } } ... } The line marked "====>" will corrupt the malloc data structures and usually cause U-Boot to crash when the next command gets executed by the shell. With the modification, the compiler will prevent this with an error: increment of read-only location '*argv' N.B.: The code above can be trivially rewritten like this: while (--argc > 0 && **++argv == '-') { char *arg = *argv; while (*++arg) { switch (*arg) { ... Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* General help message cleanupWolfgang Denk2009-06-12-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of the help messages were not really helpful; for example, many commands that take no arguments would not print a correct synopsis line, but "No additional help available." which is not exactly wrong, but not helpful either. Commit ``Make "usage" messages more helpful.'' changed this partially. But it also became clear that lots of "Usage" and "Help" messages (fields "usage" and "help" in struct cmd_tbl_s respective) were actually redundant. This patch cleans this up - for example: Before: => help dtt dtt - Digital Thermometer and Thermostat Usage: dtt - Read temperature from digital thermometer and thermostat. After: => help dtt dtt - Read temperature from Digital Thermometer and Thermostat Usage: dtt Signed-off-by: Wolfgang Denk <wd@denx.de>
* Command usage cleanupPeter Tyser2009-01-28-1/+1
| | | | | | | | Remove command name from all command "usage" fields and update common/command.c to display "name - usage" instead of just "usage". Also remove newlines from command usage fields. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Standardize command usage messages with cmd_usage()Peter Tyser2009-01-28-1/+1
| | | | Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Code cleanup: fix old style assignment ambiguities like "=-" etc.Wolfgang Denk2008-07-14-4/+4
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* [new uImage] Add new uImage fromat support to fpga commandMarian Balakowicz2008-03-12-9/+76
| | | | Signed-off-by: Marian Balakowicz <m8@semihalf.com>
* [new uImage] Update naming convention for bootm/uImage related codeMarian Balakowicz2008-02-29-1/+1
| | | | | | | | | | | | | | | This patch introduces the following prefix convention for the image format handling and bootm related code: genimg_ - dual format shared code image_ - legacy uImage format specific code fit_ - new uImage format specific code boot_ - booting process related code Related routines are renamed and a few pieces of code are moved around and re-grouped. Signed-off-by: Marian Balakowicz <m8@semihalf.com>
* [new uImage] Add dual format uImage support frameworkMarian Balakowicz2008-02-25-12/+24
| | | | | | | | | | | | | | This patch adds framework for dual format images. Format detection is added and the bootm controll flow is updated to include cases for new FIT format uImages. When the legacy (image_header based) format is detected appropriate legacy specific handling is invoked. For the new (FIT based) format uImages dual boot framework has a minial support, that will only print out a corresponding debug messages. Implementation of the FIT specific handling will be added in following patches. Signed-off-by: Marian Balakowicz <m8@semihalf.com>
* [new uImage] Define a API for image handling operationsMarian Balakowicz2008-02-07-4/+4
| | | | | | | | | - Add inline helper macros for basic header processing - Move common non inline code common/image.c - Replace direct header access with the API routines - Rename IH_CPU_* to IH_ARCH_* Signed-off-by: Marian Balakowicz <m8@semihalf.com>
* Remove bit swapping in Xilinx Spartan bitfile loadingMatthias Fuchs2008-01-09-36/+1
| | | | | | | This patch removes the unnecessary bit swapping when booting .bit files with the 'fpga loadb' command. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
* Improve configuration of FPGA subsystemMatthias Fuchs2008-01-09-1/+1
| | | | | | | | | | | | | This patch removes the FPGA subsystem configuration through the CONFIG_FPGA bitmask configuration option. See README for the new options: CONFIG_FPGA, CONFIG_FPGA_<vendor>, CONFIG_FPGA_<family> Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
* [BUILD] conditionally compile common/cmd_*.c in common/MakefileGrant Likely2007-11-20-3/+0
| | | | | | | Modify common/Makefile to conditionally compile the cmd_*.c files based on the board config. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* Fpga: fix incorrect test of CFG_FPGA_XILINX macroGrant Likely2007-09-26-1/+1
| | | | | | | | CFG_FPGA_XILINX is a bit value used to test against the value in CONFIG_FPGA. Testing for a value will always return TRUE. I don't think that is the intention in this code. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* common/cmd_[af]*: Remove obsolete references to CONFIG_COMMANDS.Jon Loeliger2007-07-08-3/+3
| | | | Signed-off-by: Jon Loeliger <jdl@freescale.com>
* common/cmd_[a-f]* : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger2007-07-04-2/+2
| | | | | | | | | | | | | | This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <jdl@freescale.com>
* Remove compile warnings in fpga codeStefan Roese2006-10-07-2/+2
| | | | Patch by Stefan Roese, 07 Oct 2006
* Add FPGA Altera Cyclone 2 supportStefan Roese2006-08-15-0/+21
| | | | Patch by Heiko Schocher, 15 Aug 2006
* Cleanup for GCC-4.xWolfgang Denk2005-10-13-1/+1
|
* Add configuration for IFM AEV FIFO board.Wolfgang Denk2005-08-10-4/+4
| | | | Minor coding style cleanup.
* Fix sign extension bug in 'fpga loadb' command;Wolfgang Denk2005-08-08-41/+56
| | | | | make 'fpga loadb' always print the file header info Patch by Andrew Dyer, 11 Jan 2005
* Code cleanup.wdenk2005-01-22-18/+18
|
* Patch by Florian Schlote, 08 Sep 2004:wdenk2005-01-09-11/+11
| | | | Add support for SenTec-COBRA5272-board (Coldfire).
* * Patch by Gleb Natapov, 07 Sep 2004:wdenk2005-01-09-0/+121
| | | | | | | | mpc824x: set PCI latency timer to a sane value (is 0 after reset). * Patch by Kurt Stremerch, 03 Sep 2004: Add bitstream configuration option for fpga command (Xilinx only).
* * Patch by Robert Schwebel, 15 Dec 2003:wdenk2004-01-03-1/+1
| | | | add support for cramfs (uses JFFS2 command interface)
* * Cleanup lowboot code for MPC5200wdenk2004-01-02-81/+81
| | | | | | | | | | | | | | | | | | * Minor code cleanup (coding style) * Patch by Reinhard Meyer, 30 Dec 2003: - cpu/mpc5xxx/fec.c: added CONFIG_PHY_ADDR, added CONFIG_PHY_TYPE, - added CONFIG_PHY_ADDR to include/configs/IceCube.h, - turned debug print of PHY registers into a function (called in two places) - added support for EMK MPC5200 based modules * Fix MPC8xx PLPRCR_MFD_SHIFT typo * Add support for TQM866M modules * Fixes for TQM855M with 4 MB flash (Am29DL163 = _no_ mirror bit flash) * Fix a few compiler warnings
* * Patch by Pierre Aubert, 24 Nov 2003:wdenk2003-12-07-4/+5
| | | | | | | - add a return value for the fpga command - add ide_preinit() function called in ide_init if CONFIG_IDE_PREINIT is defined. If ide_preinit fails, ide_init is aborted. - fix an endianess problem in fat.h
* Patch by Kenneth Johansson, 30 Jun 2003:wdenk2003-07-01-2/+2
| | | | get rid of MK_CMD_ENTRY macro; update doc/README.command
* Fix some missing commands, cleanup header fileswdenk2003-06-29-1/+0
| | | | (autoscript, bmp, bsp, fat, mmc, nand, portio, ...)
* * Code cleanup:wdenk2003-06-27-2/+11
| | | | | | | | | - remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
* Initial revisionwdenk2002-08-27-0/+158