Commit | Line | Data |
---|---|---|
24205632 | 1 | /* |
95c00464 | 2 | * linux/arch/arm/mach-mx1/mach-scb9328.c |
24205632 SH |
3 | * |
4 | * Copyright (c) 2004 Sascha Hauer <saschahauer@web.de> | |
5 | * Copyright (c) 2006-2008 Juergen Beisert <jbeisert@netscape.net> | |
6 | * | |
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. | |
10 | * | |
11 | */ | |
12 | ||
13 | #include <linux/platform_device.h> | |
14 | #include <linux/mtd/physmap.h> | |
15 | #include <linux/interrupt.h> | |
16 | #include <linux/dm9000.h> | |
438196c3 | 17 | #include <linux/gpio.h> |
24205632 SH |
18 | |
19 | #include <asm/mach-types.h> | |
20 | #include <asm/mach/arch.h> | |
21 | #include <asm/mach/time.h> | |
22 | ||
e3372474 | 23 | #include "common.h" |
d112f4e4 | 24 | #include "devices-imx1.h" |
50f2de61 | 25 | #include "hardware.h" |
267dd34c | 26 | #include "iomux-mx1.h" |
24205632 SH |
27 | |
28 | /* | |
29 | * This scb9328 has a 32MiB flash | |
30 | */ | |
31 | static struct resource flash_resource = { | |
05a3185c UKK |
32 | .start = MX1_CS0_PHYS, |
33 | .end = MX1_CS0_PHYS + (32 * 1024 * 1024) - 1, | |
24205632 SH |
34 | .flags = IORESOURCE_MEM, |
35 | }; | |
36 | ||
37 | static struct physmap_flash_data scb_flash_data = { | |
38 | .width = 2, | |
39 | }; | |
40 | ||
41 | static struct platform_device scb_flash_device = { | |
42 | .name = "physmap-flash", | |
43 | .id = 0, | |
44 | .dev = { | |
45 | .platform_data = &scb_flash_data, | |
46 | }, | |
47 | .resource = &flash_resource, | |
48 | .num_resources = 1, | |
49 | }; | |
50 | ||
51 | /* | |
52 | * scb9328 has a DM9000 network controller | |
53 | * connected to CS5, with 16 bit data path | |
54 | * and interrupt connected to GPIO 3 | |
55 | */ | |
56 | ||
57 | /* | |
58 | * internal datapath is fixed 16 bit | |
59 | */ | |
60 | static struct dm9000_plat_data dm9000_platdata = { | |
61 | .flags = DM9000_PLATF_16BITONLY, | |
62 | }; | |
63 | ||
64 | /* | |
65 | * the DM9000 drivers wants two defined address spaces | |
66 | * to gain access to address latch registers and the data path. | |
67 | */ | |
68 | static struct resource dm9000x_resources[] = { | |
9b0e6db0 | 69 | { |
24205632 | 70 | .name = "address area", |
05a3185c UKK |
71 | .start = MX1_CS5_PHYS, |
72 | .end = MX1_CS5_PHYS + 1, | |
9b0e6db0 SH |
73 | .flags = IORESOURCE_MEM, /* address access */ |
74 | }, { | |
24205632 | 75 | .name = "data area", |
05a3185c UKK |
76 | .start = MX1_CS5_PHYS + 4, |
77 | .end = MX1_CS5_PHYS + 5, | |
9b0e6db0 SH |
78 | .flags = IORESOURCE_MEM, /* data access */ |
79 | }, { | |
438196c3 | 80 | /* irq number is run-time assigned */ |
9b0e6db0 | 81 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
24205632 SH |
82 | }, |
83 | }; | |
84 | ||
85 | static struct platform_device dm9000x_device = { | |
86 | .name = "dm9000", | |
87 | .id = 0, | |
88 | .num_resources = ARRAY_SIZE(dm9000x_resources), | |
89 | .resource = dm9000x_resources, | |
90 | .dev = { | |
91 | .platform_data = &dm9000_platdata, | |
92 | } | |
93 | }; | |
94 | ||
6c80ee51 | 95 | static const int mxc_uart1_pins[] = { |
24205632 SH |
96 | PC9_PF_UART1_CTS, |
97 | PC10_PF_UART1_RTS, | |
98 | PC11_PF_UART1_TXD, | |
99 | PC12_PF_UART1_RXD, | |
100 | }; | |
101 | ||
d112f4e4 | 102 | static const struct imxuart_platform_data uart_pdata __initconst = { |
24205632 SH |
103 | .flags = IMXUART_HAVE_RTSCTS, |
104 | }; | |
105 | ||
106 | static struct platform_device *devices[] __initdata = { | |
107 | &scb_flash_device, | |
108 | &dm9000x_device, | |
109 | }; | |
110 | ||
111 | /* | |
112 | * scb9328_init - Init the CPU card itself | |
113 | */ | |
114 | static void __init scb9328_init(void) | |
115 | { | |
b78d8e59 SG |
116 | imx1_soc_init(); |
117 | ||
31b738a4 FE |
118 | mxc_gpio_setup_multiple_pins(mxc_uart1_pins, |
119 | ARRAY_SIZE(mxc_uart1_pins), "UART1"); | |
120 | ||
d112f4e4 | 121 | imx1_add_imx_uart0(&uart_pdata); |
24205632 SH |
122 | |
123 | printk(KERN_INFO"Scb9328: Adding devices\n"); | |
438196c3 SG |
124 | dm9000x_resources[2].start = gpio_to_irq(IMX_GPIO_NR(3, 3)); |
125 | dm9000x_resources[2].end = gpio_to_irq(IMX_GPIO_NR(3, 3)); | |
24205632 SH |
126 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
127 | } | |
128 | ||
129 | static void __init scb9328_timer_init(void) | |
130 | { | |
131 | mx1_clocks_init(32000); | |
132 | } | |
133 | ||
24205632 | 134 | MACHINE_START(SCB9328, "Synertronixx scb9328") |
3dac2196 | 135 | /* Sascha Hauer */ |
dc8f1907 | 136 | .atag_offset = 100, |
3dac2196 UKK |
137 | .map_io = mx1_map_io, |
138 | .init_early = imx1_init_early, | |
139 | .init_irq = mx1_init_irq, | |
6bb27d73 | 140 | .init_time = scb9328_timer_init, |
3dac2196 | 141 | .init_machine = scb9328_init, |
65ea7884 | 142 | .restart = mxc_restart, |
24205632 | 143 | MACHINE_END |