Tom Rini [Mon, 24 Nov 2014 17:01:48 +0000 (12:01 -0500)]
Merge git://git.denx.de/u-boot-dm
Conflicts:
drivers/serial/serial-uclass.c
Signed-off-by: Tom Rini <trini@ti.com>
Tom Rini [Mon, 24 Nov 2014 17:00:00 +0000 (12:00 -0500)]
Merge git://git.denx.de/u-boot-x86
Conflicts:
arch/x86/cpu/Makefile
Signed-off-by: Tom Rini <trini@ti.com>
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:39 +0000 (14:39 -0800)]
sandbox: script for testing sandbox/ext4/fat/fs commands
Test size/read/write commands in a sandbox environment.
Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:38 +0000 (14:39 -0800)]
fs: API changes enabling extra parameter to return size of type loff_t
The sandbox/ext4/fat/generic fs commands do not gracefully deal with files
greater than 2GB. Negative values are returned in such cases.
To handle this, the fs functions have been modified to take an additional
parameter of type "* loff_t" which is then populated. The return value
of the fs functions are used only for error conditions.
Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Update board/gdsys/p1022/controlcenterd-id.c,
drivers/fpga/zynqpl.c for changes]
Signed-off-by: Tom Rini <trini@ti.com>
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:37 +0000 (14:39 -0800)]
sandbox: Prepare API change for files greater than 2GB
Change the internal sandbox functions to use loff_t for file offsets.
Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:36 +0000 (14:39 -0800)]
ext4: Prepare API change for files greater than 2GB
Change the internal EXT4 functions to use loff_t for offsets.
Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Update common/spl/spl_ext.c]
Signed-off-by: Tom Rini <trini@ti.com>
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:35 +0000 (14:39 -0800)]
fat: Prepare API change for files greater than 2GB
Change the internal FAT functions to use loff_t for offsets.
Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Fix fs/fat/fat.c for min3 updates]
Signed-off-by: Tom Rini <trini@ti.com>
Tom Rini [Sat, 22 Nov 2014 13:11:08 +0000 (08:11 -0500)]
board/esd/common/auto_update.c: Use <flash.h>
A number of prototypes here are now found in <flash.h>. use.
Signed-off-by: Tom Rini <trini@ti.com>
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:34 +0000 (14:39 -0800)]
sandbox: Use md5sum and fatwrite to enable testing of fs commands
Enable md5sum to obtain the MD5 of the read and written files to check
their contents for validity.
Use map_sysmem() to map buffer in a sandbox environment.
Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Daniel Schwierzeck [Sat, 15 Nov 2014 22:46:53 +0000 (23:46 +0100)]
common/board_f: fix gcc warning on MIPS64
This fixes following warning when compiled with MIPS64
common/board_f.c: In function 'display_text_info':
common/board_f.c:150:2: warning: format '%X' expects argument i
of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat=]
debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n",
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Daniel Schwierzeck [Sat, 15 Nov 2014 22:46:52 +0000 (23:46 +0100)]
common/board_f: add setup of initial stack frame for MIPS
The MIPS specific setup of the initial stack frame was not
ported to generic board_f.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Masahiro Yamada [Thu, 13 Nov 2014 10:29:09 +0000 (19:29 +0900)]
spl: fix descending condition to drivers/mtd/nand/
SPL should not reference CONFIG_CMD_NAND to decide whether or not
it should build drivers/mtd/nand. CONFIG_CMD_NAND should be only
used to select the NAND utility command on the command parser.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Masahiro Yamada [Thu, 13 Nov 2014 10:29:08 +0000 (19:29 +0900)]
commands: add more command entries in Kconfig
This commit adds some of command entries (CONFIG_CMD_*) to
cover include/config_cmd_default.h and a little extra.
Because U-Boot supports lots of commands, they should be categorized
according to their usage.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Masahiro Yamada [Thu, 13 Nov 2014 10:29:07 +0000 (19:29 +0900)]
hush: add CONFIG_HUSH_PARSER to Kconfig
The README file states that the macros beginning with "CONFIG_SYS_"
depend on the hardware etc. and should not be meddled with if you do
not what you're doing.
We have already screwed up with this policy; we have given the prefix
"CONFIG_SYS_" to many user-selectable configurations.
Here, "CONFIG_SYS_HUSH_PARSER" is one of them. Users can enable it
if they want to use a more powerful command line parser, or disable it
if they only need a simple one.
This commit attempts to rename CONFIG_SYS_HUSH_PARSER to
CONFIG_HUSH_PARSER and move it to Kconfig.
Every board maintainer is expected to enable CONFIG_HUSH_PARSER
(= add "CONFIG_HUSH_PARSER=y" to his defconfig file) and remove
"#define CONFIG_SYS_HUSH_PARSER" from his header file.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Masahiro Yamada [Thu, 13 Nov 2014 10:29:06 +0000 (19:29 +0900)]
FIT: add some FIT configurations to Kconfig
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Masahiro Yamada [Thu, 13 Nov 2014 09:43:52 +0000 (18:43 +0900)]
config: remove redundant CONFIG_SYS_PROMPT defines
Since commit
0defddc851ed (config: Add a default CONFIG_SYS_PROMPT),
each board header does not need to define CONFIG_SYS_PROMPT
as long as it uses the default prompt "=> ".
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Masahiro Yamada [Thu, 13 Nov 2014 03:28:43 +0000 (12:28 +0900)]
tegra: do not descend into empty directories
Some tegra makefiles only contain a dummy line to generate
a built-in.o. Let's do not descend into such directories.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Warren <twarren@nvidia.com>
Cc: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Thu, 13 Nov 2014 03:28:42 +0000 (12:28 +0900)]
kbuild: use SoC-specific CONFIG to descend into SoC directory
Use "obj-$(CONFIG_FOO) += foo/" where it is possible.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Masahiro Yamada [Thu, 13 Nov 2014 03:28:41 +0000 (12:28 +0900)]
x86: use CONFIG_SYS_COREBOOT to descend into coreboot/ directory
The references of CONFIG_SYS_COREBOOT in arch/x86/cpu/coreboot/Makefile
are redundant because the build system descends into the directory
only when CONFIG_SYS_COREBOOT is defined.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Thu, 13 Nov 2014 03:28:40 +0000 (12:28 +0900)]
kbuild: Descend into SOC directory from CPU directory
Some CPUs of some architectures have SOC directories.
At present, the build system directly descends into SOC directories
from the top Makefile, but it should generally descend into each
directory from its parent directory.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Thierry Reding [Thu, 13 Nov 2014 01:26:50 +0000 (18:26 -0700)]
Add pr_fmt() macro
This macro can be overridden in source files (before including common.h)
and can be used to specify a prefix for debug and error messages. An
example of how to use this is shown below:
#define pr_fmt(fmt) "foo: " fmt
#include <common.h>
...
debug("bar");
The resulting message will read:
foo: bar
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Thierry Reding [Thu, 13 Nov 2014 01:26:49 +0000 (18:26 -0700)]
pci: Honour pci_skip_dev()
When enumerating devices, honour the pci_skip_dev() function. This can
be used by PCI controller drivers to restrict which devices will be
probed.
This is required by the NVIDIA Tegra PCIe controller driver, which will
fail with a data abort exception if an access is attempted to a device
number larger than 0 outside of bus 0. pci_skip_dev() is therefore
implemented to prevent any such accesses.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Thierry Reding [Thu, 13 Nov 2014 01:26:48 +0000 (18:26 -0700)]
pci: Abort early if bus does not exist
When listing the devices on a PCI bus, the current code will blindly try
to access all devices. Internally this causes pci_bus_to_hose() to be
repeatedly called and output an error message every time. Prevent this
by calling pci_bus_to_hose() once and abort early if no bus was found.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Thierry Reding [Thu, 13 Nov 2014 01:26:47 +0000 (18:26 -0700)]
vsprintf: Add modifier for phys_addr_t
Provide a new modifier to vsprintf() to print phys_addr_t variables to
avoid having to cast or #ifdef when printing them out. The %pa modifier
is used for this purpose, so phys_addr_t variables need to be passed by
reference, like so:
phys_addr_t start = 0;
printf("start: %pa\n", &start);
Depending on the size of phys_addr_t this will print out the address
with 8 or 16 hexadecimal digits following a 0x prefix.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Christian Gmeiner [Wed, 12 Nov 2014 13:35:04 +0000 (14:35 +0100)]
fs: make it possible to read the filesystem UUID
Some filesystems have a UUID stored in its superblock. To
allow using root=UUID=... for the kernel command line we
need a way to read-out the filesystem UUID.
changes rfc -> v1:
- make the environment variable an option parameter. If not
given, the UUID is printed out. If given, it is stored in the env
variable.
- corrected typos
- return error codes
changes v1 -> v2:
- fix return code of do_fs_uuid(..)
- document do_fs_uuid(..)
- implement fs_uuid_unsuported(..) be more consistent with the
way other optional functionality works
changes v2 -> v3:
- change ext4fs_uuid(..) to make use of #if .. #else .. #endif
construct to get rid of unreachable code
Hit any key to stop autoboot: 0
=> fsuuid
fsuuid - Look up a filesystem UUID
Usage:
fsuuid <interface> <dev>:<part>
- print filesystem UUID
fsuuid <interface> <dev>:<part> <varname>
- set environment variable to filesystem UUID
=> fsuuid mmc 0:1
d9f9fc05-45ae-4a36-a616-
fccce0e4f887
=> fsuuid mmc 0:2
eb3db83c-7b28-499f-95ce-
9e0bb21cda81
=> fsuuid mmc 0:1 uuid1
=> fsuuid mmc 0:2 uuid2
=> printenv uuid1
uuid1=
d9f9fc05-45ae-4a36-a616-
fccce0e4f887
=> printenv uuid2
uuid2=
eb3db83c-7b28-499f-95ce-
9e0bb21cda81
=>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
li pengbo [Wed, 12 Nov 2014 11:16:40 +0000 (19:16 +0800)]
sata: fix a bug in init_sata() for pci-sata card
Except the first loop, init_sata() should return 0 instead of 1
in the others.
This patch fix the issue of the 2nd sata port not workable on pci-sata card.
Signed-off-by: Pengbo Li <Pengbo.Li@freescale.com>
Steve Rae [Tue, 11 Nov 2014 19:32:19 +0000 (11:32 -0800)]
ARM: bcm: Enable bcm11130 boards
bcm11130
bcm11130_nand
Signed-off-by: Steve Rae <srae@broadcom.com>
Steve Rae [Tue, 11 Nov 2014 19:32:18 +0000 (11:32 -0800)]
ARM: bcm: Enable five Cygnus boards
bcm911360_entphn
bcm911360_entphn-ns
bcm911360k
bcm958300k-ns
bcm958305k
- updates to support Cygnus and NSP board families better
- add functions so CONFIG_ARMV7_NONSEC can be enabled on Cygnus boards
Signed-off-by: Steve Rae <srae@broadcom.com>
Stefan Roese [Tue, 11 Nov 2014 18:03:55 +0000 (19:03 +0100)]
spl: Change debug to printf for "Unsupported boot-device"
We had the problem on an AM33xx platform, that SPL detected an
unsupported boot-device. But since this message is a debug message
it took a bit of time to really know, where the hangup in SPL
resulted from. So let's change this debug message to a printf
and also print the detected boot-device that is not supported.
This makes debugging of such cases much easier.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
Masahiro Yamada [Thu, 6 Nov 2014 18:03:31 +0000 (03:03 +0900)]
linux/kernel.h: sync min, max, min3, max3 macros with Linux
U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does. This commit gets min, max, min3, max3
macros synced with the kernel introducing type checks.
Many of references of those macros must be fixed to suppress warnings.
We have two options:
- Use min, max, min3, max3 only when the arguments have the same type
(or add casts to the arguments)
- Use min_t/max_t instead with the appropriate type for the first
argument
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Pavel Machek <pavel@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
[trini: Fixup arch/blackfin/lib/string.c]
Signed-off-by: Tom Rini <trini@ti.com>
Masahiro Yamada [Mon, 17 Nov 2014 08:19:41 +0000 (17:19 +0900)]
dm: core: remove unnecessary return condition in uclass lookup
These conditions never happen.
- There is no real uclass with UCLASS_INVALID id.
- uclass never becomes NULL because ll_entry_start() always returns
a valid pointer.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Mon, 17 Nov 2014 08:19:40 +0000 (17:19 +0900)]
dm: core: remove unnecessary return condition in driver lookup
The variable "drv" never becomes NULL because ll_entry_start()
always returns a valid pointer even if there are no entries.
The case "n_ents == 0" is covered by the following "for" loop.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Mon, 17 Nov 2014 08:19:39 +0000 (17:19 +0900)]
dm: core: remove meaningless if conditional
If the variable "ret" is equal to "-ENOENT", it is trapped at [1] and
never reaches [2]. At [3], the condition "ret != -ENOENT" is always
true.
if (ret == -ENOENT) { <------------------ [1]
continue;
} else if (ret == -ENODEV) {
dm_dbg("Device '%s' has no compatible string\n", name);
break;
} else if (ret) { <------------------ [2]
dm_warn("Device tree error at offset %d\n", offset);
if (!result || ret != -ENOENT) <------------------ [3]
result = ret;
break;
}
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Mon, 17 Nov 2014 08:19:38 +0000 (17:19 +0900)]
dm: core: a trivial clean up
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 12 Nov 2014 01:06:30 +0000 (18:06 -0700)]
cros_ec: Fix uninitialised variable in cros_ec.c
This fixes this cppcheck report:
[drivers/misc/cros_ec.c:704]: (error) Uninitialized variable: req
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Wolfgang Denk <wd@denx.de>
Simon Glass [Tue, 11 Nov 2014 17:46:23 +0000 (10:46 -0700)]
dm: spi: Use device_bind_driver() instead of our own function
The SPI function does the same thing, so we may as well just use the new
generic function. The 'cs' parameter was not actually used, so can be
dropped.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
Simon Glass [Tue, 11 Nov 2014 17:46:22 +0000 (10:46 -0700)]
dm: spi: Correct handling of SPI chip selects in sandbox
This code was not updated when the chip select handling was adjusted. Fix
it to call the correct function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
Simon Glass [Tue, 11 Nov 2014 17:46:21 +0000 (10:46 -0700)]
dm: Add a function to bind a device by driver name
In some cases we need to manually bind a device to a particular driver.
Add a function to do this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
Simon Glass [Tue, 11 Nov 2014 17:46:20 +0000 (10:46 -0700)]
dm: fdt: Correct handling of aliases with embedded digits
Since we scan from left to right looking for the first digit, "i2c0" returns
2 instead of 0 for the alias number. Adjust the code to scan from right to
left instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
Simon Glass [Tue, 11 Nov 2014 17:46:19 +0000 (10:46 -0700)]
dm: core: Add functions to find parent and OF data
Add dev_get_parent() as a convenience to obtain the parent of a device.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
Simon Glass [Tue, 11 Nov 2014 17:46:18 +0000 (10:46 -0700)]
dm: core: Allow access to the device's driver_id data
When the device is created from a device tree node, it matches a compatible
string. Allow access to that string and the associated data.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
Simon Glass [Tue, 11 Nov 2014 17:46:17 +0000 (10:46 -0700)]
dm: i2c: Move error reporting into a common function
Factor out the common code to make it easier to adjust it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
Simon Glass [Tue, 11 Nov 2014 00:16:54 +0000 (17:16 -0700)]
dm: Update documentation to include CONFIG_DM... options
Add documentation for the various driver model options that are now
available.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 00:16:52 +0000 (17:16 -0700)]
dm: arm: spl: Make driver model linker lists available
The linker lists feature is useful in SPL as it holds the driver model
platform data. So don't throw away the lists.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Simon Glass [Tue, 11 Nov 2014 00:16:51 +0000 (17:16 -0700)]
dm: tegra: Add platform data for the GPIO driver
Add platform data for the GPIO driver. It doesn't need to contain anything
since the GPIO driver will actually use information from the CONFIGs for
now. This merely serves to ensure that the GPIO driver is bound.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 00:16:50 +0000 (17:16 -0700)]
dm: tegra: Add platform data for the SPL uart
Since we currently don't have device tree available in SPL, add platform
data so the uart works.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 00:16:49 +0000 (17:16 -0700)]
dm: Disable dm_warn() in SPL
Since this function can use up quite a bit of space for its strings, disable
it by default in SPL. Use CONFIG_DM_WARN to re-enable it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Simon Glass [Tue, 11 Nov 2014 00:16:48 +0000 (17:16 -0700)]
dm: Allow stdio registration to be dropped
Provide a CONFIG_DM_STDIO option to enable registering a serial device
with the stdio library. This is seldom useful in SPL, so disable it by
default when building for SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Simon Glass [Tue, 11 Nov 2014 00:16:47 +0000 (17:16 -0700)]
dm: Allow device removal features to be dropped
For SPL we don't expect to need to remove a device. Save some code space
by dropping this feature. The board config can define
CONFIG_DM_DEVICE_REMOVE if this is in fact needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Simon Glass [Tue, 11 Nov 2014 00:16:46 +0000 (17:16 -0700)]
dm: spl: Allow driver model to be used
When enabled, set up driver model for SPL. This allows SPL to use the same
drivers as the main U-Boot.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Tom Rini <trini@ti.com>
Simon Glass [Tue, 11 Nov 2014 00:16:45 +0000 (17:16 -0700)]
dm: spl: Make simple malloc() available when enabled
Set up the simple malloc() implementation when requested, in preference to
the full malloc().
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 00:16:44 +0000 (17:16 -0700)]
dm: arm: spl: Allow simple malloc() in SPL
For SPL it is sometimes useful to have a simple malloc() just to permit
driver model to work, in the cases where the full malloc() is not made
available by the board config.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 00:16:43 +0000 (17:16 -0700)]
dm: Split the simple malloc() implementation into its own file
The simple malloc() implementation is used when memory is tight. It provides
a simple buffer with an incrementing pointer.
At present the implementation is inside dlmalloc. Move it into its own file
so that it is easier to find.
Rather than using relocation as a signal that the full malloc() is
available, add a special GD_FLG_FULL_MALLOC_INIT flag. This signals that the
simple malloc() should no longer be used.
In some cases, such as SPL, even the code space used by the full malloc() is
wasteful. Add a CONFIG_SYS_MALLOC_SIMPLE option to provide only the simple
malloc. In this case the full malloc is not available at all. It saves about
1KB of code space and about 0.5KB of data on Thumb 2.
Acked-by: Tom Rini <trini@ti.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 00:16:42 +0000 (17:16 -0700)]
dm: tegra: Avoid using arch-specific memcpy() in SPL
The faster functions are not actually available in SPL and the code size
likely isn't worth it. Use the normal memcpy() in SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 29 Oct 2014 19:09:03 +0000 (13:09 -0600)]
dm: serial: Support changing the baud rate
Implement this feature in the uclass so that the baudrate can be changed
with 'setenv baudrate <rate>'.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 29 Oct 2014 19:09:02 +0000 (13:09 -0600)]
dm: at91: Add myself as maintainer for snapper9260
The old maintainer has left, so take this over.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 29 Oct 2014 19:09:01 +0000 (13:09 -0600)]
dm: at91: Convert snapper9260 to use driver model
Convert this at91sam9260-based board to use driver model. This should serve
as an example for other similar boards. Serial and GPIO are supported so
far.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
Simon Glass [Wed, 29 Oct 2014 19:09:00 +0000 (13:09 -0600)]
dm: at91: Add driver model support for the serial driver
Add driver model support while retaining the existing legacy code. This
allows the driver to support boards that have converted to driver model
as well as those that have not.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 29 Oct 2014 19:08:59 +0000 (13:08 -0600)]
dm: at91: Refactor serial driver slightly for driver model
Before adding driver model support, split out a few of the functions so
that they can be used by the driver model code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
Simon Glass [Wed, 29 Oct 2014 19:08:58 +0000 (13:08 -0600)]
dm: at91: Add platform data for GPIO on at91sam9260-based boards
These boards all have the same GPIO arrangement, so add some common platform
data that can be used by all boards. Remove the configs which are no longer
required.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 29 Oct 2014 19:08:57 +0000 (13:08 -0600)]
dm: at91: Add driver model support for atmel GPIO driver
Modify this driver to support driver model, with platform data required to
determine the GPIOs that it controls.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 29 Oct 2014 19:08:56 +0000 (13:08 -0600)]
dm: at91: Move snapper9260 to generic baord
This works correctly, so switch it over before the deadline.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 29 Oct 2014 19:08:55 +0000 (13:08 -0600)]
dm: at91: Correct text base for snapper9260
The value should be 0x21f00000. Fix it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:29 +0000 (22:42 -0700)]
x86: Rename chromebook-x86 to coreboot
Rename this vendor since it is intended to be used on any platform where
coreboot runs at reset and then loads U-Boot.
So far it is only tested on link. When other boards are supported it is
likely that we will need to move to multiple board names, all under the
'coreboot' vendor. So while it would be possible to remove the vendor for
now, that would be short-sighted.
Suggested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:28 +0000 (22:42 -0700)]
x86: ivybridge: Implement SDRAM init
Implement SDRAM init using the Memory Reference Code (mrc.bin) provided in
the board directory and the SDRAM SPD information in the device tree. This
also needs the Intel Management Engine (me.bin) to work. Binary blobs
everywhere: so far we have MRC, ME and microcode.
SDRAM init works by setting up various parameters and calling the MRC. This
in turn does some sort of magic to work out how much memory there is and
the timing parameters to use. It also sets up the DRAM controllers. When
the MRC returns, we use the information it provides to map out the
available memory in U-Boot.
U-Boot normally moves itself to the top of RAM. On x86 the RAM is not
generally contiguous, and anyway some RAM may be above 4GB which doesn't
work in 32-bit mode. So we relocate to the top of the largest block of
RAM we can find below 4GB. Memory above 4GB is accessible with special
functions (see physmem).
It would be possible to build U-Boot in 64-bit mode but this wouldn't
necessarily provide any more memory, since the largest block is often below
4GB. Anyway U-Boot doesn't need huge amounts of memory - even a very large
ramdisk seldom exceeds 100-200MB. U-Boot has support for booting 64-bit
kernels directly so this does not pose a limitation in that area. Also there
are probably parts of U-Boot that will not work correctly in 64-bit mode.
The MRC is one.
There is some work remaining in this area. Since memory init is very slow
(over 500ms) it is possible to save the parameters in SPI flash to speed it
up next time. Suspend/resume support is not fully implemented, or at least
it is not efficient.
With this patch, link boots to a prompt.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:27 +0000 (22:42 -0700)]
x86: ivybridge: Add LAPIC support
The local advanced programmable interrupt controller is not used much in
U-Boot but we do need to set it up. Add basic support for this, which will
be extended as needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:26 +0000 (22:42 -0700)]
x86: Make show_boot_progress() common
This function can probably be used on all x86 boards, so move it into the
common file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:25 +0000 (22:42 -0700)]
x86: chromebook_link: Enable GPIO support
Enable GPIO support and provide the required GPIO setup information to
the driver.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:24 +0000 (22:42 -0700)]
x86: ivybridge: Add support for early GPIO init
When not relying on Coreboot for GPIO init the GPIOs must be set up
correctly. This is currently done statically through a rather ugly method.
As the GPIOs are figured out they can be moved to the device tree and set
up as needed rather than all at the start.
In this implementation, board files should call ich_gpio_set_gpio_map()
before the GPIO driver is used in order to provide the GPIO information.
We use the early PCI interface so that this driver can now be used before
relocation.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:23 +0000 (22:42 -0700)]
x86: ivybridge: Add early init for PCH devices
Many PCH devices are hard-coded to a particular PCI address. Set these
up early in case they are needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:22 +0000 (22:42 -0700)]
x86: dts: Add microcode updates for ivybridge CPU
Add two microcode updates that are provided for this CPU. The updates
have been converted to a device tree form.
Note: SPDX submission has been done. If this license is approved I will
convert the files to use SPDX.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:21 +0000 (22:42 -0700)]
x86: ivybridge: Perform Intel microcode update on boot
Microcode updates are stored in the device tree. Work through these and
apply any that are needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:20 +0000 (22:42 -0700)]
x86: ivybridge: Check BIST value on boot
The built-in self test value should be checked before we continue booting.
Refuse to continue if there is something wrong.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:19 +0000 (22:42 -0700)]
x86: ivybridge: Perform initial CPU setup
Set up the flex ratio (controls speed versus heat output) and a few other
very early things.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:18 +0000 (22:42 -0700)]
x86: Add msr read/write functions that use a structure
It is convenient to be able to adjust MSRs with a structure that splits the
two 32-bit halves into separate fields, as they are often dealt with
separately. Add a few functions to support this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:17 +0000 (22:42 -0700)]
x86: Add clr/setbits functions
These are available on other architectures. Make them available on x86 also.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:16 +0000 (22:42 -0700)]
x86: Tidy up coreboot header usage
There is no need to explicitly write 'arch-coreboot' when including headers,
as when the arch directory points to coreboot the correct files will be
used.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:15 +0000 (22:42 -0700)]
x86: ivybridge: Add early LPC init so that serial works
The PCH (Platform Controller Hub) includes an LPC (Low Pin Count) device
which provides a serial port. This is accessible on Chromebooks, so enable
it early in the boot process.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:14 +0000 (22:42 -0700)]
x86: pci: Allow configuration before relocation
Add simple PCI access routines for x86 which permit use before relocation.
The normal PCI stack is still used, but for pre-relocation use there can
only ever be a single hose. After relocation, fall back to the normal
access, although even then on x86 machines there is normally only a single
PCI bus.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:13 +0000 (22:42 -0700)]
x86: ivybridge: Enable PCI in early init
Enable PCI so we can access devices that need to be set up before relocation.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:12 +0000 (22:42 -0700)]
x86: Support use of PCI before relocation
Add support for using PCI before SDRAM is available, using early malloc()
and global_data.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Thu, 13 Nov 2014 05:42:11 +0000 (22:42 -0700)]
x86: Refactor PCI to permit alternate init
We want access PCI earlier in the init sequence, so refactor the code so
that it does not require use of a BSS variable to work. This will allow us
to use early malloc() to store information about a PCI hose.
Common PCI code moves to arch/x86/cpu/pci.c and a new
board_pci_setup_hose() function is provided by boards to set up the (single)
hose used by that board.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Thu, 13 Nov 2014 05:42:10 +0000 (22:42 -0700)]
x86: chromebook_link: Implement CAR support (cache as RAM)
Add support for CAR so that we have memory to use prior to DRAM init.
On link there is a total of 128KB of CAR available, although some is
used for the memory reference code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:09 +0000 (22:42 -0700)]
x86: Emit post codes in startup code for Chromebooks
On x86 it is common to use 'post codes' which are 8-bit hex values emitted
from the code and visible to the user. Traditionally two 7-segment displays
were made available on the motherboard to show the last post code that was
emitted. This allows diagnosis of a boot problem since it is possible to
see where the code got to before it died.
On modern hardware these codes are not normally visible. On Chromebooks
they are displayed by the Embedded Controller (EC), so it is useful to emit
them. We must enable this feature for the EC to see the codes, so add an
option for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Thu, 13 Nov 2014 05:42:08 +0000 (22:42 -0700)]
x86: Build a .rom file which can be flashed to an x86 machine
On x86 machines U-Boot needs to be added to a large ROM image which is
then flashed onto the target board. The ROM has a particular format so it
makes sense for U-Boot to build this image automatically. Unfortunately
it relies on binary blobs so we cannot require this for the default
build as yet.
Create a u-boot.rom output file for this purpose.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:07 +0000 (22:42 -0700)]
x86: Add chromebook_link board
This board is a 'bare' version of the existing 'link 'board. It does not
require coreboot to run, but is intended to start directly from the reset
vector.
This initial commit has place holders for a wide range of features. These
will be added in follow-on patches and series. So far it cannot be booted
as there is no ROM image produced, but it does build without errors.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:06 +0000 (22:42 -0700)]
x86: ifdtool: Allow creation of an empty ROM
Allow an empty ROM to be created, without needing to provide a descriptor.
The descriptor is not needed on some x86 boards.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 05:42:04 +0000 (22:42 -0700)]
x86: Allow timer calibration to work on ivybridge
Unfortunately MSR_FSB_FREQ is not available on this CPU, and the PIT method
seems to take up to 50ms which is much too long.
For this CPU we know the frequency, so add another special case for now.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Masahiro Yamada [Thu, 13 Nov 2014 03:28:41 +0000 (12:28 +0900)]
x86: use CONFIG_SYS_COREBOOT to descend into coreboot/ directory
The references of CONFIG_SYS_COREBOOT in arch/x86/cpu/coreboot/Makefile
are redundant because the build system descends into the directory
only when CONFIG_SYS_COREBOOT is defined.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 01:00:26 +0000 (18:00 -0700)]
x86: Replace fill_processor_name() with cpu_get_name()
This implementation has a 'cpu' prefix and returns a pointer to the string,
avoiding the need for copying.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Tue, 11 Nov 2014 01:00:25 +0000 (18:00 -0700)]
x86: Remove unnecessary find_fdt(), prepare_fdt() functions
These are no-longer needed so drop them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Tue, 11 Nov 2014 01:00:24 +0000 (18:00 -0700)]
x86: Add processor functions to halt and get stack pointer
Add a function to get the stack pointer and another to halt the CPU.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Tue, 11 Nov 2014 01:00:23 +0000 (18:00 -0700)]
x86: config: Move common x86 configs to a common file
Many of the x86 CONFIG options will be common across different boards. Move
them to a common file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Tue, 11 Nov 2014 01:00:22 +0000 (18:00 -0700)]
x86: Add ifdtool for working with Intel Flash Descriptor ROM images
Newer Intel chips require a Management Engine which requires a particular
format for the SPI flash that contains the boot loader. Add a tool that
supports creating and modifying these ROM images.
This tool is from Chrome OS but has been cleaned up to use U-Boot style
and to add comments. A few features have been added also.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 01:00:21 +0000 (18:00 -0700)]
dm: gpio: Add a function to read an ID from a list of GPIOs
For board IDs a common approach is to set aside several GPIOs for use in
determining the board ID. This can provide information about board features
and the revision.
Add a function that turns a list of GPIOs into an integer by assigning
each GPIO to a single bit.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 01:00:20 +0000 (18:00 -0700)]
dm: serial: Move current serial port pointer to global_data
In general we can't store things in the data section until we have inited
SDRAM. Some platforms allow this (e.g. those with SPL) but some don't. Move
the pointer to global_data so that it will work on all platforms.
Without this fix the serial port will not work prior to relocation with
driver model on some platforms.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 01:00:19 +0000 (18:00 -0700)]
fdt: Add a function to decode a variable-sized u32 array
Sometimes an array can be of variable size up to a maximum. Add a helper
function to decode this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 11 Nov 2014 01:00:18 +0000 (18:00 -0700)]
Move early malloc() to before arch_cpu_init()
For some CPUs, having malloc() available very early is useful. There is no
reason to delay this since early malloc is allocated before board_init_f()
is called.
Move early malloc() init nearer to the start of the init sequence.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 13 Nov 2014 03:27:55 +0000 (20:27 -0700)]
x86: Fix a warning with gcc 4.4.4
This warning appears even though it seems that the compiler could work it
out. Fix it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Bin Meng [Sun, 9 Nov 2014 14:19:35 +0000 (22:19 +0800)]
x86: Save TSC frequency in the global data
Return the saved TSC frequency in get_tbclk_mhz().
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>