Skip to contentSkip to conversation

arm: atmel: Add SAMA5D2 Xplained board

PATCH New Wenyou Yang 3 participants 4 messages Oct 30, 2015 – Nov 30, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 arm: atmel: Add SAMA5D2 Xplained board

The board supports following features:
- Boot media support: SD card/e.MMC/SPI flash,
- Support LCD display (optional, disabled by default),
- Support ethernet,
- Support USB mass storage.

---
The patch is based on the following patches sent in mailing list.
[PATCH] gpio: atmel: Add the PIO4 driver support [PATCH] arm: at91: Change the Chip ID registers' addresses [PATCH v4] mmc: atmel: Add atmel sdhci support [PATCH v3] arm: at91: clock: Add the generated clock support

Changes in v6:
1./ change function invocation due to its declaration change,

	at91_enable_periph_generated_clk().

Changes in v5:
1./ remove wrong pin config for USB hw init.

Changes in v4:
1./ remove __weak attribute for has_lcdc() added in v3. 2./ remove unused goto err_exit.

Changes in v3:
1./ change defines-->definitions for more clearly in asm/arch/sama5d2.h. 2./ remove unused cpu_is_sama5d2x() macros.
3./ fix spelling error "adress".
4./ add __weak attribute for has_lcdc().
5./ remove SPL configs.

Changes in v2:
1./ re-order SAMA5D2 statements alphabetically.
2./ remove redundant "Unknown CPU type".
3./ rework sama5d2's macros.
4./ remove some #ifdef before functions.
5./ move CONFIG_CMD_SF to Kconfig.
6./ remove NAND macros from config file.
7./ CONFIG_BOOTCOMMAND for sf uses defines in at91-sama5_common.h.

 arch/arm/mach-at91/Kconfig                       |    5 +
 arch/arm/mach-at91/armv7/Makefile                |    1 +
 arch/arm/mach-at91/armv7/sama5d2_devices.c       |   59 +++++
 arch/arm/mach-at91/include/mach/at91_pmc.h       |    9 +-
 arch/arm/mach-at91/include/mach/atmel_usba_udc.h |    3 +-
 arch/arm/mach-at91/include/mach/hardware.h       |    2 +
 arch/arm/mach-at91/include/mach/sama5d2.h        |  203 ++++++++++++++++
 board/atmel/sama5d2_xplained/Kconfig             |   15 ++
 board/atmel/sama5d2_xplained/MAINTAINERS         |    7 +
 board/atmel/sama5d2_xplained/Makefile            |    8 +
 board/atmel/sama5d2_xplained/sama5d2_xplained.c  |  284 ++++++++++++++++++++++
 configs/sama5d2_xplained_mmc_defconfig           |   11 +
 configs/sama5d2_xplained_spiflash_defconfig      |   11 +
 include/configs/sama5d2_xplained.h               |  122 ++++++++++
 14 files changed, 734 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/mach-at91/armv7/sama5d2_devices.c
 create mode 100644 arch/arm/mach-at91/include/mach/sama5d2.h
 create mode 100644 board/atmel/sama5d2_xplained/Kconfig
 create mode 100644 board/atmel/sama5d2_xplained/MAINTAINERS
 create mode 100644 board/atmel/sama5d2_xplained/Makefile
 create mode 100644 board/atmel/sama5d2_xplained/sama5d2_xplained.c
 create mode 100644 configs/sama5d2_xplained_mmc_defconfig
 create mode 100644 configs/sama5d2_xplained_spiflash_defconfig
 create mode 100644 include/configs/sama5d2_xplained.h
arch/arm/mach-at91/Kconfig +5 -0
index fdaf328..c333647 100644
@@ -71,6 +71,10 @@ config TARGET_AT91SAM9X5EK
 	select CPU_ARM926EJS
 	select SUPPORT_SPL
 
+config TARGET_SAMA5D2_XPLAINED
+	bool "SAMA5D2 Xplained board"
+	select CPU_V7
+
 config TARGET_SAMA5D3_XPLAINED
 	bool "SAMA5D3 Xplained board"
 	select CPU_V7
@@ -123,6 +127,7 @@ source "board/atmel/at91sam9m10g45ek/Kconfig"
 source "board/atmel/at91sam9n12ek/Kconfig"
 source "board/atmel/at91sam9rlek/Kconfig"
 source "board/atmel/at91sam9x5ek/Kconfig"
+source "board/atmel/sama5d2_xplained/Kconfig"
 source "board/atmel/sama5d3_xplained/Kconfig"
 source "board/atmel/sama5d3xek/Kconfig"
 source "board/atmel/sama5d4_xplained/Kconfig"
arch/arm/mach-at91/armv7/Makefile +1 -0
index f4f35a4..9538bc1 100644
@@ -8,6 +8,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
+obj-$(CONFIG_SAMA5D2)	+= sama5d2_devices.o
 obj-$(CONFIG_SAMA5D3)	+= sama5d3_devices.o
 obj-$(CONFIG_SAMA5D4)	+= sama5d4_devices.o
 obj-y += clock.o
arch/arm/mach-at91/armv7/sama5d2_devices.c new file +59 -0

59 lines not on this page · raw message

arch/arm/mach-at91/include/mach/at91_pmc.h +4 -5
index 8a3fb94..5adaa30 100644
@@ -78,7 +78,8 @@ typedef struct at91_pmc {
 #define AT91_PMC_PLLXR_DIV(x)		(x & 0xFF)
 #define AT91_PMC_PLLXR_PLLCOUNT(x)	((x & 0x3F) << 8)
 #define AT91_PMC_PLLXR_OUT(x)		((x & 0x03) << 14)
-#if defined(CONFIG_SAMA5D3) || defined(CONFIG_SAMA5D4)
+#if defined(CONFIG_SAMA5D2) || defined(CONFIG_SAMA5D3) || \
+	defined(CONFIG_SAMA5D4)
 #define AT91_PMC_PLLXR_MUL(x)		((x & 0x7F) << 18)
 #else
 #define AT91_PMC_PLLXR_MUL(x)		((x & 0x7FF) << 16)
@@ -97,7 +98,8 @@ typedef struct at91_pmc {
 #define AT91_PMC_MCKR_CSS_PLLB		0x00000003
 #define AT91_PMC_MCKR_CSS_MASK		0x00000003
 
-#if defined(CONFIG_SAMA5D3) || defined(CONFIG_SAMA5D4) || \
+#if defined(CONFIG_SAMA5D2) || defined(CONFIG_SAMA5D3) || \
+	defined(CONFIG_SAMA5D4) || \
 	defined(CONFIG_AT91SAM9X5) || defined(CONFIG_AT91SAM9N12)
 #define AT91_PMC_MCKR_PRES_1		0x00000000
 #define AT91_PMC_MCKR_PRES_2		0x00000010
@@ -127,10 +129,7 @@ typedef struct at91_pmc {
 #else
 #define AT91_PMC_MCKR_MDIV_1		0x00000000
 #define AT91_PMC_MCKR_MDIV_2		0x00000100
-#if defined(CONFIG_SAMA5D3) || defined(CONFIG_SAMA5D4) || \
-	defined(CONFIG_AT91SAM9X5) || defined(CONFIG_AT91SAM9N12)
 #define AT91_PMC_MCKR_MDIV_3		0x00000300
-#endif
 #define AT91_PMC_MCKR_MDIV_4		0x00000200
 #define AT91_PMC_MCKR_MDIV_MASK		0x00000300
 #endif
arch/arm/mach-at91/include/mach/atmel_usba_udc.h +2 -1
index 38b5012..46a329b 100644
@@ -31,7 +31,8 @@ static struct usba_ep_data usba_udc_ep[] = {
 	EP("ep5", 5, 1024, 3, 1, 1),
 	EP("ep6", 6, 1024, 3, 1, 1),
 };
-#elif defined(CONFIG_SAMA5D3) || defined(CONFIG_SAMA5D4)
+#elif defined(CONFIG_SAMA5D2) || defined(CONFIG_SAMA5D3) || \
+	defined(CONFIG_SAMA5D4)
 static struct usba_ep_data usba_udc_ep[] = {
 	EP("ep0", 0, 64, 1, 0, 0),
 	EP("ep1", 1, 1024, 3, 1, 0),
arch/arm/mach-at91/include/mach/hardware.h +2 -0
index ff6b71b..38abfda 100644
@@ -23,6 +23,8 @@
 # include <asm/arch/at91sam9g45.h>
 #elif defined(CONFIG_AT91SAM9N12) || defined(CONFIG_AT91SAM9X5)
 # include <asm/arch/at91sam9x5.h>
+#elif defined(CONFIG_SAMA5D2)
+# include <asm/arch/sama5d2.h>
 #elif defined(CONFIG_SAMA5D3)
 # include <asm/arch/sama5d3.h>
 #elif defined(CONFIG_SAMA5D4)
arch/arm/mach-at91/include/mach/sama5d2.h new file +203 -0

203 lines not on this page · raw message

board/atmel/sama5d2_xplained/Kconfig new file +15 -0
new file mode 100644
index 0000000..55712e9
@@ -0,0 +1,15 @@
+if TARGET_SAMA5D2_XPLAINED
+
+config SYS_BOARD
+	default "sama5d2_xplained"
+
+config SYS_VENDOR
+	default "atmel"
+
+config SYS_SOC
+	default "at91"
+
+config SYS_CONFIG_NAME
+	default "sama5d2_xplained"
+
+endif
board/atmel/sama5d2_xplained/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000..ff9c86f
@@ -0,0 +1,7 @@
+SAMA5D2 XPLAINED BOARD
+M:	Wenyou Yang <[email protected]>
+S:	Maintained
+F:	board/atmel/sama5d2_xplained/
+F:	include/configs/sama5d2_xplained.h
+F:	configs/sama5d2_xplained_mmc_defconfig
+F:	configs/sama5d2_xplained_spiflash_defconfig
board/atmel/sama5d2_xplained/Makefile new file +8 -0
new file mode 100644
index 0000000..420870b
@@ -0,0 +1,8 @@
+#
+# Copyright (C) 2015 Atmel Corporation
+#		     Wenyou Yang <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += sama5d2_xplained.o
board/atmel/sama5d2_xplained/sama5d2_xplained.c new file +284 -0

284 lines not on this page · raw message

configs/sama5d2_xplained_mmc_defconfig new file +11 -0
new file mode 100644
index 0000000..c1dcbef
@@ -0,0 +1,11 @@
+CONFIG_ARM=y
+CONFIG_ARCH_AT91=y
+CONFIG_TARGET_SAMA5D2_XPLAINED=y
+CONFIG_SYS_EXTRA_OPTIONS="SAMA5D2,SYS_USE_MMC"
+# CONFIG_CMD_IMI is not set
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_LOADS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_SF=y
+# CONFIG_CMD_FPGA is not set
+CONFIG_SPI_FLASH=y
configs/sama5d2_xplained_spiflash_defconfig new file +11 -0
new file mode 100644
index 0000000..0271e8e
@@ -0,0 +1,11 @@
+CONFIG_ARM=y
+CONFIG_ARCH_AT91=y
+CONFIG_TARGET_SAMA5D2_XPLAINED=y
+CONFIG_SYS_EXTRA_OPTIONS="SAMA5D2,SYS_USE_SERIALFLASH"
+# CONFIG_CMD_IMI is not set
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_LOADS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_SF=y
+# CONFIG_CMD_FPGA is not set
+CONFIG_SPI_FLASH=y
include/configs/sama5d2_xplained.h new file +122 -0

122 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v6 1/1 arm: atmel: Add SAMA5D2 Xplained board

Hi Wenyou,

Quoted 7 lines · Wenyou Yang

The board supports following features:
- Boot media support: SD card/e.MMC/SPI flash,
- Support LCD display (optional, disabled by default),
- Support ethernet,
- Support USB mass storage.

I'll fix a few checkpatch warnings while applying

Andreas

Quoted 58 lines

---
The patch is based on the following patches sent in mailing list.
[PATCH] gpio: atmel: Add the PIO4 driver support [PATCH] arm: at91: Change the Chip ID registers' addresses [PATCH v4] mmc: atmel: Add atmel sdhci support [PATCH v3] arm: at91: clock: Add the generated clock support

Changes in v6:
1./ change function invocation due to its declaration change,

	at91_enable_periph_generated_clk().

Changes in v5:
1./ remove wrong pin config for USB hw init.

Changes in v4:
1./ remove __weak attribute for has_lcdc() added in v3. 2./ remove unused goto err_exit.

Changes in v3:
1./ change defines-->definitions for more clearly in asm/arch/sama5d2.h. 2./ remove unused cpu_is_sama5d2x() macros.
3./ fix spelling error "adress".
4./ add __weak attribute for has_lcdc().
5./ remove SPL configs.

Changes in v2:
1./ re-order SAMA5D2 statements alphabetically.
2./ remove redundant "Unknown CPU type".
3./ rework sama5d2's macros.
4./ remove some #ifdef before functions.
5./ move CONFIG_CMD_SF to Kconfig.
6./ remove NAND macros from config file.
7./ CONFIG_BOOTCOMMAND for sf uses defines in at91-sama5_common.h.

 arch/arm/mach-at91/Kconfig                       |    5 +
 arch/arm/mach-at91/armv7/Makefile                |    1 +
 arch/arm/mach-at91/armv7/sama5d2_devices.c       |   59 +++++
 arch/arm/mach-at91/include/mach/at91_pmc.h       |    9 +-
 arch/arm/mach-at91/include/mach/atmel_usba_udc.h |    3 +-
 arch/arm/mach-at91/include/mach/hardware.h       |    2 +
 arch/arm/mach-at91/include/mach/sama5d2.h        |  203 ++++++++++++++++
 board/atmel/sama5d2_xplained/Kconfig             |   15 ++
 board/atmel/sama5d2_xplained/MAINTAINERS         |    7 +
 board/atmel/sama5d2_xplained/Makefile            |    8 +
 board/atmel/sama5d2_xplained/sama5d2_xplained.c  |  284 ++++++++++++++++++++++
 configs/sama5d2_xplained_mmc_defconfig           |   11 +
 configs/sama5d2_xplained_spiflash_defconfig      |   11 +
 include/configs/sama5d2_xplained.h               |  122 ++++++++++
 14 files changed, 734 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/mach-at91/armv7/sama5d2_devices.c
 create mode 100644 arch/arm/mach-at91/include/mach/sama5d2.h
 create mode 100644 board/atmel/sama5d2_xplained/Kconfig
 create mode 100644 board/atmel/sama5d2_xplained/MAINTAINERS
 create mode 100644 board/atmel/sama5d2_xplained/Makefile
 create mode 100644 board/atmel/sama5d2_xplained/sama5d2_xplained.c
 create mode 100644 configs/sama5d2_xplained_mmc_defconfig
 create mode 100644 configs/sama5d2_xplained_spiflash_defconfig
 create mode 100644 include/configs/sama5d2_xplained.h
#2 lore raw

PATCH v6 1/1 arm: atmel: Add SAMA5D2 Xplained board

Hi Andreas,

Quoted 16 lines

-----Original Message-----
From: Andreas Bie?mann [mailto:andreas.devel at googlemail.com]
Sent: 2015?11?24? 0:29
To: Yang, Wenyou; U-Boot Mailing List
Cc: Bo Shen
Subject: Re: [U-Boot] [PATCH v6] arm: atmel: Add SAMA5D2 Xplained board

Hi Wenyou,

Quoted 6 lines · Wenyou Yang

The board supports following features:
- Boot media support: SD card/e.MMC/SPI flash,
- Support LCD display (optional, disabled by default),
- Support ethernet,
- Support USB mass storage.

Quoted 3 lines
Quoted 1 line

I'll fix a few checkpatch warnings while applying

Thank you very much for your review and your help,

Quoted 48 lines

Andreas

Quoted 34 lines

---
The patch is based on the following patches sent in mailing list.
[PATCH] gpio: atmel: Add the PIO4 driver support [PATCH] arm: at91: Change the Chip ID registers' addresses [PATCH v4] mmc: atmel: Add atmel sdhci support [PATCH v3] arm: at91: clock: Add the generated clock support

Changes in v6:
1./ change function invocation due to its declaration change,

	at91_enable_periph_generated_clk().

Changes in v5:
1./ remove wrong pin config for USB hw init.

Changes in v4:
1./ remove __weak attribute for has_lcdc() added in v3. 2./ remove unused goto err_exit.

Changes in v3:
1./ change defines-->definitions for more clearly in asm/arch/sama5d2.h. 2./ remove unused cpu_is_sama5d2x() macros.
3./ fix spelling error "adress".
4./ add __weak attribute for has_lcdc().
5./ remove SPL configs.

Changes in v2:
1./ re-order SAMA5D2 statements alphabetically.
2./ remove redundant "Unknown CPU type".
3./ rework sama5d2's macros.
4./ remove some #ifdef before functions.
5./ move CONFIG_CMD_SF to Kconfig.
6./ remove NAND macros from config file.
7./ CONFIG_BOOTCOMMAND for sf uses defines in at91-sama5_common.h.

Quoted 11 lines
 arch/arm/mach-at91/Kconfig                       |    5 +
 arch/arm/mach-at91/armv7/Makefile                |    1 +
 arch/arm/mach-at91/armv7/sama5d2_devices.c       |   59 +++++
 arch/arm/mach-at91/include/mach/at91_pmc.h       |    9 +-
 arch/arm/mach-at91/include/mach/atmel_usba_udc.h |    3 +-
 arch/arm/mach-at91/include/mach/hardware.h       |    2 +
 arch/arm/mach-at91/include/mach/sama5d2.h        |  203 ++++++++++++++++
 board/atmel/sama5d2_xplained/Kconfig             |   15 ++
 board/atmel/sama5d2_xplained/MAINTAINERS         |    7 +
 board/atmel/sama5d2_xplained/Makefile            |    8 +
 board/atmel/sama5d2_xplained/sama5d2_xplained.c  |  284
Quoted 14 lines

++++++++++++++++++++++

Quoted 13 lines
 configs/sama5d2_xplained_mmc_defconfig           |   11 +
 configs/sama5d2_xplained_spiflash_defconfig      |   11 +
 include/configs/sama5d2_xplained.h               |  122 ++++++++++
 14 files changed, 734 insertions(+), 6 deletions(-)  create mode
100644 arch/arm/mach-at91/armv7/sama5d2_devices.c
 create mode 100644 arch/arm/mach-at91/include/mach/sama5d2.h
 create mode 100644 board/atmel/sama5d2_xplained/Kconfig
 create mode 100644 board/atmel/sama5d2_xplained/MAINTAINERS
 create mode 100644 board/atmel/sama5d2_xplained/Makefile
 create mode 100644 board/atmel/sama5d2_xplained/sama5d2_xplained.c
 create mode 100644 configs/sama5d2_xplained_mmc_defconfig
 create mode 100644 configs/sama5d2_xplained_spiflash_defconfig
 create mode 100644 include/configs/sama5d2_xplained.h

Best Regards,
Wenyou Yang

#3 lore raw

PATCH v6 1/1 arm: atmel: Add SAMA5D2 Xplained board

In reply to Wenyou Yang

Dear Wenyou Yang,

Quoted 58 lines · Wenyou Yang

The board supports following features:
- Boot media support: SD card/e.MMC/SPI flash,
- Support LCD display (optional, disabled by default),
- Support ethernet,
- Support USB mass storage.

[fix checkpatch warnings]

---
The patch is based on the following patches sent in mailing list.
[PATCH] gpio: atmel: Add the PIO4 driver support [PATCH] arm: at91: Change the Chip ID registers' addresses [PATCH v4] mmc: atmel: Add atmel sdhci support [PATCH v3] arm: at91: clock: Add the generated clock support

Changes in v6:
1./ change function invocation due to its declaration change,

	at91_enable_periph_generated_clk().

Changes in v5:
1./ remove wrong pin config for USB hw init.

Changes in v4:
1./ remove __weak attribute for has_lcdc() added in v3. 2./ remove unused goto err_exit.

Changes in v3:
1./ change defines-->definitions for more clearly in asm/arch/sama5d2.h. 2./ remove unused cpu_is_sama5d2x() macros.
3./ fix spelling error "adress".
4./ add __weak attribute for has_lcdc().
5./ remove SPL configs.

Changes in v2:
1./ re-order SAMA5D2 statements alphabetically.
2./ remove redundant "Unknown CPU type".
3./ rework sama5d2's macros.
4./ remove some #ifdef before functions.
5./ move CONFIG_CMD_SF to Kconfig.
6./ remove NAND macros from config file.
7./ CONFIG_BOOTCOMMAND for sf uses defines in at91-sama5_common.h.

arch/arm/mach-at91/Kconfig                       |    5 +
arch/arm/mach-at91/armv7/Makefile                |    1 +
arch/arm/mach-at91/armv7/sama5d2_devices.c       |   59 +++++
arch/arm/mach-at91/include/mach/at91_pmc.h       |    9 +-
arch/arm/mach-at91/include/mach/atmel_usba_udc.h |    3 +-
arch/arm/mach-at91/include/mach/hardware.h       |    2 +
arch/arm/mach-at91/include/mach/sama5d2.h        |  203 ++++++++++++++++
board/atmel/sama5d2_xplained/Kconfig             |   15 ++
board/atmel/sama5d2_xplained/MAINTAINERS         |    7 +
board/atmel/sama5d2_xplained/Makefile            |    8 +
board/atmel/sama5d2_xplained/sama5d2_xplained.c  |  284 ++++++++++++++++++++++
configs/sama5d2_xplained_mmc_defconfig           |   11 +
configs/sama5d2_xplained_spiflash_defconfig      |   11 +
include/configs/sama5d2_xplained.h               |  122 ++++++++++
14 files changed, 734 insertions(+), 6 deletions(-)
Quoted 9 lines

create mode 100644 arch/arm/mach-at91/armv7/sama5d2_devices.c create mode 100644 arch/arm/mach-at91/include/mach/sama5d2.h create mode 100644 board/atmel/sama5d2_xplained/Kconfig create mode 100644 board/atmel/sama5d2_xplained/MAINTAINERS create mode 100644 board/atmel/sama5d2_xplained/Makefile create mode 100644 board/atmel/sama5d2_xplained/sama5d2_xplained.c create mode 100644 configs/sama5d2_xplained_mmc_defconfig create mode 100644 configs/sama5d2_xplained_spiflash_defconfig create mode 100644 include/configs/sama5d2_xplained.h

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

Best regards,
Andreas Bie?mann