diff options
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r-- | arch/arm/mach-mxs/Makefile | 6 | ||||
-rw-r--r-- | arch/arm/mach-mxs/include/mach/gpio.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-mxs/include/mach/mxs.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-mxs/mach-mx23evk.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-mxs/mach-mx28evk.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-mxs/mach-stmp378x_devb.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-mxs/mm-mx28.c | 44 | ||||
-rw-r--r-- | arch/arm/mach-mxs/mm.c (renamed from arch/arm/mach-mxs/mm-mx23.c) | 19 |
8 files changed, 35 insertions, 66 deletions
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile index 6c38262a3aaa..ea8dcb7742bc 100644 --- a/arch/arm/mach-mxs/Makefile +++ b/arch/arm/mach-mxs/Makefile | |||
@@ -1,11 +1,11 @@ | |||
1 | # Common support | 1 | # Common support |
2 | obj-y := clock.o devices.o icoll.o iomux.o system.o timer.o | 2 | obj-y := clock.o devices.o icoll.o iomux.o system.o timer.o mm.o |
3 | 3 | ||
4 | obj-$(CONFIG_MXS_OCOTP) += ocotp.o | 4 | obj-$(CONFIG_MXS_OCOTP) += ocotp.o |
5 | obj-$(CONFIG_PM) += pm.o | 5 | obj-$(CONFIG_PM) += pm.o |
6 | 6 | ||
7 | obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o | 7 | obj-$(CONFIG_SOC_IMX23) += clock-mx23.o |
8 | obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o | 8 | obj-$(CONFIG_SOC_IMX28) += clock-mx28.o |
9 | 9 | ||
10 | obj-$(CONFIG_MACH_STMP378X_DEVB) += mach-stmp378x_devb.o | 10 | obj-$(CONFIG_MACH_STMP378X_DEVB) += mach-stmp378x_devb.o |
11 | obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o | 11 | obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o |
diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h index 828ccccb6aad..56025aa0a639 100644 --- a/arch/arm/mach-mxs/include/mach/gpio.h +++ b/arch/arm/mach-mxs/include/mach/gpio.h | |||
@@ -22,14 +22,10 @@ | |||
22 | 22 | ||
23 | #include <asm-generic/gpio.h> | 23 | #include <asm-generic/gpio.h> |
24 | 24 | ||
25 | #define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr)) | ||
26 | |||
27 | /* use gpiolib dispatchers */ | 25 | /* use gpiolib dispatchers */ |
28 | #define gpio_get_value __gpio_get_value | 26 | #define gpio_get_value __gpio_get_value |
29 | #define gpio_set_value __gpio_set_value | 27 | #define gpio_set_value __gpio_set_value |
30 | #define gpio_cansleep __gpio_cansleep | 28 | #define gpio_cansleep __gpio_cansleep |
31 | #define gpio_to_irq __gpio_to_irq | 29 | #define gpio_to_irq __gpio_to_irq |
32 | 30 | ||
33 | #define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START) | ||
34 | |||
35 | #endif /* __MACH_MXS_GPIO_H__ */ | 31 | #endif /* __MACH_MXS_GPIO_H__ */ |
diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h index 35a89dd27242..5aa5f754c846 100644 --- a/arch/arm/mach-mxs/include/mach/mxs.h +++ b/arch/arm/mach-mxs/include/mach/mxs.h | |||
@@ -86,6 +86,8 @@ | |||
86 | .type = _type, \ | 86 | .type = _type, \ |
87 | } | 87 | } |
88 | 88 | ||
89 | #define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr)) | ||
90 | |||
89 | #define MXS_SET_ADDR 0x4 | 91 | #define MXS_SET_ADDR 0x4 |
90 | #define MXS_CLR_ADDR 0x8 | 92 | #define MXS_CLR_ADDR 0x8 |
91 | #define MXS_TOG_ADDR 0xc | 93 | #define MXS_TOG_ADDR 0xc |
diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c index 8fa2290f37f8..69e218de536e 100644 --- a/arch/arm/mach-mxs/mach-mx23evk.c +++ b/arch/arm/mach-mxs/mach-mx23evk.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
18 | #include <linux/irq.h> | ||
19 | 18 | ||
20 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
21 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c index d0f1ea7c0655..0173c3bce4ef 100644 --- a/arch/arm/mach-mxs/mach-mx28evk.c +++ b/arch/arm/mach-mxs/mach-mx28evk.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
18 | #include <linux/leds.h> | 18 | #include <linux/leds.h> |
19 | #include <linux/irq.h> | ||
20 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
21 | 20 | ||
22 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
@@ -352,6 +351,11 @@ static struct mxs_mmc_platform_data mx28evk_mmc_pdata[] __initdata = { | |||
352 | }, | 351 | }, |
353 | }; | 352 | }; |
354 | 353 | ||
354 | static struct gpio mx28evk_lcd_gpios[] = { | ||
355 | { MX28EVK_LCD_ENABLE, GPIOF_OUT_INIT_HIGH, "lcd-enable" }, | ||
356 | { MX28EVK_BL_ENABLE, GPIOF_OUT_INIT_HIGH, "bl-enable" }, | ||
357 | }; | ||
358 | |||
355 | static void __init mx28evk_init(void) | 359 | static void __init mx28evk_init(void) |
356 | { | 360 | { |
357 | int ret; | 361 | int ret; |
@@ -378,19 +382,12 @@ static void __init mx28evk_init(void) | |||
378 | mx28_add_flexcan(1, &mx28evk_flexcan_pdata[1]); | 382 | mx28_add_flexcan(1, &mx28evk_flexcan_pdata[1]); |
379 | } | 383 | } |
380 | 384 | ||
381 | ret = gpio_request_one(MX28EVK_LCD_ENABLE, GPIOF_DIR_OUT, "lcd-enable"); | 385 | ret = gpio_request_array(mx28evk_lcd_gpios, |
386 | ARRAY_SIZE(mx28evk_lcd_gpios)); | ||
382 | if (ret) | 387 | if (ret) |
383 | pr_warn("failed to request gpio lcd-enable: %d\n", ret); | 388 | pr_warn("failed to request gpio pins for lcd: %d\n", ret); |
384 | else | 389 | else |
385 | gpio_set_value(MX28EVK_LCD_ENABLE, 1); | 390 | mx28_add_mxsfb(&mx28evk_mxsfb_pdata); |
386 | |||
387 | ret = gpio_request_one(MX28EVK_BL_ENABLE, GPIOF_DIR_OUT, "bl-enable"); | ||
388 | if (ret) | ||
389 | pr_warn("failed to request gpio bl-enable: %d\n", ret); | ||
390 | else | ||
391 | gpio_set_value(MX28EVK_BL_ENABLE, 1); | ||
392 | |||
393 | mx28_add_mxsfb(&mx28evk_mxsfb_pdata); | ||
394 | 391 | ||
395 | /* power on mmc slot by writing 0 to the gpio */ | 392 | /* power on mmc slot by writing 0 to the gpio */ |
396 | ret = gpio_request_one(MX28EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW, | 393 | ret = gpio_request_one(MX28EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW, |
@@ -403,7 +400,8 @@ static void __init mx28evk_init(void) | |||
403 | "mmc1-slot-power"); | 400 | "mmc1-slot-power"); |
404 | if (ret) | 401 | if (ret) |
405 | pr_warn("failed to request gpio mmc1-slot-power: %d\n", ret); | 402 | pr_warn("failed to request gpio mmc1-slot-power: %d\n", ret); |
406 | mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]); | 403 | else |
404 | mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]); | ||
407 | 405 | ||
408 | gpio_led_register_device(0, &mx28evk_led_data); | 406 | gpio_led_register_device(0, &mx28evk_led_data); |
409 | } | 407 | } |
diff --git a/arch/arm/mach-mxs/mach-stmp378x_devb.c b/arch/arm/mach-mxs/mach-stmp378x_devb.c index 7f38d82b69af..3fe5dd532145 100644 --- a/arch/arm/mach-mxs/mach-stmp378x_devb.c +++ b/arch/arm/mach-mxs/mach-stmp378x_devb.c | |||
@@ -19,7 +19,6 @@ | |||
19 | 19 | ||
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <linux/irq.h> | ||
23 | #include <linux/spi/spi.h> | 22 | #include <linux/spi/spi.h> |
24 | 23 | ||
25 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
diff --git a/arch/arm/mach-mxs/mm-mx28.c b/arch/arm/mach-mxs/mm-mx28.c deleted file mode 100644 index b6e18ddb92c0..000000000000 --- a/arch/arm/mach-mxs/mm-mx28.c +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * The code contained herein is licensed under the GNU General Public | ||
5 | * License. You may obtain a copy of the GNU General Public License | ||
6 | * Version 2 or later at the following locations: | ||
7 | * | ||
8 | * http://www.opensource.org/licenses/gpl-license.html | ||
9 | * http://www.gnu.org/copyleft/gpl.html | ||
10 | * | ||
11 | * Create static mapping between physical to virtual memory. | ||
12 | */ | ||
13 | |||
14 | #include <linux/mm.h> | ||
15 | #include <linux/init.h> | ||
16 | |||
17 | #include <asm/mach/map.h> | ||
18 | |||
19 | #include <mach/mx28.h> | ||
20 | #include <mach/common.h> | ||
21 | #include <mach/iomux.h> | ||
22 | |||
23 | /* | ||
24 | * Define the MX28 memory map. | ||
25 | */ | ||
26 | static struct map_desc mx28_io_desc[] __initdata = { | ||
27 | mxs_map_entry(MX28, OCRAM, MT_DEVICE), | ||
28 | mxs_map_entry(MX28, IO, MT_DEVICE), | ||
29 | }; | ||
30 | |||
31 | /* | ||
32 | * This function initializes the memory map. It is called during the | ||
33 | * system startup to create static physical to virtual memory mappings | ||
34 | * for the IO modules. | ||
35 | */ | ||
36 | void __init mx28_map_io(void) | ||
37 | { | ||
38 | iotable_init(mx28_io_desc, ARRAY_SIZE(mx28_io_desc)); | ||
39 | } | ||
40 | |||
41 | void __init mx28_init_irq(void) | ||
42 | { | ||
43 | icoll_init_irq(); | ||
44 | } | ||
diff --git a/arch/arm/mach-mxs/mm-mx23.c b/arch/arm/mach-mxs/mm.c index 1b2345ac1a87..50af5ceebf6d 100644 --- a/arch/arm/mach-mxs/mm-mx23.c +++ b/arch/arm/mach-mxs/mm.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/mach/map.h> | 17 | #include <asm/mach/map.h> |
18 | 18 | ||
19 | #include <mach/mx23.h> | 19 | #include <mach/mx23.h> |
20 | #include <mach/mx28.h> | ||
20 | #include <mach/common.h> | 21 | #include <mach/common.h> |
21 | #include <mach/iomux.h> | 22 | #include <mach/iomux.h> |
22 | 23 | ||
@@ -29,6 +30,14 @@ static struct map_desc mx23_io_desc[] __initdata = { | |||
29 | }; | 30 | }; |
30 | 31 | ||
31 | /* | 32 | /* |
33 | * Define the MX28 memory map. | ||
34 | */ | ||
35 | static struct map_desc mx28_io_desc[] __initdata = { | ||
36 | mxs_map_entry(MX28, OCRAM, MT_DEVICE), | ||
37 | mxs_map_entry(MX28, IO, MT_DEVICE), | ||
38 | }; | ||
39 | |||
40 | /* | ||
32 | * This function initializes the memory map. It is called during the | 41 | * This function initializes the memory map. It is called during the |
33 | * system startup to create static physical to virtual memory mappings | 42 | * system startup to create static physical to virtual memory mappings |
34 | * for the IO modules. | 43 | * for the IO modules. |
@@ -42,3 +51,13 @@ void __init mx23_init_irq(void) | |||
42 | { | 51 | { |
43 | icoll_init_irq(); | 52 | icoll_init_irq(); |
44 | } | 53 | } |
54 | |||
55 | void __init mx28_map_io(void) | ||
56 | { | ||
57 | iotable_init(mx28_io_desc, ARRAY_SIZE(mx28_io_desc)); | ||
58 | } | ||
59 | |||
60 | void __init mx28_init_irq(void) | ||
61 | { | ||
62 | icoll_init_irq(); | ||
63 | } | ||