~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-mxs/mach-mxs.c

Version: ~ [ linux-5.5-rc7 ] ~ [ linux-5.4.13 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.97 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.166 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.210 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.210 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.81 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright 2012 Freescale Semiconductor, Inc.
  3  * Copyright 2012 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 
 13 #include <linux/clk.h>
 14 #include <linux/clkdev.h>
 15 #include <linux/err.h>
 16 #include <linux/init.h>
 17 #include <linux/init.h>
 18 #include <linux/irqdomain.h>
 19 #include <linux/of_irq.h>
 20 #include <linux/of_platform.h>
 21 #include <asm/mach/arch.h>
 22 #include <asm/mach/time.h>
 23 #include <mach/common.h>
 24 
 25 static int __init mxs_icoll_add_irq_domain(struct device_node *np,
 26                                 struct device_node *interrupt_parent)
 27 {
 28         irq_domain_add_legacy(np, 128, 0, 0, &irq_domain_simple_ops, NULL);
 29 
 30         return 0;
 31 }
 32 
 33 static int __init mxs_gpio_add_irq_domain(struct device_node *np,
 34                                 struct device_node *interrupt_parent)
 35 {
 36         static int gpio_irq_base = MXS_GPIO_IRQ_START;
 37 
 38         irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops, NULL);
 39         gpio_irq_base += 32;
 40 
 41         return 0;
 42 }
 43 
 44 static const struct of_device_id mxs_irq_match[] __initconst = {
 45         { .compatible = "fsl,mxs-icoll", .data = mxs_icoll_add_irq_domain, },
 46         { .compatible = "fsl,mxs-gpio", .data = mxs_gpio_add_irq_domain, },
 47         { /* sentinel */ }
 48 };
 49 
 50 static void __init mxs_dt_init_irq(void)
 51 {
 52         icoll_init_irq();
 53         of_irq_init(mxs_irq_match);
 54 }
 55 
 56 static void __init imx23_timer_init(void)
 57 {
 58         mx23_clocks_init();
 59 }
 60 
 61 static struct sys_timer imx23_timer = {
 62         .init = imx23_timer_init,
 63 };
 64 
 65 static void __init imx28_timer_init(void)
 66 {
 67         mx28_clocks_init();
 68 }
 69 
 70 static struct sys_timer imx28_timer = {
 71         .init = imx28_timer_init,
 72 };
 73 
 74 static void __init imx28_evk_init(void)
 75 {
 76         struct clk *clk;
 77 
 78         /* Enable fec phy clock */
 79         clk = clk_get_sys("enet_out", NULL);
 80         if (!IS_ERR(clk))
 81                 clk_prepare_enable(clk);
 82 }
 83 
 84 static void __init mxs_machine_init(void)
 85 {
 86         if (of_machine_is_compatible("fsl,imx28-evk"))
 87                 imx28_evk_init();
 88 
 89         of_platform_populate(NULL, of_default_bus_match_table,
 90                                 NULL, NULL);
 91 }
 92 
 93 static const char *imx23_dt_compat[] __initdata = {
 94         "fsl,imx23-evk",
 95         "fsl,imx23",
 96         NULL,
 97 };
 98 
 99 static const char *imx28_dt_compat[] __initdata = {
100         "fsl,imx28-evk",
101         "fsl,imx28",
102         NULL,
103 };
104 
105 DT_MACHINE_START(IMX23, "Freescale i.MX23 (Device Tree)")
106         .map_io         = mx23_map_io,
107         .init_irq       = mxs_dt_init_irq,
108         .timer          = &imx23_timer,
109         .init_machine   = mxs_machine_init,
110         .dt_compat      = imx23_dt_compat,
111         .restart        = mxs_restart,
112 MACHINE_END
113 
114 DT_MACHINE_START(IMX28, "Freescale i.MX28 (Device Tree)")
115         .map_io         = mx28_map_io,
116         .init_irq       = mxs_dt_init_irq,
117         .timer          = &imx28_timer,
118         .init_machine   = mxs_machine_init,
119         .dt_compat      = imx28_dt_compat,
120         .restart        = mxs_restart,
121 MACHINE_END
122 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp