platform/kernel/u-boot.git
9 years agobuildman: Add some notes about moving from MAKEALL
Simon Glass [Sat, 9 Aug 2014 21:32:58 +0000 (15:32 -0600)]
buildman: Add some notes about moving from MAKEALL

For those used to MAKEALL, buildman seems strange. Add some notes to ease
the transition.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Fix a few typos
Simon Glass [Sat, 9 Aug 2014 21:32:57 +0000 (15:32 -0600)]
buildman: Fix a few typos

There are several typos in the README - fix them.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoMerge branch 'master' of git://git.denx.de/u-boot-blackfin
Tom Rini [Tue, 12 Aug 2014 20:54:55 +0000 (16:54 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-blackfin

9 years agopowerpc/t104xrdb: support deep sleep in SPI/SD boot
Tang Yuantian [Wed, 23 Jul 2014 09:27:53 +0000 (17:27 +0800)]
powerpc/t104xrdb: support deep sleep in SPI/SD boot

Add deep sleep support in SPI/SD boot. The destination address
second stage uboot image is loaded to is changed because
currently this address will be used by kernel which means
we can't reserve it for resume.

Entry point to kernel is still placed in second stage uboot.

Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
9 years agopowerpc/mpc85xx: Make boot flag effective
Tang Yuantian [Wed, 23 Jul 2014 09:27:52 +0000 (17:27 +0800)]
powerpc/mpc85xx: Make boot flag effective

bootflag as a parameter is passed to board_init_f().
But it is not actually used in this function.
Make it effective by assigned it to gd->flags.

Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
9 years agopowerpc/t1042RDB: Add Video - HDMI support
Jason Jin [Wed, 19 Mar 2014 02:47:56 +0000 (10:47 +0800)]
powerpc/t1042RDB: Add Video - HDMI support

T1042 has internal display interface unit (DIU) for driving video.
T1042RDB supports video mode via
-LCD using TI enconder
-HDMI type interface via HDMI encoder

Chrontel, CH7301C encoder which is I2C programmable is used
as HDMI connector on T1042RDB.
This patch add support to
-enable Video interface for T1042RDB
-route qixis multiplexing to enable DIU-HDMI interface on board
-program DIU pixel clock gerenartor for T1042
-program HDMI encoder via I2C on board

This patch refer to the upstream diu patch
(337b0c52b3296f371d04aef71a833e09110e0e6b) for T1040qds.

Signed-off-by: Jason Jin <Jason.Jin@freescale.com>
Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
[York Sun: resolve conflict and move changes to T104xRDB.h]
Reviewed-by: York Sun <yorksun@freescale.com>
9 years agofsl/diu: ch7301 encoder split off from t1040qds/diu.c
Wang Dongsheng [Wed, 19 Mar 2014 02:47:55 +0000 (10:47 +0800)]
fsl/diu: ch7301 encoder split off from t1040qds/diu.c

The ch7301 encoder not only used in t1040qds platform, so we split
it for t1042rdb and LSx platform.

Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
9 years agosunxi: dram: Autodetect DDR3 bus width and density
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:54 +0000 (05:32 +0300)]
sunxi: dram: Autodetect DDR3 bus width and density

In the case if the 'dram_para' struct does not specify the exact bus
width or chip density, just use a trial and error method to find a
usable configuration.

Because all the major bugs in the DRAM initialization sequence are
now hopefully fixed, it should be safe to re-initialize the DRAM
controller multiple times until we get it configured right. The
original Allwinner's boot0 bootloader also used a similar
autodetection trick.

The DDR3 spec contains the package pinout and addressing table for
different possible chip densities. It appears to be impossible to
distinguish between a single chip with 16 I/O data lines and a pair
of chips with 8 I/O data lines in the case if they provide the same
storage capacity. Because a single 16-bit chip has a higher density
than a pair of equivalent 8-bit chips, it has stricter refresh timings.
So in the case of doubt, we assume that 16-bit chips are used.
Additionally, only Allwinner A20 has all A0-A15 address lines and
can support densities up to 8192. The older Allwinner A10 and
Allwinner A13 can only support densities up to 4096.

We deliberately leave out DDR2, dual-rank configurations and the
special case of a 8-bit chip with density 8192. None of these
configurations seem to have been ever used in real devices. And no
new devices are likely to use these exotic configurations (because
only up to 2GB of RAM can be populated in any case).

This DRAM autodetection feature potentially allows to have a single
low performance fail-safe DDR3 initialiazation for a universal single
bootloader binary, which can be compatible with all Allwinner
A10/A13/A20 based devices (if the ifdefs are replaced with a runtime
SoC type detection).

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Derive write recovery delay from DRAM clock speed
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:53 +0000 (05:32 +0300)]
sunxi: dram: Derive write recovery delay from DRAM clock speed

The write recovery time is 15ns for all JEDEC DDR3 speed bins. And
instead of hardcoding it to 10 cycles, it is possible to set tighter
timings based on accurate calculations. For example, DRAM clock
frequencies up to 533MHz need only 8 cycles for write recovery.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Drop DDR2 support and assume only single rank DDR3 memory
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:52 +0000 (05:32 +0300)]
sunxi: dram: Drop DDR2 support and assume only single rank DDR3 memory

All the known Allwinner A10/A13/A20 devices are using just single rank
DDR3 memory. So don't pretend that we support DDR2 or more than one
rank, because nobody could ever test these configurations for real and
they are likely broken. Support for these features can be added back
in the case if such hardware actually exists.

As part of this code cleanup, also replace division by 1024 with
division by 1000 for the refresh timing calculations. This allows
to use the original non-skewed tRFC timing table from the DRR3 spec
and make code less confusing.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Configurable DQS gating window mode and delay
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:51 +0000 (05:32 +0300)]
sunxi: dram: Configurable DQS gating window mode and delay

The hardware DQS gate training is a bit unreliable and does not
always find the best delay settings.

So we introduce a 32-bit 'dqs_gating_delay' variable, where each
byte encodes the DQS gating delay for each byte lane. The delay
granularity is 1/4 cycle.

Also we allow to enable the active DQS gating window mode, which
works better than the passive mode in practice. The DDR3 spec
says that there is a 0.9 cycles preamble and 0.3 cycle postamble.
The DQS window has to be opened during preamble and closed during
postamble. In the passive window mode, the gating window is opened
and closed by just using the gating delay settings. And because
of the 1/4 cycle delay granularity, accurately hitting the 0.3
cycle long postamble is a bit tough. In the active window mode,
the gating window is auto-closing with the help of monitoring
the DQS line, which relaxes the gating delay accuracy requirements.

But the hardware DQS gate training is still performed in the passive
window mode. It is a more strict test, which is reducing the results
variance compared to the training with active window mode.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Add a helper function 'mctl_get_number_of_lanes'
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:50 +0000 (05:32 +0300)]
sunxi: dram: Add a helper function 'mctl_get_number_of_lanes'

It is going to be useful in more than one place.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Improve DQS gate data training error handling
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:49 +0000 (05:32 +0300)]
sunxi: dram: Improve DQS gate data training error handling

The stale error status should be cleared for all sun4i/sun5i/sun7i
hardware and not just for sun7i. Also there are two types of DQS
gate training errors ("found no result" and "found more than one
possible result"). Both are handled now.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Use divisor P=1 for PLL5
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:48 +0000 (05:32 +0300)]
sunxi: dram: Use divisor P=1 for PLL5

This configures the PLL5P clock frequency to something in the ballpark
of 1GHz and allows more choices for MBUS and G2D clock frequency
selection (using their own divisors). In particular, it enables the use
of 2/3 clock speed ratio between MBUS and DRAM.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Configurable MBUS clock speed (use PLL5 or PLL6)
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:47 +0000 (05:32 +0300)]
sunxi: dram: Configurable MBUS clock speed (use PLL5 or PLL6)

The sun5i hardware (Allwinner A13) introduced configurable MBUS clock
speed. Allwinner A13 uses only 16-bit data bus width to connect the
external DRAM, which is halved compared to the 32-bit data bus of sun4i
(Allwinner A10), so it does not make much sense to clock a wider
internal bus at a very high speed. The Allwinner A13 manual specifies
300 MHz MBUS clock speed limit and 533 MHz DRAM clock speed limit. Newer
sun7i hardware (Allwinner A20) has a full width 32-bit external memory
interface again, but still keeps the MBUS clock speed configurable.
Clocking MBUS too low inhibits memory performance and one has to find
the optimal MBUS/DRAM clock speed ratio, which may depend on many
factors:
    http://linux-sunxi.org/A10_DRAM_Controller_Performance

This patch introduces a new 'mbus_clock' parameter for the 'dram_para'
struct and uses it as a desired MBUS clock speed target. If 'mbus_clock'
is not set, 300 MHz is used by default to match the older hardcoded
settings.

PLL5P and PLL6 are both evaluated as possible clock sources. Preferring
the one, which can provide higher clock frequency that is lower or
equal to the 'mbus_clock' target. In the case of a tie, PLL5P has
higher priority.

Attempting to set the MBUS clock speed has no effect on sun4i, but does
no harm either.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Re-introduce the impedance calibration ond ODT
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:46 +0000 (05:32 +0300)]
sunxi: dram: Re-introduce the impedance calibration ond ODT

The DRAM controller allows to configure impedance either by using the
calibration against an external high precision 240 ohm resistor, or
by skipping the calibration and loading pre-defined data. The DRAM
controller register guide is available here:

    http://linux-sunxi.org/A10_DRAM_Controller_Register_Guide#SDR_ZQCR0

The new code supports both of the impedance configuration modes:
   - If the higher bits of the 'zq' parameter in the 'dram_para' struct
     are zero, then the lowest 8 bits are used as the ZPROG value, where
     two divisors encoded in lower and higher 4 bits. One divisor is
     used for calibrating the termination impedance, and another is used
     for the output impedance.
   - If bits 27:8 in the 'zq' parameters are non-zero, then they are
     used as the pre-defined ZDATA value instead of performing the ZQ
     calibration.

Two lowest bits in the 'odt_en' parameter enable ODT for the DQ and DQS
lines individually. Enabling ODT for both DQ and DQS means that the
'odt_en' parameter needs to be set to 3.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Add 'await_bits_clear'/'await_bits_set' helper functions
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:45 +0000 (05:32 +0300)]
sunxi: dram: Add 'await_bits_clear'/'await_bits_set' helper functions

The old 'await_completion' function is not sufficient, because
in some cases we want to wait for bits to be cleared, and in the
other cases we want to wait for bits to be set. So split the
'await_completion' into two new 'await_bits_clear' and
'await_bits_set' functions.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Do DDR3 reset in the same way on sun4i/sun5i/sun7i
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:44 +0000 (05:32 +0300)]
sunxi: dram: Do DDR3 reset in the same way on sun4i/sun5i/sun7i

The older differences were likely justified by the need to mitigate
the CKE delay timing violations on sun4i/sun5i. The CKE problem is
already resolved, so now we can use the sun7i variant of this code
everywhere.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Remove broken impedance and ODT configuration code
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:43 +0000 (05:32 +0300)]
sunxi: dram: Remove broken impedance and ODT configuration code

We can safely remove it, because none of the currently supported
boards uses these features.

The existing implementation had multiple problems:
   - unnecessary code duplication between sun4i/sun5i/sun7i
   - ZQ calibration was never initiated explicitly, and could be
     only triggered by setting the highest bit in the 'zq' parameter
     in the 'dram_para' struct (this was never actually done for
     any of the known Allwinner devices).
   - even if the ZQ calibration could be started, no attempts were
     made to wait for its completion, or checking whether the
     default automatically initiated ZQ calibration is still
     in progress
   - ODT was only ever enabled on sun4i, but not on sun5i/sun7i

Additionally, SDR_IOCR was set to 0x00cc0000 only on sun4i. There
are some hints in the Rockchip Linux kernel sources, indicating
that these bits are related to the automatic I/O power down
feature, which is poorly understood on sunxi hardware at the
moment. Avoiding to set these bits on sun4i too does not seem to
have any measurable/visible impact.

The impedance and ODT configuration code will be re-introdeced in
one of the next comits.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Fix CKE delay handling for sun4i/sun5i
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:42 +0000 (05:32 +0300)]
sunxi: dram: Fix CKE delay handling for sun4i/sun5i

Before driving the CKE pin (Clock Enable) high, the DDR3 spec requires
to wait for additional 500 us after the RESET pin is de-asserted.

The DRAM controller takes care of this delay by itself, using a
configurable counter in the SDR_IDCR register. This works in the same
way on sun4i/sun5i/sun7i hardware (even the default register value
0x00c80064 is identical). Except that the counter is ticking a bit
slower on sun7i (3 DRAM clock cycles instead of 2), resulting in
longer actual delays for the same settings.

This patch configures the SDR_IDCR register for all sun4i/sun5i/sun7i
SoC variants and not just for sun7i alone. Also an explicit udelay(500)
is added immediately after DDR3 reset for extra safety. This is a
duplicated functionality. But since we don't have perfect documentation,
it may be reasonable to play safe. Half a millisecond boot time increase
is not that significant. Boot time can be always optimized later.
Preferebly by the people, who have the hardware equipment to check the
actual signals on the RESET and CKE lines and verify all the timings.

The old code did not configure the SDR_IDCR register for sun4i/sun5i,
but performed the DDR3 reset very early for sun4i/sun5i. This resulted
in a larger time gap between the DDR3 reset and the DDR3 initialization
steps and reduced the chances of CKE delay timing violation to cause
real troubles.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Respect the DDR3 reset timing requirements
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:41 +0000 (05:32 +0300)]
sunxi: dram: Respect the DDR3 reset timing requirements

The RESET pin needs to be kept low for at least 200 us according
to the DDR3 spec. So just do it the right way.

This issue did not cause any visible major problems earlier, because
the DRAM RESET pin is usually already low after the board reset. And
the time gap before reaching the sunxi u-boot DRAM initialization
code appeared to be sufficient.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Remove broken super-standby remnants
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:40 +0000 (05:32 +0300)]
sunxi: dram: Remove broken super-standby remnants

If the dram->ppwrsctl (SDR_DPCR) register has the lowest bit set to 1,
this means that DRAM is currently in self-refresh mode and retaining the
old data. Since we have no idea what to do in this situation yet, just
set this register to 0 and initialize DRAM in the same way as on any
normal reboot (discarding whatever was stored there).

This part of code was apparently used by the Allwinner boot0 bootloader
to handle resume from the so-called super-standby mode. But this
particular code got somehow mangled on the way from the boot0 bootloader
to the u-boot-sunxi bootloader and has no chance of doing anything even
remotely sane. For example:
1. in the original boot0 code we had "mctl_write_w(SDR_DPCR,
   0x16510000)" (write to the register) and in the u-boot it now looks
   like "setbits_le32(&dram->ppwrsctl, 0x16510000)" (set bits in the
   register)
2. in the original boot0 code it was issuing three commands "0x12, 0x17,
   0x13" (Self-Refresh entry, Self-Refresh exit, Refresh), but in the
   u-boot they have become "0x12, 0x12, 0x13" (Self-Refresh entry,
   Self-Refresh entry, Refresh)

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: dram: Remove useless 'dramc_scan_dll_para()' function
Siarhei Siamashka [Sun, 3 Aug 2014 02:32:39 +0000 (05:32 +0300)]
sunxi: dram: Remove useless 'dramc_scan_dll_para()' function

The attempt to do DRAM parameters calibration in 'dramc_scan_dll_para()'
function by trying different DLL adjustments and using the hardware
DQS gate training result as a feedback is a great source of inspiration,
but it just can't work properly the way it is implemented now. The fatal
problem of this implementation is that the DQS gating window can be
successfully found for almost every DLL delay adjustment setup that
gets tried. Thus making it unable to see any real difference between
'good' and 'bad' settings.

Also this code was supposed to be only activated by setting the highest
bit in the 'dram_tpr3' variable of the 'dram_para' struct (per-board
dram configuration). But none of the linux-sunxi devices has ever used
it for real. Basically, this code is just a dead weight.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: Add environment settings to make extlinux.conf booting work
Hans de Goede [Fri, 1 Aug 2014 07:37:58 +0000 (09:37 +0200)]
sunxi: Add environment settings to make extlinux.conf booting work

Automatic booting using an extlinux.conf file requires various environment
variables to be set.

Also modify CONFIG_SYS_LOAD_ADDR and CONFIG_STANDALONE_LOAD_ADDR to match
the value chosen for kernel_addr_r, see the added comment for why the new
value is chosen.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
9 years agosunxi-common.h: Use new generic $bootcmd
Hans de Goede [Thu, 31 Jul 2014 21:04:45 +0000 (23:04 +0200)]
sunxi-common.h: Use new generic $bootcmd

Use the new standard bootcmd from <config_distro_bootcmd.h>.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
9 years agoconfig: introduce a generic $bootcmd
Dennis Gilmore [Wed, 30 Jul 2014 22:37:14 +0000 (16:37 -0600)]
config: introduce a generic $bootcmd

This generic $bootcmd, and associated support macros, automatically
searches a defined set of storage devices (or network protocols) for an
extlinux configuration file or U-Boot boot script in various standardized
locations. Distros that install such a boot config file/script in those
standard locations will get easy-to-set-up booting on HW that enables
this generic $bootcmd.

Boards can define the set of devices from which boot is attempted, and
the order in which they are attempted. Users may later customize this
set/order by edting $boot_targets.

Users may interrupt the boot process and boot from a specific device
simply by executing e.g.:

$ run bootcmd_mmc1
or:
$ run bootcmd_pxe

This patch was originally written by Dennis Gilmore based on Tegra and
rpi_b boot scripts. I have made the following modifications since then:

* Boards must define the BOOT_TARGET_DEVICES macro in order to specify
  the set of devices (and order) from which to attempt boot. If needed,
  we can define a default directly in config_distro_bootcmd.h.

* Removed $env_import and related variables; nothing used them, and I
  think it's better for boards to pre-load an environment customization
  file using CONFIG_PREBOOT if they need.

* Renamed a bunch of variables to suit my whims:-)

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agosunxi: Kconfig: move common settings into a shared code block
Hans de Goede [Fri, 1 Aug 2014 07:28:24 +0000 (09:28 +0200)]
sunxi: Kconfig: move common settings into a shared code block

SYS_CPU, SYS_BOARD and SYS_SOC are identical for all sunxi boards, move
them to a shared code block.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi-common.h: Don't undef CONFIG_CMD_NET only to redefine it again later
Hans de Goede [Fri, 1 Aug 2014 07:19:55 +0000 (09:19 +0200)]
sunxi-common.h: Don't undef CONFIG_CMD_NET only to redefine it again later

config_distro_defaults.h which is include later will redefine CONFIG_CMD_NET,
drop the useless / meaningless undef of it.

While at also move the undef of CONFIG_CMD_FPGA up to directly under the
include of config_cmd_defaults.h, to make it clear that it overwrites
the setting done from config_cmd_defaults.h .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi-common.h: Don't undefine CONFIG_CMD_NFS
Hans de Goede [Fri, 1 Aug 2014 07:18:20 +0000 (09:18 +0200)]
sunxi-common.h: Don't undefine CONFIG_CMD_NFS

I see no reason to override the choice to include this from
config_cmd_defauls.h .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi-common.h: Remove dead #ifdef CONFIG_CMD_NET code block
Hans de Goede [Fri, 1 Aug 2014 07:16:47 +0000 (09:16 +0200)]
sunxi-common.h: Remove dead #ifdef CONFIG_CMD_NET code block

We undef CONFIG_CMD_NET at line 167, and there is nothing re-defining it
between line 167 and the #ifdef CONFIG_CMD_NET, so remove this effectively
dead block.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi-common.h: Remove CONFIG_SYS_BOOT_GET_CMDLINE
Hans de Goede [Fri, 1 Aug 2014 07:12:53 +0000 (09:12 +0200)]
sunxi-common.h: Remove CONFIG_SYS_BOOT_GET_CMDLINE

sunxi does not need this and it should never have been enabled for it in
the first place.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agolcd: support displaying 24bpp BMPs on >= 24bpp LCDs
Hannes Petermaier [Tue, 15 Jul 2014 14:28:46 +0000 (16:28 +0200)]
lcd: support displaying 24bpp BMPs on >= 24bpp LCDs

most todays LCDs support 32bpp e.g. the framebuffer memory is 32bpp
organized.

To support 24bpp BMPs we need to take only 3 byte from the bpp and set
one byte from the FB to 0.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
9 years agolcd: remove unused lcd_puts_xy
Jeroen Hofstee [Thu, 10 Jul 2014 20:21:11 +0000 (22:21 +0200)]
lcd: remove unused lcd_puts_xy

prevents a clang warning that the function is
never used.

cc: agust@denx.de
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
9 years agovideo: ipu_disp: squash clang warning
Jeroen Hofstee [Tue, 17 Jun 2014 17:20:27 +0000 (19:20 +0200)]
video: ipu_disp: squash clang warning

Since rgb2ycbcr_coeff and friends are declared const, but assigned
to a void pointer, clang will warn that the const is implicity casted
away. If the pointer is changed to void const * gcc will warn when it
is implicitly casted to a const int array. Just add a correctly
typed pointer instead to prevent these casts and hence the warnings.

Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
9 years agovideo: ipu_disp: wait for DP SF end irq when disabling sync BG flows
Liu Ying [Fri, 28 Feb 2014 07:12:25 +0000 (15:12 +0800)]
video: ipu_disp: wait for DP SF end irq when disabling sync BG flows

Instead of waiting for DC triple buffer to be cleared, this patch
changes to wait for a relevant DP sync flow end interrupt to come
when disabling sync BG flows.  In this way, we align the implement
to the freescale internal IPUv3 driver.  After applying this patch,
an uboot hang up issue at the arch_preboot_os() stage, where we
disable a relevant ipu display channel, is not observed any more on
some MX6DL platforms.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
9 years agovideo: Add support for TI's AM335x LCD-Controller
Hannes Petermaier [Thu, 6 Mar 2014 13:39:06 +0000 (14:39 +0100)]
video: Add support for TI's AM335x LCD-Controller

- Adds support for a minimal framebuffer driver of TI's AM335x SoC
  to be compatible with Wolfgang Denk's LCD-Framework (CONFIG_LCD,
  common/lcd.c)

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
9 years agolcd: cleanup unused functions
Hannes Petermaier [Fri, 7 Mar 2014 17:45:20 +0000 (18:45 +0100)]
lcd: cleanup unused functions

This patch removes following two functions:
- lcd_getbgcolor(...)
  not used somewhere outside lcd.c, internally we use now the global
  variable lcd_color_bg (was return value of function before)
- lcd_getfgcolor(...)
  not used in any place of u-boot

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
[agust: rebased]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
9 years agoAdd support for 32-bit organized framebuffers
Hannes Petermaier [Fri, 7 Mar 2014 17:55:40 +0000 (18:55 +0100)]
Add support for 32-bit organized framebuffers

- Adds support for 32-bit organized framebuffers to the LCD-framework.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
Cc: agust@denx.de
9 years agoenv_fat.c: Make sure our buffer is cache aligned
Tom Rini [Fri, 1 Aug 2014 17:59:10 +0000 (13:59 -0400)]
env_fat.c: Make sure our buffer is cache aligned

We must ensure the buffer we read the env into is aligned or we may get
warnings later on.

Signed-off-by: Tom Rini <trini@ti.com>
9 years agobootm: use genimg_get_kernel_addr()
Bryan Wu [Fri, 1 Aug 2014 00:40:00 +0000 (17:40 -0700)]
bootm: use genimg_get_kernel_addr()

Use the new API which is originally taken out from boot_get_kernel
of bootm.c

Signed-off-by: Bryan Wu <pengw@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
[trini: Fix warnings with CONFIG_FIT]
Signed-off-by: Tom Rini <trini@ti.com>
9 years agopxe: detect image format before calling bootm/bootz
Bryan Wu [Fri, 1 Aug 2014 00:39:59 +0000 (17:39 -0700)]
pxe: detect image format before calling bootm/bootz

Trying bootm for zImage will print out several error message which
is not necessary for this case. So detect image format firstly, only
try bootm for legacy and FIT format image then try bootz for others.

This patch needs new function genimg_get_kernel_addr().

Signed-off-by: Bryan Wu <pengw@nvidia.com>
9 years agoimage: introduce genimg_get_kernel_addr()
Bryan Wu [Fri, 1 Aug 2014 00:39:58 +0000 (17:39 -0700)]
image: introduce genimg_get_kernel_addr()

Kernel address is normally stored as a string argument of bootm or bootz.
This function is taken out from boot_get_kernel() of bootm.c, which can be
reused by others.

Signed-off-by: Bryan Wu <pengw@nvidia.com>
[trini: Fix warnings with CONFIG_FIT]
Signed-off-by: Tom Rini <trini@ti.com>
9 years agoget_maintainer.pl: add support for scanning multiple MAINTAINERS files
Daniel Schwierzeck [Fri, 1 Aug 2014 00:24:11 +0000 (02:24 +0200)]
get_maintainer.pl: add support for scanning multiple MAINTAINERS files

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agoget_maintainer.pl: adapt to U-Boot tree
Daniel Schwierzeck [Fri, 1 Aug 2014 00:24:10 +0000 (02:24 +0200)]
get_maintainer.pl: adapt to U-Boot tree

Switch core maintainer to Tom Rini. Adapt directory layout for
git tree detection.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
9 years agoget_maintainer.pl: import script from linux 3.15
Daniel Schwierzeck [Fri, 1 Aug 2014 00:24:09 +0000 (02:24 +0200)]
get_maintainer.pl: import script from linux 3.15

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoMAINTAINERS: add initial version
Daniel Schwierzeck [Fri, 1 Aug 2014 00:24:08 +0000 (02:24 +0200)]
MAINTAINERS: add initial version

MAINTAINERS contains all currently known custodians based on
infos from wiki [1] and u-boot git forks [2].

[1] http://www.denx.de/wiki/U-Boot/Custodians
[2] http://git.denx.de/?p=u-boot.git;a=forks

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agolib: lmb: fix overflow in __lmb_alloc_base w/ large RAM
Stephen Warren [Thu, 31 Jul 2014 19:40:07 +0000 (13:40 -0600)]
lib: lmb: fix overflow in __lmb_alloc_base w/ large RAM

If a 32-bit system has 2GB of RAM, and the base address of that RAM is
2GB, then start+size will overflow a 32-bit value (to a value of 0).

__lmb_alloc_base is affected by this; it calculates the minimum of
(start+size of RAM) and max_addr. However, when start+size is 0, it
is always less than max_addr, which causes the value of max_addr not
to be taken into account when restricting the allocation's location.

Fix this by calculating start+size separately, and if that calculation
underflows, using -1 (interpreted as the max unsigned value) as the
value instead, and then taking the min of that and max_addr. Now that
start+size doesn't overflow, it's typically large, and max_addr
dominates the min() call, and is taken into account.

The user-visible symptom of this bug is that CONFIG_BOOTMAP_SZ is ignored
on Tegra124 systems with 2GB of RAM, which in turn causes the DT to be
relocated at the very end of RAM, which the ARM Linux kernel doesn't map
during early boot, and which causes boot failures. With this fix,
CONFIG_BOOTMAP_SZ correctly restricts the relocated DT to a much lower
address, and everything works.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agoARM: rpi_b: use new generic $bootcmd
Stephen Warren [Wed, 30 Jul 2014 22:37:16 +0000 (16:37 -0600)]
ARM: rpi_b: use new generic $bootcmd

Replace the custom $bootcmd with that from <config_distro_bootcmd.h>.
There should be no functional change, since the new generic $bootcmd was
derived strongly from tegra-common-post.h, after which this part of
rpi_b.h was modelled.

The #defines to enable/disable U-Boot commands/features were moved
earlier in rpi_b.h, so they are set up before config_distro_bootcmd.h
is included, since it tests whether certain features should be included
based on those defines.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoARM: tegra: use new generic $bootcmd
Stephen Warren [Wed, 30 Jul 2014 22:37:15 +0000 (16:37 -0600)]
ARM: tegra: use new generic $bootcmd

Replace the custom $bootcmd with that from <config_distro_bootcmd.h>.
There should be no functional change, since the new generic $bootcmd was
derived strongly from tegra-common-post.h.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoconfig: introduce a generic $bootcmd
Dennis Gilmore [Wed, 30 Jul 2014 22:37:14 +0000 (16:37 -0600)]
config: introduce a generic $bootcmd

This generic $bootcmd, and associated support macros, automatically
searches a defined set of storage devices (or network protocols) for an
extlinux configuration file or U-Boot boot script in various standardized
locations. Distros that install such a boot config file/script in those
standard locations will get easy-to-set-up booting on HW that enables
this generic $bootcmd.

Boards can define the set of devices from which boot is attempted, and
the order in which they are attempted. Users may later customize this
set/order by edting $boot_targets.

Users may interrupt the boot process and boot from a specific device
simply by executing e.g.:

$ run bootcmd_mmc1
or:
$ run bootcmd_pxe

This patch was originally written by Dennis Gilmore based on Tegra and
rpi_b boot scripts. I have made the following modifications since then:

* Boards must define the BOOT_TARGET_DEVICES macro in order to specify
  the set of devices (and order) from which to attempt boot. If needed,
  we can define a default directly in config_distro_bootcmd.h.

* Removed $env_import and related variables; nothing used them, and I
  think it's better for boards to pre-load an environment customization
  file using CONFIG_PREBOOT if they need.

* Renamed a bunch of variables to suit my whims:-)

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agorsa: Fix two errors in the implementation
Simon Glass [Wed, 30 Jul 2014 16:00:17 +0000 (10:00 -0600)]
rsa: Fix two errors in the implementation

1. Failure to set the return code correctly
2. Failure to detect the loop end condition when the value is equal to
the modulus.

Reported-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoomap: clean-up dead configs
Masahiro Yamada [Wed, 30 Jul 2014 10:11:41 +0000 (19:11 +0900)]
omap: clean-up dead configs

The following configs are not defined at all.

 - CONFIG_OMAP1510
 - CONFIG_OMAP_1510P1
 - CONFIG_OMAP_SX1
 - CONFIG_OMAP3_DMA
 - CONFIG_OMAP3_ZOOM2
 - CONFIG_OMAP_INNOVATOR

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Rini <trini@ti.com>
9 years agofdt: Sync up with libfdt
Simon Glass [Wed, 30 Jul 2014 09:59:03 +0000 (03:59 -0600)]
fdt: Sync up with libfdt

This brings in changes up to commit f9e91a48 in the libfdt repo.
Mostly this is whitespace/minor changes. But there are a few new
features:

- fdt_size_cells() and fdt_address_cells()
- fdt_resize()

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agofdt: Rename fdt_resize() to fdt_shrink_to_minimum()
Simon Glass [Wed, 30 Jul 2014 09:59:02 +0000 (03:59 -0600)]
fdt: Rename fdt_resize() to fdt_shrink_to_minimum()

Since libfdt now has an fdt_resize() function, we need to rename the
U-Boot one.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agocosmetic: update doc/README.scrapyard
Masahiro Yamada [Tue, 29 Jul 2014 10:41:24 +0000 (19:41 +0900)]
cosmetic: update doc/README.scrapyard

- Add 'p1023rds' to the list since commit d0bc5140 dropped
   the board support but missed to update this file
 - Fill the Commit and Removed Date fields for boards removed
   by earlier commits
 - Move 'incaip' to keep the list sorted in reverse
   chronological order
 - Describe the soring rule in the comment block:
   "The list should be sorted in reverse chronological order."
 - Fix typos in the comment block

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agoext4load: fix help text
Pavel Machek [Tue, 29 Jul 2014 10:37:25 +0000 (12:37 +0200)]
ext4load: fix help text

Fix ext4load help text.

Signed-off-by: Pavel Machek <pavel@denx.de>
9 years agogit-mailrc: Add myself as dm maintainer
Simon Glass [Tue, 29 Jul 2014 06:03:12 +0000 (00:03 -0600)]
git-mailrc: Add myself as dm maintainer

Add a subsystem entry for dm with myself as maintainer.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agogit-mailrc: Change fdt maintainer
Simon Glass [Tue, 29 Jul 2014 06:03:11 +0000 (00:03 -0600)]
git-mailrc: Change fdt maintainer

Add myself as fdt maintainer.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agonet: BOOTP retry timeout improvements
Stephen Warren [Fri, 25 Jul 2014 23:30:48 +0000 (17:30 -0600)]
net: BOOTP retry timeout improvements

Currently, the BOOTP code sends out its initial request as soon as the
Ethernet driver indicates "link up". If this packet is lost or not
replied to for some reason, the code waits for a 1s timeout before
retrying. For some reason, such early packets are often lost on my
system, so this causes an annoying delay.

To optimize this, modify the BOOTP code to have very short timeouts for
the first packet transmitted, but gradually increase the timeout each
time a timeout occurs. This way, if the first packet is lost, the second
packet is transmitted quite quickly and hence the overall delay is low.
However, if there's still no response, we don't keep spewing out packets
at an insane speed.

It's arguably more correct to try and find out why the first packet is
lost. However, it seems to disappear inside my Ethenet chip; the TX chip
indicates no error during TX (not that it has much in the way of
reporting...), yet wireshark on the RX side doesn't see any packet.
FWIW, I'm using an ASIX USB Ethernet adapter. Perhaps "link up" is
reported too early or based on the wrong condition in HW, and we should
add some fixed extra delay into the driver. However, this would slow down
every link up event even if it ends up not being needed in some cases.
Having BOOTP retry quickly applies the fix/WAR to every possible
Ethernet device, and is quite simple to implement, so seems a better
solution.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agoemif.h: remove duplicated argument to |
maxin.john@enea.com [Thu, 24 Jul 2014 12:09:05 +0000 (14:09 +0200)]
emif.h: remove duplicated argument to |

Remove the duplicated argument to | in two places. Reported
by Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Maxin B. John <maxin.john@enea.com>
9 years agovitesse: remove duplicated argument to ||
maxin.john@enea.com [Thu, 24 Jul 2014 10:26:05 +0000 (12:26 +0200)]
vitesse: remove duplicated argument to ||

Remove the duplicated argument to || check

Signed-off-by: Maxin B. John <maxin.john@enea.com>
9 years agoboard_r: Add missing return to initr_doc
Ian Campbell [Thu, 24 Jul 2014 08:29:57 +0000 (09:29 +0100)]
board_r: Add missing return to initr_doc

I happened to spot this while working in the area.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Acked-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
9 years agoMakefile: use u-boot.map for binary_size_check
Chris Packham [Thu, 24 Jul 2014 05:27:07 +0000 (17:27 +1200)]
Makefile: use u-boot.map for binary_size_check

u-boot.map is generated automatically by the compiler and more
importantly can handle addresses >4GB.

9 years agoMakefile: use $(shell ...) for determining file_size
Chris Packham [Thu, 24 Jul 2014 00:44:25 +0000 (12:44 +1200)]
Makefile: use $(shell ...) for determining file_size

file_size was being calculated using back-ticks but map_size uses
$(shell ...). Update the file_size calculation to use $(shell ...).

From: Jeroen Hofstee <jeroen@myspectrum.nl>

The binary_size_check target relies on stat -c %s
to return the size of u-boot.bin. This only works
with GNU stat though. Use wc instead.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agopxe: clear Bootfile before returning
Stephen Warren [Wed, 23 Jul 2014 00:06:46 +0000 (18:06 -0600)]
pxe: clear Bootfile before returning

When "pxe boot" downloads the initrd/kernel/DTB, netboot_common() saves
the downloaded filename to global variable BootFile. If the boot
operation is aborted, this global state is not cleared. If "dhcp" is
executed later without any arguments, BootFile is not cleared, and when
the DHCP response is received, BootpCopyNetParams() writes the value into
environment variable bootfile.

This causes the following scenario:

* Boot script executes dhcp; pxe get; pxe boot

* User CTRL-C's the PXE menu, which causes the first menu item to be
  booted, which causes some file to be downloaded.

  (This boot-on-CTRL-C behaviour is arguably a bug too, but it's a
  separate bug and the bug this patch fixes would still exist if the user
  simply waited to press CTRL-C until "pxe boot" started downloading
  files)

* User CTRL-C's the file downloads, but the filename is still written to
  the bootfile environment variable.

* User re-runs the boot command, which in my case executes "dhcp; pxe get;
  pxe boot" again, and "dhcp" picks up the saved bootfile environment
  variable and proceeds to download a file that it shouldn't.

To solve this, modify the implementation of "pxe get" to clear BootFile
if the whole boot operation fails, which avoids this whole mess.

An alternative would be to modify netboot_common() such that the no-
arguments case explicitly clears the global variable BootFile. However,
that would prevent the following command sequences from working:

$ dhcp filename # downloads "filename"
$ dhcp          # downloads $bootfile, i.e. "filename"

or:
$ setenv bootfile filename
$ dhcp          # downloads $bootfile, i.e. "filename"

... and I assume someone relies on U-Boot working that way.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agodoc: README.android-fastboot: Add note about vendor ID
Barnes, Clifton A [Tue, 22 Jul 2014 15:23:56 +0000 (11:23 -0400)]
doc: README.android-fastboot: Add note about vendor ID

The Android fastboot client only communicates with specific vendor IDs.
This addition to the documentation points out that fact so everyone is
aware that not just any vendor ID will work and where to find the IDs
that will.

Signed-off-by: Clifton Barnes <cabarnes@indesign-llc.com>
Cc: Rob Herring <robh@kernel.org>
9 years agoext4: trats: trats2: Modify dfu_alt_info's file names to have absolute path
Łukasz Majewski [Tue, 22 Jul 2014 08:17:06 +0000 (10:17 +0200)]
ext4: trats: trats2: Modify dfu_alt_info's file names to have absolute path

After the clean up performed in the commit 1151b7ac10b81ecbb the DFU subsystem
requires absolute patch for correct operation.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agoImplement generalised RSA public exponents for verified boot
Michael van der Westhuizen [Wed, 2 Jul 2014 08:17:26 +0000 (10:17 +0200)]
Implement generalised RSA public exponents for verified boot

Remove the verified boot limitation that only allows a single
RSA public exponent of 65537 (F4).  This change allows use with
existing PKI infrastructure and has been tested with HSM-based
PKI.

Change the configuration OF tree format to store the RSA public
exponent as a 64 bit integer and implement backward compatibility
for verified boot configuration trees without this extra field.

Parameterise vboot_test.sh to test different public exponents.

Mathematics and other hard work by Andrew Bott.

Tested with the following public exponents: 3, 5, 17, 257, 39981,
50457, 65537 and 4294967297.

Signed-off-by: Andrew Bott <Andrew.Bott@ipaccess.com>
Signed-off-by: Andrew Wishart <Andrew.Wishart@ipaccess.com>
Signed-off-by: Neil Piercy <Neil.Piercy@ipaccess.com>
Signed-off-by: Michael van der Westhuizen <michael@smart-africa.com>
Cc: Simon Glass <sjg@chromium.org>
9 years agoserial: sh: Add support External Clock mode
Nobuhiro Iwamatsu [Mon, 28 Jul 2014 06:07:44 +0000 (15:07 +0900)]
serial: sh: Add support External Clock mode

R8A7780 and R7A7791 of rmobile supports External Clock mode, and these uses
different from Internal Clock mode registers and calculations to the baud rate
setting. This adds function for External Clock mode.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
9 years agoserial: sh: Add support DL and CKS register for R8A7794
Nobuhiro Iwamatsu [Mon, 28 Jul 2014 06:07:43 +0000 (15:07 +0900)]
serial: sh: Add support DL and CKS register for R8A7794

R8A7794 has DL and CKS register, and these registers are used in external clock
mode. This adds support these for R8A7794.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
9 years agousb: ehci: rmobile: Remove xHCI address
Nobuhiro Iwamatsu [Mon, 28 Jul 2014 06:29:31 +0000 (15:29 +0900)]
usb: ehci: rmobile: Remove xHCI address

echi-rmobile does not support xHCI. This removes xHCI address
from address table. And this revise a value of CONFIG_USB_MAX_CONTROLLER_COUNT
for lager board and koelsh board.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
9 years agousb: ehci: rmobile: Add support R8A7794
Nobuhiro Iwamatsu [Thu, 24 Jul 2014 05:52:07 +0000 (14:52 +0900)]
usb: ehci: rmobile: Add support R8A7794

R8A7794 has same IP of USB controller as R8A7790 and R8A7791.
This addes support for R8A7794.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
9 years agodfu: fix readback buffer overflow test
Stephen Warren [Tue, 1 Jul 2014 18:16:57 +0000 (12:16 -0600)]
dfu: fix readback buffer overflow test

The buffer is too small if it's < size to read, not if it's <= the size.
This fixes the 1MB test case on Tegra, which has a 1MB buffer.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agotest: dfu: add some more test cases
Stephen Warren [Tue, 1 Jul 2014 18:16:56 +0000 (12:16 -0600)]
test: dfu: add some more test cases

On Tegra, the DFU buffer size is 1M. Consequently, the 8M test always
fails. Add tests for the 1M size, and one byte less as a corner case,
so that some large tests are executed and expected to pass.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agotest: dfu: cleanup before execution
Stephen Warren [Tue, 1 Jul 2014 18:16:55 +0000 (12:16 -0600)]
test: dfu: cleanup before execution

Call cleanup() before running tests too. If a previous test was CTRL-C'd
some stale files may have been left around. dfu-util refuses to receive
a file to a filename that already exists, which results in false test
failures if the files aren't cleaned up first.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agothor: defer parsing of device string to IO backend
Lukasz Majewski [Mon, 23 Jun 2014 07:39:16 +0000 (09:39 +0200)]
thor: defer parsing of device string to IO backend

Commit d4f5ef59cc7 "dfu: defer parsing of device string to IO backend" changed
the function signature of dfu_init_env_entities(). Adjust cmd_thordown.c
to match that change.

Also, apply the same change as commit d6d37d737b58e "dfu: free entities
when parsing fails" to cmd_thordown.c.

Fixes: d4f5ef59cc7 ("dfu: defer parsing of device string to IO backend")
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
9 years agotest:dfu: README file update
Lukasz Majewski [Fri, 20 Jun 2014 15:53:44 +0000 (17:53 +0200)]
test:dfu: README file update

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agotest: dfu: script enhancements
Stephen Warren [Tue, 10 Jun 2014 22:28:10 +0000 (16:28 -0600)]
test: dfu: script enhancements

Various misc enhancements to dfu_gadget_test.sh:

* After every write (download), perform a write to a different file
  with different data. This ensures that the DFU buffer's content is
  replaced, so that if the read (upload) succeeds, we know that the
  correct data was actually read from the storage device, rather than
  simply being left over in the DFU buffer. This requires two alt
  setting names to be passed to the script, and a dummy data file to
  be generated by dfu_gadget_test_init.sh.

* Fix the assumption that dfu_gadget_test.sh is run from the directory
  that contains it, by cd'ing to that directory before invoking
  ./dfu_gadget_test_init.sh.

* Use $DIR$RCV_DIR consistently, rather than using plain $RCV_DIR in
  some places.

* Add 959, 961 test file sizes, to be consistent with having one
  more than and one less than all the other "round" sizes 64, 128, and
  4096.

* Remove references to $BKP_DIR from dfu_gadget_test_init.sh, since it
  isn't used.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agotest:dfu: Add test scripts for testing DFU regression
Lukasz Majewski [Wed, 18 Jun 2014 09:38:56 +0000 (11:38 +0200)]
test:dfu: Add test scripts for testing DFU regression

This commit adds test scripts for testing if any commit has introduced
regression to the DFU subsystem.

It uses md5 to test if sent and received file is correct.
The test detailed description is available at README file.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agodfu: add SF backend
Stephen Warren [Wed, 11 Jun 2014 22:03:36 +0000 (16:03 -0600)]
dfu: add SF backend

This allows SPI Flash to be programmed using DFU.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agodfu: add free_entity() to struct dfu_entity
Stephen Warren [Wed, 11 Jun 2014 22:03:35 +0000 (16:03 -0600)]
dfu: add free_entity() to struct dfu_entity

This allows the backend to free any resources allocated during the
relevant dfu_fill_entity_*() call. This will soon be used by the
SF backend.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agodfu: allow backend to specify a maximum buffer size
Stephen Warren [Wed, 11 Jun 2014 22:03:34 +0000 (16:03 -0600)]
dfu: allow backend to specify a maximum buffer size

CONFIG_SYS_DFU_DATA_BUF_SIZE may be large to allow for FAT/ext layouts
to transfer large files. However, this means that individual write
operations will take a long time. Allow backends to specify a maximum
buffer size, so that each write operation is limited to a smaller data
block. This prevents the DFU protocol from timing out when e.g. writing
to SPI flash. I would guess that NAND might benefit from setting this
value too, but I can't test that.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agodfu: defer parsing of device string to IO backend
Stephen Warren [Wed, 11 Jun 2014 22:03:33 +0000 (16:03 -0600)]
dfu: defer parsing of device string to IO backend

Devices are not all identified by a single integer. To support
this, defer the parsing of the device string to the IO backed, so that
it can apply the appropriate rules.

SPI devices are specified as controller:chip_select. SPI/SF support will
be added soon.

MMC devices can also be specified as controller[.hwpart][:partition] in
many commands, although we don't support that syntax in DFU.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agodfu: add write error handling
Stephen Warren [Wed, 11 Jun 2014 18:48:08 +0000 (12:48 -0600)]
dfu: add write error handling

Fix calls to dfu_write() and dfu_flush() to detect errors in the I/O
itself. This could happen due to problems with the storage medium, or
simply when trying to write a FAT/ext file that is larger than the buffer
dfu_mmc.c maintains for this purpose.

Signal the error by switching the DFU state/status. This will be picked
up by the DFU client when it sends the next DFU request. Note that errors
can't simply be returned from e.g. dnload_request_complete(), since that
function has no way to pass errors back to the DFU client; a call to
dnload_request_complete() simply means that a USB OUT completed.

This error state/status needs to be cleared when the next DFU client
connects. While there is a DFU_CLRSTATUS request, no DFU client seems to
send this. Hence, clear this when selecting the USB alternate setting on
the USB interface.

Finally, dfu.c relies on a call to dfu_flush() to clear up the internal
state of the write transaction. Now that errors in dfu_write() are
detected, dfu_flush() may no longer be called for every transaction.
Separate out the cleanup code into a new function, and call it whenever
dfu_write() fails, as well as from any call to dfu_flush().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agodfu: fix some issues with reads/uploads
Stephen Warren [Wed, 11 Jun 2014 18:47:27 +0000 (12:47 -0600)]
dfu: fix some issues with reads/uploads

DFU read support appears to rely upon dfu->read_medium() updating the
passed-by-reference len parameter to indicate the remaining size
available for reading.

dfu_read_medium_mmc() never does this, and the implementation of
dfu_read_medium_nand() will only work if called just once; it hard-codes
the value to the total size of the NAND device irrespective of read
offset.

I believe that overloading dfu->read_medium() is confusing. As such,
this patch introduces a new function dfu->get_medium_size() which can
be used to explicitly find out the medium size, and nothing else.
dfu_read() is modified to use this function to set the initial value for
dfu->r_left, rather than attempting to use the side-effects of
dfu->read_medium() for this purpose.

Due to this change, dfu_read() must initially set dfu->b_left to 0, since
no data has been read.

dfu_read_buffer_fill() must also be modified not to adjust dfu->r_left
when simply copying data from dfu->i_buf_start to the upload request
buffer. r_left represents the amount of data left to be read from HW.
That value is not affected by the memcpy(), but only by calls to
dfu->read_medium().

After this change, I can read from either a 4MB or 1.5MB chunk of a 4MB
eMMC boot partion with CONFIG_SYS_DFU_DATA_BUF_SIZE==1MB. Without this
change, attempting to do that would result in DFU read returning no data
at all due to r_left never being set.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agofs: implement size/fatsize/ext4size
Stephen Warren [Wed, 11 Jun 2014 18:47:26 +0000 (12:47 -0600)]
fs: implement size/fatsize/ext4size

These commands may be used to determine the size of a file without
actually reading the whole file content into memory. This may be used
to determine if the file will fit into the memory buffer that will
contain it. In particular, the DFU code will use it for this purpose
in the next commit.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agoMerge branch 'u-boot-sunxi/master' into 'u-boot-arm/master'
Albert ARIBAUD [Sat, 9 Aug 2014 14:48:34 +0000 (16:48 +0200)]
Merge branch 'u-boot-sunxi/master' into 'u-boot-arm/master'

9 years agosupport blackfin board initialization in generic board_f
Sonic Zhang [Thu, 17 Jul 2014 11:01:34 +0000 (19:01 +0800)]
support blackfin board initialization in generic board_f

- init hardware watchdog if applicable
- use CONFIG_SYS_MONITOR_LEN as the gd monitor len for Blackfin
- reserve u-boot memory at the top field of the RAM for Blackfin
- avoid refer to CONFIG_SYS_MONITOR_LEN, which is not defined by Blackfin

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
9 years agoblackfin: convert blackfin board_f and board_r to use generic board init functions
Sonic Zhang [Thu, 17 Jul 2014 11:00:29 +0000 (19:00 +0800)]
blackfin: convert blackfin board_f and board_r to use generic board init functions

- move blackfin specific cpu init code from blackfin board.c to cpu.c
- remove blackfin specific board init code and invoke generic board_f fron cpu init entry
- rename section name bss_vma to bss_start in order to match the generic board init code
- add a fake relocate_code function to set up the new stack only

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
9 years agoblackfin: spi clock is in sysclk1 domain instead of sysclk0
Scott Jiang [Fri, 30 May 2014 08:43:34 +0000 (16:43 +0800)]
blackfin: spi clock is in sysclk1 domain instead of sysclk0

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
9 years agobfin: add register define required by core B on dual core BF609 processor
Aaron Wu [Wed, 30 Jul 2014 06:39:17 +0000 (14:39 +0800)]
bfin: add register define required by core B on dual core BF609 processor

Add register define required by core B on dual core BF609 processor.

Signed-off-by: Aaron Wu <Aaron.wu@analog.com>
9 years agoPrepare v2014.10-rc1 v2014.10-rc1
Tom Rini [Wed, 6 Aug 2014 12:52:10 +0000 (08:52 -0400)]
Prepare v2014.10-rc1

Signed-off-by: Tom Rini <trini@ti.com>
9 years agoChange Andy Fleming's email address
Andy Fleming [Fri, 25 Jul 2014 22:39:08 +0000 (17:39 -0500)]
Change Andy Fleming's email address

Messages to afleming@freescale.com now bounce, and should be
directed to my personal address at afleming@gmail.com

Signed-off-by: Andy Fleming <afleming@gmail.com>
9 years agoThe _config target is not present anymore, mention _defconfig instead
Holger Freyther [Mon, 4 Aug 2014 07:26:05 +0000 (09:26 +0200)]
The _config target is not present anymore, mention _defconfig instead

The _config part is gone for sure, the _defconfig target could at least
work. I have not verified this for all targets though.

9 years agogit-mailrc: add a kconfig alias
Stephen Warren [Thu, 31 Jul 2014 23:30:03 +0000 (17:30 -0600)]
git-mailrc: add a kconfig alias

It's easier to Cc Masahiro on Kconfig-related changes with a git-mailrc
alias.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agodoc: README.SPL: adjust for Kbuild and Kconfig
Masahiro Yamada [Tue, 5 Aug 2014 06:25:06 +0000 (15:25 +0900)]
doc: README.SPL: adjust for Kbuild and Kconfig

Reflect the latest build system to doc/README.SPL.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agodoc: delete README.ARM-SoC
Masahiro Yamada [Tue, 5 Aug 2014 06:25:32 +0000 (15:25 +0900)]
doc: delete README.ARM-SoC

This document is too old and useless.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agoMerge branch 'master' of git://git.denx.de/u-boot-spi
Tom Rini [Tue, 5 Aug 2014 21:16:16 +0000 (17:16 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-spi

9 years agoMerge branch 'master' of git://git.denx.de/u-boot-mpc85xx
Tom Rini [Mon, 4 Aug 2014 17:35:50 +0000 (13:35 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx

9 years agospi, spi_mxc: do not hang in spi_xchg_single
Heiko Schocher [Mon, 14 Jul 2014 08:22:11 +0000 (10:22 +0200)]
spi, spi_mxc: do not hang in spi_xchg_single

if status register do never set MXC_CSPICTRL_TC, spi_xchg_single
endless loops. Add a timeout here to prevent endless hang.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Dirk Behme <dirk.behme@gmail.com>
Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>