blob: 5783bd1b6c4062f4154fa5c1510f558bb809b2f9 [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 */
14extern void __init at91rm9200_map_io(void);
15extern void __init at91sam9260_map_io(void);
16extern void __init at91sam9261_map_io(void);
17extern void __init at91sam9263_map_io(void);
18extern void __init at91sam9rl_map_io(void);
19extern void __init at91sam9g45_map_io(void);
20extern void __init at91x40_map_io(void);
21extern void __init at91cap9_map_io(void);
22extern void __init at572d940hf_map_io(void);
23
Andrew Victor2eeaaa22006-09-27 10:50:59 +010024 /* Processors */
Jean-Christophe PLAGNIOL-VILLARDe57556e32011-04-24 11:40:22 +080025extern void __init at91rm9200_set_type(int type);
26extern void __init at91rm9200_initialize(unsigned long main_clock);
Andrew Victor62c16602006-11-30 12:27:38 +010027extern void __init at91sam9260_initialize(unsigned long main_clock);
28extern void __init at91sam9261_initialize(unsigned long main_clock);
Andrew Victorb2c65612007-02-08 09:42:40 +010029extern void __init at91sam9263_initialize(unsigned long main_clock);
Andrew Victor877d7722007-05-11 20:49:56 +010030extern void __init at91sam9rl_initialize(unsigned long main_clock);
Nicolas Ferre789b23b2009-06-26 15:36:58 +010031extern void __init at91sam9g45_initialize(unsigned long main_clock);
Greg Ungerer9a7e2462007-07-30 02:39:02 +010032extern void __init at91x40_initialize(unsigned long main_clock);
Andrew Victor2b3b3512008-01-24 15:10:39 +010033extern void __init at91cap9_initialize(unsigned long main_clock);
Andrew Victor5e38efa2009-12-15 21:57:27 +010034extern void __init at572d940hf_initialize(unsigned long main_clock);
Andrew Victor2eeaaa22006-09-27 10:50:59 +010035
Andrew Victorba854e12006-07-05 17:22:52 +010036 /* Interrupts */
Andrew Victorf2173832006-09-27 13:23:00 +010037extern void __init at91rm9200_init_interrupts(unsigned int priority[]);
Andrew Victor62c16602006-11-30 12:27:38 +010038extern void __init at91sam9260_init_interrupts(unsigned int priority[]);
39extern void __init at91sam9261_init_interrupts(unsigned int priority[]);
Andrew Victorb2c65612007-02-08 09:42:40 +010040extern void __init at91sam9263_init_interrupts(unsigned int priority[]);
Andrew Victor877d7722007-05-11 20:49:56 +010041extern void __init at91sam9rl_init_interrupts(unsigned int priority[]);
Nicolas Ferre789b23b2009-06-26 15:36:58 +010042extern void __init at91sam9g45_init_interrupts(unsigned int priority[]);
Greg Ungerer9a7e2462007-07-30 02:39:02 +010043extern void __init at91x40_init_interrupts(unsigned int priority[]);
Andrew Victor2b3b3512008-01-24 15:10:39 +010044extern void __init at91cap9_init_interrupts(unsigned int priority[]);
Andrew Victor5e38efa2009-12-15 21:57:27 +010045extern void __init at572d940hf_init_interrupts(unsigned int priority[]);
Andrew Victorba854e12006-07-05 17:22:52 +010046extern void __init at91_aic_init(unsigned int priority[]);
SAN People73a59c12006-01-09 17:05:41 +000047
Andrew Victorba854e12006-07-05 17:22:52 +010048 /* Timer */
SAN People73a59c12006-01-09 17:05:41 +000049struct sys_timer;
50extern struct sys_timer at91rm9200_timer;
Andrew Victor62c16602006-11-30 12:27:38 +010051extern struct sys_timer at91sam926x_timer;
Greg Ungerer9a7e2462007-07-30 02:39:02 +010052extern struct sys_timer at91x40_timer;
SAN People73a59c12006-01-09 17:05:41 +000053
Andrew Victorba854e12006-07-05 17:22:52 +010054 /* Clocks */
SAN People73a59c12006-01-09 17:05:41 +000055extern int __init at91_clock_init(unsigned long main_clock);
Jean-Christophe PLAGNIOL-VILLARDbd602992011-02-02 07:27:07 +010056/*
57 * function to specify the clock of the default console. As we do not
58 * use the device/driver bus, the dev_name is not intialize. So we need
59 * to link the clock to a specific con_id only "usart"
60 */
61extern void __init at91rm9200_set_console_clock(int id);
62extern void __init at91sam9260_set_console_clock(int id);
63extern void __init at91sam9261_set_console_clock(int id);
64extern void __init at91sam9263_set_console_clock(int id);
65extern void __init at91sam9rl_set_console_clock(int id);
66extern void __init at91sam9g45_set_console_clock(int id);
67extern void __init at91cap9_set_console_clock(int id);
68extern void __init at572d940hf_set_console_clock(int id);
Andrew Victor907d6de2006-06-20 19:30:19 +010069struct device;
Andrew Victor907d6de2006-06-20 19:30:19 +010070
71 /* Power Management */
72extern void at91_irq_suspend(void);
73extern void at91_irq_resume(void);
74
Nicolas Ferrebb413db2010-10-14 19:14:00 +020075/* reset */
76extern void at91sam9_alt_reset(void);
77
Andrew Victorf2173832006-09-27 13:23:00 +010078 /* GPIO */
79#define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */
80#define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */
81
82struct at91_gpio_bank {
83 unsigned short id; /* peripheral ID */
84 unsigned long offset; /* offset from system peripheral base */
85 struct clk *clock; /* associated clock */
86};
87extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks);
88extern void __init at91_gpio_irq_setup(void);
Andrew Victor1f4fd0a2006-11-30 10:01:47 +010089
90extern void (*at91_arch_reset)(void);
91extern int at91_extern_irq;