2 * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
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:
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
11 * Create static mapping between physical to virtual memory.
15 #include <linux/init.h>
17 #include <asm/mach/map.h>
19 #include <mach/hardware.h>
20 #include <mach/common.h>
21 #include <mach/iomux-v3.h>
24 * Define the MX51 memory map.
26 static struct map_desc mxc_io_desc[] __initdata = {
28 .virtual = MX51_IRAM_BASE_ADDR_VIRT,
29 .pfn = __phys_to_pfn(MX51_IRAM_BASE_ADDR),
30 .length = MX51_IRAM_SIZE,
33 .virtual = MX51_DEBUG_BASE_ADDR_VIRT,
34 .pfn = __phys_to_pfn(MX51_DEBUG_BASE_ADDR),
35 .length = MX51_DEBUG_SIZE,
38 .virtual = MX51_AIPS1_BASE_ADDR_VIRT,
39 .pfn = __phys_to_pfn(MX51_AIPS1_BASE_ADDR),
40 .length = MX51_AIPS1_SIZE,
43 .virtual = MX51_SPBA0_BASE_ADDR_VIRT,
44 .pfn = __phys_to_pfn(MX51_SPBA0_BASE_ADDR),
45 .length = MX51_SPBA0_SIZE,
48 .virtual = MX51_AIPS2_BASE_ADDR_VIRT,
49 .pfn = __phys_to_pfn(MX51_AIPS2_BASE_ADDR),
50 .length = MX51_AIPS2_SIZE,
56 * This function initializes the memory map. It is called during the
57 * system startup to create static physical to virtual memory mappings
60 void __init mx51_map_io(void)
62 mxc_set_cpu_type(MXC_CPU_MX51);
63 mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR));
64 mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG_BASE_ADDR));
65 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
68 int imx51_register_gpios(void);
70 void __init mx51_init_irq(void)
72 unsigned long tzic_addr;
73 void __iomem *tzic_virt;
75 if (mx51_revision() < MX51_CHIP_REV_2_0)
76 tzic_addr = MX51_TZIC_BASE_ADDR_TO1;
78 tzic_addr = MX51_TZIC_BASE_ADDR;
80 tzic_virt = ioremap(tzic_addr, SZ_16K);
82 panic("unable to map TZIC interrupt controller\n");
84 tzic_init_irq(tzic_virt);
85 imx51_register_gpios();