aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-12-13env: Add support for access control to .flagsJoe Hershberger
Add support for read-only, write-once, and change-default. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Add a command to display details about env flagsJoe Hershberger
Similar to the env callback command, this will show details about the options available, the static list, and the currently active variables. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13tools/env: Add environment variable flags supportJoe Hershberger
Currently just validates variable types as decimal, hexidecimal, boolean, ip address, and mac address. Call env_acl_validate_setenv_params() from setenv() in fw_env.c. If the entry is not found in the env .flags, then look in the static one. This allows the env to override the static definitions, but prevents the need to have every definition in the environment distracting you. Need to build in _ctype for isdigit for Linux. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Add environment variable flagsJoe Hershberger
Currently just validates variable types as decimal, hexidecimal, boolean, ip address, and mac address. If the entry is not found in the env ".flags", then look in the static one. This allows the env to override the static definitions, but prevents the need to have every definition in the environment distracting you. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Add a silent env handlerJoe Hershberger
The silent variable now updates the global data flag anytime it is changed as well as after the env relocation (in case its value is different from the default env in such cases as NAND env) Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Add a console env handlerJoe Hershberger
Remove the hard-coded console handler and use a callback instead Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Add a loadaddr env handlerJoe Hershberger
Remove the hard-coded loadaddr handler and use a callback instead Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Add a baudrate env handlerJoe Hershberger
Remove the hard-coded baudrate handler and use a callback instead Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Add a bootfile env handlerJoe Hershberger
Remove the hard-coded bootfile handler and use a callback instead Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Add a command to view callbacksJoe Hershberger
The callbacks can be bound, but are otherwise invisible. Add a command to show what callbacks are available. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> !!! fix callback command
2012-12-13env: Add support for callbacks to environment varsJoe Hershberger
Add support for per-variable callbacks to the "hashtable" functions. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> !!!fix comment in callback
2012-12-13env: Hide '.' variables in env print by defaultJoe Hershberger
When printing all variables with env print, don't print variables that begin with '.'. If env print is called with a '-a' switch, then include variables that begin with '.' (just like the ls command). Variables printed explicitly will be printed even without the -a. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Use getenv_yesno() more generallyJoe Hershberger
Move the getenv_yesno() to env_common.c and change most checks for 'y' or 'n' to use this helper. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Refactor apply into change_okJoe Hershberger
Move the read of the old value to inside the check function. In some cases it can be avoided all together and at the least the code is only called from one place. Also name the function and the callback to more clearly describe what it does. Pass the ENTRY instead of just the name for direct access to the whole data structure. Pass an enum to the callback that specifies the operation being approved. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Consolidate common code in hsearch_r()Joe Hershberger
The same chunk of code was replicated in two places and the following changes will make that chunk grow a bit, so combine into a static func. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Refactor do_apply to a flagJoe Hershberger
Use a flag in hsearch_r for insert mode passed from import to allow the behavior be different based on use. Now that "do_check" is called for all imports, ensure console init is complete before updating the console on relocation import Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13Make linux kernel string funcs available to toolsJoe Hershberger
isspace() and strim() are not in the typical user-mode string.h, so put them in a separate compilation unit so that they can be built into tools that need them independent of the other common string functions. This allows code shared by u-boot and the linux user-mode tools to link. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13gpt: Enable support for GPT partition table restoration at Samsung's TratsLukasz Majewski
Enable support for GPT partition table restoration at Samsung's Trats development board. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> CC: Minkyu Kang <mk7.kang@samsung.com>
2012-12-13gpt: Support for new "gpt" commandPiotr Wilczek
New command - "gpt" is supported. It restores the GPT partition table. It looks into the given environment variable for partitions definition. It can be enabled at target configuration file with CONFIG_CMD_GPT. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-13gpt: Support for GPT (GUID Partition Table) restorationLukasz Majewski
The restoration of GPT table (both primary and secondary) is now possible. Function 'gpt_restore' presents example of partition restoration process. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-13gpt: The leXX_to_int() calls replaced with ones defined at <compiler.h>Chang Hyun Park
Custom definitions of le_XX_to_int functions have been replaced with standard ones, defined at <compiler.h> Replacement of several GPT related structures members with ones indicating its endianness and proper size. Signed-off-by: Chang Hyun Park <heartinpiece@outlook.com> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-13gpt:doc: GPT (GUID Partition Table) documentationLukasz Majewski
Documentation of the GPT format. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-13part:efi: Move part_efi.h file to ./includeLukasz Majewski
This move is necessary to export gpt header and GPT partition entries to be used with other commands or subsystems. Additionally the part_efi.h file has been cleaned-up to supress checkpatch's warnings. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-13vsprintf:fix: Change type returned by ustrtoulLukasz Majewski
The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned long type (as its name implies). Up till now it had returned int, which might cause problems with large numbers (GiB range), when interpreted as U2 signed numbers. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-12Merge branch 'master' of git://git.denx.de/u-boot-mipsTom Rini
2012-12-12mips: serial: Fix busted manual relocationJoe Hershberger
serial_initialize() must be called after relocation to adjust the pointers to putc(), getc(), etc. This is busted ever since the serial driver-model-ification series. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2012-12-12MIPS: constify mips_io_port_baseDaniel Schwierzeck
mips_io_port_base is exported as 'extern const unsigned long mips_io_port_base;' in arch/mips/include/asm/io.h. Thus make the variable const too. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2012-12-11cmd:spl:fix: Prevent from a build error on boards, which don't support FDTƁukasz Majewski
Do not compile in FDT related code, when it is not supported. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Stefano Babic <sbabic@denx.de>
2012-12-11exynos: Enable hashing functions and EDID for smdk5250Simon Glass
Enable SHA1/SHA256 hashing and the hash command. Also enable EDID support for reading from an LCD. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11tpm: Add TPM stress testLuigi Semenzato
Add a simple command to stress-test a TPM (Trusted Platform Module). Signed-off-by: Luigi Semenzato <semenzato@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11console: Enable function to display console infoSimon Glass
The CONFIG_SYS_CONSOLE_INFO_QUIET option should suppress the console information, but allow boards to display it later if required. Adjust the code to support this. This is used to avoid printing the information while the LCD display is not ready, since it only becomes ready when stdio init is complete. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11Add console command to access io space registersVadim Bendebury
Provide u-boot console functions to access IO space registers. A no thrills implementation, accessing one register at a time. For example: boot > iod 80 0080: 00000094 boot > iod.w 80 0080: 0094 boot > iod.b 80 0080: 94 boot > iow.b 0x80 12 boot > iod 0x80 0080: 00000012 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11fdt: edid: Enable fdt_add_edid() function when CONFIG_LCD definedTom Wai-Hong Tam
This function can be used for LCDs as well as monitors. Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11edid: Add I2C command for printing the EDIDTom Wai-Hong Tam
Add a single command to read the EDID information over I2C. For example: SMDK5250 # i2c dev 7 Setting bus to 7 SMDK5250 # i2c edid 50 EDID version: 1.4 Product ID code: 305c Manufacturer: AUO Serial number: 00000000 Manufactured in week: 0 year: 2011 Video input definition: digital signal, voltage level 0, blank to black Monitor is non-RGB Maximum visible display size: 26 cm x 14 cm Power management features: no active off, no suspend, no standby Estabilished timings: Standard timings: 1366x768 60 Hz (detailed) 1366x768 60 Hz (detailed) Monitor ID: 2VD2K.B116XW Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11edid: Library of EDID decode and printTom Wai-Hong Tam
This implements a library for accessing EDID data from an LCD panel. This is used to obtain information about the panel such as its resolution and type. This is a tidied-up version of the original code pulled from https://github.com/ynezz/u-boot-edid. The changes we made are: - removed bit fields in the struct; - removed endianness cases in the struct; - fixed some wrong definitions; - fixed to fit 80 columns; - fixed some code styles. Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11Add hash command to perform hashing using various algorithmsSimon Glass
This new command supports hashing SHA1 and SHA256. It could be extended to others such as MD5 and the CRC algorithms. The syntax is modeled on those: hash <algorithm> <address> <length> [*<dest_addr> | <dest_envvar>] to calculate a hash, and: hash -v <algorithm> <address> <length> [*<verify_addr> | <verify_envvar>] to verify a hash. Use CONFIG_CMD_HASH to enable the command, CONFIG_SHA1 to enable SHA1 and CONFIG_SHA256 to enable SHA256. The existing sha1sum command remains. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11sha1sum: Use generic hash layerSimon Glass
Update the code to use the hash layer instead of local code. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11Add generic hash APISimon Glass
We have a SHA1 command and want to add a SHA256 command also. Instead of duplicating the code, create a generic hash API which can process commands for different algorithms. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11Add strcasecmp() and strncasecmp()Simon Glass
strncasecmp() is present as strnicmp() but disabled. Make it available and define strcasecmp() also. There is a only a small performance penalty to having strcasecmp() call strncasecmp(), so do this instead of a standalone function, to save code space. Update the prototype in arch-specific headers as needed to avoid warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11sha256: Use const where possible and add watchdog functionSimon Glass
In preparation for making the hash function common, we may as well use const where we can. Also add a watchdog version of the hashing function. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11sha1: Use const where possible, and unsigned for input lenSimon Glass
In preparation for making the hash function common, we may as well use const where we can. Also the input length cannot be negative, but may be very large, so use unsigned. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11stdio: remove useless strncpyVincent Palatin
The name is already copied when we memcpy() the whole structure. This is because struct stdio_dev has this field: char name[16]; /* Device name */ So the data is inline, rather than being a pointer. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11Fix use of conditional LMBSimon Glass
This code was not guarded with CONFIG_LMB so failed to build on x86. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11Add a command to read raw blocks from a partitionKenneth Waters
Sometimes data is on a block device and within a partition, but not in a particular filesystem. This commands permits reading raw data from a partition. Signed-off-by: Kenneth Waters <kwaters@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11Add gettime commandAnton Staaf
Gettime returns the current timer value. If CONFIG_SYS_HZ is defined then the timer value is also converted to seconds. Tegra20 (SeaBoard) # gettime Timer val: 7754 Seconds : 7 Remainder : 754 sys_hz = 1000 There has been some discussion about whether this is useful enough to be included in U-Boot. The following boards do not have CONFIG_SYS_HZ defined: M52277EVB M52277EVB_stmicro M53017EVB M54418TWR M54418TWR_nand_mii M54418TWR_nand_rmii M54418TWR_nand_rmii_lowfreq M54418TWR_serial_mii M54418TWR_serial_rmii Signed-off-by: Anton Staaf <robotboy@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11Add new bootstage step for the main loopSimon Glass
Mark when we get to the main loop. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-11gpio: remove duplicate function signatureNikita Kiryanov
gpio_request() appears twice in asm-generic/gpio.h Remove one of the definitions. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
2012-12-11designware_i2c.h: Define IC_CLK only if not already defined in config fileArmando Visconti
Signed-off-by: Armando Visconti <armando.visconti@st.com>
2012-12-11designware_i2c.h: Fixed the correct values for SCL low/high timeArmando Visconti
Signed-off-by: Armando Visconti <armando.visconti@st.com>
2012-12-11designware_i2c: Fixed the setting of the i2c bus speedArmando Visconti
There are three couple (hcnt/lcnt) of registers for each speed (SS/FS/HS). The driver needs to set the proper couple of regs according to what speed we are setting. Signed-off-by: Armando Visconti <armando.visconti@st.com>