Skip to contentSkip to conversation

ARM: atmel: add sama5d3xek board support

PATCH New Bo Shen 2 participants 10 messages May 13, 2013 – May 21, 2013

Subsystems (4)
lore
Share & tools
lore

Bo Shen

author
#0 lore raw

cover ARM: atmel: add sama5d3xek board support

This patch series add sama5d3xek board support.

Included features
- boot from NAND flash, PMECC support, 4bit ECC @ 512 bytes sector
- boot from SPI flash support
- boot from SD card support
- LCD support
- EMAC support
- USB OHCI support

Will do
- Add GMAC support
- Add of control support

Changes in v3:
- Split new pmc register in a standalone patch
- Rebase to u-boot-atmel master branch

Changes in v2:
- Remove unneeded #undef
- Using string directly
- Add missed copyright
- Using pull up for usart Tx line
- Using pull up for spi cs
- make code more readable in clock.c file
- move LCD higher 8 bit to board file (This is board related)

Bo Shen (3):
ARM: at91: add Atmel sama5d3 SoC new pmc register
USB: ohci-at91: support sama5d3x devices
ARM: atmel: add sama5d3xek support

 MAINTAINERS                                  |    1 +
 arch/arm/cpu/armv7/at91/Makefile             |   52 +++++
 arch/arm/cpu/armv7/at91/clock.c              |  125 ++++++++++++
 arch/arm/cpu/armv7/at91/cpu.c                |   90 +++++++++
 arch/arm/cpu/armv7/at91/reset.c              |   47 +++++
 arch/arm/cpu/armv7/at91/sama5d3_devices.c    |  196 ++++++++++++++++++
 arch/arm/cpu/armv7/at91/timer.c              |  139 +++++++++++++
 arch/arm/include/asm/arch-at91/at91_dbu.h    |    4 +
 arch/arm/include/asm/arch-at91/at91_pmc.h    |   23 +++
 arch/arm/include/asm/arch-at91/clk.h         |    1 +
 arch/arm/include/asm/arch-at91/hardware.h    |    2 +
 arch/arm/include/asm/arch-at91/sama5d3.h     |  212 ++++++++++++++++++++
 arch/arm/include/asm/arch-at91/sama5d3_smc.h |   79 ++++++++
 board/atmel/sama5d3xek/Makefile              |   51 +++++
 board/atmel/sama5d3xek/sama5d3xek.c          |  275 ++++++++++++++++++++++++++
 boards.cfg                                   |    3 +
 drivers/usb/host/ohci-at91.c                 |   14 +-
 include/configs/sama5d3xek.h                 |  245 +++++++++++++++++++++++
 18 files changed, 1557 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/at91/Makefile
 create mode 100644 arch/arm/cpu/armv7/at91/clock.c
 create mode 100644 arch/arm/cpu/armv7/at91/cpu.c
 create mode 100644 arch/arm/cpu/armv7/at91/reset.c
 create mode 100644 arch/arm/cpu/armv7/at91/sama5d3_devices.c
 create mode 100644 arch/arm/cpu/armv7/at91/timer.c
 create mode 100644 arch/arm/include/asm/arch-at91/sama5d3.h
 create mode 100644 arch/arm/include/asm/arch-at91/sama5d3_smc.h
 create mode 100644 board/atmel/sama5d3xek/Makefile
 create mode 100644 board/atmel/sama5d3xek/sama5d3xek.c
 create mode 100644 include/configs/sama5d3xek.h
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/3 ARM: at91: add Atmel sama5d3 SoC new pmc register

Add Atmel sama5d3 SoC new pmc register

---
Changes in v3:
- New splitted patch file.

Changes in v2:
- No change

 arch/arm/include/asm/arch-at91/at91_pmc.h |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm/include/asm/arch-at91/at91_pmc.h +23 -0
index 086cb9b..66075b4 100644
@@ -55,7 +55,16 @@ typedef struct at91_pmc {
 	u32	reserved5[21];
 	u32	wpmr;		/* 0xE4 Write Protect Mode Register (CAP0) */
 	u32	wpsr;		/* 0xE8 Write Protect Status Register (CAP0) */
+#ifdef CONFIG_SAMA5D3
+	u32	reserved6[8];
+	u32	pcer1;		/* 0x100 Periperial Clock Enable Register 1 */
+	u32	pcdr1;		/* 0x104 Periperial Clock Disable Register 1 */
+	u32	pcsr1;		/* 0x108 Periperial Clock Status Register 1 */
+	u32	pcr;		/* 0x10c Periperial Control Register */
+	u32	ocr;		/* 0x110 Oscillator Calibration Register */
+#else
 	u32	reserved8[5];
+#endif
 } at91_pmc_t;
 
 #endif	/* end not assembly */
@@ -82,6 +91,16 @@ typedef struct at91_pmc {
 #define AT91_PMC_MCKR_CSS_PLLB		0x00000003
 #define AT91_PMC_MCKR_CSS_MASK		0x00000003
 
+#ifdef CONFIG_SAMA5D3
+#define AT91_PMC_MCKR_PRES_1		0x00000000
+#define AT91_PMC_MCKR_PRES_2		0x00000010
+#define AT91_PMC_MCKR_PRES_4		0x00000020
+#define AT91_PMC_MCKR_PRES_8		0x00000030
+#define AT91_PMC_MCKR_PRES_16		0x00000040
+#define AT91_PMC_MCKR_PRES_32		0x00000050
+#define AT91_PMC_MCKR_PRES_64		0x00000060
+#define AT91_PMC_MCKR_PRES_MASK		0x00000070
+#else
 #define AT91_PMC_MCKR_PRES_1		0x00000000
 #define AT91_PMC_MCKR_PRES_2		0x00000004
 #define AT91_PMC_MCKR_PRES_4		0x00000008
@@ -90,6 +109,7 @@ typedef struct at91_pmc {
 #define AT91_PMC_MCKR_PRES_32		0x00000014
 #define AT91_PMC_MCKR_PRES_64		0x00000018
 #define AT91_PMC_MCKR_PRES_MASK		0x0000001C
+#endif
 
 #ifdef CONFIG_AT91RM9200
 #define AT91_PMC_MCKR_MDIV_1		0x00000000
@@ -100,6 +120,9 @@ typedef struct at91_pmc {
 #else
 #define AT91_PMC_MCKR_MDIV_1		0x00000000
 #define AT91_PMC_MCKR_MDIV_2		0x00000100
+#ifdef CONFIG_SAMA5D3
+#define AT91_PMC_MCKR_MDIV_3		0x00000300
+#endif
 #define AT91_PMC_MCKR_MDIV_4		0x00000200
 #define AT91_PMC_MCKR_MDIV_MASK		0x00000300
 #endif
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/3 ARM: at91: add Atmel sama5d3 SoC new pmc register

Dear Bo Shen,

Quoted 8 lines · Bo Shen

Add Atmel sama5d3 SoC new pmc register

---
Changes in v3:
- New splitted patch file.

Quoted 5 lines

Changes in v2:
- No change

arch/arm/include/asm/arch-at91/at91_pmc.h | 23 +++++++++++++++++++++++

1 file changed, 23 insertions(+)

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

Best regards,
Andreas Bie?mann

#3 lore raw

PATCH 1/3 ARM: at91: fix and update README.at91 document

Dear Bo Shen,

Quoted 11 lines · Bo Shen

This patch implement following things
- The link no longer accessable
- Remove the error configuration command
- Update soldered data flash memory map
- Update at91sam9m10g45ek memory size to 128MiB

---
doc/README.at91 | 23 ++++++-----------------

1 file changed, 6 insertions(+), 17 deletions(-)

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

Best regards,
Andreas Bie?mann

#4 lore raw

PATCH 2/3 USB: ohci-at91: support sama5d3x devices

In reply to Andreas Bießmann

Dear Bo Shen,

Quoted 8 lines · Bo Shen

Add OHCI support for sama5d3x devices

---
Changes in v3:
- Rebase to u-boot-atmel master branch

Quoted 5 lines

Changes in v2:
- No Change

drivers/usb/host/ohci-at91.c | 14 ++++++++++++--

1 file changed, 12 insertions(+), 2 deletions(-)

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

Best regards,
Andreas Bie?mann

#5 lore raw

PATCH 2/3 ARM: at91: add at91sam9x5 and sama5d3x information

In reply to Andreas Bießmann

Dear Bo Shen,

Quoted 9 lines · Bo Shen

This patch add following EK information
- at91sam9n12ek, at91sam9x5ek
- sama5d3xek

---
doc/README.at91 | 42 ++++++++++++++++++++++++++++++++++++++++++

1 file changed, 42 insertions(+)

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

Best regards,
Andreas Bie?mann

#6 lore raw

PATCH 3/3 ARM: atmel: add sama5d3xek support

In reply to Andreas Bießmann

Dear Bo Shen,

Quoted 42 lines · Bo Shen

Add sama5d3xek support with following feature
- boot from NAND flash, PMECC support, 4bit ECC @ 512 bytes sector
- boot from SPI flash support
- boot from SD card support
- LCD support
- EMAC support
- USB OHCI support

---
Changes in v3:
- Split new pmc register in a standalone patch
- The EMAC support need: net: macb: using AT91FAMILY replace #ifdeferry
- http://patchwork.ozlabs.org/patch/239064/

Changes in v2:
- Remove unneeded #undef
- Using string directly
- Add missed copyright
- Using pull up for usart Tx line
- Using pull up for spi cs
- make code more readable in clock.c file
- move LCD higher 8 bit to board file (This is board related)

MAINTAINERS                                  |    1 +
arch/arm/cpu/armv7/at91/Makefile             |   52 +++++
arch/arm/cpu/armv7/at91/clock.c              |  125 ++++++++++++
arch/arm/cpu/armv7/at91/cpu.c                |   90 +++++++++
arch/arm/cpu/armv7/at91/reset.c              |   47 +++++
arch/arm/cpu/armv7/at91/sama5d3_devices.c    |  196 ++++++++++++++++++
arch/arm/cpu/armv7/at91/timer.c              |  139 +++++++++++++
arch/arm/include/asm/arch-at91/at91_dbu.h    |    4 +
arch/arm/include/asm/arch-at91/clk.h         |    1 +
arch/arm/include/asm/arch-at91/hardware.h    |    2 +
arch/arm/include/asm/arch-at91/sama5d3.h     |  212 ++++++++++++++++++++
arch/arm/include/asm/arch-at91/sama5d3_smc.h |   79 ++++++++
board/atmel/sama5d3xek/Makefile              |   51 +++++
board/atmel/sama5d3xek/sama5d3xek.c          |  275 ++++++++++++++++++++++++++
boards.cfg                                   |    3 +
include/configs/sama5d3xek.h                 |  245 +++++++++++++++++++++++
16 files changed, 1522 insertions(+)
Quoted 11 lines

create mode 100644 arch/arm/cpu/armv7/at91/Makefile create mode 100644 arch/arm/cpu/armv7/at91/clock.c create mode 100644 arch/arm/cpu/armv7/at91/cpu.c create mode 100644 arch/arm/cpu/armv7/at91/reset.c create mode 100644 arch/arm/cpu/armv7/at91/sama5d3_devices.c create mode 100644 arch/arm/cpu/armv7/at91/timer.c create mode 100644 arch/arm/include/asm/arch-at91/sama5d3.h create mode 100644 arch/arm/include/asm/arch-at91/sama5d3_smc.h create mode 100644 board/atmel/sama5d3xek/Makefile create mode 100644 board/atmel/sama5d3xek/sama5d3xek.c create mode 100644 include/configs/sama5d3xek.h

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

Best regards,
Andreas Bie?mann

#7 lore raw

PATCH 3/3 ARM: at91: add NAND partition table and index

In reply to Andreas Bießmann

Dear Bo Shen,

Quoted 10 lines · Bo Shen

Add NAND partition table, EK board support boot up NAND flash using the same NAND partition table

Add Index in this file

---
doc/README.at91 | 21 ++++++++++++++++++++-

1 file changed, 20 insertions(+), 1 deletion(-)

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

Best regards,
Andreas Bie?mann

author
#8 lore raw

PATCH 2/3 USB: ohci-at91: support sama5d3x devices

In reply to Bo Shen

Add OHCI support for sama5d3x devices

---
Changes in v3:
- Rebase to u-boot-atmel master branch

Changes in v2:
- No Change

 drivers/usb/host/ohci-at91.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-at91.c +12 -2
index efd711d..086cd0f 100644
@@ -42,7 +42,7 @@ int usb_cpu_init(void)
 	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
 		;
 #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
-	defined(CONFIG_AT91SAM9X5)
+	defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3)
 	/* Enable UPLL */
 	writel(readl(&pmc->uckr) | AT91_PMC_UPLLEN | AT91_PMC_BIASEN,
 		&pmc->uckr);
@@ -54,7 +54,12 @@ int usb_cpu_init(void)
 #endif
 
 	/* Enable USB host clock. */
+#ifdef CONFIG_SAMA5D3
+	writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcer1);
+#else
 	writel(1 << ATMEL_ID_UHP, &pmc->pcer);
+#endif
+
 #ifdef CONFIG_AT91SAM9261
 	writel(ATMEL_PMC_UHP | AT91_PMC_HCK0, &pmc->scer);
 #else
@@ -69,7 +74,12 @@ int usb_cpu_stop(void)
 	at91_pmc_t *pmc	= (at91_pmc_t *)ATMEL_BASE_PMC;
 
 	/* Disable USB host clock. */
+#ifdef CONFIG_SAMA5D3
+	writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcdr1);
+#else
 	writel(1 << ATMEL_ID_UHP, &pmc->pcdr);
+#endif
+
 #ifdef CONFIG_AT91SAM9261
 	writel(ATMEL_PMC_UHP | AT91_PMC_HCK0, &pmc->scdr);
 #else
@@ -83,7 +93,7 @@ int usb_cpu_stop(void)
 	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != 0)
 		;
 #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
-	defined(CONFIG_AT91SAM9X5)
+	defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3)
 	/* Disable UPLL */
 	writel(readl(&pmc->uckr) & (~AT91_PMC_UPLLEN), &pmc->uckr);
 	while ((readl(&pmc->sr) & AT91_PMC_LOCKU) == AT91_PMC_LOCKU)
Signature · 1 line
1.7.9.5
author
#9 lore raw

PATCH 3/3 ARM: atmel: add sama5d3xek support

In reply to Bo Shen

Add sama5d3xek support with following feature
- boot from NAND flash, PMECC support, 4bit ECC @ 512 bytes sector
- boot from SPI flash support
- boot from SD card support
- LCD support
- EMAC support
- USB OHCI support

---
Changes in v3:
- Split new pmc register in a standalone patch
- The EMAC support need: net: macb: using AT91FAMILY replace #ifdeferry
- http://patchwork.ozlabs.org/patch/239064/

Changes in v2:
- Remove unneeded #undef
- Using string directly
- Add missed copyright
- Using pull up for usart Tx line
- Using pull up for spi cs
- make code more readable in clock.c file
- move LCD higher 8 bit to board file (This is board related)

 MAINTAINERS                                  |    1 +
 arch/arm/cpu/armv7/at91/Makefile             |   52 +++++
 arch/arm/cpu/armv7/at91/clock.c              |  125 ++++++++++++
 arch/arm/cpu/armv7/at91/cpu.c                |   90 +++++++++
 arch/arm/cpu/armv7/at91/reset.c              |   47 +++++
 arch/arm/cpu/armv7/at91/sama5d3_devices.c    |  196 ++++++++++++++++++
 arch/arm/cpu/armv7/at91/timer.c              |  139 +++++++++++++
 arch/arm/include/asm/arch-at91/at91_dbu.h    |    4 +
 arch/arm/include/asm/arch-at91/clk.h         |    1 +
 arch/arm/include/asm/arch-at91/hardware.h    |    2 +
 arch/arm/include/asm/arch-at91/sama5d3.h     |  212 ++++++++++++++++++++
 arch/arm/include/asm/arch-at91/sama5d3_smc.h |   79 ++++++++
 board/atmel/sama5d3xek/Makefile              |   51 +++++
 board/atmel/sama5d3xek/sama5d3xek.c          |  275 ++++++++++++++++++++++++++
 boards.cfg                                   |    3 +
 include/configs/sama5d3xek.h                 |  245 +++++++++++++++++++++++
 16 files changed, 1522 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/at91/Makefile
 create mode 100644 arch/arm/cpu/armv7/at91/clock.c
 create mode 100644 arch/arm/cpu/armv7/at91/cpu.c
 create mode 100644 arch/arm/cpu/armv7/at91/reset.c
 create mode 100644 arch/arm/cpu/armv7/at91/sama5d3_devices.c
 create mode 100644 arch/arm/cpu/armv7/at91/timer.c
 create mode 100644 arch/arm/include/asm/arch-at91/sama5d3.h
 create mode 100644 arch/arm/include/asm/arch-at91/sama5d3_smc.h
 create mode 100644 board/atmel/sama5d3xek/Makefile
 create mode 100644 board/atmel/sama5d3xek/sama5d3xek.c
 create mode 100644 include/configs/sama5d3xek.h
MAINTAINERS +1 -0
index efc2ecc..2bd0a98 100644
@@ -918,6 +918,7 @@ Matt Sealey <[email protected]>
 
 Bo Shen <[email protected]>
 	at91sam9x5ek		ARM926EJS (AT91SAM9G15,G25,G35,X25,X35 SoC)
+	sama5d3xek		ARMV7 (SAMA5D31, D33, D34, D35 SoC)
 
 Rajeshwari Shinde <[email protected]>
 
arch/arm/cpu/armv7/at91/Makefile new file +52 -0

52 lines not on this page · raw message

arch/arm/cpu/armv7/at91/clock.c new file +125 -0

125 lines not on this page · raw message

arch/arm/cpu/armv7/at91/cpu.c new file +90 -0

90 lines not on this page · raw message

arch/arm/cpu/armv7/at91/reset.c new file +47 -0

47 lines not on this page · raw message

arch/arm/cpu/armv7/at91/sama5d3_devices.c new file +196 -0

196 lines not on this page · raw message

arch/arm/cpu/armv7/at91/timer.c new file +139 -0

139 lines not on this page · raw message

arch/arm/include/asm/arch-at91/at91_dbu.h +4 -0
index 3429293..9a640a5 100644
@@ -38,4 +38,8 @@ typedef struct at91_dbu {
 #define AT91_DBU_CID_ARCH_9xx		0x01900000
 #define AT91_DBU_CID_ARCH_9XExx	0x02900000
 
+#define AT91_DBU_CIDR_MASK		0x1f
+#define AT91_DBU_CIDR			0x40
+#define AT91_DBU_EXID			0x44
+
 #endif
arch/arm/include/asm/arch-at91/clk.h +1 -0
index d4852a3..04b0f83 100644
@@ -95,4 +95,5 @@ static inline unsigned long get_mci_clk_rate(void)
 }
 
 int at91_clock_init(unsigned long main_clock);
+void at91_periph_clk_enable(int id);
 #endif /* __ASM_ARM_ARCH_CLK_H__ */
arch/arm/include/asm/arch-at91/hardware.h +2 -0
index 8812b11..b04641e 100644
@@ -43,6 +43,8 @@
 # include <asm/arch/at91cap9.h>
 #elif defined(CONFIG_AT91X40)
 # include <asm/arch/at91x40.h>
+#elif defined(CONFIG_SAMA5D3)
+# include <asm/arch/sama5d3.h>
 #else
 # error "Unsupported AT91 processor"
 #endif
arch/arm/include/asm/arch-at91/sama5d3.h new file +212 -0

212 lines not on this page · raw message

arch/arm/include/asm/arch-at91/sama5d3_smc.h new file +79 -0

79 lines not on this page · raw message

board/atmel/sama5d3xek/Makefile new file +51 -0

51 lines not on this page · raw message

board/atmel/sama5d3xek/sama5d3xek.c new file +275 -0

275 lines not on this page · raw message

boards.cfg +3 -0
index ef1817f..c99bab8 100644
@@ -249,6 +249,9 @@ am335x_evm_uart5             arm         armv7       am335x              ti
 am335x_evm_usbspl            arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,SPL_USBETH_SUPPORT
 ti814x_evm                   arm         armv7       ti814x              ti             am33xx
 pcm051                       arm         armv7       pcm051              phytec         am33xx      pcm051
+sama5d3xek_mmc               arm         armv7       sama5d3xek          atmel          at91        sama5d3xek:SAMA5D3,SYS_USE_MMC
+sama5d3xek_nandflash         arm         armv7       sama5d3xek          atmel          at91        sama5d3xek:SAMA5D3,SYS_USE_NANDFLASH
+sama5d3xek_spiflash          arm         armv7       sama5d3xek          atmel          at91        sama5d3xek:SAMA5D3,SYS_USE_SERIALFLASH
 highbank                     arm         armv7       highbank            -              highbank
 m53evk                       arm         armv7       m53evk              denx		mx5		m53evk:IMX_CONFIG=board/denx/m53evk/imximage.cfg
 mx51_efikamx                 arm         armv7       mx51_efikamx        genesi         mx5		mx51_efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKAMX,IMX_CONFIG=board/genesi/mx51_efikamx/imximage_mx.cfg
include/configs/sama5d3xek.h new file +245 -0

245 lines not on this page · raw message

Signature · 1 line
1.7.9.5