1
0
Fork 0
Commit Graph

7649 Commits (267541f776f1e2bec21681c6e39a4c93af9621cf)

Author SHA1 Message Date
Joe Hershberger 267541f776 env: Add support for access control to .flags
Add support for read-only, write-once, and change-default.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13 11:46:56 -07:00
Joe Hershberger fffad71bc4 env: Add a command to display details about env flags
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-13 11:46:56 -07:00
Joe Hershberger 30fd4fadb3 tools/env: Add environment variable flags support
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-13 11:46:56 -07:00
Joe Hershberger 2598090b7e env: Add environment variable flags
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-13 11:46:56 -07:00
Joe Hershberger e080d545f8 env: Add a silent env handler
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-13 11:46:56 -07:00
Joe Hershberger 849d5d9cda env: Add a console env handler
Remove the hard-coded console handler and use a callback instead

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13 11:46:56 -07:00
Joe Hershberger 1cf0a8b2fb env: Add a loadaddr env handler
Remove the hard-coded loadaddr handler and use a callback instead

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13 11:46:56 -07:00
Joe Hershberger 32057717e0 env: Add a baudrate env handler
Remove the hard-coded baudrate handler and use a callback instead

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13 11:46:55 -07:00
Joe Hershberger a9f51c9b43 env: Add a bootfile env handler
Remove the hard-coded bootfile handler and use a callback instead

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13 11:46:55 -07:00
Joe Hershberger 170ab11075 env: Add support for callbacks to environment vars
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-13 11:46:55 -07:00
Joe Hershberger be11235ab8 env: Hide '.' variables in env print by default
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-13 11:46:55 -07:00
Joe Hershberger ec8a252cd4 env: Use getenv_yesno() more generally
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-13 11:46:55 -07:00
Joe Hershberger 7afcf3a55b env: Refactor apply into change_ok
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-13 11:46:55 -07:00
Joe Hershberger c4e0057fa7 env: Refactor do_apply to a flag
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-13 11:46:54 -07:00
Joe Hershberger e772cb30f6 Make linux kernel string funcs available to tools
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-13 11:46:07 -07:00
Lukasz Majewski 9960d9a8bc gpt: Enable support for GPT partition table restoration at Samsung's Trats
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-13 11:46:03 -07:00
Lukasz Majewski 40684ddb83 gpt: Support for GPT (GUID Partition Table) restoration
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-13 11:46:02 -07:00
Chang Hyun Park fae2bf22a2 gpt: The leXX_to_int() calls replaced with ones defined at <compiler.h>
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-13 11:46:02 -07:00
Lukasz Majewski 9386f96ca9 part:efi: Move part_efi.h file to ./include
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-13 11:46:02 -07:00
Lukasz Majewski 3ec44111aa vsprintf:fix: Change type returned by ustrtoul
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-13 11:46:02 -07:00
Simon Glass 23b479b25c exynos: Enable hashing functions and EDID for smdk5250
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-11 13:18:14 -07:00
Vadim Bendebury 9ad557be2f Add console command to access io space registers
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-11 13:17:35 -07:00
Tom Wai-Hong Tam d46b5f7dcb edid: Library of EDID decode and print
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-11 13:17:34 -07:00
Simon Glass bf36c5d521 Add hash command to perform hashing using various algorithms
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-11 13:17:34 -07:00
Simon Glass 460408ef9a Add generic hash API
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-11 13:17:34 -07:00
Simon Glass b1f17bf5ff Add strcasecmp() and strncasecmp()
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-11 13:17:34 -07:00
Simon Glass ec7381fbf6 sha256: Use const where possible and add watchdog function
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-11 13:17:33 -07:00
Simon Glass a7d1d76579 sha1: Use const where possible, and unsigned for input len
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-11 13:17:33 -07:00
Kenneth Waters ff048ea916 Add a command to read raw blocks from a partition
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-11 13:17:33 -07:00
Anton Staaf 53fdc7ef2e Add gettime command
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-11 13:17:33 -07:00
Nikita Kiryanov 94740e4739 gpio: remove duplicate function signature
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-11 13:17:32 -07:00
Tom Rini fd4d564b3c Merge branch 'master' of git://git.denx.de/u-boot-x86 2012-12-07 08:47:59 -07:00
Luka Perkov 3fdf7596df Change e-mail address of Luka Perkov
Change e-mail address of Luka Perkov.

Signed-off-by: Luka Perkov <luka@openwrt.org>
CC: Luka Perkov <uboot@lukaperkov.net>
2012-12-07 08:47:52 -07:00
Simon Glass ac426b7290 x86: Fix coreboot config to boot on Chromebook
The config is current broken. It compiles but does not boot because IDE is
enabled. Remove all IDE options, and enable SCSI instead.

Also add a working boot command and Linux bootargs, and enable command
line editing to make it easier to work with.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-06 14:30:45 -08:00
Gabe Black d954a431ec x86: Turn on support for EFI's GPT in the coreboot config
This allows u-boot to figure out the partitions of a chrome-os install.

Signed-off-by: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-06 14:30:44 -08:00
Simon Glass cbca883c46 x86: coreboot: Enable video display
Enable the display on coreboot, using CFB.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-06 14:30:44 -08:00
Stefan Reinauer 300081aa68 x86: Emit port 80 post codes in show_boot_progress()
This helps us monitor boot progress and determine where U-Boot dies if
there are any problems.

Signed-off-by: Stefan Reinauer <reinauer@google.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-06 14:30:43 -08:00
Gabe Black 40fef04906 Introduce arch_phys_memset which works like memset but on physical memory
The default implementation of this function is just memset, but other
implementations will be needed when physical memory isn't accessible by
U-Boot using normal addressing mechanisms.

Signed-off-by: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-06 14:30:40 -08:00
Simon Glass 34d6057be1 x86: Enable CONFIG_CMD_ZBOOT for coreboot
Enable this option to support booting a zImage.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-06 14:30:40 -08:00
Simon Glass a7e6d5496c x86: Enable ICH6 GPIO controller for coreboot
Coreboot uses this controller to implement GPIO access.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-06 14:30:38 -08:00
Bill Richardson 55ae10f8db x86: gpio: Add GPIO driver for Intel ICH6 and later.
Implement <asm-generic/gpio.h> functions for Intel ICH6 and later.
Only GPIOs 0-31 are handled by this code.

Signed-off-by: Bill Richardson <wfrichar@chromium.org>

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-06 14:30:38 -08:00
Simon Glass e3ff797cdb cbfs: Add docbook template
This adds a docbook template for fs, and makes CBFS use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-06 13:56:39 -07:00
Simon Glass 2592075776 cbfs: Remove mention of CREDITS files
As requested by Wolfgang, remove references to CREDITS in the CBFS
files.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-06 13:56:38 -07:00
Matthias Fuchs 468ebf190a 4xx: Fix PCI memory mapping on CPCI405 boards
This patch fixes an issue with overlapping PCI regions
on boards with more than 64MB RAM.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-12-06 15:53:04 +01:00
Stefan Roese 13b4f63949 mpc5200: Add a3m071 board support
This patch adds support for the a3m071 board based on the
MPC5200.

Signed-off-by: Stefan Roese <sr@denx.de>
2012-12-05 17:31:23 +01:00
Tom Rini ce12a8c1a9 Merge branch 'master' of git://git.denx.de/u-boot-x86 2012-12-03 06:47:05 -07:00
Simon Glass a78d49473c x86: Define CONFIG_SYS_VSNPRINTF for coreboot
This option protects the printf() functions from overflow.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-11-30 13:44:05 -08:00
Simon Glass 420a2ca73f x86: Select stdio devices for coreboot
We want to support VGA, serial, USB keyboard and the Coreboot memory
console buffer.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-11-30 13:44:03 -08:00
Vadim Bendebury 98ab435f73 x86: Add CBMEM console driver for coreboot
This patch builds upon the recently introduced CBMEM console
feature of coreboot.

CBMEM console uses a memry area allocated by coreboot to store
the console output. The memory area has a certain structure,
which allows to determine where the buffer is, the buffer size
and the location of the pointer in the buffer. This allows
different phases of the firmware (rom based coreboot, ram based
coreboot, u-boot after relocation with this change) to keep
adding text to the same buffer.

Note that this patch introduces a new console driver and adds the
driver to the list of drivers to be used for console output, i.e.
it engages only after u-boot relocates. Usiong CBMEM console for
capturing the pre-relocation console output will be done under a
separate change.

>From Linux, run the cbmem.py utility (which is a part of the coreboot
package) to see the output, e.g.:

vvvvvvvvvvvvvvvvv
SCSI:  AHCI 0001.0300 32 slots 6 ports ? Gbps 0xf impl SATA mode
flags: 64bit ilck stag led pmp pio
...
Magic signature found
Kernel command line: "cros_secure  quiet loglevel=1 console=tty2...
^^^^^^^^^^^^^^^^^

Note that the entire u-boot output fits into the buffer only if
the coreboot log level is reduced from the most verbose. Ether
the buffer size will have to be increased, or the coreboot
verbosity permanently reduced.

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-11-30 13:44:03 -08:00
Nobuhiro Iwamatsu f3269ad4e8 include/linux/byteorder: Always defines __fswab64, __swab64p and __swab64s
When __BYTEORDER_HAS_U64__ is not defined, we got warning following:

-----
/tmp/include/linux/byteorder/little_endian.h: In function ā€˜__cpu_to_be64pā€™:
/tmp/include/linux/byteorder/little_endian.h:71:2: warning: implicit declaration of function ā€˜__swab64pā€™
		[-Wimplicit-function-declaration]
-----

Usually, __arch__swab64* required for __fswab64,  __swab64p and __swab64s
is defined.  Therefore, __BYTEORDER_HAS_U64__ is unnecessary.
This removes __BYTEORDER_HAS_U64__.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
CC: Kim Phillips <kim.phillips@freescale.com>
Reviewed-by: Kim Phillips <kim.phillips@freescale.com>
2012-11-30 07:15:04 -07:00