]> git.kernelconcepts.de Git - karo-tx-uboot.git/log
karo-tx-uboot.git
13 years agoatmel_lcd: Allow contrast polarity to be either positive or negative
Alexander Stein [Tue, 20 Jul 2010 06:55:40 +0000 (08:55 +0200)]
atmel_lcd: Allow contrast polarity to be either positive or negative

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
13 years agop1022ds: use weak CFI flash accessors when DIU is enabled
Timur Tabi [Thu, 16 Sep 2010 21:35:44 +0000 (16:35 -0500)]
p1022ds: use weak CFI flash accessors when DIU is enabled

On the Freescale P1022, the DIU and the LBC share address pins, which means
that when the DIU is active (e.g. the console is on the DVI display), NOR flash
cannot be accessed.  So we use the weak accessor function feature of the CFI
flash code to temporarily switch the pin mux from DIU to LBC whenever we want
to read or write flash.  This has a significant performance penalty, but it's
the only way to make it work.

This change allows the 'saveenv' command to work when the video display is
enabled.  Erasing flash and writing to flash (with the 'cp' command) works,
but reading from flash (with the 'md' and 'cp' commands) does not.  Also, while
flash is being written, the video display will be blank.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
13 years agop1022ds: add video support
Timur Tabi [Thu, 23 Sep 2010 23:25:53 +0000 (01:25 +0200)]
p1022ds: add video support

Add support for the DIU controller.  If CONFIG_VIDEO is defined, then
the console will appear on a DVI monitor instead of the serial port.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
13 years agofsl_diu_fb: further refactoring of FSL DIU code
Anatolij Gustschin [Thu, 23 Sep 2010 23:06:37 +0000 (01:06 +0200)]
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>
13 years ago83xx: Remove warmboot parameter from PCI init functions
Peter Tyser [Wed, 15 Sep 2010 00:13:50 +0000 (19:13 -0500)]
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>
13 years agompc83xx: extend CONFIG_SYS_BOOTMAPSZ increase to mpc8308_p1m
Kim Phillips [Wed, 22 Sep 2010 20:36:27 +0000 (15:36 -0500)]
mpc83xx: extend CONFIG_SYS_BOOTMAPSZ increase to mpc8308_p1m

continuation of commit 39da1ba923d55f316f9f1bb3a960e4ed91dc17ac:
"e300: increase CONFIG_SYS_BOOTMAPSZ to allow booting large kernels"

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
13 years agompc83xx: fix pcie build warning
Kim Phillips [Wed, 22 Sep 2010 20:31:01 +0000 (15:31 -0500)]
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>
13 years agompc8308_p1m: support for MPC8308 P1M board
Ilya Yanok [Fri, 17 Sep 2010 21:41:50 +0000 (23:41 +0200)]
mpc8308_p1m: support for MPC8308 P1M board

This patch provides support for MPC8308 P1M board with the following
set of features:
 Dual UART is supported
 NOR flash is supported
 Both TSEC Ethernet controllers are supported
 PCI Express initialization is supported
 Both I2C controllers are supported

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
13 years agoMPC8308RDB: various clean ups
Ilya Yanok [Fri, 17 Sep 2010 21:41:49 +0000 (23:41 +0200)]
MPC8308RDB: various clean ups

This patch cleans up the Freescale MPC8308RDB Development board support.
Things fixed:
 - Removed unused PCIE2 definitions from configuration
 - SICR{L,H} defines used for System I/O Configuration Registers values
   instead of hardcoding
 - CONFIG_SYS_SCCR_PCIEXP1CM used to enable PCIE clock instead of
   writing to SCCR from the board code
 - sleep mode stuff removed as MPC8308 has no support for deep sleep and
   PMCCR1 register. board_early_init_f() removed.
 - MPC8308 has no ERRATA for DDR controller so workaround removed
 - 'assignment in if statement' issues solved
 - use LBLAWAR_* defines instead of hardcoding

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
13 years agompc8308: add SICR{L,H} fields definitions
Ilya Yanok [Fri, 17 Sep 2010 21:41:48 +0000 (23:41 +0200)]
mpc8308: add SICR{L,H} fields definitions

This patch adds defines to set supported fields in System I/O
Configuration Registers High and Low on Freescale MPC8308 CPU.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
13 years agompc83xx: add support for setting PCIE clocks
Ilya Yanok [Fri, 17 Sep 2010 21:41:47 +0000 (23:41 +0200)]
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>
13 years agompc83xx/pcie: make it compile with PCIE2 unconfigured
Ilya Yanok [Fri, 17 Sep 2010 21:41:46 +0000 (23:41 +0200)]
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>
13 years agoe300: increase CONFIG_SYS_BOOTMAPSZ to allow booting large kernels
Ira W. Snyder [Fri, 10 Sep 2010 22:42:32 +0000 (15:42 -0700)]
e300: increase CONFIG_SYS_BOOTMAPSZ to allow booting large kernels

Newer Linux kernels can overrun the initial memory window used for
booting with their BSS area. When this happens, they overwrite the FDT
and silently fail to boot.

On e300 CPUs, the Linux kernel uses an initial BAT covering the first
256MB of RAM. See arch/powerpc/kernel/head_32.S for details. Increase
the value of CONFIG_SYS_BOOTMAPSZ to accommodate the maximum value
allowed by Linux. This will allow very large kernels to boot.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
13 years agompc831xerdb: enable mtdparts for NAND
Scott Wood [Mon, 30 Aug 2010 23:04:52 +0000 (18:04 -0500)]
mpc831xerdb: enable mtdparts for NAND

The default partition table matches the .dts files for these boards in
Linux.  This allows these partitions to be used by name with U-Boot's
"nand" command.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
13 years agoppc4xx: Disable trace broadcast for 44x non debug mode
Victor Gallardo [Thu, 16 Sep 2010 18:32:04 +0000 (11:32 -0700)]
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>
13 years agoppc4xx: Cleanup of PVR detection code in cpu.c
Stefan Roese [Fri, 3 Sep 2010 11:27:02 +0000 (13:27 +0200)]
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>
13 years agoppx4xx: remove unused functionality for DU405 boards
Matthias Fuchs [Tue, 21 Sep 2010 07:38:04 +0000 (09:38 +0200)]
ppx4xx: remove unused functionality for DU405 boards

Remove some unused functionality to make U-Boot build again.
Especially PCI is not used on the board.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
Signed-off-by: Stefan Roese <sr@denx.de>
13 years agoRemove unused CONFIG_SERIAL_SOFTWARE_FIFO feature
Stefan Roese [Wed, 15 Sep 2010 07:33:25 +0000 (09:33 +0200)]
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>
13 years agoppc4xx: Remove now unused CONFIG_UART1_CONSOLE
Stefan Roese [Tue, 21 Sep 2010 08:24:36 +0000 (10:24 +0200)]
ppc4xx: Remove now unused CONFIG_UART1_CONSOLE

CONFIG_UART1_CONSOLE was a PPC4xx specific implementation and is now
removed since the move from the 4xx UART driver to the common NS16550
UART driver. Let's remove all references to this define now.

Signed-off-by: Stefan Roese <sr@denx.de>
13 years agoppc4xx: Use common NS16550 driver for PPC4xx UART
Stefan Roese [Mon, 20 Sep 2010 14:05:31 +0000 (16:05 +0200)]
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>
13 years agoppc4xx: Big header cleanup part 2, mostly PPC405 related
Stefan Roese [Sun, 12 Sep 2010 04:21:37 +0000 (06:21 +0200)]
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>
13 years agoppc4xx: Big header cleanup, mostly PPC440 related
Stefan Roese [Sat, 11 Sep 2010 07:31:43 +0000 (09:31 +0200)]
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>
13 years agoppc4xx: Move gpio.h to ppc4xx-gpio.h since its ppc4xx specific
Stefan Roese [Thu, 16 Sep 2010 12:30:37 +0000 (14:30 +0200)]
ppc4xx: Move gpio.h to ppc4xx-gpio.h since its ppc4xx specific

Signed-off-by: Stefan Roese <sr@denx.de>
13 years agoppc4xx: Move ppc4xx headers to powerpc include directory
Stefan Roese [Thu, 9 Sep 2010 17:18:00 +0000 (19:18 +0200)]
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>
13 years agoppc4xx: Remove unreferenced file include/405_dimm.h
Stefan Roese [Thu, 9 Sep 2010 17:19:18 +0000 (19:19 +0200)]
ppc4xx: Remove unreferenced file include/405_dimm.h

Signed-off-by: Stefan Roese <sr@denx.de>
13 years agofsl: refactor MPC8610 and MPC5121 DIU code to use existing bitmap and logo features
Timur Tabi [Wed, 1 Sep 2010 00:56:43 +0000 (19:56 -0500)]
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>
13 years agovideo: cfb_console: add support for 4bpp bitmaps with GDF_32BIT_X888RGB
Timur Tabi [Mon, 23 Aug 2010 21:58:00 +0000 (16:58 -0500)]
video: cfb_console: add support for 4bpp bitmaps with GDF_32BIT_X888RGB

Add support for 4bpp bitmaps, currently only for GDF_32BIT_X888RGB
frame buffer format.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
13 years agologos: add Freescale logo
Timur Tabi [Mon, 30 Aug 2010 21:27:31 +0000 (16:27 -0500)]
logos: add Freescale logo

Add the Freescale logo and update the Makefile to build it when building
a Freescale board.

Signed-off-by: Timur Tabi <timur@freescale.com>
13 years agosilence config step commands display during MAKEALL builds
Kim Phillips [Tue, 14 Sep 2010 19:48:16 +0000 (14:48 -0500)]
silence config step commands display during MAKEALL builds

[u-boot next]$ ./MAKEALL 83xx
awk '(NF && $1 !~ /^#/) { print $1 ": " $1 "_config; $(MAKE)" }' boards.cfg > .boards.depend
Configuring for ve8313 board...

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
13 years agoarm: Make jadecpu board use relocation
Matthias Weisser [Tue, 21 Sep 2010 13:37:44 +0000 (15:37 +0200)]
arm: Make jadecpu board use relocation

This patch modifies jadecpu board so that it is usable
with the relocation patches by Heiko Schocher

Signed-off-by: Matthias Weisser <weisserm@arcor.de>
13 years agoMerge branch 'next' of ../custodians into next
Wolfgang Denk [Tue, 21 Sep 2010 07:34:37 +0000 (09:34 +0200)]
Merge branch 'next' of ../custodians into next

13 years agoMerge branch 'next' of git://git.denx.de/u-boot-usb into next
Wolfgang Denk [Tue, 21 Sep 2010 07:34:02 +0000 (09:34 +0200)]
Merge branch 'next' of git://git.denx.de/u-boot-usb into next

13 years agoMerge branch 'next' of ../custodians into next
Wolfgang Denk [Tue, 21 Sep 2010 07:22:17 +0000 (09:22 +0200)]
Merge branch 'next' of ../custodians into next

13 years agoUSB-CDC: Fix coding style issues
Vitaly Kuzmichev [Mon, 13 Sep 2010 14:37:11 +0000 (18:37 +0400)]
USB-CDC: Fix coding style issues

Fixes most of checkpatch warnings and errors in USB gadget stack.

The most frequently encountered problems are:
1) "(foo*)", "foo * bar", "foo* bar"
2) C99 // comments
3) No spaces before/after/around '?', ':', '=', '==', ',', '&', '('
4) Spaces before '['
5) Spaces between function names and '('
6) Block braces in wrong places
7) Spaces before tabs
8) Macros with complex values not enclosed in parenthesis
9) Multiline comments start just after /*

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
13 years agoUSB-CDC: called handle_interrupts inside usb_eth_send
Stefano Babic [Sun, 15 Aug 2010 12:19:00 +0000 (14:19 +0200)]
USB-CDC: called handle_interrupts inside usb_eth_send

The patch removes an endless loop  in the usb_eth_send
if the tx_complete is not called before going
in the loop. The driver interrupt routine is called
allowing the driver to check if the TX is completed.

Signed-off-by: Stefano Babic <sbabic@denx.de>
13 years agoUSB-CDC: correct wrong alignment in ether.c
Stefano Babic [Sun, 15 Aug 2010 12:18:59 +0000 (14:18 +0200)]
USB-CDC: correct wrong alignment in ether.c

The buffer for the status request must be word aligned
because it is accessed with 32 bit pointer in the
eth_status_complete function.

Signed-off-by: Stefano Babic <sbabic@denx.de>
13 years agoUSB-CDC: change simple_strtol to simple_strtoul
Vitaly Kuzmichev [Fri, 13 Aug 2010 13:02:41 +0000 (17:02 +0400)]
USB-CDC: change simple_strtol to simple_strtoul

The patch is based on commit bb9496c6f7e853e5d4edd5397c9d45f1968d623c
(done by Julia Lawall <julia@diku.dk>) from linux-2.6.git.

Since num is unsigned, it would seem better to use simple_strtoul that
simple_strtol.

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
13 years agoUSB-CDC: ethernet error path potential oops fix
Vitaly Kuzmichev [Fri, 13 Aug 2010 13:02:29 +0000 (17:02 +0400)]
USB-CDC: ethernet error path potential oops fix

Fix potential oops on rare error path.
The patch is based on commit e7b13ec9235b9fded90f826ceeb8c34548631351
(done by David Brownell <david-b@pacbell.net>) from linux-2.6.git.

Description of the issue taken from linux kernel bugzilla:
(https://bugzilla.kernel.org/show_bug.cgi?id=9594)

The potential error can be tracked down as follows:

(1) line 807: let the second conjunct on the "if" statment be false
    meaning "dev->status_ep" is null. This means the "if" evaluates
    to false.

follow thru the code until...

(2) line 808: usb_ep_disable(dev->status_ep) passes in a null argument,
    however "usb_ep_disable" cannot handle that:

(from include/linux/usb/gadget.h)
191 static inline int
192 usb_ep_disable (struct usb_ep *ep)
193 {
194         return ep->ops->disable (ep);
195 }

--

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
13 years agoUSB-CDC: Correct stat_req initialization
Vitaly Kuzmichev [Fri, 13 Aug 2010 13:01:06 +0000 (17:01 +0400)]
USB-CDC: Correct stat_req initialization

Fix possible oops on stat_req->buf initialization and fix ep0 and
status_ep confusion (last one is just intended for stat_req keeping).

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>
13 years agoUSB-CDC: Replace 'strcpy' by 'strlcpy'
Vitaly Kuzmichev [Fri, 13 Aug 2010 13:00:45 +0000 (17:00 +0400)]
USB-CDC: Replace 'strcpy' by 'strlcpy'

Replace 'strcpy' by more safe 'strlcpy' that is implemented in ether.c

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
13 years agoUSB-CDC: Correct freeing usb requests
Vitaly Kuzmichev [Fri, 13 Aug 2010 13:00:16 +0000 (17:00 +0400)]
USB-CDC: Correct freeing usb requests

Fix in_ep and out_ep confusion (rx_req was allocated from out_ep, not
from in_ep) and add lost dev->req freeing.

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
13 years agoUSB-CDC: Use native debug printout macros
Vitaly Kuzmichev [Fri, 13 Aug 2010 12:57:51 +0000 (16:57 +0400)]
USB-CDC: Use native debug printout macros

Replace Linux-like debug printout macros by native ones.

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
Applied after removing dead code like '#define DEBUG/#undef DEBUG'

13 years agoUSB-CDC: Add lost 'qmult' definition
Vitaly Kuzmichev [Thu, 12 Aug 2010 12:44:40 +0000 (16:44 +0400)]
USB-CDC: Add lost 'qmult' definition

Add lost 'qmult' definition for High Speed devices and make it
configurable through CONFIG_USB_ETH_QMULT.

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
13 years agoUSB-CDC: Restuct USB gadget Makefile
Vitaly Kuzmichev [Thu, 12 Aug 2010 12:44:39 +0000 (16:44 +0400)]
USB-CDC: Restuct USB gadget Makefile

Prohibit simultaneous usage of both old and new gadget stacks and
allow UDC drivers to be dependent on CONFIG_USB_ETHER.

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
13 years agoIntegrate USB gadget layer and USB CDC driver layer
Remy Bohmer [Wed, 29 Jul 2009 16:18:43 +0000 (18:18 +0200)]
Integrate USB gadget layer and USB CDC driver layer

Derived from Linux kernel 2.6.27

Signed-off-by: Thomas Smits <ts.smits@gmail.com>
Signed-off-by: Remy Bohmer <linux@bohmer.net>
13 years agousb: musb: stub out MUSB_TXCSR_MODE for Blackfin parts
Mike Frysinger [Wed, 11 Aug 2010 21:54:00 +0000 (17:54 -0400)]
usb: musb: stub out MUSB_TXCSR_MODE for Blackfin parts

The MUSB_TXCSR_MODE register setting isn't supported on Blackfin musb
parts, so stub it out to 0.  This matches Linux behavior.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agocfi_flash: Remove uneccessary #ifdef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
Stefan Roese [Tue, 31 Aug 2010 08:04:11 +0000 (10:04 +0200)]
cfi_flash: Remove uneccessary #ifdef CONFIG_SYS_MAX_FLASH_BANKS_DETECT

Now that the defines are moved to header files we don't need this
conditional compilation any more. Remove it.

Signed-off-by: Stefan Roese <sr@denx.de>
13 years agocfi_flash: Simplify dynamic flash bank number detection
Stefan Roese [Tue, 31 Aug 2010 08:00:10 +0000 (10:00 +0200)]
cfi_flash: Simplify dynamic flash bank number detection

This patch simplifies the use of CONFIG_SYS_MAX_FLASH_BANKS_DETECT. By
moving these optional variables and defines into the common code, board
specific code is minimized. Currently only the following board use
this feature:

APC405, IDS8247, TQM834x

And IDS8247 doesn't seem to really need this feature, since its not
updating the bank number variable at all. So this patch removes the
definition of CONFIG_SYS_MAX_FLASH_BANKS_DETECT from this board port.

This new framework will be used by the upcoming lwmon5 update as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
Cc: Matthias Fuchs <matthias.fuchs@esd.eu>
13 years agocfi_flash: Add weak default for cfi_flash_bank_addr()
Stefan Roese [Mon, 30 Aug 2010 08:11:51 +0000 (10:11 +0200)]
cfi_flash: Add weak default for cfi_flash_bank_addr()

cfi_flash_bank_addr(int bank_nr) returns the base addresses of the
requested bank. Introducing this weak default enables boards to override
this functions with a board specific version when required.

This feature will be used in the lwmon5 board update, supporting runtime
detection of 2 board revisions with different flash layouts.

Signed-off-by: Stefan Roese <sr@denx.de>
13 years agocfi_flash: Simplify flash_get_info()
Stefan Roese [Mon, 30 Aug 2010 09:14:38 +0000 (11:14 +0200)]
cfi_flash: Simplify flash_get_info()

This patch removes an unecessary check in the return statement. This is
not needed, since "info" is initializes to NULL. And "info" will not be
written to again, if the flash address is not found.

Additionally "info" is not initialized to "0" but to "NULL".

Signed-off-by: Stefan Roese <sr@denx.de>
13 years agoRemove spieval board support
Wolfgang Denk [Sun, 19 Sep 2010 19:34:31 +0000 (21:34 +0200)]
Remove spieval board support

Recent changes caused that the spieval board now is included in the
boards built by MAKEALL, which revealed that compilation for this
board has been broken for a long time:

mpc5xxx_fec.c:899:2: error: #error fec->xcv_type not initialized.
mpc5xxx_fec.c:899:2: error: #error fec->xcv_type not initialized.

The board is orphaned.  Drop support for it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
13 years agoRemove smmaco4 board support
Wolfgang Denk [Sun, 19 Sep 2010 19:32:37 +0000 (21:32 +0200)]
Remove smmaco4 board support

Recent changes caused that the smmaco4 board now is included in the
boards built by MAKEALL, which revealed that compilation for this
board has been broken for a long time:

mpc5xxx_fec.c:899:2: error: #error fec->xcv_type not initialized.

The board is orphaned.  Drop support for it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
13 years agoRemove HMI10 board support
Wolfgang Denk [Sun, 19 Sep 2010 19:28:25 +0000 (21:28 +0200)]
Remove HMI10 board support

Recent changes caused that the HMI10 board now is included in the
boards built by MAKEALL, which revealed that compilation for this
board has been broken for a long time:

ps2ser.c: In function 'ps2ser_init':
ps2ser.c:155: error: 'UART_LCR' undeclared (first use in this function)
ps2ser.c:155: error: (Each undeclared identifier is reported only once
ps2ser.c:155: error: for each function it appears in.)
ps2ser.c:156: error: 'UART_DLL' undeclared (first use in this function)
ps2ser.c:157: error: 'UART_DLM' undeclared (first use in this function)
ps2ser.c:159: error: 'UART_IER' undeclared (first use in this function)
ps2ser.c:160: error: 'UART_MCR' undeclared (first use in this function)
ps2ser.c:161: error: 'UART_FCR' undeclared (first use in this function)
ps2ser.c:162: error: 'UART_FCR_ENABLE_FIFO' undeclared (first use in this function)
ps2ser.c:166: error: 'UART_LSR' undeclared (first use in this function)
ps2ser.c: In function 'ps2ser_putc':
ps2ser.c:198: error: 'UART_LSR' undeclared (first use in this function)
ps2ser.c:200: error: 'UART_TX' undeclared (first use in this function)
ps2ser.c: In function 'ps2ser_getc_hw':
ps2ser.c:224: error: 'UART_LSR' undeclared (first use in this function)
ps2ser.c:225: error: 'UART_RX' undeclared (first use in this function)
ps2ser.c: In function 'ps2ser_interrupt':
ps2ser.c:293: error: 'UART_IIR' undeclared (first use in this function)

The board is orphaned, and AFAICT has reached EOL.
Drop support for it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
13 years agocanmb board: Fix compiler warnings
Wolfgang Denk [Sun, 19 Sep 2010 10:59:41 +0000 (12:59 +0200)]
canmb board: Fix compiler warnings

Recent changes caused thatthe aev board now is included in the boards
built by MAKEALL, which revealed that compilation for this board
has been broken for a long time:

canmb.c: In function 'initdram':
canmb.c:109: warning: pointer targets in passing argument 1 of 'get_ram_size' differ in signedness
canmb.c:111: warning: pointer targets in passing argument 1 of 'get_ram_size' differ in signedness
canmb.c:137: warning: pointer targets in passing argument 1 of 'get_ram_size' differ in signedness
canmb.c:140: warning: pointer targets in passing argument 1 of 'get_ram_size' differ in signedness

Fix these.

Signed-off-by: Wolfgang Denk <wd@denx.de>
13 years agoaev board: Fix compile problems
Wolfgang Denk [Sun, 19 Sep 2010 10:40:02 +0000 (12:40 +0200)]
aev board: Fix compile problems

Recent changes caused thatthe aev board now is included in the boards
built by MAKEALL, which revealed that compilation for this board has
been broken for a long time:

mpc5xxx_fec.c:899:2: error: #error fec->xcv_type not initialized.
mpc5xxx_fec.c:899:2: error: #error fec->xcv_type not initialized.

Fix it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
13 years agoda8xx: fixup ARM relocation support
Ben Gardiner [Mon, 23 Aug 2010 13:08:15 +0000 (09:08 -0400)]
da8xx: fixup ARM relocation support

Split the existing dram_init for da8xx when ARM reloc is enabled, like the
changes to arch/arm/cpu/arm926ejs/orion5x/dram.c in
0f234d263b17ccf1b8fd776eb8c15b7cdb27a887 by Heiko Schocher <hs@denx.de>.

Without these changes gd->ram_size is '0' which leads to incorrect relocation
when CONFIG_SYS_ARM_WITHOUT_RELOC is defined and the board does not boot.

We use get_ram_size to dynamically calculate the available RAM because it runs
on different board version with different ram, as suggested by Heiko in private
communication.

Tested on a da850evm with 128M of DDR2 installed; with both
CONFIG_SYS_ARM_WITHOUT_RELOC defined and undefined.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
CC: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
CC: Heiko Schocher <hs@denx.de>
13 years agoARM: implement relocation for arm1176
Heiko Schocher [Fri, 17 Sep 2010 11:10:53 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for arm720t
Heiko Schocher [Fri, 17 Sep 2010 11:10:52 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for arm_intcm
Heiko Schocher [Fri, 17 Sep 2010 11:10:51 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for lh7a40x
Heiko Schocher [Fri, 17 Sep 2010 11:10:50 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for s3c44b0
Heiko Schocher [Fri, 17 Sep 2010 11:10:49 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for sa1100
Heiko Schocher [Fri, 17 Sep 2010 11:10:48 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for ixp
Heiko Schocher [Fri, 17 Sep 2010 11:10:47 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for pxa
Heiko Schocher [Fri, 17 Sep 2010 11:10:46 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for ARM946
Heiko Schocher [Fri, 17 Sep 2010 11:10:45 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for ARM925
Heiko Schocher [Fri, 17 Sep 2010 11:10:44 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for ARM920
Heiko Schocher [Fri, 17 Sep 2010 11:10:43 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for ARM926
Heiko Schocher [Fri, 17 Sep 2010 11:10:42 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for ARM V7 (OMAP)
Heiko Schocher [Fri, 17 Sep 2010 11:10:41 +0000 (13:10 +0200)]
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>
13 years agoARM: implement relocation for ARM11
Heiko Schocher [Fri, 17 Sep 2010 11:10:40 +0000 (13:10 +0200)]
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>
13 years agoARM: add relocation support
Heiko Schocher [Fri, 17 Sep 2010 11:10:39 +0000 (13:10 +0200)]
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>
13 years agonand_boot_fsl_nfc.c: make "nfc" a "static const" pointer
Heiko Schocher [Fri, 17 Sep 2010 11:10:38 +0000 (13:10 +0200)]
nand_boot_fsl_nfc.c: make "nfc" a "static const" pointer

With -fPIC enabled, this variable needs an entry in the GOT, which
causes the image size to exceed 2 KiB which is the maximum allowed for
some systems. Making it a "static const" avoids the GOT entry and thus
reduces the image size to < 2 KiB.

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

Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Scott Wood <scottwood@freescale.com>
13 years agoi2c, omap24xx: set bus_initialized only after relocation.
Heiko Schocher [Fri, 17 Sep 2010 11:10:37 +0000 (13:10 +0200)]
i2c, omap24xx: set bus_initialized only after relocation.

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

Signed-off-by: Heiko Schocher <hs@denx.de>
13 years agodisk/part.c: fix relocation fixup
Heiko Schocher [Fri, 17 Sep 2010 11:10:36 +0000 (13:10 +0200)]
disk/part.c: fix relocation fixup

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

Signed-off-by: Heiko Schocher <hs@denx.de>
13 years agoi2c: fix command usage help
Heiko Schocher [Fri, 17 Sep 2010 11:10:35 +0000 (13:10 +0200)]
i2c: fix command usage help

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

Signed-off-by: Heiko Schocher <hs@denx.de>
13 years agocommon: move TOTAL_MALLOC_LEN to include/common.h
Heiko Schocher [Fri, 17 Sep 2010 11:10:34 +0000 (13:10 +0200)]
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>
13 years agorelocation: fixup cmdtable
Heiko Schocher [Fri, 17 Sep 2010 11:10:33 +0000 (13:10 +0200)]
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>
13 years agoARM (ARM11): add data cache support, test on Qong board
Heiko Schocher [Fri, 17 Sep 2010 11:10:32 +0000 (13:10 +0200)]
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>
13 years agoARM V7 (OMAP): add data cache support, test on Beagle board
Heiko Schocher [Fri, 17 Sep 2010 11:10:31 +0000 (13:10 +0200)]
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>
13 years agoARM (ARM926ejs): add data cache support, tested on magnesium and tx25 board
Heiko Schocher [Fri, 17 Sep 2010 11:10:30 +0000 (13:10 +0200)]
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>
13 years agoARM: cp15: setup mmu and enable dcache
Heiko Schocher [Fri, 17 Sep 2010 11:10:29 +0000 (13:10 +0200)]
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>
13 years agoarm: get rid of bi_env
Heiko Schocher [Fri, 17 Sep 2010 11:10:28 +0000 (13:10 +0200)]
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

13 years agompc52xx: Cleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE
Heiko Schocher [Mon, 13 Sep 2010 10:12:33 +0000 (12:12 +0200)]
mpc52xx: Cleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE

cleanup for the uc101 and the mucmc52 board.

Signed-off-by: Heiko Schocher <hs@denx.de>
13 years agotools: enable img2srec for "tools-all" target
Mike Frysinger [Sun, 15 Aug 2010 04:03:19 +0000 (00:03 -0400)]
tools: enable img2srec for "tools-all" target

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agotools/env: use host build flags
Mike Frysinger [Sun, 15 Aug 2010 04:03:22 +0000 (00:03 -0400)]
tools/env: use host build flags

Convert the tools/env/Makefile to use the same host tool syntax as the
other tool subdirs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agounify toplevel tools targets
Mike Frysinger [Sun, 15 Aug 2010 04:03:21 +0000 (00:03 -0400)]
unify toplevel tools targets

Most tool subdirs do not rely on a configured tree, so move those targets
out of the config checks and unify them in the process.

Also add an easylogo target so people can easily build that.

Also add these new tool targets to the 'tools-all' target.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agotools: update .gitignore
Mike Frysinger [Sun, 15 Aug 2010 04:03:20 +0000 (00:03 -0400)]
tools: update .gitignore

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoMAKEALL: cut down on duplication of targets
Mike Frysinger [Thu, 19 Aug 2010 17:05:06 +0000 (13:05 -0400)]
MAKEALL: cut down on duplication of targets

Merge the other significant source of board name duplication with the new
boards.cfg file.  I cleaned up most targets, but the ARM and MIPS trees
are such a mess than I didn't bother.  If those maintainers care, they can
take are of it.

While we're at it, we can be a bit more clever in the LIST_xxx handling
and avoid duplicating the list names too.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Ben Gardiner <bengardiner@nanometrics.ca>
Tested-by: Thomas Chou <thomas@wytron.com.tw>
13 years agoMakefile: restore support for board shortcut targets
Mike Frysinger [Wed, 11 Aug 2010 22:52:36 +0000 (18:52 -0400)]
Makefile: restore support for board shortcut targets

The helpful shortcut for doing a board config + make was dropped recently
as it conflicted with some new build code.  However, the reason for using
pattern targets originally was to avoid managing a duplicate list of
boards.  Since we now have one centralized place for a list of boards (the
new boards.cfg), we don't need a pattern target -- we can generate the
exact list of boards on the fly.  So do just that.

When cleaning things up, the top level gitignore file ignores all things
that end with ".depend", but the clean target only deletes files that are
named exactly ".depend".  Keep these in sync by having the clean target
punt all files that match the pattern that gitignore is using.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Detlev Zundel <dzu@denx.de>
13 years agoNew implementation for internal handling of environment variables.
Wolfgang Denk [Sun, 20 Jun 2010 21:33:59 +0000 (23:33 +0200)]
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>
13 years agoMake getenv() work before relocation.
Wolfgang Denk [Sat, 24 Jul 2010 18:22:02 +0000 (20:22 +0200)]
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>
13 years agoRemove support for CONFIG_HAS_UID and "forceenv" command
Wolfgang Denk [Sun, 20 Jun 2010 14:03:45 +0000 (16:03 +0200)]
Remove support for CONFIG_HAS_UID and "forceenv" command

This (undocumented) concept was only in use for the MVSMR and
davinci_schmoogie Sergey Kubushyn <ksi@koi8.net> boards.
Drop it for now.  If really needed, it should be reimplemented
later in the context of the new environment command set.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Andre Schwarz <andre.schwarz@matrix-vision.de>
Cc: Sergey Kubushyn <ksi@koi8.net>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
13 years agoAdd hash table support as base for new environment code
Wolfgang Denk [Sun, 20 Jun 2010 11:17:12 +0000 (13:17 +0200)]
Add hash table support as base for new environment code

This implementation is based on code from uClibc-0.9.30.3 but was
modified and extended for use within U-Boot.

Major modifications and extensions:

* hsearch() [modified / extended]:
  - While the standard version does not make any assumptions about
    the type of the stored data objects at all, this implementation
    works with NUL terminated strings only.
  - Instead of storing just pointers to the original objects, we
    create local copies so the caller does not need to care about the
    data any more.
  - The standard implementation does not provide a way to update an
    existing entry.  This version will create a new entry or update an
    existing one when both "action == ENTER" and "item.data != NULL".
  - hsearch_r(): Instead of returning 1 on success, we return the
    index into the internal hash table, which is also guaranteed to be
    positive.  This allows us direct access to the found hash table
    slot for example for functions like hdelete().
* hdelete() [added]:
  - The standard implementation of hsearch(3) does not provide any way
    to delete any entries from the hash table.  We extend the code to
    do that.
* hexport() [added]:
  - Export the data stored in the hash table in linearized form:
    Entries are exported as "name=value" strings, separated by an
    arbitrary (non-NUL, of course) separator character. This allows to
    use this function both when formatting the U-Boot environment for
    external storage (using '\0' as separator), but also when using it
    for the "printenv" command to print all variables, simply by using
    as '\n" as separator. This can also be used for new features like
    exporting the environment data as text file, including the option
    for later re-import.
  - The entries in the result list will be sorted by ascending key
    values.
* himport() [added]:
  - Import linearized data into hash table.  This is the inverse
    function to hexport(): it takes a linear list of "name=value"
    pairs and creates hash table entries from it.
  - Entries without "value", i. e. consisting of only "name" or
    "name=", will cause this entry to be deleted from the hash table.
  - The "flag" argument can be used to control the behaviour: when
    the H_NOCLEAR bit is set, then an existing hash table will kept,
    i. e. new data will be added to an existing hash table;
    otherwise, old data will be discarded and a new hash table will
    be created.
  - The separator character for the "name=value" pairs can be
    selected, so we both support importing from externally stored
    environment data (separated by NUL characters) and from plain text
    files (entries separated by newline characters).
  - To allow for nicely formatted text input, leading white space
    (sequences of SPACE and TAB chars) is ignored, and entries
    starting (after removal of any leading white space) with a '#'
    character are considered comments and ignored.
  - NOTE: this means that a variable name cannot start with a '#'
    character.
  - When using a non-NUL separator character, backslash is used as
    escape character in the value part, allowing for example fo
    multi-line values.
  - In theory, arbitrary separator characters can be used, but only
    '\0' and '\n' have really been tested.

Signed-off-by: Wolfgang Denk <wd@denx.de>
13 years agoAdd qsort - add support for sorting data arrays
Wolfgang Denk [Sat, 12 Jun 2010 23:45:10 +0000 (01:45 +0200)]
Add qsort - add support for sorting data arrays

Code adapted from uClibc-0.9.30.3

Signed-off-by: Wolfgang Denk <wd@denx.de>
13 years agoAdd basic errno support.
Wolfgang Denk [Fri, 11 Jun 2010 22:19:46 +0000 (00:19 +0200)]
Add basic errno support.

Needed for hash table support; probably useful in a lot of other
places as well.

Signed-off-by: Wolfgang Denk <wd@denx.de>
13 years ago4xx: adjust TEXT_BASE to increase U-Boot image size
Wolfgang Denk [Sun, 25 Jul 2010 21:08:00 +0000 (23:08 +0200)]
4xx: adjust TEXT_BASE to increase U-Boot image size

On some boards (canyonlands, luan, sequoia) we need more room for the
U-Boot image to allow for new features like the new environment code.
Shift TEXT_BASE as needed.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
13 years agoIceCube.h: update configuration
Wolfgang Denk [Thu, 1 Jul 2010 07:44:39 +0000 (09:44 +0200)]
IceCube.h: update configuration

Increase malloc size,
enable command line editing and history,
enable hush shell.

Signed-off-by: Wolfgang Denk <wd@denx.de>
13 years agoCleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE
Wolfgang Denk [Wed, 11 Aug 2010 07:38:31 +0000 (09:38 +0200)]
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>
13 years ago4xx: add missing CONFIG_SYS_SRAM_SIZE definition
Wolfgang Denk [Fri, 10 Sep 2010 21:04:05 +0000 (23:04 +0200)]
4xx: add missing CONFIG_SYS_SRAM_SIZE definition

A number of boards define CONFIG_SYS_SRAM_BASE but fail to define
CONFIG_SYS_SRAM_SIZE which is needed when cleaning up the code that
prints this information with the bdinfo command.

Add the missing deinitions.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
13 years agoPrepare v2010.09-rc2 v2010.09-rc2
Wolfgang Denk [Sun, 19 Sep 2010 15:47:52 +0000 (17:47 +0200)]
Prepare v2010.09-rc2

Signed-off-by: Wolfgang Denk <wd@denx.de>