aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
authorHong Xu <hong.xu@atmel.com>2012-04-17 02:26:30 -0400
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-04-27 13:39:43 -0400
commit02059684271079f96e2a7a4bdc7912f029997866 (patch)
treefdef124dd855b43a39cbca91647d81936511e5ed /arch/arm/mach-at91
parent26690863e2c1fa4fee5f6137b219f4b8a1a02287 (diff)
ARM: at91: Add machine header file for AT91SAM9N12 SoC
Signed-off-by: Hong Xu <hong.xu@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9n12.h60
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h53
-rw-r--r--arch/arm/mach-at91/include/mach/cpu.h10
-rw-r--r--arch/arm/mach-at91/include/mach/hardware.h1
-rw-r--r--arch/arm/mach-at91/soc.h5
5 files changed, 129 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/include/mach/at91sam9n12.h b/arch/arm/mach-at91/include/mach/at91sam9n12.h
new file mode 100644
index 000000000000..d374b87c0459
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/at91sam9n12.h
@@ -0,0 +1,60 @@
1/*
2 * SoC specific header file for the AT91SAM9N12
3 *
4 * Copyright (C) 2012 Atmel Corporation
5 *
6 * Common definitions, based on AT91SAM9N12 SoC datasheet
7 *
8 * Licensed under GPLv2 or later
9 */
10
11#ifndef _AT91SAM9N12_H_
12#define _AT91SAM9N12_H_
13
14/*
15 * Peripheral identifiers/interrupts.
16 */
17#define AT91SAM9N12_ID_PIOAB 2 /* Parallel I/O Controller A and B */
18#define AT91SAM9N12_ID_PIOCD 3 /* Parallel I/O Controller C and D */
19#define AT91SAM9N12_ID_FUSE 4 /* FUSE Controller */
20#define AT91SAM9N12_ID_USART0 5 /* USART 0 */
21#define AT91SAM9N12_ID_USART1 6 /* USART 1 */
22#define AT91SAM9N12_ID_USART2 7 /* USART 2 */
23#define AT91SAM9N12_ID_USART3 8 /* USART 3 */
24#define AT91SAM9N12_ID_TWI0 9 /* Two-Wire Interface 0 */
25#define AT91SAM9N12_ID_TWI1 10 /* Two-Wire Interface 1 */
26#define AT91SAM9N12_ID_MCI 12 /* High Speed Multimedia Card Interface */
27#define AT91SAM9N12_ID_SPI0 13 /* Serial Peripheral Interface 0 */
28#define AT91SAM9N12_ID_SPI1 14 /* Serial Peripheral Interface 1 */
29#define AT91SAM9N12_ID_UART0 15 /* UART 0 */
30#define AT91SAM9N12_ID_UART1 16 /* UART 1 */
31#define AT91SAM9N12_ID_TCB 17 /* Timer Counter 0, 1, 2, 3, 4 and 5 */
32#define AT91SAM9N12_ID_PWM 18 /* Pulse Width Modulation Controller */
33#define AT91SAM9N12_ID_ADC 19 /* ADC Controller */
34#define AT91SAM9N12_ID_DMA 20 /* DMA Controller */
35#define AT91SAM9N12_ID_UHP 22 /* USB Host High Speed */
36#define AT91SAM9N12_ID_UDP 23 /* USB Device High Speed */
37#define AT91SAM9N12_ID_LCDC 25 /* LCD Controller */
38#define AT91SAM9N12_ID_ISI 25 /* Image Sensor Interface */
39#define AT91SAM9N12_ID_SSC 28 /* Synchronous Serial Controller */
40#define AT91SAM9N12_ID_TRNG 30 /* TRNG */
41#define AT91SAM9N12_ID_IRQ0 31 /* Advanced Interrupt Controller */
42
43/*
44 * User Peripheral physical base addresses.
45 */
46#define AT91SAM9N12_BASE_USART0 0xf801c000
47#define AT91SAM9N12_BASE_USART1 0xf8020000
48#define AT91SAM9N12_BASE_USART2 0xf8024000
49#define AT91SAM9N12_BASE_USART3 0xf8028000
50
51/*
52 * Internal Memory.
53 */
54#define AT91SAM9N12_SRAM_BASE 0x00300000 /* Internal SRAM base address */
55#define AT91SAM9N12_SRAM_SIZE SZ_32K /* Internal SRAM size (32Kb) */
56
57#define AT91SAM9N12_ROM_BASE 0x00100000 /* Internal ROM base address */
58#define AT91SAM9N12_ROM_SIZE SZ_128K /* Internal ROM size (128Kb) */
59
60#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
new file mode 100644
index 000000000000..40060cd62fa9
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
@@ -0,0 +1,53 @@
1/*
2 * Matrix-centric header file for the AT91SAM9N12
3 *
4 * Copyright (C) 2012 Atmel Corporation.
5 *
6 * Only EBI related registers.
7 * Write Protect register definitions may be useful.
8 *
9 * Licensed under GPLv2 or later.
10 */
11
12#ifndef _AT91SAM9N12_MATRIX_H_
13#define _AT91SAM9N12_MATRIX_H_
14
15#define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x118) /* EBI Chip Select Assignment Register */
16#define AT91_MATRIX_EBI_CS1A (1 << 1) /* Chip Select 1 Assignment */
17#define AT91_MATRIX_EBI_CS1A_SMC (0 << 1)
18#define AT91_MATRIX_EBI_CS1A_SDRAMC (1 << 1)
19#define AT91_MATRIX_EBI_CS3A (1 << 3) /* Chip Select 3 Assignment */
20#define AT91_MATRIX_EBI_CS3A_SMC (0 << 3)
21#define AT91_MATRIX_EBI_CS3A_SMC_NANDFLASH (1 << 3)
22#define AT91_MATRIX_EBI_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */
23#define AT91_MATRIX_EBI_DBPU_ON (0 << 8)
24#define AT91_MATRIX_EBI_DBPU_OFF (1 << 8)
25#define AT91_MATRIX_EBI_VDDIOMSEL (1 << 16) /* Memory voltage selection */
26#define AT91_MATRIX_EBI_VDDIOMSEL_1_8V (0 << 16)
27#define AT91_MATRIX_EBI_VDDIOMSEL_3_3V (1 << 16)
28#define AT91_MATRIX_EBI_EBI_IOSR (1 << 17) /* EBI I/O slew rate selection */
29#define AT91_MATRIX_EBI_EBI_IOSR_REDUCED (0 << 17)
30#define AT91_MATRIX_EBI_EBI_IOSR_NORMAL (1 << 17)
31#define AT91_MATRIX_EBI_DDR_IOSR (1 << 18) /* DDR2 dedicated port I/O slew rate selection */
32#define AT91_MATRIX_EBI_DDR_IOSR_REDUCED (0 << 18)
33#define AT91_MATRIX_EBI_DDR_IOSR_NORMAL (1 << 18)
34#define AT91_MATRIX_NFD0_SELECT (1 << 24) /* NAND Flash Data Bus Selection */
35#define AT91_MATRIX_NFD0_ON_D0 (0 << 24)
36#define AT91_MATRIX_NFD0_ON_D16 (1 << 24)
37#define AT91_MATRIX_DDR_MP_EN (1 << 25) /* DDR Multi-port Enable */
38#define AT91_MATRIX_MP_OFF (0 << 25)
39#define AT91_MATRIX_MP_ON (1 << 25)
40
41#define AT91_MATRIX_WPMR (AT91_MATRIX + 0x1E4) /* Write Protect Mode Register */
42#define AT91_MATRIX_WPMR_WPEN (1 << 0) /* Write Protect ENable */
43#define AT91_MATRIX_WPMR_WP_WPDIS (0 << 0)
44#define AT91_MATRIX_WPMR_WP_WPEN (1 << 0)
45#define AT91_MATRIX_WPMR_WPKEY (0xFFFFFF << 8) /* Write Protect KEY */
46
47#define AT91_MATRIX_WPSR (AT91_MATRIX + 0x1E8) /* Write Protect Status Register */
48#define AT91_MATRIX_WPSR_WPVS (1 << 0) /* Write Protect Violation Status */
49#define AT91_MATRIX_WPSR_NO_WPV (0 << 0)
50#define AT91_MATRIX_WPSR_WPV (1 << 0)
51#define AT91_MATRIX_WPSR_WPVSRC (0xFFFF << 8) /* Write Protect Violation Source */
52
53#endif
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 73d2fd209ce4..b6504c19d55c 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -25,6 +25,7 @@
25#define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */ 25#define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */
26#define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */ 26#define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */
27#define ARCH_ID_AT91SAM9X5 0x819a05a0 27#define ARCH_ID_AT91SAM9X5 0x819a05a0
28#define ARCH_ID_AT91SAM9N12 0x819a07a0
28 29
29#define ARCH_ID_AT91SAM9XE128 0x329973a0 30#define ARCH_ID_AT91SAM9XE128 0x329973a0
30#define ARCH_ID_AT91SAM9XE256 0x329a93a0 31#define ARCH_ID_AT91SAM9XE256 0x329a93a0
@@ -71,6 +72,9 @@ enum at91_soc_type {
71 /* SAM9X5 */ 72 /* SAM9X5 */
72 AT91_SOC_SAM9X5, 73 AT91_SOC_SAM9X5,
73 74
75 /* SAM9N12 */
76 AT91_SOC_SAM9N12,
77
74 /* Unknown type */ 78 /* Unknown type */
75 AT91_SOC_NONE 79 AT91_SOC_NONE
76}; 80};
@@ -177,6 +181,12 @@ static inline int at91_soc_is_detected(void)
177#define cpu_is_at91sam9x25() (0) 181#define cpu_is_at91sam9x25() (0)
178#endif 182#endif
179 183
184#ifdef CONFIG_SOC_AT91SAM9N12
185#define cpu_is_at91sam9n12() (at91_soc_initdata.type == AT91_SOC_SAM9N12)
186#else
187#define cpu_is_at91sam9n12() (0)
188#endif
189
180/* 190/*
181 * Since this is ARM, we will never run on any AVR32 CPU. But these 191 * Since this is ARM, we will never run on any AVR32 CPU. But these
182 * definitions may reduce clutter in common drivers. 192 * definitions may reduce clutter in common drivers.
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h
index 3a01f8ff7e74..24b46bd14bbe 100644
--- a/arch/arm/mach-at91/include/mach/hardware.h
+++ b/arch/arm/mach-at91/include/mach/hardware.h
@@ -32,6 +32,7 @@
32#include <mach/at91sam9rl.h> 32#include <mach/at91sam9rl.h>
33#include <mach/at91sam9g45.h> 33#include <mach/at91sam9g45.h>
34#include <mach/at91sam9x5.h> 34#include <mach/at91sam9x5.h>
35#include <mach/at91sam9n12.h>
35 36
36/* 37/*
37 * On all at91 except rm9200 and x40 have the System Controller starts 38 * On all at91 except rm9200 and x40 have the System Controller starts
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index 683dddfd8b13..a9cfeb153719 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -20,6 +20,7 @@ extern struct at91_init_soc at91sam9263_soc;
20extern struct at91_init_soc at91sam9g45_soc; 20extern struct at91_init_soc at91sam9g45_soc;
21extern struct at91_init_soc at91sam9rl_soc; 21extern struct at91_init_soc at91sam9rl_soc;
22extern struct at91_init_soc at91sam9x5_soc; 22extern struct at91_init_soc at91sam9x5_soc;
23extern struct at91_init_soc at91sam9n12_soc;
23 24
24static inline int at91_soc_is_enabled(void) 25static inline int at91_soc_is_enabled(void)
25{ 26{
@@ -53,3 +54,7 @@ static inline int at91_soc_is_enabled(void)
53#if !defined(CONFIG_SOC_AT91SAM9X5) 54#if !defined(CONFIG_SOC_AT91SAM9X5)
54#define at91sam9x5_soc at91_boot_soc 55#define at91sam9x5_soc at91_boot_soc
55#endif 56#endif
57
58#if !defined(CONFIG_SOC_AT91SAM9N12)
59#define at91sam9n12_soc at91_boot_soc
60#endif