[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
/*
|
2008-06-06 16:04:58 +00:00
|
|
|
* ATSTK1002/ATSTK1006 daughterboard-specific init code
|
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
*
|
2008-06-06 16:04:58 +00:00
|
|
|
* Copyright (C) 2005-2007 Atmel Corporation
|
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
2006-12-04 13:08:39 +00:00
|
|
|
#include <linux/clk.h>
|
|
|
|
#include <linux/etherdevice.h>
|
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
#include <linux/init.h>
|
2006-12-04 12:58:27 +00:00
|
|
|
#include <linux/kernel.h>
|
2006-12-04 13:08:39 +00:00
|
|
|
#include <linux/platform_device.h>
|
2006-12-04 12:58:27 +00:00
|
|
|
#include <linux/string.h>
|
|
|
|
#include <linux/types.h>
|
2007-01-10 19:20:02 +00:00
|
|
|
#include <linux/spi/spi.h>
|
2007-07-16 14:13:33 +00:00
|
|
|
#include <linux/spi/at73c213.h>
|
2008-11-20 14:59:12 +00:00
|
|
|
#include <linux/atmel-mci.h>
|
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
|
2007-03-21 17:08:49 +00:00
|
|
|
#include <video/atmel_lcdc.h>
|
|
|
|
|
2006-12-04 13:08:39 +00:00
|
|
|
#include <asm/io.h>
|
2006-12-04 12:58:27 +00:00
|
|
|
#include <asm/setup.h>
|
2008-07-27 09:34:45 +00:00
|
|
|
|
2008-08-05 11:57:38 +00:00
|
|
|
#include <mach/at32ap700x.h>
|
|
|
|
#include <mach/board.h>
|
|
|
|
#include <mach/init.h>
|
|
|
|
#include <mach/portmux.h>
|
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
|
2007-03-21 17:08:49 +00:00
|
|
|
#include "atstk1000.h"
|
2007-01-24 04:14:02 +00:00
|
|
|
|
2008-03-17 13:55:06 +00:00
|
|
|
/* Oscillator frequencies. These are board specific */
|
|
|
|
unsigned long at32_board_osc_rates[3] = {
|
|
|
|
[0] = 32768, /* 32.768 kHz on RTC osc */
|
|
|
|
[1] = 20000000, /* 20 MHz on osc0 */
|
|
|
|
[2] = 12000000, /* 12 MHz on osc1 */
|
|
|
|
};
|
2007-01-24 04:14:02 +00:00
|
|
|
|
2008-06-06 16:04:58 +00:00
|
|
|
/*
|
|
|
|
* The ATSTK1006 daughterboard is very similar to the ATSTK1002. Both
|
|
|
|
* have the AT32AP7000 chip on board; the difference is that the
|
|
|
|
* STK1006 has 128 MB SDRAM (the STK1002 uses the 8 MB SDRAM chip on
|
|
|
|
* the STK1000 motherboard) and 256 MB NAND flash (the STK1002 has
|
|
|
|
* none.)
|
|
|
|
*
|
|
|
|
* The RAM difference is handled by the boot loader, so the only
|
|
|
|
* difference we end up handling here is the NAND flash.
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_BOARD_ATSTK1006
|
|
|
|
#include <linux/mtd/partitions.h>
|
2008-08-05 11:57:38 +00:00
|
|
|
#include <mach/smc.h>
|
2008-06-06 16:04:58 +00:00
|
|
|
|
|
|
|
static struct smc_timing nand_timing __initdata = {
|
|
|
|
.ncs_read_setup = 0,
|
|
|
|
.nrd_setup = 10,
|
|
|
|
.ncs_write_setup = 0,
|
|
|
|
.nwe_setup = 10,
|
|
|
|
|
|
|
|
.ncs_read_pulse = 30,
|
|
|
|
.nrd_pulse = 15,
|
|
|
|
.ncs_write_pulse = 30,
|
|
|
|
.nwe_pulse = 15,
|
|
|
|
|
|
|
|
.read_cycle = 30,
|
|
|
|
.write_cycle = 30,
|
|
|
|
|
|
|
|
.ncs_read_recover = 0,
|
|
|
|
.nrd_recover = 15,
|
|
|
|
.ncs_write_recover = 0,
|
|
|
|
/* WE# high -> RE# low min 60 ns */
|
|
|
|
.nwe_recover = 50,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct smc_config nand_config __initdata = {
|
|
|
|
.bus_width = 1,
|
|
|
|
.nrd_controlled = 1,
|
|
|
|
.nwe_controlled = 1,
|
|
|
|
.nwait_mode = 0,
|
|
|
|
.byte_write = 0,
|
|
|
|
.tdf_cycles = 2,
|
|
|
|
.tdf_mode = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct mtd_partition nand_partitions[] = {
|
|
|
|
{
|
|
|
|
.name = "main",
|
|
|
|
.offset = 0x00000000,
|
|
|
|
.size = MTDPART_SIZ_FULL,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2008-06-28 12:16:31 +00:00
|
|
|
static struct atmel_nand_data atstk1006_nand_data __initdata = {
|
2008-06-06 16:04:58 +00:00
|
|
|
.cle = 21,
|
|
|
|
.ale = 22,
|
|
|
|
.rdy_pin = GPIO_PIN_PB(30),
|
|
|
|
.enable_pin = GPIO_PIN_PB(29),
|
2011-12-29 06:43:24 +00:00
|
|
|
.ecc_mode = NAND_ECC_SOFT,
|
2011-05-29 13:49:22 +00:00
|
|
|
.parts = nand_partitions,
|
2012-07-30 21:39:57 +00:00
|
|
|
.num_parts = ARRAY_SIZE(nand_partitions),
|
2008-06-06 16:04:58 +00:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2006-12-04 13:08:39 +00:00
|
|
|
struct eth_addr {
|
|
|
|
u8 addr[6];
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct eth_addr __initdata hw_addr[2];
|
2011-03-08 20:17:06 +00:00
|
|
|
static struct macb_platform_data __initdata eth_data[2] = {
|
2007-07-18 18:32:49 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* The MDIO pullups on STK1000 are a bit too weak for
|
|
|
|
* the autodetection to work properly, so we have to
|
|
|
|
* mask out everything but the correct address.
|
|
|
|
*/
|
|
|
|
.phy_mask = ~(1U << 16),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.phy_mask = ~(1U << 17),
|
|
|
|
},
|
|
|
|
};
|
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
|
2007-10-29 15:24:09 +00:00
|
|
|
#ifdef CONFIG_BOARD_ATSTK1000_EXTDAC
|
2007-07-16 14:13:33 +00:00
|
|
|
static struct at73c213_board_info at73c213_data = {
|
|
|
|
.ssc_id = 0,
|
|
|
|
.shortname = "AVR32 STK1000 external DAC",
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2007-10-29 16:03:26 +00:00
|
|
|
#ifndef CONFIG_BOARD_ATSTK100X_SW1_CUSTOM
|
2007-02-16 12:56:11 +00:00
|
|
|
static struct spi_board_info spi0_board_info[] __initdata = {
|
2007-10-29 15:24:09 +00:00
|
|
|
#ifdef CONFIG_BOARD_ATSTK1000_EXTDAC
|
2007-07-16 14:13:33 +00:00
|
|
|
{
|
|
|
|
/* AT73C213 */
|
|
|
|
.modalias = "at73c213",
|
|
|
|
.max_speed_hz = 200000,
|
|
|
|
.chip_select = 0,
|
|
|
|
.mode = SPI_MODE_1,
|
|
|
|
.platform_data = &at73c213_data,
|
|
|
|
},
|
|
|
|
#endif
|
2007-01-10 19:20:02 +00:00
|
|
|
{
|
2007-02-16 12:56:11 +00:00
|
|
|
/* QVGA display */
|
2007-01-10 19:20:02 +00:00
|
|
|
.modalias = "ltv350qv",
|
|
|
|
.max_speed_hz = 16000000,
|
|
|
|
.chip_select = 1,
|
2007-05-29 19:33:37 +00:00
|
|
|
.mode = SPI_MODE_3,
|
2007-01-10 19:20:02 +00:00
|
|
|
},
|
|
|
|
};
|
2007-06-12 12:34:47 +00:00
|
|
|
#endif
|
|
|
|
|
2007-10-29 16:03:26 +00:00
|
|
|
#ifdef CONFIG_BOARD_ATSTK100X_SPI1
|
2007-06-12 12:34:47 +00:00
|
|
|
static struct spi_board_info spi1_board_info[] __initdata = { {
|
|
|
|
/* patch in custom entries here */
|
|
|
|
} };
|
|
|
|
#endif
|
2007-01-10 19:20:02 +00:00
|
|
|
|
2006-12-04 13:08:39 +00:00
|
|
|
/*
|
|
|
|
* The next two functions should go away as the boot loader is
|
|
|
|
* supposed to initialize the macb address registers with a valid
|
|
|
|
* ethernet address. But we need to keep it around for a while until
|
|
|
|
* we can be reasonably sure the boot loader does this.
|
|
|
|
*
|
|
|
|
* The phy_id is ignored as the driver will probe for it.
|
|
|
|
*/
|
2006-12-04 12:58:27 +00:00
|
|
|
static int __init parse_tag_ethernet(struct tag *tag)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
i = tag->u.ethernet.mac_index;
|
2006-12-04 13:08:39 +00:00
|
|
|
if (i < ARRAY_SIZE(hw_addr))
|
|
|
|
memcpy(hw_addr[i].addr, tag->u.ethernet.hw_address,
|
|
|
|
sizeof(hw_addr[i].addr));
|
|
|
|
|
2006-12-04 12:58:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
__tagtable(ATAG_ETHERNET, parse_tag_ethernet);
|
|
|
|
|
2006-12-04 13:08:39 +00:00
|
|
|
static void __init set_hw_addr(struct platform_device *pdev)
|
|
|
|
{
|
|
|
|
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
|
|
const u8 *addr;
|
|
|
|
void __iomem *regs;
|
|
|
|
struct clk *pclk;
|
|
|
|
|
|
|
|
if (!res)
|
|
|
|
return;
|
|
|
|
if (pdev->id >= ARRAY_SIZE(hw_addr))
|
|
|
|
return;
|
|
|
|
|
|
|
|
addr = hw_addr[pdev->id].addr;
|
|
|
|
if (!is_valid_ether_addr(addr))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Since this is board-specific code, we'll cheat and use the
|
|
|
|
* physical address directly as we happen to know that it's
|
|
|
|
* the same as the virtual address.
|
|
|
|
*/
|
|
|
|
regs = (void __iomem __force *)res->start;
|
|
|
|
pclk = clk_get(&pdev->dev, "pclk");
|
2010-11-26 17:06:12 +00:00
|
|
|
if (IS_ERR(pclk))
|
2006-12-04 13:08:39 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
clk_enable(pclk);
|
|
|
|
__raw_writel((addr[3] << 24) | (addr[2] << 16)
|
|
|
|
| (addr[1] << 8) | addr[0], regs + 0x98);
|
|
|
|
__raw_writel((addr[5] << 8) | addr[4], regs + 0x9c);
|
|
|
|
clk_disable(pclk);
|
|
|
|
clk_put(pclk);
|
|
|
|
}
|
|
|
|
|
2007-10-29 15:24:09 +00:00
|
|
|
#ifdef CONFIG_BOARD_ATSTK1000_EXTDAC
|
|
|
|
static void __init atstk1002_setup_extdac(void)
|
2007-07-16 14:13:33 +00:00
|
|
|
{
|
|
|
|
struct clk *gclk;
|
|
|
|
struct clk *pll;
|
|
|
|
|
|
|
|
gclk = clk_get(NULL, "gclk0");
|
|
|
|
if (IS_ERR(gclk))
|
|
|
|
goto err_gclk;
|
|
|
|
pll = clk_get(NULL, "pll0");
|
|
|
|
if (IS_ERR(pll))
|
|
|
|
goto err_pll;
|
|
|
|
|
|
|
|
if (clk_set_parent(gclk, pll)) {
|
|
|
|
pr_debug("STK1000: failed to set pll0 as parent for DAC clock\n");
|
|
|
|
goto err_set_clk;
|
|
|
|
}
|
|
|
|
|
2008-09-24 08:30:47 +00:00
|
|
|
at32_select_periph(GPIO_PIOA_BASE, (1 << 30), GPIO_PERIPH_A, 0);
|
2007-10-29 15:24:09 +00:00
|
|
|
at73c213_data.dac_clk = gclk;
|
2007-07-16 14:13:33 +00:00
|
|
|
|
|
|
|
err_set_clk:
|
|
|
|
clk_put(pll);
|
|
|
|
err_pll:
|
|
|
|
clk_put(gclk);
|
|
|
|
err_gclk:
|
|
|
|
return;
|
|
|
|
}
|
2007-10-29 15:24:09 +00:00
|
|
|
#else
|
|
|
|
static void __init atstk1002_setup_extdac(void)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_BOARD_ATSTK1000_EXTDAC */
|
2007-07-16 14:13:33 +00:00
|
|
|
|
2006-10-04 14:02:10 +00:00
|
|
|
void __init setup_board(void)
|
|
|
|
{
|
2007-10-29 16:03:26 +00:00
|
|
|
#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
|
2009-03-31 17:31:02 +00:00
|
|
|
at32_map_usart(0, 1, 0); /* USART 0/B: /dev/ttyS1, IRDA */
|
2007-06-12 12:34:47 +00:00
|
|
|
#else
|
2009-03-31 17:31:02 +00:00
|
|
|
at32_map_usart(1, 0, 0); /* USART 1/A: /dev/ttyS0, DB9 */
|
2007-01-24 04:14:02 +00:00
|
|
|
#endif
|
|
|
|
/* USART 2/unused: expansion connector */
|
2009-03-31 17:31:02 +00:00
|
|
|
at32_map_usart(3, 2, 0); /* USART 3/C: /dev/ttyS2, DB9 */
|
2006-10-04 14:02:10 +00:00
|
|
|
|
|
|
|
at32_setup_serial_console(0);
|
|
|
|
}
|
|
|
|
|
2008-07-27 09:34:45 +00:00
|
|
|
#ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
|
|
|
|
|
2008-08-07 12:08:49 +00:00
|
|
|
static struct mci_platform_data __initdata mci0_data = {
|
|
|
|
.slot[0] = {
|
|
|
|
.bus_width = 4,
|
|
|
|
|
2008-07-27 09:34:45 +00:00
|
|
|
/* MMC card detect requires MACB0 *NOT* be used */
|
|
|
|
#ifdef CONFIG_BOARD_ATSTK1002_SW6_CUSTOM
|
2008-08-07 12:08:49 +00:00
|
|
|
.detect_pin = GPIO_PIN_PC(14), /* gpio30/sdcd */
|
|
|
|
.wp_pin = GPIO_PIN_PC(15), /* gpio31/sdwp */
|
2008-07-27 09:34:45 +00:00
|
|
|
#else
|
2008-08-07 12:08:49 +00:00
|
|
|
.detect_pin = -ENODEV,
|
|
|
|
.wp_pin = -ENODEV,
|
2008-07-27 09:34:45 +00:00
|
|
|
#endif /* SW6 for sd{cd,wp} routing */
|
2008-08-07 12:08:49 +00:00
|
|
|
},
|
|
|
|
};
|
2008-07-27 09:34:45 +00:00
|
|
|
|
|
|
|
#endif /* SW2 for MMC signal routing */
|
|
|
|
|
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
static int __init atstk1002_init(void)
|
|
|
|
{
|
2007-01-30 10:16:16 +00:00
|
|
|
/*
|
|
|
|
* ATSTK1000 uses 32-bit SDRAM interface. Reserve the
|
|
|
|
* SDRAM-specific pins so that nobody messes with them.
|
|
|
|
*/
|
2008-11-04 22:37:10 +00:00
|
|
|
at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL);
|
2007-01-30 10:16:16 +00:00
|
|
|
|
2008-06-06 16:04:58 +00:00
|
|
|
#ifdef CONFIG_BOARD_ATSTK1006
|
|
|
|
smc_set_timing(&nand_config, &nand_timing);
|
|
|
|
smc_set_configuration(3, &nand_config);
|
|
|
|
at32_add_device_nand(0, &atstk1006_nand_data);
|
|
|
|
#endif
|
|
|
|
|
2007-10-29 16:03:26 +00:00
|
|
|
#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
|
2006-10-04 14:02:10 +00:00
|
|
|
at32_add_device_usart(1);
|
2007-06-12 12:34:47 +00:00
|
|
|
#else
|
|
|
|
at32_add_device_usart(0);
|
2007-01-24 04:14:02 +00:00
|
|
|
#endif
|
2006-10-04 14:02:10 +00:00
|
|
|
at32_add_device_usart(2);
|
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
|
2007-07-06 12:37:30 +00:00
|
|
|
#ifndef CONFIG_BOARD_ATSTK1002_SW6_CUSTOM
|
2006-12-04 13:08:39 +00:00
|
|
|
set_hw_addr(at32_add_device_eth(0, ð_data[0]));
|
2007-07-06 12:37:30 +00:00
|
|
|
#endif
|
2007-10-29 16:03:26 +00:00
|
|
|
#ifndef CONFIG_BOARD_ATSTK100X_SW1_CUSTOM
|
2007-02-16 12:56:11 +00:00
|
|
|
at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
|
2007-06-12 12:34:47 +00:00
|
|
|
#endif
|
2007-10-29 16:03:26 +00:00
|
|
|
#ifdef CONFIG_BOARD_ATSTK100X_SPI1
|
2007-06-12 12:34:47 +00:00
|
|
|
at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info));
|
|
|
|
#endif
|
2008-09-19 15:56:54 +00:00
|
|
|
#ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
|
2008-10-12 14:02:46 +00:00
|
|
|
at32_add_device_mci(0, &mci0_data);
|
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-06-30 16:35:03 +00:00
|
|
|
#endif
|
2007-06-12 12:34:47 +00:00
|
|
|
#ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM
|
|
|
|
set_hw_addr(at32_add_device_eth(1, ð_data[1]));
|
|
|
|
#else
|
2007-03-21 17:08:49 +00:00
|
|
|
at32_add_device_lcdc(0, &atstk1000_lcdc_data,
|
2008-08-04 12:27:38 +00:00
|
|
|
fbmem_start, fbmem_size,
|
|
|
|
ATMEL_LCDC_PRI_24BIT | ATMEL_LCDC_PRI_CONTROL);
|
2007-06-12 12:34:47 +00:00
|
|
|
#endif
|
2007-06-14 15:37:31 +00:00
|
|
|
at32_add_device_usba(0, NULL);
|
2007-10-29 16:03:26 +00:00
|
|
|
#ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM
|
2007-07-06 12:34:03 +00:00
|
|
|
at32_add_device_ssc(0, ATMEL_SSC_TX);
|
|
|
|
#endif
|
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
|
2007-10-29 15:02:51 +00:00
|
|
|
atstk1000_setup_j2_leds();
|
2007-10-29 15:24:09 +00:00
|
|
|
atstk1002_setup_extdac();
|
2007-07-16 14:13:33 +00:00
|
|
|
|
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 06:32:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
postcore_initcall(atstk1002_init);
|