Path: blob/master/arch/arm/mach-at91/board-eco920.c
10817 views
/*1* This program is free software; you can redistribute it and/or modify2* it under the terms of the GNU General Public License as published by3* the Free Software Foundation; either version 2 of the License, or4* (at your option) any later version.5*6* This program is distributed in the hope that it will be useful,7* but WITHOUT ANY WARRANTY; without even the implied warranty of8* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9* GNU General Public License for more details.10*11* You should have received a copy of the GNU General Public License12* along with this program; if not, write to the Free Software13* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA14*/1516#include <linux/init.h>17#include <linux/platform_device.h>18#include <linux/mtd/physmap.h>19#include <linux/gpio.h>2021#include <asm/mach-types.h>2223#include <asm/mach/arch.h>24#include <asm/mach/map.h>2526#include <mach/board.h>27#include <mach/at91rm9200_mc.h>28#include <mach/cpu.h>2930#include "generic.h"3132static void __init eco920_init_early(void)33{34/* Set cpu type: PQFP */35at91rm9200_set_type(ARCH_REVISON_9200_PQFP);3637at91rm9200_initialize(18432000);3839/* Setup the LEDs */40at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);4142/* DBGU on ttyS0. (Rx & Tx only */43at91_register_uart(0, 0, 0);4445/* set serial console to ttyS0 (ie, DBGU) */46at91_set_serial_console(0);47}4849static void __init eco920_init_irq(void)50{51at91rm9200_init_interrupts(NULL);52}5354static struct at91_eth_data __initdata eco920_eth_data = {55.phy_irq_pin = AT91_PIN_PC2,56.is_rmii = 1,57};5859static struct at91_usbh_data __initdata eco920_usbh_data = {60.ports = 1,61};6263static struct at91_udc_data __initdata eco920_udc_data = {64.vbus_pin = AT91_PIN_PB12,65.pullup_pin = AT91_PIN_PB13,66};6768static struct at91_mmc_data __initdata eco920_mmc_data = {69.slot_b = 0,70.wire4 = 0,71};7273static struct physmap_flash_data eco920_flash_data = {74.width = 2,75};7677static struct resource eco920_flash_resource = {78.start = 0x11000000,79.end = 0x11ffffff,80.flags = IORESOURCE_MEM,81};8283static struct platform_device eco920_flash = {84.name = "physmap-flash",85.id = 0,86.dev = {87.platform_data = &eco920_flash_data,88},89.resource = &eco920_flash_resource,90.num_resources = 1,91};9293static struct spi_board_info eco920_spi_devices[] = {94{ /* CAN controller */95.modalias = "tlv5638",96.chip_select = 3,97.max_speed_hz = 20 * 1000 * 1000,98.mode = SPI_CPHA,99},100};101102static void __init eco920_board_init(void)103{104at91_add_device_serial();105at91_add_device_eth(&eco920_eth_data);106at91_add_device_usbh(&eco920_usbh_data);107at91_add_device_udc(&eco920_udc_data);108109at91_add_device_mmc(0, &eco920_mmc_data);110platform_device_register(&eco920_flash);111112at91_sys_write(AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1)113| AT91_SMC_RWSETUP_(1)114| AT91_SMC_DBW_8115| AT91_SMC_WSEN116| AT91_SMC_NWS_(15));117118at91_set_A_periph(AT91_PIN_PC6, 1);119120at91_set_gpio_input(AT91_PIN_PA23, 0);121at91_set_deglitch(AT91_PIN_PA23, 1);122123/* Initialization of the Static Memory Controller for Chip Select 3 */124at91_sys_write(AT91_SMC_CSR(3),125AT91_SMC_DBW_16 | /* 16 bit */126AT91_SMC_WSEN |127AT91_SMC_NWS_(5) | /* wait states */128AT91_SMC_TDF_(1) /* float time */129);130131at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices));132}133134MACHINE_START(ECO920, "eco920")135/* Maintainer: Sascha Hauer */136.timer = &at91rm9200_timer,137.map_io = at91rm9200_map_io,138.init_early = eco920_init_early,139.init_irq = eco920_init_irq,140.init_machine = eco920_board_init,141MACHINE_END142143144