blob: dccb67a9e7c4f5968668380aa55c4fcd2fdacd7b [file] [log] [blame]
Shawn Guofaff3dc2010-12-09 23:12:45 +08001/*
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 Guod1654b82012-05-06 22:14:13 +080016#include <linux/pinctrl/machine.h>
Shawn Guofaff3dc2010-12-09 23:12:45 +080017
18#include <asm/mach/map.h>
19
Fabio Estevama6d34042011-09-30 13:03:24 -030020#include <mach/mx23.h>
Shawn Guofaff3dc2010-12-09 23:12:45 +080021#include <mach/mx28.h>
22#include <mach/common.h>
23#include <mach/iomux.h>
24
25/*
Fabio Estevama6d34042011-09-30 13:03:24 -030026 * Define the MX23 memory map.
27 */
28static 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 Guofaff3dc2010-12-09 23:12:45 +080034 * Define the MX28 memory map.
35 */
36static 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 Estevama6d34042011-09-30 13:03:24 -030046void __init mx23_map_io(void)
47{
48 iotable_init(mx23_io_desc, ARRAY_SIZE(mx23_io_desc));
49}
50
51void __init mx23_init_irq(void)
52{
53 icoll_init_irq();
54}
55
Shawn Guofaff3dc2010-12-09 23:12:45 +080056void __init mx28_map_io(void)
57{
58 iotable_init(mx28_io_desc, ARRAY_SIZE(mx28_io_desc));
59}
60
61void __init mx28_init_irq(void)
62{
63 icoll_init_irq();
Shawn Guofaff3dc2010-12-09 23:12:45 +080064}
Shawn Guod1654b82012-05-06 22:14:13 +080065
66void __init mx23_soc_init(void)
67{
68 pinctrl_provide_dummies();
Dong Aishengcb1be3c2012-05-04 20:12:18 +080069
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 Guo164387d2012-05-03 23:32:52 +080072
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 Guod1654b82012-05-06 22:14:13 +080076}
77
78void __init mx28_soc_init(void)
79{
80 pinctrl_provide_dummies();
Dong Aishengcb1be3c2012-05-04 20:12:18 +080081
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 Guo164387d2012-05-03 23:32:52 +080084
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 Guod1654b82012-05-06 22:14:13 +080090}