Commit Graph

695 Commits

Author SHA1 Message Date
Joakim Tjernlund d1e0b10acc powerpc: do not fixup NULL ptrs
The fixup routine must not fixup NULL pointers.
Problem can be seen by
 char *testfun(void) __attribute__((weak));
 char *(*myfun)(void) = testfun;

Then add
  printf("myfun:%p, &myfun:%p\n", myfun, &myfun);
before relocation and after relocation.
myfun should be NULL in both cases but it is not.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
2010-10-18 22:39:37 +02:00
Peter Tyser d98b0523cf powerpc: Cleanup BOOTFLAG_* references
Now that warm booting is not supported, there isn't a need for the
BOOTFLAG_COLD and BOOTFLAG_WARM defines, so remove them.

Note that this change makes the board info bd_bootflags field useless.
It will always be set to 0, but we leave it around so that we don't
break the board info structure that some OSes are expecting to be passed
from U-Boot.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2010-10-18 22:38:56 +02:00
Damien Dusha 29c6fbe047 MPC5121: Add USB EHCI support
Signed-off-by: Francesco Rendine <francesco.rendine@valueteam.com>
Signed-off-by: Damien Dusha <d.dusha@gmail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>

Coding style cleanup; slight file restructuring.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Remy Bohmer <linux@bohmer.net>
2010-10-18 22:33:32 +02:00
Wolfgang Denk 14d0a02a16 Rename TEXT_BASE into CONFIG_SYS_TEXT_BASE
The change is currently needed to be able to remove the board
configuration scripting from the top level Makefile and replace it by
a simple, table driven script.

Moving this configuration setting into the "CONFIG_*" name space is
also desirable because it is needed if we ever should move forward to
a Kconfig driven configuration system.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-10-18 22:07:10 +02:00
Jason Liu ff9f475d5d MX5: rename mx51 to mx5
Rename mx51 to mx5 in order to support more mx51
like-style SOCs such as MX53 and the followings.

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-10-18 10:43:19 +02:00
Wolfgang Denk cacc342d5a Merge branch 'master' of git://git.denx.de/u-boot-arm 2010-10-17 20:25:05 +02:00
Enric Balletbo i Serra 84b6631038 OMAP3: SDRC: Introduce Numonyx DDR type
Introduce Numonyx DDR timings and provide CONFIG_OMAP3_NUMONYX_DDR
config options to allow for platform files to setup their timings.

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Acked-by: Steve Sakoman <steve.sakoman@linaro.org>
Tested-by: Steve Sakoman <steve.sakoman@linaro.org>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-10-17 20:14:39 +02:00
Steve Sakoman 57b512b2ec ARMV7: OMAP4: Implement relocation for Panda and OMAP4430SDP
This patch fixes the build breakage introduced by the recent relocation
changes for ARMV7

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2010-10-17 20:14:30 +02:00
Steve Sakoman 136c69ad79 ARMV7: OMAP3: Fix bug in get_sdr_cs_offset()
This patch fixes a typo in the routine to calculate the cs offset
based upon the contents of the SDRC cs_cfg register.  This function
mistakenly shifts the CS1STARTLOW field 17 bits right instead of
17 bits left.

This hasn't been an issue to date because all OMAP3 boards currently
are configured to have zeros in this field.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org>
2010-10-17 20:14:28 +02:00
Sukumar Ghorai de941241a0 ARMV7: OMAP: Add new mmc driver compatible with CONFIG_GENERIC_MMC
OMAP boards currently use a legacy mmc driver. This patch adds a new
mmc driver which will work with the generic mmc driver in u-boot.

This new driver will work with both OMAP3 and OMAP4 boards.

This patch does not remove the old driver.  It should remain in the
tree until all boards that use it switch to the new driver.

Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com>
Tested-by: Steve Sakoman <steve@sakoman.com>
2010-10-17 20:14:10 +02:00
Wolfgang Denk 6ca803750e Merge branch 'master' of git://git.denx.de/u-boot-imx 2010-10-17 19:57:38 +02:00
Mike Frysinger 5641f34f8b Blackfin: workaround anomaly 05000440
We cannot rely on the syscontrol rom func to program PLL_DIV with anomaly
05000440 is in effect, so manually program the MMR when necessary.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-14 20:23:26 -04:00
Mike Frysinger e5d8984be6 Blackfin: update anomaly lists to latest sheets
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-14 20:23:26 -04:00
Steve Sakoman d470a6f60a env_mmc: Fix crashing bug encountered after enabling ARM relocation
The crash was occuring in env_relocate because it was being called prior
to mmc_initialize.  This patch moves the MMC initialization earlier in
the init process.

This patch also cleans up the env_relocate_spec code in env_mmc.c

Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org>
Acked-by: Stefano Babic <sbabic@denx.de>
2010-10-13 21:52:13 +02:00
Peter Tyser 4bbfd3e279 ppc: Conditionally compile bat_rw.c
Only a few PPC boards actually use the common BAT manipulation
functions, so only compile it for them.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2010-10-13 21:44:10 +02:00
Wolfgang Denk e1b4c57096 Merge branch 'master' of git://git.denx.de/u-boot-arm 2010-10-13 20:59:47 +02:00
Stefano Babic f76888c294 MX31: add support for setting pin pads
The patch adds a utility function and defines
to set the pad as it is done in linux.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-10-13 18:11:30 +02:00
Stefano Babic 70e23264ff MX31: Adding missing iomux pin to MX.31 registers
Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-10-13 18:10:32 +02:00
Heiko Schocher bafe7437a4 arm1136, qong: add support for ELF relocations
Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Albert ARIBAUD <albert.aribaud@free.fr>
2010-10-13 10:12:52 +02:00
Heiko Schocher c3d3a5418d armv7, beagle: add support for ELF relocations
Signed-off-by: Heiko Schocher <hs@denx.de>
2010-10-13 10:12:25 +02:00
Heiko Schocher 9710504d20 arm926ejs, tx25: add support for ELF relocations
Signed-off-by: Heiko Schocher <hs@denx.de>
2010-10-13 10:12:01 +02:00
Albert Aribaud 92d5ecba47 arm: implement ELF relocations
ELF relocation tables generated with linker option -pie can
be used to fixup code and data in a single loop at relocation,
removing the need for manual fixups anywhere else in the code.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-10-13 10:10:21 +02:00
Matt Waddel b80e41ac54 ARMV7: Versatile Express Coretile CortexA9x4 support
Adds support for the ARM quad-core Cortex-A9 processor

This system includes a motherboard(Versatile Express), daughterboard
(Coretile), and SOC(Cortex-A9 quad core).  The serial port, ethernet,
and flash systems work with these additions.  The naming convention
is:
   SOC -> CortexA9 quad core = ca9x4
   daughterboard -> Coretile = ct
   motherboard -> Versatile Express = vxp
This gives ca9x4_ct_vxp.c as the board support file.

Signed-off-by: Matt Waddel <matt.waddel@linaro.org>
2010-10-13 09:59:39 +02:00
Andreas Bießmann a4a87d8a93 arch/arm/include/asm/sizes.h: cleanups
Merge several sizes.h in asm/arch subdirectories into a single
asm/sizes.h file.

Fixup usage of asm/arch/sizes.h in some files to use the merged file.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2010-10-13 09:59:33 +02:00
Prafulla Wadaskar beeb258976 Kirkwood: dram_init is moved to dram.c
For all Kirkwood boards so far dram_init function is duplicated
dram_init function is moved to dram.c and relevant code from all
board specific files removed

If any board needs specific dram init handling than standard one,
then, a macro CONFIG_SYS_BOARD_DRAM_INIT should be defined in
board config header file and the dram_init function can be put
in board specific source file
For ex. keymile boards

Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
2010-10-13 09:36:07 +02:00
Albert Aribaud 500f2ff52a orion5x: optimize window size computation
Signed-off-by: Chris Moore <moore@free.fr>
Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-10-13 09:36:02 +02:00
Prafulla Wadaskar c0cd02073d Kirkwood: print_cpuinfo fixed for valid devid revid
Earlier Device Identification register was used to detect
the type for SoC, considering 88F6282 support to be added,
It is not possible to detect the same using current
algorithm.

With this patch, device ID is being read using PCIE devid
register, also valid chip revision ID will also be read and
displayed

Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
2010-10-13 09:35:58 +02:00
Peter Tyser 52ebd9c1e5 powerpc: Remove warm reset entry point
No boards utilize the warm reset entry point, so remove it.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2010-10-12 23:01:32 +02:00
Peter Tyser a1c4864ab0 powerpc: Zero out board info struct on bootup
This puts the board info struct in a known state and allows the removal
of other code which initialized board info fields to 0.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2010-10-12 23:00:30 +02:00
Wolfgang Denk 655c549752 Merge branch 'master' of git://git.denx.de/u-boot-microblaze 2010-10-12 20:48:01 +02:00
Michal Simek b98cba0911 microblaze: Support little-endian microblaze target
Microblaze little-endian toolchain should export
__MICROBLAZEEL__.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-12 16:51:34 +10:00
Michal Simek d69f8f41af microblaze: Add support for NET_MULTI api
Microblaze hasn't supported NET_MULTI support.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-12 16:51:34 +10:00
Ben Gardiner 7b37a27e14 davinci_emac: davinci_eth_set_mac_addr to ->write_hwaddr
This patch proposes to migrate the davinci_emac driver to using the
eth_device->write_hwaddr function pointer as suggested by Ben Warren.

All the davinci boards had the behaviour, prior to this patch, of
sync'ing the environment variable enetaddr with the MAC address read
from non-volatile storage on boot -- when the two locations disagreed,
the environment variable value took precendence. This patch keeps the
same behaviour but lets eth_initialize take care of it.

This patch refactors davinci_emac setup in the boards so that the MAC
address is read from non-volatile storage into the environment variable
and then the environment variable value is use in eth_intialize. The
only exception is the direct call to davinci_eth_set_mac_addr made by
the da830evm board init which was changed into an assignment of the
enetaddr field.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Tested-by: Nick Thompson <nick.thompson@ge.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-10-11 23:07:17 -07:00
Albert Aribaud d778a2fbb3 orion5x: fix relocation-incompatible code
Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-10-11 14:35:45 +02:00
Albert Aribaud da90d4ce38 arm: bugfix: replace ble with blo in start.S files
Generalized misuse of ble within relocation and bss
initialization loops caused one iteration too many.
Instead of ble ('branch if lower or equal'), use
blo ('branch if lower').

While we're at it, fix all 'addreee' typos.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-10-11 10:28:43 +02:00
Wolfgang Denk ddf71e4cff Merge branch 'at91' of git://git.denx.de/u-boot-atmel 2010-10-11 10:24:22 +02:00
Wolfgang Denk e67f462864 Merge branch 'master' of git://git.denx.de/u-boot-imx 2010-10-11 10:19:04 +02:00
Wolfgang Denk bfc7bea6ad Merge branch 'master' of git://git.denx.de/u-boot-x86 2010-10-11 10:00:34 +02:00
Wolfgang Denk 29840de6b6 Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx 2010-10-11 09:56:34 +02:00
Kim Phillips e95a0611f2 powerpc/85xx: fix rev.2 job queue LIODN error storm
pumping line-rate traffic though a p4080 rev.2, which
is configured to encrypt packets prior to forwarding through
an IPsec tunnel, gets this error:

of_platform ffe302000.jq: DECO: desc idx 22: LIODN error. DECO was trying
to share from itself or from another DECO but the two Non-SEQ LIODN
values didn't match or the "shared from" DECO's Descriptor required that
the SEQ LIODNs be the same and they aren't.

Since high traffic rates cause DECOs to begin to start sharing
shared descriptors amongst themselves, and DECOs inherit job queue
LIODNs when accessing shared descriptors, and a recently discovered
rev.2 h/w erratum requires all sharing job queues in a partition
have same liodn assignment, reassign the first job queue's liodn
assignment to the rest.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-07 09:49:47 -05:00
Kumar Gala 3c6a22b962 powerpc/p4080: Add new CPC register - HDBCR0
Manual was updated to add a new register for disabling CDQ speculation.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-07 09:49:47 -05:00
Graeme Russ c868af3e57 x86: Implement fully relocatable image
u-boot.bin can be loaded at any 4-byte aligned memory location and directly
'jumped' to using the 'go' command using the load address as the start
address. Doing so performs a 'warm boot' which skips memory initialisation
and other low-level initialisations, relocates U-Boot to upper memory and
starts U-Boot in RAM as per normal 'cold boot'
2010-10-07 20:03:33 +11:00
Graeme Russ f2ff75c0a2 x86: Use loops instead of memcpy/memset in board_init_f
Provides a small speed increase and prepares for fully relocatable image.
Downside is the TEXT_BASE, bss, load address etc must ALL be aligned on a
a 4-byte boundary which is not such a terrible restriction as everything
is already 4-byte aligned anyway
2010-10-07 20:03:33 +11:00
Graeme Russ 2219142658 x86: Rearrange linker script
Tidy up the linker script and discard some sections to save space
2010-10-07 20:03:32 +11:00
Graeme Russ 067f9b1071 x86: Rename linker script symbols
Create more generic names for the symbols exported from the linker script
2010-10-07 20:03:31 +11:00
Graeme Russ c81b26beb8 x86: Set cold/warm boot flag 2010-10-07 20:03:30 +11:00
Graeme Russ 161b3589ea x86: Place global data below stack before entering C
By reserving space for the Global Data immediately below the stack during
assembly level initialisation, the C declaration of the static global data
can be removed, along with the 'RAM Bootstrap' function. This results in
cleaner code, and the ability to pass boot-up flags from assembler into C
2010-10-07 20:03:29 +11:00
Graeme Russ 5a3876d2ac x86: Dont clobber %eax after getting memory size
By using another register, reduce code size by one instruction
2010-10-07 20:03:28 +11:00
Graeme Russ 5f2679055d x86: Don't clobber %ebx
%ebx will hold low-level boot flags and must be preserved
2010-10-07 20:03:28 +11:00
Graeme Russ 88fa0a6eb9 x86: Remove usage of %ebp as a return pointer
Using %ebp as a return pointer prevents creating 'load anywhere' images
2010-10-07 20:03:27 +11:00
Graeme Russ 00940a229d x86: Move ECC initialisation outside RAM initialisation
To allow for 'load anywhere' images, the %ebp return pointer 'hack' must
be removed, so we cannot have two 'calls' to get_mem_size
2010-10-07 20:03:26 +11:00
Graeme Russ 6ae032a86a x86: Remove progress indication in low-level init
Progress indication is not relocation friendly so remove it in
preperation for full relocatability support
2010-10-07 20:03:24 +11:00
Graeme Russ 7228efa3cb x86: Fix %ss and %esp in register structure for interrupts 2010-10-07 20:03:23 +11:00
Graeme Russ 5c161653db x86: Change compiler options
Change to:
 - reparam=3
 - no-from-pointer
 - no-stack-protector
 - preferred-stack-boundary=2
 - no-top-level-reorder

These options make the code a little smaller and faster
2010-10-07 20:03:23 +11:00
Graeme Russ 8ffb2e8f33 x86: Coding Style Cleanup
Perform some basic code cleanups of the x86 files
2010-10-07 20:03:21 +11:00
Graeme Russ 59c6d0ef9a x86: Move loading of GTD to C code
Linux has C macros and code to load the GTD after switching to Protected
Mode. Using these greatly simplifies the assembler code
2010-10-07 20:03:21 +11:00
Graeme Russ d664adb6bb x86: use gc sections to reduce image size
Follow the discussion of Charles Manning and Mike Frysinger.
Using gc_sections helps reduce image size.
2010-10-07 20:03:20 +11:00
Graeme Russ abe98f49e1 x86: zboot update
The header of recent Linux Kernels includes the size of the image, and
therefore is not needed to be passed to zboot. Still process the third
parameter (size of image) in the event that an older kernel is being loaded
2010-10-07 20:03:19 +11:00
Graeme Russ 76d5763a49 x86: Make CONFIG_RELOC_FIXUP_WORKS generic for all x86 boards
Relocation is not board-specific for the x86 architectrure, so
CONFIG_RELOC_FIXUP_WORKS can be defined globally in the config.h
2010-10-07 20:03:18 +11:00
Andre Schwarz 76221a6cfa PowerPC: change board specific early pci_init() into generic.
Signed-off-by: Andre Schwarz <andre.schwarz@matrix-vision.de>
2010-10-06 22:37:35 +02:00
Wolfgang Denk 544d97e9aa PCU_E: remove code for yet another corpse
The PCU_E board has long reached EOL, and support for it is no longer
relevant in current versions of U-Boot.  Remove it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-10-06 22:22:24 +02:00
Alexander Stein c8f6d84d10 at91: Add arch_preboot_os which disables PIT in a faster way
When disabled the PIT runs until it reaches the CPIV value.
The Linux PIT driver stops the PIT and waits until it stopped. This can
take over 100ms. Simply stopping in u-boot isn't sufficient as the PIT
will still be running when Linux is waiting until it stopped.
So, we stop it in u-boot by setting the compare value to a value slightly
greater than the current running counter to make the PIT stopped in short
time.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
2010-10-05 16:58:57 +02:00
Andreas Bießmann b944ad22b4 at91_emac.h: fix typo in register definition
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Acked-by: Jens Scharsig <js_at_ng@scharsoft.de>
2010-10-05 16:58:56 +02:00
Reinhard Meyer 6341c5cf87 AT91: convert cpu.c to struct SoC access
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-10-05 16:58:56 +02:00
Wolfgang Denk d628866474 Merge branch 'master' of git://git.denx.de/u-boot-blackfin 2010-10-05 14:42:32 +02:00
Wolfgang Denk db682a0b59 Merge branch 'master' of git://git.denx.de/u-boot-ppc4xx 2010-10-05 14:37:25 +02:00
Wolfgang Denk bbf2abc0f5 Merge branch 'next' of git://git.denx.de/u-boot-video 2010-10-05 14:31:48 +02:00
Stefan Roese eb011d27aa ppc4xx: Remove some testing hacks from ppc4xx.h
I accidentally left these hacks in the code while doing the big header
cleanup. Let's remove it now.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-10-04 11:20:11 +02:00
Stefan Roese c96be63aab ppc4xx: Add defines for COM3 & COM4 (UART2 & UART3) on 440EPx/GRx
Signed-off-by: Stefan Roese <sr@denx.de>
2010-10-04 11:19:43 +02:00
Tirumala Marri 1b8fec1393 APM821xx: Add CPU support
APM821XX is a new line of SoCs which are derivatives of
PPC44X family of processors. This patch adds support of CPU, cache,
tlb, 32k ocm, bootstraps, PLB and AHB bus.

Signed-off-by: Tirumala R Marri <tmarri@apm.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2010-10-04 11:15:02 +02:00
Mike Frysinger d3c07a5d24 Blackfin: fix MMC init output alignment
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:40 -04:00
Mike Frysinger 48c00fe25c Blackfin: propagate target cpu defines when building embedded env
Since we're no longer extracting the env from the target ELF file (since
upstream wouldn't take that change), we're back to the problem of cpu
defines not properly propagating to the env setup stage.  So the embedded
env built by the host compiler doesn't match the one that is linked into
the u-boot env.

Reported-by: Vivi Li <vivi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:40 -04:00
Mike Frysinger cec11d5014 Blackfin: cmd_gpio: accept upper case pin names
The intention all along was to accept pin names irrelevant of their case.
But I guess I forgot to test/implement support for that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:40 -04:00
Mike Frysinger 73b6f4046b Blackfin: cmd_gpio: return gpio value to caller
Make the GPIO command usable in a scripting environment by returning
the GPIO value rather than always 0.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:39 -04:00
Mike Frysinger 1729615875 Blackfin: cmd_gpio: document/extend input sub-option
The input sub command was missing from the help text, and it didn't show
the actual value currently read on the GPIO.  This allows people to read
the value of input pins.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:39 -04:00
Mike Frysinger 821ad16fa9 Blackfin: move CONFIG_BFIN_CPU to board config.mk
The CONFIG_BFIN_CPU option is largely used in the build system, so move
it out of the board config.h and into the board config.mk.  It'd be nice
to keep everything in the config.h, but the patch to extract that value
early was rejected.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:38 -04:00
Mike Frysinger 543ef36586 Blackfin: bf561: merge headers
Only the BF561 port was using the common dual core headers, so merge them
into the BF561 specific headers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:38 -04:00
Mike Frysinger c489762ac2 Blackfin: bf533: merge headers
Only the BF533 port was using the common extended headers, so merge them
into the BF533 specific headers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:38 -04:00
Mike Frysinger 9615398dc2 Blackfin: unify core MMRs
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:38 -04:00
Mike Frysinger aa79cbbf27 Blackfin: bf52x: unify arch header duplication
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:38 -04:00
Mike Frysinger 9d291d816b Blackfin: bf537: unify arch header duplication
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:38 -04:00
Mike Frysinger 94e3e444de Blackfin: punt old *p style volatile MMR defines
These are unused now, so punt them to clean things up.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:38 -04:00
Mike Frysinger f47a5a83a2 Blackfin: punt headers for non-existent BF541
There is no BF541 processor variant, so punt headers for it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:37 -04:00
Mike Frysinger 6f070e1867 Blackfin: bfin_spi: add optional DMA support
This moves the last piece from the old spi_flash driver to the new SPI
framework -- optional DMA RX support.  This typically cuts speeds by ~40%
at the cost of additional ~300 bytes.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:36 -04:00
Mike Frysinger 2c0a6f2d4f Blackfin: add support for BF51x parts
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:36 -04:00
Mike Frysinger 180e311f28 Blackfin: add support for BF538/BF539 processors
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-02 16:00:36 -04:00
Stefano Babic f3554dfdd9 MX51: Register definitions cannot be included in board config file
Due to wrong dependencies, it is not possible to include imx_regs.h
inside the board configuration file.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-09-30 14:42:14 +02:00
Stefano Babic 9583dfab1d MX51: add structure to access System Reset Controller
Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-09-29 11:24:31 +02:00
Stefano Babic 35af33da00 MX51: Added pins definition to set up pads
Add pins definitions to set up RAM pads. Pins have only
a pad, there is no entry in the multiplexer.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-09-29 11:24:31 +02:00
Stefano Babic 87d98d3b8e ARM: Use syslib functions for all CORTEXA8
The OMAP3 cpu directory contains a syslib file with some utilities
that can be shared by all targets using arm cortexa8 processors,
not only OMAP.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-09-29 11:24:31 +02:00
Stefano Babic c4ea142424 Use common function to set GPIOs for MX3 and MX5
The patch adds support for setting gpios to the
MX51 processor and change name to the corresponding
functions for MX31. In this way, it is possible to get rid
of nasty #ifdef switches related to the processor type.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-09-29 11:24:30 +02:00
Wolfgang Denk 2e6e1772c0 Merge branch 'next' of /home/wd/git/u-boot/next
Conflicts:
	include/ppc4xx.h

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-09-28 23:30:47 +02:00
Wolfgang Denk 949c80e100 mpc512x: fix build issues
Commit 800eb0964 "POST cleanup." removed file
arch/powerpc/cpu/mpc512x/common.c but failed to remove the reference
to it from arch/powerpc/cpu/mpc512x/Makefile which causes somewhat
obscure build errors:

make[1]: *** No rule to make target `/work/wd/tmp-ppc/arch/powerpc/cpu/mpc512x/.depend', needed by `_depend'.  Stop.

Fix these.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-09-28 23:02:05 +02:00
Aneesh V 7ca3f9c568 ARMV7: OMAP4: Calculate SDRAM size
Calculate the SDRAM size from DMM configuration registers instead of using
hard-coded values. This gives correct values for all different boards.

It's assumed that DMM sections do not overlap memory areas.

Signed-off-by: Aneesh V <aneesh@ti.com>
Tested-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-09-28 13:54:43 -04:00
Thomas Weber 85d3eba90d ixp/npe: Remove duplicated comment
Signed-off-by: Thomas Weber <weber@corscience.de>
2010-09-28 14:48:44 +02:00
Anatolij Gustschin 9e70d1378c fsl_diu_fb: further refactoring of FSL DIU code
Move common code to the fsl_diu_fb.c file and remove obsolete
code from board files (aria, mpc8610hpcd and pdm360ng).
Move fsl_diu_fb.h file to the include directory.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2010-09-25 13:10:03 +02:00
Peter Tyser 6aa3d3bfaa 83xx: Remove warmboot parameter from PCI init functions
This change lays the groundwork for the BOOTFLAG_* flags being removed.

This change has the small affect of delaying 100ms on PCI initialization
after a warm boot as opposed to the optimal 1ms on some boards.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

included the mpc8308_p1m board.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2010-09-23 21:14:42 +02:00
Kim Phillips 654d49b401 mpc83xx: fix pcie build warning
Configuring for MPC8308RDB board...
pcie.c: In function 'mpc83xx_pcie_register_hose':
pcie.c:143: warning: assignment makes pointer from integer without a cast

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2010-09-23 21:14:25 +02:00
Ilya Yanok f1371048ab mpc83xx: add support for setting PCIE clocks
This patch adds support for setting PCIE clocks in cpu_init.c by
providing CONFIG_SYS_SCCR_PCIEXP{1,2} in configuration.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2010-09-23 21:13:56 +02:00
Ilya Yanok bab00b95b7 mpc83xx/pcie: make it compile with PCIE2 unconfigured
MPC8308 has only one PCIE host controller so we want it to compile
without CONFIG_SYS_PCIE2_CFG_{BASE,SIZE} defined.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2010-09-23 21:13:44 +02:00
Victor Gallardo ad876fff34 ppc4xx: Disable trace broadcast for 44x non debug mode
By default the trace broadcast is enabled on 44x systems.

To reduce power consumption when instruction tracing is
not needed, disable trace broadcast.

Check External Debug Mode (EDM) bit to detect if it should be
disabled or not.

Resetting system via a debugger will set the DBCR0[EDM] bit.
Resetting via u-boot or OS will not.

Signed-off-by: Victor Gallardo <vgallardo@apm.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2010-09-23 09:02:06 +02:00
Stefan Roese e02d449644 ppc4xx: Cleanup of PVR detection code in cpu.c
This patch cleans the PVR detection code in check_cpu() up a bit.
Basically the strings are better seperated, resulting in an easier
to understand and maintain code version.

The #ifdef's couldn't be removed easily because of two reasons:

- Some SoC revisions have the same PVR, so need a way to differentiate
  between those two SoC's.
- In some case statements registers only available in this SoC variant
  are referenced.

Instead I moved the CONFIG_440 #ifdef a bit, so that 405 platforms don't
add this 440 detection code and vice versa. Resulting in this U-Boot
image size change:

405EX (Kilauea):     408 bytes less
440EPx (Sequoia):    604 bytes less
460EX (Canyonlands): 564 bytes less

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
2010-09-23 09:02:06 +02:00
Stefan Roese 24956642ef Remove unused CONFIG_SERIAL_SOFTWARE_FIFO feature
This patch removes the completely unused CONFIG_SERIAL_SOFTWARE_FIFO
feature from U-Boot. It has only been implemented for PPC4xx and was not
used at all. So let's remove it and make the code smaller and cleaner.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
2010-09-23 09:02:05 +02:00
Stefan Roese 550650ddd0 ppc4xx: Use common NS16550 driver for PPC4xx UART
This patch removes the PPC4xx UART driver. Instead the common NS16550
driver is used, since all PPC4xx SoC's use this peripheral device.

The file 4xx_uart.c now only implements the UART clock calculation
function which also sets the SoC internal UART divisors.

All PPC4xx board config headers are changed to use this common NS16550
driver now.

Tested on these boards:
acadia, canyonlands, katmai, kilauea, sequoia, zeus

Signed-off-by: Stefan Roese <sr@denx.de>
2010-09-23 09:02:05 +02:00
Stefan Roese afabb498b7 ppc4xx: Big header cleanup part 2, mostly PPC405 related
This cleanup is done by creating header files for all SoC versions and
moving the SoC specific defines into these special headers. This way the
common header ppc405.h and ppc440.h can be cleaned up finally.

As a part from this cleanup, the GPIO definitions for PPC405EP are
corrected. The high and low parts of the registers (for example
CONFIG_SYS_GPIO0_OSRL vs. CONFIG_SYS_GPIO0_OSRH) have been defined in
the wrong order. This patch now fixes this issue by switching these
xxxH and xxxL values. This brings the GPIO 405EP port in sync with all
other PPC4xx ports.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-09-23 09:02:05 +02:00
Stefan Roese 5e7abce991 ppc4xx: Big header cleanup, mostly PPC440 related
This patch starts a bit PPC4xx header cleanup. First patch mostly
touches PPC440 files. A later patch will touch the PPC405 files as well.

This cleanup is done by creating header files for all SoC versions and
moving the SoC specific defines into these special headers. This way the
common header ppc405.h and ppc440.h can be cleaned up finally.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-09-23 09:02:05 +02:00
Stefan Roese 0988776288 ppc4xx: Move gpio.h to ppc4xx-gpio.h since its ppc4xx specific
Signed-off-by: Stefan Roese <sr@denx.de>
2010-09-23 09:02:05 +02:00
Stefan Roese b36df56115 ppc4xx: Move ppc4xx headers to powerpc include directory
This patch moves some ppc4xx related headers from the common include
directory (include/) to the powerpc specific one
(arch/powerpc/include/asm/). This way to common include directory is not
so cluttered with files.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-09-23 09:02:05 +02:00
Stefan Roese 8a805df136 ppc4xx/fdt/flash: Change fdt_fixup_nor_flash_node() to not rely on cs size
This patch changes the behaviour of the fdt_fixup_nor_flash_node()
function. Now it doesn't patch the size of the "reg" property with the
chip-select size, but with the size returned from the new function
flash_get_bank_size(). This function will return per weak default the
flash size of the bank (bank = chip-select numer) detected by the flash
driver. If this does not fit your needs, this function may be overridden
by a board specific one.

For this the parameters needed to be changed. So I intentionally squashed
the PPC4xx stuff using this routine into this patch. Otherwise it would
not be git-bisectable anymore.

The board specific function for the AMCC/APM Ebony eval board is now
included in this patch version.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Detlev Zundel <dzu@denx.de>
Cc: Gerald Van Baren <vanbaren@cideas.com>
Cc: Wolfgang Denk <wd@denx.de>
2010-09-23 08:49:49 +02:00
Mike Frysinger 55fed6fd0b Blackfin: bfin_spi: use same gpio cs define as Linux
Linux uses an offset of 8 to switch from hardware cs to a gpio cs,
so have u-boot use the same value.  Also make sure it is public
for boards to access.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-09-21 18:22:14 -04:00
Timur Tabi e69e520f9d fsl: refactor MPC8610 and MPC5121 DIU code to use existing bitmap and logo features
The Freescale MPC8610 and MPC5121 DIU code had re-implement two features that already
existed in U-Boot: bitmap drawing and top-of-screen logo (CONFIG_VIDEO_LOGO).
So delete the 8610-specific code and use the built-in features instead.

Signed-off-by: Timur Tabi <timur@freescale.com>
2010-09-21 22:46:02 +02:00
Michael Zaidman 800eb09641 POST cleanup.
- Revives POST for blackfin arch;
- Removes redundant code:
     arch/blackfin/lib/post.c
     arch/powerpc/cpu/ppc4xx/commproc.c
     arch/powerpc/cpu/mpc512x/common.c
- fixes up the post_word_{load|store} usage.

Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com>
Acked-by: Detlev Zundel <dzu@denx.de>
Tested-by: Anatolij Gustschin <agust@denx.de>

List of the maintainers of the affected by patch boards:
Cc: Stephan Linz <linz@li-pro.net>
Cc: Denis Peter <d.peter@mpl.ch>
Cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
Cc: Peter Tyser <ptyser@xes-inc.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Niklaus Giger <niklaus.giger@netstal.com>
Cc: Larry Johnson <lrj@acm.org>
Cc: Feng Kan <fkan@amcc.com>
2010-09-21 21:39:31 +02:00
Heiko Schocher a51dd67a03 ARM: implement relocation for arm1176
Change the implementation for arm1176 to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:56 +02:00
Heiko Schocher abef7b859d ARM: implement relocation for arm720t
Change the implementation for arm720t to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:56 +02:00
Heiko Schocher c6c2ceb124 ARM: implement relocation for arm_intcm
Change the implementation for arm_intcm to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:56 +02:00
Heiko Schocher ec985e94a2 ARM: implement relocation for lh7a40x
Change the implementation for lh7a40x to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:55 +02:00
Heiko Schocher 0110955a79 ARM: implement relocation for s3c44b0
Change the implementation for s3c44b0 to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:55 +02:00
Heiko Schocher e30ceca21f ARM: implement relocation for sa1100
Change the implementation for sa1100 to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:55 +02:00
Heiko Schocher 2af0a099ac ARM: implement relocation for ixp
Change the implementation for ixp to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:55 +02:00
Heiko Schocher 5347f68c85 ARM: implement relocation for pxa
Change the implementation for pxa to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:55 +02:00
Heiko Schocher 5a8a87ed0e ARM: implement relocation for ARM946
Change the implementation for arm946 to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:54 +02:00
Heiko Schocher 405d023b71 ARM: implement relocation for ARM925
Change the implementation for arm925 to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:54 +02:00
Heiko Schocher cc7cdcbd1d ARM: implement relocation for ARM920
Change the implementation for arm920 to relocate the code to
an arbitrary address in RAM.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:54 +02:00
Heiko Schocher ab86f72c35 ARM: implement relocation for ARM926
Change the implementation for arm926 to relocate the code to
an arbitrary address in RAM.

Adapt the TX25 (i.MX25), magnesium board to test the changes.

On the tx25 board TEXT_BASE is set to the final relocation
address to prevent one more copying of u-boot code
when relocating. More info see:
doc/README.arm-relocation

da850 board:
Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Ben Gardiner <bengardiner@nanometrics.ca>
2010-09-19 19:29:54 +02:00
Heiko Schocher 561142af20 ARM: implement relocation for ARM V7 (OMAP)
Change the implementation for ARM V7 to relocate the code to an
arbitrary address in RAM.

Adapt the Beagle board (Cortex A8) to test the changes.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:53 +02:00
Heiko Schocher e48b7c0aad ARM: implement relocation for ARM11
Change the implementation for ARM11 to relocate the code to an
arbitrary address in RAM.

Tested on the qong board.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:53 +02:00
Heiko Schocher f1d2b313c9 ARM: add relocation support
!! This breaks support for all arm boards !!

To compile in old style, you must define
CONFIG_SYS_ARM_WITHOUT_RELOC or you can compile
with "CONFIG_SYS_ARM_WITHOUT_RELOC=1 ./MAKEALL board"

!! This define will be removed soon, so convert your
board to use relocation support

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>

Fix boot from NAND for non-ARM systems
Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-09-19 19:29:53 +02:00
Heiko Schocher 3fbeeea633 common: move TOTAL_MALLOC_LEN to include/common.h
Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:52 +02:00
Heiko Schocher 620f1f6a64 relocation: fixup cmdtable
fixup_cmdtable() did all work for fixing up the cmdtable,
if CONFIG_RELOC_FIXUP_WORKS is not defined.

CONFIG_RELOC_FIXUP_WORKS is missing for i386! I talked
with Graeme Russ, and he will fix this soon.

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:51 +02:00
Heiko Schocher 7e4a9e6dc8 ARM (ARM11): add data cache support, test on Qong board
Add data cache support for arm1136 systems.

Enable "cache" command on Qong board and test performance.

    Test 1: Loading 127 MB of data from NAND flash into RAM:

    Instr. Cache	off	on	on
      Data Cache	off	off	on
    --------------------------------------------------
    QONG (ARM11)	177s	95s	43s	= x 4.1

    Test 2: uncompressing a gzipped image from RAM to RAM
            (size compressed: 6.5 MiB, uncompressed: 35 MiB):

    Instr. Cache	off	on	on
      Data Cache	off	off	on
    --------------------------------------------------
    QONG (ARM11)	1.54s	0.95s	0.18s	= x 8.6

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:51 +02:00
Heiko Schocher 95c6f6d34d ARM V7 (OMAP): add data cache support, test on Beagle board
Add data cache support for ARM V7 systems. Used cache flush
functions from linux:arch/arm/mm/cache-v7.S developed from
Catalin Marinas.

Enable "cache" command on Beagle board and test performance.

    Test 1: Loading 127 MB of data from NAND flash into RAM:

    Instr. Cache	off	on	on
      Data Cache	off	off	on
    --------------------------------------------------
    Beagle (Cortex A8)	116s	106s	30.3s	= x 3.8

    Test 2: uncompressing a gzipped image from RAM to RAM
            (size compressed: 6.5 MiB, uncompressed: 35 MiB):

    Instr. Cache	off	on	on
      Data Cache	off	off	on
    --------------------------------------------------
    Beagle (Cortex A8)	1.84s	1.64s	0.12s	= x 15.3

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Ben Gardiner<bengardiner@nanometrics.ca>
2010-09-19 19:29:51 +02:00
Heiko Schocher c3330e9d6a ARM (ARM926ejs): add data cache support, tested on magnesium and tx25 board
Enable "cache" command on tx25 and magnesium board and test performance.

    Test 1: Loading 127 MB of data from NAND flash into RAM:

    Instr. Cache        off     on      on
      Data Cache        off     off     on
    --------------------------------------------------
    magnesium           32,6s   22,5s   30s     = x 1,09
    tx25 (29MB only)    9,69s   5,05s   8,16s   = x 1,19

    Test 2: uncompressing a gzipped image from RAM to RAM
            (size compressed: 6.5 MiB, uncompressed: 35 MiB):

    Instr. Cache        off     on      on
      Data Cache        off     off     on
    --------------------------------------------------
    magnesium           4,25s   2,08s   1,72s   = x 2,47
    tx25                4,82s   2,04s   1,84s   = x 2,62

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Alessandro Rubini <rubini@gnudd.com>
2010-09-19 19:29:51 +02:00
Heiko Schocher 880eff5cfb ARM: cp15: setup mmu and enable dcache
This has been tested on at91sam9263 and STN8815.
Again, I didn't check if it has bad effects
on non-arm926 cores.

Initially I had a "done" bit to only set up page tables
at the beginning. However, since the aligmnent requirement
was for the whole object file, this extra integer tool 16kB
in BSS, so I chose to remove it.

Also, note not all boards use PHYS_SDRAM, but it looks like
it's the most used name (more than CONFIG_SYS_DRAM_BASE for
example).

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19 19:29:50 +02:00
Heiko Schocher 55e97429d1 arm: get rid of bi_env
bi_env is nowhere used, so delete it!

Signed-off-by: Heiko Schocher <hs@denx.de>

similar patch posted from Dirk Behme Tue Jul 27 18:36:09 CEST 2010
http://lists.denx.de/pipermail/u-boot/2010-July/074542.html
2010-09-19 19:29:50 +02:00
Wolfgang Denk ea882baf9c New implementation for internal handling of environment variables.
Motivation:

* Old environment code used a pessimizing implementation:
  - variable lookup used linear search => slow
  - changed/added variables were added at the end, i. e. most
    frequently used variables had the slowest access times => slow
  - each setenv() would calculate the CRC32 checksum over the whole
    environment block => slow
* "redundant" envrionment was locked down to two copies
* No easy way to implement features like "reset to factory defaults",
  or to select one out of several pre-defined (previously saved) sets
  of environment settings ("profiles")
* No easy way to import or export environment settings

======================================================================

API Changes:

- Variable names starting with '#' are no longer allowed

  I didn't find any such variable names being used; it is highly
  recommended to follow standard conventions and start variable names
  with an alphanumeric character

- "printenv" will now print a backslash at the end of all but the last
  lines of a multi-line variable value.

  Multi-line variables have never been formally defined, allthough
  there is no reason not to use them. Now we define rules how to deal
  with them, allowing for import and export.

- Function forceenv() and the related code in saveenv() was removed.
  At the moment this is causing build problems for the only user of
  this code (schmoogie - which has no entry in MAINTAINERS); may be
  fixed later by implementing the "env set -f" feature.

Inconsistencies:

- "printenv" will '\\'-escape the '\n' in multi-line variables, while
  "printenv var" will not do that.

======================================================================

Advantages:

- "printenv" output much better readable (sorted)
- faster!
- extendable (additional variable properties can be added)
- new, powerful features like "factory reset" or easy switching
  between several different environment settings ("profiles")

Disadvantages:

- Image size grows by typically 5...7 KiB (might shrink a bit again on
  systems with redundant environment with a following patch series)

======================================================================

Implemented:

- env command with subcommands:

  - env print [arg ...]

    same as "printenv": print environment

  - env set [-f] name [arg ...]

    same as "setenv": set (and delete) environment variables

    ["-f" - force setting even for read-only variables - not
    implemented yet.]

  - end delete [-f] name

    not implemented yet

    ["-f" - force delete even for read-only variables]

  - env save

    same as "saveenv": save environment

  - env export [-t | -b | -c] addr [size]

    export internal representation (hash table) in formats usable for
    persistent storage or processing:

	-t:	export as text format; if size is given, data will be
		padded with '\0' bytes; if not, one terminating '\0'
		will be added (which is included in the "filesize"
		setting so you can for exmple copy this to flash and
		keep the termination).
	-b:	export as binary format (name=value pairs separated by
		'\0', list end marked by double "\0\0")
	-c:	export as checksum protected environment format as
		used for example by "saveenv" command
	addr:	memory address where environment gets stored
	size:	size of output buffer

	With "-c" and size is NOT given, then the export command will
	format the data as currently used for the persistent storage,
	i. e. it will use CONFIG_ENV_SECT_SIZE as output block size and
	prepend a valid CRC32 checksum and, in case of resundant
	environment, a "current" redundancy flag. If size is given, this
	value will be used instead of CONFIG_ENV_SECT_SIZE; again, CRC32
	checksum and redundancy flag will be inserted.

	With "-b" and "-t", always only the real data (including a
	terminating '\0' byte) will be written; here the optional size
	argument will be used to make sure not to overflow the user
	provided buffer; the command will abort if the size is not
	sufficient. Any remainign space will be '\0' padded.

        On successful return, the variable "filesize" will be set.
        Note that filesize includes the trailing/terminating '\0'
        byte(s).

        Usage szenario: create a text snapshot/backup of the current
	settings:

		=> env export -t 100000
		=> era ${backup_addr} +${filesize}
		=> cp.b 100000 ${backup_addr} ${filesize}

	Re-import this snapshot, deleting all other settings:

		=> env import -d -t ${backup_addr}

  - env import [-d] [-t | -b | -c] addr [size]

    import external format (text or binary) into hash table,
    optionally deleting existing values:

	-d:	delete existing environment before importing;
		otherwise overwrite / append to existion definitions
	-t:	assume text format; either "size" must be given or the
		text data must be '\0' terminated
	-b:	assume binary format ('\0' separated, "\0\0" terminated)
	-c:	assume checksum protected environment format
	addr:	memory address to read from
	size:	length of input data; if missing, proper '\0'
		termination is mandatory

  - env default -f

    reset default environment: drop all environment settings and load
    default environment

  - env ask name [message] [size]

    same as "askenv": ask for environment variable

  - env edit name

    same as "editenv": edit environment variable

  - env run

    same as "run": run commands in an environment variable

======================================================================

TODO:

- drop default env as implemented now; provide a text file based
  initialization instead (eventually using several text files to
  incrementally build it from common blocks) and a tool to convert it
  into a binary blob / object file.

- It would be nice if we could add wildcard support for environment
  variables; this is needed for variable name auto-completion,
  but it would also be nice to be able to say "printenv ip*" or
  "printenv *addr*"

- Some boards don't link any more due to the grown code size:
  DU405, canyonlands, sequoia, socrates.

	=> cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>,
	       Stefan Roese <sr@denx.de>,
	       Heiko Schocher <hs@denx.de>

- Dropping forceenv() causes build problems on schmoogie

	=> cc: Sergey Kubushyn <ksi@koi8.net>

- Build tested on PPC and ARM only; runtime tested with NOR and NAND
  flash only => needs testing!!

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>,
Cc: Stefan Roese <sr@denx.de>,
Cc: Heiko Schocher <hs@denx.de>
Cc: Sergey Kubushyn <ksi@koi8.net>
2010-09-19 19:29:48 +02:00
Wolfgang Denk 91a76751a0 Make getenv() work before relocation.
So far, getenv() would work before relocation is most cases, even
though it was not intended to be used that way.  When switching to a
hash table based implementation, this would break a number of boards.

For convenience, we make getenv() check if it's running before
relocation and, if so, use getenv_f() internally.

Note that this is limited to simple cases, as we use a small static
buffer (32 bytes) in the global data for this purpose.

For this reason, it is also not a good idea to convert all current
uses of getenv_f() into getenv() - some of the existing use cases need
to be able to deal with longer variable values, so getenv_f() is still
needed and recommended for use before relocation.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-09-19 19:29:48 +02:00
Wolfgang Denk 3611665044 Cleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE
Traditionally many boards used local definitions for SRAM base address
and size (like SRAM_BASE, SRAM_LEN and/or SRAM_SIZE), while the (now)
"official" names are CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE.

The corresponding code in arch/powerpc/lib/board.c was board specific,
and has never actually been maintained well. Replace this by feature-
specific code and adapt the boards that actually use this.

NOTE: there is still a ton of boards using the old #defines, which
therefor contain incorrect values in bi_sramstart and bi_sramsize.

All respective board maintainers are requested to clean up their
respective configurations.  Thanks.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Josef Wagner <Wagner@Microsys.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
2010-09-19 19:29:46 +02:00
Wolfgang Denk 07517e7f4f Prepare v2010.09-rc2
Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-09-19 17:47:52 +02:00
Terry Lv a80603598c Save environment data to mmc.
This patch is to save environment data to mmc card.
It uses interfaces defined in generic mmc.

Signed-off-by: Terry Lv <r65388@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2010-09-19 17:47:29 +02:00
Thomas Weber c54b5923da ARM: Update ARM mach-types
This patch updates the mach-types.h based on the latest linux kernel

Signed-off-by: Thomas Weber <weber@corscience.de>
2010-09-18 23:54:50 +02:00
Graeme Russ 797960fda1 x86: Fix x86 Cold Boot
Commit 077e1958ca broke the ability of the
x86 port to boot from a cold-reset by removing the initial IDT. Re-
instate the initial IDT to allow cold-booting of x86 boards
2010-09-13 07:20:02 +10:00
Graeme Russ e69c0cba8f x86: Fix do_go_exec() - const argv[]
Commit 54841ab50c made the argv parameter
to do_go_exec() const but did not allow for the fact that argv[-1] is
set to point to the global data structure and relies on argv being non-
const.

With this patch, do_go_exec() creates a new copy of the argv array with
an extra element to store global data pointer rather than simply
clobbering an arbitrary memory location.
2010-09-13 07:20:02 +10:00
Wolfgang Denk 2d941de9d5 Prepare v2010.09-rc1
Coding style cleanup.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-09-10 00:16:19 +02:00
Wolfgang Denk 8fea51a4ac Merge branch 'master' of git://git.denx.de/u-boot-arm 2010-09-09 21:39:46 +02:00
Wolfgang Denk a78ded1311 Merge branch 'master' of git://git.denx.de/u-boot-ti 2010-09-09 19:55:02 +02:00
Wolfgang Denk 40e74c852b bedbug_860.c, bedbug_603e.c: Fix return type to silence compile warnings.
commit 47e26b1b "cmd_usage(): simplify return code handling" caused
the following compile warnings:

bedbug_860.c: In function 'bedbug860_do_break':
bedbug_860.c:73: warning: 'return' with a value, in function returning void
bedbug_860.c:121: warning: 'return' with a value, in function returning void

Fix the return type.

Actually these files could need some cleanup - commands should
return proper error codes, and there are coding style issues.
=> To be fixed later.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-09-08 22:02:54 +02:00
Steve Sakoman 3667cbeed5 ARMV7: OMAP3: Remove erroneous hard coded sdram setup for 128MB/bank
Upcoming Beagle and Overo revisions use POP memory with 256MB or 512MB
per bank.  This patches uses the SDRC settings from x-load or the config
header to set up timing properly.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-09-08 14:51:24 -04:00
Steve Sakoman 543431b66d ARMV7: OMAP3: Fix broken reset command on OMAP36XX/37XX and OMAP4
Using the reset command on OMAP36XX/37XX and OMAP4 caused a hang. This
patch uses the reset bit appropriate for each CPU architecture.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-09-08 14:51:18 -04:00
Mans Rullgard 0c0a0e0781 ARMV7: OMAP3: Apply Cortex-A8 errata workarounds only on affected revisions
The workarounds for errata 621766 and 725233 should only be applied
on affected Cortex-A8 revisions.  Recent chips use r3px cores where
these have been fixed.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-09-08 14:51:13 -04:00
Mans Rullgard 096ca838b5 ARMV7: OMAP3: Convert setup_auxcr() to pure asm
This function consists entirely of inline asm statements, so writing
it directly in a .S file is simpler. Additionally, the inline asm is
not safe as is, since registers are not guaranteed to be preserved
between asm() statements.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-09-08 14:51:09 -04:00
Mans Rullgard 2984470746 ARMV7: OMAP3: Fix and clean up L2 cache enable/disable functions
On OMAP34xx ES1.0, the L2 enable bit can only be set in secure mode,
so an SMC call to the ROM monitor is required.  On later versions,
and on newer devices, this bit is banked and we can set it directly.

The code checked only the ES revision of the chip, and hence incorrectly
used the ROM call on ES1.0 versions of other devices.

This patch adds a check for chip family as well as revision, and also
removes some code duplication between the enable and disable functions.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-09-08 14:51:04 -04:00
Steve Sakoman 7c281c985c ARMV7: OMAP3: Add clock setup for OMAP36XX/37XX
This patch configures clocks properly when a 36XX/37XX
processor is detected.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-09-08 14:50:58 -04:00
Steve Sakoman b2b9169f0b ARMV7: OMAP3: Update CPU type detection for AM35XX/OMAP36XX/37XX
TI has added new processors to the OMAP3 family.  This patch enhances
the code in sysinfo.c to detect which family member is present.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-09-08 14:50:52 -04:00
Steve Sakoman 0e7b62179f ARMV7: OMAP: Move syslib.c to omap-common since it can be shared by OMAP3 and OMAP4
The functions in syslib.c can be shared, so this patch moves it from
cpu/omap3 to cpu/omap-common

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-09-08 14:50:17 -04:00
Wolfgang Denk f8736c2125 Merge branch 'avr32' of git://git.denx.de/u-boot-atmel 2010-09-08 00:48:27 +02:00
Wolfgang Denk cf64fda38e Merge branch 'at91' of git://git.denx.de/u-boot-atmel 2010-09-08 00:42:00 +02:00
Wolfgang Denk 09b4a9cf40 Merge branch 'master' of git://git.denx.de/u-boot-samsung 2010-09-08 00:03:22 +02:00
Wolfgang Denk 27130f133e Merge branch 'master' of git://git.denx.de/u-boot-marvell 2010-09-07 23:20:53 +02:00
Wolfgang Denk f91506e283 Merge branch 'master' of /home/wd/git/u-boot/master 2010-09-07 22:19:49 +02:00
Wolfgang Denk c0026fc581 Merge branch 'master' of git://git.denx.de/u-boot-ppc4xx 2010-09-07 21:52:29 +02:00
Wolfgang Denk 6050c754b0 Merge branch 'next' of git://git.denx.de/u-boot-nios 2010-09-07 21:46:14 +02:00
Wolfgang Denk 67bd94148e Merge branch 'master' of git://git.denx.de/u-boot-i2c 2010-09-07 21:28:20 +02:00
Alexander Stein 5c3dab97c7 at91_pit: Fix AT91_PIT_MR_PIV_MASK macro
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
2010-09-03 16:26:45 +02:00
Haavard Skinnemoen 1f36f73fe7 avr32: Add simple paging support
Use the MMU hardware to set up 1:1 mappings between physical and virtual
addresses. This allows us to bypass the cache when accessing the flash
without having to do any physical-to-virtual address mapping in the CFI
driver.

The virtual memory mappings are defined at compile time through a sorted
array of virtual memory range objects. When a TLB miss exception
happens, the exception handler does a binary search through the array
until it finds a matching entry and loads it into the TLB. The u-boot
image itself is covered by a fixed TLB entry which is never replaced.

This makes the 'saveenv' command work again on ATNGW100 and other boards
using the CFI driver, hopefully without breaking any rules.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2010-09-03 15:13:02 +02:00
Haavard Skinnemoen 8d1334a787 avr32: Print unrelocated PC on exception
In addition to the real PC value, also print the value of PC after
subtracting the relocation offset. This value will match the address in
the ELF file so it's much easier to figure out where things went wrong.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2010-09-03 15:12:42 +02:00
Reinhard Meyer 7588ad12ba AT91: add option to enable pullups in at91sam9260_devices.c
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-09-03 11:22:49 +02:00
Reinhard Meyer e0cd44c3c1 AT91: reset.c: fix comments, add option
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-09-03 11:21:51 +02:00
Reinhard Meyer 93dfcbe3c8 AT91: fix at91sam9260.h for AT91SAM9XE
Define the different location of the GPBRs for the 9XE
Define the proper CPU Name

Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-09-03 11:21:02 +02:00
Reinhard Meyer d88bebe16d AT91SAM9XE: add embedded flash support
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-09-03 11:20:31 +02:00
Reinhard Meyer c7260d1539 AT91: add RTT and GPBR based RTC
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-09-03 11:20:02 +02:00
Reinhard Meyer 1592ef8596 AT91: MCI: add SD/MMC driver using mmc framework
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-09-03 11:19:01 +02:00
Stefan Roese f3cac53840 ppc4xx: Invalidate d-cache when used as init-ram
We need to invalidate the data cache after it has been used as init-ram.

This problem was detected on the lwmon5 update.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-09-03 11:14:26 +02:00
Stefan Roese c1ab75c7d4 ppc4xx: Fix 440EPx bug in reconfigure_pll()
This patch fixes a bug in reconfigure_pll(), where the detection of
the current bootstrap option is wrong. The ICS bits where incorrectly
shifted. This bug was found on the lwmon5 board, which uses bootstrap
option H (I2C bootstrap EEPROM).

Additionally a bit of code was moved into the if statement, since its
only used after later on. No need to run this code all the time.

Also, a few empty lines are added to make the code better readable.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Rupjyoti Sarmah <rsarmah@amcc.com>
Cc: Victor Gallardo <vgallardo@appliedmicro.com>
2010-09-03 11:14:21 +02:00
York Sun 8d9207c792 Fix parameters to support RDIMM for P2020DS
Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-08-31 11:23:04 -05:00
Jens Scharsig c982d866ea AT91 Fix: return value of get_tbclk
* Fix: return value of get_tbclk
 * this fixes issue with prematurely restart/retry, if BOOT_RETRY_TIMEOUT is used

Signed-off-by: Jens Scharsig <js_at_ng@scharsoft.de>
2010-08-31 10:38:35 +02:00
Minkyu Kang a87bc64cb4 ARMV7: S5P: rename the member of gpio structure
Typically we declare the name of gpio structure to "gpio",
so it was duplicated around the name. (e.g: gpio->gpio_a)
This patch modified the naming that is removing "gpio_".

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2010-08-30 14:44:33 +09:00
Minkyu Kang f70409aff3 ARMV7: S5P: separate the peripheral clocks
Because of peripheral devices can select clock sources,
separate the peripheral clocks. (pwm, uart and so on)
It just return the pclk at s5pc1xx SoC,
but s5pc210 SoC must be calculated by own clock register setting.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2010-08-30 14:44:16 +09:00
Albert Aribaud 438c37e1b3 orion5x: fix comment-in-comment typo in cpu.h
Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-08-27 21:41:48 +05:30
Prafulla Wadaskar f106056095 Kirkwood: bugfix: window size (mis)calculation
Fixed kw_winctrl_calcsize() off-by-1 bug which caused mapping
windows size to be cut by half.
This corrected all windows address configuration

Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
2010-08-26 14:43:55 +05:30
Albert Aribaud 4e4479a892 Orion5x: bugfix: window size (mis)calculation
Fix orion5x_winctrl_calcsize() off-by-1 bug which caused mapping
windows to be cut by half. This afected all windows including NOR
flash (causing half the flash to be unaccessible) but DRAM was and
still is fine as its size is determined otherwise.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-08-26 14:05:19 +05:30
Minkyu Kang 545dabbeef ARMV7: S5P: fix the macro at samsung_get_base function
New line is unnecessary at last line of macro.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2010-08-26 17:34:38 +09:00
Minkyu Kang da70a2bb4a S5P: mmc: fix the mmc offset
This patch fixed the size of mmc structure.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2010-08-23 15:34:37 +09:00
Minkyu Kang 37168dab52 ARMV7: S5P: rename from s5pc1xx to s5p
Because of these are common files around s5p Socs, rename from s5pc1xx to s5p.
And getting cpu_id is SoC specific, so move to SoC's header file.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2010-08-23 15:34:25 +09:00
Minkyu Kang 852bd07c80 ARMV7: S5P: make s5p-common for sharing the code between s5pc1xx and s5pc2xx
This patch adds basic support for s5pc210.
s5p-common will be used by all of s5p SoCs.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2010-08-23 15:34:20 +09:00
Nishanth Menon a947f4b68b omap2: i2c: remove redundant header definitions
Remove the register offset and common defines which are
already present in drivers/i2c/omap24xx.h. All of these
defines carry the same value even.

Cc: Steve Sakoman <steve@sakoman.com>
Cc: Heiko <hs@denx.de>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
Cc: Wolfang Denk <wd@denx.de>

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Steve Sakoman <steve@sakoman.com>
2010-08-23 08:09:04 +02:00
Nishanth Menon 46d8ece4e8 omap2: i2c: add syss offset
OMAP2420 ES2.3 trm defines syss register offset as 0x10. Add it.

Cc: Steve Sakoman <steve@sakoman.com>
Cc: Heiko <hs@denx.de>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
Cc: Wolfang Denk <wd@denx.de>

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Steve Sakoman <steve@sakoman.com>
2010-08-23 08:08:49 +02:00
Matthew McClintock b80d30546e mpx85xx/fdt: Add cpu-release-addr for all cores
We currently do not add a cpu-release-addr for core 0, this is needed
when we want to reset core 0 and later restart it from Linux

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-08-19 21:20:10 -05:00
Thomas Chou 7a6a7d10e6 nios2: fix out of reach case for do_reset
There is a limitation (or bug?) of nios2 toolchain. The nios2 gcc
didn't generate correct code when the reset vector is passed as a
constant. It just generated a direct "call", which was wrong when
the reset vector was not located in the same 256MB span as u-boot.

The "Nios II Processor Reference Handbook" said,
"call can transfer execution anywhere within the 256 MByte range
determined by PC31..28. The Nios II GNU linker does not automatically
handle cases in which the address is out of this range."

So we have to use registered "callr" instruction to do the job.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
2010-08-19 22:15:49 -04:00
Thomas Chou 62a0557382 nios2: fix bootm error on fdt args
We should check argv[3] only if there are enough args. Otherwise,
it might cause invalid memory access fault.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
2010-08-19 22:15:49 -04:00
Kumar Gala ed062e0f6c powerpc/85xx: Rename Security Engine Job Queue to Job Ring to match docs
Official docs call it the Job Ring not Job Queue for the p4080 security
block.  Match the docs to reduce confusion.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-08-19 02:06:13 -05:00
Kim Phillips 680c613a5c powerpc/8xxx: share PIC defines among 85xx and 86xx
fixes breakeage introduced by commit
a37c36f4e7 "powerpc/8xxx: query
feature reporting register for num cores on unknown cpus"

Reported-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-08-19 02:06:13 -05:00
Wolfgang Denk 5549d22b65 Merge branch 'master' of /home/wd/git/u-boot/master 2010-08-18 21:19:00 +02:00
Sandeep Paulraj 9ce2c4b7f7 ARM: Update ARM mach-types
This patch updates the mach-types.h based on the latest linux kernel

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-08-18 21:15:57 +02:00
Minkyu Kang d93d0f0cfe S5P: Use accessor functions instead of SoC specific defines to access the base address
This patch is intended to prepare the other S5P SoC. (s5pc210)
If use SoC specific defines then can't share with other SoC.
So, make the accessor functions for access the base address by common way.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2010-08-17 11:38:19 +09:00
Wolfgang Denk ae37a0704a Merge branch 'master' of git://git.denx.de/u-boot-ti 2010-08-12 23:08:05 +02:00
Wolfgang Denk 668a6b4591 Merge branch 'master' of git://git.denx.de/u-boot-usb 2010-08-12 23:05:22 +02:00
Ajay Kumar Gupta a7e9c513b6 AM35x: Adding SCM general register definitions
Adding general register structure of system control module (SCM)
of AM35x. This would be required to access devconf2 and ip_sw_reset
register in musb module.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
2010-08-12 16:39:59 +02:00
Mike Frysinger 5d89115c53 Blackfin: re-use board data in cpu banner
The bi_cpu field of the board data is already set to the relevant cpu
string, so there is no need for us to use the define directly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-11 11:29:19 -04:00
Michael Hennerich 5fc564eda7 Blackfin: shutdown video DMA when booting Linux
In case there is no frame buffer driver present in Linux to hand over the
PPI LCD DMA upon boot, the DMA initiated by u-boot to display the splash
screen runs unattended.  Therefore always stop the video driver in u-boot
before starting Linux.  If people don't want this behavior, then they can
simply stub out the video_stop() function in their board video driver.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-11 11:29:08 -04:00
Matthias Weisser 6052ac8386 ARM: Add support for MB86R0x SoCs
Signed-off-by: Matthias Weisser <weisserm@arcor.de>
2010-08-10 23:13:28 +02:00
Wolfgang Denk b9d51fbb18 Merge branch 'master' of git://git.denx.de/u-boot-arm 2010-08-10 23:03:15 +02:00
Wolfgang Denk b77f380115 Merge branch 'master' of git://git.denx.de/u-boot-imx 2010-08-10 22:49:09 +02:00
Albert Aribaud 4cfa0ab2c9 orion5x: allow overriding default mappings windows
Turn all ORION5X_DEF{ADR,SZ}_xxx macros into ORION5X_{ADR,SZ}_xxx
and allow defining them from board code to override defaults. This
is particularly useful for defining board-specific FLASH address
and size in board header file rather than having to tweak orion5x
code.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-08-10 22:44:12 +02:00
Wolfgang Denk fe8d63c8c7 Merge branch 'master' of git://git.denx.de/u-boot-marvell 2010-08-10 22:37:27 +02:00
Wolfgang Denk 9844d027b5 Merge branch 'master' of git://git.denx.de/u-boot-ti 2010-08-10 22:20:51 +02:00
Wolfgang Denk 201532a69c Merge branch 'master' of ../master 2010-08-10 22:20:27 +02:00
Li Haibo 51b5870bdc MX51EVK: fix return value of get_timer_masked
get_timer_masked() should return current timestamp,
not current ticks from hardware register.

Tested on one custom board with NAND flash.
Without this patch, NAND write always TIMEOUT
because get_timer(0) return a big value.

This patch applies for u-boot-2010.06

Signed-off-by: Li Haibo <hbli@sinocastel.com>
2010-08-10 09:46:44 +02:00
Mike Frysinger 5700bb6352 miiphy: constify device name
The driver name does not need to be writable, so constify it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-08-09 11:52:29 -07:00
Heiko Schocher 48690d8024 net ppc: fix ethernet device names with spaces
since commit 1384f3bb8a ethernet names
with spaces drop a

Warning: eth device name has a space!

message. This patch fix it for:

- "FEC ETHERNET" devices found on
  mpc512x, mpc5xxx, mpc8xx and mpc8220 boards.
  renamed to "FEC".
- "SCC ETHERNET" devices found on
  mpc8xx, mpc82xx based boards. Renamed to "SCC".
- "HDLC ETHERNET" devices found on mpc8xx boards
  Renamed to "HDLC"
- "FCC ETHERNET" devices found on mpc8260 and mpc85xx based
  boards. Renamed to "FCC"

Tested on the kup4k board.

Signed-off-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-08-09 11:52:28 -07:00
Stephan Linz 958e120643 fdt relocate: have more attention to use a bootmap or not
Platforms with flat device tree support can use a bootmap to relocate
the fdt_blob. This is not a must. That's why the relocation function
boot_relocate_fdt() should be use only if CONFIG_OF_LIBFDT was defined
together with CONFIG_SYS_BOOTMAPSZ (see common/cmd_bootm.c).

On MicroBlaze platforms there is no need to use a bootmap to relocate
a fdt blob. So we need a more precise focus on the compilation and usage
of boot_relocate_fdt().

In general it is valid to exclude the function boot_relocate_fdt() if
the bootmap size CONFIG_SYS_BOOTMAPSZ is not defined.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2010-08-08 22:16:05 +02:00
Prafulla Wadaskar 5f30500316 cmd_ide: add support for Kirkwood
Added MVSATAC definitions to Kirkwood.
Added support for Kirkwood in cmd_ide.

Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
2010-08-08 05:17:55 +05:30
Albert Aribaud 113bfe48bc cmd_ide: add support for orion5x
Add MVSATAHC definitions to orion5x.
Add support for orion5x in cmd_ide.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-08-08 05:17:06 +05:30
Albert Aribaud f2a37fcd9b ide: add configuration
CONFIG_IDE_SWAP_IO

This configuration option replaces a complex conditional
in cmd_ide.c with an explicit define to be added to SoC or
board configs.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-08-08 05:17:05 +05:30
Marek Vasut 560639806d ARM: Define __raw_readX and __raw_writeX
These functions are undefined on ARM when using __io. These are the commonly
used versions and can be redefined.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2010-08-07 22:34:25 +02:00
Wolfgang Denk 3df4f46f32 Merge branch 'master' of /home/wd/git/u-boot/master 2010-08-07 22:33:06 +02:00
Steve Sakoman 9b16757758 ARMV7: Restructure omap3 musb driver to allow code sharing between OMAP3 and OMAP4
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-08-05 10:11:34 -04:00
Steve Sakoman d708395d2f ARMV7: Modify i2c driver for more reliable operation on OMAP4
This patch modifies the init routine to follow the TRM
recommendations. It also modifies the i2c_read_byte function
to reflect subtle differences between the i2c controller in
OMAP3 and OMAP4.

Signed-off-by:  Steve Sakoman <steve@sakoman.com>
Acked-by: Nishanth Menon <menon.nishanth@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-08-05 10:11:24 -04:00
Steve Sakoman 674e0b217f ARMV7: Fix udelay for OMAP4
The OMAP4 x-load code sets gptimer1 clock source to 32Khz.  This isn't
acceptable for udelay.  This patch changes from gptimer1 to gptimer2,
which uses sys_clk at 38.4 Mhz.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-08-05 10:11:20 -04:00
Steve Sakoman 2ad853c348 ARMV7: Add pad mux support for OMAP4
Add functional multiplexing support for OMAP4 pads.
Configure all the pads for the OMAP4430 SDP
and OMAP4 Panda boards

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-08-05 10:11:14 -04:00
Wolfgang Denk cdb749778a Rename getenv_r() into getenv_f()
While running from flash, i. e. before relocation, we have only a
limited C runtime environment without writable data segment. In this
phase, some configurations (for example with environment in EEPROM)
must not use the normal getenv(), but a special function.  This
function had been called getenv_r(), with the idea that the "_r"
suffix would mean the same as in the _r_eentrant versions of some of
the C library functions (for example getdate vs. getdate_r, getgrent
vs. getgrent_r, etc.).

Unfortunately this was a misleading name, as in U-Boot the "_r"
generally means "running from RAM", i. e. _after_ relocation.

To avoid confusion, rename into getenv_f() [as "running from flash"]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
2010-08-04 00:45:36 +02:00
Wolfgang Denk 9efac4a1eb Merge branch 'master' of git://git.denx.de/u-boot-samsung 2010-08-04 00:35:10 +02:00
Wolfgang Denk 36448c6038 Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx 2010-08-04 00:30:50 +02:00
Wolfgang Denk ac956293be Merge branch 'master' of /home/wd/git/u-boot/master 2010-08-03 22:45:13 +02:00
Minkyu Kang 5000284872 S5P: support mmc driver
This patch adds support mmc driver for s5p SoC

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2010-08-03 10:18:15 +09:00
Kim Phillips a37c36f4e7 powerpc/8xxx: query feature reporting register for num cores on unknown cpus
doing so helps avant garde users, such as those using simulators that
allow users to configure the number of cores, so as to not have to
manually adjust u-boot sources.  h/w should also be reliably setting
FRR NCPU in the future.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-08-01 11:18:45 -05:00
Mike Frysinger c8cf4fc407 Blackfin: gpio: use common usage func
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-07-29 13:29:52 -04:00
york 5fb8a8a731 powerpc/8xxx: Improvement to DDR parameters
Changes for P2020DS DDR applies to other 8xxx platform

Signed-off-by: York Sun <yorksun@freescale.com>
2010-07-26 13:16:10 -05:00
york 9490ff4864 powerpc/8xxx: Enable DDR3 RDIMM support
Enabled registered DIMMs using data from SPD. RDIMMs have registers
which need to be configured before using. The register configuration
words are stored in SPD byte 60~116 (JEDEC standard No.21-C). Software
should read those RCWs and put into DDR controller before initialization.

Signed-off-by: York Sun <yorksun@freescale.com>
2010-07-26 13:16:10 -05:00
york 7fd101c97b powerpc/8xxx: Enabled address hashing for 85xx
For 85xx silicon which supports address hashing, it can be activated by
hwconfig.

Signed-off-by: York Sun <yorksun@freescale.com>
2010-07-26 13:16:09 -05:00
york 5800e7ab32 powerpc/8xxx: Enable quad-rank DIMMs.
Previous code presumes each DIMM has up to two rank (chip select). Newer
DDR controller supports up to four chip select on one DIMM.

Signed-off-by: York Sun <yorksun@freescale.com>
2010-07-26 13:16:09 -05:00
york 076bff8f47 powerpc/8xxx: Fix bug in memctrl interleaving & bank interleaving on cs0~cs4
Verified on MPC8641HPCN with four DDR2 dimms. Each dimm has dual
rank with 512MB each rank.

Also check dimm size and rank size for memory controller interleaving

Signed-off-by: York Sun <yorksun@freescale.com>
2010-07-26 13:16:09 -05:00
Kumar Gala 79e4e6480b powerpc/8xxx: Enabled hwconfig for memory interleaving
Replace environmental variables memctl_intlv_ctl and ba_intlv_ctl with
hwconfig parameters. The syntax is

    setenv hwconfig "fsl_ddr:ctlr_intlv=<mode>,bank_intlv=<mode>"

The mode values for memory controller interleaving are
    cacheline
    page
    bank
    superbank

The mode values for bank interleaving are
    cs0_cs1
    cs2_cs3
    cs0_cs1_and_cs2_cs3
    cs0_cs1_cs2_cs3

Signed-off-by: York Sun <yorksun@freescale.com>
2010-07-26 13:16:08 -05:00
Kumar Gala fd3c9befa8 powerpc/p4080: Add workaround for erratum CPU22
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-07-26 13:07:57 -05:00
Kumar Gala 61054ffa16 powerpc/p4080: Add workaround for errata SERDES8
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-07-26 13:07:57 -05:00
Kumar Gala 34a8258fea powerpc/p4080: Add support for initializing SERDES
Add support for initializing the SERDES blocks on CoreNet style QoriQ
devices and the p4080 specific SERDES tables to know which actual
componetns are enabled.

Additionally, split out the Frame Manger (FMAN) into its specific ethernet
ports instead of gross level of the full FMAN.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-07-26 13:07:57 -05:00
Kumar Gala db977abfc8 powerpc/85xx: Add support to initialize LIODN registers and portals
On the new QorIQ/CoreNet based platforms we need to initialize the
"portals" as access into the Data Path subystem as well as Logical IO
Device Numbers (LIODN) that are used for the IOMMU (PAMU).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-07-26 13:07:56 -05:00
Kumar Gala 6aba33e939 powerpc/p4080: Add support for CPC(Corenet platform cache) on CoreNet platforms
The CoreNet style platforms can have a L3 cache that fronts the memory
controllers.  Enable that cache as well as add information into the
device tree about it.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Dave Liu <daveliu@freescale.com>
Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-07-26 13:07:56 -05:00
york a3f18529ec powerpc/85xx: Move INIT_RAM_ADDR physical address to 36-bit space
If 36-bit physical address is used, move the INIT_RAM_ADDR to higher
address. This frees the low 4GB address space for better use.

Signed-off-by: York Sun <yorksun@freescale.com>
2010-07-26 13:07:49 -05:00
Kumar Gala ebd7cb0ba9 powerpc/fsl_fman: Add initial fman immap structures
Add basic structures for Frame Manager on P4080/P3041/P5020 devices

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-07-26 08:07:47 -05:00
Kumar Gala 9ab87d04a8 powerpc/85xx: Add additional p4080 platform related defines/structs
* Added PCIE4 address, offset, DEVDISR & LAW target ID
* Added new p4080 DDR registers and defines to immap
* Add missing corenet platform DEVDISR related defines
* Updated ccsr_gur to include LIODN registers
* Add RCWSR defines
* Added Basic qman, pme, bman immap structs
* Added SATA related offsets & addresses
* Added Frame Manager 1/2 offsets & addresses
* Renamed CONFIG_SYS_TSEC1_OFFSET to CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET
* Added various offsets and addresses that where missing

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-07-26 08:07:47 -05:00
Mike Frysinger b990c7bda4 Blackfin: jtag-console: handle newline stuffing
Serial devices currently have to manually stuff \r after every \n found,
but this is a bit more difficult with the jtag console since we process
everything in chunks of 4 bit.  So we have to scan & stuff the whole
string rather than what most serial drivers do which is output on a byte
per byte basis.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-07-25 15:17:34 -04:00
Mike Frysinger 4fff5ac2f8 Blackfin: jtag-console: add debug markers
While we're in here, add some useful debug points.  We need custom debug
statements because we need the output to only go to the serial port.  If
we used the standard debug helpers, the output would also go to the stdout
(which would be the jtag console) and make it hard to figure out what is
going where exactly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-07-25 15:17:31 -04:00
Mike Frysinger 5079d8bbad Blackfin: jtag-console: robustify against missing peer
If the other side isn't listening, we should reset the state to ignore
the whole message and not just the part we missed.  This makes it easier
to connect at any time to the jtag console without worrying about the two
sides getting out of sync and thus sending garbage back and forth.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-07-25 15:17:27 -04:00
Wolfgang Denk 47e26b1bf9 cmd_usage(): simplify return code handling
Lots of code use this construct:

	cmd_usage(cmdtp);
	return 1;

Change cmd_usage() let it return 1 - then we can replace all these
ocurrances by

	return cmd_usage(cmdtp);

This fixes a few places with incorrect return code handling, too.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-07-24 20:43:57 +02:00
Wolfgang Denk 9662317142 Merge branch 'master' of git://git.denx.de/u-boot-ppc4xx 2010-07-24 20:34:13 +02:00
Stefan Roese be24ef6e8e ppc4xx: Add ECC status info to machine-check exception for IBM DDR2 core
Signed-off-by: Stefan Roese <sr@denx.de>
2010-07-23 09:55:03 +02:00
Stefan Roese 58eb869ffc ppc4xx: Add "ecctest" command to test/simulate ECC errors
This patch adds the "ecctest" command to test and simulate ECC errors
(single bit and/or double bit) while running from SDRAM. Currently only
the IBM DDR2 controller is supported (405EX, 440SP(e), 460EX/GT).

This is done by copying and calling functions, modifying the SDRAM
controller operation mode, in internal SRAM/OCM.

For correctable ECC errors (single bit) only the status will be printed
since the DDR2 controller doesn't provide the faulting address:

=> ecctest 1000000 1
Using address 01000000 for 1 bit ECC error injection
ECC: Correctable error

Uncorrectable ECC errors (double bit) will also display the faulting
address:

=> ecctest 1000000 2
Using address 01000000 for 2 bit ECC error injection
ECC: Uncorrectable error at 0x0001000000

To enable this "ecctest" function you need to define CONFIG_CMD_ECCTEST
in the board config header.

Tested on katmai and t3corp.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-07-23 09:54:54 +02:00
Stefan Roese b995d7cb2c ppc4xx: DDR/ECC: Use correct macros to clear error status
Use the correct macro instead of the hardcoded 0x4c to clear the ECC
status in the 440/460 DDR(2) error status register after ECC
initialization.

Also the non-440 parts (405EX(r) right now) and the IBM DDR PPC variants
(440GX) use a different registers to clear this error status. Use the
correct ones.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-07-23 09:54:28 +02:00
Stefan Roese 897d6abc50 ppc4xx: Only define DDR2 registers for the correct PowerPC variants
Make sure that some SDRAM/DDR2 registers are only defined for the PPC
variants really implementing those registers.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-07-23 09:54:22 +02:00
Stefan Roese eab9800182 ppc4xx: Add CONFIG_DDR_RFDC_FIXED to allow board specific RFDC values
Using this define, a board can define an opimized RFDC value and use
the auto calibration code to "tune" the remaining DDR2 controller
calibration register.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-07-23 09:54:09 +02:00