Shawn Guo | faff3dc | 2010-12-09 23:12:45 +0800 | [diff] [blame] | 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> |
Shawn Guo | d1654b8 | 2012-05-06 22:14:13 +0800 | [diff] [blame] | 16 | #include <linux/pinctrl/machine.h> |
Shawn Guo | faff3dc | 2010-12-09 23:12:45 +0800 | [diff] [blame] | 17 | |
| 18 | #include <asm/mach/map.h> |
| 19 | |
Fabio Estevam | a6d3404 | 2011-09-30 13:03:24 -0300 | [diff] [blame] | 20 | #include <mach/mx23.h> |
Shawn Guo | faff3dc | 2010-12-09 23:12:45 +0800 | [diff] [blame] | 21 | #include <mach/mx28.h> |
| 22 | #include <mach/common.h> |
| 23 | #include <mach/iomux.h> |
| 24 | |
| 25 | /* |
Fabio Estevam | a6d3404 | 2011-09-30 13:03:24 -0300 | [diff] [blame] | 26 | * Define the MX23 memory map. |
| 27 | */ |
| 28 | static struct map_desc mx23_io_desc[] __initdata = { |
| 29 | mxs_map_entry(MX23, OCRAM, MT_DEVICE), |
| 30 | mxs_map_entry(MX23, IO, MT_DEVICE), |
| 31 | }; |
| 32 | |
| 33 | /* |
Shawn Guo | faff3dc | 2010-12-09 23:12:45 +0800 | [diff] [blame] | 34 | * Define the MX28 memory map. |
| 35 | */ |
| 36 | static struct map_desc mx28_io_desc[] __initdata = { |
| 37 | mxs_map_entry(MX28, OCRAM, MT_DEVICE), |
| 38 | mxs_map_entry(MX28, IO, MT_DEVICE), |
| 39 | }; |
| 40 | |
| 41 | /* |
| 42 | * This function initializes the memory map. It is called during the |
| 43 | * system startup to create static physical to virtual memory mappings |
| 44 | * for the IO modules. |
| 45 | */ |
Fabio Estevam | a6d3404 | 2011-09-30 13:03:24 -0300 | [diff] [blame] | 46 | void __init mx23_map_io(void) |
| 47 | { |
| 48 | iotable_init(mx23_io_desc, ARRAY_SIZE(mx23_io_desc)); |
| 49 | } |
| 50 | |
| 51 | void __init mx23_init_irq(void) |
| 52 | { |
| 53 | icoll_init_irq(); |
| 54 | } |
| 55 | |
Shawn Guo | faff3dc | 2010-12-09 23:12:45 +0800 | [diff] [blame] | 56 | void __init mx28_map_io(void) |
| 57 | { |
| 58 | iotable_init(mx28_io_desc, ARRAY_SIZE(mx28_io_desc)); |
| 59 | } |
| 60 | |
| 61 | void __init mx28_init_irq(void) |
| 62 | { |
| 63 | icoll_init_irq(); |
Shawn Guo | faff3dc | 2010-12-09 23:12:45 +0800 | [diff] [blame] | 64 | } |
Shawn Guo | d1654b8 | 2012-05-06 22:14:13 +0800 | [diff] [blame] | 65 | |
| 66 | void __init mx23_soc_init(void) |
| 67 | { |
| 68 | pinctrl_provide_dummies(); |
Dong Aisheng | cb1be3c | 2012-05-04 20:12:18 +0800 | [diff] [blame] | 69 | |
| 70 | mxs_add_dma("imx23-dma-apbh", MX23_APBH_DMA_BASE_ADDR); |
| 71 | mxs_add_dma("imx23-dma-apbx", MX23_APBX_DMA_BASE_ADDR); |
Shawn Guo | 164387d | 2012-05-03 23:32:52 +0800 | [diff] [blame] | 72 | |
| 73 | mxs_add_gpio("imx23-gpio", 0, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO0); |
| 74 | mxs_add_gpio("imx23-gpio", 1, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO1); |
| 75 | mxs_add_gpio("imx23-gpio", 2, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO2); |
Shawn Guo | d1654b8 | 2012-05-06 22:14:13 +0800 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | void __init mx28_soc_init(void) |
| 79 | { |
| 80 | pinctrl_provide_dummies(); |
Dong Aisheng | cb1be3c | 2012-05-04 20:12:18 +0800 | [diff] [blame] | 81 | |
| 82 | mxs_add_dma("imx28-dma-apbh", MX23_APBH_DMA_BASE_ADDR); |
| 83 | mxs_add_dma("imx28-dma-apbx", MX23_APBX_DMA_BASE_ADDR); |
Shawn Guo | 164387d | 2012-05-03 23:32:52 +0800 | [diff] [blame] | 84 | |
| 85 | mxs_add_gpio("imx28-gpio", 0, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO0); |
| 86 | mxs_add_gpio("imx28-gpio", 1, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO1); |
| 87 | mxs_add_gpio("imx28-gpio", 2, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO2); |
| 88 | mxs_add_gpio("imx28-gpio", 3, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO3); |
| 89 | mxs_add_gpio("imx28-gpio", 4, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO4); |
Shawn Guo | d1654b8 | 2012-05-06 22:14:13 +0800 | [diff] [blame] | 90 | } |