Skip to contentSkip to conversation

arm: atmel: add at91sam9n12ek board support

PATCH New Josh Wu 2 participants 15 messages Apr 17, 2013 – May 12, 2013

Subsystems (3)
lore
Share & tools
lore

Josh Wu

author
#0 lore raw

v4 cover arm: atmel: add at91sam9n12ek board support

This patch series will add at91sam9n12ek board support. In the board, spi/nand flash, mmc, lcd are supported.

TODO:
- ethernet support
- usb support.

Change since v3:
- drop the patch: at91: clock: remove chip macro for plla div2. Still use macro to add 9n12 in clock.c
The reason is it will impact 9g20ek board. Since in 9g20, this PMC_MCKR bit 12 means Processor Clock Division. it is different from other boards. Thanks Shen Bo for finding this issue.
To keep it consistent, I just drop this patch. Add a 9N12 macro for MCKR.
- rebase on top of latest atmel master.

Changes since v2:
- re-arrange the patch series order. move
'at91: clock: remove chip macro for plla div2' ahead to 9n12 patches.
- remove redudent blank line in the end of at91sam9n12_devices.c

Changes since v1:
- split into more patches to make it clearer.
- include an extra patch that use run-time detect for spi ip.
- include an extra patch to remove the chip select for clock part.
- merge at91sam9n12 register definition with at91sam9x5.
- fix copyright issue and add maintainer.
- disable pull-up as possible as we can.
- add mtdparts command.
- fix warnings and typos.

Bo Shen (1):
spi: atmel_spi: using ip version to check whether has wdrbt

Josh Wu (2):
arm: at91: add at91sam9n12 register definition
arm: at91: add at91sam9n12ek board support

 MAINTAINERS                                        |    3 +
 arch/arm/cpu/arm926ejs/at91/Makefile               |    1 +
 arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c  |  177 +++++++++++++++
 arch/arm/cpu/arm926ejs/at91/clock.c                |    4 +-
 arch/arm/include/asm/arch-at91/at91sam9_matrix.h   |    2 +-
 arch/arm/include/asm/arch-at91/at91sam9x5.h        |   19 +-
 arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h |   17 +-
 arch/arm/include/asm/arch-at91/hardware.h          |    2 +-
 board/atmel/at91sam9n12ek/Makefile                 |   52 +++++
 board/atmel/at91sam9n12ek/at91sam9n12ek.c          |  228 +++++++++++++++++++
 boards.cfg                                         |    3 +
 drivers/spi/atmel_spi.c                            |   15 +-
 drivers/spi/atmel_spi.h                            |    2 +-
 include/configs/at91sam9n12ek.h                    |  232 ++++++++++++++++++++
 14 files changed, 743 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c
 create mode 100644 board/atmel/at91sam9n12ek/Makefile
 create mode 100644 board/atmel/at91sam9n12ek/at91sam9n12ek.c
 create mode 100644 include/configs/at91sam9n12ek.h
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v4 1/3 spi: atmel_spi: using ip version to check whether has wdrbt

From: Bo Shen <[email protected]>

Using IP version to check whether it has wdrbt bit in mode register

Tested in at91sam9x5ek and at91sam9n12ek.

[fix warning about incompatible parameter]

---
changes since v3:
- rebase on top of atmel master tree.

 drivers/spi/atmel_spi.c |   15 ++++++++++++---
 drivers/spi/atmel_spi.h |    2 +-
 2 files changed, 13 insertions(+), 4 deletions(-)
drivers/spi/atmel_spi.c +12 -3
index f4b1bad..52594e3 100644
@@ -30,6 +30,15 @@
 
 #include "atmel_spi.h"
 
+static int spi_has_wdrbt(struct atmel_spi_slave *slave)
+{
+	unsigned int ver;
+
+	ver = spi_readl(slave, VERSION);
+
+	return (ATMEL_SPI_VERSION_REV(ver) >= 0x210);
+}
+
 void spi_init()
 {
 
@@ -90,10 +99,10 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 
 	as->regs = regs;
 	as->mr = ATMEL_SPI_MR_MSTR | ATMEL_SPI_MR_MODFDIS
-#if defined(CONFIG_AT91SAM9X5) || defined(CONFIG_AT91SAM9M10G45)
-			| ATMEL_SPI_MR_WDRBT
-#endif
 			| ATMEL_SPI_MR_PCS(~(1 << cs) & 0xf);
+	if (spi_has_wdrbt(as))
+		as->mr |= ATMEL_SPI_MR_WDRBT;
+
 	spi_writel(as, CSR(cs), csrx);
 
 	return &as->slave;
drivers/spi/atmel_spi.h +1 -1
index 057de9a..d240945 100644
@@ -64,7 +64,7 @@
 #define ATMEL_SPI_CSRx_DLYBCT(x)	((x) << 24)
 
 /* Bits in VERSION */
-#define ATMEL_SPI_VERSION_REV(x)	((x) << 0)
+#define ATMEL_SPI_VERSION_REV(x)	((x) & 0xfff)
 #define ATMEL_SPI_VERSION_MFN(x)	((x) << 16)
 
 /* Constants for CSRx:BITS */
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v4 1/3 spi: atmel_spi: using ip version to check whether has wdrbt

Dear Josh Wu,

Quoted 10 lines · Josh Wu

From: Bo Shen <[email protected]>

Using IP version to check whether it has wdrbt bit in mode register

Tested in at91sam9x5ek and at91sam9n12ek.

[fix warning about incompatible parameter]
Quoted 7 lines

---
changes since v3:
- rebase on top of atmel master tree.

drivers/spi/atmel_spi.c | 15 ++++++++++++---
drivers/spi/atmel_spi.h | 2 +-

2 files changed, 13 insertions(+), 4 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

#3 lore raw

PATCH v4 2/3 arm: at91: add at91sam9n12 register definition

Dear Josh Wu,

Quoted 11 lines · Josh Wu

Since at91sam9n12 is a subset of at91sam9x5, so put all at91sam9n12 definitions in at91sam9x5 head file.

---

arch/arm/include/asm/arch-at91/at91sam9_matrix.h   |    2 +-
arch/arm/include/asm/arch-at91/at91sam9x5.h        |   19 ++++++++++++++++---
arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h |   17 ++++++++++++++---
arch/arm/include/asm/arch-at91/hardware.h          |    2 +-
4 files changed, 32 insertions(+), 8 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

#4 lore raw

PATCH v4 3/3 arm: at91: add at91sam9n12ek board support

In reply to Andreas Bießmann

Dear Josh Wu,

Quoted 20 lines · Josh Wu

Add support for following features:
- nand boot, with PMECC 2bit ECC for 512 bytes sector
- SPI flash boot
- SD card boot
- LCD support

[fix -Wimplicit-function-declaration for at91_lcd_hw_init()]

---

MAINTAINERS                                       |    3 +
arch/arm/cpu/arm926ejs/at91/Makefile              |    1 +
arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c |  177 ++++++++++++++++
arch/arm/cpu/arm926ejs/at91/clock.c               |    4 +-
arch/arm/include/asm/arch-at91/at91_common.h      |    1 +
board/atmel/at91sam9n12ek/Makefile                |   52 +++++
board/atmel/at91sam9n12ek/at91sam9n12ek.c         |  228 ++++++++++++++++++++
boards.cfg                                        |    3 +
include/configs/at91sam9n12ek.h                   |  232 +++++++++++++++++++++
9 files changed, 699 insertions(+), 2 deletions(-)
Quoted 4 lines

create mode 100644 arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c create mode 100644 board/atmel/at91sam9n12ek/Makefile create mode 100644 board/atmel/at91sam9n12ek/at91sam9n12ek.c create mode 100644 include/configs/at91sam9n12ek.h

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

#5 lore raw

PATCH v4 1/3 spi: atmel_spi: using ip version to check whether has wdrbt

In reply to Josh Wu

Dear Josh Wu,

Quoted 10 lines · Josh Wu

From: Bo Shen <[email protected]>

Using IP version to check whether it has wdrbt bit in mode register

Tested in at91sam9x5ek and at91sam9n12ek.

[fix warning about incompatible parameter]
Quoted 7 lines

---
changes since v3:
- rebase on top of atmel master tree.

drivers/spi/atmel_spi.c | 15 ++++++++++++---
drivers/spi/atmel_spi.h | 2 +-

2 files changed, 13 insertions(+), 4 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

#6 lore raw

PATCH v4 2/3 arm: at91: add at91sam9n12 register definition

Dear Josh Wu,

Quoted 11 lines · Josh Wu

Since at91sam9n12 is a subset of at91sam9x5, so put all at91sam9n12 definitions in at91sam9x5 head file.

---

arch/arm/include/asm/arch-at91/at91sam9_matrix.h   |    2 +-
arch/arm/include/asm/arch-at91/at91sam9x5.h        |   19 ++++++++++++++++---
arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h |   17 ++++++++++++++---
arch/arm/include/asm/arch-at91/hardware.h          |    2 +-
4 files changed, 32 insertions(+), 8 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

#7 lore raw

PATCH v4 3/3 arm: at91: add at91sam9n12ek board support

In reply to Andreas Bießmann

Dear Josh Wu,

Quoted 20 lines · Josh Wu

Add support for following features:
- nand boot, with PMECC 2bit ECC for 512 bytes sector
- SPI flash boot
- SD card boot
- LCD support

[fix -Wimplicit-function-declaration for at91_lcd_hw_init()]

---

MAINTAINERS                                       |    3 +
arch/arm/cpu/arm926ejs/at91/Makefile              |    1 +
arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c |  177 ++++++++++++++++
arch/arm/cpu/arm926ejs/at91/clock.c               |    4 +-
arch/arm/include/asm/arch-at91/at91_common.h      |    1 +
board/atmel/at91sam9n12ek/Makefile                |   52 +++++
board/atmel/at91sam9n12ek/at91sam9n12ek.c         |  228 ++++++++++++++++++++
boards.cfg                                        |    3 +
include/configs/at91sam9n12ek.h                   |  232 +++++++++++++++++++++
9 files changed, 699 insertions(+), 2 deletions(-)
Quoted 4 lines

create mode 100644 arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c create mode 100644 board/atmel/at91sam9n12ek/Makefile create mode 100644 board/atmel/at91sam9n12ek/at91sam9n12ek.c create mode 100644 include/configs/at91sam9n12ek.h

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

#8 lore raw

PATCH 1/2 arm: at91: enable mci support for at91sam9g20ek.

In reply to Andreas Bießmann

Dear Josh Wu,

Quoted 7 lines · Josh Wu

---

arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c |    4 ++++
board/atmel/at91sam9260ek/at91sam9260ek.c         |   10 ++++++++++
include/configs/at91sam9260ek.h                   |   16 ++++++++++++++--
3 files changed, 28 insertions(+), 2 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

#9 lore raw

PATCH 1/2 mmc: atmel_mci: using IP version for different setting

In reply to Andreas Bießmann

Dear Bo Shen,

Quoted 10 lines · Bo Shen

Using IP version for different setting
- Higher version supports 8bit mode
- Higher version bus width setting is different

---
drivers/mmc/gen_atmel_mci.c | 42 ++++++++++++++++++++++++++++++++++++++----
include/atmel_mci.h | 2 ++

2 files changed, 40 insertions(+), 4 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

#10 lore raw

PATCH 2/2 arm: at91: add at91sam9g20ek_mmc_config, which can save environment in mmc card

In reply to Andreas Bießmann

Dear Josh Wu,

Quoted 6 lines · Josh Wu

---
boards.cfg | 1 +
include/configs/at91sam9260ek.h | 18 +++++++++++++++++-

2 files changed, 18 insertions(+), 1 deletion(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

#12 lore raw

PATCH v2 1/1 at91sam9260ek: move board id setup to config header

In reply to Andreas Bießmann

Dear Andreas Bie?mann,

Quoted 10 lines · Andreas Bie?mann

---
Changes in v2:
* use only one ifdef for sam9G variants

board/atmel/at91sam9260ek/at91sam9260ek.c |   12 ------------
include/configs/at91sam9260ek.h           |   18 ++++++++++++++++++
2 files changed, 18 insertions(+), 12 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

author
#13 lore raw

PATCH v4 2/3 arm: at91: add at91sam9n12 register definition

In reply to Josh Wu

Since at91sam9n12 is a subset of at91sam9x5, so put all at91sam9n12 definitions in at91sam9x5 head file.

---
 arch/arm/include/asm/arch-at91/at91sam9_matrix.h   |    2 +-
 arch/arm/include/asm/arch-at91/at91sam9x5.h        |   19 ++++++++++++++++---
 arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h |   17 ++++++++++++++---
 arch/arm/include/asm/arch-at91/hardware.h          |    2 +-
 4 files changed, 32 insertions(+), 8 deletions(-)
arch/arm/include/asm/arch-at91/at91sam9_matrix.h +1 -1
index b9a93b0..6e0bebd 100644
@@ -23,7 +23,7 @@
 #include <asm/arch/at91cap9_matrix.h>
 #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
 #include <asm/arch/at91sam9g45_matrix.h>
-#elif defined(CONFIG_AT91SAM9X5)
+#elif defined(CONFIG_AT91SAM9N12) || defined(CONFIG_AT91SAM9X5)
 #include <asm/arch/at91sam9x5_matrix.h>
 #else
 #error "Unsupported AT91SAM9/CAP9 processor"
arch/arm/include/asm/arch-at91/at91sam9x5.h +16 -3
index b7d1932..85e42f5 100644
@@ -1,10 +1,10 @@
 /*
  * Chip-specific header file for the AT91SAM9x5 family
  *
- *  Copyright (C) 2012 Atmel Corporation.
+ *  Copyright (C) 2012-2013 Atmel Corporation.
  *
  * Definitions for the SoC:
- * AT91SAM9x5
+ * AT91SAM9x5 & AT91SAM9N12
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,10 +22,12 @@
 #define ATMEL_ID_SYS	1	/* System Controller Interrupt */
 #define ATMEL_ID_PIOAB	2	/* Parallel I/O Controller A and B */
 #define ATMEL_ID_PIOCD	3	/* Parallel I/O Controller C and D */
-#define ATMEL_ID_SMD	4	/* SMD Soft Modem (SMD) */
+#define ATMEL_ID_SMD	4	/* SMD Soft Modem (SMD), only for AT91SAM9X5 */
+#define ATMEL_ID_FUSE	4	/* FUSE Controller, only for AT91SAM9N12 */
 #define ATMEL_ID_USART0	5	/* USART 0 */
 #define ATMEL_ID_USART1	6	/* USART 1 */
 #define ATMEL_ID_USART2	7	/* USART 2 */
+#define ATMEL_ID_USART3	8	/* USART 3 */
 #define ATMEL_ID_TWI0	9	/* Two-Wire Interface 0 */
 #define ATMEL_ID_TWI1	10	/* Two-Wire Interface 1 */
 #define ATMEL_ID_TWI2	11	/* Two-Wire Interface 2 */
@@ -46,6 +48,7 @@
 #define ATMEL_ID_HSMCI1	26	/* High Speed Multimedia Card Interface 1 */
 #define ATMEL_ID_EMAC1	27	/* Ethernet MAC1 */
 #define ATMEL_ID_SSC	28	/* Synchronous Serial Controller */
+#define ATMEL_ID_TRNG	30	/* True Random Number Generator */
 #define ATMEL_ID_IRQ	31	/* Advanced Interrupt Controller */
 
 /*
@@ -85,6 +88,7 @@
 /*
  * System Peripherals
  */
+#define ATMEL_BASE_FUSE		0xffffdc00
 #define ATMEL_BASE_MATRIX	0xffffde00
 #define ATMEL_BASE_PMECC	0xffffe000
 #define ATMEL_BASE_PMERRLOC	0xffffe600
@@ -111,10 +115,15 @@
  */
 #define ATMEL_BASE_ROM		0x00100000 /* Internal ROM base address */
 #define ATMEL_BASE_SRAM		0x00300000 /* Internal SRAM base address */
+
+#ifdef CONFIG_AT91SAM9N12
+#define ATMEL_BASE_OHCI		0x00500000 /* USB Host controller */
+#else	/* AT91SAM9X5 */
 #define ATMEL_BASE_SMD		0x00400000 /* SMD Controller */
 #define ATMEL_BASE_UDPHS_FIFO	0x00500000 /* USB Device HS controller */
 #define ATMEL_BASE_OHCI		0x00600000 /* USB Host controller (OHCI) */
 #define ATMEL_BASE_EHCI		0x00700000 /* USB Host controller (EHCI) */
+#endif
 
 /* 9x5 series chip id definitions */
 #define ARCH_ID_AT91SAM9X5	0x819a05a0
@@ -140,7 +149,11 @@
 /*
  * Cpu Name
  */
+#ifdef CONFIG_AT91SAM9N12
+#define ATMEL_CPU_NAME	"AT91SAM9N12"
+#else	/* AT91SAM9X5 */
 #define ATMEL_CPU_NAME	get_cpu_name()
+#endif
 
 /*
  * Other misc defines
arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h +14 -3
index d6ce6fa..0d33069 100644
@@ -1,10 +1,10 @@
 /*
  * Matrix-centric header file for the AT91SAM9X5 family
  *
- *  Copyright (C) 2012 Atmel Corporation.
+ *  Copyright (C) 2012-2013 Atmel Corporation.
  *
  * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9X5 preliminary datasheet.
+ * Based on AT91SAM9X5 & AT91SAM9N12 preliminary datasheet.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,14 +17,25 @@
 
 #ifndef __ASSEMBLY__
 
+/* AT91SAM9N12 Matrix definition is a subset of AT91SAM9X5. */
 struct at91_matrix {
 	u32	mcfg[16];
 	u32	scfg[16];
 	u32	pras[16][2];
 	u32	mrcr;           /* 0x100 Master Remap Control */
-	u32	filler[7];
+	u32	filler[5];
+#ifdef CONFIG_AT91SAM9X5
+	u32	filler1[2];
+#endif
+	/* EBI Chip Select Assignment Register
+	 * 0x118: AT91SAM9N12
+	 * 0x120: AT91SAM9X5
+	 */
 	u32	ebicsa;
 	u32	filler4[47];
+#ifdef CONFIG_AT91SAM9N12
+	u32	filler5[2];
+#endif
 	u32	wpmr;
 	u32	wpsr;
 };
arch/arm/include/asm/arch-at91/hardware.h +1 -1
index 4c4ee70..8812b11 100644
@@ -37,7 +37,7 @@
 # include <asm/arch/at91sam9rl.h>
 #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
 # include <asm/arch/at91sam9g45.h>
-#elif defined(CONFIG_AT91SAM9X5)
+#elif defined(CONFIG_AT91SAM9N12) || defined(CONFIG_AT91SAM9X5)
 # include <asm/arch/at91sam9x5.h>
 #elif defined(CONFIG_AT91CAP9)
 # include <asm/arch/at91cap9.h>
Signature · 1 line
1.7.9.5
author
#14 lore raw

PATCH v4 3/3 arm: at91: add at91sam9n12ek board support

In reply to Josh Wu

Add support for following features:
- nand boot, with PMECC 2bit ECC for 512 bytes sector
- SPI flash boot
- SD card boot
- LCD support

---
changes since v3:
- use 9N12 cpu macro to select plla clock in clock.c

changes since v2:
- remove redudent blank line in the end of at91sam9n12_devices.c.

 MAINTAINERS                                       |    3 +
 arch/arm/cpu/arm926ejs/at91/Makefile              |    1 +
 arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c |  177 ++++++++++++++++
 arch/arm/cpu/arm926ejs/at91/clock.c               |    4 +-
 board/atmel/at91sam9n12ek/Makefile                |   52 +++++
 board/atmel/at91sam9n12ek/at91sam9n12ek.c         |  228 ++++++++++++++++++++
 boards.cfg                                        |    3 +
 include/configs/at91sam9n12ek.h                   |  232 +++++++++++++++++++++
 8 files changed, 698 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c
 create mode 100644 board/atmel/at91sam9n12ek/Makefile
 create mode 100644 board/atmel/at91sam9n12ek/at91sam9n12ek.c
 create mode 100644 include/configs/at91sam9n12ek.h
MAINTAINERS +3 -0
index bbab5fe..642d318 100644
@@ -1017,6 +1017,9 @@ Richard Woodruff <[email protected]>
 
 	omap2420h4	ARM1136EJS
 
+Josh Wu <[email protected]>
+	at91sam9n12ek	ARM926EJS (AT91SAM9N12 SoC)
+
 Ilya Yanok <[email protected]>
 
 	mcx		ARM ARMV7 (AM35x SoC)
arch/arm/cpu/arm926ejs/at91/Makefile +1 -0
index 346e58f..c4408f6 100644
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_AT91SAM9263)	+= at91sam9263_devices.o
 COBJS-$(CONFIG_AT91SAM9RL)	+= at91sam9rl_devices.o
 COBJS-$(CONFIG_AT91SAM9M10G45)	+= at91sam9m10g45_devices.o
 COBJS-$(CONFIG_AT91SAM9G45)	+= at91sam9m10g45_devices.o
+COBJS-$(CONFIG_AT91SAM9N12)	+= at91sam9n12_devices.o
 COBJS-$(CONFIG_AT91SAM9X5)	+= at91sam9x5_devices.o
 COBJS-$(CONFIG_AT91_EFLASH)	+= eflash.o
 COBJS-$(CONFIG_AT91_LED)	+= led.o
arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c new file +177 -0

177 lines not on this page · raw message

arch/arm/cpu/arm926ejs/at91/clock.c +2 -2
index f825388..5b4923f 100644
@@ -156,7 +156,7 @@ int at91_clock_init(unsigned long main_clock)
 	 */
 	mckr = readl(&pmc->mckr);
 #if defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) \
-		|| defined(CONFIG_AT91SAM9X5)
+		|| defined(CONFIG_AT91SAM9N12) || defined(CONFIG_AT91SAM9X5)
 	/* plla divisor by 2 */
 	gd->arch.plla_rate_hz /= (1 << ((mckr & 1 << 12) >> 12));
 #endif
@@ -171,7 +171,7 @@ int at91_clock_init(unsigned long main_clock)
 	if (mckr & AT91_PMC_MCKR_MDIV_MASK)
 		freq /= 2;			/* processor clock division */
 #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) \
-		|| defined(CONFIG_AT91SAM9X5)
+		|| defined(CONFIG_AT91SAM9N12) || defined(CONFIG_AT91SAM9X5)
 	/* mdiv <==> divisor
 	 *  0   <==>   1
 	 *  1   <==>   2
board/atmel/at91sam9n12ek/Makefile new file +52 -0

52 lines not on this page · raw message

board/atmel/at91sam9n12ek/at91sam9n12ek.c new file +228 -0

228 lines not on this page · raw message

boards.cfg +3 -0
index f785da8..a71dbfa 100644
@@ -106,6 +106,9 @@ at91sam9x5ek_mmc             arm         arm926ejs   at91sam9x5ek        atmel
 at91sam9xeek_dataflash_cs0   arm         arm926ejs   at91sam9260ek       atmel          at91        at91sam9260ek:AT91SAM9XE,SYS_USE_DATAFLASH_CS0
 at91sam9xeek_dataflash_cs1   arm         arm926ejs   at91sam9260ek       atmel          at91        at91sam9260ek:AT91SAM9XE,SYS_USE_DATAFLASH_CS1
 at91sam9xeek_nandflash       arm         arm926ejs   at91sam9260ek       atmel          at91        at91sam9260ek:AT91SAM9XE,SYS_USE_NANDFLASH
+at91sam9n12ek_nandflash      arm         arm926ejs   at91sam9n12ek       atmel          at91        at91sam9n12ek:AT91SAM9N12,SYS_USE_NANDFLASH
+at91sam9n12ek_spiflash       arm         arm926ejs   at91sam9n12ek       atmel          at91        at91sam9n12ek:AT91SAM9N12,SYS_USE_SPIFLASH
+at91sam9n12ek_mmc            arm         arm926ejs   at91sam9n12ek       atmel          at91        at91sam9n12ek:AT91SAM9N12,SYS_USE_MMC
 snapper9260                  arm         arm926ejs   -                   bluewater      at91        snapper9260:AT91SAM9260
 snapper9g20                  arm         arm926ejs   snapper9260         bluewater      at91        snapper9260:AT91SAM9G20
 vl_ma2sc                     arm         arm926ejs   vl_ma2sc            BuS            at91
include/configs/at91sam9n12ek.h new file +232 -0

232 lines not on this page · raw message

Signature · 1 line
1.7.9.5