summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeLines
* floppy: delete unused filesMasahiro Yamada2014-04-17-124/+0
| | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* Merge branch 'next'Tom Rini2014-04-17-129/+429
|\
| * env: Implement support for encrypting environmentMarek Vasut2014-03-21-0/+62
| | | | | | | | | | | | | | | | | | Add function which allows encrypting the whole environment block with AES-128-CBC. The key for the environment is retrieved by env_aes_cbc_get_key() function, which must be implemented on a per-board basis. Signed-off-by: Marek Vasut <marex@denx.de>
| * env: Add env_export() wrapperMarek Vasut2014-03-21-117/+63
| | | | | | | | | | | | | | | | Implement env_export() wrapper, so that all implementers of saveenv() don't have to call hexport_r(), crc32() etc. sequence . This trims down a bit of code duplication. Signed-off-by: Marek Vasut <marex@denx.de>
| * aes: Add 'aes' command to access AES-128-CBCMarek Vasut2014-03-21-0/+90
| | | | | | | | | | | | | | Add simple 'aes' command, which allows using the AES-128-CBC encryption and decryption functions from U-Boot command line. Signed-off-by: Marek Vasut <marex@denx.de>
| * tools, fit_check_sign: verify a signed fit imageHeiko Schocher2014-03-21-8/+10
| | | | | | | | | | | | | | | | add host tool "fit_check_sign" which verifies, if a fit image is signed correct. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org>
| * gen: Add progressive hash APIHung-ying Tyan2014-03-21-11/+105
| | | | | | | | | | | | | | | | | | | | | | Add hash_init(), hash_update() and hash_finish() to the hash_algo struct. Add hash_lookup_algo() to look up the struct given an algorithm name. Signed-off-by: Hung-ying Tyan <tyanh@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org>
| * rsa: add sha256,rsa4096 algorithmHeiko Schocher2014-03-21-0/+23
| | | | | | | | | | | | | | | | Add support for sha256,rsa4096 signatures in u-boot. Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Cc: andreas@oetken.name
| * rsa: add sha256-rsa2048 algorithmHeiko Schocher2014-03-21-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | based on patch from andreas@oetken.name: http://patchwork.ozlabs.org/patch/294318/ commit message: I currently need support for rsa-sha256 signatures in u-boot and found out that the code for signatures is not very generic. Thus adding of different hash-algorithms for rsa-signatures is not easy to do without copy-pasting the rsa-code. I attached a patch for how I think it could be better and included support for rsa-sha256. This is a fast first shot. aditionally work: - removed checkpatch warnings - removed compiler warnings - rebased against current head Signed-off-by: Heiko Schocher <hs@denx.de> Cc: andreas@oetken.name Cc: Simon Glass <sjg@chromium.org>
| * fit: add sha256 supportHeiko Schocher2014-03-21-0/+5
| | | | | | | | | | | | | | add sha256 support to fit images Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org>
| * fdt: add "fdt checksign" commandHeiko Schocher2014-03-21-1/+41
| | | | | | | | | | | | | | | | check if a fdt is correct signed pass an optional addr value. Contains the addr of the key blob Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org>
* | Start the deprecation process for generic boardSimon Glass2014-04-17-0/+6
| | | | | | | | | | | | | | | | We should move forward to remove the old board init code. Add a prominent message to encourage maintainers to get started on this work. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Revert "Start the deprecation process for generic board"Tom Rini2014-04-04-6/+0
| | | | | | | | | | | | | | | | | | We've run into a non-trivial conversion to CONFIG_SYS_GENERIC_BOARD so we'll postpone this notice until right after v2014.04 is out. This reverts commit 36c4b1d98059244c34ec3327d9cc9f3c552fd01b. Signed-off-by: Tom Rini <trini@ti.com>
* | cmd:gpt: randomly generate each partition uuid if undefinedPrzemyslaw Marczak2014-04-02-15/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - randomly generate partition uuid if any is undefined and CONFIG_RAND_UUID is defined - print debug info about set/unset/generated uuid - update doc/README.gpt Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Piotr Wilczek <p.wilczek@samsung.com> Cc: Tom Rini <trini@ti.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Lukasz Majewski <l.majewski@samsung.com>
* | mmc: Add 'mmc rst-function' sub-commandTom Rini2014-04-02-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | Some eMMC chips may need the RST_n_FUNCTION bit set to a non-zero value in order for warm reset of the system to work. Details on this being required will be part of the eMMC datasheet. Also add using this command to the dra7xx README. * Whitespace fix by panto Signed-off-by: Tom Rini <trini@ti.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
* | Start the deprecation process for generic boardSimon Glass2014-03-28-0/+6
| | | | | | | | | | | | | | | | We should move forward to remove the old board init code. Add a prominent message to encourage maintainers to get started on this work. Signed-off-by: Simon Glass <sjg@chromium.org>
* | common, env: Fix support for environment in i2c eepromMatthias Fuchs2014-03-28-2/+7
| | | | | | | | | | | | | | | | When using CONFIG_SYS_I2C i2c needs to be initialized by i2c_init_all(). This is done in some places but not in eeprom_init(). Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
* | Merge branch 'master' of git://git.denx.de/u-boot-mmcTom Rini2014-03-28-2/+2
|\ \
| * | mmc: Split mmc struct, rework mmc initialization (v2)Pantelis Antoniou2014-03-24-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way that struct mmc was implemented was a bit of a mess; configuration and internal state all jumbled up in a single structure. On top of that the way initialization is done with mmc_register leads to a lot of duplicated code in drivers. Typically the initialization got something like this in every driver. struct mmc *mmc = malloc(sizeof(struct mmc)); memset(mmc, 0, sizeof(struct mmc); /* fill in fields of mmc struct */ /* store private data pointer */ mmc_register(mmc); By using the new mmc_create call one just passes an mmc config struct and an optional private data pointer like this: struct mmc = mmc_create(&cfg, priv); All in tree drivers have been updated to the new form, and expect mmc_register to go away before long. Changes since v1: * Use calloc instead of manually calling memset. * Mark mmc_register as deprecated. Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
* | Add lzmadec commandPatrice Bouchand2014-03-22-0/+55
|/ | | | | | | | | I needed to be able to uncompress lzma files. I did this command based on unzip command and propose it if it could help. Signed-off-by: Patrice Bouchand <pbfwdlist@gmail.com> Changed to work with sandbox Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Add LCD driverSimon Glass2014-03-17-4/+17
| | | | | | | | | | | | | Add a simple LCD driver which uses SDL to display the image. We update the image regularly, while still providing for reasonable performance. Adjust the common lcd code to support sandbox. For command-line runs we do not want the LCD to be displayed, so add a --show_lcd option to enable it. Tested-by: Che-Liang Chiou <clchiou@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* cros_ec: Move EC interface into common libraryVadim Bendebury2014-03-17-0/+45
| | | | | | | | | | Add a common library for obtaining access to the Chrome OS EC. This is used by boards which need to talk to the EC. Reviewed-by: Vadim Bendebury <vbendeb@google.com> Tested-by: Vadim Bendebury <vbendeb@google.com> Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Use os functions to read host device treeSimon Glass2014-03-17-27/+21
| | | | | | | | | | At present we use U-Boot's filesystem layer to read the sandbox device tree, but this is problematic since it relies on a temporary feauture added there. Since we plan to implement proper block layer support for sandbox, change this code to use the os layer functions instead. Also use the new fdt_create_empty_tree() instead of our own code. Signed-off-by: Simon Glass <sjg@chromium.org>
* powerpc: mpc8260: consolidate CONFIG_MPC8260 and CONFIG_8260Masahiro Yamada2014-03-07-26/+26
| | | | | | | | | | | | | | | | | | | | | | | Before this commit, CONFIG_MPC8260 and CONFIG_8260 were used mixed-up. All boards with mpc8260 cpu defined both of them: - CONFIG_MPC8260 was defined in board config headers and include/common.h - CONFIG_8260 was defined arch/powerpc/cpu/mpc8260/config.mk We do not need to have both of them. This commit keeps only CONFIG_MPC8260. This commit does: - Delete CONFIG_8260 and CONFIG_MPC8260 definition in config headers and include/common.h - Rename CONFIG_8260 to CONFIG_MPC8260 in arch/powerpc/cpu/mpc8260/config.mk. - Rename #ifdef CONFIG_8260 to #ifdef CONFIG_MPC8260 Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Wolfgang Denk <wd@denx.de>
* cmd_nvedit: Make 'env import -c' require size parameterTom Rini2014-03-07-0/+3
| | | | | | | | | When importing a checksummed area we need to be told how big the area in question is so that we know that will match the size of the area which the checksum is generated against. Reported-by: Pierre AUBERT <p.aubert@staubli.com> Signed-off-by: Tom Rini <trini@ti.com>
* hush: fix some quoted variable expansion issuesStephen Warren2014-03-07-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following shell command fails: if test -z "$x"; then echo "zero"; else echo "non-zero"; fi (assuming $x does not exist, it prints "non-zero" rather than "zero"). ... since "$x" expands to nothing, and the argument is completely dropped, causing too few to be passed to -z, causing cmd_test() to error out early. This is because when variable expansions are processed by make_string(), the expanded results are concatenated back into a new string. However, no quoting is applied when doing so, so any empty variables simply don't generate any parameter when the combined string is parsed again. Fix this by explicitly replacing quoting any argument that was originally quoted when re-generating a string from the already-parsed argument list. This also fixes loss of whitespace in commands such as: setenv space " " setenv var " 1${space}${space} 2 " echo ">>${var}<<" Reported-by: Russell King <linux@arm.linux.org.uk> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
* Add 64-bit data support for memory commandsYork Sun2014-03-04-10/+151
| | | | | | | | | | Add 64-bit data for memory commands, such as md, mw, mm, cmp. The new size ".q " is introduced. For 64-bit architecture, 64-bit data is enabled by default, by detecting compiler __LP64__. It is optional for other architectures. Signed-off-by: York Sun <yorksun@freescale.com>
* dm: Enable gpio command to support driver modelSimon Glass2014-03-04-13/+116
| | | | | | | | | | Now that named GPIO banks are supported, along with a way of obtaining the status of a GPIO (input or output), we can provide an enhanced GPIO command for driver model. Where the driver provides its own operation for obtaining the GPIO state, this is used, otherwise a generic version is sufficient. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add a demonstration/example driverSimon Glass2014-03-04-0/+103
| | | | | | | | | | | | | | | | As an example of how to write a uclass and a driver, provide a demo version of each, accessible through the 'demo' command. To use these with driver model, define CONFIG_CMD_DEMO and CONFIG_DM_DEMO. The two demo drivers are enabled with CONFIG_DM_DEMO_SIMPLE and CONFIG_DM_DEMO_SHAPE. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com> Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
* dm: Set up driver model after relocationSimon Glass2014-03-04-0/+33
| | | | | | | | Make driver model available after relocation, by setting up data structures and scanning for devices using compiled-in platform_data and (when available) the device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add cmd_process_error() to report and process errorsSimon Glass2014-03-04-0/+10
| | | | | | | | | | | | U-Boot now uses errors defined in include/errno.h which are negative integers. Commands which fail need to report the error and return 1 to indicate failure. Add this functionality in cmd_process_error(). For now this merely reports the error number. It would be possible also to produce a helpful error message by storing the error strings in U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2014-02-26-15/+16
|\ | | | | | | | | | | | | | | | | Conflicts: arch/arm/cpu/armv7/config.mk board/ti/am43xx/mux.c include/configs/am43xx_evm.h Signed-off-by: Tom Rini <trini@ti.com>
| * arm: Switch to -mno-unaligned-access when supported by the compilerTom Rini2014-02-26-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we tell the compiler to optimize for ARMv7 (and ARMv6 for that matter) it assumes a default of SCTRL.A being cleared and unaligned accesses being allowed and fast at the hardware level. We set this bit and must pass along -mno-unaligned-access so that the compiler will still breakdown accesses and not trigger a data abort. To better help understand the requirements of the project with respect to unaligned memory access, the Documentation/unaligned-memory-access.txt file has been added as doc/README.unaligned-memory-access.txt and is taken from the v3.14-rc1 tag of the kernel. Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Cc: Mans Rullgard <mans@mansr.com> Signed-off-by: Tom Rini <trini@ti.com>
| * arm: remove unneeded symbol offsets and _TEXT_BASEAlbert ARIBAUD2014-02-26-13/+5
| | | | | | | | | | | | | | | | Remove the last uses of symbol offsets in ARM U-Boot. Remove some needless uses of _TEXT_BASE. Remove all _TEXT_BASE definitions. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
| * pxe: allow compilation when !defined(CONFIG_CMD_NET)Stephen Warren2014-02-21-0/+11
| | | | | | | | | | | | | | | | | | pxe.c provides both the "pxe" command which relies on a network, and the "sysboot" command which doesn't. Fix the file to compile when network support isn't enabled. This is useful e.g. on the Raspberry Pi which has no network support yet, but will soon support the sysboot command. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
* | Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxTom Rini2014-02-25-1/+6
|\ \ | | | | | | | | | | | | | | | | | | With this, fixup a trivial build error of get_effective_memsize needing to be updated in the new board/freescale/p1010rdb/spl.c Signed-off-by: Tom Rini <trini@ti.com>
| * | SPL: P2020RDB: fix the problem booting from spi flashYing Zhang2014-02-24-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | There was no enough stack in SPL, so the buffer needed in SPL is to malloc from memory pool and to repalce the temporary variable. Signed-off-by: Ying Zhang <b40530@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
* | | ubifs: fix checkpatch warningKaricheri, Muralidharan2014-02-21-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | Fix the following checkpatch warning:- WARNING: externs should be avoided in .c files Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
* | | common, itest: pass u-boot env variables to itest.sHeiko Schocher2014-02-21-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compare two U-Boot Environment variables with itest.s, example: => print tmp ver tmp=U-Boot 2013.10-g75e ver=U-Boot 2013.10-g75eb4bc (Jan 21 2014 - 10:35:39)MPC83XX => print check_ub_ver check_ub_ver=if itest.s \${tmp} == \${ver}; then echo equal; else echo diff ;fi => run check_ub_ver diff => setenv tmp U-Boot 2013.10-g75eb4bc (Jan 21 2014 - 10:35:39)MPC83XX => print tmp ver tmp=U-Boot 2013.10-g75eb4bc (Jan 21 2014 - 10:35:39)MPC83XX ver=U-Boot 2013.10-g75eb4bc (Jan 21 2014 - 10:35:39)MPC83XX => run check_ub_ver equal Signed-off-by: Heiko Schocher <hs@denx.de>
* | | common, ubi: add ubi check volumename commandHeiko Schocher2014-02-21-0/+31
| | | | | | | | | | | | | | | | | | | | | check with this ubi command, if a UBI volume with "volumename" exists in current ubi device. Signed-off-by: Heiko Schocher <hs@denx.de>
* | | Fix memory commands for 64-bit platformsYork Sun2014-02-21-36/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | For aarch64, unsigned long is 64-bit data. Memory commands should be fixed with u32 for 32-bit address access. To be clear, ushort is replace with u16, u_char is replaced with u8. Signed-off-by: York Sun <yorksun@freescale.com> Acked-by: Wolfgang Denk <wd@denx.de>
* | | pxe: prepend fdtdir to DTB name irrespective of sourceStephen Warren2014-02-21-37/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The directory name from an fdtdir directive in a PXE config file should always be pre-pended to the DTB filename; it shouldn't matter whether the DTB filename came from the $fdtfile environment variable, or whether it was constructed dynamically from ${soc}-${board}.dtb. Fix the code to always prepend the directory name. Reported-by: Dennis Gilmore <dennis@ausil.us> Fixes: c61d94d86035 ("pxe: implement fdtdir extlinux.conf tag") Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Dennis Gilmore <dennis@ausil.us> Tested-by: Dennis Gilmore <dennis@ausil.us>
* | | fix address of error message in mtest commandDavid Feng2014-02-21-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch deal with error message of mtest command. When test failed, the mtest command will output error information that include memory address and value. But the address field is not correct or misleading. Signed-off-by: David Feng <fenghua@phytium.com.cn>
* | | common: Add get_effective_memsize() to memsize.cYork Sun2014-02-21-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | This function has been around for powerpc. It is used for systems with memory more than CONFIG_MAX_MEM_MAPPED. In case of non-contiguous memory, this feature can limit U-boot to one block without going over the limit. Signed-off-by: York Sun <yorksun@freescale.com> Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* | | common: Remove invalid endianess conversionChristian Eggers2014-02-21-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | do_bootm_standanlone() calls ntohl(images->ep) which is wrong because endianess conversion has already been done: do_bootm() \-do_bootm_states() +-bootm_find_os() | \-images.ep = image_get_ep(); | \-uimage_to_cpu(hdr->ih_ep); \-boot_selected_os() \-do_bootm_standanlone() Without this conversion the code works correctly at least on AT91SAM9G45. On big endian systems there should be no difference after applying this patch because uimage_to_cpu(x) and ntohl(x) both expand to 'x'. Signed-off-by: Christian Eggers <ceggers@gmx.de>
* | | fs/fdos: RemoveTom Rini2014-02-21-69/+1
| | | | | | | | | | | | | | | | | | We have an unused FAT implementation in fs/fdos, remove. Signed-off-by: Tom Rini <trini@ti.com>
* | | blackfin: Add <asm/clock.h> to numerous driversTom Rini2014-02-20-0/+1
| |/ |/| | | | | | | | | | | | | | | With d6a320d we moved some clock externs out of blackfin_local.h and into clock.h but now need to include <asm/clock.h> in more drivers to avoid warnings. Cc: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Tom Rini <trini@ti.com>
* | cosmetic: FIT: fix a strange commentMasahiro Yamada2014-02-19-1/+1
| | | | | | | | | | | | | | | | | | | | There is a strange comment in fit_image_load(). This function can be used for loading Kernel Image, FDT as well as ramdisk. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
* | Move #ifdef(CONFIG_DISPLAY_CPUINFO) from caller to calleeMasahiro Yamada2014-02-19-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When CONFIG_DISPLAY_CPUINFO is not enabled, print_cpuinfo() should be defined as an empty function in a header, include/common.h - Remove #ifdef CONFIG_DISPLAY_CPUINFO .. #endif from caller, common/board_f.c and arch/arm/lib/board.c - Remove redundant prototypes in arch/arm/lib/board.c, arch/arm/include/asm/arch-am33x/sys_proto.h and board/nokia/rx51/rx51.h, keeping the one in include/common.h - Add #ifdef CONFIG_DISPLAY_CPUINFO to the func definition where it is missing Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | dts: re-write dts/Makefile more simply with KbuildMasahiro Yamada2014-02-19-1/+1
| | | | | | | | | | | | | | | | | | | | | | Useful rules in scripts/Makefile.lib allows us to easily generate a device tree blob and wrap it in assembly code. We do not need to parse a linker script to get output format and arch. This commit deletes ./u-boot.dtb since it is a copy of dts/dt.dtb. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>