diff options
author | dmitry pervushin <dpervushin@embeddedalley.com> | 2009-04-22 18:57:05 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-04-27 05:28:08 -0400 |
commit | 45d9108011b9dfb4fccd6c258290d2185145709b (patch) | |
tree | c416842cd6f2a3444fc87b4b03009d0346312a55 /arch/arm/mach-stmp37xx/stmp37xx_devb.c | |
parent | 5cccd37ea15970846a93b4b01fafd6e043bafe8e (diff) |
[ARM] 5465/1: Freescale STMP platform support [7/10]
Sources: support for 37xx boards
Signed-off-by: dmitry pervushin <dpervushin@embeddedalley.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-stmp37xx/stmp37xx_devb.c')
-rw-r--r-- | arch/arm/mach-stmp37xx/stmp37xx_devb.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/arch/arm/mach-stmp37xx/stmp37xx_devb.c b/arch/arm/mach-stmp37xx/stmp37xx_devb.c new file mode 100644 index 000000000000..adfbdc7f8e27 --- /dev/null +++ b/arch/arm/mach-stmp37xx/stmp37xx_devb.c | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * Freescale STMP37XX development board support | ||
3 | * | ||
4 | * Embedded Alley Solutions, Inc <source@embeddedalley.com> | ||
5 | * | ||
6 | * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. | ||
7 | * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. | ||
8 | */ | ||
9 | |||
10 | /* | ||
11 | * The code contained herein is licensed under the GNU General Public | ||
12 | * License. You may obtain a copy of the GNU General Public License | ||
13 | * Version 2 or later at the following locations: | ||
14 | * | ||
15 | * http://www.opensource.org/licenses/gpl-license.html | ||
16 | * http://www.gnu.org/copyleft/gpl.html | ||
17 | */ | ||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/device.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <asm/setup.h> | ||
23 | #include <asm/mach-types.h> | ||
24 | #include <asm/mach/arch.h> | ||
25 | |||
26 | #include <mach/stmp3xxx.h> | ||
27 | #include <mach/pins.h> | ||
28 | #include <mach/pinmux.h> | ||
29 | #include "stmp37xx.h" | ||
30 | |||
31 | /* | ||
32 | * List of STMP37xx development board specific devices | ||
33 | */ | ||
34 | static struct platform_device *stmp37xx_devb_devices[] = { | ||
35 | &stmp3xxx_dbguart, | ||
36 | }; | ||
37 | |||
38 | static struct pin_desc dbguart_pins_0[] = { | ||
39 | { PINID_PWM0, PIN_FUN3, }, | ||
40 | { PINID_PWM1, PIN_FUN3, }, | ||
41 | }; | ||
42 | |||
43 | static struct pin_group dbguart_pins[] = { | ||
44 | [0] = { | ||
45 | .pins = dbguart_pins_0, | ||
46 | .nr_pins = ARRAY_SIZE(dbguart_pins_0), | ||
47 | }, | ||
48 | }; | ||
49 | |||
50 | static int dbguart_pins_control(int id, int request) | ||
51 | { | ||
52 | int r = 0; | ||
53 | |||
54 | if (request) | ||
55 | r = stmp3xxx_request_pin_group(&dbguart_pins[id], "debug uart"); | ||
56 | else | ||
57 | stmp3xxx_release_pin_group(&dbguart_pins[id], "debug uart"); | ||
58 | return r; | ||
59 | } | ||
60 | |||
61 | |||
62 | static void __init stmp37xx_devb_init(void) | ||
63 | { | ||
64 | stmp3xxx_pinmux_init(NR_REAL_IRQS); | ||
65 | |||
66 | /* Init STMP3xxx platform */ | ||
67 | stmp3xxx_init(); | ||
68 | |||
69 | stmp3xxx_dbguart.dev.platform_data = dbguart_pins_control; | ||
70 | /* Add STMP37xx development board devices */ | ||
71 | platform_add_devices(stmp37xx_devb_devices, | ||
72 | ARRAY_SIZE(stmp37xx_devb_devices)); | ||
73 | } | ||
74 | |||
75 | MACHINE_START(STMP37XX, "STMP37XX") | ||
76 | .phys_io = 0x80000000, | ||
77 | .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc, | ||
78 | .boot_params = 0x40000100, | ||
79 | .map_io = stmp37xx_map_io, | ||
80 | .init_irq = stmp37xx_init_irq, | ||
81 | .timer = &stmp3xxx_timer, | ||
82 | .init_machine = stmp37xx_devb_init, | ||
83 | MACHINE_END | ||