17
17
#include <asm/mach/arch.h>
18
18
#include <asm/mach/map.h>
19
19
#include <mach/cpu.h>
20
#include <mach/at91_dbgu.h>
20
21
#include <mach/at91sam9260.h>
21
22
#include <mach/at91_pmc.h>
22
23
#include <mach/at91_rstc.h>
23
24
#include <mach/at91_shdwc.h>
25
27
#include "generic.h"
28
static struct map_desc at91sam9260_io_desc[] __initdata = {
30
.virtual = AT91_VA_BASE_SYS,
31
.pfn = __phys_to_pfn(AT91_BASE_SYS),
37
static struct map_desc at91sam9260_sram_desc[] __initdata = {
39
.virtual = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE,
40
.pfn = __phys_to_pfn(AT91SAM9260_SRAM0_BASE),
41
.length = AT91SAM9260_SRAM0_SIZE,
44
.virtual = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE - AT91SAM9260_SRAM1_SIZE,
45
.pfn = __phys_to_pfn(AT91SAM9260_SRAM1_BASE),
46
.length = AT91SAM9260_SRAM1_SIZE,
51
static struct map_desc at91sam9g20_sram_desc[] __initdata = {
53
.virtual = AT91_IO_VIRT_BASE - AT91SAM9G20_SRAM0_SIZE,
54
.pfn = __phys_to_pfn(AT91SAM9G20_SRAM0_BASE),
55
.length = AT91SAM9G20_SRAM0_SIZE,
58
.virtual = AT91_IO_VIRT_BASE - AT91SAM9G20_SRAM0_SIZE - AT91SAM9G20_SRAM1_SIZE,
59
.pfn = __phys_to_pfn(AT91SAM9G20_SRAM1_BASE),
60
.length = AT91SAM9G20_SRAM1_SIZE,
65
static struct map_desc at91sam9xe_sram_desc[] __initdata = {
67
.pfn = __phys_to_pfn(AT91SAM9XE_SRAM_BASE),
72
30
/* --------------------------------------------------------------------
74
32
* -------------------------------------------------------------------- */
241
199
CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk),
242
200
CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk),
243
201
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
202
/* more usart lookup table for DT entries */
203
CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
204
CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk),
205
CLKDEV_CON_DEV_ID("usart", "fffb4000.serial", &usart1_clk),
206
CLKDEV_CON_DEV_ID("usart", "fffb8000.serial", &usart2_clk),
207
CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk),
208
CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk),
209
CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk),
210
/* fake hclk clock */
211
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
246
214
static struct clk_lookup usart_clocks_lookups[] = {
331
299
static void __init at91sam9xe_map_io(void)
333
unsigned long cidr, sram_size;
335
cidr = at91_sys_read(AT91_DBGU_CIDR);
337
switch (cidr & AT91_CIDR_SRAMSIZ) {
301
unsigned long sram_size;
303
switch (at91_soc_initdata.cidr & AT91_CIDR_SRAMSIZ) {
338
304
case AT91_CIDR_SRAMSIZ_32K:
339
305
sram_size = 2 * SZ_16K;
343
309
sram_size = SZ_16K;
346
at91sam9xe_sram_desc->virtual = AT91_IO_VIRT_BASE - sram_size;
347
at91sam9xe_sram_desc->length = sram_size;
349
iotable_init(at91sam9xe_sram_desc, ARRAY_SIZE(at91sam9xe_sram_desc));
312
at91_init_sram(0, AT91SAM9XE_SRAM_BASE, sram_size);
352
void __init at91sam9260_map_io(void)
315
static void __init at91sam9260_map_io(void)
354
/* Map peripherals */
355
iotable_init(at91sam9260_io_desc, ARRAY_SIZE(at91sam9260_io_desc));
357
if (cpu_is_at91sam9xe())
317
if (cpu_is_at91sam9xe()) {
358
318
at91sam9xe_map_io();
359
else if (cpu_is_at91sam9g20())
360
iotable_init(at91sam9g20_sram_desc, ARRAY_SIZE(at91sam9g20_sram_desc));
362
iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc));
319
} else if (cpu_is_at91sam9g20()) {
320
at91_init_sram(0, AT91SAM9G20_SRAM0_BASE, AT91SAM9G20_SRAM0_SIZE);
321
at91_init_sram(1, AT91SAM9G20_SRAM1_BASE, AT91SAM9G20_SRAM1_SIZE);
323
at91_init_sram(0, AT91SAM9260_SRAM0_BASE, AT91SAM9260_SRAM0_SIZE);
324
at91_init_sram(1, AT91SAM9260_SRAM1_BASE, AT91SAM9260_SRAM1_SIZE);
365
void __init at91sam9260_initialize(unsigned long main_clock)
328
static void __init at91sam9260_initialize(void)
367
330
at91_arch_reset = at91sam9_alt_reset;
368
331
pm_power_off = at91sam9260_poweroff;
369
332
at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
370
333
| (1 << AT91SAM9260_ID_IRQ2);
372
/* Init clock subsystem */
373
at91_clock_init(main_clock);
375
/* Register the processor-specific clocks */
376
at91sam9260_register_clocks();
378
335
/* Register GPIO subsystem */
379
336
at91_gpio_init(at91sam9260_gpio, 3);
421
378
0, /* Advanced Interrupt Controller */
424
void __init at91sam9260_init_interrupts(unsigned int priority[NR_AIC_IRQS])
427
priority = at91sam9260_default_irq_priority;
429
/* Initialize the AIC interrupt controller */
430
at91_aic_init(priority);
432
/* Enable GPIO interrupts */
433
at91_gpio_irq_setup();
381
struct at91_init_soc __initdata at91sam9260_soc = {
382
.map_io = at91sam9260_map_io,
383
.default_irq_priority = at91sam9260_default_irq_priority,
384
.register_clocks = at91sam9260_register_clocks,
385
.init = at91sam9260_initialize,