SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 1 | /* |
Andrew Victor | 9d04126 | 2007-02-05 11:42:07 +0100 | [diff] [blame] | 2 | * linux/arch/arm/mach-at91/generic.h |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2005 David Brownell |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | */ |
| 10 | |
Jean-Christophe PLAGNIOL-VILLARD | bd60299 | 2011-02-02 07:27:07 +0100 | [diff] [blame] | 11 | #include <linux/clkdev.h> |
Nicolas Ferre | 8014d6f | 2012-02-14 18:08:14 +0100 | [diff] [blame] | 12 | #include <linux/of.h> |
Jean-Christophe PLAGNIOL-VILLARD | bd60299 | 2011-02-02 07:27:07 +0100 | [diff] [blame] | 13 | |
Jean-Christophe PLAGNIOL-VILLARD | 1b021a3 | 2011-04-28 20:19:32 +0800 | [diff] [blame] | 14 | /* Map io */ |
Jean-Christophe PLAGNIOL-VILLARD | 21d08b9 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 15 | extern void __init at91_map_io(void); |
Jean-Christophe PLAGNIOL-VILLARD | f0051d8 | 2011-05-10 03:20:09 +0800 | [diff] [blame] | 16 | extern void __init at91_init_sram(int bank, unsigned long base, |
| 17 | unsigned int length); |
Jean-Christophe PLAGNIOL-VILLARD | 1b021a3 | 2011-04-28 20:19:32 +0800 | [diff] [blame] | 18 | |
Andrew Victor | 2eeaaa2 | 2006-09-27 10:50:59 +0100 | [diff] [blame] | 19 | /* Processors */ |
Jean-Christophe PLAGNIOL-VILLARD | e57556e3 | 2011-04-24 11:40:22 +0800 | [diff] [blame] | 20 | extern void __init at91rm9200_set_type(int type); |
Jean-Christophe PLAGNIOL-VILLARD | 21d08b9 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 21 | extern void __init at91_initialize(unsigned long main_clock); |
Greg Ungerer | 9a7e246 | 2007-07-30 02:39:02 +0100 | [diff] [blame] | 22 | extern void __init at91x40_initialize(unsigned long main_clock); |
Joachim Eastwood | 397f8c3 | 2012-10-28 18:31:09 +0000 | [diff] [blame] | 23 | extern void __init at91rm9200_dt_initialize(void); |
Jean-Christophe PLAGNIOL-VILLARD | 2b11ea5 | 2012-02-28 13:57:51 +0800 | [diff] [blame] | 24 | extern void __init at91_dt_initialize(void); |
Andrew Victor | 2eeaaa2 | 2006-09-27 10:50:59 +0100 | [diff] [blame] | 25 | |
Andrew Victor | ba854e1 | 2006-07-05 17:22:52 +0100 | [diff] [blame] | 26 | /* Interrupts */ |
Jean-Christophe PLAGNIOL-VILLARD | 92100c1 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 27 | extern void __init at91_init_irq_default(void); |
| 28 | extern void __init at91_init_interrupts(unsigned int priority[]); |
Greg Ungerer | 9a7e246 | 2007-07-30 02:39:02 +0100 | [diff] [blame] | 29 | extern void __init at91x40_init_interrupts(unsigned int priority[]); |
Nicolas Ferre | 738a0fd | 2012-10-24 16:09:57 +0200 | [diff] [blame] | 30 | extern void __init at91_aic_init(unsigned int priority[], |
| 31 | unsigned int ext_irq_mask); |
Nicolas Ferre | 8014d6f | 2012-02-14 18:08:14 +0100 | [diff] [blame] | 32 | extern int __init at91_aic_of_init(struct device_node *node, |
| 33 | struct device_node *parent); |
Ludovic Desroches | c4b6852 | 2012-05-30 10:01:09 +0200 | [diff] [blame] | 34 | extern int __init at91_aic5_of_init(struct device_node *node, |
| 35 | struct device_node *parent); |
Nicolas Ferre | 8014d6f | 2012-02-14 18:08:14 +0100 | [diff] [blame] | 36 | |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 37 | |
Andrew Victor | ba854e1 | 2006-07-05 17:22:52 +0100 | [diff] [blame] | 38 | /* Timer */ |
Jean-Christophe PLAGNIOL-VILLARD | 5e9cf5e | 2012-02-20 11:07:39 +0100 | [diff] [blame] | 39 | extern void at91rm9200_ioremap_st(u32 addr); |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 40 | extern void at91rm9200_timer_init(void); |
Jean-Christophe PLAGNIOL-VILLARD | 4ab0c599 | 2011-09-18 22:29:50 +0800 | [diff] [blame] | 41 | extern void at91sam926x_ioremap_pit(u32 addr); |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 42 | extern void at91sam926x_pit_init(void); |
| 43 | extern void at91x40_timer_init(void); |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 44 | |
Andrew Victor | ba854e1 | 2006-07-05 17:22:52 +0100 | [diff] [blame] | 45 | /* Clocks */ |
Jean-Christophe PLAGNIOL-VILLARD | 4653937 | 2011-04-24 18:20:28 +0800 | [diff] [blame] | 46 | #ifdef CONFIG_AT91_PMC_UNIT |
| 47 | extern int __init at91_clock_init(unsigned long main_clock); |
Jean-Christophe PLAGNIOL-VILLARD | eb5e76f | 2012-03-02 20:44:23 +0800 | [diff] [blame] | 48 | extern int __init at91_dt_clock_init(void); |
Jean-Christophe PLAGNIOL-VILLARD | 4653937 | 2011-04-24 18:20:28 +0800 | [diff] [blame] | 49 | #else |
| 50 | static int inline at91_clock_init(unsigned long main_clock) { return 0; } |
| 51 | #endif |
Andrew Victor | 907d6de | 2006-06-20 19:30:19 +0100 | [diff] [blame] | 52 | struct device; |
Andrew Victor | 907d6de | 2006-06-20 19:30:19 +0100 | [diff] [blame] | 53 | |
| 54 | /* Power Management */ |
| 55 | extern void at91_irq_suspend(void); |
| 56 | extern void at91_irq_resume(void); |
| 57 | |
Jean-Christophe PLAGNIOL-VILLARD | 0d78171 | 2012-02-05 20:25:32 +0800 | [diff] [blame] | 58 | /* idle */ |
| 59 | extern void at91sam9_idle(void); |
| 60 | |
Nicolas Ferre | bb413db | 2010-10-14 19:14:00 +0200 | [diff] [blame] | 61 | /* reset */ |
Jean-Christophe PLAGNIOL-VILLARD | e9f68b5 | 2011-11-18 01:25:52 +0800 | [diff] [blame] | 62 | extern void at91_ioremap_rstc(u32 base_addr); |
Russell King | 1b2073e | 2011-11-03 09:53:29 +0000 | [diff] [blame] | 63 | extern void at91sam9_alt_restart(char, const char *); |
Jean-Christophe PLAGNIOL-VILLARD | 14f991a | 2011-11-18 01:41:28 +0800 | [diff] [blame] | 64 | extern void at91sam9g45_restart(char, const char *); |
Nicolas Ferre | bb413db | 2010-10-14 19:14:00 +0200 | [diff] [blame] | 65 | |
Jean-Christophe PLAGNIOL-VILLARD | f22deee | 2011-11-01 01:23:20 +0800 | [diff] [blame] | 66 | /* shutdown */ |
| 67 | extern void at91_ioremap_shdwc(u32 base_addr); |
| 68 | |
Jean-Christophe PLAGNIOL-VILLARD | 4342d64 | 2011-11-27 23:15:50 +0800 | [diff] [blame] | 69 | /* Matrix */ |
| 70 | extern void at91_ioremap_matrix(u32 base_addr); |
| 71 | |
Jean-Christophe PLAGNIOL-VILLARD | f363c40 | 2012-02-13 12:58:53 +0800 | [diff] [blame] | 72 | /* Ram Controler */ |
| 73 | extern void at91_ioremap_ramc(int id, u32 addr, u32 size); |
| 74 | |
Andrew Victor | f217383 | 2006-09-27 13:23:00 +0100 | [diff] [blame] | 75 | /* GPIO */ |
| 76 | #define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */ |
| 77 | #define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */ |
| 78 | |
| 79 | struct at91_gpio_bank { |
| 80 | unsigned short id; /* peripheral ID */ |
Jean-Christophe PLAGNIOL-VILLARD | 80e91cb | 2011-09-16 23:37:50 +0800 | [diff] [blame] | 81 | unsigned long regbase; /* offset from system peripheral base */ |
Andrew Victor | f217383 | 2006-09-27 13:23:00 +0100 | [diff] [blame] | 82 | }; |
| 83 | extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks); |
| 84 | extern void __init at91_gpio_irq_setup(void); |
Nicolas Ferre | 8014d6f | 2012-02-14 18:08:14 +0100 | [diff] [blame] | 85 | extern int __init at91_gpio_of_irq_setup(struct device_node *node, |
| 86 | struct device_node *parent); |
Andrew Victor | 1f4fd0a | 2006-11-30 10:01:47 +0100 | [diff] [blame] | 87 | |
Jean-Christophe PLAGNIOL-VILLARD | 546c830 | 2013-06-01 16:40:11 +0200 | [diff] [blame] | 88 | extern u32 at91_get_extern_irq(void); |