Path: blob/master/arch/arm/mach-davinci/board-sffsdr.c
10699 views
/*1* Lyrtech SFFSDR board support.2*3* Copyright (C) 2008 Philip Balister, OpenSDR <[email protected]>4* Copyright (C) 2008 Lyrtech <www.lyrtech.com>5*6* Based on DV-EVM platform, original copyright follows:7*8* Copyright (C) 2007 MontaVista Software, Inc.9*10* This program is free software; you can redistribute it and/or modify11* it under the terms of the GNU General Public License as published by12* the Free Software Foundation; either version 2 of the License, or13* (at your option) any later version.14*15* This program is distributed in the hope that it will be useful,16* but WITHOUT ANY WARRANTY; without even the implied warranty of17* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the18* GNU General Public License for more details.19*20* You should have received a copy of the GNU General Public License21* along with this program; if not, write to the Free Software22* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.23*/2425#include <linux/init.h>26#include <linux/platform_device.h>27#include <linux/i2c.h>28#include <linux/i2c/at24.h>29#include <linux/mtd/mtd.h>30#include <linux/mtd/nand.h>31#include <linux/mtd/partitions.h>3233#include <asm/mach-types.h>34#include <asm/mach/arch.h>35#include <asm/mach/flash.h>3637#include <mach/dm644x.h>38#include <mach/common.h>39#include <mach/i2c.h>40#include <mach/serial.h>41#include <mach/mux.h>42#include <mach/usb.h>4344#define SFFSDR_PHY_ID "0:01"45static struct mtd_partition davinci_sffsdr_nandflash_partition[] = {46/* U-Boot Environment: Block 047* UBL: Block 148* U-Boot: Blocks 6-7 (256 kb)49* Integrity Kernel: Blocks 8-31 (3 Mb)50* Integrity Data: Blocks 100-END51*/52{53.name = "Linux Kernel",54.offset = 32 * SZ_128K,55.size = 16 * SZ_128K, /* 2 Mb */56.mask_flags = MTD_WRITEABLE, /* Force read-only */57},58{59.name = "Linux ROOT",60.offset = MTDPART_OFS_APPEND,61.size = 256 * SZ_128K, /* 32 Mb */62.mask_flags = 0, /* R/W */63},64};6566static struct flash_platform_data davinci_sffsdr_nandflash_data = {67.parts = davinci_sffsdr_nandflash_partition,68.nr_parts = ARRAY_SIZE(davinci_sffsdr_nandflash_partition),69};7071static struct resource davinci_sffsdr_nandflash_resource[] = {72{73.start = DM644X_ASYNC_EMIF_DATA_CE0_BASE,74.end = DM644X_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1,75.flags = IORESOURCE_MEM,76}, {77.start = DM644X_ASYNC_EMIF_CONTROL_BASE,78.end = DM644X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,79.flags = IORESOURCE_MEM,80},81};8283static struct platform_device davinci_sffsdr_nandflash_device = {84.name = "davinci_nand", /* Name of driver */85.id = 0,86.dev = {87.platform_data = &davinci_sffsdr_nandflash_data,88},89.num_resources = ARRAY_SIZE(davinci_sffsdr_nandflash_resource),90.resource = davinci_sffsdr_nandflash_resource,91};9293static struct at24_platform_data eeprom_info = {94.byte_len = (64*1024) / 8,95.page_size = 32,96.flags = AT24_FLAG_ADDR16,97};9899static struct i2c_board_info __initdata i2c_info[] = {100{101I2C_BOARD_INFO("24lc64", 0x50),102.platform_data = &eeprom_info,103},104/* Other I2C devices:105* MSP430, addr 0x23 (not used)106* PCA9543, addr 0x70 (setup done by U-Boot)107* ADS7828, addr 0x48 (ADC for voltage monitoring.)108*/109};110111static struct davinci_i2c_platform_data i2c_pdata = {112.bus_freq = 20 /* kHz */,113.bus_delay = 100 /* usec */,114};115116static void __init sffsdr_init_i2c(void)117{118davinci_init_i2c(&i2c_pdata);119i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));120}121122static struct platform_device *davinci_sffsdr_devices[] __initdata = {123&davinci_sffsdr_nandflash_device,124};125126static struct davinci_uart_config uart_config __initdata = {127.enabled_uarts = (1 << 0),128};129130static void __init davinci_sffsdr_map_io(void)131{132dm644x_init();133}134135static __init void davinci_sffsdr_init(void)136{137struct davinci_soc_info *soc_info = &davinci_soc_info;138139platform_add_devices(davinci_sffsdr_devices,140ARRAY_SIZE(davinci_sffsdr_devices));141sffsdr_init_i2c();142davinci_serial_init(&uart_config);143soc_info->emac_pdata->phy_id = SFFSDR_PHY_ID;144davinci_setup_usb(0, 0); /* We support only peripheral mode. */145146/* mux VLYNQ pins */147davinci_cfg_reg(DM644X_VLYNQEN);148davinci_cfg_reg(DM644X_VLYNQWD);149}150151MACHINE_START(SFFSDR, "Lyrtech SFFSDR")152/* Maintainer: Hugo Villeneuve [email protected] */153.boot_params = (DAVINCI_DDR_BASE + 0x100),154.map_io = davinci_sffsdr_map_io,155.init_irq = davinci_irq_init,156.timer = &davinci_timer,157.init_machine = davinci_sffsdr_init,158MACHINE_END159160161