Path: blob/master/arch/arm/mach-imx/mach-apf9328.c
10817 views
/*1* linux/arch/arm/mach-imx/mach-apf9328.c2*3* Copyright (c) 2005-2011 ARMadeus systems <[email protected]>4*5* This work is based on mach-scb9328.c which is:6* Copyright (c) 2004 Sascha Hauer <[email protected]>7* Copyright (c) 2006-2008 Juergen Beisert <[email protected]>8*9* This program is free software; you can redistribute it and/or modify10* it under the terms of the GNU General Public License version 2 as11* published by the Free Software Foundation.12*13*/1415#include <linux/init.h>16#include <linux/kernel.h>17#include <linux/platform_device.h>18#include <linux/mtd/physmap.h>19#include <linux/dm9000.h>2021#include <asm/mach-types.h>22#include <asm/mach/arch.h>23#include <asm/mach/time.h>2425#include <mach/common.h>26#include <mach/hardware.h>27#include <mach/irqs.h>28#include <mach/iomux-mx1.h>2930#include "devices-imx1.h"3132static const int apf9328_pins[] __initconst = {33/* UART1 */34PC9_PF_UART1_CTS,35PC10_PF_UART1_RTS,36PC11_PF_UART1_TXD,37PC12_PF_UART1_RXD,38/* UART2 */39PB28_PF_UART2_CTS,40PB29_PF_UART2_RTS,41PB30_PF_UART2_TXD,42PB31_PF_UART2_RXD,43};4445/*46* The APF9328 can have up to 32MB NOR Flash47*/48static struct resource flash_resource = {49.start = MX1_CS0_PHYS,50.end = MX1_CS0_PHYS + SZ_32M - 1,51.flags = IORESOURCE_MEM,52};5354static struct physmap_flash_data apf9328_flash_data = {55.width = 2,56};5758static struct platform_device apf9328_flash_device = {59.name = "physmap-flash",60.id = 0,61.dev = {62.platform_data = &apf9328_flash_data,63},64.resource = &flash_resource,65.num_resources = 1,66};6768/*69* APF9328 has a DM9000 Ethernet controller70*/71static struct dm9000_plat_data dm9000_setup = {72.flags = DM9000_PLATF_16BITONLY73};7475static struct resource dm9000_resources[] = {76{77.start = MX1_CS4_PHYS + 0x00C00000,78.end = MX1_CS4_PHYS + 0x00C00001,79.flags = IORESOURCE_MEM,80}, {81.start = MX1_CS4_PHYS + 0x00C00002,82.end = MX1_CS4_PHYS + 0x00C00003,83.flags = IORESOURCE_MEM,84}, {85.start = IRQ_GPIOB(14),86.end = IRQ_GPIOB(14),87.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,88},89};9091static struct platform_device dm9000x_device = {92.name = "dm9000",93.id = 0,94.num_resources = ARRAY_SIZE(dm9000_resources),95.resource = dm9000_resources,96.dev = {97.platform_data = &dm9000_setup,98}99};100101/* --- SERIAL RESSOURCE --- */102static const struct imxuart_platform_data uart0_pdata __initconst = {103.flags = 0,104};105106static const struct imxuart_platform_data uart1_pdata __initconst = {107.flags = IMXUART_HAVE_RTSCTS,108};109110static struct platform_device *devices[] __initdata = {111&apf9328_flash_device,112&dm9000x_device,113};114115static void __init apf9328_init(void)116{117mxc_gpio_setup_multiple_pins(apf9328_pins,118ARRAY_SIZE(apf9328_pins),119"APF9328");120121imx1_add_imx_uart0(&uart0_pdata);122imx1_add_imx_uart1(&uart1_pdata);123124platform_add_devices(devices, ARRAY_SIZE(devices));125}126127static void __init apf9328_timer_init(void)128{129mx1_clocks_init(32768);130}131132static struct sys_timer apf9328_timer = {133.init = apf9328_timer_init,134};135136MACHINE_START(APF9328, "Armadeus APF9328")137/* Maintainer: Gwenhael Goavec-Merou, ARMadeus Systems */138.map_io = mx1_map_io,139.init_early = imx1_init_early,140.init_irq = mx1_init_irq,141.timer = &apf9328_timer,142.init_machine = apf9328_init,143MACHINE_END144145146