1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#include <linux/mm.h>
22#include <linux/init.h>
23#include <linux/pinctrl/machine.h>
24#include <asm/pgtable.h>
25#include <asm/mach/map.h>
26
27#include "common.h"
28#include "devices/devices-common.h"
29#include "hardware.h"
30#include "iomux-v1.h"
31
32
33static struct map_desc imx21_io_desc[] __initdata = {
34
35
36
37
38
39
40
41
42 imx_map_entry(MX21, AIPI, MT_DEVICE),
43
44
45
46
47
48 imx_map_entry(MX21, SAHB1, MT_DEVICE),
49
50
51
52
53 imx_map_entry(MX21, X_MEMC, MT_DEVICE),
54};
55
56
57
58
59
60
61void __init mx21_map_io(void)
62{
63 iotable_init(imx21_io_desc, ARRAY_SIZE(imx21_io_desc));
64}
65
66void __init imx21_init_early(void)
67{
68 mxc_set_cpu_type(MXC_CPU_MX21);
69 imx_iomuxv1_init(MX21_IO_ADDRESS(MX21_GPIO_BASE_ADDR),
70 MX21_NUM_GPIO_PORT);
71}
72
73void __init mx21_init_irq(void)
74{
75 mxc_init_irq(MX21_IO_ADDRESS(MX21_AVIC_BASE_ADDR));
76}
77
78static const struct resource imx21_audmux_res[] __initconst = {
79 DEFINE_RES_MEM(MX21_AUDMUX_BASE_ADDR, SZ_4K),
80};
81
82void __init imx21_soc_init(void)
83{
84 mxc_arch_reset_init(MX21_IO_ADDRESS(MX21_WDOG_BASE_ADDR));
85 mxc_device_init();
86
87 mxc_register_gpio("imx21-gpio", 0, MX21_GPIO1_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
88 mxc_register_gpio("imx21-gpio", 1, MX21_GPIO2_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
89 mxc_register_gpio("imx21-gpio", 2, MX21_GPIO3_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
90 mxc_register_gpio("imx21-gpio", 3, MX21_GPIO4_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
91 mxc_register_gpio("imx21-gpio", 4, MX21_GPIO5_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
92 mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
93
94 pinctrl_provide_dummies();
95 imx_add_imx_dma("imx21-dma", MX21_DMA_BASE_ADDR,
96 MX21_INT_DMACH0, 0);
97 platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res,
98 ARRAY_SIZE(imx21_audmux_res));
99}
100