2 * linux/arch/arm/mach-mx1/mach-scb9328.c
4 * Copyright (c) 2004 Sascha Hauer <saschahauer@web.de>
5 * Copyright (c) 2006-2008 Juergen Beisert <jbeisert@netscape.net>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
13 #include <linux/platform_device.h>
14 #include <linux/mtd/physmap.h>
15 #include <linux/interrupt.h>
16 #include <linux/dm9000.h>
17 #include <linux/gpio.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/time.h>
23 #include <mach/common.h>
24 #include <mach/hardware.h>
25 #include <mach/iomux-mx1.h>
27 #include "devices-imx1.h"
30 * This scb9328 has a 32MiB flash
32 static struct resource flash_resource
= {
33 .start
= MX1_CS0_PHYS
,
34 .end
= MX1_CS0_PHYS
+ (32 * 1024 * 1024) - 1,
35 .flags
= IORESOURCE_MEM
,
38 static struct physmap_flash_data scb_flash_data
= {
42 static struct platform_device scb_flash_device
= {
43 .name
= "physmap-flash",
46 .platform_data
= &scb_flash_data
,
48 .resource
= &flash_resource
,
53 * scb9328 has a DM9000 network controller
54 * connected to CS5, with 16 bit data path
55 * and interrupt connected to GPIO 3
59 * internal datapath is fixed 16 bit
61 static struct dm9000_plat_data dm9000_platdata
= {
62 .flags
= DM9000_PLATF_16BITONLY
,
66 * the DM9000 drivers wants two defined address spaces
67 * to gain access to address latch registers and the data path.
69 static struct resource dm9000x_resources
[] = {
71 .name
= "address area",
72 .start
= MX1_CS5_PHYS
,
73 .end
= MX1_CS5_PHYS
+ 1,
74 .flags
= IORESOURCE_MEM
, /* address access */
77 .start
= MX1_CS5_PHYS
+ 4,
78 .end
= MX1_CS5_PHYS
+ 5,
79 .flags
= IORESOURCE_MEM
, /* data access */
81 /* irq number is run-time assigned */
82 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
86 static struct platform_device dm9000x_device
= {
89 .num_resources
= ARRAY_SIZE(dm9000x_resources
),
90 .resource
= dm9000x_resources
,
92 .platform_data
= &dm9000_platdata
,
96 static const int mxc_uart1_pins
[] = {
103 static const struct imxuart_platform_data uart_pdata __initconst
= {
104 .flags
= IMXUART_HAVE_RTSCTS
,
107 static struct platform_device
*devices
[] __initdata
= {
113 * scb9328_init - Init the CPU card itself
115 static void __init
scb9328_init(void)
119 mxc_gpio_setup_multiple_pins(mxc_uart1_pins
,
120 ARRAY_SIZE(mxc_uart1_pins
), "UART1");
122 imx1_add_imx_uart0(&uart_pdata
);
124 printk(KERN_INFO
"Scb9328: Adding devices\n");
125 dm9000x_resources
[2].start
= gpio_to_irq(IMX_GPIO_NR(3, 3));
126 dm9000x_resources
[2].end
= gpio_to_irq(IMX_GPIO_NR(3, 3));
127 platform_add_devices(devices
, ARRAY_SIZE(devices
));
130 static void __init
scb9328_timer_init(void)
132 mx1_clocks_init(32000);
135 static struct sys_timer scb9328_timer
= {
136 .init
= scb9328_timer_init
,
139 MACHINE_START(SCB9328
, "Synertronixx scb9328")
142 .map_io
= mx1_map_io
,
143 .init_early
= imx1_init_early
,
144 .init_irq
= mx1_init_irq
,
145 .handle_irq
= imx1_handle_irq
,
146 .timer
= &scb9328_timer
,
147 .init_machine
= scb9328_init
,
148 .restart
= mxc_restart
,