Path: blob/master/arch/arm/mach-at91/board-cam60.c
10817 views
/*1* KwikByte CAM60 (KB9260)2*3* based on board-sam9260ek.c4* Copyright (C) 2005 SAN People5* Copyright (C) 2006 Atmel6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2 of the License, or10* (at your option) any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; if not, write to the Free Software19* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA20*/2122#include <linux/types.h>23#include <linux/init.h>24#include <linux/mm.h>25#include <linux/module.h>26#include <linux/platform_device.h>27#include <linux/spi/spi.h>28#include <linux/spi/flash.h>2930#include <mach/hardware.h>31#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/board.h>40#include <mach/gpio.h>41#include <mach/at91sam9_smc.h>4243#include "sam9_smc.h"44#include "generic.h"454647static void __init cam60_init_early(void)48{49/* Initialize processor: 10 MHz crystal */50at91sam9260_initialize(10000000);5152/* DBGU on ttyS0. (Rx & Tx only) */53at91_register_uart(0, 0, 0);5455/* set serial console to ttyS0 (ie, DBGU) */56at91_set_serial_console(0);57}5859static void __init cam60_init_irq(void)60{61at91sam9260_init_interrupts(NULL);62}636465/*66* USB Host67*/68static struct at91_usbh_data __initdata cam60_usbh_data = {69.ports = 1,70};717273/*74* SPI devices.75*/76#if defined(CONFIG_MTD_DATAFLASH)77static struct mtd_partition cam60_spi_partitions[] = {78{79.name = "BOOT1",80.offset = 0,81.size = 4 * 1056,82},83{84.name = "BOOT2",85.offset = MTDPART_OFS_NXTBLK,86.size = 256 * 1056,87},88{89.name = "kernel",90.offset = MTDPART_OFS_NXTBLK,91.size = 2222 * 1056,92},93{94.name = "file system",95.offset = MTDPART_OFS_NXTBLK,96.size = MTDPART_SIZ_FULL,97},98};99100static struct flash_platform_data cam60_spi_flash_platform_data = {101.name = "spi_flash",102.parts = cam60_spi_partitions,103.nr_parts = ARRAY_SIZE(cam60_spi_partitions)104};105#endif106107static struct spi_board_info cam60_spi_devices[] __initdata = {108#if defined(CONFIG_MTD_DATAFLASH)109{ /* DataFlash chip */110.modalias = "mtd_dataflash",111.chip_select = 0,112.max_speed_hz = 15 * 1000 * 1000,113.bus_num = 0,114.platform_data = &cam60_spi_flash_platform_data115},116#endif117};118119120/*121* MACB Ethernet device122*/123static struct __initdata at91_eth_data cam60_macb_data = {124.phy_irq_pin = AT91_PIN_PB5,125.is_rmii = 0,126};127128129/*130* NAND Flash131*/132static struct mtd_partition __initdata cam60_nand_partition[] = {133{134.name = "nand_fs",135.offset = 0,136.size = MTDPART_SIZ_FULL,137},138};139140static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)141{142*num_partitions = ARRAY_SIZE(cam60_nand_partition);143return cam60_nand_partition;144}145146static struct atmel_nand_data __initdata cam60_nand_data = {147.ale = 21,148.cle = 22,149// .det_pin = ... not there150.rdy_pin = AT91_PIN_PA9,151.enable_pin = AT91_PIN_PA7,152.partition_info = nand_partitions,153};154155static struct sam9_smc_config __initdata cam60_nand_smc_config = {156.ncs_read_setup = 0,157.nrd_setup = 1,158.ncs_write_setup = 0,159.nwe_setup = 1,160161.ncs_read_pulse = 3,162.nrd_pulse = 3,163.ncs_write_pulse = 3,164.nwe_pulse = 3,165166.read_cycle = 5,167.write_cycle = 5,168169.mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8,170.tdf_cycles = 2,171};172173static void __init cam60_add_device_nand(void)174{175/* configure chip-select 3 (NAND) */176sam9_smc_configure(3, &cam60_nand_smc_config);177178at91_add_device_nand(&cam60_nand_data);179}180181182static void __init cam60_board_init(void)183{184/* Serial */185at91_add_device_serial();186/* SPI */187at91_add_device_spi(cam60_spi_devices, ARRAY_SIZE(cam60_spi_devices));188/* Ethernet */189at91_add_device_eth(&cam60_macb_data);190/* USB Host */191/* enable USB power supply circuit */192at91_set_gpio_output(AT91_PIN_PB18, 1);193at91_add_device_usbh(&cam60_usbh_data);194/* NAND */195cam60_add_device_nand();196}197198MACHINE_START(CAM60, "KwikByte CAM60")199/* Maintainer: KwikByte */200.timer = &at91sam926x_timer,201.map_io = at91sam9260_map_io,202.init_early = cam60_init_early,203.init_irq = cam60_init_irq,204.init_machine = cam60_board_init,205MACHINE_END206207208