summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-06-19.gitignore: drop include/asm/proc from ignore patternMasahiro Yamada
Commit 7d89982b stopped creating symbolic link arch/${arch}/include/asm/proc. arch/.gitignore should be updated. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Vasili Galka <vvv444@gmail.com>
2014-06-19fs: ext4: fix writing zero-length filesStephen Warren
ext4fs_allocate_blocks() always allocates at least one block for a file. If the file size is zero, this causes total_remaining_blocks to underflow, which then causes an apparent hang while 2^32 blocks are allocated. To solve this, check that total_remaining_blocks is non-zero as part of the loop condition (i.e. before each loop) rather than at the end of the loop. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-19fdt_support: correct the return condition of fdt_initrd()Masahiro Yamada
Before this commit, fdt_initrd() just returned if initrd start address is zero. But it is possible if the RAM is located at address 0. This commit makes the return condition more reasonable: Just return if the size of initrd is zero. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-19fdt_support: fix an endian bug of fdt_initrd()Masahiro Yamada
Data written to DTB must be converted to big endian order. It is usually done by using cpu_to_fdt32(), cpu_to_fdt64(), etc. fdt_initrd() invoked write_cell(), which always swaps byte order. It means the function only worked on little endian architectures. (On big endian architectures, the byte order should be kept as it is) This commit uses cpu_to_fdt32() and cpu_to_fdt64() and deletes write_cell(). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-19fdt_support: fix an endian bug of fdt_fixup_memory_banksMasahiro Yamada
Data written to DTB must be converted to big endian order. It is usually done by using cpu_to_fdt32(), cpu_to_fdt64(), etc. fdt_fixup_memory_banks() invoked write_cell(), which always swaps byte order. It means the function only worked on little endian architectures. This commit adds and uses a new helper function, fdt_pack_reg(), which works on both big endian and little endian architrectures. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-19fdt_support: add 'const' qualifier for unchanged argumentMasahiro Yamada
In the next commit, I will add a new function, fdt_pack_reg() which uses get_cells_len(). Beforehand, this commit adds 'const' qualifier to get_cells_len(). Otherwise, a warning message will appear: warning: passing argument 1 of 'get_cells_len' discards 'const' qualifier from pointer target type [enabled by default] Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-19fdt_support: refactor fdt_fixup_stdout() functionMasahiro Yamada
- Do not use a deep indentation. We have only 80-character on each line and 1 indentation consumes 8 spaces. Before the code moves far to the right, you should consider to fix your code. See Linux Documentation/CodingStyle. - Add CONFIG_OF_STDOUT_VIA_ALIAS and OF_STDOUT_PATH macros only to their definition. Do not add them to both callee and caller. This is a tip to avoid using #ifdef everywhere. - OF_STDOUT_PATH and CONFIG_OF_STDOUT_VIA_ALIAS are exclusive. If both are defined, the former takes precedence. Do not try to fix-up "linux,stdout-path" property twice. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-19fdt_support: delete force argument of fdt_chosen()Masahiro Yamada
After all, we have realized "force" argument is completely useless. fdt_chosen() was always called with force = 1. We should always want to do the same thing (set appropriate value to the property) even if the property already exists. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-19fdt_support: delete force argument of fdt_initrd()Masahiro Yamada
After all, we have realized "force" argument is completely useless. fdt_initrd() was always called with force = 1. We should always want to do the same thing (set appropriate value to the property) even if the property already exists. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-19fdt_support: refactor with fdt_find_or_add_subnode helper funcMasahiro Yamada
Some functions in fdt_support.c do the same routine: search a node with a given name ("chosen", "memory", etc.) or newly create it if it does not exist. So this commit makes that routine to a helper function. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-19fdt_support: delete unnecessary DECLARE_GLOBAL_DATA_PTRMasahiro Yamada
gd->bd is not used in fdt_support.c. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-19freescale: m5253demo: fix unused-but-set-variable warningsMasahiro Yamada
Fix the following warning messages: In function 'flash_erase': 180:21: warning: variable 'last' set but not used [-Wunused-but-set-variable] In function 'write_buff': 322:10: warning: variable 'port_width' set but not used [-Wunused-but-set-variable] Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
2014-06-19libfdt: Fix segfault when calling fit_check_format() on corrupt FIT imagesJon Nalley
It has been observed that fit_check_format() will fail when passed a corrupt FIT image. This was tracked down to _fdt_string_eq(): return (strlen(p) == len) && (memcmp(p, s, len) == 0); In the case of a corrupt FIT image one can't depend on 'p' being NULL terminated. I changed it to use strnlen() to fix the issue. Signed-off-by: Tom Rini <trini@ti.com>
2014-06-19m68k:correct io macros about endianChao Fu
M68k is big endian cpu ,so use be_out and be_in in big endian. Signed-off-by: Chao Fu <b44548@freescale.com>
2014-06-19m68k: eliminate a warning in cpu_initMasahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-19ARM: fdt support: Add usbethaddr as an acceptable MACDan Murphy
A board that has a USB ethernet device only may set the usbetheraddr and not the ethaddr. ethaddr will be the default MAC address that is chosen and if that is not populated then the usbethaddr is looked at. If neither are set then then device tree blob is not modified. Signed-off-by: Dan Murphy <dmurphy@ti.com>
2014-06-19Fix bug in io64 target (introduced by commit aba27ac)Vasili Galka
From comparison of current logic and the logic that was prior to commit aba27ac, we see that first parameter of FPGA_GET_REG() shall be the FPGA index and not channel number. The re-factoring in commit aba27ac accidentally changed that. Cc: Stefan Roese <sr@denx.de> Acked-by: Dirk Eibach <dirk.eibach@gdsys.cc> Signed-off-by: Vasili Galka <vvv444@gmail.com>
2014-06-18configs: iocon: Enabling CONFIG_CMD_FPGAD againMichal Simek
This is a MIME GnuPG-signed message. If you see this text, it means that your E-mail or Usenet software does not support MIME signed messages. The Internet standard for MIME PGP messages, RFC 2015, was published in 1996. To open this message correctly you will need to install E-mail or Usenet software that supports modern Internet standards. Revert changes in iocon.h config file caused by these two commits: "configs: iocom: Fix typo on CMD_FPGA command" (sha1: d0db28f94034ef02c1d6737895766fb3c19de47f) and "fpga: Guard the LOADMK functionality with CMD_FPGA_LOADMK" (sha1: 64e809afeaf1572c3246a5bca198a77d0498fd89) CONFIG_CMD_FPGAD is own command. Reported-by: Dirk Eibach <dirk.eibach@gdsys.cc> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-06-12Merge branch 'master' of git://git.denx.de/u-boot-mmcTom Rini
2014-06-12mmc: free allocated memory on initialization errorsDarwin Rambo
Cleanup to balance malloc/free calls. Signed-off-by: Darwin Rambo <drambo@broadcom.com> Reviewed-by: Steve Rae <srae@broadcom.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-06-12cmd_mmc: make mmc dev always re-probe the HWStephen Warren
Currently, U-Boot behaves as follows: - Begin with no SD card inserted in "mmc 1" - Execute: mmc dev 1 - This fails, since there is no card - User plugs in an SD card - Execute: mmc dev 1 - This still fails, since the HW isn't reprobed. With this change, U-Boot behaves as follows: - Begin with no SD card inserted in "mmc 1" - Execute: mmc dev 1 - This fails, since there is no card - User plugs in an SD card - Execute: mmc dev 1 - The newly present SD card is detected I know that "mmc rescan" will force the HW to be reprobed, but I feel it makes more sense if "mmc dev" always reprobes the HW after selecting the current MMC device. This allows scripts to just execute "mmc dev", and not have to also execute "mmc rescan" to check for media presense. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-06-12cmd_mmc: Use init_mmc_device() from do_mmc_rescan()Stephen Warren
The body of init_mmc_device() is now identical to that of do_mmc_rescan() except for the error codes returned. Modify do_mmc_rescan() to simply call init_mmc_device() and convert the error codes, to avoid code duplication. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-06-12cmd_mmc: add force_init parameter to init_mmc_device()Stephen Warren
This allows callers to inject mmc->has_init = 0 between finding the MMC device, and calling mmc_init(), which forces mmc_init() to rescan the HW. Future changes will use this feature. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-06-12disk: default to HW partition 0 if not specifiedStephen Warren
Currently, get_device()/get_dev_hwpart() for MMC devices does not select an explicit HW partition unless the user explicitly requests one, i.e. by requesting device "mmc 0.0" rather than just "mmc 0". I think it makes more sense if the default is to select HW partition 0 (main data area) if the user didn't request a specific partition. Otherwise, the following happens, which feels wrong: Select HW partition 1 (boot0): mmc dev 0 1 Attempts to access SW partition 1 on HW partition 1 (boot0), rather than SW partition 1 on HW partition 0 (main data area): ls mmc 0:1 / With this patch, the second command above re-selects the main data area. Many device types don't support HW partitions at all, so if HW partition 0 is selected (either explicitly or as the default) and there's no select_hwpart function, we simply skip attempting to select a HW partition. Some MMC devices (i.e. SD cards) don't support HW partitions. However, this patch still works, since mmc_start_init() sets the current partition number to 0, and mmc_select_hwpart() succeeds if the requested partition is already selected. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-06-12cmd_mmc: default to HW partition 0 if not specifiedStephen Warren
Currently, "mmc dev 0" does not change the selected HW partition. I think it makes more sense if "mmc dev 0" is an alias for "mmc dev 0 0", i.e. that HW partition 0 (main data area) is always selected by default if the user didn't request a specific partition. Otherwise, the following happens, which feels wrong: Select HW partition 1 (boot0): mmc dev 0 1 Doesn't change the HW partition, so it's still 1 (boot0): mmc dev 0 With this patch, the second command above re-selects the main data area. Note that some MMC devices (i.e. SD cards) don't support HW partitions. However, this patch still works, since mmc_start_init() sets the current partition number to 0, and mmc_select_hwpart() succeeds if the requested partition is already selected. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-06-12mmc: return meaningful error codes from mmc_select_hwpartStephen Warren
Rather than just returning -1 everywhere, try to return something meaningful from mmc_select_hwpart(). Note that most other MMC functions don't do this, including functions called from mmc_select_hwpart(), so I'm not sure how effective this will be. Still, it's one less place with hard-coded -1. Suggested-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-06-12i2c: kona: Resolve Kona I2C driver issueSteve Rae
- "i2c mw" command hangs (with some compilers) Signed-off-by: Steve Rae <srae@broadcom.com>
2014-06-11common/xyzModem.c: move empty statements to newlineJeroen Hofstee
To prevent a warning for clang the loop without a body is made more clear by moving it to a line of its own. This prevents a clang warning. cc: sbabic@denx.de Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-11jffs2:jffs2_1pass.c: remove double bracesJeroen Hofstee
Clang interpretes an if condition likeĀ  "if ((a = b) == NULL) as it tries to assign a value in a statement. Hence if you do "if ((something)) it warns you that you might be confused. Hence drop the double braces for plane if statements. Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-11board:keymile: remove unnecessary double bracesJeroen Hofstee
Clang interpretes an if condition like "if ((a = b) == NULL) as it tries to assign a value in a statement. Hence if you do "if ((something)) it warns you that you might be confused. Hence drop the double braces for plane if statements. cc: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-11common/cli_hush.c: remove unnecessary double bracesJeroen Hofstee
Clang interpretes an if condition like "if ((a = b) == NULL) as it tries to assign a value in a statement. Hence if you do "if ((something)) it warns you that you might be confused. Hence drop the double braces for plane if statements. Simon Glass <sjg@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-11LzmaTools: don't self assign valuesJeroen Hofstee
It seems the code tries to trick the compiler the argument is actually used. However compilers became too smart to fool them so easily an now warn. Gcc and clang don't seem to emit a warning when the argument is unused. If so it should be decorated with unused / (void). Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-11imximage_hynix.cfg: fix unterminated commentJeroen Hofstee
cc: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-11cosmetic: board: pm9263 rewrite old style stuct initJeroen Hofstee
this prevent some warnings when compiling with clang cc: Stelian Pop <stelian@popies.net> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-11tps6586x.h: fix inclusion guardJeroen Hofstee
cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-11Remove ${objtree}/include/asm/proc/ linkVasili Galka
mkconfig links ${objtree}/include/asm/proc/ to ${srctree}/arch/${arch}/include/asm/proc-armv/. This seems to be a remnant from the past. Ever since its introduction in 2003 it is used only in ARM build and always links to same place, so let's simplify the code, remove it and reference directly where needed. Successful MAKEALL for ARM and PowerPC verified on Linux. Signed-off-by: Vasili Galka <vvv444@gmail.com>
2014-06-11cosmetic: Whitespace fixVasili Galka
Signed-off-by: Vasili Galka <vvv444@gmail.com>
2014-06-11cosmetic: atmel: replace old style struct initJeroen Hofstee
This prevents some warnings when building with clang. cc:: andreas.devel@googlemail.com Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-11ext4: correctly zero filenameJeroen Hofstee
Since ALLOC_CACHE_ALIGN_BUFFER declares a char* for filename sizeof(filename) is not the size of the buffer. Use the already known length instead. cc: Uma Shankar <uma.shankar@samsung.com> cc: Manjunatha C Achar <a.manjunatha@samsung.com> cc: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Marek Vasut <marex@denx.de>
2014-06-11common: hash: zero end the string instead of the pointerJeroen Hofstee
if algo->digest_size is zero nothing is set in the str_output buffer. An attempt is made to zero end the buffer, but the pointer to the buffer is set to zero instead. I am unaware if it causes any actual problems, but solves the following warning: common/hash.c:217:13: warning: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Wnon-literal-null-conversion] str_ptr = '\0'; ^~~~ cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-11kbuild: move spl/Makefile to scripts/Makefile.splMasahiro Yamada
All files under spl/ and tpl/ are generated during the build process except spl/Makefile. We can simplify clean-rule and git-ignore by moving spl/Makefile to somewhere else. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-11m68k: Fix warnings with gcc 4.6Simon Glass
Most of the warnings seem to be related to using 'int' for size_t. Change this and fix up the remaining warnings and problems. For bootm, the warning was masked by others, and there is an actual bug in the code. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-11docs: driver-model: Fix spellingChris Packham
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2014-06-11.gitignore: move *.exe pattern to the top gitignore for CygwinMasahiro Yamada
GCC on Cygwin generates executables with .exe extension, for example: scripts/basic/fixdep.exe scripts/docproc.exe To ignore them, *.exe pattern should be moved from tools/.gitignore to ./.gitignore Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-11kbuild: remove unnecessary adjustment for CygwinMasahiro Yamada
"SFX = .exe" was originally added for Cygwin environment. It is true that GCC on Cygwin spits executables with .exe extention. For example, gcc -o foo foo.c will generate "foo.exe", not "foo". But GNU make is also nicely adjusted for Cygwin. For example, foo: foo.c gcc -o $@ $< will compare the timestamp between "foo.exe" and "foo.c". You do not have to tweak Makefiles like this: foo$(SFX): foo.c gcc -o $@ $< And "make clean" works as well without adjustment for Cygwin because the command "rm foo" on Cygwin will delete both "foo" and "foo.exe". In conclusion, makefiles do not need special care for Cygwin. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-11.gitignore: drop *.dts.tmp patternMasahiro Yamada
This pattern was added by commit cc4f427b to ignore the intermidiate file for generating DTB. When Kbuild was introduced, dts/Makefile was totally re-written. This ignore pattern is already useless. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-11kbuild, tools: generate wrapper C sources automatically by MakefileMasahiro Yamada
There are many source files shared between U-boot image and tools. Instead of adding a lot of dummy wrapper files that just include the corresponding file in lib/ or common/ directory, Makefile should automatically generate them. The original inspiration for this came from scripts/Makefile.asm-generic of Linux Kernel. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2014-06-11disk: part_dos.c: Add a PBR check when MBR checking failsDarwin Dingel
Bug: SDCard with a messed up partition but still has a FAT signature intact is readable in Linux but unreadable in uboot with 'fatls'. Fix: When partition info checking fails, there is no checking for a FAT signature (DOS_PBR) which will fail 'fatls'. FAT signature checking is done when no valid partition is found in partition table. If FAT signature is found, the disk will be read as PBR and continue processing. Signed-off-by: Darwin Dingel <darwin.dingel@alliedtelesis.co.nz>
2014-06-11kbuild: export HOSTCXX and HOSTCXXFLAGSMasahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-11Use run_command_repeatable()Thomas Betker
Replace run_command() by run_command_repeatable() in places which depend on the return code to indicate repeatability. Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>