Sascha Hauer | ef4bac5 | 2012-09-20 14:59:36 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Sascha Hauer, Pengutronix |
| 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 | |
| 12 | #include <linux/irq.h> |
Fabio Estevam | 6869a22 | 2015-03-13 10:31:55 -0300 | [diff] [blame] | 13 | #include <linux/of_address.h> |
Sascha Hauer | ef4bac5 | 2012-09-20 14:59:36 +0200 | [diff] [blame] | 14 | #include <linux/of_irq.h> |
| 15 | #include <linux/of_platform.h> |
| 16 | #include <asm/mach/arch.h> |
| 17 | #include <asm/mach/time.h> |
| 18 | #include "common.h" |
Fabio Estevam | 6869a22 | 2015-03-13 10:31:55 -0300 | [diff] [blame] | 19 | #include "hardware.h" |
| 20 | |
| 21 | static void __init imx25_init_early(void) |
| 22 | { |
| 23 | mxc_set_cpu_type(MXC_CPU_MX25); |
| 24 | } |
| 25 | |
Martin Kaiser | 24bb244 | 2017-04-03 21:47:05 +0200 | [diff] [blame] | 26 | static void __init imx25_dt_init(void) |
| 27 | { |
| 28 | imx_aips_allow_unprivileged_access("fsl,imx25-aips"); |
| 29 | } |
| 30 | |
Fabio Estevam | 6869a22 | 2015-03-13 10:31:55 -0300 | [diff] [blame] | 31 | static void __init mx25_init_irq(void) |
| 32 | { |
| 33 | struct device_node *np; |
| 34 | void __iomem *avic_base; |
| 35 | |
| 36 | np = of_find_compatible_node(NULL, NULL, "fsl,avic"); |
| 37 | avic_base = of_iomap(np, 0); |
| 38 | BUG_ON(!avic_base); |
| 39 | mxc_init_irq(avic_base); |
| 40 | } |
Sascha Hauer | ef4bac5 | 2012-09-20 14:59:36 +0200 | [diff] [blame] | 41 | |
Sascha Hauer | ef4bac5 | 2012-09-20 14:59:36 +0200 | [diff] [blame] | 42 | static const char * const imx25_dt_board_compat[] __initconst = { |
| 43 | "fsl,imx25", |
| 44 | NULL |
| 45 | }; |
| 46 | |
| 47 | DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)") |
Sascha Hauer | ef4bac5 | 2012-09-20 14:59:36 +0200 | [diff] [blame] | 48 | .init_early = imx25_init_early, |
Martin Kaiser | 24bb244 | 2017-04-03 21:47:05 +0200 | [diff] [blame] | 49 | .init_machine = imx25_dt_init, |
Fabio Estevam | 8c4300c | 2016-02-02 19:45:38 -0200 | [diff] [blame] | 50 | .init_late = imx25_pm_init, |
Sascha Hauer | ef4bac5 | 2012-09-20 14:59:36 +0200 | [diff] [blame] | 51 | .init_irq = mx25_init_irq, |
Sascha Hauer | ef4bac5 | 2012-09-20 14:59:36 +0200 | [diff] [blame] | 52 | .dt_compat = imx25_dt_board_compat, |
Sascha Hauer | ef4bac5 | 2012-09-20 14:59:36 +0200 | [diff] [blame] | 53 | MACHINE_END |