Path: blob/master/arch/arm/mach-at91/board-kb9202.c
10817 views
/*1* linux/arch/arm/mach-at91/board-kb9202.c2*3* Copyright (c) 2005 kb_admin4* KwikByte, Inc.5*6* This program is free software; you can redistribute it and/or modify7* it under the terms of the GNU General Public License as published by8* the Free Software Foundation; either version 2 of the License, or9* (at your option) any later version.10*11* This program is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14* GNU General Public License for more details.15*16* You should have received a copy of the GNU General Public License17* along with this program; if not, write to the Free Software18* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19*/2021#include <linux/types.h>22#include <linux/init.h>23#include <linux/mm.h>24#include <linux/module.h>25#include <linux/platform_device.h>2627#include <mach/hardware.h>28#include <asm/setup.h>29#include <asm/mach-types.h>30#include <asm/irq.h>3132#include <asm/mach/arch.h>33#include <asm/mach/map.h>34#include <asm/mach/irq.h>3536#include <mach/board.h>37#include <mach/gpio.h>38#include <mach/cpu.h>39#include <mach/at91rm9200_mc.h>4041#include "generic.h"424344static void __init kb9202_init_early(void)45{46/* Set cpu type: PQFP */47at91rm9200_set_type(ARCH_REVISON_9200_PQFP);4849/* Initialize processor: 10 MHz crystal */50at91rm9200_initialize(10000000);5152/* Set up the LEDs */53at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18);5455/* DBGU on ttyS0. (Rx & Tx only) */56at91_register_uart(0, 0, 0);5758/* USART0 on ttyS1 (Rx & Tx only) */59at91_register_uart(AT91RM9200_ID_US0, 1, 0);6061/* USART1 on ttyS2 (Rx & Tx only) - IRDA (optional) */62at91_register_uart(AT91RM9200_ID_US1, 2, 0);6364/* USART3 on ttyS3 (Rx, Tx, CTS, RTS) - RS485 (optional) */65at91_register_uart(AT91RM9200_ID_US3, 3, ATMEL_UART_CTS | ATMEL_UART_RTS);6667/* set serial console to ttyS0 (ie, DBGU) */68at91_set_serial_console(0);69}7071static void __init kb9202_init_irq(void)72{73at91rm9200_init_interrupts(NULL);74}7576static struct at91_eth_data __initdata kb9202_eth_data = {77.phy_irq_pin = AT91_PIN_PB29,78.is_rmii = 0,79};8081static struct at91_usbh_data __initdata kb9202_usbh_data = {82.ports = 1,83};8485static struct at91_udc_data __initdata kb9202_udc_data = {86.vbus_pin = AT91_PIN_PB24,87.pullup_pin = AT91_PIN_PB22,88};8990static struct at91_mmc_data __initdata kb9202_mmc_data = {91.det_pin = AT91_PIN_PB2,92.slot_b = 0,93.wire4 = 1,94};9596static struct mtd_partition __initdata kb9202_nand_partition[] = {97{98.name = "nand_fs",99.offset = 0,100.size = MTDPART_SIZ_FULL,101},102};103104static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)105{106*num_partitions = ARRAY_SIZE(kb9202_nand_partition);107return kb9202_nand_partition;108}109110static struct atmel_nand_data __initdata kb9202_nand_data = {111.ale = 22,112.cle = 21,113// .det_pin = ... not there114.rdy_pin = AT91_PIN_PC29,115.enable_pin = AT91_PIN_PC28,116.partition_info = nand_partitions,117};118119static void __init kb9202_board_init(void)120{121/* Serial */122at91_add_device_serial();123/* Ethernet */124at91_add_device_eth(&kb9202_eth_data);125/* USB Host */126at91_add_device_usbh(&kb9202_usbh_data);127/* USB Device */128at91_add_device_udc(&kb9202_udc_data);129/* MMC */130at91_add_device_mmc(0, &kb9202_mmc_data);131/* I2C */132at91_add_device_i2c(NULL, 0);133/* SPI */134at91_add_device_spi(NULL, 0);135/* NAND */136at91_add_device_nand(&kb9202_nand_data);137}138139MACHINE_START(KB9200, "KB920x")140/* Maintainer: KwikByte, Inc. */141.timer = &at91rm9200_timer,142.map_io = at91rm9200_map_io,143.init_early = kb9202_init_early,144.init_irq = kb9202_init_irq,145.init_machine = kb9202_board_init,146MACHINE_END147148149