summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2014-03-04Add 64-bit data support for memory commandsYork Sun
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>
2014-03-04dm: Enable gpio command to support driver modelSimon Glass
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>
2014-03-04dm: Add a demonstration/example driverSimon Glass
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>
2014-03-04dm: Set up driver model after relocationSimon Glass
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>
2014-03-04Add cmd_process_error() to report and process errorsSimon Glass
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>
2014-02-26Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini
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>
2014-02-26arm: Switch to -mno-unaligned-access when supported by the compilerTom Rini
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>
2014-02-26arm: remove unneeded symbol offsets and _TEXT_BASEAlbert ARIBAUD
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>
2014-02-25Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxTom Rini
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>
2014-02-24SPL: P2020RDB: fix the problem booting from spi flashYing Zhang
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>
2014-02-21ubifs: fix checkpatch warningKaricheri, Muralidharan
Fix the following checkpatch warning:- WARNING: externs should be avoided in .c files Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
2014-02-21common, itest: pass u-boot env variables to itest.sHeiko Schocher
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>
2014-02-21common, ubi: add ubi check volumename commandHeiko Schocher
check with this ubi command, if a UBI volume with "volumename" exists in current ubi device. Signed-off-by: Heiko Schocher <hs@denx.de>
2014-02-21Fix memory commands for 64-bit platformsYork Sun
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>
2014-02-21pxe: prepend fdtdir to DTB name irrespective of sourceStephen Warren
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>
2014-02-21fix address of error message in mtest commandDavid Feng
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>
2014-02-21common: Add get_effective_memsize() to memsize.cYork Sun
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>
2014-02-21common: Remove invalid endianess conversionChristian Eggers
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>
2014-02-21pxe: allow compilation when !defined(CONFIG_CMD_NET)Stephen Warren
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>
2014-02-21fs/fdos: RemoveTom Rini
We have an unused FAT implementation in fs/fdos, remove. Signed-off-by: Tom Rini <trini@ti.com>
2014-02-20blackfin: Add <asm/clock.h> to numerous driversTom Rini
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>
2014-02-19cosmetic: FIT: fix a strange commentMasahiro Yamada
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>
2014-02-19Move #ifdef(CONFIG_DISPLAY_CPUINFO) from caller to calleeMasahiro Yamada
- 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>
2014-02-19dts: re-write dts/Makefile more simply with KbuildMasahiro Yamada
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>
2014-02-19kbuild: use Linux Kernel build scriptsMasahiro Yamada
Now we are ready to switch over to real Kbuild. This commit disables temporary scripts: scripts/{Makefile.build.tmp, Makefile.host.tmp} and enables real Kbuild scripts: scripts/{Makefile.build,Makefile.host,Makefile.lib}. This switch is triggered by the line in scripts/Kbuild.include -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj We need to adjust some build scripts for U-Boot. But smaller amount of modification is preferable. Additionally, we need to fix compiler flags which are locally added or removed. In Kbuild, it is not allowed to change CFLAGS locally. Instead, ccflags-y, asflags-y, cppflags-y, CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o are prepared for that purpose. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-19kbuild: change out-of-tree buildMasahiro Yamada
This commit changes the working directory where the build process occurs. Before this commit, build process occurred under the source tree for both in-tree and out-of-tree build. That's why we needed to add $(obj) prefix to all generated files in makefiles like follows: $(obj)u-boot.bin: $(obj)u-boot Here, $(obj) is empty for in-tree build, whereas it points to the output directory for out-of-tree build. And our old build system changes the current working directory with "make -C <sub-dir>" syntax when descending into the sub-directories. On the other hand, Kbuild uses a different idea to handle out-of-tree build and directory descending. The build process of Kbuild always occurs under the output tree. When "O=dir/to/store/output/files" is given, the build system changes the current working directory to that directory and restarts the make. Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj=<sub-dir>" syntax for descending into sub-directories. (We can write it like "make $(obj)=<sub-dir>" with a shorthand.) This means the current working directory is always the top of the output directory. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-19common: spl: Add spl sata boot supportDan Murphy
Add spl_sata to read a fat partition from a bootable SATA drive. Signed-off-by: Dan Murphy <dmurphy@ti.com> Reviewed-by: Roger Quadros <rogerq@ti.com>
2014-02-19EXT4: Fix number base handling of "ext4write" commandWolfgang Denk
Unlike other commands (for example, "fatwrite"), ext4write would interpret the "sizebytes" as decimal number. This is not only inconsistend and unexpected to most users, it also breaks usage like this: tftp ${addr} ${name} ext4write mmc 0:2 ${addr} ${filename} ${filesize} Change this to use the standard notation of base 16 input format. See also commit b770e88 WARNING: this is a change to the user interface!! Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Uma Shankar <uma.shankar@samsung.com> Cc: Stephen Warren <swarren@nvidia.com>
2014-02-19fdt: rename IMAAGE_OF_BOARD_SETUP to IMAGE_OF_BOARD_SETUPMasahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-02-19cmd_test: implement -e test for file existenceStephen Warren
This is much like a regular shell's -e operator, except that it takes multiple arguments to specify the device type and device/partition ID in addition to the usual filename: if test -e mmc 0:1 /boot/boot.scr; then echo yes; else echo no; fi Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-02-19cmd_test: evaluate to false without any argumentsStephen Warren
This emulates bash: $ if test; then echo yes; else echo no; fi no Currently, the code sets expr = -1 in this case, which gets mapped to 0 (true) at the end of do_test() by the logical -> shell exit code conversion. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-02-19cmd_test: implement ! on sub-expressionsStephen Warren
Currently, ! can only be parsed as the first operator in an expression. This prevents the following from working: $ if test ! ! 1 -eq 1; then echo yes; else echo no; fi yes $ if test ! 1 -eq 2 -a ! 3 -eq 4; then echo yes; else echo no; fi yes Fix this by parsing ! like any other operator, and and handling it similarly to -a and -o. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-02-19cmd_test: check for binary operators before unaryStephen Warren
This better mirrors the behaviour of bash, for example: $ if test -z = -z; then echo yes; else echo no; fi yes This is parsed as a string comparison of "-z" and "-z", since the check for the binary "=" operator occurs first. Without this change, the command would be parsed as a -z test of "-", followed by a syntax error; a trailing -z without and operand. This is a behavioural change, but I believe any commands affected were previously invalid or bizarely formed. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-02-19cmd_test: use table lookup for parsingStephen Warren
do_test() currently uses strcmp() twice to determine which operator is present; once to determine how many arguments the operator needs, then a second time to actually decode the operator and implement it. Rewrite the code so that a table lookup is used to translate the operator string to an integer, and use a more efficient switch statement to decode and execute the operator. This approach also acts as enablement for the following patches. This patch should introduce no behavioural change. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-02-17Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini
2014-02-17Merge branch 'master' of git://git.denx.de/u-boot-mmcTom Rini
2014-02-07cmd_mmc.c: Drop open/close mmc sub-commandsTom Rini
The open and close mmc sub-commands implement a hard-coded set of values specific to the SMDK5250 platform. Remove these commands as what they did can be done instead with a series of mmc dev / bootpart / bootbus commands instead now. Cc: Amar <amarendra.xt@samsung.com> Cc: Minkyu Kang <mk7.kang@samsung.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Tom Rini <trini@ti.com> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-02-07cmd_mmc.c: Add bootbus mmc sub-commandTom Rini
Add a bootbus sub-command to the mmc command to allow for setting the boot_bus_width, reset_boot_bus_width and boot_mode fields of BOOT_BUS_WIDTH (EXT_CSD[177]). Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Tom Rini <trini@ti.com> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-02-07cmd_mmc.c: Add 'partconf' command to mmcTom Rini
Add a partconf sub-command to the mmc command to allow for setting the boot_ack, boot_partition and partition_access fields of PARTITION_CONFIG (formerly BOOT_CONFIG, EXT_CSD[179]). Part of this requires changing the check for 'part' from an strncmp to a strcmp, like the rest of the sub-commands. Cc: Andy Fleming <afleming@gmail.com> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Tom Rini <trini@ti.com> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-02-07cmd_mmc.c: Rename 'bootpart' to 'bootpart-resize'Tom Rini
Rename 'bootpart' to 'bootpart-resize' to better reflect what this command is for. Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Tom Rini <trini@ti.com> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-02-07cmd_mmc.c: Change 'bootpart' code to match normal coding styleTom Rini
Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Tom Rini <trini@ti.com> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-02-07SPL: Add CONFIG_SUPPORT_EMMC_BOOT support to CONFIG_SPL_FRAMEWORKTom Rini
We use the switch CONFIG_SUPPORT_EMMC_BOOT today to enable some additional features of the eMMC boot partitions. Add support for being told that we have booted from one of these partitions to the spl framework and implement this on TI OMAP/related. Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Tom Rini <trini@ti.com> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-02-07arc: bdinfo, image and arc-specific init functions declarations supportAlexey Brodkin
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Francois Bedard <fbedard@synopsys.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Heiko Schocher <hs@denx.de>
2014-02-04cmd_pxe.c add any option for filesystem with sysboot uses generic loadDennis Gilmore
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2014-02-04Merge branch 'clk' of git://www.denx.de/git/u-boot-microblazeTom Rini
2014-02-04pxe: implement fdtdir extlinux.conf tagStephen Warren
People who write (or scripts that auto-generate) extlinux.conf don't want to know about HW-specific information such as FDT filenames. Create a new extlinux.conf tag "fdtdir" that specifies only the directory where FDT files are located, and defer all knowledge of the filename to U-Boot. The algorithm implemented is: ========== if $fdt_addr_r is set: if "fdt" tag was specified in extlinux.conf: load the FDT from the filename in the tag else if "fdtdir" tag was specified in extlinux.conf: if "fdtfile" is set in the environment: load the FDT from filename in "$fdtfile" else: load the FDT from some automatically generated filename if no FDT file was loaded, and $fdtaddr is set: # This indicates an FDT packaged with firmware use the FDT at $fdtaddr ========== A small part of an example /boot/extlinux.conf might be: ========== LABEL primary LINUX zImage FDTDIR ./ LABEL failsafe LINUX bkp/zImage FDTDIR bkp/ ========== ... with /boot/tegra20-seaboard.dtb or /boot/bkp/tegra20-seaboard.dtb being loaded by the sysboot/pxe code. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-02-04pxe: support "devicetree" tagStephen Warren
The specification for extlinux.conf[1] states that "fdt" is an alias for "devicetree". To date, U-Boot only implements "fdt". Rectify that. [1] http://freedesktop.org/wiki/Specifications/BootLoaderSpec/ Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-02-04common: Add new clk commandMichal Simek
Command provides just dump subcommand for showing clock frequencies in a soc. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Stefano Babic <sbabic@denx.de>
2014-02-03common: lcd.c: fix data abort exception when try to access bmp headerPrzemyslaw Marczak
Changes: - le16_to_cpu() to get_unaligned_le16() - le32_to_cpu() to get_unaligned_le32() when access fields in struct bmp header. This changes avoids data abort exception caused by unaligned data access. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2014-01-27board_r - fixup functions table after relocationAlexey Brodkin
This is only required for "PIC" relocation and doesn't apply to modern "PIE" relocation which does data relocation as well as code. "init_sequence_r" is just an array that consists of compile-time adresses of init functions. Since this is basically an array of integers (pointers to "void" to be more precise) it won't be modified during relocation - it will be just copied to new location as it is. As a consequence on execution after relocation "initcall_run_list" will be jumping to pre-relocation addresses. As long as we don't overwrite pre-relocation memory area init calls are executed correctly. But still it is dangerous because after relocation we don't expect initially used memory to stay untouched. Cc: Tom Rini <trini@ti.com> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Doug Anderson <dianders@chromium.org> Cc: Thomas Langer <thomas.langer@lantiq.com> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>