Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved. |
| 3 | * Copyright 2011 Linaro Ltd. |
| 4 | * |
| 5 | * The code contained herein is licensed under the GNU General Public |
| 6 | * License. You may obtain a copy of the GNU General Public License |
| 7 | * Version 2 or later at the following locations: |
| 8 | * |
| 9 | * http://www.opensource.org/licenses/gpl-license.html |
| 10 | * http://www.gnu.org/copyleft/gpl.html |
| 11 | */ |
| 12 | |
Shawn Guo | 394025ef | 2012-05-11 13:09:45 +0800 | [diff] [blame] | 13 | #include <linux/clk.h> |
| 14 | #include <linux/clkdev.h> |
| 15 | #include <linux/err.h> |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 16 | #include <linux/io.h> |
| 17 | #include <linux/irq.h> |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 18 | #include <linux/of_irq.h> |
| 19 | #include <linux/of_platform.h> |
| 20 | #include <asm/mach/arch.h> |
| 21 | #include <asm/mach/time.h> |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 22 | |
Shawn Guo | e337247 | 2012-09-13 21:01:00 +0800 | [diff] [blame] | 23 | #include "common.h" |
Shawn Guo | 18cb680 | 2013-05-10 09:13:44 +0800 | [diff] [blame] | 24 | #include "hardware.h" |
Shawn Guo | 50f2de6 | 2012-09-14 14:14:45 +0800 | [diff] [blame] | 25 | #include "mx53.h" |
Shawn Guo | e337247 | 2012-09-13 21:01:00 +0800 | [diff] [blame] | 26 | |
Shawn Guo | 394025ef | 2012-05-11 13:09:45 +0800 | [diff] [blame] | 27 | static void __init imx53_qsb_init(void) |
| 28 | { |
| 29 | struct clk *clk; |
| 30 | |
| 31 | clk = clk_get_sys(NULL, "ssi_ext1"); |
| 32 | if (IS_ERR(clk)) { |
| 33 | pr_err("failed to get clk ssi_ext1\n"); |
| 34 | return; |
| 35 | } |
| 36 | |
| 37 | clk_register_clkdev(clk, NULL, "0-000a"); |
| 38 | } |
| 39 | |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 40 | static void __init imx53_dt_init(void) |
| 41 | { |
Shawn Guo | c1e31d1 | 2013-05-10 10:19:01 +0800 | [diff] [blame^] | 42 | mxc_arch_reset_init_dt(); |
Shawn Guo | 18cb680 | 2013-05-10 09:13:44 +0800 | [diff] [blame] | 43 | |
Shawn Guo | 394025ef | 2012-05-11 13:09:45 +0800 | [diff] [blame] | 44 | if (of_machine_is_compatible("fsl,imx53-qsb")) |
| 45 | imx53_qsb_init(); |
| 46 | |
Fabio Estevam | f40f38d | 2012-11-21 13:43:05 -0200 | [diff] [blame] | 47 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 48 | } |
| 49 | |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 50 | static const char *imx53_dt_board_compat[] __initdata = { |
Sascha Hauer | 3f8976d | 2012-02-17 12:07:00 +0100 | [diff] [blame] | 51 | "fsl,imx53", |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 52 | NULL |
| 53 | }; |
| 54 | |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 55 | static void __init imx53_timer_init(void) |
| 56 | { |
| 57 | mx53_clocks_init_dt(); |
| 58 | } |
| 59 | |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 60 | DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)") |
| 61 | .map_io = mx53_map_io, |
| 62 | .init_early = imx53_init_early, |
| 63 | .init_irq = mx53_init_irq, |
| 64 | .handle_irq = imx53_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 65 | .init_time = imx53_timer_init, |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 66 | .init_machine = imx53_dt_init, |
Robert Lee | aa96a18 | 2012-05-21 17:50:27 -0500 | [diff] [blame] | 67 | .init_late = imx53_init_late, |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 68 | .dt_compat = imx53_dt_board_compat, |
Russell King | 65ea788 | 2011-11-06 17:12:08 +0000 | [diff] [blame] | 69 | .restart = mxc_restart, |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 70 | MACHINE_END |