Path: blob/master/arch/arm/mach-at91/board-csb637.c
10817 views
/*1* linux/arch/arm/mach-at91/board-csb637.c2*3* Copyright (C) 2005 SAN People4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA18*/1920#include <linux/types.h>21#include <linux/init.h>22#include <linux/mm.h>23#include <linux/module.h>24#include <linux/platform_device.h>25#include <linux/mtd/physmap.h>2627#include <asm/setup.h>28#include <asm/mach-types.h>29#include <asm/irq.h>3031#include <asm/mach/arch.h>32#include <asm/mach/map.h>33#include <asm/mach/irq.h>3435#include <mach/hardware.h>36#include <mach/board.h>37#include <mach/gpio.h>3839#include "generic.h"404142static void __init csb637_init_early(void)43{44/* Initialize processor: 3.6864 MHz crystal */45at91rm9200_initialize(3686400);4647/* DBGU on ttyS0. (Rx & Tx only) */48at91_register_uart(0, 0, 0);4950/* make console=ttyS0 (ie, DBGU) the default */51at91_set_serial_console(0);52}5354static void __init csb637_init_irq(void)55{56at91rm9200_init_interrupts(NULL);57}5859static struct at91_eth_data __initdata csb637_eth_data = {60.phy_irq_pin = AT91_PIN_PC0,61.is_rmii = 0,62};6364static struct at91_usbh_data __initdata csb637_usbh_data = {65.ports = 2,66};6768static struct at91_udc_data __initdata csb637_udc_data = {69.vbus_pin = AT91_PIN_PB28,70.pullup_pin = AT91_PIN_PB1,71};7273#define CSB_FLASH_BASE AT91_CHIPSELECT_074#define CSB_FLASH_SIZE SZ_16M7576static struct mtd_partition csb_flash_partitions[] = {77{78.name = "uMON flash",79.offset = 0,80.size = MTDPART_SIZ_FULL,81.mask_flags = MTD_WRITEABLE, /* read only */82}83};8485static struct physmap_flash_data csb_flash_data = {86.width = 2,87.parts = csb_flash_partitions,88.nr_parts = ARRAY_SIZE(csb_flash_partitions),89};9091static struct resource csb_flash_resources[] = {92{93.start = CSB_FLASH_BASE,94.end = CSB_FLASH_BASE + CSB_FLASH_SIZE - 1,95.flags = IORESOURCE_MEM,96}97};9899static struct platform_device csb_flash = {100.name = "physmap-flash",101.id = 0,102.dev = {103.platform_data = &csb_flash_data,104},105.resource = csb_flash_resources,106.num_resources = ARRAY_SIZE(csb_flash_resources),107};108109static struct gpio_led csb_leds[] = {110{ /* "d1", red */111.name = "d1",112.gpio = AT91_PIN_PB2,113.active_low = 1,114.default_trigger = "heartbeat",115},116};117118static void __init csb637_board_init(void)119{120/* LED(s) */121at91_gpio_leds(csb_leds, ARRAY_SIZE(csb_leds));122/* Serial */123at91_add_device_serial();124/* Ethernet */125at91_add_device_eth(&csb637_eth_data);126/* USB Host */127at91_add_device_usbh(&csb637_usbh_data);128/* USB Device */129at91_add_device_udc(&csb637_udc_data);130/* I2C */131at91_add_device_i2c(NULL, 0);132/* SPI */133at91_add_device_spi(NULL, 0);134/* NOR flash */135platform_device_register(&csb_flash);136}137138MACHINE_START(CSB637, "Cogent CSB637")139/* Maintainer: Bill Gatliff */140.timer = &at91rm9200_timer,141.map_io = at91rm9200_map_io,142.init_early = csb637_init_early,143.init_irq = csb637_init_irq,144.init_machine = csb637_board_init,145MACHINE_END146147148