Skip to contentSkip to conversation

board: atmel: Add new board SAMA5D2 PTC EK

PATCH New Wenyou Yang 2 participants 5 messages Nov 17, 2017 – Nov 30, 2017

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

cover board: atmel: Add new board SAMA5D2 PTC EK

Add the new board SAMA5D2 PTC EK and remove the SAMA5D2 PTC ENGI board which was a prototype.

Ludovic Desroches (2):
ARM: at91: add sama5d2 smc header
board: atmel: add sama5d2_ptc_ek board

 arch/arm/dts/Makefile                              |   3 +
 arch/arm/dts/at91-sama5d2_ptc_ek.dts               | 215 ++++++++++++++++
 arch/arm/dts/sama5d2.dtsi                          |  18 ++
 arch/arm/mach-at91/Kconfig                         |   7 +-
 arch/arm/mach-at91/include/mach/sama5d2_smc.h      |  76 ++++++
 board/atmel/sama5d2_ptc/MAINTAINERS                |   7 -
 board/atmel/sama5d2_ptc/Makefile                   |   8 -
 board/atmel/sama5d2_ptc/sama5d2_ptc.c              | 285 ---------------------
 .../atmel/{sama5d2_ptc => sama5d2_ptc_ek}/Kconfig  |   6 +-
 board/atmel/sama5d2_ptc_ek/MAINTAINERS             |   8 +
 board/atmel/sama5d2_ptc_ek/Makefile                |   8 +
 board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c        | 130 ++++++++++
 configs/sama5d2_ptc_ek_mmc_defconfig               |  60 +++++
 configs/sama5d2_ptc_ek_nandflash_defconfig         |  60 +++++
 configs/sama5d2_ptc_nandflash_defconfig            |  33 ---
 configs/sama5d2_ptc_spiflash_defconfig             |  34 ---
 include/configs/sama5d2_ptc.h                      | 114 ---------
 include/configs/sama5d2_ptc_ek.h                   |  46 ++++
 18 files changed, 630 insertions(+), 488 deletions(-)
 create mode 100644 arch/arm/dts/at91-sama5d2_ptc_ek.dts
 create mode 100644 arch/arm/mach-at91/include/mach/sama5d2_smc.h
 delete mode 100644 board/atmel/sama5d2_ptc/MAINTAINERS
 delete mode 100644 board/atmel/sama5d2_ptc/Makefile
 delete mode 100644 board/atmel/sama5d2_ptc/sama5d2_ptc.c
 rename board/atmel/{sama5d2_ptc => sama5d2_ptc_ek}/Kconfig (60%)
 create mode 100644 board/atmel/sama5d2_ptc_ek/MAINTAINERS
 create mode 100644 board/atmel/sama5d2_ptc_ek/Makefile
 create mode 100644 board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c
 create mode 100644 configs/sama5d2_ptc_ek_mmc_defconfig
 create mode 100644 configs/sama5d2_ptc_ek_nandflash_defconfig
 delete mode 100644 configs/sama5d2_ptc_nandflash_defconfig
 delete mode 100644 configs/sama5d2_ptc_spiflash_defconfig
 delete mode 100644 include/configs/sama5d2_ptc.h
 create mode 100644 include/configs/sama5d2_ptc_ek.h
Signature · 1 line
2.13.0
#1 lore raw

PATCH 1/2 ARM: at91: add sama5d2 smc header

From: Ludovic Desroches <[email protected]>

Add a header for SAMA5D2 SMC since it's not compatible with SAMA5D3 one.

[wenyou: fix the wrong base address of the SMC register]

---

 arch/arm/mach-at91/include/mach/sama5d2_smc.h | 76 +++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 arch/arm/mach-at91/include/mach/sama5d2_smc.h
arch/arm/mach-at91/include/mach/sama5d2_smc.h new file +76 -0
new file mode 100644
index 0000000000..7ddb728cf3
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2017 Microchip Corporation.
+ *
+ * Static Memory Controllers (SMC) - System peripherals registers.
+ * Based on SAMA5D2 datasheet.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef SAMA5D2_SMC_H
+#define SAMA5D2_SMC_H
+
+#ifdef __ASSEMBLY__
+#define AT91_ASM_SMC_SETUP0	(ATMEL_BASE_SMC + 0x700)
+#define AT91_ASM_SMC_PULSE0	(ATMEL_BASE_SMC + 0x704)
+#define AT91_ASM_SMC_CYCLE0	(ATMEL_BASE_SMC + 0x708)
+#define AT91_ASM_SMC_TIMINGS0	(ATMEL_BASE_SMC + 0x70c)
+#define AT91_ASM_SMC_MODE0	(ATMEL_BASE_SMC + 0x710)
+#else
+struct at91_cs {
+	u32	setup;		/* 0x600 SMC Setup Register */
+	u32	pulse;		/* 0x604 SMC Pulse Register */
+	u32	cycle;		/* 0x608 SMC Cycle Register */
+	u32	timings;	/* 0x60C SMC Cycle Register */
+	u32	mode;		/* 0x610 SMC Mode Register */
+};
+
+struct at91_smc {
+	struct at91_cs cs[4];
+};
+#endif /*  __ASSEMBLY__ */
+
+#define AT91_SMC_SETUP_NWE(x)		(x & 0x3f)
+#define AT91_SMC_SETUP_NCS_WR(x)	((x & 0x3f) << 8)
+#define AT91_SMC_SETUP_NRD(x)		((x & 0x3f) << 16)
+#define AT91_SMC_SETUP_NCS_RD(x)	((x & 0x3f) << 24)
+
+#define AT91_SMC_PULSE_NWE(x)		(x & 0x7f)
+#define AT91_SMC_PULSE_NCS_WR(x)	((x & 0x7f) << 8)
+#define AT91_SMC_PULSE_NRD(x)		((x & 0x7f) << 16)
+#define AT91_SMC_PULSE_NCS_RD(x)	((x & 0x7f) << 24)
+
+#define AT91_SMC_CYCLE_NWE(x)		(x & 0x1ff)
+#define AT91_SMC_CYCLE_NRD(x)		((x & 0x1ff) << 16)
+
+#define AT91_SMC_TIMINGS_TCLR(x)	(x & 0xf)
+#define AT91_SMC_TIMINGS_TADL(x)	((x & 0xf) << 4)
+#define AT91_SMC_TIMINGS_TAR(x)		((x & 0xf) << 8)
+#define AT91_SMC_TIMINGS_OCMS(x)	((x & 0x1) << 12)
+#define AT91_SMC_TIMINGS_TRR(x)		((x & 0xf) << 16)
+#define AT91_SMC_TIMINGS_TWB(x)		((x & 0xf) << 24)
+#define AT91_SMC_TIMINGS_RBNSEL(x)	((x & 0xf) << 28)
+#define AT91_SMC_TIMINGS_NFSEL(x)	((x & 0x1) << 31)
+
+#define AT91_SMC_MODE_RM_NCS		0x00000000
+#define AT91_SMC_MODE_RM_NRD		0x00000001
+#define AT91_SMC_MODE_WM_NCS		0x00000000
+#define AT91_SMC_MODE_WM_NWE		0x00000002
+
+#define AT91_SMC_MODE_EXNW_DISABLE	0x00000000
+#define AT91_SMC_MODE_EXNW_FROZEN	0x00000020
+#define AT91_SMC_MODE_EXNW_READY	0x00000030
+
+#define AT91_SMC_MODE_BAT		0x00000100
+#define AT91_SMC_MODE_DBW_8		0x00000000
+#define AT91_SMC_MODE_DBW_16		0x00001000
+#define AT91_SMC_MODE_DBW_32		0x00002000
+#define AT91_SMC_MODE_TDF_CYCLE(x)	((x & 0xf) << 16)
+#define AT91_SMC_MODE_TDF		0x00100000
+#define AT91_SMC_MODE_PMEN		0x01000000
+#define AT91_SMC_MODE_PS_4		0x00000000
+#define AT91_SMC_MODE_PS_8		0x10000000
+#define AT91_SMC_MODE_PS_16		0x20000000
+#define AT91_SMC_MODE_PS_32		0x30000000
+
+#endif
Signature · 1 line
2.13.0
#2 lore raw

PATCH 1/2 ARM: at91: add sama5d2 smc header

Quoted 8 lines · Wenyou Yang

From: Ludovic Desroches <[email protected]>

Add a header for SAMA5D2 SMC since it's not compatible with SAMA5D3 one.

[wenyou: fix the wrong base address of the SMC register]

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171130/f70d5aff/attachment.sig>
#3 lore raw

PATCH 2/2 board: atmel: add sama5d2_ptc_ek board

In reply to Wenyou Yang

From: Ludovic Desroches <[email protected]>

Add the SAMA5D2 PTC EK board and remove the SAMA5D2 PTC ENGI board which was a prototype.

---

 arch/arm/dts/Makefile                              |   3 +
 arch/arm/dts/at91-sama5d2_ptc_ek.dts               | 215 ++++++++++++++++
 arch/arm/dts/sama5d2.dtsi                          |  18 ++
 arch/arm/mach-at91/Kconfig                         |   7 +-
 board/atmel/sama5d2_ptc/MAINTAINERS                |   7 -
 board/atmel/sama5d2_ptc/Makefile                   |   8 -
 board/atmel/sama5d2_ptc/sama5d2_ptc.c              | 285 ---------------------
 .../atmel/{sama5d2_ptc => sama5d2_ptc_ek}/Kconfig  |   6 +-
 board/atmel/sama5d2_ptc_ek/MAINTAINERS             |   8 +
 board/atmel/sama5d2_ptc_ek/Makefile                |   8 +
 board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c        | 130 ++++++++++
 configs/sama5d2_ptc_ek_mmc_defconfig               |  60 +++++
 configs/sama5d2_ptc_ek_nandflash_defconfig         |  60 +++++
 configs/sama5d2_ptc_nandflash_defconfig            |  33 ---
 configs/sama5d2_ptc_spiflash_defconfig             |  34 ---
 include/configs/sama5d2_ptc.h                      | 114 ---------
 include/configs/sama5d2_ptc_ek.h                   |  46 ++++
 17 files changed, 554 insertions(+), 488 deletions(-)
 create mode 100644 arch/arm/dts/at91-sama5d2_ptc_ek.dts
 delete mode 100644 board/atmel/sama5d2_ptc/MAINTAINERS
 delete mode 100644 board/atmel/sama5d2_ptc/Makefile
 delete mode 100644 board/atmel/sama5d2_ptc/sama5d2_ptc.c
 rename board/atmel/{sama5d2_ptc => sama5d2_ptc_ek}/Kconfig (60%)
 create mode 100644 board/atmel/sama5d2_ptc_ek/MAINTAINERS
 create mode 100644 board/atmel/sama5d2_ptc_ek/Makefile
 create mode 100644 board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c
 create mode 100644 configs/sama5d2_ptc_ek_mmc_defconfig
 create mode 100644 configs/sama5d2_ptc_ek_nandflash_defconfig
 delete mode 100644 configs/sama5d2_ptc_nandflash_defconfig
 delete mode 100644 configs/sama5d2_ptc_spiflash_defconfig
 delete mode 100644 include/configs/sama5d2_ptc.h
 create mode 100644 include/configs/sama5d2_ptc_ek.h
arch/arm/dts/Makefile +3 -0
index 6db64f9101..4e2eac0938 100644
@@ -421,6 +421,9 @@ dtb-$(CONFIG_TARGET_OMAP3_LOGIC) += \
 	logicpd-torpedo-37xx-devkit.dtb \
 	logicpd-som-lv-37xx-devkit.dtb
 
+dtb-$(CONFIG_TARGET_SAMA5D2_PTC_EK) += \
+	at91-sama5d2_ptc_ek.dtb
+
 dtb-$(CONFIG_TARGET_SAMA5D2_XPLAINED) += \
 	at91-sama5d2_xplained.dtb
 
arch/arm/dts/at91-sama5d2_ptc_ek.dts new file +215 -0

215 lines not on this page · raw message

arch/arm/dts/sama5d2.dtsi +18 -0
index 7520446dc1..6645a55364 100644
@@ -302,6 +302,7 @@
 						#clock-cells = <0>;
 						reg = <24>;
 						atmel,clk-output-range = <0 83000000>;
+						u-boot,dm-pre-reloc;
 					};
 
 					uart1_clk: uart1_clk at 25 {
@@ -315,6 +316,7 @@
 						#clock-cells = <0>;
 						reg = <26>;
 						atmel,clk-output-range = <0 83000000>;
+						u-boot,dm-pre-reloc;
 					};
 
 					uart3_clk: uart3_clk at 27 {
@@ -635,6 +637,14 @@
 				status = "disabled";
 			};
 
+			uart0: serial at f801c000 {
+				compatible = "atmel,at91sam9260-usart";
+				reg = <0xf801c000 0x100>;
+				clocks = <&uart0_clk>;
+				clock-names = "usart";
+				status = "disabled";
+			};
+
 			uart1: serial at f8020000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8020000 0x100>;
@@ -643,6 +653,14 @@
 				status = "disabled";
 			};
 
+			uart2: serial at f8024000 {
+				compatible = "atmel,at91sam9260-usart";
+				reg = <0xf8024000 0x100>;
+				clocks = <&uart2_clk>;
+				clock-names = "usart";
+				status = "disabled";
+			};
+
 			i2c0: i2c at f8028000 {
 				compatible = "atmel,sama5d2-i2c";
 				reg = <0xf8028000 0x100>;
arch/arm/mach-at91/Kconfig +3 -4
index 7e85b69679..9ec3ab33d9 100644
@@ -143,10 +143,9 @@ config TARGET_AT91SAM9X5EK
 	select BOARD_EARLY_INIT_F
 	select BOARD_LATE_INIT
 
-config TARGET_SAMA5D2_PTC
-	bool "SAMA5D2 PTC board"
+config TARGET_SAMA5D2_PTC_EK
+	bool "SAMA5D2 PTC EK board"
 	select SAMA5D2
-	select SUPPORT_SPL
 	select BOARD_EARLY_INIT_F
 
 config TARGET_SAMA5D2_XPLAINED
@@ -251,7 +250,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_ptc/Kconfig"
+source "board/atmel/sama5d2_ptc_ek/Kconfig"
 source "board/atmel/sama5d2_xplained/Kconfig"
 source "board/atmel/sama5d27_som1_ek/Kconfig"
 source "board/atmel/sama5d3_xplained/Kconfig"
board/atmel/sama5d2_ptc/MAINTAINERS deleted +0 -7
deleted file mode 100644
index 7ab03d6eaf..0000000000
@@ -1,7 +0,0 @@
-SAMA5D2 PTC Engineering BOARD
-M:	Wenyou Yang <[email protected]>
-S:	Maintained
-F:	board/atmel/sama5d2_ptc/
-F:	include/configs/sama5d2_ptc.h
-F:	configs/sama5d2_ptc_spiflash_defconfig
-F:	configs/sama5d2_ptc_nandflash_defconfig
board/atmel/sama5d2_ptc/Makefile deleted +0 -8
deleted file mode 100644
index 1fe0392da0..0000000000
@@ -1,8 +0,0 @@
-#
-# Copyright (C) 2016 Atmel
-#		     Wenyou Yang <[email protected]>
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-y += sama5d2_ptc.o
board/atmel/sama5d2_ptc/sama5d2_ptc.c deleted +0 -285

285 lines not on this page · raw message

board/atmel/sama5d2_ptc_ek/Kconfig renamed from board/atmel/sama5d2_ptc/Kconfig +3 -3
similarity index 60%
rename from board/atmel/sama5d2_ptc/Kconfig
rename to board/atmel/sama5d2_ptc_ek/Kconfig
index d2661c689a..8b202d6ccf 100644
@@ -1,7 +1,7 @@
-if TARGET_SAMA5D2_PTC
+if TARGET_SAMA5D2_PTC_EK
 
 config SYS_BOARD
-	default "sama5d2_ptc"
+	default "sama5d2_ptc_ek"
 
 config SYS_VENDOR
 	default "atmel"
@@ -10,6 +10,6 @@ config SYS_SOC
 	default "at91"
 
 config SYS_CONFIG_NAME
-	default "sama5d2_ptc"
+	default "sama5d2_ptc_ek"
 
 endif
board/atmel/sama5d2_ptc_ek/MAINTAINERS new file +8 -0
new file mode 100644
index 0000000000..3c7b7f51c6
@@ -0,0 +1,8 @@
+SAMA5D2 PTC EK BOARD
+M:	Wenyou Yang <[email protected]>
+M:	Ludovic Desroches <[email protected]>
+S:	Maintained
+F:	board/atmel/sama5d2_ptc_ek/
+F:	include/configs/sama5d2_ptc_ek.h
+F:	configs/sama5d2_ptc_ek_mmc_defconfig
+F:	configs/sama5d2_ptc_ek_nandflash_defconfig
board/atmel/sama5d2_ptc_ek/Makefile new file +8 -0
new file mode 100644
index 0000000000..9fe4b410a1
@@ -0,0 +1,8 @@
+#
+# Copyright (C) 2017 Microchip Corporation
+#		     Wenyou Yang <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += sama5d2_ptc_ek.o
board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c new file +130 -0

130 lines not on this page · raw message

configs/sama5d2_ptc_ek_mmc_defconfig new file +60 -0

60 lines not on this page · raw message

configs/sama5d2_ptc_ek_nandflash_defconfig new file +60 -0

60 lines not on this page · raw message

configs/sama5d2_ptc_nandflash_defconfig deleted +0 -33
deleted file mode 100644
index cfbdbb0025..0000000000
@@ -1,33 +0,0 @@
-CONFIG_ARM=y
-CONFIG_ARCH_AT91=y
-CONFIG_TARGET_SAMA5D2_PTC=y
-CONFIG_SPL_GPIO_SUPPORT=y
-CONFIG_SPL_LIBCOMMON_SUPPORT=y
-CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SPL_SERIAL_SUPPORT=y
-CONFIG_SPL_NAND_SUPPORT=y
-CONFIG_NAND_BOOT=y
-CONFIG_BOOTDELAY=3
-CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="console=ttyS0,57600 earlyprintk mtdparts=atmel_nand:6M(bootstrap)ro, 6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=2 root=ubi0:rootfs"
-# CONFIG_DISPLAY_BOARDINFO is not set
-CONFIG_SPL=y
-# CONFIG_CMD_IMI is not set
-# CONFIG_CMD_FLASH is not set
-# CONFIG_CMD_FPGA is not set
-# CONFIG_CMD_LOADS is not set
-CONFIG_CMD_NAND=y
-CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
-CONFIG_CMD_USB=y
-CONFIG_CMD_FAT=y
-CONFIG_ENV_IS_IN_NAND=y
-# CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
-CONFIG_USB=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_STORAGE=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC"
-CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_USB_ETHER=y
configs/sama5d2_ptc_spiflash_defconfig deleted +0 -34
deleted file mode 100644
index 25ee07740e..0000000000
@@ -1,34 +0,0 @@
-CONFIG_ARM=y
-CONFIG_ARCH_AT91=y
-CONFIG_TARGET_SAMA5D2_PTC=y
-CONFIG_SPL_GPIO_SUPPORT=y
-CONFIG_SPL_LIBCOMMON_SUPPORT=y
-CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SPL_SERIAL_SUPPORT=y
-CONFIG_SPL_SPI_FLASH_SUPPORT=y
-CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_SPI_BOOT=y
-CONFIG_BOOTDELAY=3
-CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="console=ttyS0,57600 earlyprintk mtdparts=atmel_nand:6M(bootstrap)ro, 6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=2 root=ubi0:rootfs"
-# CONFIG_DISPLAY_BOARDINFO is not set
-CONFIG_SPL=y
-# CONFIG_CMD_IMI is not set
-# CONFIG_CMD_FLASH is not set
-# CONFIG_CMD_FPGA is not set
-# CONFIG_CMD_LOADS is not set
-CONFIG_CMD_NAND=y
-CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
-CONFIG_CMD_USB=y
-CONFIG_CMD_FAT=y
-CONFIG_ENV_IS_IN_SPI_FLASH=y
-# CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
-CONFIG_USB=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_STORAGE=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC"
-CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_USB_ETHER=y
include/configs/sama5d2_ptc.h deleted +0 -114

114 lines not on this page · raw message

include/configs/sama5d2_ptc_ek.h new file +46 -0

46 lines not on this page · raw message

Signature · 1 line
2.13.0
#4 lore raw

PATCH 2/2 board: atmel: add sama5d2_ptc_ek board

Quoted 7 lines · Wenyou Yang

From: Ludovic Desroches <[email protected]>

Add the SAMA5D2 PTC EK board and remove the SAMA5D2 PTC ENGI board which was a prototype.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171130/48d91651/attachment.sig>