summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Add cli_ prefix to readline functionsSimon Glass2014-05-2910-30/+32
| | | | | | This makes it clear where the code resides. Signed-off-by: Simon Glass <sjg@chromium.org>
* Split out simple parser and readline into separate filesSimon Glass2014-05-294-1013/+1021
| | | | | | | It doesn't make sense to have the simple parser and the readline code all in main. Split them out into separate files. Signed-off-by: Simon Glass <sjg@chromium.org>
* move CLI prototypes to cli.h and add commentsSimon Glass2014-05-299-0/+9
| | | | | | | Move the CLI prototypes from common.h to cli.h as part of an effort to reduce the size of common.h. Signed-off-by: Simon Glass <sjg@chromium.org>
* Rename hush to cli_hushSimon Glass2014-05-293-4/+4
| | | | | | Hush is a command-line interpreter, so rename it to make that clearer. Signed-off-by: Simon Glass <sjg@chromium.org>
* Remove unnecessary use of hush header fileSimon Glass2014-05-292-5/+0
| | | | | | | Some files include hush.h but don't actually use it. Remove this where possible. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: rename device struct to udeviceHeiko Schocher2014-05-272-4/+4
| | | | | | | | | | | | using UBI and DM together leads in compiler error, as both define a "struct device", so rename "struct device" in include/dm/device.h to "struct udevice", as we use linux code (MTD/UBI/UBIFS some USB code,...) and cannot change the linux "struct device" Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de>
* Merge branch 'master' of git://git.denx.de/u-boot-mmcTom Rini2014-05-236-334/+540
|\
| * cmd_mmc: use new mmc_select_hwpart() functionStephen Warren2014-05-231-15/+6
| | | | | | | | | | | | | | | | | | | | The implementation of mmc_select_hwpart() was cribbed from do_mmcops(). Update do_mmcops() to call mmc_select_hwpart() to avoid duplication. <panto> Manual patch update due to patch order. Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
| * cmd_part: fix typo in part command help textStephen Warren2014-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | All the sub-commands start with the main command name, but it was missing from one of the help texts. <panto> typos fix. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Tom Rini <trini@ti.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
| * eMMC: cmd_mmc.c adds the 'rpmb' sub-command for the 'mmc' commandPierre Aubert2014-05-231-296/+510
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This sub-command adds support for the RPMB partition of an eMMC: * mmc rpmb key <address of the authentication key> Programs the authentication key in the eMMC This key can not be overwritten. * mmc rpmb read <address> <block> <#count> [address of key] Reads <#count> blocks of 256 bytes in the RPMB partition beginning at block number <block>. If the optionnal address of the authentication key is provided, the Message Authentication Code (MAC) is verified on each block. * mmc rpmb write <address> <block> <#count> <address of key> Writes <#count> blocks of 256 bytes in the RPMB partition beginning at block number <block>. The datas are signed with the key provided. * mmc rpmb counter Returns the 'Write counter' of the RPMB partition. The sub-command is conditional on compilation flag CONFIG_SUPPORT_EMMC_RPMB Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Pierre Aubert <p.aubert@staubli.com> CC: Wolfgang Denk <wd@denx.de>
| * Add the function 'confirm_yesno' for interactivePierre Aubert2014-05-234-36/+37
| | | | | | | | | | | | | | | | User's confirmation is asked in different commands. This commit adds a function for such confirmation. Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Pierre Aubert <p.aubert@staubli.com>
* | Merge branch 'fpga' of git://www.denx.de/git/u-boot-microblazeTom Rini2014-05-221-4/+87
|\ \
| * | fpga: Added support to load bit stream from SD/MMCSiva Durga Prasad Paladugu2014-05-201-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-201-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-201-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-201-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>
* | Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2014-05-221-1/+1
|\ \
| * \ Merge remote-tracking branch 'u-boot/master'Albert ARIBAUD2014-05-207-47/+44
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | Conflicts: boards.cfg Conflicts were trivial once u-boot-arm/master boards.cfg was reformatted (commit 6130c146) to match u-boot/master's own reformatting (commit 1b37fa83).
| * | Merge branch 'master' of git://git.denx.de/u-boot-armStefano Babic2014-05-1529-287/+649
| |\ \
| * | | nand: remove CONFIG_SYS_NAND_PAGE_SIZETim Harvey2014-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only need to read in the size of struct image_header and thus don't need to know the page size of the nand device. Cc: Scott Wood <scottwood@freescale.com> Signed-off-by: Tim Harvey <tharvey@gateworks.com> Acked-by: Stefano Babic <sbabic@denx.de> Acked-by: Scott Wood <scottwood@freescale.com>
* | | | Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2014-05-226-18/+239
|\ \ \ \ | |_|_|/ |/| | |
| * | | usb/gadget: add the fastboot gadgetSebastian Siewior2014-05-082-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains an implementation of the fastboot protocol on the device side and documentation. This is based on USB download gadget infrastructure. The fastboot function implements the getvar, reboot, download and reboot commands. What is missing is the flash handling i.e. writting the image to media. v3 (Rob Herring): This is based on http://patchwork.ozlabs.org/patch/126798/ with the following changes: - Rebase to current mainline and updates for current gadget API - Use SPDX identifiers for licenses - Traced the history and added missing copyright to cmd_fastboot.c - Use load_addr/load_size for transfer buffer - Allow vendor strings to be optional - Set vendor/product ID from config defines - Allow Ctrl-C to exit fastboot mode v4: - Major re-write to use the USB download gadget. Consolidated function code to a single file. - Moved globals into single struct. - Use puts and putc as appropriate. - Added CONFIG_USB_FASTBOOT_BUF_ADDR and CONFIG_USB_FASTBOOT_BUF_SIZE to set the fastboot transfer buffer. v5: - Add CONFIG option documentation to README - Rebase using new downloader registration Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Rob Herring <robh@kernel.org>
| * | | image: add support for Android's boot image formatSebastian Siewior2014-05-084-6/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the Android boot-image format. The header file is from the Android project and got slightly alterted so the struct + its defines are not generic but have something like a namespace. The header file is from bootloader/legacy/include/boot/bootimg.h. The header parsing has been written from scratch and I looked at bootloader/legacy/usbloader/usbloader.c for some details. The image contains the physical address (load address) of the kernel and ramdisk. This address is considered only for the kernel image. The "second image" defined in the image header is currently not supported. I haven't found anything that is creating this. v3 (Rob Herring): This is based on http://patchwork.ozlabs.org/patch/126797/ with the following changes: - Rebased to current mainline - Moved android image handling to separate functions in common/image-android.c - s/u8/char/ in header to fix string function warnings - Use SPDX identifiers for licenses - Cleaned-up file source information: android_image.h is from file include/boot/bootimg.h in repository: https://android.googlesource.com/platform/bootable/bootloader/legacy The git commit hash is 4205b865141ff2e255fe1d3bd16de18e217ef06a usbloader.c would be from the same commit, but it does not appear to have been used for any actual code. v4: - s/andriod/android/ - Use a separate flag ep_found to track if the entry point has been set rather than using a magic value. Cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Tom Rini <trini@ti.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
| * | | ums: allow the user to specify the device typeStephen Warren2014-05-081-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow an optional devtype parameter to the ums command, which specifies the type of the device to be exported. This could allow exporting a SATA or even another USB device. Cc: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
| * | | ums: move all variable declarations to the start of the blockStephen Warren2014-05-081-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's easier to assign values to the variables inside an if statement body if the assignment and declaration are separate. Cc: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
| * | | ums: use get_device() not find_mmc_device();Stephen Warren2014-05-081-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_device() is a generic routine that will support any type of block device. Use this instead of the type-specific find_mmc_device(), for future flexibility. Cc: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
| * | | ums: move IO support code to common locationStephen Warren2014-05-081-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's nothing Samsung-/board-specfic about the implementation of ums_init(). Move the code into cmd_usb_mass_storage.c, so that it can be shared by any user of that command. Cc: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
| * | | usb: ums: add error handling for failed registrationStephen Warren2014-05-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this, if g_dnl_register() fails, the UMS code continues on blindly and crashes. This fix makes it simply print an error message instead. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | | | common/board_f: Fix size variableYork Sun2014-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DRAM size should use 64-bit variable when the size could be more than 4GB. Caught and verified on P4080DS with 4GB DDR. Signed-off-by: York Sun <yorksun@freescale.com> Acked-by: Simon Glass <sjg@chromium.org>
* | | | common/board_f: Initialized global data for generic boardYork Sun2014-05-121-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some platforms (tested on mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). The data should not be cleared later. Any arch which uses global data in generic board board_init_f() should define CONFIG_SYS_GENERIC_GLOBAL_DATA. Signed-off-by: York Sun <yorksun@freescale.com> CC: Scott Wood <scottwood@freescale.com> CC: Simon Glass <sjg@chromium.org> CC: Albert ARIBAUD <albert.u.boot@aribaud.net> Acked-by: Simon Glass <sjg@chromium.org>
* | | | cmd_bootm.c: Only say XIP image when load is image_startTom Rini2014-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We say we have an XIP (in this case, image loaded at desired execution address) when the image header has been offset in the load. It's possible that in some cases executing the header is non-fatal but that's not true in many other cases. Signed-off-by: Tom Rini <trini@ti.com>
* | | | hush shell: Avoid string write overflow when entering max cmd lengthKristian Otnes2014-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | console_buffer array is defined to be CONFIG_SYS_CBSIZE + 1 long, whereas the_command array only CONFIG_SYS_CBSIZE long. Subsequent use of strcpy(the_command, console_buffer) will write final \0 terminating byte outside the_command array when entering a command of max length. Signed-off-by: Kristian Otnes <kotnes <at> cisco <dot> com>
* | | | cmd_time: do not show ticksMasahiro Yamada2014-05-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The command "time" shows the execution time of the command given to the argument, like this: time: 45.293 seconds, 45293 ticks Since we adopted CONFIG_SYS_HZ = 1000 for all boards, we always have a simple formula: "1 tick = 0.0001 second". Showing ticks looks almost redundant. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | | | bd_info: remove bi_barudrate member from struct bd_infoMasahiro Yamada2014-05-122-23/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gd->bd->bi_baudrate is a copy of gd->baudrate. Since baudrate is a common feature for all architectures, keep gd->baudrate only. It is true that bi_baudrate was passed to the kernel in that structure but it was a long time ago. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Tom Rini <trini@ti.com> Cc: Simon Glass <sjg@chromium.org> Cc: Wolfgang Denk <wd@denx.de> Cc: Heiko Schocher <hs@denx.de> Acked-by: Michal Simek <monstr@monstr.eu> (For microblaze)
* | | | Merge branch 'tom' of git://git.denx.de/u-boot-x86Tom Rini2014-05-092-14/+19
|\ \ \ \ | |_|_|/ |/| | |
| * | | Make 'run' use run_command_list() instead of run_command()Simon Glass2014-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case where an environment variable spans multiple lines, we should use run_command_list() so that all lines are executed. This shold be backwards compatible with existing behaviour for existing scripts. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: Support 'env import' and 'env export'Simon Glass2014-05-091-13/+18
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Adjust the code for these commands so that they work on sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> (Adjusted to fix minor merge comflict, when applied) Change-Id: I987dee6194cd5c83f82604caf894fc85e4eb71a8
* | | Merge branch 'u-boot/master'Albert ARIBAUD2014-05-0929-287/+649
|\ \ \ | |/ / | | / | |/ |/| | | | | Conflicts: drivers/net/Makefile (trivial merge)
| * USB: gadget: added a saner gadget downloader registration APIMateusz Zalega2014-05-053-5/+3
| | | | | | | | | | | | | | | | | | | | Preprocessor definitions and hardcoded implementation selection in g_dnl core were replaced by a linker list made of (usb_function_name, bind_callback) pairs. Signed-off-by: Mateusz Zalega <m.zalega@samsung.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Acked-by: Marek Vasut <marex@denx.de>
| * usb: dfu: fix boards wo USB cable detectionMateusz Zalega2014-05-051-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Former usb_cable_connected() patch broke compilation of boards which do not support this feature. I've renamed usb_cable_connected() to g_dnl_usb_cable_connected() and added its default implementation to gadget downloader driver code. There's only one driver of this kind and it's unlikely there'll be another, so there's no point in keeping it in /common. Previously this function was declared in usb.h. I've moved it, since it's more appropriate to keep it in g_dnl.h - usb.h seems to be intended for USB host implementation. Existing code, confronted with default -EOPNOTSUPP return value, continues as if the cable was connected. CONFIG_USB_CABLE_CHECK was removed. Change-Id: Ib9198621adee2811b391c64512f14646cefd0369 Signed-off-by: Mateusz Zalega <m.zalega@samsung.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
| * usb: Fix USB keyboard polling via control endpointAdrian Cox2014-04-301-11/+25
| | | | | | | | | | | | | | | | | | | | USB keyboard polling failed for some keyboards on PowerPC 5020. This was caused by requesting only 4 bytes of data from keyboards that produce an 8 byte HID report. Signed-off-by: Adrian Cox <adrian@humboldt.co.uk> Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Marek Vasut <marex@denx.de>
| * Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxTom Rini2014-04-252-7/+170
| |\
| | * driver/ddr/fsl: Add DDR4 support to Freescale DDR driverYork Sun2014-04-221-1/+44
| | | | | | | | | | | | | | | | | | | | | Mostly reusing DDR3 driver, this patch adds DDR4 SPD handling, register calculation and programming. Signed-off-by: York Sun <yorksun@freescale.com>
| | * fdt_support: Add helper function to read "ranges" propertyAlexander Graf2014-04-221-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a helper function that can be used to interpret most "ranges" properties in the device tree. It reads the n'th range out of a "ranges" array and returns the node's virtual address of the range, the physical address that range starts at and the size of the range. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Scott Wood <scottwood@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
| | * fdt_support: split fdt_getprop_u32_defaultAlexander Graf2014-04-221-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already have a nice helper to give us a property cell value with default fall back from a path. Split that into two helpers - one for the old path based lookup and one to give us a value based on a node offset. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Scott Wood <scottwood@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
| * | board_f: call timer_init on MIPSPaul Burton2014-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | MIPS needs a call to timer_init to preserve its current behaviour ensuring that the cop0 compare register is initialised appropriately. Reported-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * | board_f: call init_func_ram on MIPSPaul Burton2014-04-201-2/+2
| |/ | | | | | | | | | | | | | | Assigning gd->ram_size the return value of initdram matches the existing MIPS board behaviour. Suggested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * bootm: set max decompression size for LZOKees Cook2014-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | The LZO decompressor wasn't initializing the maximum output size, which meant it would fail to decompress most of the time. Reported-by: Matthias Weißer <weisserm@arcor.de> Signed-off-by: Kees Cook <keescook@chromium.org> Tested-by: Matthias Weißer <weisserm@arcor.de> Acked-by: Simon Glass <sjg@chromium.org>
| * board_r: return 0 from show_model_rPaul Burton2014-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The show_model_r function should return an int but didn't. Return 0 to indicate inevitable success and avoid the following if it is used: common/board_r.c: In function 'show_model_r': common/board_r.c:531:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Paul Burton <paul.burton@imgtec.com> Acked-by: Simon Glass <sjg@chromium.org>
| * blackfin: make name_to_gpio be a weak symbolIan Campbell2014-04-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This required moving it into a C file from the header. The only user of a non-default name_to_gpio is blackfin, therefore build tested with the blackfin bct-brettl2 build, which is one I picked at random. Also tested with a build for the ARM tec board which uses the default/fallback implementation. Inspection with objdump shows that both have done the right thing. This change was requested by Marek during review of the sunxi patch series. Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Cc: Marek Vasut <marex@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Sonic Zhang <sonic.adi@gmail.com>
OpenPOWER on IntegriCloud