2 * Copyright (C) 2012 Altera Corporation
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.
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.
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/>.
17 #include <linux/dw_apb_timer.h>
18 #include <linux/of_irq.h>
19 #include <linux/of_platform.h>
21 #include <asm/hardware/cache-l2x0.h>
22 #include <asm/hardware/gic.h>
23 #include <asm/mach/arch.h>
25 extern void socfpga_init_clocks(void);
27 const static struct of_device_id irq_match
[] = {
28 { .compatible
= "arm,cortex-a9-gic", .data
= gic_of_init
, },
32 static void __init
gic_init_irq(void)
34 of_irq_init(irq_match
);
37 static void socfpga_cyclone5_restart(char mode
, const char *cmd
)
42 static void __init
socfpga_cyclone5_init(void)
44 l2x0_of_init(0, ~0UL);
45 of_platform_populate(NULL
, of_default_bus_match_table
, NULL
, NULL
);
46 socfpga_init_clocks();
49 static const char *altera_dt_match
[] = {
51 "altr,socfpga-cyclone5",
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
,