xref: /linux/arch/arm/mach-socfpga/socfpga.c (revision 08ec212c0f92cbf30e3ecc7349f18151714041d6)
1 /*
2  *  Copyright (C) 2012 Altera Corporation
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 as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 #include <linux/dw_apb_timer.h>
18 #include <linux/of_irq.h>
19 #include <linux/of_platform.h>
20 
21 #include <asm/hardware/cache-l2x0.h>
22 #include <asm/hardware/gic.h>
23 #include <asm/mach/arch.h>
24 
25 extern void socfpga_init_clocks(void);
26 
27 const static struct of_device_id irq_match[] = {
28 	{ .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
29 	{}
30 };
31 
32 static void __init gic_init_irq(void)
33 {
34 	of_irq_init(irq_match);
35 }
36 
37 static void socfpga_cyclone5_restart(char mode, const char *cmd)
38 {
39 	/* TODO: */
40 }
41 
42 static void __init socfpga_cyclone5_init(void)
43 {
44 	l2x0_of_init(0, ~0UL);
45 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
46 	socfpga_init_clocks();
47 }
48 
49 static const char *altera_dt_match[] = {
50 	"altr,socfpga",
51 	"altr,socfpga-cyclone5",
52 	NULL
53 };
54 
55 DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA")
56 	.init_irq	= gic_init_irq,
57 	.handle_irq     = gic_handle_irq,
58 	.timer		= &dw_apb_timer,
59 	.init_machine	= socfpga_cyclone5_init,
60 	.restart	= socfpga_cyclone5_restart,
61 	.dt_compat	= altera_dt_match,
62 MACHINE_END
63