oweals/u-boot.git
16 years agosocrates: Fix PCI clk fix patch
Andy Fleming [Tue, 10 Jun 2008 23:49:34 +0000 (18:49 -0500)]
socrates: Fix PCI clk fix patch

The submitted patch seems to have been more up-to-date, but an older patch was
already in the repository.  This patch encompasses the differences

Taken entirely from Sergei Poselenov <sposelenov@emcraft.com>

Signed-off-by: Andy Fleming <afleming@freescale.com>
16 years agoNAND FSL UPM: driver re-write using the hwcontrol callback
Wolfgang Grandegger [Thu, 5 Jun 2008 11:02:29 +0000 (13:02 +0200)]
NAND FSL UPM: driver re-write using the hwcontrol callback

This is a re-write of the NAND FSL UPM driver using the more universal
hwcontrol callback (instead of the cmdfunc callback). Here is a brief
list of furher modifications:

- For the time being, the UPM setup writing the UPM array has been
  removed from the driver and must now be done by the board specific
  code.

- The bus width definition in "struct fsl_upm_nand" is now in bits to
  comply with the corresponding Linux driver and 8, 16 and 32 bit
  accesses are supported.

- chip->dev_read is only set if fun->dev_ready != NULL, which is
  required for boards not connecting the R/B pin.

- A few issue have been fixed with MxMR bit manipulation like in the
  corresponding Linux driver.

Note: I think the "io_addr" field of "struct fsl_upm" could be removed
      as well, because the address is already determined by
      "nand->IO_ADDR_[RW]", but I'm not 100% sure.

This patch has been tested on a TQM8548 modules with the NAND chip
Micron MT29F8G08FABWP.

This patch is based on the following patches posted to this list a few
minutes ago:

  PPC: add accessor macros to clear and set bits in one shot
  83xx/85xx/86xx: add more MxMR local bus definitions

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>
16 years agoMPC85xx: Beautify boot output of L2 cache configuration
Wolfgang Grandegger [Thu, 5 Jun 2008 11:11:59 +0000 (13:11 +0200)]
MPC85xx: Beautify boot output of L2 cache configuration

The boot output is now aligned poperly with other boot output
lines, e.g.:

  FLASH: 128 MB
  L2:    512 KB enabled

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
16 years agoPPC: add accessor macros to clear and set bits in one shot
Wolfgang Grandegger [Wed, 4 Jun 2008 10:45:22 +0000 (12:45 +0200)]
PPC: add accessor macros to clear and set bits in one shot

PPC: add accessor macros to clear and set bits in one shot

This patch adds macros from linux/include/asm-powerpc/io.h to clear and
set bits in one shot using the in_be32, out_be32, etc. accessor functions.
They are very handy to manipulate bits it I/O registers.

This patch is required for my forthcoming FSL NAND UPM driver re-write and
the support for the TQM8548 module.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
16 years agoTQM: move TQM boards to board/tqc
Wolfgang Grandegger [Wed, 4 Jun 2008 11:52:17 +0000 (13:52 +0200)]
TQM: move TQM boards to board/tqc

Move all TQM board directories to the vendor specific directory "tqc"
for modules from TQ-Components GmbH (http://www.tqc.de).

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
16 years ago83xx/85xx/86xx: add more MxMR local bus definitions
Wolfgang Grandegger [Mon, 2 Jun 2008 10:09:30 +0000 (12:09 +0200)]
83xx/85xx/86xx: add more MxMR local bus definitions

83xx/85xx/86xx: add more MxMR local bus definitions

This patch adds more macro definitions for the UPM Machine Mode Registers
They are copied from "include/mpc82xx.h" to simplify the merge of all 8xxx
common local bus definitions into include/asm-ppc/fsl_lbc.h. They are
required for my forthcoming FSL NAND UPM driver re-write and the support
for the TQM8548 module.

This patch is based on the following two patches from Anton Vorontsov:

http://www.mail-archive.com/u-boot-users@lists.sourceforge.net/msg06511.html
http://www.mail-archive.com/u-boot-users@lists.sourceforge.net/msg06587.html

I leave coding style violation fixes, code beautification and name
corrections to somebody else ;-(.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
16 years ago83xx/85xx: further localbus cleanups
Anton Vorontsov [Thu, 29 May 2008 14:14:56 +0000 (18:14 +0400)]
83xx/85xx: further localbus cleanups

Merge mpc85xx.h's LBC defines to fsl_lbc.h. Also, adopt ACS names
from mpc85xx.h, so ACS_0b10 renamed to ACS_DIV4, ACS_0b11 to ACS_DIV2.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
16 years ago83xx/85xx/86xx: factor out Freescale Localbus defines out of mpc83xx.h
Anton Vorontsov [Wed, 28 May 2008 14:20:15 +0000 (18:20 +0400)]
83xx/85xx/86xx: factor out Freescale Localbus defines out of mpc83xx.h

This patch moves Freescale Localbus defines out of mpc83xx.h, so we could
use it on MPC85xx and MPC86xx processors.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
16 years ago85xx: Add setting of cache props in the device tree.
Kumar Gala [Thu, 29 May 2008 16:22:06 +0000 (11:22 -0500)]
85xx: Add setting of cache props in the device tree.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago85xx: expose cpu identification
Kumar Gala [Tue, 10 Jun 2008 21:53:46 +0000 (16:53 -0500)]
85xx: expose cpu identification

The current cpu identification code is used just to return the name
of the processor at boot.  There are some other locations that the name
is useful (device tree setup).  Expose the functionality to other bits
of code.

Also, drop the 'E' suffix and add it on by looking at the SVR version
when we print this out.  This is mainly to allow the most flexible use
of the name.  The device tree code tends to not care about the 'E' suffix.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago85xx: Only use PORPLLSR[DDR_Ratio] on platforms that define it
Kumar Gala [Thu, 29 May 2008 06:21:24 +0000 (01:21 -0500)]
85xx: Only use PORPLLSR[DDR_Ratio] on platforms that define it

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoMPC85xx: Change traps.c to not reference non-addressable memory
Becky Bruce [Wed, 14 May 2008 18:10:04 +0000 (13:10 -0500)]
MPC85xx: Change traps.c to not reference non-addressable memory

Currently, END_OF_RAM is used by the trap code to determine if
we should attempt to access the stack pointer or not. However,
on systems with a lot of RAM, only a subset of the RAM is
guaranteed to be mapped in and accessible.  Change END_OF_RAM
to use get_effective_memsize() instead of using the raw ram
size out of the bd.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
16 years agoMerge branch 'master' of ssh://mercury/home/wd/git/u-boot/master
Wolfgang Denk [Wed, 4 Jun 2008 23:12:30 +0000 (01:12 +0200)]
Merge branch 'master' of ssh://mercury/home/wd/git/u-boot/master

16 years agoSocrates: Fix PCI bus frequency report
Wolfgang Denk [Tue, 27 May 2008 12:19:30 +0000 (14:19 +0200)]
Socrates: Fix PCI bus frequency report

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
16 years agoFix incorrect switch for IF_TYPE in part.c
Tor Krill [Thu, 29 May 2008 09:10:30 +0000 (11:10 +0200)]
Fix incorrect switch for IF_TYPE in part.c

Use correct field in block_dev_desc_t when writing interface type in
dev_print. Error introduced in 574b3195.

Also added fix from Martin Krause

Signed-off-by: Tor Krill <tor@excito.com>
16 years agoAdd size #defines for Altera Cyclone-II EP2C8 and EP2C20.
Andre Schwarz [Tue, 27 May 2008 08:25:39 +0000 (10:25 +0200)]
Add size #defines for Altera Cyclone-II EP2C8 and EP2C20.

Signed-off-by: Andre Schwarz <andre.schwarz@matrix-vision.de>
16 years agoAdditional fix to readline_into_buffer() with CONFIG_CMDLINE_EDITING before relocating
Peter Tyser [Thu, 22 May 2008 23:56:52 +0000 (18:56 -0500)]
Additional fix to readline_into_buffer() with CONFIG_CMDLINE_EDITING before relocating

Removed unneeded command line history initialization.  Also, the original
code would access the 'initted' variable before relocation to SDRAM
which resulted in erratic behavior since the bss is not initialized when
executing from flash.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
16 years agoPPC4xx: Simplified post_word_{load, store}
Grant Erickson [Wed, 21 May 2008 20:28:30 +0000 (13:28 -0700)]
PPC4xx: Simplified post_word_{load, store}

This patch simplifies post_word_{load,store} by using the preprocessor
to eliminate redundant, copy-and-pasted code.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
16 years agoDTT: Issue one-shot command on AD7414 (LM75 code) to read temp
Stefan Roese [Fri, 16 May 2008 09:06:06 +0000 (11:06 +0200)]
DTT: Issue one-shot command on AD7414 (LM75 code) to read temp

On AD7414 the first value upon bootup is not read correctly.
This is most likely because of the 800ms update time of the
temp register in normal update mode. To get current values
each time we issue the "dtt" command including upon powerup
we switch into one-short mode.

This patch fixes the problem on AD7414 equipped boards (Sequoia,
Canyonlands etc), that temp value printed in the bootup log was
incorrect.

Signed-off-by: Stefan Roese <sr@denx.de>
16 years agoAdd support for environment in SPI flash
Haavard Skinnemoen [Fri, 16 May 2008 09:10:35 +0000 (11:10 +0200)]
Add support for environment in SPI flash

This is pretty incomplete...it doesn't handle reading the environment
before relocation, it doesn't support redundant environment, and it
doesn't support embedded environment. But apart from that, it does
seem to work.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoSPI Flash: Add "sf" command
Haavard Skinnemoen [Fri, 16 May 2008 09:10:34 +0000 (11:10 +0200)]
SPI Flash: Add "sf" command

This adds a new command, "sf" which can be used to manipulate SPI
flash. Currently, initialization, reading, writing and erasing is
supported.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoSPI Flash subsystem
Haavard Skinnemoen [Fri, 16 May 2008 09:10:33 +0000 (11:10 +0200)]
SPI Flash subsystem

This adds a new SPI flash subsystem.

Currently, only AT45 DataFlash in non-power-of-two mode is supported,
but some preliminary support for other flash types is in place as
well.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoatmel_spi: Driver for the Atmel SPI controller
Hans-Christian Egtvedt [Fri, 16 May 2008 09:10:32 +0000 (11:10 +0200)]
atmel_spi: Driver for the Atmel SPI controller

This adds a driver for the SPI controller found on most AT91 and AVR32
chips, implementing the new SPI API.

Changed in v4:
  - Update to new API
  - Handle zero-length transfers appropriately. The user may send a
    zero-length SPI transfer with SPI_XFER_END set in order to
    deactivate the chip select after a series of transfers with chip
    select active. This is useful e.g. when polling the status
    register of DataFlash.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
16 years agoSPI API improvements
Haavard Skinnemoen [Fri, 16 May 2008 09:10:31 +0000 (11:10 +0200)]
SPI API improvements

This patch gets rid of the spi_chipsel table and adds a handful of new
functions that makes the SPI layer cleaner and more flexible.

Instead of the spi_chipsel table, each board that wants to use SPI
gets to implement three hooks:
  * spi_cs_activate(): Activates the chipselect for a given slave
  * spi_cs_deactivate(): Deactivates the chipselect for a given slave
  * spi_cs_is_valid(): Determines if the given bus/chipselect
    combination can be activated.

Not all drivers may need those extra functions however. If that's the
case, the board code may just leave them out (assuming they know what
the driver needs) or rely on the linker to strip them out (assuming
--gc-sections is being used.)

To set up communication parameters for a given slave, the driver needs
to call spi_setup_slave(). This returns a pointer to an opaque
spi_slave struct which must be passed as a parameter to subsequent SPI
calls. This struct can be freed by calling spi_free_slave(), but most
driver probably don't want to do this.

Before starting one or more SPI transfers, the driver must call
spi_claim_bus() to gain exclusive access to the SPI bus and initialize
the hardware. When all transfers are done, the driver must call
spi_release_bus() to make the bus available to others, and possibly
shut down the SPI controller hardware.

spi_xfer() behaves mostly the same as before, but it now takes a
spi_slave parameter instead of a spi_chipsel function pointer. It also
got a new parameter, flags, which is used to specify chip select
behaviour. This may be extended with other flags in the future.

This patch has been build-tested on all powerpc and arm boards
involved. I have not tested NIOS since I don't have a toolchain for it
installed, so I expect some breakage there even though I've tried
fixing up everything I could find by visual inspection.

I have run-time tested this on AVR32 ATNGW100 using the atmel_spi and
DataFlash drivers posted as a follow-up. I'd like some help testing
other boards that use the existing SPI API.

But most of all, I'd like some comments on the new API. Is this stuff
usable for everyone? If not, why?

Changed in v4:
  - Build fixes for various boards, drivers and commands
  - Provide common struct spi_slave definition that can be extended by
    drivers
  - Pass a struct spi_slave * to spi_cs_activate and spi_cs_deactivate
  - Make default bus and mode build-time configurable
  - Override default SPI bus ID and mode on mx32ads and imx31_litekit.

Changed in v3:
  - Add opaque struct spi_slave for controller-specific data associated
    with a slave.
  - Add spi_claim_bus() and spi_release_bus()
  - Add spi_free_slave()
  - spi_setup() is now called spi_setup_slave() and returns a
    struct spi_slave
  - soft_spi now supports four SPI modes (CPOL|CPHA)
  - Add bus parameter to spi_setup_slave()
  - Convert the new i.MX32 SPI driver
  - Convert the new MC13783 RTC driver

Changed in v2:
  - Convert the mpc8xxx_spi driver and the mpc8349emds board to the
    new API.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Tested-by: Guennadi Liakhovetski <lg@denx.de>
16 years agoMove definition of container_of() to common.h
Haavard Skinnemoen [Fri, 16 May 2008 09:10:30 +0000 (11:10 +0200)]
Move definition of container_of() to common.h

AVR32 and AT91SAM9 both have their own identical definitions of
container_of() taken from the Linux kernel. Move it to common.h so
that all architectures can use it.

container_of() is already used by some drivers, and will be used
extensively by the new and improved SPI API.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agosoft_i2c: Pull SDA high before reading
Haavard Skinnemoen [Fri, 16 May 2008 09:08:11 +0000 (11:08 +0200)]
soft_i2c: Pull SDA high before reading

Spotted by Dean Capindale.

Systems that support open-drain GPIO properly are allowed provide an
empty I2C_TRISTATE define. However, this means that we need to be
careful not to drive SDA low when the slave is expected to respond.

This patch adds a missing I2C_SDA(1) to read_byte() required to
tristate the SDA line on systems that support open-drain GPIO.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoFix warnings from gcc-4.3.0 build on a ppc host
Kumar Gala [Thu, 15 May 2008 20:13:08 +0000 (15:13 -0500)]
Fix warnings from gcc-4.3.0 build on a ppc host

* The cfi_flash.c memset fix actual allows the board to boot so there is
  a bit more going on here than just resolving warnings associated with
  uninitialized variables.

* include/asm/bitops.h:302: warning: '__swab32p' is static but used in
  inline function 'ext2_find_next_zero_bit' which is not static

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoMPC512x: Change traps.c to not reference non-addressable memory
Becky Bruce [Wed, 14 May 2008 18:09:51 +0000 (13:09 -0500)]
MPC512x: Change traps.c to not reference non-addressable memory

Currently, END_OF_RAM is used by the trap code to determine if
we should attempt to access the stack pointer or not. However,
on systems with a lot of RAM, only a subset of the RAM is
guaranteed to be mapped in and accessible.  Change END_OF_RAM
to use get_effective_memsize() instead of using the raw ram
size out of the bd.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
16 years agoMake sure common.h is the first include.
Kumar Gala [Wed, 14 May 2008 00:01:54 +0000 (19:01 -0500)]
Make sure common.h is the first include.

If common.h isn't first we can get CONFIG_ options defined in the
board config file ignored.  This can cause an issue if any of those
config options impact the size of types of data structures
(eg CONFIG_PHYS_64BIT).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoAvoid initrd and logbuffer area overlaps
Marian Balakowicz [Tue, 13 May 2008 13:53:29 +0000 (15:53 +0200)]
Avoid initrd and logbuffer area overlaps

Add logbuffer to reserved LMB areas to prevent initrd allocation
from overlaping with it.

Make sure to use correct logbuffer base address.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
16 years agolwmon5: add memory-pattern-test to FPGA POST.
Sascha Laue [Tue, 13 May 2008 11:29:54 +0000 (13:29 +0200)]
lwmon5: add memory-pattern-test to FPGA POST.

16 years agoPPC: 86xx Add bat registers to reginfo command
Becky Bruce [Fri, 9 May 2008 00:02:51 +0000 (19:02 -0500)]
PPC: 86xx Add bat registers to reginfo command

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
16 years agoPPC: Add print_bats() to lib_ppc/bat_rw.c
Becky Bruce [Fri, 9 May 2008 20:41:35 +0000 (15:41 -0500)]
PPC: Add print_bats() to lib_ppc/bat_rw.c

This function prints the values of all the BAT register
pairs - I needed this for debug earlier this week; adding it to
lib_ppc so others can use it (and add it to reginfo commands
if so desired).

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
16 years agoPPC: Change lib_ppc/bat_rw.c to use high bats
Becky Bruce [Fri, 16 May 2008 02:29:04 +0000 (21:29 -0500)]
PPC: Change lib_ppc/bat_rw.c to use high bats

Currently, this code only deals with BATs 0-3, which makes
it useless on systems that support BATs 4-7.  Add the
support for these registers.

Signed-off-by: Becky Bruce <Becky.bruce@freescale.com>
16 years agoPPC: Create and use CONFIG_HIGH_BATS
Becky Bruce [Fri, 9 May 2008 00:02:12 +0000 (19:02 -0500)]
PPC: Create and use CONFIG_HIGH_BATS

Change all code that conditionally operates on high bat
registers (that is, BATs 4-7) to look at CONFIG_HIGH_BATS
instead of the myriad ways this is done now.  Define the option
for every config for which high bats are supported (and
enabled by early boot, on parts where they're not always
enabled)

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
16 years agoMerge remote branch 'u-boot-at91/for-1.3.4'
Wolfgang Denk [Mon, 2 Jun 2008 22:24:36 +0000 (00:24 +0200)]
Merge remote branch 'u-boot-at91/for-1.3.4'

16 years agoMerge remote branch 'u-boot-avr32/master'
Wolfgang Denk [Mon, 2 Jun 2008 22:19:57 +0000 (00:19 +0200)]
Merge remote branch 'u-boot-avr32/master'

16 years agoMerge remote branch 'u-boot-nand-flash/master'
Wolfgang Denk [Mon, 2 Jun 2008 22:16:48 +0000 (00:16 +0200)]
Merge remote branch 'u-boot-nand-flash/master'

16 years agoMerge remote branch 'u-boot-mips/master'
Wolfgang Denk [Mon, 2 Jun 2008 22:11:40 +0000 (00:11 +0200)]
Merge remote branch 'u-boot-mips/master'

16 years agoMerge remote branch 'u-boot-ppc4xx/master'
Wolfgang Denk [Mon, 2 Jun 2008 21:28:39 +0000 (23:28 +0200)]
Merge remote branch 'u-boot-ppc4xx/master'

16 years agomips: Add an 'include/asm/errno.h', like all other architectures
Jason McMullan [Thu, 29 May 2008 15:53:38 +0000 (00:53 +0900)]
mips: Add an 'include/asm/errno.h', like all other architectures

All other u-boot architectures have an include/asm/errno.h, so
this change adds it to the mips include/asm-mips headers also.

Stolen from Linux 2.6.25.

Signed-off-by: Jason McMullan <mcmullan@netapp.com>
16 years ago[MIPS] <asm/mipsregs.h>: Update coprocessor register access macros
Shinya Kuribayashi [Thu, 29 May 2008 15:53:38 +0000 (00:53 +0900)]
[MIPS] <asm/mipsregs.h>: Update coprocessor register access macros

Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
16 years ago[MIPS] <asm/mipsregs.h>: Update register / bit field definitions
Shinya Kuribayashi [Thu, 29 May 2008 15:53:38 +0000 (00:53 +0900)]
[MIPS] <asm/mipsregs.h>: Update register / bit field definitions

Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
16 years ago[MIPS] <asm/mipsregs.h>: CodinygStyle cleanups
Shinya Kuribayashi [Thu, 29 May 2008 15:53:37 +0000 (00:53 +0900)]
[MIPS] <asm/mipsregs.h>: CodinygStyle cleanups

No functional changes.

Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
16 years agomips: If CONFIG_CMD_SPI is defined, call spi_init()
Jason McMullan [Thu, 29 May 2008 15:53:37 +0000 (00:53 +0900)]
mips: If CONFIG_CMD_SPI is defined, call spi_init()

The mips architecture currently does not call 'spi_init()' in the generic
board initialization routine is CONFIG_CMD_SPI is defined.

This patch rectifies that problem.

Signed-off-by: Jason McMullan <mcmullan@netapp.com>
Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
16 years ago[MIPS] lib_mips/board.c: Add nand_init
Jason McMullan [Thu, 29 May 2008 15:53:37 +0000 (00:53 +0900)]
[MIPS] lib_mips/board.c: Add nand_init

This patch adds the standard 'nand_init()' call to the mips generic
'board_init_r()' call, bringing MIPS in line with the other architectures.

Signed-off-by: Jason McMullan <mcmullan@netapp.com>
Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
16 years agoRemove prototypes of nand_init() in favor of including nand.h.
Scott Wood [Thu, 22 May 2008 15:49:46 +0000 (10:49 -0500)]
Remove prototypes of nand_init() in favor of including nand.h.

Likewise with onenand_init().

Signed-off-by: Scott Wood <scottwood@freescale.com>
16 years agoMake onenand_uboot.h self-sufficient.
Scott Wood [Thu, 22 May 2008 15:49:00 +0000 (10:49 -0500)]
Make onenand_uboot.h self-sufficient.

Don't assume types are provided by previously included headers.

Signed-off-by: Scott Wood <scottwood@freescale.com>
16 years agonand: Correct NAND erase percentage output
Dirk Behme [Wed, 16 Jan 2008 13:26:59 +0000 (14:26 +0100)]
nand: Correct NAND erase percentage output

For NAND erase sizes smaller than one NAND erase block, erase
percentage output becomes grater than 100% e.g.

-- cut --
  > nand info
Device 0: NAND 64MiB 1,8V 8-bit, sector size 16 KiB
  > nand erase 0x100000 0x2000
NAND erase: device 0 offset 0x100000, size 0x2000
Erasing at 0x100000 -- 200% complete.
OK
  >
-- cut --

Correct this and give user a warning that more is erased than specified:

-- cut --
  > nand erase 0x100000 0x2000
NAND erase: device 0 offset 0x100000, size 0x2000
Warning: Erase size 0x00002000 smaller than one erase block 0x00004000
           Erasing 0x00004000 instead
Erasing at 0x100000 -- 100% complete.
OK
  >
-- cut --

Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
16 years agoCleanup nand_info[] declaration.
Stelian Pop [Tue, 13 May 2008 15:31:24 +0000 (17:31 +0200)]
Cleanup nand_info[] declaration.

The nand_info array is declared as extern in several .c files.
Those days, nand.h contains a reference to the array, so there is
no need to declare it elsewhere.

Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Scott Wood <scottwood@freescale.com>
16 years agoNAND: Provide a sane default for NAND_MAX_CHIPS.
Scott Wood [Mon, 19 May 2008 14:30:43 +0000 (09:30 -0500)]
NAND: Provide a sane default for NAND_MAX_CHIPS.

This allows the header to be included regardless of whether a board's
config file provides NAND-related defininitions.

Signed-off-by: Scott Wood <scottwood@freescale.com>
16 years agoavr32: Fix theoretical race in udelay()
Haavard Skinnemoen [Mon, 26 May 2008 10:19:10 +0000 (12:19 +0200)]
avr32: Fix theoretical race in udelay()

If the specified delay is very short, the cycle counter may go past the
"end" time we are waiting for before we get around to reading it.

Fix it by checking the different between the cycle count "now" and the
cycle count at the beginning. This will work as long as the delay
measured in number of cycles is below 2^31.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Compile atmel_mci.o conditionally
Haavard Skinnemoen [Wed, 21 May 2008 11:01:09 +0000 (13:01 +0200)]
avr32: Compile atmel_mci.o conditionally

Remove #ifdef CONFIG_MMC from the source file and use conditional
compilation in the Makefile instead.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Fix wrong error flags in atmel_mci driver
Haavard Skinnemoen [Thu, 22 May 2008 10:28:25 +0000 (12:28 +0200)]
avr32: Fix wrong error flags in atmel_mci driver

Make sure we check for CRC errors when sending commands that use CRC
checking.

Reported-by: Gururaja Hebbar K R <gururajakr@sanyo.co.in>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Fix two warnings in atmel_mci.c
Haavard Skinnemoen [Wed, 21 May 2008 09:10:59 +0000 (11:10 +0200)]
avr32: Fix two warnings in atmel_mci.c

The warnings are harmless but annoying. Let's fix them.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Rework SDRAM initialization code
Haavard Skinnemoen [Mon, 19 May 2008 09:36:28 +0000 (11:36 +0200)]
avr32: Rework SDRAM initialization code

This cleans up the SDRAM initialization and related code a bit, and
allows faster booting.

  * Add definitions for EBI and internal SRAM to asm/arch/memory-map.h
  * Remove memory test from sdram_init() and make caller responsible
    for verifying the SDRAM and determining its size.
  * Remove base_address member from struct sdram_config (was sdram_info)
  * Add data_bits member to struct sdram_config and kill CFG_SDRAM_16BIT
  * Add support for a common STK1000 hack: 16MB SDRAM instead of 8.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Do stricter stack checking in the exception handler
Haavard Skinnemoen [Mon, 19 May 2008 09:27:37 +0000 (11:27 +0200)]
avr32: Do stricter stack checking in the exception handler

Don't do a stack dump if the stack pointer is outside the memory area
reserved for stack.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Use the same entry point for reset and exception handling
Haavard Skinnemoen [Fri, 2 May 2008 13:32:57 +0000 (15:32 +0200)]
avr32: Use the same entry point for reset and exception handling

Since the reset vector is always aligned to a very large boundary, we
can save a couple of KB worth of alignment padding by placing the
exception vectors at the same address.

Deciding which one it is is easy: If we're handling an exception, the
CPU is in Exception mode. If we're starting up after reset, the CPU is
in Supervisor mode. So this adds a very minimal overhead to the reset
path (only executed once) and the exception handling path (normally
never executed at all.)

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Put memset in its own section
Haavard Skinnemoen [Fri, 2 May 2008 13:24:22 +0000 (15:24 +0200)]
avr32: Put memset in its own section

All C code is compiled with -ffunction-sections -fdata-sections.
Assembly functions should get their own sections as well so that
everything looks consistent.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Rename pm_init() as clk_init() and make SoC-specific
Haavard Skinnemoen [Fri, 2 May 2008 13:21:40 +0000 (15:21 +0200)]
avr32: Rename pm_init() as clk_init() and make SoC-specific

pm_init() was always more about clock initialization than anything
else. Dealing with PLLs, clock gating and such is also inherently
SoC-specific, so move it into a SoC-specific directory.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Use new-style Makefile for the at32ap platform
Haavard Skinnemoen [Wed, 30 Apr 2008 14:15:57 +0000 (16:15 +0200)]
avr32: Use new-style Makefile for the at32ap platform

This makes it easier to avoid compiling certain files later.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Remove unused file cpu/at32ap/pm.c
Haavard Skinnemoen [Wed, 30 Apr 2008 12:36:47 +0000 (14:36 +0200)]
avr32: Remove unused file cpu/at32ap/pm.c

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Clean up the HMATRIX code
Haavard Skinnemoen [Wed, 30 Apr 2008 12:19:28 +0000 (14:19 +0200)]
avr32: Clean up the HMATRIX code

Rework the HMATRIX configuration interface so that it becomes easier
to configure the HMATRIX for boards with special needs, and add new
parts.

The HMATRIX header file has been split into a general,
chip-independent part with register definitions, etc. and a
chip-specific part with SFR bitfield definitions and master/slave
identifiers.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Add support for the ATSTK1006 board
Haavard Skinnemoen [Thu, 22 Nov 2007 11:14:11 +0000 (12:14 +0100)]
avr32: Add support for the ATSTK1006 board

This is a replacement for ATSTK1002 with 64MB SDRAM and NAND flash on
board. It's currently in production and will be available soon.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Get rid of the .flashprog section
Haavard Skinnemoen [Tue, 29 Apr 2008 10:53:05 +0000 (12:53 +0200)]
avr32: Get rid of the .flashprog section

The .flashprog section was only needed back when we were running
directly from flash, and it's even more useless on NGW100 since it
uses the CFI flash driver which never used this workaround in the
first place.

Remove it on STK1000 as well, and get rid of all the associated code and
annotations.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Use correct condition around macb clock accessors
Haavard Skinnemoen [Wed, 30 Apr 2008 11:09:56 +0000 (13:09 +0200)]
avr32: Use correct condition around macb clock accessors

get_macb_pclk_rate() and get_macb_hclk_rate() should be available when
the chip has a MACB controller, not when it has a USART.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: Disable the AP7000 internal watchdog on startup
David Brownell [Thu, 17 Apr 2008 05:57:58 +0000 (22:57 -0700)]
avr32: Disable the AP7000 internal watchdog on startup

This patch forces the watchdog off in all cases.  That will at least
get rid of the constant reboot cycle, though it won't let the watchdog
actually run in the new kernels:  its probe() comes up with a polite
warning.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoavr32: stk1002 and ngw100 convergence
David Brownell [Fri, 22 Feb 2008 20:54:39 +0000 (12:54 -0800)]
avr32: stk1002 and ngw100 convergence

Make STK1002 and NGW100 boards act more alike:
  - STK boards can use as many arguments as NGW
  - STK boards don't need to manage FPGAs either
  - NGW commands should match STK ones

Also spell U-Boot right in prompts for STK1002 and NGW100.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
[haavard.skinnemoen@atmel.com: update STK100[34] as well]
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
16 years agoSocrates: Fix PCI bus frequency report
Sergei Poselenov [Tue, 27 May 2008 11:47:00 +0000 (13:47 +0200)]
Socrates: Fix PCI bus frequency report

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
16 years agoMerge branch 'master' of /home/wd/git/u-boot/custodians
Wolfgang Denk [Tue, 27 May 2008 10:56:01 +0000 (12:56 +0200)]
Merge branch 'master' of /home/wd/git/u-boot/custodians

Conflicts:

include/configs/socrates.h

Signed-off-by: Wolfgang Denk <wd@denx.de>
16 years agoSocrates: Added USB support.
Sergei Poselenov [Tue, 27 May 2008 09:49:13 +0000 (11:49 +0200)]
Socrates: Added USB support.

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
16 years agoUSB: add new configuration variable CONFIG_PCI_OHCI_DEVNO
Sergei Poselenov [Tue, 27 May 2008 09:35:02 +0000 (11:35 +0200)]
USB: add new configuration variable CONFIG_PCI_OHCI_DEVNO

In case of several PCI USB controllers on a board this variable
specifys which controller to use.
See doc/README.generic_usb_ohci for details.

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
16 years agoSocrates: add support for DS75 Digital Thermo Sensor on I2C bus.
Sergei Poselenov [Tue, 27 May 2008 08:36:07 +0000 (10:36 +0200)]
Socrates: add support for DS75 Digital Thermo Sensor on I2C bus.

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
16 years agoSocrates: Config file cleanup.
Sergei Poselenov [Mon, 26 May 2008 16:16:04 +0000 (18:16 +0200)]
Socrates: Config file cleanup.

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
16 years agoMAKEALL: add at91 list
Jean-Christophe PLAGNIOL-VILLARD [Sat, 24 May 2008 10:47:46 +0000 (12:47 +0200)]
MAKEALL: add at91 list

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
16 years agoMerging Stelian Pop AT91 patches
Jean-Christophe PLAGNIOL-VILLARD [Sat, 24 May 2008 10:56:53 +0000 (12:56 +0200)]
Merging Stelian Pop AT91 patches

Merge branch 'testing-V2'

Conflicts:

board/atmel/at91cap9adk/Makefile
                Fixing copyright
board/atmel/at91sam9260ek/Makefile
                Fixing copyright
board/atmel/at91sam9260ek/u-boot.lds
                Delete no more needed ld script

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
16 years agoUSB: replace old swap_ with proper endianess conversion macros
Christian Eggers [Wed, 21 May 2008 20:12:00 +0000 (22:12 +0200)]
USB: replace old swap_ with proper endianess conversion macros

Signed-off-by: Christian Eggers <ceggers@gmx.de>
Signed-off-by: Markus Klotzbuecher <mk@denx.de>
16 years agoFix endianess conversion in usb_ohci.c
Christian Eggers [Wed, 21 May 2008 19:29:10 +0000 (21:29 +0200)]
Fix endianess conversion in usb_ohci.c

Signed-off-by: Christian Eggers <ceggers@gmx.de>
Signed-off-by: Markus Klotzbuecher <mk@denx.de>
16 years agoUSB: add support for multiple PCI OHCI controllers
Sergei Poselenov [Wed, 21 May 2008 23:15:53 +0000 (01:15 +0200)]
USB: add support for multiple PCI OHCI controllers

Add new configuration variable CONFIG_PCI_OHCI_DEVNO.
In case of several PCI USB controllers on a board this variable
specifys which controller to use.

Also add USB support for sokrates board.

See doc/README.generic_usb_ohci for details.

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
Signed-off-by: Markus Klotzbuecher <mk@denx.de>
16 years agoMerge branch 'quad100hd'
Stefan Roese [Wed, 21 May 2008 15:39:24 +0000 (17:39 +0200)]
Merge branch 'quad100hd'

16 years agoMerge branch 'master' of git://git.denx.de/u-boot-testing
Wolfgang Denk [Wed, 21 May 2008 15:06:45 +0000 (17:06 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-testing

16 years agoFix some whitespace issues
Wolfgang Denk [Wed, 21 May 2008 14:56:08 +0000 (16:56 +0200)]
Fix some whitespace issues

introduced by 53677ef18 "Big white-space cleanup."

Signed-off-by: Wolfgang Denk <wd@denx.de>
16 years agoMerge branch 'socrates' of /home/wd/git/u-boot/projects
Wolfgang Denk [Tue, 20 May 2008 23:13:52 +0000 (01:13 +0200)]
Merge branch 'socrates' of /home/wd/git/u-boot/projects

16 years agoMerge branch 'lwmon5' of /home/wd/git/u-boot/projects
Wolfgang Denk [Tue, 20 May 2008 23:13:39 +0000 (01:13 +0200)]
Merge branch 'lwmon5' of /home/wd/git/u-boot/projects

16 years agoMake ads5121 out-of-tree compiling safe
York Sun [Mon, 12 May 2008 19:36:39 +0000 (14:36 -0500)]
Make ads5121 out-of-tree compiling safe

Reuse the existing DIU driver in board/freescale/common.

Signed-off-by: York Sun <yorksun@freescale.com>
16 years agoAdding DIU support for Freescale 5121ADS
York Sun [Mon, 5 May 2008 15:20:01 +0000 (10:20 -0500)]
Adding DIU support for Freescale 5121ADS

Add DIU and cfb console support to FSL 5121ADS board.

Use #define CONFIG_VIDEO in config file to enable fb console.

Signed-off-by: York Sun <yorksun@freescale.com>
16 years agoReplace DPRINTF with debug
York Sun [Mon, 5 May 2008 15:20:00 +0000 (10:20 -0500)]
Replace DPRINTF with debug

Remove DPRINTF macro and replace it with generic debug macro.

Signed-off-by: York Sun <yorksun@freescale.com>
16 years agoMove pixel clock setting to board file
York Sun [Mon, 5 May 2008 15:19:59 +0000 (10:19 -0500)]
Move pixel clock setting to board file

The clock divider has different format in 5121 and 8610. This patch moves it to
board specific code.

Signed-off-by: York Sun <yorksun@freescale.com>
16 years agoBig white-space cleanup.
Wolfgang Denk [Tue, 20 May 2008 14:00:29 +0000 (16:00 +0200)]
Big white-space cleanup.

This commit gets rid of a huge amount of silly white-space issues.
Especially, all sequences of SPACEs followed by TAB characters get
removed (unless they appear in print statements).

Also remove all embedded "vim:" and "vi:" statements which hide
indentation problems.

Signed-off-by: Wolfgang Denk <wd@denx.de>
16 years agosocrates: fix second TSEC configuration (it is actually TSEC3)
Sergei Poselenov [Thu, 8 May 2008 15:46:23 +0000 (17:46 +0200)]
socrates: fix second TSEC configuration (it is actually TSEC3)

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
16 years agoFixed reset for socrates
Sergei Poselenov [Thu, 8 May 2008 12:17:08 +0000 (14:17 +0200)]
Fixed reset for socrates

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
16 years agosocrates: changes to support FDT
Sergei Poselenov [Wed, 7 May 2008 13:10:49 +0000 (15:10 +0200)]
socrates: changes to support FDT

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>
16 years agoInitial support for "Socrates" board
Sergei Poselenov [Wed, 30 Apr 2008 09:42:50 +0000 (11:42 +0200)]
Initial support for "Socrates" board

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
16 years agoPOST: replace the LOGBUFF_INITIALIZED flag in gd->post_log_word (1 << 31) with the...
Yuri Tikhonov [Thu, 8 May 2008 13:46:42 +0000 (15:46 +0200)]
POST: replace the LOGBUFF_INITIALIZED flag in gd->post_log_word (1 << 31) with the GD_FLG_LOGINIT flag in gd->flags.

This way we become able to utilize the full post_log_word for POST
activities (overwise, POST ECC, which has 0x8000 ID, could be
erroneously treated as started in post_output_backlog() even if there
was actually no POST ECC run (because of OCM POST failure, for
example).

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
16 years agoPOST: mark OCM test as POST_STOP
Yuri Tikhonov [Thu, 8 May 2008 13:46:02 +0000 (15:46 +0200)]
POST: mark OCM test as POST_STOP

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
16 years agoPOST: add POST_STOP flag
Yuri Tikhonov [Thu, 8 May 2008 13:45:26 +0000 (15:45 +0200)]
POST: add POST_STOP flag

Don't run futher tests in case of a test fails that is marked as
POST_STOP.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
16 years agoPOST: switch CFG_POST_OCM with CFG_POST_CODEC (workaround)
Yuri Tikhonov [Thu, 8 May 2008 13:44:16 +0000 (15:44 +0200)]
POST: switch CFG_POST_OCM with CFG_POST_CODEC (workaround)

Switch the OCM testid with the codec one. The reason is that current
implementation requires the POST_ROM testid to fit into lower 16
bits, and the codec test will never run with POST_ROM hopefully.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
16 years agolwmon5: enable OCM post test on lwmon5 board
Yuri Tikhonov [Thu, 8 May 2008 13:43:28 +0000 (15:43 +0200)]
lwmon5: enable OCM post test on lwmon5 board

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
16 years agoPOST: OCM test added.
Yuri Tikhonov [Thu, 8 May 2008 13:42:47 +0000 (15:42 +0200)]
POST: OCM test added.

Added OCM test to POST layer. This version runs before all other tests
but doesn't yet interrupt post sequence on failure.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
16 years agoPOST: typo fix
Yuri Tikhonov [Thu, 8 May 2008 13:40:39 +0000 (15:40 +0200)]
POST: typo fix

Signed-off-by: Ilya Yanok <yanok@emcraft.com>