aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-05-01mmc: Define a constant for the maximum block sizeSimon Glass2-12/+16
The number 512 appears quite a bit in the mmc code. Add a constant for this so that it can be used here and in other parts of the code (e.g. SPL code which loads from mmc). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@google.com>
2013-05-01amcc-common.h: enable support for "env grep", "setexpr", and regex.Wolfgang Denk1-0/+3
Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Stefan Roese <sr@denx.de>
2013-05-01amcc-common.h: minor white space cleanupWolfgang Denk1-3/+3
Align some comments. Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Stefan Roese <sr@denx.de>
2013-05-01m28evk: enable "env grep" and regexp supportWolfgang Denk1-0/+3
Signed-off-by: Wolfgang Denk <wd@denx.de> Conflicts: include/configs/m28evk.h
2013-05-01m28evk: white space cleanupWolfgang Denk1-128/+128
Change all "#define<TAB>" sequences into "#define<SPACE>" Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Marek Vasut <marex@denx.de>
2013-05-01setexpr: add regex substring matching and substitutionWolfgang Denk1-3/+277
Add "setexpr name gsub r s [t]" and "setexpr name sub r s [t]" commands which implement substring matching for the regular expression <r> in the string <t>, and substitution of the string <s>. The result is assigned to the environment variable <name>. If <t> is not supplied, the previous value of <name> is used instead. "gsub" performs global substitution, while "sub" will replace only the first substring. Both commands are closely modeled after the gawk functions with the same names. Examples: - Generate broadcast address by substituting the last two numbers of the IP address by "255.255": => print ipaddr ipaddr=192.168.1.104 => setexpr broadcast sub "(.*\\.).*\\..*" "\\1255.255" $ipaddr broadcast=192.168.255.255 - Depending on keyboard configuration (German vs. US keyboard) a barcode scanner may initialize the MAC address as C0:E5:4E:02:06:DC or as C0>E5>4E>02>06>DC. Make sure we always have a correct value: => print ethaddr ethaddr=C0>E5>4E>02>06>DC => setexpr ethaddr gsub > : ethaddr=C0:E5:4E:02:06:DC - Do the same, but substitute one step at a time in a loop until no futher matches: => setenv ethaddr C0>E5>4E>02>06>DC => while setexpr ethaddr sub > : > do > echo ----- > done ethaddr=C0:E5>4E>02>06>DC ----- ethaddr=C0:E5:4E>02>06>DC ----- ethaddr=C0:E5:4E:02>06>DC ----- ethaddr=C0:E5:4E:02:06>DC ----- ethaddr=C0:E5:4E:02:06:DC ----- C0:E5:4E:02:06:DC: No match => print ethaddr ethaddr=C0:E5:4E:02:06:DC etc. To enable this feature, the CONFIG_REGEX option has to be defined in the board config file. Signed-off-by: Wolfgang Denk <wd@denx.de>
2013-05-01setexpr: simplify code, improve help messageWolfgang Denk1-7/+11
Simplify the argument checking for the "setexpr" command. This is done mainly to make future extensions easier. Also improve the help message for the one argument version of the command - this does not "load an address", but a value, which in this context may be a plain number or a pointer dereference. Signed-off-by: Wolfgang Denk <wd@denx.de>
2013-05-01"env grep" - add support for regular expression matchesWolfgang Denk3-11/+52
When CONFIG_REGEX is enabled, the new option "-e" becomes available which causes regular expression matches to be used. This allows for example things like these: - print all MAC addresses: => env grep -e eth.*addr eth1addr=00:10:ec:80:c5:15 ethaddr=00:10:ec:00:c5:15 - print all variables that have at least 2 colons in their value: => env grep -v -e :.*: addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panic=1 eth1addr=00:10:ec:80:c5:15 ethaddr=00:10:ec:00:c5:15 ver=U-Boot 2013.04-rc1-00289-g497746b-dirty (Mar 22 2013 - 12:50:25) etc. Signed-off-by: Wolfgang Denk <wd@denx.de>
2013-05-01Add SLRE - Super Light Regular Expression libraryWolfgang Denk4-0/+832
Downloaded from http://slre.sourceforge.net/ and adapted for U-Boot environment. Used to implement regex operations on environment variables. Code size is ~ 3.5 KiB on PPC. To enable this code, define the CONFIG_REGEX option in your board config file. Note: There are more recent versions of the SLRE library available at http://slre.googlecode.com ; unfortunately, the new code has a heavily reorked API which makes it less usable for our purposes: - the return code is strings, which are more difficult to process - we don't get any information any more which sub-string of the data was matched by the given regex - it is much more cumbersome to work with arbitrary expressions, where for example the number of substrings for capturing are not known at compile time Also, there does not seem to be any real changes or improvements of the functionality. Because of this, we deliberately stick with the older code. Note 2: the test code (built when SLRE_TEST is defined) was modified to allow for more extensive testing; now we can test the regexp matching on all lines on a text file (instead of the whole data in the file as a single block). Signed-off-by: Wolfgang Denk <wd@denx.de>
2013-05-01"env grep" - add options to grep in name, value, or both.Wolfgang Denk1-5/+33
Add options to "env grep" command: -n : search only the envrironment variable names -v : search only their values -b : search both names and values (= default) An option "--" will stop parsing options, so to print variables that contain the striing "- " please use: env grep -- "- " Or to print all environment varioables which have a '-' in their name, use: env grep -n -- - Signed-off-by: Wolfgang Denk <wd@denx.de>
2013-05-01"env grep" - reimplement command using hexport_r()Wolfgang Denk3-60/+40
Also drop hstrstr_r() which is not needed any more. The new code is way more flexible. Signed-off-by: Wolfgang Denk <wd@denx.de>
2013-05-01hashtable: preparations to use hexport_r() for "env grep"Wolfgang Denk3-12/+38
The output of "env grep" is unsorted, and printing is done by a private implementation to parse the hash table. We have all the needed code in place in hexport_r() alsready, so let's use this instead. Here we prepare the code for this, without any functional changes yet. Signed-off-by: Wolfgang Denk <wd@denx.de>
2013-05-01spl_mmc: cleanup variable typesPeter Korsgaard1-8/+9
block_read returns unsigned long, so it doesn't make sense to check for < 0. and neither does marking the header structure as const and then casting away the constness to load data into it. Also cleanup some unneeded pointer casting while we're at it. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com> Reviewed-by: Tom Rini <trini@ti.com>
2013-05-01sandbox: config: Enable CONFIG_FIT and CONFIG_CMD_FITSimon Glass1-0/+2
Enable these options to use FITs on sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01sandbox: fs: Add support for saving files to host filesystemSimon Glass4-4/+49
This allows write of files from the host filesystem in sandbox. There is currently no concept of overwriting the file and removing its existing contents - all writing is done on top of what is there. This means that writing 10 bytes to the start of a 1KB file will only update those 10 bytes, not truncate the file to 10 byte slong. If the file does not exist it is created. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01fs: Add support for saving data to filesystemsSimon Glass2-0/+76
Add a new method for saving that filesystems can implement. This mirrors the existing load method. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01sandbox: Support 'source' commandSimon Glass1-4/+7
Enhance the source command to work with sandbox, by using map_sysmem() to convert a ulong address into a pointer. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01sandbox: Allow -c argument to provide a command listSimon Glass1-1/+1
This allows passing of entire scripts to sandbox with the -c argument, which is useful for testing. Commands can be delimited with a newline or semicolon. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01Revert "fdt- Tell the FDT library where the device tree is"Simon Glass1-8/+0
This reverts commit 3b73459ea3421e9f8c6c8c62e1d3fe458ca5bc56. In practice it doesn't seem like a good idea to make the the working FDT point to the control FDT. Now that we can access the control FDT using the 'fdt' command, there is no need for this feature. Remove it. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01fdt: Skip checking FDT if the pointer is NULLSimon Glass1-1/+2
If we have no FDT, don't attempt to read from it. This allows sandbox to run without an FDT if required. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01sandbox: fdt: Support fdt command for sandboxSimon Glass1-3/+7
By using map_sysmem() we can get the fdt command to work correctly with sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01fdt: Allow fdt command to check and update control FDTSimon Glass1-13/+34
There is an existing fdt command to deal with the working FDT. Enhance this to support the control FDT also (CONFIG_OF_CONTROL). Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01Add getenv_hex() to return an environment variable as hexSimon Glass2-0/+28
This conversion is required in a number of places in U-Boot. Add a standard function to provide this feature, so we avoid all the different variations in the way it is coded. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01fdt: Add a parameter to fdt_valid()Simon Glass1-18/+20
At present this only checks working_fdt, but we want to check other FDTs also. So add the FDT to check as a parameter to fdt_valid(). Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01sandbox: Add CONFIG_OF_HOSTFILE to read FDT from host fileSimon Glass5-1/+70
With sandbox it is tricky to add an FDT to the image at build time (or later) since we build an ELF file, not a plain binary, and the address space of the whole U-Boot is not accessible in the emulated memory map of sandbox. Sandbox can read files directly from the host, though, so add an option to read an FDT from a host file on start-up. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01sandbox: Switch over to generic boardSimon Glass11-324/+66
Add generic board support for sandbox. and remove the old board init code. Select CONFIG_SYS_GENERIC_BOARD for sandbox now that this is supported. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
2013-05-01sandbox: Provide a way to map from host RAM to U-Boot RAMSimon Glass3-0/+13
In many cases, pointers to memory are passed around, and these pointers refer to U-Boot memory, not host memory. This in itself is not a problem. However, in a few places, we cast that pointer back to a ulong (being a U-Boot memory address). It is possible to convert many of these cases to avoid this. However there are data structures (e.g. struct bootm_headers) which use pointers. We could with a lot of effort adjust the structs and all code that uses them to use ulong instead of pointers. This seems like an unacceptable cost, since our objective with sandbox is to minimise the impact on U-Boot code while maximising the features available to sandbox. Therefore, create a map_to_sysmem() function which converts from a pointer to a U-Boot address. This can be used sparingly when needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01Trigger generic board error only when buildingSimon Glass2-2/+12
At present the generic board error can occur when configuring U-Boot, or during distclean, but this is incorrect. The existing autoconf.mk may come from an earlier U-Boot configuration which is about to be overwritten. Make the error conditional so that it will only be triggered when we are actually building U-Boot. This avoids a problem where the system is being reconfigured to remove CONFIG_SYS_GENERIC_BOARD on an architecture that does not support it. Currently this will print an error and require the manual removal of include/autoconf.mk. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-01Merge branch 'master' of git://git.denx.de/u-boot-i2cTom Rini1-0/+2
2013-05-01Merge branch 'microblaze' of git://www.denx.de/git/u-boot-microblazeTom Rini8-4/+126
2013-05-01post: fix I2C POST failure for devices in CONFIG_SYS_POST_I2C_IGNORESAnatolij Gustschin1-0/+2
Devices in CONFIG_SYS_POST_I2C_IGNORES list may be absent and the rule is not to report I2C POST failure for devices in this list. Currently this doesn't work since probing for these devices isn't done and thus they are not marked as successfully probed. Ignore optional devices when checking for devices that didn't respond. Signed-off-by: Anatolij Gustschin <agust@denx.de>
2013-04-30watchdog: Add support for Xilinx Microblaze watchdogMichal Simek8-0/+114
Watchdog can be used on Microblaze, PPC and Zynq hw designs. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com>
2013-04-30microblaze: Disable all cpu features before resetMichal Simek1-1/+2
Fix microblaze soft reset function and disable all cpu features. Especially disable caches because IRQs were off by disable_interrupts(). Reported-by: John Williams <john.williams@xilinx.com> Signed-off-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-04-30microblaze: Enable netconsoleMichal Simek1-1/+8
Setup environment and enable netconsole. Signed-off-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com>
2013-04-30microblaze: Fix reset functionMichal Simek1-2/+2
Remove CONFIG_SYS_RESET_ADDRESS macro. It was there from historical point of view when soft reset was just jump to u-boot text start (not used right now). Signed-off-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-04-29git-mailrc: Add trini shortcutMichal Simek1-1/+2
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. Easier for using with patman. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-04-22Merge branch 'master' of git://www.denx.de/git/u-boot-cfi-flashTom Rini2-0/+20
2013-04-22Merge branch 'master' of git://www.denx.de/git/u-boot-ppc4xxTom Rini11-10/+343
2013-04-22flash: Add optional verify-after-write featureStefan Roese2-0/+20
Sometimes it might make sense to verify the written data to NOR flash. This patch adds this feature. To enable this verify-after-write, you need to define CONFIG_FLASH_VERIFY in your board config header. Please note that this option is useless in nearly all cases, since such flash programming errors usually are detected earlier while unprotecting/erasing/programming. Please only enable this option if you really know what you are doing. Signed-off-by: Stefan Roese <sr@denx.de>
2013-04-22ppc4xx: Add lcd4_lwmon5 supportStefan Roese4-6/+142
This patch adds the fast booting LWMON5 derivat "lcd4_lwmon5". Its a stripped down version of the full blown lwmon5 support, without ECC, USB, POST and some other stuff. It used the newly introduced SPL infrastrucure for SPL from NOR flash booting on the PPC4xx. By setting the environment variable "boot_os" to "yes", Linux will be started from the SPL version. If not, the "normal" U-Boot will be started. Signed-off-by: Stefan Roese <sr@denx.de>
2013-04-22Makefile: Add target for combined u-boot.img & spl/u-boot.binStefan Roese2-0/+16
This new make target "u-boot-img-spl-at-end.bin" consists of the the real, full-blown U-Boot image and the U-Boot SPL binary directly attached to it. The full-blown U-Boot image has the mkimage header included, with its load-address and entry-point. This will be used by the upcoming lwmon5 PPC440EPx derivate board port. Signed-off-by: Stefan Roese <sr@denx.de>
2013-04-22ppc4xx: Add SPL supportStefan Roese5-4/+185
This patch adds SPL booting support (NOR flash) for the PPC4xx platforms. This SPL booting (Falcon mode) will be used by the upcoming lcd4_lwmon5 board port (lwmon5 variant). Signed-off-by: Stefan Roese <sr@denx.de>
2013-04-19feature-removal-schedule.txt: Add CONFIG_SYS_MTEST_START/ENDTom Rini1-0/+12
With 'mtest' no longer a default command, we will have unused defines which should be removed for the v2013.10 release. Signed-off-by: Tom Rini <trini@ti.com>
2013-04-19config_cmd_default.h: Remove CONFIG_CMD_MEMTESTTom Rini2-18/+0
As per doc/feature-removal-schedule.txt, remove CONFIG_CMD_MEMTEST from default list of commands. Signed-off-by: Tom Rini <trini@ti.com>
2013-04-19Prepare v2013.04v2013.04Tom Rini1-1/+1
Signed-off-by: Tom Rini <trini@ti.com>
2013-04-19crc32: Correct endianness of crc32 resultSimon Glass1-1/+4
When crc32 is handled by the hash library, it requires the data to be in big-endian format, since it reads it byte-wise. Thus at present the 'crc32' command reports incorrect data. For example, previously we might see: Peach # crc32 40000000 100 CRC32 for 40000000 ... 400000ff ==> 0d968558 but instead with the hash library we see: Peach # crc32 40000000 100 CRC32 for 40000000 ... 400000ff ==> 5885960d Correct this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@google.com>
2013-04-18patman: fix gitutil for decorationsAndreas Bießmann2-4/+7
The git config parameter log.decorate is quite useful when working with git. Patman, however can not handle the decorated output when parsing the commit. To prevent this use the '--no-decorate' switch for git-log. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Simon Glass <sjg@chromium.org>
2013-04-18Merge branch 'master' of git://git.denx.de/u-boot-arm into HEADTom Rini33-92/+467
Quick manual fixup to merge the USB boot related defines and TPM related defines. Conflicts: include/configs/exynos5250-dt.h Signed-off-by: Tom Rini <trini@ti.com>
2013-04-17fdt: Ensure that libfdt_env.h comes from U-BootSimon Glass1-1/+2
When building host utilities, we include libfdt.h from the host, not from U-Boot. This in turn brings in libfdt_env.h from the host, which can mess up the types and cause a build failure, depending on the host environment. To fix this, force inclusion of U-Boot's libfdt_env.h so that the types are correct. Another way to fix this is to use -nostdinc and -idirafter to ensure that system includes are included after U-Boot ones. Unfortunately this means that U-Boot's errno.h gets included instead of the system one. This in turn requires a hack to errno.h to redirect things, so all in all the solution in this patch is probably cleaner. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-04-17mmc: check the revision for sd3.0Jaehoon Chung2-0/+3
Support to check whether the SD3.0 or not. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Rommel Custodio <sessyargc@gmail.com>