Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / arch / arm / mach-at91 / at91sam9260.c
1 /*
2  * arch/arm/mach-at91/at91sam9260.c
3  *
4  *  Copyright (C) 2006 SAN People
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 as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  */
12
13 #include <asm/system_misc.h>
14 #include <mach/cpu.h>
15 #include <mach/at91_dbgu.h>
16 #include <mach/hardware.h>
17
18 #include "soc.h"
19 #include "generic.h"
20
21 /* --------------------------------------------------------------------
22  *  AT91SAM9260 processor initialization
23  * -------------------------------------------------------------------- */
24
25 static void __init at91sam9xe_map_io(void)
26 {
27         unsigned long sram_size;
28
29         switch (at91_soc_initdata.cidr & AT91_CIDR_SRAMSIZ) {
30                 case AT91_CIDR_SRAMSIZ_32K:
31                         sram_size = 2 * SZ_16K;
32                         break;
33                 case AT91_CIDR_SRAMSIZ_16K:
34                 default:
35                         sram_size = SZ_16K;
36         }
37
38         at91_init_sram(0, AT91SAM9XE_SRAM_BASE, sram_size);
39 }
40
41 static void __init at91sam9260_map_io(void)
42 {
43         if (cpu_is_at91sam9xe())
44                 at91sam9xe_map_io();
45         else if (cpu_is_at91sam9g20())
46                 at91_init_sram(0, AT91SAM9G20_SRAM_BASE, AT91SAM9G20_SRAM_SIZE);
47         else
48                 at91_init_sram(0, AT91SAM9260_SRAM_BASE, AT91SAM9260_SRAM_SIZE);
49 }
50
51 static void __init at91sam9260_initialize(void)
52 {
53         arm_pm_idle = at91sam9_idle;
54
55         at91_sysirq_mask_rtt(AT91SAM9260_BASE_RTT);
56 }
57
58 AT91_SOC_START(at91sam9260)
59         .map_io = at91sam9260_map_io,
60         .init = at91sam9260_initialize,
61 AT91_SOC_END