Commit Graph

63 Commits

Author SHA1 Message Date
Mark Jackson 716ece1de9 Add AVR32 LCD support
This patch adds support for the AVR32 LCD controller.  This patch is
based off the latest u-boot-video.

A quick summary of what's going on:-

Enable LCDC pixel clock
Enable LCDC port pins
Add framebuffer pointer to global_data struct
Allocate framebuffer

To use the new code, update your board config to include something like
this:-

#define CONFIG_LCD			1

#if defined(CONFIG_LCD)
#define CONFIG_CMD_BMP
#define CONFIG_ATMEL_LCD		1
#define LCD_BPP				LCD_COLOR16
#define CONFIG_BMP_16BPP		1
#define CONFIG_FB_ADDR			0x10600000
#define CONFIG_WHITE_ON_BLACK		1
#define CONFIG_VIDEO_BMP_GZIP 		1
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE		262144
#define CONFIG_ATMEL_LCD_BGR555		1
#define CONFIG_SYS_CONSOLE_IS_IN_ENV	1
#define CONFIG_SPLASH_SCREEN		1
#endif

The standard U-Boot BMP and Splash-screen features should just work.

Signed-off-by: Mark Jackson <mpfj@mimc.co.uk>
[agust@denx.de: fixed some style issues]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2009-07-26 13:12:02 +02:00
Michal Simek bc0d3296f1 asm-generic: Consolidate errno.h to asm-generic/errno.h
This patch use blackfin errno.h implementation which
correspond Linux kernel one.

MIPS implemetation is different that's why I keep it.

I removed ppc_error_no.h from Marvell boards which
was the same too.

I have got ack from ppc40x, blackfin, arm, coldfire and avr custodians.

Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2009-07-09 14:07:11 +02:00
Haavard Skinnemoen 1129b14e54 Merge branch 'evk1100-prep' 2009-03-23 10:22:47 +01:00
Haavard Skinnemoen 8206bfae3a Merge branch 'mimc200' 2009-03-23 10:22:41 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4d7c32dad2 avr32: fix cacheflush.h location introducted by d8f2aa3298
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2009-03-23 10:15:39 +01:00
Mike Frysinger 566b652c7c remove bi_enet*addr from global data for all arches
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Ben Warren <biggerbadderben@gmail.com>
CC: Daniel Hellstrom <daniel@gaisler.com>
CC: Michal Simek <monstr@seznam.cz>
CC: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
CC: Scott McNutt <smcnutt@psyent.com>
CC: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2009-03-20 22:39:12 +01:00
Gunnar Rangoy f5f652fa91 AVR32: Make GPIO implmentation cpu dependent
There are some differences in the implementation of GPIO in the
at32uc chip compared to the ap700x series.

Signed-off-by: Gunnar Rangoy <gunnar@rangoy.com>
Signed-off-by: Paul Driveklepp <pauldriveklepp@gmail.com>
Signed-off-by: Olav Morken <olavmrk@gmail.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2009-02-23 10:34:24 +01:00
Olav Morken a38de083d2 AVR32: Move addrspace.h to arch-directory, and move some functions from io.h to addrspace.h
The AVR32A architecture (which AT32UC3A-series is based on) has a
different memory layout than the AVR32B-architecture. This patch moves
addrspace.h to an arch-dependent directory in preparation for
AT32UC3A-support. It also moves some address-space manipulation
functions from io.h to addrspace.h.

Signed-off-by: Gunnar Rangoy <gunnar@rangoy.com>
Signed-off-by: Paul Driveklepp <pauldriveklepp@gmail.com>
Signed-off-by: Olav Morken <olavmrk@gmail.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2009-02-23 10:34:24 +01:00
Olav Morken d8f2aa3298 AVR32: Make cacheflush cpu-dependent
The AT32UC3A series of processors doesn't contain any cache, and issuing
cache control instructions on those will cause an exception. This commit
makes cacheflush.h arch-dependent in preparation for the AT32UC3A-support.

Signed-off-by: Gunnar Rangoy <gunnar@rangoy.com>
Signed-off-by: Paul Driveklepp <pauldriveklepp@gmail.com>
Signed-off-by: Olav Morken <olavmrk@gmail.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2009-02-23 10:34:23 +01:00
Haavard Skinnemoen ea393eb1d6 Merge branch 'cleanups' into next 2009-02-23 10:27:15 +01:00
Andy Fleming 1de97f9856 Eliminated arch-specific mmc header requirement
The current MMC infrastructure relies on the existence of an
arch-specific header file.  This isn't necessary, and a couple
drivers were forced to implement dummy files to meet this requirement.
Instead, we move the stuff in those header files into a more appropriate
place, and eliminate the stubs and the #include of asm/arch/mmc.h

Signed-off-by: Andy Fleming <afleming@freescale.com>
2009-02-16 18:07:41 -06:00
Kumar Gala 47d41cc3a1 Add an architecture specific config.h for common defines
We have common defines that we duplicate in various ways.  Having an
arch specific config.h gives us a common location for those defines.

Eventually we should be able to replace this when we have proper
Kconfig support.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-02-10 00:43:54 +01:00
Haavard Skinnemoen cb54732052 Merge branch 'fixes' into cleanups
Conflicts:

	board/atmel/atngw100/atngw100.c
	board/atmel/atstk1000/atstk1000.c
	cpu/at32ap/at32ap700x/gpio.c
	include/asm-avr32/arch-at32ap700x/clk.h
	include/configs/atngw100.h
	include/configs/atstk1002.h
	include/configs/atstk1003.h
	include/configs/atstk1004.h
	include/configs/atstk1006.h
	include/configs/favr-32-ezkit.h
	include/configs/hammerhead.h
	include/configs/mimc200.h
2008-12-17 16:53:07 +01:00
Haavard Skinnemoen 92c78a3bbc avr32: Remove second definition of virt_to_phys()
The second definition introduced by 65e43a1063 conflicts with the
existing one.

Also, convert the existing definition to use phys_addr_t. The volatile
qualifier is still needed due to brain damage elsewhere.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-12-17 16:43:18 +01:00
Kumar Gala 65e43a1063 Introduce virt_to_phys()
virt_to_phys() returns the physical address given a virtual. In most
cases this will be just the input value as the vast majority of
systems run in a 1:1 mode.

However in systems that are not running this way it should report the
physical address or ~0 if no mapping exists for the given virtual
address.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-12-15 22:04:29 +01:00
Jean-Christophe PLAGNIOL-VILLARD 6d0f6bcf33 rename CFG_ macros to CONFIG_SYS
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-18 21:54:03 +02:00
Mark Jackson f5c3ba7978 Allow console input to be disabled
Added new CONFIG_DISABLE_CONSOLE define and GD_FLG_DISABLE_CONSOLE.

When CONFIG_DISABLE_CONSOLE is defined, setting
GD_FLG_DISABLE_CONSOLE disables all console input and output.

Signed-off-by: Mark Jackson <mpfj@mimc.co.uk>
2008-09-06 22:36:54 +02:00
Haavard Skinnemoen baf449fc5f avr32: Add support for "GPIO" port mux
The "GPIO" port mux is used on AVR32 UC3 parts as well as AT32AP7200 and
all later AVR32 chips. This patch adds a driver for it, implementing the
same API as the existing portmux-pio driver but with more functionality.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-09-01 14:38:46 +02:00
Haavard Skinnemoen 25e6854d42 avr32: use board_early_init_r instead of board_init_info
Replace the avr32-specific board_init_info hook by the standard
board_early_init_r hook and make it optional.

board_early_init_r() runs somewhat earlier than board_init_info used to
do, but this isn't a problem for any of the in-tree boards.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-09-01 14:21:35 +02:00
Haavard Skinnemoen 36d375faf5 avr32: Use board_postclk_init instead of gclk_init
Replace the avr32-specific gclk_init() board hook with the standard
board_postclk_init() hook which is supposed to run at the same point
during initialization.

Provide a dummy weak alias for boards not implementing this hook. The
cost of this is:
  - 2 bytes for the dummy function (retal 0)
  - 2 bytes for each unnecessary function call (short rcall)

which is a pretty small price to pay for avoiding lots of #ifdef
clutter. In this particular case, all boards probably end up slightly
smaller because we avoid the conditional checking if the gclk_init
symbol is NULL.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-09-01 14:21:34 +02:00
Haavard Skinnemoen 98090cd75c avr32: Add gclk helper functions
Add two helper functions for configuring and enabling generic clocks:
  - gclk_enable_output: Enables output on a GCLKx pin
  - gclk_set_rate: Configures a gclk to run at a specific rate

This should eliminate any reason to go mucking about with PM registers
from board code.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-09-01 14:21:34 +02:00
Haavard Skinnemoen ab0df36fc7 avr32: refactor the portmux/gpio code
- Separate the portmux configuration functionality from the GPIO pin
    control API.
  - Separate the controller-specific code from the chip-specific code.
  - Allow "ganged" port configuration (multiple pins at once).
  - Add more flexibility to the "canned" peripheral select functions:
      - Allow using more than 23 address bits, more chip selects, as
	well as NAND- and CF-specific pins.
      - Make the MACB SPEED pin optional, and choose between MII/RMII
	using a parameter instead of an #ifdef.
      - Make it possible to use other MMC slots than slot 0, and support
	different MMC/SDCard data bus widths.
  - Use more reasonable pull-up defaults; floating pins may consume a
    lot of power.
  - Get rid of some custom portmux code from the mimc200 board code. The
    old gpio/portmux API couldn't really handle its requirements, but
    the new one can.
  - Add documentation.

The end result is slightly smaller code for all boards. Which isn't
really the point, but at least it isn't any larger.

This has been verified on ATSTK1002 and ATNGW100. I'd appreciate if
the board maintainers could help me test this on their boards. In
particular, the mimc200 port has lost a lot of code, so I'm hoping Mark
can help me out.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: Mark Jackson <mpfj@mimc.co.uk>
Cc: Alex Raimondi <alex.raimondi@miromico.ch>
Cc: Julien May <julien.may@miromico.ch>

Changes since v1:
  * Enable pullup on NWAIT
  * Add missing include to portmux-pio.h
  * Rename CONFIG_PIO2 -> CONFIG_PORTMUX_PIO to match docs
2008-09-01 14:20:41 +02:00
Haavard Skinnemoen 4c24e8288c avr32: data_bits should reflect the actual number of data bits
Make the data_bits enum in struct sdram_config reflect the actual number
of data bits on the bus, i.e. 16 or 32. Having 0 mean 16 bits and 1 mean
32 bits is just too confusing.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-09-01 13:41:58 +02:00
Haavard Skinnemoen b2b15ebb66 Merge branch 'hammerhead' of git://git.denx.de/u-boot-avr32 2008-07-30 10:07:08 +02:00
Julien May 5c374c9ee1 Add support for the hammerhead (AVR32) board
The Hammerhead platform is built around a AVR32 32-bit microcontroller
from Atmel.  It offers versatile peripherals, such as ethernet, usb
device, usb host etc.

The board also incooperates a power supply and is a Power over Ethernet
(PoE) Powered Device (PD).

Additonally, a Cyclone III FPGA from Altera is integrated on the board.
The FPGA is mapped into the 32-bit AVR memory bus. The FPGA offers two
DDR2 SDRAM interfaces, which will cover even the most exceptional need
of memory bandwidth. Together with the onboard video decoder the board
is ready for video processing.

For more information see: http:///www.miromico.com/hammerhead

Signed-off-by: Julien May <mailinglist@miromico.ch>
[haavard.skinnemoen@atmel.com: various small fixes and adaptions]
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-07-30 10:06:11 +02:00
Haavard Skinnemoen ba17540844 Merge branch 'format-warnings' of git://git.denx.de/u-boot-avr32 2008-07-24 12:42:31 +02:00
Haavard Skinnemoen 7f4b009f42 avr32: Fix printf() format warnings
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-07-23 16:15:01 +02:00
Haavard Skinnemoen a79c3e8d9c avr32: asm/io.h needs asm/types.h
map_physmem() takes a phys_addr_t as parameter. This type is defined in
asm/types.h, so we need to include that file.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-07-23 10:52:19 +02:00
Wolfgang Denk b223017f08 Merge branch 'master' of git://www.denx.de/git/u-boot-avr32 2008-07-07 00:39:43 +02:00
Haavard Skinnemoen 341188b9cc MMC: Consolidate MMC/SD command definitions
This moves the MMC and SD Card command definitions from
include/asm/arch/mmc.h into include/mmc.h. These definitions are
given by the MMC and SD Card standards, not by any particular
architecture.

There's a lot more room for consolidation in the MMC drivers which
I'm hoping to get done eventually, but this patch is a start.

Compile-tested for all avr32 boards as well as lpc2292sodimm and
lubbock. This should cover all three mmc drivers in the tree.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-28 22:40:15 +02:00
Peter Ma 4688f9e34a avr32: Add GPIO manipulation functions
Adds GPIO manipulation functions for AVR32 AP7 platform.

Signed-off-by: Peter Ma <pma@mediamatech.com>
[haavard.skinnemoen@atmel.com: coding style fixup, slight simplification]
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-20 10:40:42 +02:00
Hans-Christian Egtvedt 60445cb5c3 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>
2008-06-03 20:30:05 +02:00
Haavard Skinnemoen 289011207d 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>
2008-06-03 20:27:23 +02:00
Haavard Skinnemoen a23e277c4a 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>
2008-05-27 15:27:31 +02:00
Haavard Skinnemoen 3ace2527ba 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>
2008-05-27 15:27:30 +02:00
Haavard Skinnemoen 44453b25b0 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>
2008-05-27 15:27:29 +02:00
Haavard Skinnemoen 781eb9a1e4 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>
2008-05-27 15:27:29 +02:00
Haavard Skinnemoen cdd42c0c7a 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>
2008-05-27 15:27:29 +02:00
Wolfgang Denk eddc7c46c6 Merge branch 'lwmon5' of /home/wd/git/u-boot/projects 2008-05-21 01:13:39 +02:00
Wolfgang Denk 53677ef18e 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>
2008-05-21 00:14:08 +02:00
Yuri Tikhonov 0e15ddd11f 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>
2008-05-20 23:24:38 +02:00
Yuri Tikhonov 28a3850658 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>
2008-05-20 23:24:37 +02:00
Kumar Gala e99ccb4881 Introduce phys_size_t and move phys_addr_t into asm/types.h
Also add CONFIG_PHYS_64BIT on powerpc to deal with 32-bit ppc's
that have larger physical addresses like 44x, 85xx, and 86xx.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-04-13 17:13:46 -07:00
Yuri Tikhonov b428f6a8c6 The patch introduces the CRITICAL feature of POST tests. If the test marked as POST_CRITICAL fails then the alternative, post_critical, boot-command is used. If this command is not defined then U-Boot enters into interactive mode.
Signed-off-by: Dmitry Rakhchev <rda@emcraft.com>
Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
2008-03-18 22:24:48 +01:00
Shinya Kuribayashi b075d74efb Remove the __STRICT_ANSI__ check from the __u64/__s64 declaration on 32bit targets.
----------------------------------------------------------------
Olaf Hering [Wed, 17 Oct 2007 06:27:13 +0000 (23:27 -0700)]

Remove the __STRICT_ANSI__ check from the __u64/__s64 declaration on
32bit targets.

GCC can be made to warn about usage of long long types with ISO C90
(-ansi), but only with -pedantic.  You can write this in a way that even
then it doesn't cause warnings, namely by:

#ifdef __GNUC__
__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
#endif

The __extension__ keyword in front of this switches off any pedantic
warnings for this expression.

Signed-off-by: Olaf Hering <olh@suse.de>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
----------------------------------------------------------------

Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
2008-02-23 09:49:48 +01:00
Haavard Skinnemoen d38da53794 AVR32: Make SDRAM refresh rate configurable
The existing code assumes the SDRAM row refresh period should always
be 15.6 us. This is not always true, and indeed on the ATNGW100, the
refresh rate should really be 7.81 us.

Add a refresh_period member to struct sdram_info and initialize it
properly for both ATSTK1000 and ATNGW100. Out-of-tree boards will
panic() until the refresh_period member is updated properly.

Big thanks to Gerhard Berghofer for pointing out this issue.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-02-05 12:14:27 +01:00
Wolfgang Denk f77ac3d657 Merge branch 'master' of git://www.denx.de/git/u-boot-avr32 2007-12-27 00:46:08 +01:00
Haavard Skinnemoen 5fee84a794 AVR32: Make some AT32AP700x peripherals optional
Add a chip-features file providing definitions of the form

AT32AP700x_CHIP_HAS_<peripheral>

to indicate the availability of the given peripheral on the currently
selected chip.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-12-17 10:34:12 +01:00
Haavard Skinnemoen 36f28f8a96 AVR32: Rename at32ap7000 -> at32ap700x
The SoC-specific code for all the AT32AP700x CPUs is practically
identical; the only difference is that some chips have less features
than others. By doing this rename, we can add support for the AP7000
derivatives simply by making some features conditional.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-12-17 10:34:12 +01:00
Haavard Skinnemoen 4d7d6936eb Introduce map_physmem() and unmap_physmem()
map_physmem() returns a virtual address which can be used to access a
given physical address without involving the cache. unmap_physmem()
should be called when the virtual address returned by map_physmem() is
no longer needed.

This patch adds a stub implementation which simply returns the
physical address cast to a uchar * for all architectures except AVR32,
which converts the physical address to an uncached virtual mapping.
unmap_physmem() is a no-op on all architectures, but if any
architecture needs to do such mappings through the TLB, this is the
hook where those TLB entries can be invalidated.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-12-13 13:15:16 +01:00