[U-Boot] [PATCH v1 0/7] board: sama5d3: 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 SAMA5D3 http://lists.denx.de/pipermail/u-boot/2016-October/271241.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 v2 0/3] gpio: at91_gpio: Add option and clock support http://lists.denx.de/pipermail/u-boot/2016-October/271231.html 5./ [PATCH v11] dm: at91: Add driver model support for the spi driver http://lists.denx.de/pipermail/u-boot/2016-October/271235.html 6./ [PATCH v2 0/8] board: sama5d4: convert boards to support DM/DT http://lists.denx.de/pipermail/u-boot/2016-October/271244.html
Wenyou Yang (7): board: sama5d3xek: move config options to defconfig board: sama5d3xek: clean up code board: sama5d3xek: enable early debug UART board: sama5d3_xplained: move config options to defconfig board: sama5d3_xplained: clean up code board: sama5d3_xplained: enable early debug UART configs: sama5d3_xplained: move CONFIG_SYS_NO_FLASH to defconfig
board/atmel/sama5d3_xplained/sama5d3_xplained.c | 35 +++++----- board/atmel/sama5d3xek/sama5d3xek.c | 86 +++++-------------------- configs/sama5d3_xplained_mmc_defconfig | 28 +++++++- configs/sama5d3_xplained_nandflash_defconfig | 28 +++++++- configs/sama5d3xek_mmc_defconfig | 30 ++++++++- configs/sama5d3xek_nandflash_defconfig | 31 ++++++++- configs/sama5d3xek_spiflash_defconfig | 30 ++++++++- include/configs/sama5d3_xplained.h | 10 +-- include/configs/sama5d3xek.h | 17 +---- 9 files changed, 174 insertions(+), 121 deletions(-)

Enable CONFIG_CLK and CONFIG_PINCTRL to support at91 clock driver and at91 pinctrl driver.
Move some config options to configs/sama5d3xek_*_defconfig.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
board/atmel/sama5d3xek/sama5d3xek.c | 2 ++ configs/sama5d3xek_mmc_defconfig | 24 +++++++++++++++++++++++- configs/sama5d3xek_nandflash_defconfig | 25 ++++++++++++++++++++++++- configs/sama5d3xek_spiflash_defconfig | 24 +++++++++++++++++++++++- include/configs/sama5d3xek.h | 16 ---------------- 5 files changed, 72 insertions(+), 19 deletions(-)
diff --git a/board/atmel/sama5d3xek/sama5d3xek.c b/board/atmel/sama5d3xek/sama5d3xek.c index f001696..08f1be4 100644 --- a/board/atmel/sama5d3xek/sama5d3xek.c +++ b/board/atmel/sama5d3xek/sama5d3xek.c @@ -331,6 +331,7 @@ int board_mmc_init(bd_t *bis) #ifdef CONFIG_ATMEL_SPI #include <spi.h>
+#ifndef CONFIG_DM_SPI int spi_cs_is_valid(unsigned int bus, unsigned int cs) { return bus == 0 && cs < 4; @@ -367,6 +368,7 @@ void spi_cs_deactivate(struct spi_slave *slave) break; } } +#endif #endif /* CONFIG_ATMEL_SPI */
#ifdef CONFIG_BOARD_LATE_INIT diff --git a/configs/sama5d3xek_mmc_defconfig b/configs/sama5d3xek_mmc_defconfig index ea6d4b9..d8556ab 100644 --- a/configs/sama5d3xek_mmc_defconfig +++ b/configs/sama5d3xek_mmc_defconfig @@ -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="sama5d36ek" CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D3,SYS_USE_MMC" CONFIG_BOOTDELAY=3 @@ -27,11 +28,32 @@ CONFIG_CMD_DHCP=y CONFIG_CMD_MII=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_LCD=y -CONFIG_OF_LIBFDT=y diff --git a/configs/sama5d3xek_nandflash_defconfig b/configs/sama5d3xek_nandflash_defconfig index f8504cc..7cf875d 100644 --- a/configs/sama5d3xek_nandflash_defconfig +++ b/configs/sama5d3xek_nandflash_defconfig @@ -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="sama5d36ek" CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D3,SYS_USE_NANDFLASH" CONFIG_BOOTDELAY=3 @@ -25,11 +26,33 @@ CONFIG_CMD_DHCP=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y CONFIG_CMD_FAT=y +CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clocks clock-names interrupt-parent" +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_LCD=y -CONFIG_OF_LIBFDT=y diff --git a/configs/sama5d3xek_spiflash_defconfig b/configs/sama5d3xek_spiflash_defconfig index b5cabaf..7906fe7 100644 --- a/configs/sama5d3xek_spiflash_defconfig +++ b/configs/sama5d3xek_spiflash_defconfig @@ -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="sama5d36ek" CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D3,SYS_USE_SERIALFLASH" CONFIG_BOOTDELAY=3 @@ -26,11 +27,32 @@ CONFIG_CMD_DHCP=y CONFIG_CMD_MII=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_LCD=y -CONFIG_OF_LIBFDT=y diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h index 1b053a6..e45c713 100644 --- a/include/configs/sama5d3xek.h +++ b/include/configs/sama5d3xek.h @@ -22,11 +22,6 @@ #define CONFIG_BOARD_LATE_INIT #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-/* serial console */ -#define CONFIG_ATMEL_USART -#define CONFIG_USART_BASE ATMEL_BASE_DBGU -#define CONFIG_USART_ID ATMEL_ID_DBGU - /* * This needs to be defined for the OHCI code to work but it is defined as * ATMEL_ID_UHPHS in the CPU specific header files. @@ -73,13 +68,6 @@ (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE) #endif
-/* SerialFlash */ - -#ifdef CONFIG_CMD_SF -#define CONFIG_ATMEL_SPI -#define CONFIG_SF_DEFAULT_SPEED 30000000 -#endif - /* NAND flash */ #define CONFIG_CMD_NAND
@@ -111,18 +99,14 @@ #define CONFIG_PHY_MICREL_KSZ9021
/* MMC */ - #ifdef CONFIG_CMD_MMC #define CONFIG_MMC #define CONFIG_GENERIC_MMC -#define CONFIG_GENERIC_ATMEL_MCI -#define ATMEL_BASE_MMCI ATMEL_BASE_MCI0 #endif
/* USB */
#ifdef CONFIG_CMD_USB -#define CONFIG_USB_ATMEL #define CONFIG_USB_ATMEL_CLK_SEL_UPLL #define CONFIG_USB_OHCI_NEW #define CONFIG_SYS_USB_OHCI_CPU_INIT

Since the introduction of the pinctrl and clk driver and the dts file, remove unneeded hard coded related code from the board file.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
board/atmel/sama5d3xek/sama5d3xek.c | 73 +------------------------------------ 1 file changed, 1 insertion(+), 72 deletions(-)
diff --git a/board/atmel/sama5d3xek/sama5d3xek.c b/board/atmel/sama5d3xek/sama5d3xek.c index 08f1be4..a348643 100644 --- a/board/atmel/sama5d3xek/sama5d3xek.c +++ b/board/atmel/sama5d3xek/sama5d3xek.c @@ -16,7 +16,6 @@ #include <lcd.h> #include <linux/ctype.h> #include <atmel_hlcdc.h> -#include <atmel_mci.h> #include <phy.h> #include <micrel.h> #include <net.h> @@ -135,8 +134,6 @@ static void sama5d3xek_usb_hw_init(void) #ifdef CONFIG_GENERIC_ATMEL_MCI static void sama5d3xek_mci_hw_init(void) { - at91_mci_hw_init(); - at91_set_pio_output(AT91_PIO_PORTB, 10, 0); /* MCI0 Power */ } #endif @@ -217,12 +214,6 @@ void lcd_show_board_info(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); - at91_seriald_hw_init();
return 0; @@ -248,9 +239,6 @@ int board_init(void) #ifdef CONFIG_GENERIC_ATMEL_MCI sama5d3xek_mci_hw_init(); #endif -#ifdef CONFIG_ATMEL_SPI - at91_spi0_hw_init(1 << 0); -#endif #ifdef CONFIG_MACB if (has_emac()) at91_macb_hw_init(); @@ -316,61 +304,6 @@ int board_eth_init(bd_t *bis) return rc; }
-#ifdef CONFIG_GENERIC_ATMEL_MCI -int board_mmc_init(bd_t *bis) -{ - int rc = 0; - - rc = atmel_mci_init((void *)ATMEL_BASE_MCI0); - - return rc; -} -#endif - -/* SPI chip select control */ -#ifdef CONFIG_ATMEL_SPI -#include <spi.h> - -#ifndef CONFIG_DM_SPI -int spi_cs_is_valid(unsigned int bus, unsigned int cs) -{ - return bus == 0 && cs < 4; -} - -void spi_cs_activate(struct spi_slave *slave) -{ - switch (slave->cs) { - case 0: - at91_set_pio_output(AT91_PIO_PORTD, 13, 0); - case 1: - at91_set_pio_output(AT91_PIO_PORTD, 14, 0); - case 2: - at91_set_pio_output(AT91_PIO_PORTD, 15, 0); - case 3: - at91_set_pio_output(AT91_PIO_PORTD, 16, 0); - default: - break; - } -} - -void spi_cs_deactivate(struct spi_slave *slave) -{ - switch (slave->cs) { - case 0: - at91_set_pio_output(AT91_PIO_PORTD, 13, 1); - case 1: - at91_set_pio_output(AT91_PIO_PORTD, 14, 1); - case 2: - at91_set_pio_output(AT91_PIO_PORTD, 15, 1); - case 3: - at91_set_pio_output(AT91_PIO_PORTD, 16, 1); - default: - break; - } -} -#endif -#endif /* CONFIG_ATMEL_SPI */ - #ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { @@ -394,12 +327,8 @@ int board_late_init(void) #ifdef CONFIG_SPL_BUILD void spl_board_init(void) { -#ifdef CONFIG_SYS_USE_MMC - sama5d3xek_mci_hw_init(); -#elif CONFIG_SYS_USE_NANDFLASH +#if CONFIG_SYS_USE_NANDFLASH sama5d3xek_nand_hw_init(); -#elif CONFIG_SYS_USE_SERIALFLASH - at91_spi0_hw_init(1 << 0); #endif }

Enable early debug UART to debug problems when an ICE or other debug mechanism is not available.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
board/atmel/sama5d3xek/sama5d3xek.c | 15 ++++++++++++++- configs/sama5d3xek_mmc_defconfig | 6 ++++++ configs/sama5d3xek_nandflash_defconfig | 6 ++++++ configs/sama5d3xek_spiflash_defconfig | 6 ++++++ include/configs/sama5d3xek.h | 1 + 5 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/board/atmel/sama5d3xek/sama5d3xek.c b/board/atmel/sama5d3xek/sama5d3xek.c index a348643..6bd4a68 100644 --- a/board/atmel/sama5d3xek/sama5d3xek.c +++ b/board/atmel/sama5d3xek/sama5d3xek.c @@ -13,6 +13,7 @@ #include <asm/arch/at91_rstc.h> #include <asm/arch/gpio.h> #include <asm/arch/clk.h> +#include <debug_uart.h> #include <lcd.h> #include <linux/ctype.h> #include <atmel_hlcdc.h> @@ -212,12 +213,24 @@ void lcd_show_board_info(void) #endif /* CONFIG_LCD_INFO */ #endif /* CONFIG_LCD */
-int board_early_init_f(void) +#ifdef CONFIG_DEBUG_UART_BOARD_INIT +void board_debug_uart_init(void) { at91_seriald_hw_init(); +} +#endif
+#ifdef CONFIG_BOARD_EARLY_INIT_F +int board_early_init_f(void) +{ +#ifdef CONFIG_DEBUG_UART + debug_uart_init(); +#else + at91_seriald_hw_init(); +#endif return 0; } +#endif
int board_init(void) { diff --git a/configs/sama5d3xek_mmc_defconfig b/configs/sama5d3xek_mmc_defconfig index d8556ab..a834552 100644 --- a/configs/sama5d3xek_mmc_defconfig +++ b/configs/sama5d3xek_mmc_defconfig @@ -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=0xffffee00 +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 diff --git a/configs/sama5d3xek_nandflash_defconfig b/configs/sama5d3xek_nandflash_defconfig index 7cf875d..2e53ee9 100644 --- a/configs/sama5d3xek_nandflash_defconfig +++ b/configs/sama5d3xek_nandflash_defconfig @@ -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=0xffffee00 +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 diff --git a/configs/sama5d3xek_spiflash_defconfig b/configs/sama5d3xek_spiflash_defconfig index 7906fe7..6f26b4b 100644 --- a/configs/sama5d3xek_spiflash_defconfig +++ b/configs/sama5d3xek_spiflash_defconfig @@ -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=0xffffee00 +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 diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h index e45c713..5839fff 100644 --- a/include/configs/sama5d3xek.h +++ b/include/configs/sama5d3xek.h @@ -19,6 +19,7 @@ */ #include "at91-sama5_common.h"
+#define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOARD_LATE_INIT #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG

Enable CONFIG_CLK and CONFIG_PINCTRL to support at91 clock driver and at91 pinctrl driver.
Move some config options to configs/sama5d3xek_*_defconfig.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
configs/sama5d3_xplained_mmc_defconfig | 21 ++++++++++++++++++++- configs/sama5d3_xplained_nandflash_defconfig | 21 ++++++++++++++++++++- include/configs/sama5d3_xplained.h | 7 ------- 3 files changed, 40 insertions(+), 9 deletions(-)
diff --git a/configs/sama5d3_xplained_mmc_defconfig b/configs/sama5d3_xplained_mmc_defconfig index 4f4e51b..8940f16 100644 --- a/configs/sama5d3_xplained_mmc_defconfig +++ b/configs/sama5d3_xplained_mmc_defconfig @@ -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-sama5d3_xplained" CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D3,SYS_USE_MMC" CONFIG_BOOTDELAY=3 @@ -29,6 +30,24 @@ CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_CMD_UBI=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_PINCTRL=y +CONFIG_PINCTRL_AT91=y +CONFIG_DM_SERIAL=y +CONFIG_ATMEL_USART=y CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y -CONFIG_OF_LIBFDT=y diff --git a/configs/sama5d3_xplained_nandflash_defconfig b/configs/sama5d3_xplained_nandflash_defconfig index e83d047..6020513 100644 --- a/configs/sama5d3_xplained_nandflash_defconfig +++ b/configs/sama5d3_xplained_nandflash_defconfig @@ -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-sama5d3_xplained" CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D3,SYS_USE_NANDFLASH" CONFIG_BOOTDELAY=3 @@ -27,6 +28,24 @@ CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_CMD_UBI=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_PINCTRL=y +CONFIG_PINCTRL_AT91=y +CONFIG_DM_SERIAL=y +CONFIG_ATMEL_USART=y CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y -CONFIG_OF_LIBFDT=y diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h index 5e661741..fe5d19a 100644 --- a/include/configs/sama5d3_xplained.h +++ b/include/configs/sama5d3_xplained.h @@ -15,11 +15,6 @@
#include "at91-sama5_common.h"
-/* serial console */ -#define CONFIG_ATMEL_USART -#define CONFIG_USART_BASE ATMEL_BASE_DBGU -#define CONFIG_USART_ID ATMEL_ID_DBGU - /* * This needs to be defined for the OHCI code to work but it is defined as * ATMEL_ID_UHPHS in the CPU specific header files. @@ -83,8 +78,6 @@ #ifdef CONFIG_CMD_MMC #define CONFIG_MMC #define CONFIG_GENERIC_MMC -#define CONFIG_GENERIC_ATMEL_MCI -#define CONFIG_ATMEL_MCI_8BIT #endif
/* USB */

Since the introduction of the pinctrl and clk driver and the dts file, remove unneeded hard coded related code from the board file.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
board/atmel/sama5d3_xplained/sama5d3_xplained.c | 19 ------------------- 1 file changed, 19 deletions(-)
diff --git a/board/atmel/sama5d3_xplained/sama5d3_xplained.c b/board/atmel/sama5d3_xplained/sama5d3_xplained.c index 2b9da91..c4d67a7 100644 --- a/board/atmel/sama5d3_xplained/sama5d3_xplained.c +++ b/board/atmel/sama5d3_xplained/sama5d3_xplained.c @@ -6,14 +6,12 @@ */
#include <common.h> -#include <mmc.h> #include <asm/io.h> #include <asm/arch/sama5d3_smc.h> #include <asm/arch/at91_common.h> #include <asm/arch/at91_rstc.h> #include <asm/arch/gpio.h> #include <asm/arch/clk.h> -#include <atmel_mci.h> #include <net.h> #include <netdev.h> #include <spl.h> @@ -65,20 +63,12 @@ static void sama5d3_xplained_usb_hw_init(void) #ifdef CONFIG_GENERIC_ATMEL_MCI static void sama5d3_xplained_mci0_hw_init(void) { - at91_mci_hw_init(); - at91_set_pio_output(AT91_PIO_PORTE, 2, 0); /* MCI0 Power */ } #endif
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); - at91_seriald_hw_init();
return 0; @@ -122,15 +112,6 @@ int board_eth_init(bd_t *bis) return 0; }
-#ifdef CONFIG_GENERIC_ATMEL_MCI -int board_mmc_init(bd_t *bis) -{ - atmel_mci_init((void *)ATMEL_BASE_MCI0); - - return 0; -} -#endif - /* SPL */ #ifdef CONFIG_SPL_BUILD void spl_board_init(void)

Enable early debug UART to debug problems when an ICE or other debug mechanism is not available.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
board/atmel/sama5d3_xplained/sama5d3_xplained.c | 16 +++++++++++++++- configs/sama5d3_xplained_mmc_defconfig | 6 ++++++ configs/sama5d3_xplained_nandflash_defconfig | 6 ++++++ include/configs/sama5d3_xplained.h | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/board/atmel/sama5d3_xplained/sama5d3_xplained.c b/board/atmel/sama5d3_xplained/sama5d3_xplained.c index c4d67a7..692fec6 100644 --- a/board/atmel/sama5d3_xplained/sama5d3_xplained.c +++ b/board/atmel/sama5d3_xplained/sama5d3_xplained.c @@ -12,6 +12,7 @@ #include <asm/arch/at91_rstc.h> #include <asm/arch/gpio.h> #include <asm/arch/clk.h> +#include <debug_uart.h> #include <net.h> #include <netdev.h> #include <spl.h> @@ -67,12 +68,25 @@ static void sama5d3_xplained_mci0_hw_init(void) } #endif
-int board_early_init_f(void) +#ifdef CONFIG_DEBUG_UART_BOARD_INIT +void board_debug_uart_init(void) { at91_seriald_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(); + at91_seriald_hw_init(); +#endif return 0; } +#endif
int board_init(void) { diff --git a/configs/sama5d3_xplained_mmc_defconfig b/configs/sama5d3_xplained_mmc_defconfig index 8940f16..a9890cc 100644 --- a/configs/sama5d3_xplained_mmc_defconfig +++ b/configs/sama5d3_xplained_mmc_defconfig @@ -46,6 +46,12 @@ CONFIG_GENERIC_ATMEL_MCI=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=0xffffee00 +CONFIG_DEBUG_UART_CLOCK=0 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_USB=y CONFIG_DM_USB=y diff --git a/configs/sama5d3_xplained_nandflash_defconfig b/configs/sama5d3_xplained_nandflash_defconfig index 6020513..05798d6 100644 --- a/configs/sama5d3_xplained_nandflash_defconfig +++ b/configs/sama5d3_xplained_nandflash_defconfig @@ -44,6 +44,12 @@ CONFIG_GENERIC_ATMEL_MCI=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=0xffffee00 +CONFIG_DEBUG_UART_CLOCK=0 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_USB=y CONFIG_DM_USB=y diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h index fe5d19a..7cf65f9 100644 --- a/include/configs/sama5d3_xplained.h +++ b/include/configs/sama5d3_xplained.h @@ -15,6 +15,8 @@
#include "at91-sama5_common.h"
+#define CONFIG_BOARD_EARLY_INIT_F + /* * This needs to be defined for the OHCI code to work but it is defined as * ATMEL_ID_UHPHS in the CPU specific header files.

Move CONFIG_SYS_NO_FLASH to the configs/sama5d3x_xplained_*_defconfig files.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
configs/sama5d3_xplained_mmc_defconfig | 1 + configs/sama5d3_xplained_nandflash_defconfig | 1 + include/configs/sama5d3_xplained.h | 3 --- 3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/configs/sama5d3_xplained_mmc_defconfig b/configs/sama5d3_xplained_mmc_defconfig index a9890cc..4908966 100644 --- a/configs/sama5d3_xplained_mmc_defconfig +++ b/configs/sama5d3_xplained_mmc_defconfig @@ -12,6 +12,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d3_xplained" CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D3,SYS_USE_MMC" CONFIG_BOOTDELAY=3 +CONFIG_SYS_NO_FLASH=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y CONFIG_HUSH_PARSER=y diff --git a/configs/sama5d3_xplained_nandflash_defconfig b/configs/sama5d3_xplained_nandflash_defconfig index 05798d6..5f427c4 100644 --- a/configs/sama5d3_xplained_nandflash_defconfig +++ b/configs/sama5d3_xplained_nandflash_defconfig @@ -10,6 +10,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d3_xplained" CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D3,SYS_USE_NANDFLASH" CONFIG_BOOTDELAY=3 +CONFIG_SYS_NO_FLASH=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y CONFIG_HUSH_PARSER=y diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h index 7cf65f9..a14bec5 100644 --- a/include/configs/sama5d3_xplained.h +++ b/include/configs/sama5d3_xplained.h @@ -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
participants (1)
-
Wenyou Yang