1 /* 2 * Setup code for AT91RM9200 3 * 4 * Copyright (C) 2011 Atmel, 5 * 2011 Nicolas Ferre <nicolas.ferre@atmel.com> 6 * 2012 Joachim Eastwood <manabian@gmail.com> 7 * 8 * Licensed under GPLv2 or later. 9 */ 10 11 #include <linux/types.h> 12 #include <linux/init.h> 13 #include <linux/module.h> 14 #include <linux/gpio.h> 15 #include <linux/of.h> 16 #include <linux/of_irq.h> 17 #include <linux/of_platform.h> 18 #include <linux/clk-provider.h> 19 20 #include <asm/setup.h> 21 #include <asm/irq.h> 22 #include <asm/mach/arch.h> 23 #include <asm/mach/map.h> 24 #include <asm/mach/irq.h> 25 #include <asm/system_misc.h> 26 27 #include <mach/at91_st.h> 28 29 #include "generic.h" 30 31 static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd) 32 { 33 /* 34 * Perform a hardware reset with the use of the Watchdog timer. 35 */ 36 at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1); 37 at91_st_write(AT91_ST_CR, AT91_ST_WDRST); 38 } 39 40 static void __init at91rm9200_dt_timer_init(void) 41 { 42 of_clk_init(NULL); 43 at91rm9200_timer_init(); 44 } 45 46 static void __init at91rm9200_dt_device_init(void) 47 { 48 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 49 50 arm_pm_idle = at91rm9200_idle; 51 arm_pm_restart = at91rm9200_restart; 52 at91rm9200_pm_init(); 53 } 54 55 56 57 static const char *at91rm9200_dt_board_compat[] __initconst = { 58 "atmel,at91rm9200", 59 NULL 60 }; 61 62 DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200") 63 .init_time = at91rm9200_dt_timer_init, 64 .map_io = at91_map_io, 65 .init_machine = at91rm9200_dt_device_init, 66 .dt_compat = at91rm9200_dt_board_compat, 67 MACHINE_END 68