Path: blob/master/arch/arm/mach-at91/board-rm9200dk.c
10817 views
/*1* linux/arch/arm/mach-at91/board-rm9200dk.c2*3* Copyright (C) 2005 SAN People4*5* Epson S1D framebuffer glue code is:6* Copyright (C) 2005 Thibaut VARENE <[email protected]>7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2 of the License, or11* (at your option) any later version.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21*/2223#include <linux/types.h>24#include <linux/init.h>25#include <linux/mm.h>26#include <linux/module.h>27#include <linux/platform_device.h>28#include <linux/spi/spi.h>29#include <linux/mtd/physmap.h>3031#include <asm/setup.h>32#include <asm/mach-types.h>33#include <asm/irq.h>3435#include <asm/mach/arch.h>36#include <asm/mach/map.h>37#include <asm/mach/irq.h>3839#include <mach/hardware.h>40#include <mach/board.h>41#include <mach/gpio.h>42#include <mach/at91rm9200_mc.h>4344#include "generic.h"454647static void __init dk_init_early(void)48{49/* Initialize processor: 18.432 MHz crystal */50at91rm9200_initialize(18432000);5152/* Setup the LEDs */53at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);5455/* DBGU on ttyS0. (Rx & Tx only) */56at91_register_uart(0, 0, 0);5758/* USART1 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */59at91_register_uart(AT91RM9200_ID_US1, 1, ATMEL_UART_CTS | ATMEL_UART_RTS60| ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD61| ATMEL_UART_RI);6263/* set serial console to ttyS0 (ie, DBGU) */64at91_set_serial_console(0);65}6667static void __init dk_init_irq(void)68{69at91rm9200_init_interrupts(NULL);70}7172static struct at91_eth_data __initdata dk_eth_data = {73.phy_irq_pin = AT91_PIN_PC4,74.is_rmii = 1,75};7677static struct at91_usbh_data __initdata dk_usbh_data = {78.ports = 2,79};8081static struct at91_udc_data __initdata dk_udc_data = {82.vbus_pin = AT91_PIN_PD4,83.pullup_pin = AT91_PIN_PD5,84};8586static struct at91_cf_data __initdata dk_cf_data = {87.det_pin = AT91_PIN_PB0,88.rst_pin = AT91_PIN_PC5,89// .irq_pin = ... not connected90// .vcc_pin = ... always powered91};9293#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD94static struct at91_mmc_data __initdata dk_mmc_data = {95.slot_b = 0,96.wire4 = 1,97};98#endif99100static struct spi_board_info dk_spi_devices[] = {101{ /* DataFlash chip */102.modalias = "mtd_dataflash",103.chip_select = 0,104.max_speed_hz = 15 * 1000 * 1000,105},106{ /* UR6HCPS2-SP40 PS2-to-SPI adapter */107.modalias = "ur6hcps2",108.chip_select = 1,109.max_speed_hz = 250 * 1000,110},111{ /* TLV1504 ADC, 4 channels, 10 bits; one is a temp sensor */112.modalias = "tlv1504",113.chip_select = 2,114.max_speed_hz = 20 * 1000 * 1000,115},116#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD117{ /* DataFlash card */118.modalias = "mtd_dataflash",119.chip_select = 3,120.max_speed_hz = 15 * 1000 * 1000,121}122#endif123};124125static struct i2c_board_info __initdata dk_i2c_devices[] = {126{127I2C_BOARD_INFO("ics1523", 0x26),128},129{130I2C_BOARD_INFO("x9429", 0x28),131},132{133I2C_BOARD_INFO("24c1024", 0x50),134}135};136137static struct mtd_partition __initdata dk_nand_partition[] = {138{139.name = "NAND Partition 1",140.offset = 0,141.size = MTDPART_SIZ_FULL,142},143};144145static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)146{147*num_partitions = ARRAY_SIZE(dk_nand_partition);148return dk_nand_partition;149}150151static struct atmel_nand_data __initdata dk_nand_data = {152.ale = 22,153.cle = 21,154.det_pin = AT91_PIN_PB1,155.rdy_pin = AT91_PIN_PC2,156// .enable_pin = ... not there157.partition_info = nand_partitions,158};159160#define DK_FLASH_BASE AT91_CHIPSELECT_0161#define DK_FLASH_SIZE SZ_2M162163static struct physmap_flash_data dk_flash_data = {164.width = 2,165};166167static struct resource dk_flash_resource = {168.start = DK_FLASH_BASE,169.end = DK_FLASH_BASE + DK_FLASH_SIZE - 1,170.flags = IORESOURCE_MEM,171};172173static struct platform_device dk_flash = {174.name = "physmap-flash",175.id = 0,176.dev = {177.platform_data = &dk_flash_data,178},179.resource = &dk_flash_resource,180.num_resources = 1,181};182183static struct gpio_led dk_leds[] = {184{185.name = "led0",186.gpio = AT91_PIN_PB2,187.active_low = 1,188.default_trigger = "heartbeat",189}190};191192static void __init dk_board_init(void)193{194/* Serial */195at91_add_device_serial();196/* Ethernet */197at91_add_device_eth(&dk_eth_data);198/* USB Host */199at91_add_device_usbh(&dk_usbh_data);200/* USB Device */201at91_add_device_udc(&dk_udc_data);202at91_set_multi_drive(dk_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */203/* Compact Flash */204at91_add_device_cf(&dk_cf_data);205/* I2C */206at91_add_device_i2c(dk_i2c_devices, ARRAY_SIZE(dk_i2c_devices));207/* SPI */208at91_add_device_spi(dk_spi_devices, ARRAY_SIZE(dk_spi_devices));209#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD210/* DataFlash card */211at91_set_gpio_output(AT91_PIN_PB7, 0);212#else213/* MMC */214at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */215at91_add_device_mmc(0, &dk_mmc_data);216#endif217/* NAND */218at91_add_device_nand(&dk_nand_data);219/* NOR Flash */220platform_device_register(&dk_flash);221/* LEDs */222at91_gpio_leds(dk_leds, ARRAY_SIZE(dk_leds));223/* VGA */224// dk_add_device_video();225}226227MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")228/* Maintainer: SAN People/Atmel */229.timer = &at91rm9200_timer,230.map_io = at91rm9200_map_io,231.init_early = dk_init_early,232.init_irq = dk_init_irq,233.init_machine = dk_board_init,234MACHINE_END235236237