David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2012 Sascha Hauer, Pengutronix |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <linux/irq.h> |
| 7 | #include <linux/of_address.h> |
| 8 | #include <linux/of_irq.h> |
| 9 | #include <linux/of_platform.h> |
| 10 | #include <asm/mach/arch.h> |
| 11 | #include <asm/mach/time.h> |
| 12 | #include "common.h" |
| 13 | #include "hardware.h" |
| 14 | |
| 15 | static void __init imx25_init_early(void) |
| 16 | { |
| 17 | mxc_set_cpu_type(MXC_CPU_MX25); |
| 18 | } |
| 19 | |
| 20 | static void __init imx25_dt_init(void) |
| 21 | { |
| 22 | imx_aips_allow_unprivileged_access("fsl,imx25-aips"); |
| 23 | } |
| 24 | |
| 25 | static void __init mx25_init_irq(void) |
| 26 | { |
| 27 | struct device_node *np; |
| 28 | void __iomem *avic_base; |
| 29 | |
| 30 | np = of_find_compatible_node(NULL, NULL, "fsl,avic"); |
| 31 | avic_base = of_iomap(np, 0); |
| 32 | BUG_ON(!avic_base); |
| 33 | mxc_init_irq(avic_base); |
| 34 | } |
| 35 | |
| 36 | static const char * const imx25_dt_board_compat[] __initconst = { |
| 37 | "fsl,imx25", |
| 38 | NULL |
| 39 | }; |
| 40 | |
| 41 | DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)") |
| 42 | .init_early = imx25_init_early, |
| 43 | .init_machine = imx25_dt_init, |
| 44 | .init_late = imx25_pm_init, |
| 45 | .init_irq = mx25_init_irq, |
| 46 | .dt_compat = imx25_dt_board_compat, |
| 47 | MACHINE_END |