Commit Graph

66 Commits

Author SHA1 Message Date
Haavard Skinnemoen 4209324a74 avr32: data param to at32_add_device_mci() must be non-NULL
at32_add_device_mci() will refuse to add the mci device if the data
parameter is NULL. Fix up the favr-32 and hammerhead boards so that this
doesn't happen.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: Alex Raimondi <mailinglist@miromico.ch>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
2009-01-05 17:14:22 +01:00
Haavard Skinnemoen 0e49005090 Merge branch 'move-atmel-mci-h' into boards 2009-01-05 16:36:07 +01:00
Nicolas Ferre c42aa775cc atmel-mci: move atmel-mci.h file to include/linux
Needed to use the atmel-mci driver in an architecture
independant maner.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2009-01-05 16:35:31 +01:00
Alex Raimondi dd5e1339e5 avr32: Hammerhead board support
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.

This patch does include the basic support for the fpga device driver,
but not the device driver itself.

Signed-off-by: Alex Raimondi <mailinglist@miromico.ch>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2009-01-05 15:52:04 +01:00
Haavard Skinnemoen bc08969fe6 Merge branch 'cleanups' into boards 2009-01-05 15:51:52 +01:00
Alex Raimondi adde42b583 avr32: Allow reserving multiple pins at once
at32_reserve_pin now takes an u32 bitmask rather than a single pin.
This allows to reserve multiple pins at once.

Remove (undocumented) SDCS (pin PE26) from reservation in board
setup code.

Signed-off-by: Alex Raimondi <raimondi@miromico.ch>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2009-01-05 12:16:13 +01:00
Haavard Skinnemoen 45f926912f favr-32: Remove deprecated call
at32_add_system_devices() is deprecated, so remove the call to it.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2009-01-05 12:15:14 +01:00
Mark Jackson 8d3d3fb922 MIMC200: Remove deprecated call
This patch removes a call to the deprecated function
at32_add_system_devices().

Signed-off-by: Mark Jackson <mpfj@mimc.co.uk>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2009-01-05 11:35:16 +01:00
Haavard Skinnemoen 8983fdb508 avr32: favr-32 build fix
The favr-32 board code still refers to the old asm/arch header files
which were moved to mach/ some time ago.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-12-18 16:22:13 +01:00
Haavard Skinnemoen d9214556b1 Merge branches 'boards' and 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6 2008-10-23 15:24:10 +02:00
Haavard Skinnemoen e82c6106b0 avr32: Fix GPIO initcall breakage
Add essential system devices, including GPIO controllers, automatically
at core_initcall time. This ensures that the devices are there when the
PIO driver gets initialized at postcore_initcall, fixing a bug exposed
by commit d6634db8fe "avr32: Use
platform_driver_probe for pio platform driver".

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-10-23 15:18:33 +02:00
Mark Jackson 5b50c166b7 avr32: Add MIMC200 board support
Please consider the following patch which adds support for a new AVR32
based board.

The board is closely based on Atmel's NGW100 reference board, but has an
extra 8MByte FLASH and 128KByte FRAM.

Signed-off-by: Mark Jackson <mpfj@mimc.co.uk>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-10-13 16:36:25 +02:00
Hans-Christian Egtvedt 45c349b58c avr32: add support for EarthLCD Favr-32 board
This patch adds support for the Favr-32 board made by EarthLCD.

This kit, which is also called ezLCD-101, has a 10.4" touch screen LCD panel,
16 MB 32-bit SDRAM, 8 MB parallel flash, Ethernet, audio out, USB device,
SD-card slot, USART and various other connectors for cennecting stuff to SPI,
I2C, GPIO, etc.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-10-13 16:01:18 +02:00
Hans-Christian Egtvedt a3bee42f05 avr32: Add support for EVKLCD10X addon boards
This patch lets the user enable support for EVKLCD100 and EVKLCD101
(refered to by EVKLCD10X). By enabling EVKLCD10X support the LCD
controller and AC97 controller platform devices are added.

The user can also choose between the EVKLCD100 (QVGA display) and the
EVKLCD101 (VGA display), this is added to automagically select the
correct panel timing and resolution parameters.

Enabling support for EVKLCD10X addon board will cripple the MCI platform
device a bit since they share two GPIO lines (detect and write-protect).
These two lines are disabled when EVKLCD10X is enabled.

The default configurations are based upon ATNGW100, but with added AC97C
and LCDC driver. Virtual terminal is also enabled by default for
EVKLCD10X boards.

Verified on hardware with a NGW100 + EVKLCD100/101.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-10-13 12:56:24 +02:00
Haavard Skinnemoen 6eb3ebe04d avr32: Fix build failures in board code
Fix a few instances of board code breakage introduced by the atmel-mci
platform interface changes.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-10-12 16:13:28 +02:00
Julien May caf18f19ee avr32: Allow selecting multiple pins at once
at32_select_periph() now takes an u32 bitmask rather than a single pin.
This allows to set multiple pins at once.

Signed-off-by: Alex Raimondi <mailinglist@miromico.ch>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-10-12 15:54:00 +02:00
Haavard Skinnemoen 0d62950125 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/atmel-mci-2.6.28 2008-10-12 15:44:33 +02:00
Haavard Skinnemoen 6b918657b7 atmel-mci: Platform code for supporting multiple mmc slots
Add the necessary platform infrastructure to support multiple mmc/sdcard
slots all at once through a single controller. Currently, the driver
will use the first valid slot it finds and stick with that, but later
patches will add support for switching between several slots on the fly.

Extend the platform data structure with per-slot information: MMC/SDcard
bus width and card detect/write protect pins. This will affect the pin
muxing as well as the capabilities announced to the mmc core.

Note that board code is now required to supply a mci_platform_data
struct to at32_add_device_mci().

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-10-05 20:39:21 +02:00
David Brownell 96706600de ngw100: export J15 through sysfs
The NGW100 board has jumper J15 (near the reset button) which
is unused.  This patch exports it through the GPIO sysfs support
(as /sys/class/gpio/gpio62/value) so that it's easily queried
by boot scripts or whatever might want to know if the jumper
has been installed (value = 0) or not (value = 1, "default").

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
[haavard.skinnemoen@atmel.com: add missing include]
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-09-22 09:51:01 +02:00
Julien May 7066412488 avr32: Allow fine-grained control over LCDC pins
This replaces the pin_config param with an u64 pin_mask in
at32_add_device_lcdc, allowing a board-maintainer to indivually select
specific lcdc pins.

Signed-off-by: Alex Raimondi <raimondi@miromico.ch>
Signed-off-by: Julien May <jmay@miromico.ch>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-09-22 09:51:01 +02:00
Haavard Skinnemoen 7fb61a7b6f atstk1000: fix build breakage with BOARD_ATSTK100X_SW2_CUSTOM=y
The #ifdef surrounding the code adding the mmc controller had a typo,
causing it to be compiled even when mmc was supposed to be disabled.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-09-19 18:21:29 +02:00
Haavard Skinnemoen 33f197a603 avr32: Make atstk1006_nand_data definition static
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-08-08 12:44:56 +02:00
Haavard Skinnemoen 0fe9497e77 avr32: Reduce DataFlash bus speed to 8 MHz on ATNGW100
Doing this in combination with "atmel_spi: fix hang due to missed
interrupt" appears to eliminate the overruns I'm seeing when using
JFFS2-on-DataFlash as /usr filesystem on the ATNGW100.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-08-08 12:44:41 +02:00
Haavard Skinnemoen 3663b736a5 avr32: Use <mach/foo.h> instead of <asm/arch/foo.h>
Update all avr32-specific files to use the new platform-specific header
locations. Drivers shared with ARM are left alone for now.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-08-05 14:36:57 +02:00
David Brownell 3c26e17032 avr32: some mmc/sd cleanups
Minor cleanups for the MMC/SD support on avr32:

 - Make at32_add_device_mci() properly initialize "missing"
   platform data ... so boards like STK1002 won't try GPIO 0.

 - Switch over to gpio_is_valid() instead of testing for only
   one designated value.

 - Provide STK1002 platform data for the unlikely case that
   switches are set so first Ethernet controller isn't in use.
   (That's the only way to get card detect and writeprotect
   switch sensing on the STK1000.)

And get rid of one "unused variable" warning.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-07-27 13:57:36 +02:00
Haavard Skinnemoen eda3d8f560 Merge commit 'upstream/master' 2008-07-27 13:54:08 +02:00
David Woodhouse ff877ea80e Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6 2008-07-25 10:40:14 -04:00
Adrian Bunk 62fe8378d9 fix avr32 build errors
Commit 7d2be0749a
(atmel-mci: Driver for Atmel on-chip MMC controllers)
causes build errors like:

<--  snip  -->

...
  CC      arch/avr32/boards/atstk1000/atstk1003.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/avr32/boards/atstk1000/atstk1003.c: In function 'atstk1003_init':
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/avr32/boards/atstk1000/atstk1003.c:157: error: too few arguments to function 'at32_add_device_mci'
make[2]: *** [arch/avr32/boards/atstk1000/atstk1003.o] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-07-17 21:01:34 +02:00
Haavard Skinnemoen 7d2be0749a atmel-mci: Driver for Atmel on-chip MMC controllers
This is a driver for the MMC controller on the AP7000 chips from
Atmel. It should in theory work on AT91 systems too with some
tweaking, but since the DMA interface is quite different, it's not
entirely clear if it's worth merging this with the at91_mci driver.

This driver has been around for a while in BSPs and kernel sources
provided by Atmel, but this particular version uses the generic DMA
Engine framework (with the slave extensions) instead of an
avr32-only DMA controller framework.

This driver can also use PIO transfers when no DMA channels are
available, and for transfers where using DMA may be difficult or
impractical for some reason (e.g. the DMA setup overhead is usually
not worth it for very short transfers, and badly aligned buffers or
lengths are difficult to handle.)

Currently, the driver only support PIO transfers. DMA support has been
split out to a separate patch to hopefully make it easier to review.

The driver has been tested using mmc-block and ext3fs on several SD,
SDHC and MMC+ cards. Reads and writes work fine, with read transfer
rates up to 3.5 MiB/s on fast cards with debugging disabled.

The driver has also been tested using the mmc_test module on the same
cards. All tests except 7, 9, 15 and 17 succeed. The first two are
unsupported by all the cards I have, so I don't know if the driver
handles this correctly. The last two fail because the hardware flags a
Data CRC Error instead of a Data Timeout error. I'm not sure how to deal
with that.

Documentation for this controller can be found in many data sheets from
Atmel, including the AT32AP7000 data sheet which can be found here:

http://www.atmel.com/dyn/products/datasheets.asp?family_id=682

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-15 14:14:49 +02:00
David Brownell 7ef31e9c4e avr32: improve NGW100 I2C/PMBus setup
Basic I2C initialization for the NGW100 board:

  - Provide empty i2c device table. Daughtercards may add devices,
    and the ATtiny24 could do stuff too.

  - Set up EXTINT(3) so the ATtiny24 can interrupt the AP7000.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:32:29 +02:00
Hans-Christian Egtvedt 47882cf620 avr32: Add pin configuration choice to LCDC peripheral
This patch lets the board code choose which pin out to use for the LCD
interface.

On AT32AP7000 the LCDC is wired to two sets of pins, which lets the user
choose between dual ethernet and 32-bit EBI. For the ATNGW100 board it
is vital to have the choice to select the alternative pinout since this
pinout is routed to the external headers.

Update ATSTK1002 and ATSTK1004 to use the new interface.

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:32:27 +02:00
Alex 60ed7951d0 avr32: Allow board to define oscillator rates
On our custom board we have other oscillator rates than on atngw100 and
atstk100x.

Currently these rates are hardcoded in arch/avr32/mach-at32ap/at32ap700x.c.

This patch moves them into board specific code.

Signed-off-by: Alex Raimondi <raimondi@miromico.ch>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:07:16 +02:00
Håvard Skinnemoen e150d6e725 avr32: Add support for ATSTK1006
The ATSTK1006 is basically an upgraded version of ATSTK1002 with
128 MiB SDRAM and 256 MiB NAND flash on board.

Otherwise, the board is very similar to the ATSTK1002, so it uses the
same board support file.

Signed-off-by: Håvard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2008-06-07 08:46:24 +01:00
Haavard Skinnemoen f059267e7f avr32: Use correct config symbol in atstk1004 board code
CONFIG_BOARD_ATSTK1002_SW2_CUSTOM should be
CONFIG_BOARD_ATSTK100X_SW2_CUSTOM.

Spotted by Robert P. J. Day.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-02-13 14:44:06 +01:00
Haavard Skinnemoen e8897bfef2 [AVR32] Kconfig: Choose daughterboard instead of CPU
Remove the CPU selection menu and instead let it be selected by the
board or daughterboard option. Add daughterboard selection for
ATSTK1000 (this was previously determined based on CPU type.)

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-01-25 08:31:42 +01:00
Haavard Skinnemoen 78693e47a2 [AVR32] Add support for ATSTK1003 and ATSTK1004
ATSTK1003 and ATSTK1004 are CPU daughterboards for ATSTK1000 featuring
the AT32AP7001 and AT32AP7002 CPUs, respectively.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-01-25 08:31:42 +01:00
Haavard Skinnemoen 64d8105267 [AVR32] Clean up external DAC setup code
Reduce the ridiculous amount of #ifdef clutter in atstk1002.c a bit by
moving all the extdac stuff into its own function and providing an
empty stub for the case when it isn't wanted.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-01-25 08:31:42 +01:00
Haavard Skinnemoen f4c41b2689 [AVR32] ATSTK1000: Move gpio-leds setup to setup.c
There may be other boards than STK1002 that want to use the leds on
STK1000. Move it to stk1000 common code to make it easier to reuse.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-01-25 08:31:42 +01:00
Haavard Skinnemoen 438ff3f3cc [AVR32] Add support for AT32AP7001 and AT32AP7002
These are derivatives of the AT32AP7000 chip, which means that most of
the code stays the same. Rename a few files, functions, definitions
and config symbols to reflect that they apply to all AP700x chips, and
exclude some platform devices from chips where they aren't present.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-01-25 08:31:41 +01:00
Hans-Christian Egtvedt 1c2f173796 [AVR32] Wire up AT73C213 sound driver on ATSTK1000 board
Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-10-23 11:19:14 +02:00
David Brownell 82c54f864f [AVR32] ngw100 i2c-gpio tweaks
Make the NGW100 bitbang i2c use open drain signaling.

Also, speed it up, so it's closer to 100 kHz ... the code paths seem
to be long enough that the udelay isn't dominating bit times.  The
peak bit rate I observed was around 125 kHz, but that's with large
delays (usually before ACK/NAK) which hold the overall rate down to
around 80 kHz (call it 100 usec/byte on average).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-10-11 13:32:55 +02:00
Kristoffer Nyborg Gregertsen af8184718a [AVR32] SMC configuration in clock cycles
This patch makes the SMC configuration take timings in clock cycles
instead of nanoseconds. A function to calculate timings in clock
cycles is added.

This patch removes the rounding troubles of the previous SMC
configuration method.

[hskinnemoen@atmel.com: fix atstk1002/atngw100 flash config]
Signed-off-by: Kristoffer Nyborg Gregertsen <gregerts@stud.ntnu.no>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-10-11 13:32:49 +02:00
Haavard Skinnemoen 6fcf061511 [AVR32] Wire up USBA device
Implement at32_add_device_usba() and use it to wire up the USBA device
on ATSTK1000 and ATNGW100.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-10-11 11:40:27 +02:00
Haavard Skinnemoen 54bb69e250 [AVR32] Wire up i2c-gpio on the ATNGW100 board
The NGW100 has a board controller which is hooked up to the TWI lines
on AP7000. Since the TWI driver isn't in mainline, use the i2c-gpio
driver in the mean time.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-08-15 16:36:55 +02:00
David Brownell ad93ab0a6e [AVR32] leds-gpio for stk1000
Add GPIO led support: J2 to either block of LEDs on the STK1000.

This uses the new LEDS_GPIO driver, and sets up a heartbeat trigger by
default ... either bright (!!) amber, or a more interesting purple.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-08-15 16:36:55 +02:00
Linus Torvalds d7f5e3df35 Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds:
  leds: Convert from struct class_device to struct device
  leds: leds-gpio for ngw100
  leds: Add warning printks in error paths
  leds: Fix trigger unregister_simple if register_simple fails
  leds: Use menuconfig objects II - LED
  leds: Teach leds-gpio to handle timer-unsafe GPIOs
  leds: Add generic GPIO LED driver
2007-07-22 11:22:01 -07:00
Haavard Skinnemoen 587ca7619a [AVR32] Initialize phy_mask for both macb devices
The STK1000 uses pullups on the MDIO lines to the PHY, but they are
too weak. This causes the PHY layer to detect PHYs on all possible MII
addresses. Mask out all but the correct address to prevent this from
happening.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-07-18 20:47:04 +02:00
Kristoffer Nyborg Gregertsen d4003ba0a1 [AVR32] Don't wire up macb0 unless SW6 is in default position
If the user wants to sacrifice macb0 for more GPIOs, let him.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-07-18 20:45:52 +02:00
Hans-Christian Egtvedt 95a42267cd [AVR32] Wire up SSC platform device 0 as TX on ATSTK1000 board
Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-07-18 20:45:52 +02:00
David Brownell a8e93ed8cb [AVR32] Make STK1000 mux settings configurable
This adds some STK1002-specific config options covering the jumper settings,
so the kernel can automatically be configured to include the relevant devices.

One of them replaces the previous internal SW2_DEFAULT setting; SPI config
is affected by two of the jumpers; and a fourth one switches between LCD and
the second Ethernet connector.  (There's more that to be done.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-07-18 20:45:51 +02:00