blob: a9d6ed4dbbc881a2dddbbad4e1cdf33bbfb2ea1a [file] [log] [blame]
SAN People73a59c12006-01-09 17:05:41 +00001/*
Andrew Victor9d041262007-02-05 11:42:07 +01002 * linux/arch/arm/mach-at91/generic.h
SAN People73a59c12006-01-09 17:05:41 +00003 *
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-VILLARDbd602992011-02-02 07:27:07 +010011#include <linux/clkdev.h>
12
Jean-Christophe PLAGNIOL-VILLARD1b021a32011-04-28 20:19:32 +080013 /* Map io */
Jean-Christophe PLAGNIOL-VILLARD21d08b92011-04-23 15:28:34 +080014extern void __init at91_map_io(void);
Jean-Christophe PLAGNIOL-VILLARD1b021a32011-04-28 20:19:32 +080015
Andrew Victor2eeaaa22006-09-27 10:50:59 +010016 /* Processors */
Jean-Christophe PLAGNIOL-VILLARDe57556e32011-04-24 11:40:22 +080017extern void __init at91rm9200_set_type(int type);
Jean-Christophe PLAGNIOL-VILLARD21d08b92011-04-23 15:28:34 +080018extern void __init at91_initialize(unsigned long main_clock);
Greg Ungerer9a7e2462007-07-30 02:39:02 +010019extern void __init at91x40_initialize(unsigned long main_clock);
Andrew Victor2eeaaa22006-09-27 10:50:59 +010020
Andrew Victorba854e12006-07-05 17:22:52 +010021 /* Interrupts */
Jean-Christophe PLAGNIOL-VILLARD92100c12011-04-23 15:28:34 +080022extern void __init at91_init_irq_default(void);
23extern void __init at91_init_interrupts(unsigned int priority[]);
Greg Ungerer9a7e2462007-07-30 02:39:02 +010024extern void __init at91x40_init_interrupts(unsigned int priority[]);
Andrew Victorba854e12006-07-05 17:22:52 +010025extern void __init at91_aic_init(unsigned int priority[]);
SAN People73a59c12006-01-09 17:05:41 +000026
Andrew Victorba854e12006-07-05 17:22:52 +010027 /* Timer */
SAN People73a59c12006-01-09 17:05:41 +000028struct sys_timer;
29extern struct sys_timer at91rm9200_timer;
Andrew Victor62c16602006-11-30 12:27:38 +010030extern struct sys_timer at91sam926x_timer;
Greg Ungerer9a7e2462007-07-30 02:39:02 +010031extern struct sys_timer at91x40_timer;
SAN People73a59c12006-01-09 17:05:41 +000032
Andrew Victorba854e12006-07-05 17:22:52 +010033 /* Clocks */
Jean-Christophe PLAGNIOL-VILLARDbd602992011-02-02 07:27:07 +010034/*
35 * function to specify the clock of the default console. As we do not
36 * use the device/driver bus, the dev_name is not intialize. So we need
37 * to link the clock to a specific con_id only "usart"
38 */
39extern void __init at91rm9200_set_console_clock(int id);
40extern void __init at91sam9260_set_console_clock(int id);
41extern void __init at91sam9261_set_console_clock(int id);
42extern void __init at91sam9263_set_console_clock(int id);
43extern void __init at91sam9rl_set_console_clock(int id);
44extern void __init at91sam9g45_set_console_clock(int id);
45extern void __init at91cap9_set_console_clock(int id);
Jean-Christophe PLAGNIOL-VILLARD46539372011-04-24 18:20:28 +080046#ifdef CONFIG_AT91_PMC_UNIT
47extern int __init at91_clock_init(unsigned long main_clock);
48#else
49static int inline at91_clock_init(unsigned long main_clock) { return 0; }
50#endif
Andrew Victor907d6de2006-06-20 19:30:19 +010051struct device;
Andrew Victor907d6de2006-06-20 19:30:19 +010052
53 /* Power Management */
54extern void at91_irq_suspend(void);
55extern void at91_irq_resume(void);
56
Nicolas Ferrebb413db2010-10-14 19:14:00 +020057/* reset */
58extern void at91sam9_alt_reset(void);
59
Andrew Victorf2173832006-09-27 13:23:00 +010060 /* GPIO */
61#define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */
62#define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */
63
64struct at91_gpio_bank {
65 unsigned short id; /* peripheral ID */
66 unsigned long offset; /* offset from system peripheral base */
67 struct clk *clock; /* associated clock */
68};
69extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks);
70extern void __init at91_gpio_irq_setup(void);
Andrew Victor1f4fd0a2006-11-30 10:01:47 +010071
72extern void (*at91_arch_reset)(void);
73extern int at91_extern_irq;