]> git.kernelconcepts.de Git - karo-tx-uboot.git/log
karo-tx-uboot.git
9 years agobios_emulator: Add an option to enable debugging
Simon Glass [Sat, 15 Nov 2014 03:56:42 +0000 (20:56 -0700)]
bios_emulator: Add an option to enable debugging

At present there are DEBUG options spread around the place. If you enable
one and not another you can end up with an emulator that does not work,
since each file can have a different view of what the registers look like.
To fix this, create a global CONFIG_X86EMU_DEBUG option that keeps
everything consistent.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobios_emulator: Allow a custom interrupt handler to be installed
Simon Glass [Sat, 15 Nov 2014 03:56:41 +0000 (20:56 -0700)]
bios_emulator: Allow a custom interrupt handler to be installed

Sometime we want to provide an interrupt handler for the ROM, Add a
function to allow this.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobios_emulator: Add vesa support and allow ROMs to be passed in as data
Simon Glass [Sat, 15 Nov 2014 03:56:40 +0000 (20:56 -0700)]
bios_emulator: Add vesa support and allow ROMs to be passed in as data

As well as locating the ROM on the PCI bus, allow the ROM to be supplied to
the emulator. Split the init up a little so that callers can supply their
own interrupt routines. Also allow a vesa mode to be provided, to be
selected once the BIOS run is complete.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobios_emulator: Allow x86 to use the emulator
Simon Glass [Sat, 15 Nov 2014 03:56:39 +0000 (20:56 -0700)]
bios_emulator: Allow x86 to use the emulator

There is an implicit assumption that x86 machines want to use raw I/O in the
BIOS emulator, but this should be selectable. Add an CONFIG_X86EMU_RAW_IO
option to control it instead.

Also fix a few bugs which cause warnings on x86 and adjust the Makefile to
remove the assumption that only PowerPC uses the emulator.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: config: Enable video support for chromebook_link
Simon Glass [Sat, 15 Nov 2014 03:56:38 +0000 (20:56 -0700)]
x86: config: Enable video support for chromebook_link

Now that we have the required drivers, enable video support with a suitable
option ROM.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: dts: Add video information to the device tree
Simon Glass [Sat, 15 Nov 2014 03:56:37 +0000 (20:56 -0700)]
x86: dts: Add video information to the device tree

This provides panel timing information needed by the video driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add initial video device init for Intel GMA
Simon Glass [Sat, 15 Nov 2014 03:56:36 +0000 (20:56 -0700)]
x86: Add initial video device init for Intel GMA

Intel's Graphics Media Accelerator (GMA) is a generic name for a wide range
of video devices. Add code to set up the hardware on ivybridge. Part of the
init happens in native code, part of it happens in a 16-bit option ROM for
those nostalgic for the 1970s.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Allow an option ROM to be built into U-Boot
Simon Glass [Sat, 15 Nov 2014 03:56:35 +0000 (20:56 -0700)]
x86: Allow an option ROM to be built into U-Boot

Some x86 machines require a binary blob containing 16-bit initialisation
code for their video hardware. Allow this to be built into the x86 ROM so
that it is accessible during boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: video: Add video driver for bare x86 boards
Simon Glass [Sat, 15 Nov 2014 03:56:34 +0000 (20:56 -0700)]
x86: video: Add video driver for bare x86 boards

Add a very simple driver which uses vesa to discover the video mode and
then provides a frame buffer for use by U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
9 years agopci: Add general support for execution of video ROMs
Simon Glass [Sat, 15 Nov 2014 03:56:33 +0000 (20:56 -0700)]
pci: Add general support for execution of video ROMs

Some platforms don't have native code for dealing with their video
hardware. In some cases they use a binary blob to set it up and perform
required actions like setting the video mode. This approach is a hangover
from the old PC days where a ROM was provided and executed during startup.

Even now, these ROMs are supplied as a way to set up video. It avoids the
code for every video chip needing to be provided in the boot loader. But
it makes the video much less flexible - e.g. it is not possible to do
anything else while the video init is happening (including waiting hundreds
of milliseconds for display panels to start up).

In any case, to deal with this sad state of affairs, provide an API for
execution of x86 video ROMs, either natively or through emulation.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add support for running option ROMs natively
Simon Glass [Sat, 15 Nov 2014 03:56:32 +0000 (20:56 -0700)]
x86: Add support for running option ROMs natively

On x86 machines we can use an emulator to run option ROMS as with other
architectures. But with some additional effort (mostly due to the 16-bit
nature of option ROMs) we can run them natively. Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoAdd support for Vesa BIOS extensions
Simon Glass [Sat, 15 Nov 2014 03:56:31 +0000 (20:56 -0700)]
Add support for Vesa BIOS extensions

For option ROMs we can use these extensions to request a particular video
mode. Add a header file which defines the binary interface.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add vesa mode configuration options
Simon Glass [Sat, 15 Nov 2014 03:56:30 +0000 (20:56 -0700)]
x86: Add vesa mode configuration options

Add Kconfig options to allow selection of a vesa mode on x86 machines.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add GDT descriptors for option ROMs
Simon Glass [Sat, 15 Nov 2014 03:56:29 +0000 (20:56 -0700)]
x86: Add GDT descriptors for option ROMs

Option ROMs require a few additional descriptors. Add these, and remove the
enum since we now have to access several descriptors from assembler.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoIntroduce a header file for the BIOS emulator
Simon Glass [Sat, 15 Nov 2014 03:56:28 +0000 (20:56 -0700)]
Introduce a header file for the BIOS emulator

We should have a public header so that users can avoid defining functions
themselves.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add a definition of asmlinkage
Simon Glass [Sat, 15 Nov 2014 03:56:27 +0000 (20:56 -0700)]
x86: Add a definition of asmlinkage

This is needed to permit calling C from assembler without too much pain.
Add a definition for x86.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: config: Enable SPI for chromebook_link
Simon Glass [Tue, 25 Nov 2014 04:18:19 +0000 (21:18 -0700)]
x86: config: Enable SPI for chromebook_link

Enable SPI so that the SPI flash can be used.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Add northbridge init functions
Simon Glass [Tue, 25 Nov 2014 04:18:18 +0000 (21:18 -0700)]
x86: ivybridge: Add northbridge init functions

Add init for the northbridge, another part of the platform controller hub.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Drop some msr functions that we don't support
Simon Glass [Tue, 25 Nov 2014 04:18:17 +0000 (21:18 -0700)]
x86: Drop some msr functions that we don't support

These are not available in U-Boot as yet, so drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add init for model 206AX CPU
Simon Glass [Tue, 25 Nov 2014 04:18:16 +0000 (21:18 -0700)]
x86: Add init for model 206AX CPU

Add the setup code for the CPU so that it can be used at full speed.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add LAPIC setup code
Simon Glass [Tue, 25 Nov 2014 04:18:15 +0000 (21:18 -0700)]
x86: Add LAPIC setup code

Add code to set up the Local Advanced Peripheral Interrupt Controller.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
9 years agox86: Drop old CONFIG_INTEL_CORE_ARCH code
Simon Glass [Tue, 25 Nov 2014 04:18:14 +0000 (21:18 -0700)]
x86: Drop old CONFIG_INTEL_CORE_ARCH code

This is no-longer used, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
9 years agox86: Remove unnecessary call to initr_enable_interrupts()
Bin Meng [Thu, 20 Nov 2014 08:11:27 +0000 (16:11 +0800)]
x86: Remove unnecessary call to initr_enable_interrupts()

Actually initr_enable_interrupts() was never called in an x86 build
due to it was wrapped by CONFIG_x86 (typo of X86).

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
9 years agox86: Refactor interrupt_init()
Bin Meng [Thu, 20 Nov 2014 08:11:16 +0000 (16:11 +0800)]
x86: Refactor interrupt_init()

Rename interrupt_init() in arch/x86/lib/pcat_interrupts.c to
i8259_init() and create a new interrupt_init() in
arch/x86/cpu/interrupt.c to call i8259_init() followed by a
call to cpu_init_interrupts().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
9 years agox86: Remove cpu_init_r() for x86
Bin Meng [Thu, 20 Nov 2014 08:11:00 +0000 (16:11 +0800)]
x86: Remove cpu_init_r() for x86

Since cpu_init_interrupts() was moved out of cpu_init_r(), it is
useless to keep cpu_init_r() for x86, thus remove it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
9 years agox86: Call cpu_init_interrupts() from interrupt_init()
Bin Meng [Thu, 20 Nov 2014 08:10:49 +0000 (16:10 +0800)]
x86: Call cpu_init_interrupts() from interrupt_init()

Currently cpu_init_interrupts() is called from cpu_init_r() to
setup the interrupt and exception of the cpu core, but at that
time the i8259 has not been initialized to mask all the irqs
and remap the master i8259 interrupt vector base, so the whole
system is at risk of being interrupted, and if interrupted,
wrong interrupt/exception message is shown.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add Intel speedstep and turbo mode code
Simon Glass [Sat, 15 Nov 2014 01:18:43 +0000 (18:18 -0700)]
x86: Add Intel speedstep and turbo mode code

Intel chips have a turbo mode where they can run faster for a short period
until they reach thermal limits. Add code to adjust and query this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Set up XHCI USB
Simon Glass [Sat, 15 Nov 2014 01:18:42 +0000 (18:18 -0700)]
x86: ivybridge: Set up XHCI USB

Add init for XHCI so that high-speed USB can be used.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: config: Enable USB on link
Simon Glass [Sat, 15 Nov 2014 01:18:41 +0000 (18:18 -0700)]
x86: config: Enable USB on link

Enable USB support on link - there are two EHCI ports available.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Set up EHCI USB
Simon Glass [Sat, 15 Nov 2014 01:18:40 +0000 (18:18 -0700)]
x86: ivybridge: Set up EHCI USB

Add init for EHCI so that USB can be used.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: dts: Add SATA settings for link
Simon Glass [Sat, 15 Nov 2014 01:18:39 +0000 (18:18 -0700)]
x86: dts: Add SATA settings for link

Add the requires settings to enable SATA on link.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Add SATA init
Simon Glass [Sat, 15 Nov 2014 01:18:38 +0000 (18:18 -0700)]
x86: ivybridge: Add SATA init

Add code to set up the SATA interfaces on boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: dts: Add LPC settings for link
Simon Glass [Sat, 15 Nov 2014 01:18:37 +0000 (18:18 -0700)]
x86: dts: Add LPC settings for link

Add some settings required to set up the LPC correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: dts: Move PCI peripherals into a pci node
Simon Glass [Sat, 15 Nov 2014 01:18:36 +0000 (18:18 -0700)]
x86: dts: Move PCI peripherals into a pci node

These peripherals should not be at the top level, since they exist inside
the PCI bus. We don't have a full device tree node for pci yet, but we
should at least put it at the right level.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Add additional LPC init
Simon Glass [Sat, 15 Nov 2014 01:18:35 +0000 (18:18 -0700)]
x86: ivybridge: Add additional LPC init

Set up all the remaining pieces of the LPC (low-pin-count) peripheral in
PCH (Peripheral Controller Hub).

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Add PCH init
Simon Glass [Sat, 15 Nov 2014 01:18:34 +0000 (18:18 -0700)]
x86: ivybridge: Add PCH init

Add required init for the Intel Platform Controller Hub in ivybridge.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add a simple header file for ACPI
Simon Glass [Sat, 15 Nov 2014 01:18:33 +0000 (18:18 -0700)]
x86: Add a simple header file for ACPI

We don't use many features yet, so this only has a few declarations.
It will be expanded as needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Add support for BD82x6x PCH
Simon Glass [Sat, 15 Nov 2014 01:18:32 +0000 (18:18 -0700)]
x86: ivybridge: Add support for BD82x6x PCH

Add basic setup for the PCH.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Set up edge triggering on interrupt 9
Simon Glass [Sat, 15 Nov 2014 01:18:31 +0000 (18:18 -0700)]
x86: Set up edge triggering on interrupt 9

Add this additional init in case it is needed by the OS.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
9 years agopci: Add functions to read and write a BAR address
Simon Glass [Sat, 15 Nov 2014 01:18:30 +0000 (18:18 -0700)]
pci: Add functions to read and write a BAR address

Some PCI functions cannot be auto-configured. Add a function to set up a
fixed BAR which can be used in these situations. Also add a function to read
the current address of a BAR.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
9 years agox86: config: Enable plug-and-play for link PCI
Simon Glass [Sat, 15 Nov 2014 01:18:29 +0000 (18:18 -0700)]
x86: config: Enable plug-and-play for link PCI

Enable this option so that we can configure the available PCI devices. Also
make sure that PCI is available early after relocation as we use it for
several other subsystems.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: pci: Add handlers before and after a PCI hose scan
Simon Glass [Sat, 15 Nov 2014 01:18:28 +0000 (18:18 -0700)]
x86: pci: Add handlers before and after a PCI hose scan

Some boards will want to do some setup before and after a PCI hose
is scanned.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
9 years agox86: Add ioapic.h header
Simon Glass [Sat, 15 Nov 2014 01:18:27 +0000 (18:18 -0700)]
x86: Add ioapic.h header

Add definitions for the I/O Advanced Peripheral Interrupt Controller.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agortc: mc146818: Set up RTC at start of day
Simon Glass [Sat, 15 Nov 2014 01:18:26 +0000 (18:18 -0700)]
rtc: mc146818: Set up RTC at start of day

Provide a function to set up the RTC ready for use.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
9 years agox86: Factor out common values in the link script
Simon Glass [Sat, 15 Nov 2014 01:18:25 +0000 (18:18 -0700)]
x86: Factor out common values in the link script

Define the reset base in config.mk so that it does not need to be calculated
twice in the link script. Also tidy up the START_16 and RESET_VEC_LOC values
to fit with this new approach.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
9 years agox86: Ensure that all relocation data is included in the image
Simon Glass [Sat, 15 Nov 2014 01:18:24 +0000 (18:18 -0700)]
x86: Ensure that all relocation data is included in the image

Some toolchains put the relocation data into separate sections. Adjust the
linker script to catch this case. Without relocation data, U-Boot will not
boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
9 years agox86: Panic if there is no relocation data
Simon Glass [Sat, 15 Nov 2014 01:18:23 +0000 (18:18 -0700)]
x86: Panic if there is no relocation data

This normally indicates a problem which will prevent relocation from
functioning, resulting in a hang. Panic in this case to make it easier
to debug.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
9 years agox86: Remove board_early_init_r()
Simon Glass [Sat, 15 Nov 2014 01:18:22 +0000 (18:18 -0700)]
x86: Remove board_early_init_r()

This function is not needed. Remove it to improve the generic init sequence
slightly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
9 years agopci: Update pci_ids.h to include some missing IDs
Simon Glass [Sat, 15 Nov 2014 01:18:21 +0000 (18:18 -0700)]
pci: Update pci_ids.h to include some missing IDs

This was taken from Linux 3.18 with some additional IDs from Chrome OS
Coreboot commit 688ef385.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoAlign embedded device tree correctly
Simon Glass [Sat, 15 Nov 2014 01:18:19 +0000 (18:18 -0700)]
Align embedded device tree correctly

Device trees must be aligned to a 4-byte boundary. This was dropped in the
Kbuild conversion. Bring it back, and use 16-byte alignment for good
measure.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoFix SIZE_MAX compiler warning when using stdint.h
Simon Glass [Tue, 25 Nov 2014 04:18:21 +0000 (21:18 -0700)]
Fix SIZE_MAX compiler warning when using stdint.h

This new symbol may be defined by the compiler. If it is, avoid a compiler
warning when USE_STDINT is defined.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add ivybridge directory to Makefile
Simon Glass [Tue, 25 Nov 2014 04:18:20 +0000 (21:18 -0700)]
x86: Add ivybridge directory to Makefile

It is now required to add subdirectories in the x86 cpu Makefile. Add this
to fix a build breakage for chromebook_link.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoPrepare v2015.01-rc2
Tom Rini [Mon, 24 Nov 2014 22:08:47 +0000 (17:08 -0500)]
Prepare v2015.01-rc2

Signed-off-by: Tom Rini <trini@ti.com>
9 years agoMerge branch 'master' of git://git.denx.de/u-boot-arm
Tom Rini [Mon, 24 Nov 2014 22:05:11 +0000 (17:05 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-arm

9 years agoRevert "hush: fix segfault on syntax error"
Rabin Vincent [Fri, 21 Nov 2014 22:05:22 +0000 (23:05 +0100)]
Revert "hush: fix segfault on syntax error"

128059b92 ("hush: fix segfault on syntax error") attempted to fix a
segfault on syntax errors, but it broke Ctrl-C handling, and the
assumption that it made, that rcode could not be -1, is incorrect.
Revert this change.

Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Reported-by: Przemyslaw Marczak <p.marczak@samsung.com>
Signed-off-by: Rabin Vincent <rabin@rab.in>
9 years agoMerge branch 'master' of git://www.denx.de/git/u-boot-imx
Tom Rini [Mon, 24 Nov 2014 17:02:12 +0000 (12:02 -0500)]
Merge branch 'master' of git://www.denx.de/git/u-boot-imx

9 years agoMerge git://git.denx.de/u-boot-dm
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>
9 years agoMerge git://git.denx.de/u-boot-x86
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>
9 years agomx6boards: Fix error handling in board_mmc_init()
Fabio Estevam [Fri, 21 Nov 2014 18:42:58 +0000 (16:42 -0200)]
mx6boards: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Cc: Eric Benard <eric@eukrea.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agonitrogen6x: Fix error handling in board_mmc_init()
Fabio Estevam [Fri, 21 Nov 2014 18:42:57 +0000 (16:42 -0200)]
nitrogen6x: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Cc: Eric Nelson <eric.nelson@boundarydevices.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agoot1200: Fix error handling in board_mmc_init()
Fabio Estevam [Fri, 21 Nov 2014 18:42:56 +0000 (16:42 -0200)]
ot1200: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agoarm: imx: stop sata on boot
Nikita Kiryanov [Fri, 21 Nov 2014 10:47:26 +0000 (12:47 +0200)]
arm: imx: stop sata on boot

Ideally, the Linux kernel should get the hardware in its most
untouched state. For the most part, U-Boot does not reset the various
subsystems it touches before boot, and usually Linux deals with it, but
on some boards (cm_fx6) the Linux kernel fails to detect the ssd
correctly if sata is used by U-Boot.

Power off sata on OS boot so that Linux will have a clean state to work
with.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Stefano Babic <sbabic@denx.de>
9 years agoarm: mx6: cm_fx6: implement board specific sata stop
Nikita Kiryanov [Fri, 21 Nov 2014 10:47:25 +0000 (12:47 +0200)]
arm: mx6: cm_fx6: implement board specific sata stop

Provide board specific implementation for sata stop command for
cm_fx6.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Stefano Babic <sbabic@denx.de>
9 years agocmd_sata: implement sata stop command
Nikita Kiryanov [Fri, 21 Nov 2014 10:47:24 +0000 (12:47 +0200)]
cmd_sata: implement sata stop command

Implement sata stop command.
This introduces the __sata_stop() weak function, which mirrors
the weak __sata_initialize() function, giving users the option of
undoing the custom steps performed in overrides of sata_initialize().

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
9 years agosata: implement reset_sata for dwc_ahsata
Nikita Kiryanov [Fri, 21 Nov 2014 10:47:23 +0000 (12:47 +0200)]
sata: implement reset_sata for dwc_ahsata

Add reset_sata() to the sata driver interface and implement it
for dwc_ahsata. This function cleans up after sata_init(), and
therefore accepts a device number like sata_init() does.
A dummy implementation is provided for the rest of the drivers.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
9 years agoarm: mx6: introduce disable_sata_clock
Nikita Kiryanov [Fri, 21 Nov 2014 10:47:22 +0000 (12:47 +0200)]
arm: mx6: introduce disable_sata_clock

Implement disable_sata_clock for mx6 SoCs.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Stefano Babic <sbabic@denx.de>
9 years agogw_ventana: Use the generic spl_sd.cfg
Fabio Estevam [Thu, 20 Nov 2014 15:17:56 +0000 (13:17 -0200)]
gw_ventana: Use the generic spl_sd.cfg

gw_ventana can boot from SPI or NAND and both of these interfaces boot from
the same 0x400 offset.

This means that we could simplify the code and replace the custom gw_ventana.cfg
with the generic spl_sd.cfg, as it provides the same boot offset of 0x400.

Cc: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agoARM: bootm: Allow booting in secure mode on hyp capable systems
Hans de Goede [Fri, 14 Nov 2014 08:34:31 +0000 (09:34 +0100)]
ARM: bootm: Allow booting in secure mode on hyp capable systems

Older Linux kernels will not properly boot in hyp mode, add support for a
bootm_boot_mode environment variable, which can be set to "sec" or "nonsec"
to force booting in secure or non-secure mode when build with non-sec support.

The default behavior can be selected through CONFIG_ARMV7_BOOT_SEC_DEFAULT,
when this is set booting in secure mode is the default. The default setting
for this Kconfig option is N, preserving the current behavior of booting in
non-secure mode by default when non-secure mode is supported.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
9 years agoARM: Add arch/arm/cpu/armv7/Kconfig with non-secure and virt options
Hans de Goede [Fri, 14 Nov 2014 08:34:30 +0000 (09:34 +0100)]
ARM: Add arch/arm/cpu/armv7/Kconfig with non-secure and virt options

Add arch/arm/cpu/armv7/Kconfig with non-secure and virt options, this is a
preparation patch for adding an env variable to choose between secure /
non-secure boot on non-secure boot capable systems, specifically this
prepares for adding CONFIG_ARMV7_BOOT_SEC_DEFAULT as a proper Kconfig option.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agoKconfig: Add EXPERT option
Tom Rini [Fri, 14 Nov 2014 08:34:29 +0000 (09:34 +0100)]
Kconfig: Add EXPERT option

For similar reasons to why the Linux Kernel has an EXPERT option, we too
want an option to allow for tweaking of some options that while normally
should remain hidden, may need to be changed in some cases.

Signed-off-by: Tom Rini <trini@ti.com>
Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosandbox: script for testing sandbox/ext4/fat/fs commands
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>
9 years agofs: API changes enabling extra parameter to return size of type loff_t
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>
9 years agosandbox: Prepare API change for files greater than 2GB
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>
9 years agoext4: Prepare API change for files greater than 2GB
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>
9 years agofat: Prepare API change for files greater than 2GB
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>
9 years agoboard/esd/common/auto_update.c: Use <flash.h>
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>
9 years agosandbox: Use md5sum and fatwrite to enable testing of fs commands
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>
9 years agocommon/board_f: fix gcc warning on MIPS64
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>
9 years agocommon/board_f: add setup of initial stack frame for MIPS
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>
9 years agospl: fix descending condition to drivers/mtd/nand/
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>
9 years agocommands: add more command entries in Kconfig
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>
9 years agohush: add CONFIG_HUSH_PARSER to Kconfig
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>
9 years agoFIT: add some FIT configurations to Kconfig
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>
9 years agoconfig: remove redundant CONFIG_SYS_PROMPT defines
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>
9 years agotegra: do not descend into empty directories
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>
9 years agokbuild: use SoC-specific CONFIG to descend into SoC directory
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>
9 years agox86: use CONFIG_SYS_COREBOOT to descend into coreboot/ directory
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>
9 years agokbuild: Descend into SOC directory from CPU directory
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>
9 years agoAdd pr_fmt() macro
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>
9 years agopci: Honour pci_skip_dev()
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>
9 years agopci: Abort early if bus does not exist
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>
9 years agovsprintf: Add modifier for phys_addr_t
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>
9 years agofs: make it possible to read the filesystem UUID
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>
9 years agosata: fix a bug in init_sata() for pci-sata card
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>
9 years agoARM: bcm: Enable bcm11130 boards
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>
9 years agoARM: bcm: Enable five Cygnus boards
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>
9 years agospl: Change debug to printf for "Unsupported boot-device"
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>
9 years agolinux/kernel.h: sync min, max, min3, max3 macros with Linux
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>
9 years agodm: core: remove unnecessary return condition in uclass lookup
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>
9 years agodm: core: remove unnecessary return condition in driver lookup
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>