1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright 2012 Sascha Hauer, Pengutronix 4 */ 5 6 #include <linux/init.h> 7 #include <linux/irq.h> 8 #include <linux/of_irq.h> 9 #include <linux/of_platform.h> 10 #include <linux/mm.h> 11 #include <asm/mach/arch.h> 12 #include <asm/mach/map.h> 13 #include <asm/mach/time.h> 14 15 #include "common.h" 16 #include "devices/devices-common.h" 17 #include "hardware.h" 18 #include "mx27.h" 19 20 /* MX27 memory map definition */ 21 static struct map_desc imx27_io_desc[] __initdata = { 22 /* 23 * this fixed mapping covers: 24 * - AIPI1 25 * - AIPI2 26 * - AITC 27 * - ROM Patch 28 * - and some reserved space 29 */ 30 imx_map_entry(MX27, AIPI, MT_DEVICE), 31 /* 32 * this fixed mapping covers: 33 * - CSI 34 * - ATA 35 */ 36 imx_map_entry(MX27, SAHB1, MT_DEVICE), 37 /* 38 * this fixed mapping covers: 39 * - EMI 40 */ 41 imx_map_entry(MX27, X_MEMC, MT_DEVICE), 42 }; 43 44 /* 45 * Initialize the memory map. It is called during the 46 * system startup to create static physical to virtual 47 * memory map for the IO modules. 48 */ 49 static void __init mx27_map_io(void) 50 { 51 iotable_init(imx27_io_desc, ARRAY_SIZE(imx27_io_desc)); 52 } 53 54 static void __init imx27_init_early(void) 55 { 56 mxc_set_cpu_type(MXC_CPU_MX27); 57 } 58 59 static void __init mx27_init_irq(void) 60 { 61 mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR)); 62 } 63 64 static const char * const imx27_dt_board_compat[] __initconst = { 65 "fsl,imx27", 66 NULL 67 }; 68 69 DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)") 70 .map_io = mx27_map_io, 71 .init_early = imx27_init_early, 72 .init_irq = mx27_init_irq, 73 .init_late = imx27_pm_init, 74 .dt_compat = imx27_dt_board_compat, 75 MACHINE_END 76