pandora-u-boot.git
12 years agoarm, davinci: perform check for initializing global data and serial init
Lad, Prabhakar [Sun, 24 Jun 2012 21:35:18 +0000 (21:35 +0000)]
arm, davinci: perform check for initializing global data and serial init

initialize baudrate, flags, data and serial initialization,
only when CONFIG_SPL_LIBCOMMON_SUPPORT is defined.

Tested-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
Acked-by: Christian Riesch <christian.riesch@omicron.at>
12 years agoda850/omap-l138: Make MMC and NOR support mutually exclusive
Rajashekhara, Sudhakar [Sun, 24 Jun 2012 21:35:17 +0000 (21:35 +0000)]
da850/omap-l138: Make MMC and NOR support mutually exclusive

On Logic PD Rev.3 DA850/OMAP-L138 EVM, NOR and MMC/SD cannot
work together. This patch enables the MMC/SD support only
when NOR support is disabled. NOR Flash identification works
even without this patch, but erase and write will have issues.

Tested-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
12 years agoda850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM
Rajashekhara, Sudhakar [Sun, 24 Jun 2012 21:35:16 +0000 (21:35 +0000)]
da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM

AHCLKR/UART1_RTS/GP0[11] pin needs to be configured for
MMC and NOR to work on DA850/OMAP-L138 Rev.3 EVM. When
GP0[11] is low, the SD0 interface will not work, but NOR
flash will. When GP0[11] is high, SD0 will work but NOR
flash will not.

Tested-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
12 years agoda850/omap-l138: Add MMC support for DA850/OMAP-L138
Lad, Prabhakar [Sun, 24 Jun 2012 21:35:15 +0000 (21:35 +0000)]
da850/omap-l138: Add MMC support for DA850/OMAP-L138

This patch adds support for MMC/SD on DA850/OMAP-L138.

Tested-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
12 years agoomap: am33xx: enable gpio support
Steve Sakoman [Mon, 4 Jun 2012 05:35:34 +0000 (05:35 +0000)]
omap: am33xx: enable gpio support

This patch uses the code in omap-common to support gpio modules 1-3
on am33xx based boards.

It adds base address and register definitions, enables clocks to the
modules, and enables building the common gpio code for CONFIG_AM33XX
as well as CONFIG_OMAP

Signed-off-by: Steve Sakoman <steve@sakoman.com>
12 years agoomap: am335x_evm: remove unused definitions
Steve Sakoman [Mon, 4 Jun 2012 05:26:14 +0000 (05:26 +0000)]
omap: am335x_evm: remove unused definitions

UART_RESET, UART_CLK_RUNNING_MASK, and UART_SMART_IDLE_EN
are defined inn evm.c but not used. Also removes unnecessary
include of serial.h

PHYS_DRAM_1_SIZE is defined in am335x_evm.h but never used.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
12 years agoOMAP3: mcx: read hot-water-button after reset
Stefano Babic [Wed, 13 Jun 2012 22:34:44 +0000 (22:34 +0000)]
OMAP3: mcx: read hot-water-button after reset

Detect hot-water-button to start a differnt image.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <trini@ti.com>
12 years agoOMAP3: mcx: updated default environment
Stefano Babic [Wed, 13 Jun 2012 22:34:43 +0000 (22:34 +0000)]
OMAP3: mcx: updated default environment

Patch drops also not used CFI setup in the
configuration file.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <trini@ti.com>
12 years agoOMAP3: mcx: set pinmux for uart4
Stefano Babic [Wed, 13 Jun 2012 22:34:42 +0000 (22:34 +0000)]
OMAP3: mcx: set pinmux for uart4

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <trini@ti.com>
12 years agomcx: increased buffer for command line
Stefano Babic [Wed, 13 Jun 2012 22:34:41 +0000 (22:34 +0000)]
mcx: increased buffer for command line

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <trini@ti.com>
12 years agoarm: omap3: cm-t35: minor comment and printf change
Igor Grinberg [Wed, 13 Jun 2012 19:41:40 +0000 (19:41 +0000)]
arm: omap3: cm-t35: minor comment and printf change

Fix the comment to reflect the actual function call time.
Change the printf message to look nicer in the context it might be printed.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
12 years agohawkboard/omapl-138: Add support for generating ais image for hawkboard
Sughosh Ganu [Wed, 13 Jun 2012 08:39:06 +0000 (08:39 +0000)]
hawkboard/omapl-138: Add support for generating ais image for hawkboard

Parameters used for configuring certain SoC peripherals are parsed
from the cfg file and appended as part of the ais image's header. The
u-boot-spl.ais generated is flashed separately to the nand, so do not
delete the file after generation of u-boot.ais.

Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
12 years agoomap24xx_i2c: add 2-byte address support
Ilya Yanok [Fri, 8 Jun 2012 03:12:09 +0000 (03:12 +0000)]
omap24xx_i2c: add 2-byte address support

Various devices like EEPROMs require 2-byte address support to
be properly accessed. This patch adds this support for OMAP2/3/4
I2C controller driver.
I've tested it with EEPROM (16 bit address) and TPS65217 chip
(8 bit address) on TI Beaglebone board.

Unfortunately I don't have access to any compatible hardware
with 16bit data register so I can't test if those #ifdef
clauses really work.

CC: Tom Rini <trini@ti.com>
Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
12 years agoCREDITS: Add credits for MCF5249 initialization code
Jeremy Andrus [Mon, 13 Aug 2012 14:49:51 +0000 (14:49 +0000)]
CREDITS: Add credits for MCF5249 initialization code

Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years agoConsolidate bootcount code into drivers/bootcount
Stefan Roese [Thu, 16 Aug 2012 17:55:41 +0000 (17:55 +0000)]
Consolidate bootcount code into drivers/bootcount

This patch moves all bootcount implementations into a common
directory: drivers/bootcount. The generic bootcount driver
is now usable not only by powerpc platforms, but others as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Cc: Christian Riesch <christian.riesch@omicron.at>
Cc: Manfred Rudigier <manfred.rudigier@omicron.at>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
Tested-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Tested-by: Christian Riesch <christian.riesch@omicron.at>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agompc52xx: remove o2dnt board
Anatolij Gustschin [Fri, 31 Aug 2012 01:30:44 +0000 (01:30 +0000)]
mpc52xx: remove o2dnt board

Remove old o2dnt board without OF support. New support for this board
is added by the previous patch, O2I configuration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agompc52xx: add common o2dnt and o2dnt2 support and configurations
Anatolij Gustschin [Fri, 31 Aug 2012 01:29:57 +0000 (01:29 +0000)]
mpc52xx: add common o2dnt and o2dnt2 support and configurations

Add common code for o2dnt and o2dnt2 based boards and add different
board configuration files for O2D, O2I, O2DNT2, O2D300, O2MNT and
O3DNT boards.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agompc5xxx: add GPIO port configuration
Anatolij Gustschin [Sun, 12 Aug 2012 23:38:10 +0000 (23:38 +0000)]
mpc5xxx: add GPIO port configuration

Add posibility for board specifig GPIO configurations using
various CONFIG_SYS_ macros.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agompc5xxx: add pci_mpc5xxx_init prototype to common header
Anatolij Gustschin [Sun, 12 Aug 2012 23:38:09 +0000 (23:38 +0000)]
mpc5xxx: add pci_mpc5xxx_init prototype to common header

Add pci_mpc5xxx_init() prototype to the header file, so board .c files
do not need to add extern pci_mpc5xxx_init() declaration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Wolfgang Denk [Sat, 1 Sep 2012 12:09:41 +0000 (14:09 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

* 'master' of git://git.denx.de/u-boot-sh:
  sh: tmu: Removed arch/sh/include/asm/clk.h
  sh: tmu: Changed switch statement to shift operation
  sh: tmu: Changed TMU driver using array of structures

Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years agoMerge branch 'sf' of git://git.denx.de/u-boot-blackfin
Wolfgang Denk [Sat, 1 Sep 2012 10:22:31 +0000 (12:22 +0200)]
Merge branch 'sf' of git://git.denx.de/u-boot-blackfin

* 'sf' of git://git.denx.de/u-boot-blackfin:
  sf: spansion: Add support for S25FL256S
  sf: winbond: fix page_size
  sf: stmicro: add support for N25Q128A
  sf: stmicro: add support N25Q128 parts
  sf: stmicro: support JEDEC standard two-byte signature
  sf: winbond: add W25Q32
  cmd_spi: remove superfluous semicolon

Signed-off-by: Wolfgang Denk <wd@denx.de>
13 years agoMIPS: add support for qemu for little endian MIPS32 CPUs
Daniel Schwierzeck [Thu, 23 Aug 2012 21:47:02 +0000 (23:47 +0200)]
MIPS: add support for qemu for little endian MIPS32 CPUs

Tested with 'qemu-system-mipsel -machine mips -bios u-boot.bin -nographic'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
13 years agoMIPS: move CONFIG_STANDALONE_LOAD_ADDR to CPU config makefiles
Daniel Schwierzeck [Tue, 21 Aug 2012 21:38:25 +0000 (23:38 +0200)]
MIPS: move CONFIG_STANDALONE_LOAD_ADDR to CPU config makefiles

Prepare for upcoming MIPS64 CPU support.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
13 years agoMIPS: factor out endianess flag handling to arch config.mk
Daniel Schwierzeck [Tue, 21 Aug 2012 21:27:37 +0000 (23:27 +0200)]
MIPS: factor out endianess flag handling to arch config.mk

This is CPU independent and should be configured architecture-wide.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
13 years agopowerpc/mpc85xx/p1_p2_rdb: add all LAWs during SPL
Scott Wood [Wed, 8 Aug 2012 15:06:18 +0000 (15:06 +0000)]
powerpc/mpc85xx/p1_p2_rdb: add all LAWs during SPL

LAW init is skipped in the SPL payload because it's assumed that the SPL
has taken care of it -- so make sure the SPL loads all the LAWs as is
done on other boards.

This bug was introduced by:

  commit 4589728e214958a4e6e011a081a68d360c49d7a5
  Author: Kumar Gala <galak@kernel.crashing.org>
  Date:   Fri Nov 11 08:14:53 2011 -0600

    powerpc/85xx: Fix builds of P1020/P2020RDB-PC_36BIT_NAND

    Size grew a bit so nand-spl didn't fit in 4k, reduce done by removing
    LAW entries not needed during SPL phase.

Signed-off-by: Scott Wood <scottwood@freescale.com>
13 years agoRevert "powerpc: Fix declaration type for I/O functions"
Andy Fleming [Thu, 23 Aug 2012 17:00:31 +0000 (12:00 -0500)]
Revert "powerpc: Fix declaration type for I/O functions"

This reverts commit 20959471b5d07fdeb8603b918d80385aa2954711.

13 years agopowerpc/p1_p2_rdb_pc: print -PC suffix in board name
Scott Wood [Mon, 20 Aug 2012 13:16:30 +0000 (13:16 +0000)]
powerpc/p1_p2_rdb_pc: print -PC suffix in board name

Currently the -PC variants of the P1/P2 RDB boards do not print it on boot --
e.g. a P2020RDB-PC will claim to be a plain P2020RDB.  Besides being incorrect,
this can confuse a user into building U-Boot for P2020RDB rather than P2020RDB-PC,
resulting in a board that does not boot.

P1024RDB and P1025RDB are not included, as these boards apparently do not
have -PC as part of their name, even though they are supported by p1_p2_rdb_pc.

The P2020RDB variant covered by this is apparently P2020RDB-PCA rather
than P2020RDB-PC.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/85xx: clear out TLB on boot
Scott Wood [Mon, 20 Aug 2012 13:10:08 +0000 (13:10 +0000)]
powerpc/85xx: clear out TLB on boot

Instead of just shooting down the entry that covers CCSR, clear out
every TLB entry that isn't the one that we're executing out of.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx: Move HWCONFIG_BUFFER_SIZE into config.h
York Sun [Fri, 17 Aug 2012 09:00:54 +0000 (09:00 +0000)]
powerpc/mpc8xxx: Move HWCONFIG_BUFFER_SIZE into config.h

Before proper environment is setup, we extract hwconfig and put it into a
buffer with size HWCONFIG_BUFFER_SIZE. We need to enlarge the buffer to
accommodate longer string. Since this macro is used in multiple files, we
move it into arch/powerpc/include/asm/config.h.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx DDR: Fix interactive DDR debugging
York Sun [Fri, 17 Aug 2012 08:22:43 +0000 (08:22 +0000)]
powerpc/mpc8xxx DDR: Fix interactive DDR debugging

Add one more argument to call function readline_into_buffer().
Fix print SPD format for negative values.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx DDR: Fall back to raw timing for first controller only
York Sun [Fri, 17 Aug 2012 08:22:42 +0000 (08:22 +0000)]
powerpc/mpc8xxx DDR: Fall back to raw timing for first controller only

Only the first DIMM of first controller should fall back to raw timing
parameters if SPD is missing or corrupted.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx DDR: Fix CAS latency calculation
York Sun [Fri, 17 Aug 2012 08:22:41 +0000 (08:22 +0000)]
powerpc/mpc8xxx DDR: Fix CAS latency calculation

Empty slot should be skipped when calculating CAS latency.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx: Fix bug for extended DDR timing
York Sun [Fri, 17 Aug 2012 08:22:40 +0000 (08:22 +0000)]
powerpc/mpc8xxx: Fix bug for extended DDR timing

Faster DDR3 timing requires parameters exceeding previously defined
range. Extended parameters are fixed. Added some debug messages.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx: Enable 3-way and 4-way DDR interleaving
York Sun [Fri, 17 Aug 2012 08:22:39 +0000 (08:22 +0000)]
powerpc/mpc8xxx: Enable 3-way and 4-way DDR interleaving

Restructure DDR interleaving option to support 3 and 4 DDR controllers
for 2-, 3- and 4-way interleaving.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx: Add support for cas latency 12 and above
York Sun [Fri, 17 Aug 2012 08:22:38 +0000 (08:22 +0000)]
powerpc/mpc8xxx: Add support for cas latency 12 and above

Required by JEDEC 79-3E for high speed DDR3.
Also change "CSn disabled" message to debug.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx: Add fine timing support for DDR3
York Sun [Fri, 17 Aug 2012 08:22:37 +0000 (08:22 +0000)]
powerpc/mpc8xxx: Add fine timing support for DDR3

When the DDR3 speed goes higher, we need to utilize fine offset
from SPD.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc85xx: Skip zero values for DDR debug registers
York Sun [Fri, 17 Aug 2012 08:22:36 +0000 (08:22 +0000)]
powerpc/mpc85xx: Skip zero values for DDR debug registers

Some debug registers have non-zero default out of reset. If software is
not setting debug registers, skip writing to them to avoid unnecessary
overriding.

Also add debug messages for workarounds and debug registers.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx: fix core id for multicore booting
York Sun [Fri, 17 Aug 2012 08:20:26 +0000 (08:20 +0000)]
powerpc/mpc8xxx: fix core id for multicore booting

For the cores with multiple threads, we need to figure out which physical
core a thread belongs. To match the core ids, update PIR registers and
spin tables.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agoAdded new ext fields to IFC
Kumar Gala [Fri, 17 Aug 2012 08:20:25 +0000 (08:20 +0000)]
Added new ext fields to IFC

In case more than 32 bit address is used, the EXT bit should be set.
Need to fix up address map for IFC #CS for 4, also need to move # of IFC
banks into config_mpc85xx.h

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agoAdd IFC offset for DPAA/Corenet platforms
Kumar Gala [Fri, 17 Aug 2012 08:20:24 +0000 (08:20 +0000)]
Add IFC offset for DPAA/Corenet platforms

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agoAdd e6500 processor detection
Kumar Gala [Fri, 17 Aug 2012 08:20:23 +0000 (08:20 +0000)]
Add e6500 processor detection

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx: use topology registers to calculate number of cores
York Sun [Fri, 17 Aug 2012 08:20:22 +0000 (08:20 +0000)]
powerpc/mpc8xxx: use topology registers to calculate number of cores

We have actual topology infomation to find out exactly which core is present.
Calculate the number of cores if not specified.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx: Add immap for topology and rcpm registers
York Sun [Fri, 17 Aug 2012 08:20:21 +0000 (08:20 +0000)]
powerpc/mpc8xxx: Add immap for topology and rcpm registers

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc85xx: Add IFC LAW target ID for FSL High-End SoC
Prabhakar Kushwaha [Wed, 15 Aug 2012 06:24:15 +0000 (06:24 +0000)]
powerpc/mpc85xx: Add IFC LAW target ID for FSL High-End SoC

Freescale's High-End SoC are going to have Integrated Flash controller
(IFC)'s support.

So add IFC LAW target ID support for High-End SoC or corenet SoC.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc85xx:Enable debugger support to missed e500v2 SoC
Prabhakar Kushwaha [Wed, 15 Aug 2012 04:12:43 +0000 (04:12 +0000)]
powerpc/mpc85xx:Enable debugger support to missed e500v2 SoC

Freescale's e500v1 and e500v2 cores (used in mpc85xx chips) have some
restrictions on external debugging (JTAG). Need to define define
CONFIG_SYS_PPC_E500_DEBUG_TLB to enable a temporary TLB entry to be
used during boot to work around the limitations.

Enable missed e500v2 SoC i.e. MPC8536, MPC8544, MPC8548 and MPC8572 for
debug support.

Signed-off-by: Radu Lazarescu <radu.lazarescu@freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Cc: Tang Yuantian <Yuantian.Tang@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/fsl-corenet: work around erratum A004510
Scott Wood [Tue, 14 Aug 2012 10:14:53 +0000 (10:14 +0000)]
powerpc/fsl-corenet: work around erratum A004510

Erratum A004510 says that under certain load conditions, modified
cache lines can be discarded, causing data corruption.

To work around this, several CCSR and DCSR register updates need to be
made in a careful manner, so that there is no other transaction in
corenet when the update is made.

The update is made from a locked cacheline, with a delay before to flush
any previous activity, and a delay after to flush the CCSR/DCSR update.
We can't use a readback because that would be another corenet
transaction, which is not allowed.

We lock the subsequent cacheline to prevent it from being fetched while
we're executing the previous cacheline.  It is filled with nops so that a
branch doesn't cause us to fetch another cacheline.

Ordinarily we are running in a cache-inhibited mapping at this point, so
we temporarily change that.  We make it guarded so that we should never
see a speculative load, and we never do an explicit load.  Thus, only the
I-cache should ever fill from this mapping, and we flush/unlock it
afterward.  Thus we should avoid problems from any potential cache
aliasing between inhibited and non-inhibited mappings.

NOTE that if PAMU is used with this patch, it will need to use a
dedicated LAW as described in the erratum.  This is the responsibility
of the OS that sets up PAMU.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/fsl-corenet: remove dead variant symbols
Scott Wood [Tue, 14 Aug 2012 10:14:51 +0000 (10:14 +0000)]
powerpc/fsl-corenet: remove dead variant symbols

These are not supported as individual build targets, but instead
are supported by another target.

The dead p4040 defines in particular had bitrotted significantly.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/85xx: remove support for the Freescale P3060
Timur Tabi [Tue, 14 Aug 2012 06:47:27 +0000 (06:47 +0000)]
powerpc/85xx: remove support for the Freescale P3060

The P3060 was cancelled before it went into production, so there's no point
in supporting it.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/85xx: get rid of enum board_slots in P4080 MDIO driver
Timur Tabi [Tue, 14 Aug 2012 06:47:25 +0000 (06:47 +0000)]
powerpc/85xx: get rid of enum board_slots in P4080 MDIO driver

enum board_slots contained six values, where SLOT1 == 1, SLOT2 == 2, and
so on.  This is pointless, so remove it.  Also move the lane_to_slot[]
array to the top of the file so that it can be used by other functions.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agofm-eth: use fdt_status_disabled() function in ft_fixup_port()
Timur Tabi [Tue, 14 Aug 2012 06:47:24 +0000 (06:47 +0000)]
fm-eth: use fdt_status_disabled() function in ft_fixup_port()

We have a dedicated function for setting the node status now, so use it.
Also improve a comment and fix the type of the phandle variable.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/85xx: introduce function serdes_device_from_fm_port()
Timur Tabi [Tue, 14 Aug 2012 06:47:23 +0000 (06:47 +0000)]
powerpc/85xx: introduce function serdes_device_from_fm_port()

In order to figure out which SerDes lane a given Fman port is connected
to, we need a function that maps the fm_port namespace to the srds_prtcl
namespace.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agofm-eth: add function fm_info_get_phy_address()
Timur Tabi [Tue, 14 Aug 2012 06:47:22 +0000 (06:47 +0000)]
fm-eth: add function fm_info_get_phy_address()

Function fm_info_get_phy_address() returns the PHY address for a given
Fman port.  This is handy when the MDIO code needs to fixup the Ethernet
nodes in the device tree to point to PHY nodes for a specific PHY address.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/85xx: add support for FM2 DTSEC5
Timur Tabi [Tue, 14 Aug 2012 06:47:21 +0000 (06:47 +0000)]
powerpc/85xx: add support for FM2 DTSEC5

Unlike previous SOCs, the Freescale P5040 has a fifth DTSEC on the second
Fman, so add the Fman and SerDes macros for that DTSEC.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agompc85xx: use LCRR_DBYP define instead of raw constant
Paul Gortmaker [Mon, 13 Aug 2012 13:48:57 +0000 (13:48 +0000)]
mpc85xx: use LCRR_DBYP define instead of raw constant

Using the raw value of 0x80000000 directly in the code can
lead to "count the zeros" bugs like that fixed in commit
718e9d13b98 ("MPC85xxCDS: Fix missing LCRR_DBYP bits for
66-133MHz LBC")

Change all existing raw values to use the symbolic value of
LCRR_DBYP instead.

Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agonand_spl: change out_be32 to raw_writel and depend on subsequent sync
Matthew McClintock [Mon, 13 Aug 2012 08:10:42 +0000 (08:10 +0000)]
nand_spl: change out_be32 to raw_writel and depend on subsequent sync

This change reduces the SPL size by removing the redundant syncs produced
by out_be32 and just replies on one final sync

Done with:

sed -r '/in_be32/b; s/(out_be32)\(([^,]*),\s+(.*)\)/__raw_writel(\3, \2)/g' -i `git grep --name-only sdram_init nand_spl/`

Signed-off-by: Matthew McClintock <msm@freescale.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agonand_spl: p1023rds: wait before enabling DDR controller
Matthew McClintock [Mon, 13 Aug 2012 10:00:40 +0000 (10:00 +0000)]
nand_spl: p1023rds: wait before enabling DDR controller

We have a requirement to wait a period of time before enabling the
DDR controller

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agonand_spl: update udelay for Freescale boards
Matthew McClintock [Mon, 13 Aug 2012 13:21:19 +0000 (13:21 +0000)]
nand_spl: update udelay for Freescale boards

Let's use the more appropriate udelay for the nand_spl. While we
can't make use of u-boot's full udelay we can atl east use a for
loop that won't get optimized away .Since we have the bus clock
we can use the timebase to calculate wall time.

Looked at reusing the u-boot udelay functions but it pulls in a lot
of code and would require quite a bit of work to keep us within the
very small space constrains we currently have

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/p1010rdb: nandboot: compare SVR properly
Matthew McClintock [Mon, 13 Aug 2012 08:10:39 +0000 (08:10 +0000)]
powerpc/p1010rdb: nandboot: compare SVR properly

We were not comparing the SVRs properly previously. This comparison
will properly shift the SVR and mask off the E bit

This fixes the boot output to show the correct DDR bus width:

512 MiB (DDR3, 16-bit, CL=5, ECC off)

instead of

512 MiB (DDR3, 32-bit, CL=5, ECC off)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agop1010rdb: fix ddr values for p1014rdb (setting bus width to 16bit)
Matthew McClintock [Mon, 13 Aug 2012 08:10:38 +0000 (08:10 +0000)]
p1010rdb: fix ddr values for p1014rdb (setting bus width to 16bit)

There was an extra 0 in front of the value we were using to mask,
remove it to improve the code.

Also fix the value written to ddr_sdram_cfg to set the bus width
properly to 16 bits

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agop1014rdb: set ddr bus width properly depending on SVR
Matthew McClintock [Mon, 13 Aug 2012 08:10:37 +0000 (08:10 +0000)]
p1014rdb: set ddr bus width properly depending on SVR

Currently, for NAND boot for the P1010/4RDB we hard code the DDR
configuration. We can still dynamically set the DDR bus width in
the nand spl so the P1010/4RDB boards can boot from the same
u-boot image

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc8xxx: Remove P1015 and P1016 from CPU list
York Sun [Fri, 10 Aug 2012 11:07:26 +0000 (11:07 +0000)]
powerpc/mpc8xxx: Remove P1015 and P1016 from CPU list

P1015 is the same as P1011 and P1016 is the same as P1012 from software
point of view. They have different packages but share SVRs.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/CoreNet: add tool to support pbl image build.
Shaohui Xie [Fri, 10 Aug 2012 02:49:35 +0000 (02:49 +0000)]
powerpc/CoreNet: add tool to support pbl image build.

Provides a tool to build boot Image for PBL(Pre boot loader) which is
used on Freescale CoreNet SoCs, PBL can be used to load some instructions
and/or data for pre-initialization. The default output image is u-boot.pbl,
for more details please refer to doc/README.pblimage.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/corenet_ds: Slave module for boot from PCIE
Liu Gang [Thu, 9 Aug 2012 05:10:03 +0000 (05:10 +0000)]
powerpc/corenet_ds: Slave module for boot from PCIE

When boot from PCIE, slave's core should be in holdoff after powered on for
some specific requirements. Master will release the slave's core at the
right time by PCIE interface.

Slave's ucode and ENV can be stored in master's memory space, then slave
can fetch them through PCIE interface. For the corenet platform, ucode is
for Fman.

NOTE: Because the slave can not erase, write master's NOR flash by
  PCIE interface, so it can not modify the ENV parameters stored
  in master's NOR flash using "saveenv" or other commands.

environment and requirement:

master:
1. NOR flash for its own u-boot image, ucode and ENV space.
2. Slave's u-boot image is in master NOR flash.
3. Put the slave's ucode and ENV into it's own memory space.
4. Normally boot from local NOR flash.
5. Configure PCIE system if needed.
slave:
1. Just has EEPROM for RCW. No flash for u-boot image, ucode and ENV.
2. Boot location should be set to one PCIE interface by RCW.
3. RCW should configure the SerDes, PCIE interfaces correctly.
4. Must set all the cores in holdoff by RCW.
5. Must be powered on before master's boot.

For the slave module, need to finish these processes:
1. Set the boot location to one PCIE interface by RCW.
    2. Set a specific TLB entry for the boot process.
3. Set a LAW entry with the TargetID of one PCIE for the boot.
4. Set a specific TLB entry in order to fetch ucode and ENV from
   master.
5. Set a LAW entry with the TargetID one of the PCIE ports for
   ucode and ENV.
6. Slave's u-boot image should be generated specifically by
   make xxxx_SRIO_PCIE_BOOT_config.
   This will set SYS_TEXT_BASE=0xFFF80000 and other configurations.

In addition, the processes are very similar between boot from SRIO and
boot from PCIE. Some configurations like the address spaces can be set to
the same. So the module of boot from PCIE was added based on the existing
module of boot from SRIO, and the following changes were needed:
1. Updated the README.srio-boot-corenet to add descriptions about
   boot from PCIE, and change the name to
   README.srio-pcie-boot-corenet.
2. Changed the compile config "xxxx_SRIOBOOT_SLAVE" to
   "xxxx_SRIO_PCIE_BOOT", and the image builded with
   "xxxx_SRIO_PCIE_BOOT" can support both the boot from SRIO and
   from PCIE.
3. Updated other macros and documents if needed to add information
   about boot from PCIE.

Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/corenet_ds: Master module for boot from PCIE
Liu Gang [Thu, 9 Aug 2012 05:10:02 +0000 (05:10 +0000)]
powerpc/corenet_ds: Master module for boot from PCIE

For the powerpc processors with PCIE interface, boot location can be
configured from one PCIE interface by RCW. The processor booting from PCIE
can do without flash for u-boot image. The image can be fetched from another
processor's memory space by PCIE link connected between them.

The processor booting from PCIE is slave, the processor booting from normal
flash memory space is master, and it can help slave to boot from master's
memory space.

When boot from PCIE, slave's core should be in holdoff after powered on for
some specific requirements. Master will release the slave's core at the
right time by PCIE interface.

Environment and requirement:

master:
    1. NOR flash for its own u-boot image, ucode and ENV space.
    2. Slave's u-boot image is in master NOR flash.
    3. Normally boot from local NOR flash.
    4. Configure PCIE system if needed.
slave:
    1. Just has EEPROM for RCW. No flash for u-boot image, ucode and ENV.
    2. Boot location should be set to one PCIE interface by RCW.
    3. RCW should configure the SerDes, PCIE interfaces correctly.
4. Must set all the cores in holdoff by RCW.
5. Must be powered on before master's boot.

For the master module, need to finish these processes:
    1. Initialize the PCIE port and address space.
    2. Set inbound PCIE windows covered slave's u-boot image stored in
       master's NOR flash.
3. Set outbound windows in order to configure slave's registers
   for the core's releasing.
    4. Should set the environment variable "bootmaster" to "PCIE1", "PCIE2"
   or "PCIE3" using the following command:

setenv bootmaster PCIE1
saveenv

Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/corenet_ds: Update README and README.srio-pcie-boot-corenet
Liu Gang [Thu, 9 Aug 2012 05:10:01 +0000 (05:10 +0000)]
powerpc/corenet_ds: Update README and README.srio-pcie-boot-corenet

Added descriptions about boot from PCIE in the files README and
doc/README.srio-pcie-boot-corenet, and changed the name of the
doc/README.srio-boot-corenet to doc/README.srio-pcie-boot-corenet.

Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/corenet_ds: Get rid of the CONFIG_SRIOBOOT_SLAVE_PORTx macro
Liu Gang [Thu, 9 Aug 2012 05:10:00 +0000 (05:10 +0000)]
powerpc/corenet_ds: Get rid of the CONFIG_SRIOBOOT_SLAVE_PORTx macro

When compile the slave image for boot from SRIO, no longer need to
specify which SRIO port it will boot from. The code will get this
information from RCW and then finishes corresponding configurations.

This has the following advantages:
1. No longer need to rebuild an image when change the SRIO port for
   boot from SRIO, just rewrite the new RCW with selected port,
   then the code will get the port information by reading new RCW.
2. It will be easier to support other boot location options, for
   example, boot from PCIE.

Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/corenet_ds: Get rid of the SRIOBOOT_MASTER build target
Liu Gang [Thu, 9 Aug 2012 05:09:59 +0000 (05:09 +0000)]
powerpc/corenet_ds: Get rid of the SRIOBOOT_MASTER build target

Get rid of the SRIOBOOT_MASTER build target, and to support for serving as
a SRIO boot master via environment variable. Set the environment variable
"bootmaster" to "SRIO1" or "SRIO2" using the following command:

setenv bootmaster SRIO1
saveenv

The "bootmaster" will enable the function of the SRIO boot master, and
this has the following advantages compared with SRIOBOOT_MASTER build
configuration:
1. Reduce a build configuration item in boards.cfg file.
   No longer need to build a special image for master, just use a
   normal target image and set the "bootmaster" variable.
2. No longer need to rebuild an image when change the SRIO port for
   boot from SRIO, just set the corresponding value to "bootmaster"
   based on the using SRIO port.

Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/corenet_ds: Update README.srio-boot-corenet
Liu Gang [Thu, 9 Aug 2012 05:09:58 +0000 (05:09 +0000)]
powerpc/corenet_ds: Update README.srio-boot-corenet

Update some descriptions due to the implementation changes:

For master:
Get rid of the SRIOBOOT_MASTER build target, and to support
for serving as a SRIO boot master via environment variable.
For slave:
1. When compile the slave image for boot from SRIO, no longer
   need to specify which SRIO port it will boot from.
2. All slave's cores should be in hold off.

Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc/mpc85xx: Make NMG_CPU_A011 workaround conditional
York Sun [Wed, 8 Aug 2012 18:04:53 +0000 (18:04 +0000)]
powerpc/mpc85xx: Make NMG_CPU_A011 workaround conditional

This erratum applies to the following SoCs:
P4080 rev 1.0, 2.0, fixed in rev 3.0
P2041 rev 1.0, 1.1, fixed in rev 2.0
P3041 rev 1.0, 1.1, fixed in rev 2.0.

Workaround for erratum NMG_CPU_A011 is enabled by default. This workaround
may degrade performance. P4080 erratum CPU22 shares the same workaround.
So it is always enabled for P4080. For other SoCs, it can be disabled by
hwconfig with syntax:

fsl_cpu_a011:disable

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agonand/fsl_elbc: shrink SPL a bit by converting out_be32() to __raw_writel()
Scott Wood [Wed, 8 Aug 2012 15:03:33 +0000 (15:03 +0000)]
nand/fsl_elbc: shrink SPL a bit by converting out_be32() to __raw_writel()

This is needed to make room for a bugfix on p1_p2_rdb_pc.  A sync is used
before the final write to LSOR that initiates the transaction, to ensure
all the other set up has been completed.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agopowerpc: Stack Pointer not properly aligned
Joakim Tjernlund [Mon, 23 Jul 2012 10:58:03 +0000 (10:58 +0000)]
powerpc: Stack Pointer not properly aligned

The code first aligns the SP to 16 then subtract 8, making it
8 bytes aligned. Furthermore the initial stack frame not
quite correct either.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agompc85xx: Initial SP alignment is wrong.
Joakim Tjernlund [Mon, 23 Jul 2012 10:58:02 +0000 (10:58 +0000)]
mpc85xx: Initial SP alignment is wrong.

PowerPC mandates SP to be 16 bytes aligned.
Furthermore, a stack frame is added, pointing to the reset vector
which may in the way when gdb is walking the stack because
the reset vector may not accessible depending on emulator settings.
Also use a temp register so gdb doesn't pick up intermediate values.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andy Fleming <afleming@freescale.com>
13 years agosh: tmu: Removed arch/sh/include/asm/clk.h
Nobuhiro Iwamatsu [Tue, 21 Aug 2012 05:37:34 +0000 (14:37 +0900)]
sh: tmu: Removed arch/sh/include/asm/clk.h

asm/clk.h was included get_peripheral_clk_rate function. But this
is not used from anywhere.
This removed asm/clk.h, and deleted include line from arch/sh/lib/time.c

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
13 years agosh: tmu: Changed switch statement to shift operation
Nobuhiro Iwamatsu [Tue, 21 Aug 2012 04:24:43 +0000 (13:24 +0900)]
sh: tmu: Changed switch statement to shift operation

Calculation of the bit position using switch statement can substitute
shift operation using ffs.
And removed unsed macro and variable.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
13 years agosh: tmu: Changed TMU driver using array of structures
Nobuhiro Iwamatsu [Tue, 21 Aug 2012 04:14:46 +0000 (13:14 +0900)]
sh: tmu: Changed TMU driver using array of structures

This changed into access using array of structure from access to the register
using the definition of the register by macro.
And removed white space.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
13 years agodm: mips: Import libgcc components from Linux
Marek Vasut [Sun, 12 Aug 2012 14:53:35 +0000 (16:53 +0200)]
dm: mips: Import libgcc components from Linux

Import ashldr3, ashrdi3 and lshrdi3 to squash possible libgcc fp mismatch,
resulting in the following warning:

mips-linux-gnu-ld: Warning: /usr/lib/gcc/mips-linux-gnu/4.7/libgcc.a(_lshrdi3.o) uses hard float, u-boot uses soft float
mips-linux-gnu-ld: Warning: /usr/lib/gcc/mips-linux-gnu/4.7/libgcc.a(_ashldi3.o) uses hard float, u-boot uses soft float

Imported from Linux (linux-next 20120723) as of commit:

commit 72fbfb260197a52c2bc2583f3e8f15d261d0f924
Author: Ralf Baechle <ralf@linux-mips.org>
Date:   Wed Jun 7 13:25:37 2006 +0100

    [MIPS] Fix optimization for size build.

    It took a while longer than on other architectures but gcc has finally
    started to strike us as well ...

    This also fixes the damage by 6edfba1b33c701108717f4e036320fc39abe1912.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
[<daniel.schwierzeck@gmail.com>: removed USE_PRIVATE_LIBGCC = yes]
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
13 years agodm: mips: Fix warnings in lb60 board
Marek Vasut [Sun, 12 Aug 2012 14:53:35 +0000 (16:53 +0200)]
dm: mips: Fix warnings in lb60 board

The lb60 board accesses the clkgr register, which is 32bit via
16bit IO ops. This causes malfunction. Fix this.

qi_lb60.c: In function ‘cpm_init’:
qi_lb60.c:72:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
qi_lb60.c:84:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel <zpxu@ingenic.cn>
Cc: Shinya Kuribayashi <skuribay@pobox.com>
Cc: Xiangfu Liu <xiangfu@openmobilefree.net>
13 years agodm: mips: Fix lb60 timer code
Marek Vasut [Sun, 12 Aug 2012 14:53:35 +0000 (16:53 +0200)]
dm: mips: Fix lb60 timer code

The timer code contains more halfword writes which trigger gcc errors.
The registers are again 32bit, yet written by 16bit writes, fix this:

timer.c: In function ‘reset_timer_masked’:
timer.c:37:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
timer.c: In function ‘get_timer_masked’:
timer.c:43:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
timer.c: In function ‘timer_init’:
timer.c:86:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
timer.c:88:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
timer.c:89:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
timer.c:90:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel <zpxu@ingenic.cn>
Cc: Shinya Kuribayashi <skuribay@pobox.com>
Cc: Xiangfu Liu <xiangfu@openmobilefree.net>
13 years agodm: mips: Fix lb60 WDT control
Marek Vasut [Sun, 12 Aug 2012 14:53:35 +0000 (16:53 +0200)]
dm: mips: Fix lb60 WDT control

Write the TSCR register via 32bit write instead of 16bit one.
The register is 32bit wide and bit 16 is being set, triggering
gcc overflow error and making the code broken.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel <zpxu@ingenic.cn>
Cc: Shinya Kuribayashi <skuribay@pobox.com>
Cc: Xiangfu Liu <xiangfu@openmobilefree.net>
13 years agoMakefile: fix HAVE_VENDOR_COMMON_LIB
Scott Wood [Tue, 14 Aug 2012 01:44:29 +0000 (01:44 +0000)]
Makefile: fix HAVE_VENDOR_COMMON_LIB

Commit 8b5a02640adf77301f943e8754992c50df004e8a ("Makefile: cosmetic:
optimize usage of LIBS-y") broke the build of boards that have a board
vendor "common" directory, by introducing a space between "LIBS-" and
"y".

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
13 years agosf: spansion: Add support for S25FL256S
Michal Simek [Tue, 14 Aug 2012 11:11:22 +0000 (13:11 +0200)]
sf: spansion: Add support for S25FL256S

Add support for Spansion S25FL256S SPI flash.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agosf: winbond: fix page_size
Stephen Warren [Mon, 13 Aug 2012 22:46:21 +0000 (16:46 -0600)]
sf: winbond: fix page_size

Commit a4ed3b6 "sf: inline data constants" modified winbond.c's page_size
from 256 to 4096. This prevents either/both of "sf write" writing the
correct data, or "sf read" from reading the correct data back.

This allows U-Boot running on Compulab Tegra to upgrade itself.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agomtd/cfi_flash: fix write problems for Numonyx P33/30 32 MBit flashs
Holger Brunck [Thu, 9 Aug 2012 08:22:41 +0000 (10:22 +0200)]
mtd/cfi_flash: fix write problems for Numonyx P33/30 32 MBit flashs

commit 54652991
Work around bug in Numonyx P33/P30 256-Mbit 65nm flash chips

fixes a problem for Numonyx P33/P30 flashes for 256-Mbit, but this leads
to problems for smaller versions of this chip e.g. the 32Mbit version
with deviceid 0x16 on mgcoge. So move the code for this work around to
an own function and check previously manufacturer id and device id to
not break other flashes which don't need this work around.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Stefan Roese <sr@denx.de>
cc: Philippe De Muyter <phdm@macqel.be>
cc: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Stefan Roese <sr@denx.de>
13 years agocfi_flash: add support for Spansion flash PPB sector protection
Anatolij Gustschin [Thu, 9 Aug 2012 06:18:12 +0000 (08:18 +0200)]
cfi_flash: add support for Spansion flash PPB sector protection

Erasing flash sectors protected with persistent protection bit (PPB)
mechanism on Spansion flash chips doesn't work. Add sector protection
status checking and sector lock and unlock commands to fix this.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
13 years agotx25: Use generic gpio_* calls
Vikram Narayanan [Sat, 16 Jun 2012 07:16:17 +0000 (07:16 +0000)]
tx25: Use generic gpio_* calls

Instead of manipulating gpio registers directly, use the calls
from the gpio library.

Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Cc: John Rigby <jcrigby@gmail.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
13 years agodts/Makefile: Turn off some predefined macros
Horst Kronstorfer [Fri, 13 Jul 2012 03:03:40 +0000 (03:03 +0000)]
dts/Makefile: Turn off some predefined macros

Add '-ansi' to DTS_CPPFLAGS to avoid unwanted expansion of dts content
that matches some predefined macros.

Example: A number of PowerPC related *.dts files in the kernel define a
property named 'linux,network-index' which (w/o '-ansi') is expanded to
'1,network-index' by the preprocessor because of '#define linux 1.'

Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
13 years agoAdd support for DS1388.
Kenth Eriksson [Thu, 12 Jul 2012 19:59:44 +0000 (19:59 +0000)]
Add support for DS1388.

Support for DS1388 is added by extending the DS1337 driver. DS1388 is
similar to DS1337. The time registers are offset by 1 (due to support
for hundreds of seconds), and there is no century bit.
The configuration and trickle charge registers are also different.
Tested on hardware with Freescale P2010 and DS1388.

Signed-off-by: Kenth Eriksson <kenth.eriksson@transmode.com>
13 years agodts/Makefile: Check for empty $(LDSCRIPT)
Horst Kronstorfer [Thu, 12 Jul 2012 02:58:32 +0000 (02:58 +0000)]
dts/Makefile: Check for empty $(LDSCRIPT)

Make sure that $(LDSCRIPT) is not empty before calling process_lds
with 'cat $(LDSCRIPT)' else cat will block waiting for input from
stdin.

Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
13 years agoconfig: Always use GNU ld
Khem Raj [Thu, 2 Aug 2012 06:19:34 +0000 (06:19 +0000)]
config: Always use GNU ld

This patch makes sure that we always use the GNU ld. U-Boot uses certain
construct e.g. OVERLAY which are not implemented in gold therefore it
always needs GNU ld for linking.

It works well if default linker in toolchain is GNU ld but in some
cases we can have gold to be the default linker and also ship GNU ld
but not as default in such cases its called $(PREFIX)ld.bfd, with this
patch we make sure that if $(PREFIX)ld.bfd exists than we use that for
our ld.

This way it does not matter what the default ld is.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
13 years agotools: add kwboot binary to .gitignore file
Luka Perkov [Sun, 15 Jul 2012 06:29:38 +0000 (06:29 +0000)]
tools: add kwboot binary to .gitignore file

Signed-off-by: Luka Perkov <uboot@lukaperkov.net>
Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
13 years agofdt: Include arch specific gpio.h instead of asm-generic/gpio.h
Michal Simek [Wed, 11 Jul 2012 02:26:38 +0000 (02:26 +0000)]
fdt: Include arch specific gpio.h instead of asm-generic/gpio.h

Include arch specific gpio.h instead of asm-generic/gpio.h
because several architectures (Microblaze, Blackfin, Nios2, OpenRISC)
define gpio functions in header file.
asm-generic/gpio.h can be included in arch specific gpio.h
(For example: ARM)

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Simon Glass <sjg@chromium.org>
13 years agoserial: CONSOLE macro is not used
Michal Simek [Thu, 9 Aug 2012 21:04:28 +0000 (21:04 +0000)]
serial: CONSOLE macro is not used

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Mike Frysinger <vapier@gentoo.org>
13 years agoMakefile: cosmetic: optimize usage of LIBS-y
Daniel Schwierzeck [Thu, 19 Jul 2012 13:39:58 +0000 (13:39 +0000)]
Makefile: cosmetic: optimize usage of LIBS-y

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
13 years agoMakefile: replace LIBS by LIBS-y
Daniel Schwierzeck [Thu, 28 Jun 2012 06:45:20 +0000 (06:45 +0000)]
Makefile: replace LIBS by LIBS-y

Synchronize with ALL-y handling and code in spl/Makefile.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
13 years agoMakefile: allow appending to LIB in sub-makefiles
Daniel Schwierzeck [Thu, 28 Jun 2012 06:45:19 +0000 (06:45 +0000)]
Makefile: allow appending to LIB in sub-makefiles

The top Makefile and the SPL Makefile have lines like those:

ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
LIBS += $(CPUDIR)/omap-common/libomap-common.o
endif

ifeq ($(SOC),mx5)
LIBS += $(CPUDIR)/imx-common/libimx-common.o
endif

This should be done in the arch/CPU/SoC specific sub-makefiles to
keep the top Makefiles clean. This patch also allows adding of new
arch/CPU/SoC specific libraries in the future without touching
the top Makefiles.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
13 years agonds32: fix unused pmu_init warning
Mike Frysinger [Mon, 6 Aug 2012 13:46:37 +0000 (13:46 +0000)]
nds32: fix unused pmu_init warning

Fixes the build-time warning:
board.c: At top level:
board.c:106: warning: 'pmu_init' defined but not used

This makes the ifdef logic at the call site match the logic at the
function definition.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agonds32: delete unused local variable
Mike Frysinger [Mon, 6 Aug 2012 13:46:36 +0000 (13:46 +0000)]
nds32: delete unused local variable

Fixes the build-time warning:
board.c: In function 'board_init_r':
board.c:304: warning: unused variable 's'

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agonds32: drop bi_enetaddr from global data
Mike Frysinger [Mon, 6 Aug 2012 13:46:35 +0000 (13:46 +0000)]
nds32: drop bi_enetaddr from global data

Nothing is using this, so punt it from the gd.  Seems to just be a copy
& paste wart from the initial port.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agosf: stmicro: add support for N25Q128A
Michal Simek [Fri, 10 Aug 2012 12:21:46 +0000 (14:21 +0200)]
sf: stmicro: add support for N25Q128A

Add support for Numonyx N25Q128A SPI flash.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agosf: stmicro: add support N25Q128 parts
Stephan Linz [Thu, 2 Aug 2012 18:47:30 +0000 (20:47 +0200)]
sf: stmicro: add support N25Q128 parts

Adds support for Numonyx's N25Q128 SPI flash. These devices
are used on (among others) Avnet Spartan-6 LX9 micro-evaluation
boards. Tested with "sf" commands and CONFIG_ENV_IS_IN_SPI_FLASH.

Signed-off-by: Stephan Linz <linz@li-pro.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>