Skip to contentSkip to conversation

board: sama5d4: convert boards to support DM/DT

PATCH Superseded Wenyou Yang 4 participants 21 messages Oct 28, 2016 – Feb 7, 2017 Arm/Microchip (AT91) SoC support

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover board: sama5d4: convert boards to support DM/DT

The purpose of patch set is to convert the board to support Device Tree and Driver Model.

They are based on the following patches:

	1./ [PATCH v3 0/2] pinctrl: at91: Add pinctrl driver
	http://lists.denx.de/pipermail/u-boot/2016-October/270991.html
	2./ [PATCH v1 0/2] ARM: dts: at91: add dts files for the boards of SAMA5D4
	http://lists.denx.de/pipermail/u-boot/2016-October/271004.html
	3./ [PATCH v3 0/2] serial: atmel_usart: Support to enable an early debug UART
	http://lists.denx.de/pipermail/u-boot/2016-October/270250.html
	4./ [PATCH v1 0/3] gpio: at91_gpio: Add option and clock support
	http://lists.denx.de/pipermail/u-boot/2016-October/270687.html
	5./ [PATCH v10] dm: at91: Add driver model support for the spi driver
	http://lists.denx.de/pipermail/u-boot/2016-October/270516.html

Changes in v2:
- Restore the wrong removal #define CONFIG_USB_ETHER.
- Update the commit log.
- Restore the wrong removal of USB related code.
- Update the commit log.
- Restore wrong removal of #define CONFIG_USB_ETHER.
- Update the commit log.
- Restore the wrong removal USB related code.
- Update the commit log.

Wenyou Yang (8):
configs: at91-sama5_common: fix for CONFIG_AT91_GPIO
board: sama5d4_xplained: move config options to defconfig
board: sama5d4_xplained: clean up code
board: sama5d4_xplained: enable early debug UART
board: sama5d4ek: move config options to defconfig
board: sama5d4ek: clean up code
board: sama5d4ek: enable early debug UART
configs: sama5d4: move CONFIG_SYS_NO_FLASH to *defconfig

 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 100 ++++-------------------
 board/atmel/sama5d4ek/sama5d4ek.c               | 101 ++++--------------------
 configs/sama5d4_xplained_mmc_defconfig          |  31 +++++++-
 configs/sama5d4_xplained_nandflash_defconfig    |  33 +++++++-
 configs/sama5d4_xplained_spiflash_defconfig     |  31 +++++++-
 configs/sama5d4ek_mmc_defconfig                 |  30 +++++++
 configs/sama5d4ek_nandflash_defconfig           |  30 +++++++
 configs/sama5d4ek_spiflash_defconfig            |  30 +++++++
 include/configs/at91-sama5_common.h             |   2 +
 include/configs/sama5d4_xplained.h              |  28 +------
 include/configs/sama5d4ek.h                     |  29 +------
 11 files changed, 216 insertions(+), 229 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/8 configs: at91-sama5_common: fix for CONFIG_AT91_GPIO

If enabled Driver Model for GPIO, CONFIG_AT91_GPIO should be defined by configs/*_defconfig file.

---

Changes in v2: None

 include/configs/at91-sama5_common.h | 2 ++
 1 file changed, 2 insertions(+)
include/configs/at91-sama5_common.h +2 -0
index b09ef33..98e3f0e 100644
@@ -29,7 +29,9 @@
 #define CONFIG_ENV_VARS_UBOOT_CONFIG
 
 /* general purpose I/O */
+#ifndef CONFIG_DM_GPIO
 #define CONFIG_AT91_GPIO
+#endif
 
 
 /*
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/8 configs: at91-sama5_common: fix for CONFIG_AT91_GPIO

Quoted 4 lines · Wenyou Yang

If enabled Driver Model for GPIO, CONFIG_AT91_GPIO should be defined by configs/*_defconfig file.

Quoted 21 lines

---

Changes in v2: None

 include/configs/at91-sama5_common.h | 2 ++
 1 file changed, 2 insertions(+)
include/configs/at91-sama5_common.h +2 -0
index b09ef33..98e3f0e 100644
@@ -29,7 +29,9 @@
 #define CONFIG_ENV_VARS_UBOOT_CONFIG
 
 /* general purpose I/O */
+#ifndef CONFIG_DM_GPIO
 #define CONFIG_AT91_GPIO
+#endif
 
 
 /*
#3 lore raw

PATCH v2 2/8 board: sama5d4_xplained: move config options to defconfig

In reply to Wenyou Yang

Enable CONFIG_CLK and CONFIG_PINCTRL to support at91 clock driver and at91 pinctrl driver.

Move some config options to configs/sama5d4_xplained_*_defconfig files.

---

Changes in v2:
- Restore the wrong removal #define CONFIG_USB_ETHER.
- Update the commit log.

 board/atmel/sama5d4_xplained/sama5d4_xplained.c |  2 ++
 configs/sama5d4_xplained_mmc_defconfig          | 24 ++++++++++++++++++++++-
 configs/sama5d4_xplained_nandflash_defconfig    | 26 ++++++++++++++++++++++++-
 configs/sama5d4_xplained_spiflash_defconfig     | 24 ++++++++++++++++++++++-
 include/configs/sama5d4_xplained.h              | 25 ------------------------
 5 files changed, 73 insertions(+), 28 deletions(-)
board/atmel/sama5d4_xplained/sama5d4_xplained.c +2 -0
index 47f0bae..6684276 100644
@@ -28,10 +28,12 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_ATMEL_SPI
+#ifndef CONFIG_DM_SPI
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {
 	return bus == 0 && cs == 0;
 }
+#endif
 
 void spi_cs_activate(struct spi_slave *slave)
 {
configs/sama5d4_xplained_mmc_defconfig +23 -1
index 5ff4688..e25b26a 100644
@@ -8,6 +8,7 @@ CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
@@ -26,10 +27,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
configs/sama5d4_xplained_nandflash_defconfig +25 -1
index 800a8b2..53dfdd6 100644
@@ -6,6 +6,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
@@ -21,13 +22,36 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
configs/sama5d4_xplained_spiflash_defconfig +23 -1
index e5d2f54..17fd9a2 100644
@@ -7,6 +7,7 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
 CONFIG_BOOTDELAY=3
@@ -25,10 +26,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
include/configs/sama5d4_xplained.h +0 -25
index 249e661..1173583 100644
@@ -15,11 +15,6 @@
 
 #include "at91-sama5_common.h"
 
-/* serial console */
-#define CONFIG_ATMEL_USART
-#define CONFIG_USART_BASE		ATMEL_BASE_USART3
-#define CONFIG_USART_ID			ATMEL_ID_USART3
-
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
@@ -34,16 +29,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR		0x22000000 /* load address */
 
-/* SerialFlash */
-
-#ifdef CONFIG_CMD_SF
-#define CONFIG_ATMEL_SPI
-#define CONFIG_ATMEL_SPI0
-#define CONFIG_SF_DEFAULT_BUS		0
-#define CONFIG_SF_DEFAULT_CS		0
-#define CONFIG_SF_DEFAULT_SPEED		30000000
-#endif
-
 /* NAND flash */
 #define CONFIG_CMD_NAND
 
@@ -66,16 +51,6 @@
 #ifdef CONFIG_CMD_MMC
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_GENERIC_ATMEL_MCI
-#define ATMEL_BASE_MMCI			ATMEL_BASE_MCI1
-#endif
-
-/* USB */
-
-#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_EHCI
-#define CONFIG_USB_EHCI_ATMEL
-#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	3
 #endif
 
 /* USB device */
Signature · 1 line
2.7.4
#4 lore raw

PATCH v2 2/8 board: sama5d4_xplained: move config options to defconfig

Quoted 7 lines · Wenyou Yang

Enable CONFIG_CLK and CONFIG_PINCTRL to support at91 clock driver and at91 pinctrl driver.

Move some config options to configs/sama5d4_xplained_*_defconfig files.

Quoted 220 lines

---

Changes in v2:
- Restore the wrong removal #define CONFIG_USB_ETHER.
- Update the commit log.

 board/atmel/sama5d4_xplained/sama5d4_xplained.c |  2 ++
 configs/sama5d4_xplained_mmc_defconfig          | 24 ++++++++++++++++++++++-
 configs/sama5d4_xplained_nandflash_defconfig    | 26 ++++++++++++++++++++++++-
 configs/sama5d4_xplained_spiflash_defconfig     | 24 ++++++++++++++++++++++-
 include/configs/sama5d4_xplained.h              | 25 ------------------------
 5 files changed, 73 insertions(+), 28 deletions(-)
board/atmel/sama5d4_xplained/sama5d4_xplained.c +2 -0
index 47f0bae..6684276 100644
@@ -28,10 +28,12 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_ATMEL_SPI
+#ifndef CONFIG_DM_SPI
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {
 	return bus == 0 && cs == 0;
 }
+#endif
 
 void spi_cs_activate(struct spi_slave *slave)
 {
configs/sama5d4_xplained_mmc_defconfig +23 -1
index 5ff4688..e25b26a 100644
@@ -8,6 +8,7 @@ CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
@@ -26,10 +27,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
configs/sama5d4_xplained_nandflash_defconfig +25 -1
index 800a8b2..53dfdd6 100644
@@ -6,6 +6,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
@@ -21,13 +22,36 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
configs/sama5d4_xplained_spiflash_defconfig +23 -1
index e5d2f54..17fd9a2 100644
@@ -7,6 +7,7 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
 CONFIG_BOOTDELAY=3
@@ -25,10 +26,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
include/configs/sama5d4_xplained.h +0 -25
index 249e661..1173583 100644
@@ -15,11 +15,6 @@
 
 #include "at91-sama5_common.h"
 
-/* serial console */
-#define CONFIG_ATMEL_USART
-#define CONFIG_USART_BASE		ATMEL_BASE_USART3
-#define CONFIG_USART_ID			ATMEL_ID_USART3
-
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
@@ -34,16 +29,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR		0x22000000 /* load address */
 
-/* SerialFlash */
-
-#ifdef CONFIG_CMD_SF
-#define CONFIG_ATMEL_SPI
-#define CONFIG_ATMEL_SPI0
-#define CONFIG_SF_DEFAULT_BUS		0
-#define CONFIG_SF_DEFAULT_CS		0
-#define CONFIG_SF_DEFAULT_SPEED		30000000
-#endif
-
 /* NAND flash */
 #define CONFIG_CMD_NAND
 
@@ -66,16 +51,6 @@
 #ifdef CONFIG_CMD_MMC
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_GENERIC_ATMEL_MCI
-#define ATMEL_BASE_MMCI			ATMEL_BASE_MCI1
-#endif
-
-/* USB */
-
-#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_EHCI
-#define CONFIG_USB_EHCI_ATMEL
-#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	3
 #endif
 
 /* USB device */
#5 lore raw

PATCH v2 2/8 board: sama5d4_xplained: move config options to defconfig

In reply to Wenyou Yang
Quoted 7 lines · Wenyou Yang

Enable CONFIG_CLK and CONFIG_PINCTRL to support at91 clock driver and at91 pinctrl driver.

Move some config options to configs/sama5d4_xplained_*_defconfig files.

Quoted 220 lines

---

Changes in v2:
- Restore the wrong removal #define CONFIG_USB_ETHER.
- Update the commit log.

 board/atmel/sama5d4_xplained/sama5d4_xplained.c |  2 ++
 configs/sama5d4_xplained_mmc_defconfig          | 24 ++++++++++++++++++++++-
 configs/sama5d4_xplained_nandflash_defconfig    | 26 ++++++++++++++++++++++++-
 configs/sama5d4_xplained_spiflash_defconfig     | 24 ++++++++++++++++++++++-
 include/configs/sama5d4_xplained.h              | 25 ------------------------
 5 files changed, 73 insertions(+), 28 deletions(-)
board/atmel/sama5d4_xplained/sama5d4_xplained.c +2 -0
index 47f0bae..6684276 100644
@@ -28,10 +28,12 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_ATMEL_SPI
+#ifndef CONFIG_DM_SPI
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {
 	return bus == 0 && cs == 0;
 }
+#endif
 
 void spi_cs_activate(struct spi_slave *slave)
 {
configs/sama5d4_xplained_mmc_defconfig +23 -1
index 5ff4688..e25b26a 100644
@@ -8,6 +8,7 @@ CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
@@ -26,10 +27,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
configs/sama5d4_xplained_nandflash_defconfig +25 -1
index 800a8b2..53dfdd6 100644
@@ -6,6 +6,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
@@ -21,13 +22,36 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
configs/sama5d4_xplained_spiflash_defconfig +23 -1
index e5d2f54..17fd9a2 100644
@@ -7,6 +7,7 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
 CONFIG_BOOTDELAY=3
@@ -25,10 +26,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
include/configs/sama5d4_xplained.h +0 -25
index 249e661..1173583 100644
@@ -15,11 +15,6 @@
 
 #include "at91-sama5_common.h"
 
-/* serial console */
-#define CONFIG_ATMEL_USART
-#define CONFIG_USART_BASE		ATMEL_BASE_USART3
-#define CONFIG_USART_ID			ATMEL_ID_USART3
-
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
@@ -34,16 +29,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR		0x22000000 /* load address */
 
-/* SerialFlash */
-
-#ifdef CONFIG_CMD_SF
-#define CONFIG_ATMEL_SPI
-#define CONFIG_ATMEL_SPI0
-#define CONFIG_SF_DEFAULT_BUS		0
-#define CONFIG_SF_DEFAULT_CS		0
-#define CONFIG_SF_DEFAULT_SPEED		30000000
-#endif
-
 /* NAND flash */
 #define CONFIG_CMD_NAND
 
@@ -66,16 +51,6 @@
 #ifdef CONFIG_CMD_MMC
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_GENERIC_ATMEL_MCI
-#define ATMEL_BASE_MMCI			ATMEL_BASE_MCI1
-#endif
-
-/* USB */
-
-#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_EHCI
-#define CONFIG_USB_EHCI_ATMEL
-#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	3
 #endif
 
 /* USB device */
#6 lore raw

PATCH v2 2/8 board: sama5d4_xplained: move config options to defconfig

In reply to Wenyou Yang
Quoted 7 lines · Wenyou Yang

Enable CONFIG_CLK and CONFIG_PINCTRL to support at91 clock driver and at91 pinctrl driver.

Move some config options to configs/sama5d4_xplained_*_defconfig files.

Quoted 220 lines

---

Changes in v2:
- Restore the wrong removal #define CONFIG_USB_ETHER.
- Update the commit log.

 board/atmel/sama5d4_xplained/sama5d4_xplained.c |  2 ++
 configs/sama5d4_xplained_mmc_defconfig          | 24 ++++++++++++++++++++++-
 configs/sama5d4_xplained_nandflash_defconfig    | 26 ++++++++++++++++++++++++-
 configs/sama5d4_xplained_spiflash_defconfig     | 24 ++++++++++++++++++++++-
 include/configs/sama5d4_xplained.h              | 25 ------------------------
 5 files changed, 73 insertions(+), 28 deletions(-)
board/atmel/sama5d4_xplained/sama5d4_xplained.c +2 -0
index 47f0bae..6684276 100644
@@ -28,10 +28,12 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_ATMEL_SPI
+#ifndef CONFIG_DM_SPI
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {
 	return bus == 0 && cs == 0;
 }
+#endif
 
 void spi_cs_activate(struct spi_slave *slave)
 {
configs/sama5d4_xplained_mmc_defconfig +23 -1
index 5ff4688..e25b26a 100644
@@ -8,6 +8,7 @@ CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
@@ -26,10 +27,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
configs/sama5d4_xplained_nandflash_defconfig +25 -1
index 800a8b2..53dfdd6 100644
@@ -6,6 +6,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
@@ -21,13 +22,36 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
configs/sama5d4_xplained_spiflash_defconfig +23 -1
index e5d2f54..17fd9a2 100644
@@ -7,6 +7,7 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
 CONFIG_BOOTDELAY=3
@@ -25,10 +26,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_OF_LIBFDT=y
include/configs/sama5d4_xplained.h +0 -25
index 249e661..1173583 100644
@@ -15,11 +15,6 @@
 
 #include "at91-sama5_common.h"
 
-/* serial console */
-#define CONFIG_ATMEL_USART
-#define CONFIG_USART_BASE		ATMEL_BASE_USART3
-#define CONFIG_USART_ID			ATMEL_ID_USART3
-
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
@@ -34,16 +29,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR		0x22000000 /* load address */
 
-/* SerialFlash */
-
-#ifdef CONFIG_CMD_SF
-#define CONFIG_ATMEL_SPI
-#define CONFIG_ATMEL_SPI0
-#define CONFIG_SF_DEFAULT_BUS		0
-#define CONFIG_SF_DEFAULT_CS		0
-#define CONFIG_SF_DEFAULT_SPEED		30000000
-#endif
-
 /* NAND flash */
 #define CONFIG_CMD_NAND
 
@@ -66,16 +51,6 @@
 #ifdef CONFIG_CMD_MMC
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_GENERIC_ATMEL_MCI
-#define ATMEL_BASE_MMCI			ATMEL_BASE_MCI1
-#endif
-
-/* USB */
-
-#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_EHCI
-#define CONFIG_USB_EHCI_ATMEL
-#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	3
 #endif
 
 /* USB device */
#7 lore raw

PATCH v2 3/8 board: sama5d4_xplained: clean up code

In reply to Wenyou Yang

Since the introduction of the pinctrl and clk driver and the dts file, remove unneeded hard coded related code from the board file.

---

Changes in v2:
- Restore the wrong removal of USB related code.
- Update the commit log.

 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 87 +------------------------
 1 file changed, 1 insertion(+), 86 deletions(-)
board/atmel/sama5d4_xplained/sama5d4_xplained.c +1 -86
index 6684276..2b51e4c 100644
@@ -16,48 +16,14 @@
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
 #include <atmel_hlcdc.h>
-#include <atmel_mci.h>
 #include <lcd.h>
-#include <mmc.h>
 #include <net.h>
 #include <netdev.h>
 #include <nand.h>
-#include <spi.h>
 #include <version.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_ATMEL_SPI
-#ifndef CONFIG_DM_SPI
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-	return bus == 0 && cs == 0;
-}
-#endif
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 0);
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);
-}
-
-static void sama5d4_xplained_spi0_hw_init(void)
-{
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 0, 0);	/* SPI0_MISO */
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 1, 0);	/* SPI0_MOSI */
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 2, 0);	/* SPI0_SPCK */
-
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);	/* SPI0_CS0 */
-
-	/* Enable clock */
-	at91_periph_clk_enable(ATMEL_ID_SPI0);
-}
-#endif /* CONFIG_ATMEL_SPI */
-
 #ifdef CONFIG_NAND_ATMEL
 static void sama5d4_xplained_nand_hw_init(void)
 {
@@ -202,41 +168,6 @@ void lcd_show_board_info(void)
 
 #endif /* CONFIG_LCD */
 
-#ifdef CONFIG_GENERIC_ATMEL_MCI
-void sama5d4_xplained_mci1_hw_init(void)
-{
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 19, 1);	/* MCI1 CDA */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 20, 1);	/* MCI1 DA0 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 21, 1);	/* MCI1 DA1 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 22, 1);	/* MCI1 DA2 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 23, 1);	/* MCI1 DA3 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 18, 0);	/* MCI1 CLK */
-
-	/*
-	 * As the mci io internal pull down is too strong, so if the io needs
-	 * external pull up, the pull up resistor will be very small, if so
-	 * the power consumption will increase, so disable the interanl pull
-	 * down to save the power.
-	 */
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 18, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 19, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 20, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 21, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 22, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 23, 0);
-
-	/* Enable clock */
-	at91_periph_clk_enable(ATMEL_ID_MCI1);
-}
-
-int board_mmc_init(bd_t *bis)
-{
-	/* Enable the power supply */
-	at91_set_pio_output(AT91_PIO_PORTE, 4, 0);
-
-	return atmel_mci_init((void *)ATMEL_BASE_MCI1);
-}
-#endif /* CONFIG_GENERIC_ATMEL_MCI */
 
 #ifdef CONFIG_MACB
 void sama5d4_xplained_macb0_hw_init(void)
@@ -268,12 +199,6 @@ static void sama5d4_xplained_serial3_hw_init(void)
 
 int board_early_init_f(void)
 {
-	at91_periph_clk_enable(ATMEL_ID_PIOA);
-	at91_periph_clk_enable(ATMEL_ID_PIOB);
-	at91_periph_clk_enable(ATMEL_ID_PIOC);
-	at91_periph_clk_enable(ATMEL_ID_PIOD);
-	at91_periph_clk_enable(ATMEL_ID_PIOE);
-
 	sama5d4_xplained_serial3_hw_init();
 
 	return 0;
@@ -284,15 +209,9 @@ int board_init(void)
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
-#ifdef CONFIG_ATMEL_SPI
-	sama5d4_xplained_spi0_hw_init();
-#endif
 #ifdef CONFIG_NAND_ATMEL
 	sama5d4_xplained_nand_hw_init();
 #endif
-#ifdef CONFIG_GENERIC_ATMEL_MCI
-	sama5d4_xplained_mci1_hw_init();
-#endif
 #ifdef CONFIG_MACB
 	sama5d4_xplained_macb0_hw_init();
 #endif
@@ -338,12 +257,8 @@ int board_eth_init(bd_t *bis)
 #ifdef CONFIG_SPL_BUILD
 void spl_board_init(void)
 {
-#ifdef CONFIG_SYS_USE_MMC
-	sama5d4_xplained_mci1_hw_init();
-#elif CONFIG_SYS_USE_NANDFLASH
+#if CONFIG_SYS_USE_NANDFLASH
 	sama5d4_xplained_nand_hw_init();
-#elif CONFIG_SYS_USE_SERIALFLASH
-	sama5d4_xplained_spi0_hw_init();
 #endif
 }
 
Signature · 1 line
2.7.4
#8 lore raw

PATCH v2 3/8 board: sama5d4_xplained: clean up code

Quoted 5 lines · Wenyou Yang

Since the introduction of the pinctrl and clk driver and the dts file, remove unneeded hard coded related code from the board file.

Quoted 147 lines

---

Changes in v2:
- Restore the wrong removal of USB related code.
- Update the commit log.

 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 87 +------------------------
 1 file changed, 1 insertion(+), 86 deletions(-)
board/atmel/sama5d4_xplained/sama5d4_xplained.c +1 -86
index 6684276..2b51e4c 100644
@@ -16,48 +16,14 @@
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
 #include <atmel_hlcdc.h>
-#include <atmel_mci.h>
 #include <lcd.h>
-#include <mmc.h>
 #include <net.h>
 #include <netdev.h>
 #include <nand.h>
-#include <spi.h>
 #include <version.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_ATMEL_SPI
-#ifndef CONFIG_DM_SPI
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-	return bus == 0 && cs == 0;
-}
-#endif
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 0);
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);
-}
-
-static void sama5d4_xplained_spi0_hw_init(void)
-{
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 0, 0);	/* SPI0_MISO */
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 1, 0);	/* SPI0_MOSI */
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 2, 0);	/* SPI0_SPCK */
-
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);	/* SPI0_CS0 */
-
-	/* Enable clock */
-	at91_periph_clk_enable(ATMEL_ID_SPI0);
-}
-#endif /* CONFIG_ATMEL_SPI */
-
 #ifdef CONFIG_NAND_ATMEL
 static void sama5d4_xplained_nand_hw_init(void)
 {
@@ -202,41 +168,6 @@ void lcd_show_board_info(void)
 
 #endif /* CONFIG_LCD */
 
-#ifdef CONFIG_GENERIC_ATMEL_MCI
-void sama5d4_xplained_mci1_hw_init(void)
-{
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 19, 1);	/* MCI1 CDA */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 20, 1);	/* MCI1 DA0 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 21, 1);	/* MCI1 DA1 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 22, 1);	/* MCI1 DA2 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 23, 1);	/* MCI1 DA3 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 18, 0);	/* MCI1 CLK */
-
-	/*
-	 * As the mci io internal pull down is too strong, so if the io needs
-	 * external pull up, the pull up resistor will be very small, if so
-	 * the power consumption will increase, so disable the interanl pull
-	 * down to save the power.
-	 */
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 18, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 19, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 20, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 21, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 22, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 23, 0);
-
-	/* Enable clock */
-	at91_periph_clk_enable(ATMEL_ID_MCI1);
-}
-
-int board_mmc_init(bd_t *bis)
-{
-	/* Enable the power supply */
-	at91_set_pio_output(AT91_PIO_PORTE, 4, 0);
-
-	return atmel_mci_init((void *)ATMEL_BASE_MCI1);
-}
-#endif /* CONFIG_GENERIC_ATMEL_MCI */
 
 #ifdef CONFIG_MACB
 void sama5d4_xplained_macb0_hw_init(void)
@@ -268,12 +199,6 @@ static void sama5d4_xplained_serial3_hw_init(void)
 
 int board_early_init_f(void)
 {
-	at91_periph_clk_enable(ATMEL_ID_PIOA);
-	at91_periph_clk_enable(ATMEL_ID_PIOB);
-	at91_periph_clk_enable(ATMEL_ID_PIOC);
-	at91_periph_clk_enable(ATMEL_ID_PIOD);
-	at91_periph_clk_enable(ATMEL_ID_PIOE);
-
 	sama5d4_xplained_serial3_hw_init();
 
 	return 0;
@@ -284,15 +209,9 @@ int board_init(void)
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
-#ifdef CONFIG_ATMEL_SPI
-	sama5d4_xplained_spi0_hw_init();
-#endif
 #ifdef CONFIG_NAND_ATMEL
 	sama5d4_xplained_nand_hw_init();
 #endif
-#ifdef CONFIG_GENERIC_ATMEL_MCI
-	sama5d4_xplained_mci1_hw_init();
-#endif
 #ifdef CONFIG_MACB
 	sama5d4_xplained_macb0_hw_init();
 #endif
@@ -338,12 +257,8 @@ int board_eth_init(bd_t *bis)
 #ifdef CONFIG_SPL_BUILD
 void spl_board_init(void)
 {
-#ifdef CONFIG_SYS_USE_MMC
-	sama5d4_xplained_mci1_hw_init();
-#elif CONFIG_SYS_USE_NANDFLASH
+#if CONFIG_SYS_USE_NANDFLASH
 	sama5d4_xplained_nand_hw_init();
-#elif CONFIG_SYS_USE_SERIALFLASH
-	sama5d4_xplained_spi0_hw_init();
 #endif
 }
 
#9 lore raw

PATCH v2 4/8 board: sama5d4_xplained: enable early debug UART

In reply to Wenyou Yang

Enable early debug UART to debug problems when an ICE or other debug mechanism is not available.

---

Changes in v2: None

 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 15 ++++++++++++++-
 configs/sama5d4_xplained_mmc_defconfig          |  6 ++++++
 configs/sama5d4_xplained_nandflash_defconfig    |  6 ++++++
 configs/sama5d4_xplained_spiflash_defconfig     |  6 ++++++
 include/configs/sama5d4_xplained.h              |  2 ++
 5 files changed, 34 insertions(+), 1 deletion(-)
board/atmel/sama5d4_xplained/sama5d4_xplained.c +14 -1
index 2b51e4c..c46a7a4 100644
@@ -16,6 +16,7 @@
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
 #include <atmel_hlcdc.h>
+#include <debug_uart.h>
 #include <lcd.h>
 #include <net.h>
 #include <netdev.h>
@@ -197,12 +198,24 @@ static void sama5d4_xplained_serial3_hw_init(void)
 	at91_periph_clk_enable(ATMEL_ID_USART3);
 }
 
-int board_early_init_f(void)
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
 {
 	sama5d4_xplained_serial3_hw_init();
+}
+#endif
 
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifdef CONFIG_DEBUG_UART
+	debug_uart_init();
+#else
+	sama5d4_xplained_serial3_hw_init();
+#endif
 	return 0;
 }
+#endif
 
 int board_init(void)
 {
configs/sama5d4_xplained_mmc_defconfig +6 -0
index e25b26a..e7518e8 100644
@@ -46,6 +46,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
configs/sama5d4_xplained_nandflash_defconfig +6 -0
index 53dfdd6..790d7d1 100644
@@ -45,6 +45,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
configs/sama5d4_xplained_spiflash_defconfig +6 -0
index 17fd9a2..af6263f 100644
@@ -45,6 +45,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
include/configs/sama5d4_xplained.h +2 -0
index 1173583..8032164 100644
@@ -15,6 +15,8 @@
 
 #include "at91-sama5_common.h"
 
+#define CONFIG_BOARD_EARLY_INIT_F
+
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
Signature · 1 line
2.7.4
#10 lore raw

PATCH v2 4/8 board: sama5d4_xplained: enable early debug UART

Quoted 4 lines · Wenyou Yang

Enable early debug UART to debug problems when an ICE or other debug mechanism is not available.

Quoted 113 lines

---

Changes in v2: None

 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 15 ++++++++++++++-
 configs/sama5d4_xplained_mmc_defconfig          |  6 ++++++
 configs/sama5d4_xplained_nandflash_defconfig    |  6 ++++++
 configs/sama5d4_xplained_spiflash_defconfig     |  6 ++++++
 include/configs/sama5d4_xplained.h              |  2 ++
 5 files changed, 34 insertions(+), 1 deletion(-)
board/atmel/sama5d4_xplained/sama5d4_xplained.c +14 -1
index 2b51e4c..c46a7a4 100644
@@ -16,6 +16,7 @@
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
 #include <atmel_hlcdc.h>
+#include <debug_uart.h>
 #include <lcd.h>
 #include <net.h>
 #include <netdev.h>
@@ -197,12 +198,24 @@ static void sama5d4_xplained_serial3_hw_init(void)
 	at91_periph_clk_enable(ATMEL_ID_USART3);
 }
 
-int board_early_init_f(void)
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
 {
 	sama5d4_xplained_serial3_hw_init();
+}
+#endif
 
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifdef CONFIG_DEBUG_UART
+	debug_uart_init();
+#else
+	sama5d4_xplained_serial3_hw_init();
+#endif
 	return 0;
 }
+#endif
 
 int board_init(void)
 {
configs/sama5d4_xplained_mmc_defconfig +6 -0
index e25b26a..e7518e8 100644
@@ -46,6 +46,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
configs/sama5d4_xplained_nandflash_defconfig +6 -0
index 53dfdd6..790d7d1 100644
@@ -45,6 +45,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
configs/sama5d4_xplained_spiflash_defconfig +6 -0
index 17fd9a2..af6263f 100644
@@ -45,6 +45,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
include/configs/sama5d4_xplained.h +2 -0
index 1173583..8032164 100644
@@ -15,6 +15,8 @@
 
 #include "at91-sama5_common.h"
 
+#define CONFIG_BOARD_EARLY_INIT_F
+
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
#11 lore raw

PATCH v2 5/8 board: sama5d4ek: move config options to defconfig

In reply to Wenyou Yang

Enable CONFIG_CLK and CONFIG_PINCTRL to support at91 clock driver and at91 pinctrl driver.

Move some config options to configs/sama5d4ek_*_defconfig.

---

Changes in v2:
- Restore wrong removal of #define CONFIG_USB_ETHER.
- Update the commit log.

 board/atmel/sama5d4ek/sama5d4ek.c     |  2 ++
 configs/sama5d4ek_mmc_defconfig       | 23 +++++++++++++++++++++++
 configs/sama5d4ek_nandflash_defconfig | 23 +++++++++++++++++++++++
 configs/sama5d4ek_spiflash_defconfig  | 23 +++++++++++++++++++++++
 include/configs/sama5d4ek.h           | 26 --------------------------
 5 files changed, 71 insertions(+), 26 deletions(-)
board/atmel/sama5d4ek/sama5d4ek.c +2 -0
index d1b5ff5..a0e4bb7 100644
@@ -28,10 +28,12 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_ATMEL_SPI
+#ifndef CONFIG_DM_SPI
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {
 	return bus == 0 && cs == 0;
 }
+#endif
 
 void spi_cs_activate(struct spi_slave *slave)
 {
configs/sama5d4ek_mmc_defconfig +23 -0
index 4899970..fd49b58 100644
@@ -8,6 +8,7 @@ CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4ek"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
@@ -28,9 +29,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
configs/sama5d4ek_nandflash_defconfig +23 -0
index 9ebe295..34f5234 100644
@@ -6,6 +6,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4ek"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
@@ -26,9 +27,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
configs/sama5d4ek_spiflash_defconfig +23 -0
index dff8995..c7f4655 100644
@@ -7,6 +7,7 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4ek"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
 CONFIG_BOOTDELAY=3
@@ -27,9 +28,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
include/configs/sama5d4ek.h +0 -26
index 00ed400..b5b8e4c 100644
@@ -15,11 +15,6 @@
 
 #include "at91-sama5_common.h"
 
-/* serial console */
-#define CONFIG_ATMEL_USART
-#define CONFIG_USART_BASE		ATMEL_BASE_USART3
-#define	CONFIG_USART_ID			ATMEL_ID_USART3
-
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
@@ -34,16 +29,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR		0x22000000 /* load address */
 
-/* SerialFlash */
-
-#ifdef CONFIG_CMD_SF
-#define CONFIG_ATMEL_SPI
-#define CONFIG_ATMEL_SPI0
-#define CONFIG_SF_DEFAULT_BUS		0
-#define CONFIG_SF_DEFAULT_CS		0
-#define CONFIG_SF_DEFAULT_SPEED		30000000
-#endif
-
 /* NAND flash */
 #define CONFIG_CMD_NAND
 
@@ -62,20 +47,9 @@
 #endif
 
 /* MMC */
-
 #ifdef CONFIG_CMD_MMC
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_GENERIC_ATMEL_MCI
-#define ATMEL_BASE_MMCI			ATMEL_BASE_MCI1
-#endif
-
-/* USB */
-
-#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_EHCI
-#define CONFIG_USB_EHCI_ATMEL
-#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	3
 #endif
 
 /* USB device */
Signature · 1 line
2.7.4
#12 lore raw

PATCH v2 5/8 board: sama5d4ek: move config options to defconfig

Quoted 6 lines · Wenyou Yang

Enable CONFIG_CLK and CONFIG_PINCTRL to support at91 clock driver and at91 pinctrl driver.

Move some config options to configs/sama5d4ek_*_defconfig.

Quoted 216 lines

---

Changes in v2:
- Restore wrong removal of #define CONFIG_USB_ETHER.
- Update the commit log.

 board/atmel/sama5d4ek/sama5d4ek.c     |  2 ++
 configs/sama5d4ek_mmc_defconfig       | 23 +++++++++++++++++++++++
 configs/sama5d4ek_nandflash_defconfig | 23 +++++++++++++++++++++++
 configs/sama5d4ek_spiflash_defconfig  | 23 +++++++++++++++++++++++
 include/configs/sama5d4ek.h           | 26 --------------------------
 5 files changed, 71 insertions(+), 26 deletions(-)
board/atmel/sama5d4ek/sama5d4ek.c +2 -0
index d1b5ff5..a0e4bb7 100644
@@ -28,10 +28,12 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_ATMEL_SPI
+#ifndef CONFIG_DM_SPI
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {
 	return bus == 0 && cs == 0;
 }
+#endif
 
 void spi_cs_activate(struct spi_slave *slave)
 {
configs/sama5d4ek_mmc_defconfig +23 -0
index 4899970..fd49b58 100644
@@ -8,6 +8,7 @@ CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4ek"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
@@ -28,9 +29,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
configs/sama5d4ek_nandflash_defconfig +23 -0
index 9ebe295..34f5234 100644
@@ -6,6 +6,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4ek"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
@@ -26,9 +27,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
configs/sama5d4ek_spiflash_defconfig +23 -0
index dff8995..c7f4655 100644
@@ -7,6 +7,7 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4ek"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
 CONFIG_BOOTDELAY=3
@@ -27,9 +28,31 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_H32MX=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
include/configs/sama5d4ek.h +0 -26
index 00ed400..b5b8e4c 100644
@@ -15,11 +15,6 @@
 
 #include "at91-sama5_common.h"
 
-/* serial console */
-#define CONFIG_ATMEL_USART
-#define CONFIG_USART_BASE		ATMEL_BASE_USART3
-#define	CONFIG_USART_ID			ATMEL_ID_USART3
-
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
@@ -34,16 +29,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR		0x22000000 /* load address */
 
-/* SerialFlash */
-
-#ifdef CONFIG_CMD_SF
-#define CONFIG_ATMEL_SPI
-#define CONFIG_ATMEL_SPI0
-#define CONFIG_SF_DEFAULT_BUS		0
-#define CONFIG_SF_DEFAULT_CS		0
-#define CONFIG_SF_DEFAULT_SPEED		30000000
-#endif
-
 /* NAND flash */
 #define CONFIG_CMD_NAND
 
@@ -62,20 +47,9 @@
 #endif
 
 /* MMC */
-
 #ifdef CONFIG_CMD_MMC
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_GENERIC_ATMEL_MCI
-#define ATMEL_BASE_MMCI			ATMEL_BASE_MCI1
-#endif
-
-/* USB */
-
-#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_EHCI
-#define CONFIG_USB_EHCI_ATMEL
-#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	3
 #endif
 
 /* USB device */
#13 lore raw

PATCH v2 6/8 board: sama5d4ek: clean up code

In reply to Wenyou Yang

Since the introduction of the pinctrl and clk driver and the dts file, remove unneeded hard coded related code from the board file.

---

Changes in v2:
- Restore the wrong removal USB related code.
- Update the commit log.

 board/atmel/sama5d4ek/sama5d4ek.c | 88 +--------------------------------------
 1 file changed, 1 insertion(+), 87 deletions(-)
board/atmel/sama5d4ek/sama5d4ek.c +1 -87
index a0e4bb7..c5479e7 100644
@@ -16,48 +16,14 @@
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
 #include <atmel_hlcdc.h>
-#include <atmel_mci.h>
 #include <lcd.h>
-#include <mmc.h>
 #include <net.h>
 #include <netdev.h>
 #include <nand.h>
-#include <spi.h>
 #include <version.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_ATMEL_SPI
-#ifndef CONFIG_DM_SPI
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-	return bus == 0 && cs == 0;
-}
-#endif
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 0);
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);
-}
-
-static void sama5d4ek_spi0_hw_init(void)
-{
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 0, 0);	/* SPI0_MISO */
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 1, 0);	/* SPI0_MOSI */
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 2, 0);	/* SPI0_SPCK */
-
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);	/* SPI0_CS0 */
-
-	/* Enable clock */
-	at91_periph_clk_enable(ATMEL_ID_SPI0);
-}
-#endif /* CONFIG_ATMEL_SPI */
-
 #ifdef CONFIG_NAND_ATMEL
 static void sama5d4ek_nand_hw_init(void)
 {
@@ -198,42 +164,6 @@ void lcd_show_board_info(void)
 
 #endif /* CONFIG_LCD */
 
-#ifdef CONFIG_GENERIC_ATMEL_MCI
-void sama5d4ek_mci1_hw_init(void)
-{
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 19, 1);	/* MCI1 CDA */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 20, 1);	/* MCI1 DA0 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 21, 1);	/* MCI1 DA1 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 22, 1);	/* MCI1 DA2 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 23, 1);	/* MCI1 DA3 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 18, 0);	/* MCI1 CLK */
-
-	/*
-	 * As the mci io internal pull down is too strong, so if the io needs
-	 * external pull up, the pull up resistor will be very small, if so
-	 * the power consumption will increase, so disable the interanl pull
-	 * down to save the power.
-	 */
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 18, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 19, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 20, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 21, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 22, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 23, 0);
-
-	/* Enable clock */
-	at91_periph_clk_enable(ATMEL_ID_MCI1);
-}
-
-int board_mmc_init(bd_t *bis)
-{
-	/* Enable power for MCI1 interface */
-	at91_set_pio_output(AT91_PIO_PORTE, 15, 0);
-
-	return atmel_mci_init((void *)ATMEL_BASE_MCI1);
-}
-#endif /* CONFIG_GENERIC_ATMEL_MCI */
-
 #ifdef CONFIG_MACB
 void sama5d4ek_macb0_hw_init(void)
 {
@@ -264,12 +194,6 @@ static void sama5d4ek_serial3_hw_init(void)
 
 int board_early_init_f(void)
 {
-	at91_periph_clk_enable(ATMEL_ID_PIOA);
-	at91_periph_clk_enable(ATMEL_ID_PIOB);
-	at91_periph_clk_enable(ATMEL_ID_PIOC);
-	at91_periph_clk_enable(ATMEL_ID_PIOD);
-	at91_periph_clk_enable(ATMEL_ID_PIOE);
-
 	sama5d4ek_serial3_hw_init();
 
 	return 0;
@@ -280,15 +204,9 @@ int board_init(void)
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
-#ifdef CONFIG_ATMEL_SPI
-	sama5d4ek_spi0_hw_init();
-#endif
 #ifdef CONFIG_NAND_ATMEL
 	sama5d4ek_nand_hw_init();
 #endif
-#ifdef CONFIG_GENERIC_ATMEL_MCI
-	sama5d4ek_mci1_hw_init();
-#endif
 #ifdef CONFIG_MACB
 	sama5d4ek_macb0_hw_init();
 #endif
@@ -334,12 +252,8 @@ int board_eth_init(bd_t *bis)
 #ifdef CONFIG_SPL_BUILD
 void spl_board_init(void)
 {
-#ifdef CONFIG_SYS_USE_MMC
-	sama5d4ek_mci1_hw_init();
-#elif CONFIG_SYS_USE_NANDFLASH
+#if CONFIG_SYS_USE_NANDFLASH
 	sama5d4ek_nand_hw_init();
-#elif CONFIG_SYS_USE_SERIALFLASH
-	sama5d4ek_spi0_hw_init();
 #endif
 }
 
Signature · 1 line
2.7.4
#14 lore raw

PATCH v2 6/8 board: sama5d4ek: clean up code

Quoted 5 lines · Wenyou Yang

Since the introduction of the pinctrl and clk driver and the dts file, remove unneeded hard coded related code from the board file.

Quoted 149 lines

---

Changes in v2:
- Restore the wrong removal USB related code.
- Update the commit log.

 board/atmel/sama5d4ek/sama5d4ek.c | 88 
+--------------------------------------
 1 file changed, 1 insertion(+), 87 deletions(-)
board/atmel/sama5d4ek/sama5d4ek.c +1 -87
index a0e4bb7..c5479e7 100644
@@ -16,48 +16,14 @@
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
 #include <atmel_hlcdc.h>
-#include <atmel_mci.h>
 #include <lcd.h>
-#include <mmc.h>
 #include <net.h>
 #include <netdev.h>
 #include <nand.h>
-#include <spi.h>
 #include <version.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_ATMEL_SPI
-#ifndef CONFIG_DM_SPI
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-	return bus == 0 && cs == 0;
-}
-#endif
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 0);
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);
-}
-
-static void sama5d4ek_spi0_hw_init(void)
-{
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 0, 0);	/* SPI0_MISO */
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 1, 0);	/* SPI0_MOSI */
-	at91_pio3_set_a_periph(AT91_PIO_PORTC, 2, 0);	/* SPI0_SPCK */
-
-	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);	/* SPI0_CS0 */
-
-	/* Enable clock */
-	at91_periph_clk_enable(ATMEL_ID_SPI0);
-}
-#endif /* CONFIG_ATMEL_SPI */
-
 #ifdef CONFIG_NAND_ATMEL
 static void sama5d4ek_nand_hw_init(void)
 {
@@ -198,42 +164,6 @@ void lcd_show_board_info(void)
 
 #endif /* CONFIG_LCD */
 
-#ifdef CONFIG_GENERIC_ATMEL_MCI
-void sama5d4ek_mci1_hw_init(void)
-{
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 19, 1);	/* MCI1 CDA */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 20, 1);	/* MCI1 DA0 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 21, 1);	/* MCI1 DA1 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 22, 1);	/* MCI1 DA2 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 23, 1);	/* MCI1 DA3 */
-	at91_pio3_set_c_periph(AT91_PIO_PORTE, 18, 0);	/* MCI1 CLK */
-
-	/*
-	 * As the mci io internal pull down is too strong, so if the io needs
-	 * external pull up, the pull up resistor will be very small, if so
-	 * the power consumption will increase, so disable the interanl pull
-	 * down to save the power.
-	 */
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 18, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 19, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 20, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 21, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 22, 0);
-	at91_pio3_set_pio_pulldown(AT91_PIO_PORTE, 23, 0);
-
-	/* Enable clock */
-	at91_periph_clk_enable(ATMEL_ID_MCI1);
-}
-
-int board_mmc_init(bd_t *bis)
-{
-	/* Enable power for MCI1 interface */
-	at91_set_pio_output(AT91_PIO_PORTE, 15, 0);
-
-	return atmel_mci_init((void *)ATMEL_BASE_MCI1);
-}
-#endif /* CONFIG_GENERIC_ATMEL_MCI */
-
 #ifdef CONFIG_MACB
 void sama5d4ek_macb0_hw_init(void)
 {
@@ -264,12 +194,6 @@ static void sama5d4ek_serial3_hw_init(void)
 
 int board_early_init_f(void)
 {
-	at91_periph_clk_enable(ATMEL_ID_PIOA);
-	at91_periph_clk_enable(ATMEL_ID_PIOB);
-	at91_periph_clk_enable(ATMEL_ID_PIOC);
-	at91_periph_clk_enable(ATMEL_ID_PIOD);
-	at91_periph_clk_enable(ATMEL_ID_PIOE);
-
 	sama5d4ek_serial3_hw_init();
 
 	return 0;
@@ -280,15 +204,9 @@ int board_init(void)
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
-#ifdef CONFIG_ATMEL_SPI
-	sama5d4ek_spi0_hw_init();
-#endif
 #ifdef CONFIG_NAND_ATMEL
 	sama5d4ek_nand_hw_init();
 #endif
-#ifdef CONFIG_GENERIC_ATMEL_MCI
-	sama5d4ek_mci1_hw_init();
-#endif
 #ifdef CONFIG_MACB
 	sama5d4ek_macb0_hw_init();
 #endif
@@ -334,12 +252,8 @@ int board_eth_init(bd_t *bis)
 #ifdef CONFIG_SPL_BUILD
 void spl_board_init(void)
 {
-#ifdef CONFIG_SYS_USE_MMC
-	sama5d4ek_mci1_hw_init();
-#elif CONFIG_SYS_USE_NANDFLASH
+#if CONFIG_SYS_USE_NANDFLASH
 	sama5d4ek_nand_hw_init();
-#elif CONFIG_SYS_USE_SERIALFLASH
-	sama5d4ek_spi0_hw_init();
 #endif
 }
#15 lore raw

PATCH v2 7/8 board: sama5d4ek: enable early debug UART

In reply to Wenyou Yang

Enable early debug UART to debug problems when an ICE or other debug mechanism is not available.

---

Changes in v2: None

 board/atmel/sama5d4ek/sama5d4ek.c     | 15 ++++++++++++++-
 configs/sama5d4ek_mmc_defconfig       |  6 ++++++
 configs/sama5d4ek_nandflash_defconfig |  6 ++++++
 configs/sama5d4ek_spiflash_defconfig  |  6 ++++++
 include/configs/sama5d4ek.h           |  2 ++
 5 files changed, 34 insertions(+), 1 deletion(-)
board/atmel/sama5d4ek/sama5d4ek.c +14 -1
index c5479e7..2c2036c 100644
@@ -17,6 +17,7 @@
 #include <asm/arch/sama5d4.h>
 #include <atmel_hlcdc.h>
 #include <lcd.h>
+#include <debug_uart.h>
 #include <net.h>
 #include <netdev.h>
 #include <nand.h>
@@ -192,12 +193,24 @@ static void sama5d4ek_serial3_hw_init(void)
 	at91_periph_clk_enable(ATMEL_ID_USART3);
 }
 
-int board_early_init_f(void)
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
 {
 	sama5d4ek_serial3_hw_init();
+}
+#endif
 
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifdef CONFIG_DEBUG_UART
+	debug_uart_init();
+#else
+	sama5d4ek_serial3_hw_init();
+#endif
 	return 0;
 }
+#endif
 
 int board_init(void)
 {
configs/sama5d4ek_mmc_defconfig +6 -0
index fd49b58..76b7855 100644
@@ -48,6 +48,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
configs/sama5d4ek_nandflash_defconfig +6 -0
index 34f5234..1bef322 100644
@@ -46,6 +46,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
configs/sama5d4ek_spiflash_defconfig +6 -0
index c7f4655..bd7325e 100644
@@ -47,6 +47,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
include/configs/sama5d4ek.h +2 -0
index b5b8e4c..964cb6b 100644
@@ -15,6 +15,8 @@
 
 #include "at91-sama5_common.h"
 
+#define CONFIG_BOARD_EARLY_INIT_F
+
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
Signature · 1 line
2.7.4
#16 lore raw

PATCH v2 7/8 board: sama5d4ek: enable early debug UART

Quoted 4 lines · Wenyou Yang

Enable early debug UART to debug problems when an ICE or other debug mechanism is not available.

Quoted 117 lines

---

Changes in v2: None

 board/atmel/sama5d4ek/sama5d4ek.c     | 15 ++++++++++++++-
 configs/sama5d4ek_mmc_defconfig       |  6 ++++++
 configs/sama5d4ek_nandflash_defconfig |  6 ++++++
 configs/sama5d4ek_spiflash_defconfig  |  6 ++++++
 include/configs/sama5d4ek.h           |  2 ++
 5 files changed, 34 insertions(+), 1 deletion(-)
board/atmel/sama5d4ek/sama5d4ek.c +14 -1
index c5479e7..2c2036c 100644
@@ -17,6 +17,7 @@
 #include <asm/arch/sama5d4.h>
 #include <atmel_hlcdc.h>
 #include <lcd.h>
+#include <debug_uart.h>
 #include <net.h>
 #include <netdev.h>
 #include <nand.h>
@@ -192,12 +193,24 @@ static void sama5d4ek_serial3_hw_init(void)
 	at91_periph_clk_enable(ATMEL_ID_USART3);
 }
 
-int board_early_init_f(void)
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
 {
 	sama5d4ek_serial3_hw_init();
+}
+#endif
 
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifdef CONFIG_DEBUG_UART
+	debug_uart_init();
+#else
+	sama5d4ek_serial3_hw_init();
+#endif
 	return 0;
 }
+#endif
 
 int board_init(void)
 {
configs/sama5d4ek_mmc_defconfig +6 -0
index fd49b58..76b7855 100644
@@ -48,6 +48,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
configs/sama5d4ek_nandflash_defconfig +6 -0
index 34f5234..1bef322 100644
@@ -46,6 +46,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
configs/sama5d4ek_spiflash_defconfig +6 -0
index c7f4655..bd7325e 100644
@@ -47,6 +47,12 @@ CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_AT91=y
 CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_BASE=0xfc00c000
+CONFIG_DEBUG_UART_CLOCK=0
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
include/configs/sama5d4ek.h +2 -0
index b5b8e4c..964cb6b 100644
@@ -15,6 +15,8 @@
 
 #include "at91-sama5_common.h"
 
+#define CONFIG_BOARD_EARLY_INIT_F
+
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
#17 lore raw

PATCH v2 8/8 configs: sama5d4: move CONFIG_SYS_NO_FLASH to *defconfig

In reply to Wenyou Yang

Move CONFIG_SYS_NO_FLASH to the configs/sama5d4*_defconfig file.

---

Changes in v2: None

 configs/sama5d4_xplained_mmc_defconfig       | 1 +
 configs/sama5d4_xplained_nandflash_defconfig | 1 +
 configs/sama5d4_xplained_spiflash_defconfig  | 1 +
 configs/sama5d4ek_mmc_defconfig              | 1 +
 configs/sama5d4ek_nandflash_defconfig        | 1 +
 configs/sama5d4ek_spiflash_defconfig         | 1 +
 include/configs/sama5d4_xplained.h           | 3 ---
 include/configs/sama5d4ek.h                  | 3 ---
 8 files changed, 6 insertions(+), 6 deletions(-)
configs/sama5d4_xplained_mmc_defconfig +1 -0
index e7518e8..dfd6070 100644
@@ -12,6 +12,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
configs/sama5d4_xplained_nandflash_defconfig +1 -0
index 790d7d1..3ac745c 100644
@@ -10,6 +10,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
configs/sama5d4_xplained_spiflash_defconfig +1 -0
index af6263f..bd3353b 100644
@@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
 CONFIG_BOOTDELAY=3
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
configs/sama5d4ek_mmc_defconfig +1 -0
index 76b7855..799fbbc 100644
@@ -14,6 +14,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
configs/sama5d4ek_nandflash_defconfig +1 -0
index 1bef322..cf2d714 100644
@@ -12,6 +12,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
configs/sama5d4ek_spiflash_defconfig +1 -0
index bd7325e..67e2fab 100644
@@ -13,6 +13,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
 CONFIG_BOOTDELAY=3
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
include/configs/sama5d4_xplained.h +0 -3
index 8032164..68d7bcf 100644
@@ -10,9 +10,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-/* No NOR flash, this definition should put before common header */
-#define CONFIG_SYS_NO_FLASH
-
 #include "at91-sama5_common.h"
 
 #define CONFIG_BOARD_EARLY_INIT_F
include/configs/sama5d4ek.h +0 -3
index 964cb6b..fd60540 100644
@@ -10,9 +10,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-/* No NOR flash, this definition should put before common header */
-#define CONFIG_SYS_NO_FLASH
-
 #include "at91-sama5_common.h"
 
 #define CONFIG_BOARD_EARLY_INIT_F
Signature · 1 line
2.7.4
#18 lore raw

PATCH v2 8/8 configs: sama5d4: move CONFIG_SYS_NO_FLASH to *defconfig

Quoted 3 lines · Wenyou Yang

Move CONFIG_SYS_NO_FLASH to the configs/sama5d4*_defconfig file.

Quoted 122 lines

---

Changes in v2: None

 configs/sama5d4_xplained_mmc_defconfig       | 1 +
 configs/sama5d4_xplained_nandflash_defconfig | 1 +
 configs/sama5d4_xplained_spiflash_defconfig  | 1 +
 configs/sama5d4ek_mmc_defconfig              | 1 +
 configs/sama5d4ek_nandflash_defconfig        | 1 +
 configs/sama5d4ek_spiflash_defconfig         | 1 +
 include/configs/sama5d4_xplained.h           | 3 ---
 include/configs/sama5d4ek.h                  | 3 ---
 8 files changed, 6 insertions(+), 6 deletions(-)
configs/sama5d4_xplained_mmc_defconfig +1 -0
index e7518e8..dfd6070 100644
@@ -12,6 +12,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
configs/sama5d4_xplained_nandflash_defconfig +1 -0
index 790d7d1..3ac745c 100644
@@ -10,6 +10,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
configs/sama5d4_xplained_spiflash_defconfig +1 -0
index af6263f..bd3353b 100644
@@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
 CONFIG_BOOTDELAY=3
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
configs/sama5d4ek_mmc_defconfig +1 -0
index 76b7855..799fbbc 100644
@@ -14,6 +14,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
configs/sama5d4ek_nandflash_defconfig +1 -0
index 1bef322..cf2d714 100644
@@ -12,6 +12,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
configs/sama5d4ek_spiflash_defconfig +0 -0
index bd7325e..67e2fab 100644
@@ -13,6 +13,7 @@ 

CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
CONFIG_BOOTDELAY=3
# CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y

configs/sama5d4ek_spiflash_defconfig +1 -0
+CONFIG_SYS_NO_FLASH=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
include/configs/sama5d4_xplained.h +0 -3
index 8032164..68d7bcf 100644
@@ -10,9 +10,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-/* No NOR flash, this definition should put before common header */
-#define CONFIG_SYS_NO_FLASH
-
 #include "at91-sama5_common.h"
 
 #define CONFIG_BOARD_EARLY_INIT_F
include/configs/sama5d4ek.h +0 -3
index 964cb6b..fd60540 100644
@@ -10,9 +10,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-/* No NOR flash, this definition should put before common header */
-#define CONFIG_SYS_NO_FLASH
-
 #include "at91-sama5_common.h"
 
 #define CONFIG_BOARD_EARLY_INIT_F
#19 lore raw

v2 cover board: sama5d4: convert boards to support DM/DT

In reply to Wenyou Yang

Hi Wenyou,

Quoted 4 lines · Wenyou Yang

The purpose of patch set is to convert the board to support Device Tree and Driver Model.

They are based on the following patches:

Quoted 11 lines
	1./ [PATCH v3 0/2] pinctrl: at91: Add pinctrl driver
	http://lists.denx.de/pipermail/u-boot/2016-October/270991.html
	2./ [PATCH v1 0/2] ARM: dts: at91: add dts files for the boards of SAMA5D4
	http://lists.denx.de/pipermail/u-boot/2016-October/271004.html
	3./ [PATCH v3 0/2] serial: atmel_usart: Support to enable an early debug UART
	http://lists.denx.de/pipermail/u-boot/2016-October/270250.html
	4./ [PATCH v1 0/3] gpio: at91_gpio: Add option and clock support
	http://lists.denx.de/pipermail/u-boot/2016-October/270687.html
	5./ [PATCH v10] dm: at91: Add driver model support for the spi driver
	http://lists.denx.de/pipermail/u-boot/2016-October/270516.html

could you please send this series rebased on current ToT?

Andreas

Quoted 33 lines

Changes in v2:
- Restore the wrong removal #define CONFIG_USB_ETHER.
- Update the commit log.
- Restore the wrong removal of USB related code.
- Update the commit log.
- Restore wrong removal of #define CONFIG_USB_ETHER.
- Update the commit log.
- Restore the wrong removal USB related code.
- Update the commit log.

Wenyou Yang (8):
configs: at91-sama5_common: fix for CONFIG_AT91_GPIO
board: sama5d4_xplained: move config options to defconfig
board: sama5d4_xplained: clean up code
board: sama5d4_xplained: enable early debug UART
board: sama5d4ek: move config options to defconfig
board: sama5d4ek: clean up code
board: sama5d4ek: enable early debug UART
configs: sama5d4: move CONFIG_SYS_NO_FLASH to *defconfig

 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 100 ++++-------------------
 board/atmel/sama5d4ek/sama5d4ek.c               | 101 ++++--------------------
 configs/sama5d4_xplained_mmc_defconfig          |  31 +++++++-
 configs/sama5d4_xplained_nandflash_defconfig    |  33 +++++++-
 configs/sama5d4_xplained_spiflash_defconfig     |  31 +++++++-
 configs/sama5d4ek_mmc_defconfig                 |  30 +++++++
 configs/sama5d4ek_nandflash_defconfig           |  30 +++++++
 configs/sama5d4ek_spiflash_defconfig            |  30 +++++++
 include/configs/at91-sama5_common.h             |   2 +
 include/configs/sama5d4_xplained.h              |  28 +------
 include/configs/sama5d4ek.h                     |  29 +------
 11 files changed, 216 insertions(+), 229 deletions(-)
#20 lore raw

v2 cover board: sama5d4: convert boards to support DM/DT

Hi Andreas,

Thank you very much for your review! a lot of patches.

Quoted 22 lines

-----Original Message-----
From: Andreas Bie?mann [mailto:andreas at biessmann.org]
Sent: 2017?2?7? 3:52
To: Wenyou Yang - A41535 <[email protected]>; U-Boot Mailing List <[email protected]>
Subject: Re: [U-Boot] [PATCH v2 0/8] board: sama5d4: convert boards to support DM/DT

Hi Wenyou,

Quoted 7 lines · Wenyou Yang

The purpose of patch set is to convert the board to support Device Tree and Driver Model.

They are based on the following patches:
1./ [PATCH v3 0/2] pinctrl: at91: Add pinctrl driver
http://lists.denx.de/pipermail/u-boot/2016-October/270991.html
2./ [PATCH v1 0/2] ARM: dts: at91: add dts files for the boards of

SAMA5D4

Quoted 2 lines
	http://lists.denx.de/pipermail/u-boot/2016-October/271004.html
	3./ [PATCH v3 0/2] serial: atmel_usart: Support to enable an early debug

UART

Quoted 8 lines
Quoted 6 lines
	http://lists.denx.de/pipermail/u-boot/2016-October/270250.html
	4./ [PATCH v1 0/3] gpio: at91_gpio: Add option and clock support
	http://lists.denx.de/pipermail/u-boot/2016-October/270687.html
	5./ [PATCH v10] dm: at91: Add driver model support for the spi driver
	http://lists.denx.de/pipermail/u-boot/2016-October/270516.html

could you please send this series rebased on current ToT?

Okay, I will rebase it and sent.

Quoted 36 lines

Andreas

Quoted 33 lines

Changes in v2:
- Restore the wrong removal #define CONFIG_USB_ETHER.
- Update the commit log.
- Restore the wrong removal of USB related code.
- Update the commit log.
- Restore wrong removal of #define CONFIG_USB_ETHER.
- Update the commit log.
- Restore the wrong removal USB related code.
- Update the commit log.

Wenyou Yang (8):
configs: at91-sama5_common: fix for CONFIG_AT91_GPIO
board: sama5d4_xplained: move config options to defconfig
board: sama5d4_xplained: clean up code
board: sama5d4_xplained: enable early debug UART
board: sama5d4ek: move config options to defconfig
board: sama5d4ek: clean up code
board: sama5d4ek: enable early debug UART
configs: sama5d4: move CONFIG_SYS_NO_FLASH to *defconfig

 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 100 ++++-------------------
 board/atmel/sama5d4ek/sama5d4ek.c               | 101 ++++--------------------
 configs/sama5d4_xplained_mmc_defconfig          |  31 +++++++-
 configs/sama5d4_xplained_nandflash_defconfig    |  33 +++++++-
 configs/sama5d4_xplained_spiflash_defconfig     |  31 +++++++-
 configs/sama5d4ek_mmc_defconfig                 |  30 +++++++
 configs/sama5d4ek_nandflash_defconfig           |  30 +++++++
 configs/sama5d4ek_spiflash_defconfig            |  30 +++++++
 include/configs/at91-sama5_common.h             |   2 +
 include/configs/sama5d4_xplained.h              |  28 +------
 include/configs/sama5d4ek.h                     |  29 +------
 11 files changed, 216 insertions(+), 229 deletions(-)

Best Regards,
Wenyou Yang