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