summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* stdio: Pass device pointer to stdio methodsSimon Glass2014-07-23-101/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | At present stdio device functions do not get any clue as to which stdio device is being acted on. Some implementations go to great lengths to work around this, such as defining a whole separate set of functions for each possible device. For driver model we need to associate a stdio_dev with a device. It doesn't seem possible to continue with this work-around approach. Instead, add a stdio_dev pointer to each of the stdio member functions. Note: The serial drivers have the same problem, but it is not strictly necessary to fix that to get driver model running. Also, if we convert serial over to driver model the problem will go away. Code size increases by 244 bytes for Thumb2 and 428 for PowerPC. 22: stdio: Pass device pointer to stdio methods arm: (for 2/2 boards) all +244.0 bss -4.0 text +248.0 powerpc: (for 1/1 boards) all +428.0 text +428.0 Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Marek Vasut <marex@denx.de>
* stdio: Remove redundant code around stdio_register() callsSimon Glass2014-07-23-42/+0
| | | | | | | | | | | | | There is no point in setting a structure's memory to NULL when it has already been zeroed with memset(). Also, there is no need to create a stub function for stdio to call - if the function is NULL it will not be called. This is a clean-up, with no change in functionality. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
* dm: Use an explicit expect value in core testsSimon Glass2014-07-23-6/+12
| | | | | | | Rather than reusing the 'reg' property, use an explicit property for the expected ping value used in testing. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: Don't use the driver model uclass for SPLSimon Glass2014-07-23-0/+2
| | | | | | | Driver model does not support SPL yet, so we should not use the GPIO uclass for SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Always enable malloc debugSimon Glass2014-07-23-0/+4
| | | | | | | | Tun on DEBUG in malloc(). This adds code space and slows things down but for sandbox this is acceptable. We gain the ability to check for memory leaks in tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: config: Enable pre-relocation malloc()Simon Glass2014-07-23-1/+3
| | | | | | | Enable this for sandbox so that we will be able to use driver model before relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Support pre-relocation malloc()Simon Glass2014-07-23-0/+6
| | | | | | | Set up and zero global data before board_init_f() is called so that we can remove the need for CONFIG_SYS_GENERIC_GLOBAL_DATA. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add a simple malloc() implementation for pre-relocationSimon Glass2014-07-23-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we are to have driver model before relocation we need to support some way of calling memory allocation routines. The standard malloc() is pretty complicated: 1. It uses some BSS memory for its state, and BSS is not available before relocation 2. It supports algorithms for reducing memory fragmentation and improving performace of free(). Before relocation we could happily just not support free(). 3. It includes about 4KB of code (Thumb 2) and 1KB of data. However since this has been loaded anyway this is not really a problem. The simplest way to support pre-relocation malloc() is to reserve an area of memory and allocate it in increasing blocks as needed. This implementation does this. To enable it, you need to define the size of the malloc() pool as described in the README. It will be located above the pre-relocation stack on supported architectures. Note that this implementation is only useful on machines which have some memory available before dram_init() is called - this includes those that do no DRAM init (like tegra) and those that do it in SPL (quite a few boards). Enabling driver model preior to relocation for the rest of the boards is left for a later exercise. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Set up global data before board_init_f()Simon Glass2014-07-23-1/+5
| | | | | | | | | | | | At present sandbox defines CONFIG_SYS_GENERIC_GLOBAL_DATA, meaning that the global_data pointer is set up in board_init_f(). If we set up and zero the global data before calling board_init_f() then we don't need to define CONFIG_SYS_GENERIC_GLOBAL_DATA. Make this change to simplify the init process. Signed-off-by: Simon Glass <sjg@chromium.org>
* Remove form-feeds from dlmalloc.cSimon Glass2014-07-23-23/+23
| | | | | | | | | | These don't really serve any purpose in the modern age. On the other hand they show up as annoying control characters in my editor, which then happily removes them. I believe we can drop these characters from the file. Signed-off-by: Simon Glass <sjg@chromium.org>
* m68k: define __kernel_size_t as unsinged int againMasahiro Yamada2014-07-22-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit ddc94378d changed the definition of __kernel_size_t from unsigned int to unsigned long. It is true that it fixed warnings on some crosstools but it increased warnings on the others. The problem is that we cannot see consistency in terms of the typedef of __kernel_size_t on M68K architecture. However, I'd like to suggest to have __kernel_size_t to be unsigned int again. Rationale: [1] Linux Kernel defines __kernel_size_t on M68K as unsigned int. Let's stick to the Linux's way. [2] We want to build boards with popular pre-built toolchains, not the one locally-built by indivisuals. I think m68-linux-gcc which can be downloaded from www.kernel.org is the candidate for our _recommended_ toolchains. With this patch, all the m68k boards can be built without any warnings. Give it a try with the following crosstools: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.3/ x86_64-gcc-4.6.3-nolibc_m68k-linux.tar.xz or https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/ x86_64-gcc-4.9.0-nolibc_m68k-linux.tar.xz (The latter is newer.) Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org> Cc: Jason Jin <Jason.jin@freescale.com>
* m68k: fix an undefined behavior warning of M5253DEMO boardMasahiro Yamada2014-07-22-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latest GCC is so clever that it reports more warnings than old ones did: ------------------------------>8------------------------------ board/freescale/m5253demo/flash.c: In function 'flash_get_offsets': board/freescale/m5253demo/flash.c:65:23: warning: iteration 2047u invokes undefined behavior [-Waggressive-loop-optimizations] info->start[k + 1] = info->start[k] + CONFIG_SYS_SST_SECTSZ; ^ board/freescale/m5253demo/flash.c:64:3: note: containing loop for (k = 0, j = 0; j < CONFIG_SYS_SST_SECT; j++, k++) { ^ ------------------------------8<------------------------------ The cause of the warning is like this: The for statement iterates 2048 times in flash_get_offsets() func. (Notice CONFIG_SYS_SST_SECT is defined as 2048) The last iteration does info->start[2048] = info->start[2047] + CONFIG_SYS_SST_SECTSZ; causing an undefined behavior. (Please note the array size of info->start is 2048. CONFIG_SYS_MAX_FLASH_SECT is defined as 2048 for this board.) This commit fixes that so as not to overrun the info->start array. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Jason Jin <Jason.jin@freescale.com>
* boards.cfg: re-claim ownership for TQM8xx boardsWolfgang Denk2014-07-22-9/+9
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Ethernet: let user know if there is no valid ethernet addressPavel Machek2014-07-22-8/+21
| | | | | | Improve error messages in case of invalid/unset ethernet addresses. Signed-off-by: Pavel Machek <pavel@denx.de>
* board_r: run scsi init() on ARM tooIan Campbell2014-07-22-4/+1
| | | | | | | | | | | | | | | | | This has been disabled for ARM in initr_scsi since that function was introduced. However it works fine for me on Cubieboard and Cubietruck (with the upcoming AHCI glue patch). I also tested on two random ARM platforms which seem to define CONFIG_CMD_SCSI: - highbank worked fine (on midway hardware) - omap5_uevm built OK and I confirmed using objdump that things were as expected (i.e. the default weak scsi_init nop was used). While there remove the mismatched comment from the #endif (omitting the comment seems to be the prevailing style in this file). Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Acked-by: Simon Glass <sjg@chromium.org>
* AHCI: Increase link timeout to 200msIan Campbell2014-07-22-1/+1
| | | | | | | | | | | | | In 73545f75b66d "ahci: wait longer for link" I increased the timeout to 40ms based on the observed behaviour of a WD disk on a Cubietruck. Since then Karsten Merker and myself have both observed timeouts with HGST disks (Karsten on Cubietruck, me on Cubieboard2). Increasing the timeout to ~175ms fixes this, so go to 200ms for a bit of headroom. Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Cc: Karsten Merker <merker@debian.org> Acked-by: Hans de Goede <hdegoede@redhat.com>
* .gitignore: clean-up unnecessary entriesMasahiro Yamada2014-07-22-4/+0
| | | | | | | | | There have been /errlog and /reloc_off in the top level .gitignore since commit 1b4aaffe added it about 7 years ago. But they are no longer generated. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* Update .mailmap using scripts/mailmapperMasahiro Yamada2014-07-22-0/+15
| | | | | | | | | | | Add more entries to .mailmap for the canonical names with 50 commits or more. This commit was generated by the following command: scripts/mailmapper > tmp; mv tmp .mailmap Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* scripts: add mailmapper, a tool to create/update mailmap fileMasahiro Yamada2014-07-22-0/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tool helps to create/update the mailmap file. It runs 'git shortlog' internally and searches differently spelled author names which share the same email address. The author name with the most commits is asuumed to be a canonical real name. If the number of commits from the cananonical name is equal to or greater than 'MIN_COMMITS' (=50), the entry for the cananical name will be output. ('MIN_COMMITS' is used here because we do not want to create a fat mailmap by adding every author with only a few commits.) If there exists a mailmap file specified by the mailmap.file configuration options or '.mailmap' at the toplevel of the repository, it is used as a base file. The base file and the newly added entries are merged together and sorted alphabetically (but the comment block is kept untouched), and then printed to standard output. Usage ----- scripts/mailmapper prints the mailmapping to standard output. scripts/mailmapper > tmp; mv tmp .mailmap will be useful for updating '.mailmap' file. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* add .mailmap for proper git-shortlog outputMasahiro Yamada2014-07-22-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first version of .mailmap created by hand. Please see "man git-shortlog" for what this commit is trying to do. Without this file, for example, "git shortlog -n -s" shows as follows: 2693 Wolfgang Denk <------ 1002 Stefan Roese <------ 811 wdenk <------ 808 Mike Frysinger 806 Simon Glass [snip] 177 Matthias Fuchs 154 stroese <------ 153 Timur Tabi And then, with this file, it shows as follows: 3504 Wolfgang Denk <------ 1156 Stefan Roese <------ 808 Mike Frysinger 806 Simon Glass Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Stefan Roese <sr@denx.de> Cc: Wolfgang Denk <wd@denx.de>
* whitespace cleanupsPavel Machek2014-07-22-5/+5
| | | | | | Whitespace cleanups. Signed-off-by: Pavel Machek <pavel@denx.de>
* Makefile: fix tags target documentationIgor Grinberg2014-07-22-1/+2
| | | | | | | | Replace the TAGS target name by the actual ctags target name. Also, add etags target documentation. Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* Makefile: fix ctags/etags clean targetsIgor Grinberg2014-07-22-1/+1
| | | | | | | | | | | | | | Commit efcf861 (kbuild: use scripts/Makefile.clean) refactored the cleaning targets and accidentially replaced the actually generated "ctags" and "etags" files in the file list by "tags" and "TAGS". "tags" and "TAGS" are not part of the Makefile build targets and therefore should not be a part of the list for clean targets. Substitute the actually generated files instead, to fix the clean targets behavior. Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* Makefile: fix the {c, e}tags/cscope build targetsIgor Grinberg2014-07-22-2/+2
| | | | | | | | | | | | | | | | Commit 9e41403 (kbuild: change out-of-tree build) changed the U-Boot build working directory to the output tree for the out-of-tree builds. This broke the {c,e}tags/cscope build targets as TAG_SUBDIRS variable collected directories based on assumption that the build working directory is the U-Boot source tree directory. Fix the {c,e}tags/cscope build targets by adding the $(srctree) prefix. Also, remove the $(obj) prefix from the etags build target to finish the $(obj) prefix removal started by the same commit. Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* rpi_b: handle import of environments in files with CRLF as line endingsAlexander Holler2014-07-22-1/+1
| | | | | | Use the new option -r for env import. Signed-off-by: Alexander Holler <holler@ahsoftware.de>
* am335x_evm: handle import of environments in files with CRLF as line endingsAlexander Holler2014-07-22-1/+1
| | | | | | Use the new option -r for env import. Signed-off-by: Alexander Holler <holler@ahsoftware.de>
* omap3_beagle: handle import of environments in files with CRLF as line endingsAlexander Holler2014-07-22-1/+1
| | | | | | Use the new option -r for env import. Signed-off-by: Alexander Holler <holler@ahsoftware.de>
* Add option -r to env import to allow import of text files with CRLF as line ↵Alexander Holler2014-07-22-9/+36
| | | | | | | | | | | | | | endings When this option is enabled, CRLF is treated like LF when importing environments from text files, which means CRs ('\r') in front of LFs ('\n') are just ignored. Drawback of enabling this option is that (maybe exported) variables which have a trailing CR in their content will get imported without that CR. But this drawback is very unlikely and the big advantage of letting Windows user create a *working* uEnv.txt too is likely more welcome. Signed-off-by: Alexander Holler <holler@ahsoftware.de>
* h2200: Disable SHA256 on FIT imagesTom Rini2014-07-22-0/+1
| | | | | | | This board is close in binary size to one of its hard limits, so disable SHA256 FIT image support to gain some breathing room. Signed-off-by: Tom Rini <trini@ti.com>
* lib/time.c cleanupsPavel Machek2014-07-22-8/+10
| | | | | | | | | | As I initially suspected overflow in time handling, I took a detailed look at lib/time.c. This adds comments about units being used, reduces amount of type casting being done, and makes __udelay() always wait at least one tick. (Current code could do no delaying at all for short delays). Signed-off-by: Pavel Machek <pavel@denx.de>
* common: cmd_ide: use __weak and add prototypesJeroen Hofstee2014-07-22-38/+17
| | | | | | | | | | | clang chokes about the concept of having an alias to an always_inlined function. gcc likely just ignores the always inlined since binary sizes are equal before and after this patch. Convert the aliases to weak functions and provide missing prototypes. cc: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* common: cmd_ide: remove PIO modeJeroen Hofstee2014-07-22-84/+0
| | | | | | | | Since no board defines CONFIG_TUNE_PIO this is just dead code, so remove it. cc: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* serial: ns16550: use a const variable instead of macroMasahiro Yamada2014-07-22-3/+3
| | | | | | | | Just for type checking. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Marek Vasut <marex@denx.de> Acked-by: Marek Vasut <marex@denx.de>
* serial: ns16550: use DIV_ROUND_CLOSEST macro to compute the divisorMasahiro Yamada2014-07-22-7/+3
| | | | | | | | | The function still returns the same value. The comment block is no longer necessary because our intention is clear enough by using DIV_ROUND_CLOSEST() macro. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* serial: ns16550: drop CONFIG_OMAP1610 from the special caseMasahiro Yamada2014-07-22-6/+0
| | | | | | | | | | | | | | | | | | | If CONFIG_OMAP1610 is defined, the code returning the fixed value (26) is enabled. But this case is covered by the following code. (CONFIG_SYS_NS16550_CLK + (gd->baudrate * (MODE_X_DIV / 2))) / (MODE_X_DIV * gd->baudrate) = (48000000 + (115200 * (16 / 2))) / (16 * 115200) = 48921600 / 1843200 = 26 The "#ifdef CONFIG_OMAP1610" was added by commit 6f21347d more than ten years ago. In those days, the divide-and-round was not used. I guess that is why this weird code was added here. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Tom Rini <trini@ti.com> Cc: Rishi Bhattacharya <rishi@ti.com>
* bootp can use mdelayPavel Machek2014-07-22-3/+2
| | | | | | | Cleanup bootp code by using mdelay. Signed-off-by: Pavel Machek <pavel@denx.de> Acked-by: Marek Vasut <marex@denx.de>
* spl: nand: read only in the size of image_header on the first accessMasahiro Yamada2014-07-22-3/+3
| | | | | | | | | | | For the same reason as in commit 50c8d66d, all the remaining CONFIG_SYS_NAND_PAGE_SIZE in common/spl/spl_nand.c can be replaced with sizeof(*header). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Tim Harvey <tharvey@gateworks.com> Cc: Scott Wood <scottwood@freescale.com> Cc: Stefano Babic <sbabic@denx.de>
* catch wrong load address passed to fatload / ext2loadPavel Machek2014-07-22-1/+4
| | | | | | | | If filename is passed instead of address to ext2load or fatload, u-boot silently accepts that, and uses 0 for load address and default filename from environment. That is confusing, display help instead. Signed-off-by: Pavel Machek <pavel@denx.de>
* Fix help text of ext2load and fatload.Pavel Machek2014-07-22-2/+2
| | | | | | | Fix help text of ext2load and fatload to match code in fs/fs.c Signed-off-by: Pavel Machek <pavel@denx.de> Reviewed-by: Marek Vasut <marex@denx.de>
* tools: compiler.h: add missing time.hJeroen Hofstee2014-07-22-0/+1
| | | | | | | | | | genimg_print_time uses time_t, but time.h is never included. Linux gets away with this since types.h includes time.h. Explicitly include the header file so building on e.g. FreeBSD also works. cc: Tom Rini <trini@ti.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* driver/usb: include upper/lower_32_bits() from linux/compat.hLijun Pan2014-07-22-4/+2
| | | | | | | upper_32_bits() and lower_32_bits() have been ported into linux/compat.h. Start use them now in drivers/usb/host/xhci.h. Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
* linux/compat.h: port lower_32_bits and upper_32_bits from LinuxLijun Pan2014-07-22-0/+19
| | | | | | | | | | | | | | [backport from linux commit 204b885e and 218e180e7] 64 bit processors are becomming more and more popular. lower_32_bits and upper_32_bits save our labor doing shifts/manipulations like (u32)(n) and (u32)((n) >> 32). They are good helpers in both little and big endian cases. Port these two functions here from Linux:include/linux/kernel.h, cater the comment message to little/big endian cases. Later on, developers could include linux/compat.h if they want to use these two functions. Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
* sparc: merge LEON2 and LEON3 linker scriptsMasahiro Yamada2014-07-22-146/+2
| | | | | | | | | | | | | | | | | | There is only one line diff between LEON2 and LEON3 linker scripts: - arch/sparc/cpu/leon2/start.o (.text) + arch/sparc/cpu/leon3/start.o (.text) They can be written in the same way: */start.o (.text) So, board/gaisler/grsim_leon2/u-boot.lds and arch/sparc/cpu/leon3/u-boot.lds can be merged into arch/sparc/cpu/u-boot.lds. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Daniel Hellstrom <daniel@gaisler.com>
* sparc: merge LEON3 linker scriptsMasahiro Yamada2014-07-22-431/+0
| | | | | | | | | | | | | | | | The linker scripts of LEON3 - board/gaisler/grsim/u-boot.lds - board/gaisler/gr_cpci_ax2000/u-boot.lds - board/gaisler/gr_ep2s60/u-boot.lds - board/gaisler/gr_xc3s_1500/u-boot.lds are the same (except cosmetic differences such as indentation). This commit merges them into arch/sparc/cpu/leon3/u-boot.lds. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Daniel Hellstrom <daniel@gaisler.com>
* esd:cmd_loadpci.c: Switch from "do_source" to "source"Tom Rini2014-07-22-7/+1
| | | | | | | | Rather than calling do_source directly (which is not officially exported from cmd_source.c) call 'source' which is exported and requires a little less code to do so as well. Signed-off-by: Tom Rini <trini@ti.com>
* Merge branch 'master' of git://git.denx.de/u-boot-i2cTom Rini2014-07-21-2/+77
|\
| * fsl_i2c: add support for 3rd and 4th I2CShengzhou Liu2014-07-16-2/+20
| | | | | | | | | | | | Add support for 3rd and 4th I2C. Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
| * i2c, omap24xx: add i2c deblock sequenzHeiko Schocher2014-07-16-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a bus busy is detected when intializing the driver, toggle 9 times the scl pin. Therefore enable the test mode of the controller, in which the scl, sda pins can be controlled manually. Tested on the siemens boards pxm2, rut and dxr2. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Tom Rini <trini@ti.com> Cc: Hannes Petermaier <oe5hpm@oevsv.at> Cc: Lubomir Popov <lpopov@mm-sol.com> Cc: Steve Sakoman <steve@sakoman.com> Cc: Sandeep Paulraj <s-paulraj@ti.com> Cc: Vincent Stehlé <v-stehle@ti.com> Cc: Samuel Egli <samuel.egli@siemens.com>
* | common: cmd_mii: fix printf format warningJeroen Hofstee2014-07-18-4/+4
| | | | | | | | | | | | | | | | The and operator implicitly upcasts the value to int, hence the format should expect an int type as well. (and make checkpatch happy) Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* | autoboot: add its own headerJeroen Hofstee2014-07-18-0/+1
| | | | | | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>