Shawn Guo | d9654dc | 2014-05-13 21:46:16 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Freescale Semiconductor, Inc. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | */ |
| 8 | |
| 9 | #include <linux/irqchip.h> |
| 10 | #include <linux/of_platform.h> |
| 11 | #include <asm/mach/arch.h> |
| 12 | #include <asm/mach/map.h> |
| 13 | |
| 14 | #include "common.h" |
Anson Huang | a25d67a | 2014-06-20 13:44:05 +0800 | [diff] [blame] | 15 | #include "cpuidle.h" |
Shawn Guo | d9654dc | 2014-05-13 21:46:16 +0800 | [diff] [blame] | 16 | |
| 17 | static void __init imx6sx_init_machine(void) |
| 18 | { |
| 19 | struct device *parent; |
| 20 | |
| 21 | mxc_arch_reset_init_dt(); |
| 22 | |
| 23 | parent = imx_soc_device_init(); |
| 24 | if (parent == NULL) |
| 25 | pr_warn("failed to initialize soc device\n"); |
| 26 | |
| 27 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); |
| 28 | |
| 29 | imx_anatop_init(); |
Anson Huang | ff843d6 | 2014-06-20 13:20:54 +0800 | [diff] [blame] | 30 | imx6sx_pm_init(); |
Shawn Guo | d9654dc | 2014-05-13 21:46:16 +0800 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | static void __init imx6sx_init_irq(void) |
| 34 | { |
| 35 | imx_init_revision_from_anatop(); |
| 36 | imx_init_l2cache(); |
| 37 | imx_src_init(); |
| 38 | imx_gpc_init(); |
| 39 | irqchip_init(); |
| 40 | } |
| 41 | |
Anson Huang | a25d67a | 2014-06-20 13:44:05 +0800 | [diff] [blame] | 42 | static void __init imx6sx_init_late(void) |
| 43 | { |
| 44 | imx6q_cpuidle_init(); |
Anson Huang | 47526e4 | 2014-06-25 17:10:12 +0800 | [diff] [blame] | 45 | |
| 46 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) |
| 47 | platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); |
Anson Huang | a25d67a | 2014-06-20 13:44:05 +0800 | [diff] [blame] | 48 | } |
| 49 | |
Shawn Guo | 8756dd9 | 2014-07-01 16:03:00 +0800 | [diff] [blame] | 50 | static const char * const imx6sx_dt_compat[] __initconst = { |
Shawn Guo | d9654dc | 2014-05-13 21:46:16 +0800 | [diff] [blame] | 51 | "fsl,imx6sx", |
| 52 | NULL, |
| 53 | }; |
| 54 | |
| 55 | DT_MACHINE_START(IMX6SX, "Freescale i.MX6 SoloX (Device Tree)") |
| 56 | .map_io = debug_ll_io_init, |
| 57 | .init_irq = imx6sx_init_irq, |
| 58 | .init_machine = imx6sx_init_machine, |
| 59 | .dt_compat = imx6sx_dt_compat, |
Anson Huang | a25d67a | 2014-06-20 13:44:05 +0800 | [diff] [blame] | 60 | .init_late = imx6sx_init_late, |
Shawn Guo | d9654dc | 2014-05-13 21:46:16 +0800 | [diff] [blame] | 61 | .restart = mxc_restart, |
| 62 | MACHINE_END |