[U-Boot] [PATCH v4 0/7] 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, and enable the early debug UART as well. It is based on the patch set: [PATCH v8 0/2] pinctrl: at91: Add pinctrl driver https://lists.denx.de/pipermail/u-boot/2017-March/284577.html
Changes in v4: - Convert the macb to support DM and clean up macb init code. - Remain the SPI speed macros. - Update the config options for SPL. - Update the commit log. - Remove the unneeded dbgu init during board_early_init_f stage. - Use CONFIG_DEBUG_UART_CLOCK as the input clock for the early debug uart. - Drop [PATCH] configs: sama5d4: move CONFIG_SYS_NO_FLASH to *defconfig - Rebase on v2017.03.
Changes in v3: - add the Reviewed-by tags. - rebase on the patch: [PATCH v2] ARM: dts: at91: add device tree files for at91sam9x5ek http://lists.denx.de/pipermail/u-boot/2017-February/280504.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 (7): configs: at91-sama5_common: fix for CONFIG_AT91_GPIO board: sama5d4_xplained: update to support DM/DT board: sama5d4_xplained: clean up code board: sama5d4_xplained: enable early debug UART board: sama5d4ek: update to support DM/DT board: sama5d4ek: clean up code board: sama5d4ek: enable early debug UART
board/atmel/sama5d4_xplained/sama5d4_xplained.c | 145 +++--------------------- board/atmel/sama5d4ek/sama5d4ek.c | 145 +++--------------------- configs/sama5d4_xplained_mmc_defconfig | 37 +++++- configs/sama5d4_xplained_nandflash_defconfig | 36 +++++- configs/sama5d4_xplained_spiflash_defconfig | 37 +++++- configs/sama5d4ek_mmc_defconfig | 37 ++++++ configs/sama5d4ek_nandflash_defconfig | 38 ++++++- configs/sama5d4ek_spiflash_defconfig | 38 ++++++- include/configs/at91-sama5_common.h | 2 + include/configs/sama5d4_xplained.h | 45 +------- include/configs/sama5d4ek.h | 45 +------- 11 files changed, 253 insertions(+), 352 deletions(-)

Add #ifndef CONFIG_DM_GPIO for CONFIG_AT91_GPIO define to avoid the redefine compilation error.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com Reviewed-by: Andreas Bießmann andreas@biessmann.org ---
Changes in v4: None Changes in v3: None Changes in v2: None
include/configs/at91-sama5_common.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h index 42410a8526..de37e24542 100644 --- a/include/configs/at91-sama5_common.h +++ b/include/configs/at91-sama5_common.h @@ -27,7 +27,9 @@ #define CONFIG_ENV_VARS_UBOOT_CONFIG
/* general purpose I/O */ +#ifndef CONFIG_DM_GPIO #define CONFIG_AT91_GPIO +#endif
/*

Update the configuration files to support the device tree and driver model, so do SPL. The device clock and pins configuration are handled by the clock and the pinctrl drivers respectively.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com Reviewed-by: Andreas Bießmann andreas@biessmann.org ---
Changes in v4: None Changes in v3: None 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 | 31 ++++++++++++++++- configs/sama5d4_xplained_nandflash_defconfig | 30 ++++++++++++++++- configs/sama5d4_xplained_spiflash_defconfig | 31 ++++++++++++++++- include/configs/sama5d4_xplained.h | 45 +++---------------------- 5 files changed, 95 insertions(+), 44 deletions(-)
diff --git a/board/atmel/sama5d4_xplained/sama5d4_xplained.c b/board/atmel/sama5d4_xplained/sama5d4_xplained.c index 47f0bae8c1..6684276e05 100644 --- a/board/atmel/sama5d4_xplained/sama5d4_xplained.c +++ b/board/atmel/sama5d4_xplained/sama5d4_xplained.c @@ -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) { diff --git a/configs/sama5d4_xplained_mmc_defconfig b/configs/sama5d4_xplained_mmc_defconfig index 3e5849510e..72c239a0f8 100644 --- a/configs/sama5d4_xplained_mmc_defconfig +++ b/configs/sama5d4_xplained_mmc_defconfig @@ -8,11 +8,15 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_SPL_FAT_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_FIT=y +CONFIG_SPL_DRIVERS_MISC_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained" CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC" CONFIG_BOOTDELAY=3 # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y +CONFIG_SPL_SEPARATE_BSS=y CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y # CONFIG_CMD_IMI is not set @@ -26,10 +30,35 @@ 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_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas" +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_DM_ETH=y +CONFIG_MACB=y +CONFIG_PINCTRL=y +CONFIG_SPL_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 diff --git a/configs/sama5d4_xplained_nandflash_defconfig b/configs/sama5d4_xplained_nandflash_defconfig index 0c47883ddc..0f6c2f4964 100644 --- a/configs/sama5d4_xplained_nandflash_defconfig +++ b/configs/sama5d4_xplained_nandflash_defconfig @@ -6,7 +6,10 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_NAND_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_FIT=y +CONFIG_SPL_DRIVERS_MISC_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained" CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH" CONFIG_BOOTDELAY=3 # CONFIG_DISPLAY_BOARDINFO is not set @@ -24,10 +27,35 @@ 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_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas" +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_DM_ETH=y +CONFIG_MACB=y +CONFIG_PINCTRL=y +CONFIG_SPL_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 diff --git a/configs/sama5d4_xplained_spiflash_defconfig b/configs/sama5d4_xplained_spiflash_defconfig index e5d2f54458..96816d4472 100644 --- a/configs/sama5d4_xplained_spiflash_defconfig +++ b/configs/sama5d4_xplained_spiflash_defconfig @@ -4,9 +4,12 @@ CONFIG_TARGET_SAMA5D4_XPLAINED=y CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL_DRIVERS_MISC_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 +28,36 @@ 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_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas" +CONFIG_DM=y +CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=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_DM_ETH=y +CONFIG_MACB=y +CONFIG_PINCTRL=y +CONFIG_SPL_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 diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h index 55f10ad1f0..aced293fa8 100644 --- a/include/configs/sama5d4_xplained.h +++ b/include/configs/sama5d4_xplained.h @@ -12,32 +12,21 @@
#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 #define CONFIG_SYS_SDRAM_SIZE 0x20000000
#ifdef CONFIG_SPL_BUILD -#define CONFIG_SYS_INIT_SP_ADDR 0x210000 +#define CONFIG_SYS_INIT_SP_ADDR 0x218000 #else #define CONFIG_SYS_INIT_SP_ADDR \ - (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE) + (CONFIG_SYS_SDRAM_BASE + 16 * 1024 - GENERATED_GBL_DATA_SIZE) #endif
#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
@@ -58,32 +47,6 @@ #define CONFIG_ATMEL_NAND_HW_PMECC #endif
-/* MMC */ - -#ifdef CONFIG_CMD_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 */ -#define CONFIG_USB_ETHER -#define CONFIG_USB_ETH_RNDIS -#define CONFIG_USBNET_MANUFACTURER "Atmel SAMA5D4EK" - -/* Ethernet Hardware */ -#define CONFIG_MACB -#define CONFIG_RMII -#define CONFIG_NET_RETRY_COUNT 20 -#define CONFIG_MACB_SEARCH_PHY - /* LCD */ #ifdef CONFIG_LCD #define LCD_BPP LCD_COLOR16 @@ -107,7 +70,7 @@ /* SPL */ #define CONFIG_SPL_FRAMEWORK #define CONFIG_SPL_TEXT_BASE 0x200000 -#define CONFIG_SPL_MAX_SIZE 0x10000 +#define CONFIG_SPL_MAX_SIZE 0x18000 #define CONFIG_SPL_BSS_START_ADDR 0x20000000 #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 #define CONFIG_SYS_SPL_MALLOC_START 0x20080000 @@ -137,7 +100,7 @@
#elif CONFIG_SYS_USE_SERIALFLASH #define CONFIG_SPL_SPI_LOAD -#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000 +#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x10000
#endif #endif

Due to the introduction of the pinctrl and clk driver, and using device tree files, remove the unneeded hardcoded pin configuration and clock enabling code from the board file.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com Reviewed-by: Andreas Bießmann andreas@biessmann.org ---
Changes in v4: None Changes in v3: None Changes in v2: - Restore the wrong removal of USB related code. - Update the commit log.
board/atmel/sama5d4_xplained/sama5d4_xplained.c | 134 +----------------------- 1 file changed, 1 insertion(+), 133 deletions(-)
diff --git a/board/atmel/sama5d4_xplained/sama5d4_xplained.c b/board/atmel/sama5d4_xplained/sama5d4_xplained.c index 6684276e05..30d4fb73bf 100644 --- a/board/atmel/sama5d4_xplained/sama5d4_xplained.c +++ b/board/atmel/sama5d4_xplained/sama5d4_xplained.c @@ -10,54 +10,17 @@ #include <asm/arch/at91_common.h> #include <asm/arch/at91_rstc.h> #include <asm/arch/atmel_mpddrc.h> -#include <asm/arch/atmel_usba_udc.h> #include <asm/arch/gpio.h> #include <asm/arch/clk.h> #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,61 +165,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) -{ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 0, 0); /* ETXCK_EREFCK */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 6, 0); /* ERXDV */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 8, 0); /* ERX0 */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 9, 0); /* ERX1 */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 7, 0); /* ERXER */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 2, 0); /* ETXEN */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 12, 0); /* ETX0 */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 13, 0); /* ETX1 */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 17, 0); /* EMDIO */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 16, 0); /* EMDC */ - - /* Enable clock */ - at91_periph_clk_enable(ATMEL_ID_GMAC0); -} -#endif - static void sama5d4_xplained_serial3_hw_init(void) { at91_pio3_set_b_periph(AT91_PIO_PORTE, 17, 1); /* TXD3 */ @@ -268,12 +176,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,27 +186,15 @@ 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 #ifdef CONFIG_LCD sama5d4_xplained_lcd_hw_init(); #endif #ifdef CONFIG_CMD_USB sama5d4_xplained_usb_hw_init(); #endif -#ifdef CONFIG_USB_GADGET_ATMEL_USBA - at91_udp_hw_init(); -#endif
return 0; } @@ -316,34 +206,12 @@ int dram_init(void) return 0; }
-int board_eth_init(bd_t *bis) -{ - int rc = 0; - -#ifdef CONFIG_MACB - rc = macb_eth_initialize(0, (void *)ATMEL_BASE_GMAC0, 0x00); -#endif - -#ifdef CONFIG_USB_GADGET_ATMEL_USBA - usba_udc_probe(&pdata); -#ifdef CONFIG_USB_ETH_RNDIS - usb_eth_initialize(bis); -#endif -#endif - - return rc; -} - /* SPL */ #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 }

Enable the 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 Reviewed-by: Andreas Bießmann andreas@biessmann.org ---
Changes in v4: None Changes in v3: None Changes in v2: None
board/atmel/sama5d4_xplained/sama5d4_xplained.c | 13 ++++++++++++- configs/sama5d4_xplained_mmc_defconfig | 6 ++++++ configs/sama5d4_xplained_nandflash_defconfig | 6 ++++++ configs/sama5d4_xplained_spiflash_defconfig | 6 ++++++ 4 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/board/atmel/sama5d4_xplained/sama5d4_xplained.c b/board/atmel/sama5d4_xplained/sama5d4_xplained.c index 30d4fb73bf..94ecab28b9 100644 --- a/board/atmel/sama5d4_xplained/sama5d4_xplained.c +++ b/board/atmel/sama5d4_xplained/sama5d4_xplained.c @@ -15,6 +15,7 @@ #include <asm/arch/sama5d3_smc.h> #include <asm/arch/sama5d4.h> #include <atmel_hlcdc.h> +#include <debug_uart.h> #include <lcd.h> #include <nand.h> #include <version.h> @@ -165,6 +166,7 @@ void lcd_show_board_info(void)
#endif /* CONFIG_LCD */
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT static void sama5d4_xplained_serial3_hw_init(void) { at91_pio3_set_b_periph(AT91_PIO_PORTE, 17, 1); /* TXD3 */ @@ -174,12 +176,21 @@ static void sama5d4_xplained_serial3_hw_init(void) at91_periph_clk_enable(ATMEL_ID_USART3); }
-int board_early_init_f(void) +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(); +#endif return 0; } +#endif
int board_init(void) { diff --git a/configs/sama5d4_xplained_mmc_defconfig b/configs/sama5d4_xplained_mmc_defconfig index 72c239a0f8..2b95a16fc9 100644 --- a/configs/sama5d4_xplained_mmc_defconfig +++ b/configs/sama5d4_xplained_mmc_defconfig @@ -53,6 +53,12 @@ CONFIG_PINCTRL=y CONFIG_SPL_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=88000000 +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/sama5d4_xplained_nandflash_defconfig b/configs/sama5d4_xplained_nandflash_defconfig index 0f6c2f4964..b0466c2973 100644 --- a/configs/sama5d4_xplained_nandflash_defconfig +++ b/configs/sama5d4_xplained_nandflash_defconfig @@ -50,6 +50,12 @@ CONFIG_PINCTRL=y CONFIG_SPL_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=88000000 +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/sama5d4_xplained_spiflash_defconfig b/configs/sama5d4_xplained_spiflash_defconfig index 96816d4472..57dec69b38 100644 --- a/configs/sama5d4_xplained_spiflash_defconfig +++ b/configs/sama5d4_xplained_spiflash_defconfig @@ -52,6 +52,12 @@ CONFIG_PINCTRL=y CONFIG_SPL_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=88000000 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_DM_SPI=y CONFIG_ATMEL_SPI=y

Update the configuration files to support the device tree and driver model, so do SPL. The device clock and pins configuration are handled by the clock and the pinctrl drivers respectively.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com Reviewed-by: Andreas Bießmann andreas@biessmann.org ---
Changes in v4: None Changes in v3: None 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 | 31 ++++++++++++++++++++++++ configs/sama5d4ek_nandflash_defconfig | 32 ++++++++++++++++++++++++- configs/sama5d4ek_spiflash_defconfig | 32 +++++++++++++++++++++++-- include/configs/sama5d4ek.h | 45 ++++------------------------------- 5 files changed, 98 insertions(+), 44 deletions(-)
diff --git a/board/atmel/sama5d4ek/sama5d4ek.c b/board/atmel/sama5d4ek/sama5d4ek.c index d1b5ff5797..a0e4bb791e 100644 --- a/board/atmel/sama5d4ek/sama5d4ek.c +++ b/board/atmel/sama5d4ek/sama5d4ek.c @@ -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) { diff --git a/configs/sama5d4ek_mmc_defconfig b/configs/sama5d4ek_mmc_defconfig index 7bf32e3fe7..cf376d00d1 100644 --- a/configs/sama5d4ek_mmc_defconfig +++ b/configs/sama5d4ek_mmc_defconfig @@ -8,6 +8,9 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_SPL_FAT_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SPL_DRIVERS_MISC_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4ek" CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC" CONFIG_BOOTDELAY=3 @@ -15,6 +18,7 @@ CONFIG_BOOTDELAY=3 CONFIG_SYS_CONSOLE_IS_IN_ENV=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y +CONFIG_SPL_SEPARATE_BSS=y CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y # CONFIG_CMD_IMI is not set @@ -28,9 +32,36 @@ 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_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas" +CONFIG_DM=y +CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=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_DM_ETH=y +CONFIG_MACB=y +CONFIG_PINCTRL=y +CONFIG_SPL_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 diff --git a/configs/sama5d4ek_nandflash_defconfig b/configs/sama5d4ek_nandflash_defconfig index 609260613b..3e4c0a32b2 100644 --- a/configs/sama5d4ek_nandflash_defconfig +++ b/configs/sama5d4ek_nandflash_defconfig @@ -6,9 +6,13 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_NAND_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SPL_DRIVERS_MISC_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4ek" CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH" CONFIG_BOOTDELAY=3 +CONFIG_SYS_CONSOLE_IS_IN_ENV=y # CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y # CONFIG_DISPLAY_BOARDINFO is not set @@ -26,11 +30,37 @@ 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_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas" +CONFIG_DM=y +CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=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_DM_ETH=y +CONFIG_MACB=y +CONFIG_PINCTRL=y +CONFIG_SPL_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/sama5d4ek_spiflash_defconfig b/configs/sama5d4ek_spiflash_defconfig index dff8995c4e..ca3aae37fc 100644 --- a/configs/sama5d4ek_spiflash_defconfig +++ b/configs/sama5d4ek_spiflash_defconfig @@ -4,13 +4,15 @@ CONFIG_TARGET_SAMA5D4EK=y CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL_DRIVERS_MISC_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 -# CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y @@ -27,11 +29,37 @@ 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_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas" +CONFIG_DM=y +CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=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_DM_ETH=y +CONFIG_MACB=y +CONFIG_PINCTRL=y +CONFIG_SPL_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/sama5d4ek.h b/include/configs/sama5d4ek.h index 680d5918d7..a5fd37f46b 100644 --- a/include/configs/sama5d4ek.h +++ b/include/configs/sama5d4ek.h @@ -12,32 +12,21 @@
#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 #define CONFIG_SYS_SDRAM_SIZE 0x20000000
#ifdef CONFIG_SPL_BUILD -#define CONFIG_SYS_INIT_SP_ADDR 0x210000 +#define CONFIG_SYS_INIT_SP_ADDR 0x218000 #else #define CONFIG_SYS_INIT_SP_ADDR \ - (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE) + (CONFIG_SYS_SDRAM_BASE + 16 * 1024 - GENERATED_GBL_DATA_SIZE) #endif
#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
@@ -58,32 +47,6 @@ #define CONFIG_ATMEL_NAND_HW_PMECC #endif
-/* MMC */ - -#ifdef CONFIG_CMD_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 */ -#define CONFIG_USB_ETHER -#define CONFIG_USB_ETH_RNDIS -#define CONFIG_USBNET_MANUFACTURER "Atmel SAMA5D4EK" - -/* Ethernet Hardware */ -#define CONFIG_MACB -#define CONFIG_RMII -#define CONFIG_NET_RETRY_COUNT 20 -#define CONFIG_MACB_SEARCH_PHY - /* LCD */ #define LCD_BPP LCD_COLOR16 #define LCD_OUTPUT_BPP 18 @@ -105,7 +68,7 @@ /* SPL */ #define CONFIG_SPL_FRAMEWORK #define CONFIG_SPL_TEXT_BASE 0x200000 -#define CONFIG_SPL_MAX_SIZE 0x10000 +#define CONFIG_SPL_MAX_SIZE 0x18000 #define CONFIG_SPL_BSS_START_ADDR 0x20000000 #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 #define CONFIG_SYS_SPL_MALLOC_START 0x20080000 @@ -135,7 +98,7 @@
#elif CONFIG_SYS_USE_SERIALFLASH #define CONFIG_SPL_SPI_LOAD -#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000 +#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x10000
#endif #endif

Due to the introduction of the pinctrl and clk driver, and using device tree files, remove the unneeded hardcoded pin configuration and clock enabling code from the board file.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com Reviewed-by: Andreas Bießmann andreas@biessmann.org ---
Changes in v4: None Changes in v3: None Changes in v2: - Restore the wrong removal USB related code. - Update the commit log.
board/atmel/sama5d4ek/sama5d4ek.c | 134 +------------------------------------- 1 file changed, 1 insertion(+), 133 deletions(-)
diff --git a/board/atmel/sama5d4ek/sama5d4ek.c b/board/atmel/sama5d4ek/sama5d4ek.c index a0e4bb791e..f2d0a472e1 100644 --- a/board/atmel/sama5d4ek/sama5d4ek.c +++ b/board/atmel/sama5d4ek/sama5d4ek.c @@ -10,54 +10,17 @@ #include <asm/arch/at91_common.h> #include <asm/arch/at91_rstc.h> #include <asm/arch/atmel_mpddrc.h> -#include <asm/arch/atmel_usba_udc.h> #include <asm/arch/gpio.h> #include <asm/arch/clk.h> #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,61 +161,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) -{ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 0, 0); /* ETXCK_EREFCK */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 6, 0); /* ERXDV */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 8, 0); /* ERX0 */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 9, 0); /* ERX1 */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 7, 0); /* ERXER */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 2, 0); /* ETXEN */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 12, 0); /* ETX0 */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 13, 0); /* ETX1 */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 17, 0); /* EMDIO */ - at91_pio3_set_a_periph(AT91_PIO_PORTB, 16, 0); /* EMDC */ - - /* Enable clock */ - at91_periph_clk_enable(ATMEL_ID_GMAC0); -} -#endif - static void sama5d4ek_serial3_hw_init(void) { at91_pio3_set_b_periph(AT91_PIO_PORTE, 17, 1); /* TXD3 */ @@ -264,12 +172,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,27 +182,15 @@ 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 #ifdef CONFIG_LCD sama5d4ek_lcd_hw_init(); #endif #ifdef CONFIG_CMD_USB sama5d4ek_usb_hw_init(); #endif -#ifdef CONFIG_USB_GADGET_ATMEL_USBA - at91_udp_hw_init(); -#endif
return 0; } @@ -312,34 +202,12 @@ int dram_init(void) return 0; }
-int board_eth_init(bd_t *bis) -{ - int rc = 0; - -#ifdef CONFIG_MACB - rc = macb_eth_initialize(0, (void *)ATMEL_BASE_GMAC0, 0x00); -#endif - -#ifdef CONFIG_USB_GADGET_ATMEL_USBA - usba_udc_probe(&pdata); -#ifdef CONFIG_USB_ETH_RNDIS - usb_eth_initialize(bis); -#endif -#endif - - return rc; -} - /* SPL */ #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 }

Enable the 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 Reviewed-by: Andreas Bießmann andreas@biessmann.org ---
Changes in v4: - Convert the macb to support DM and clean up macb init code. - Remain the SPI speed macros. - Update the config options for SPL. - Update the commit log. - Remove the unneeded dbgu init during board_early_init_f stage. - Use CONFIG_DEBUG_UART_CLOCK as the input clock for the early debug uart. - Drop [PATCH] configs: sama5d4: move CONFIG_SYS_NO_FLASH to *defconfig - Rebase on v2017.03.
Changes in v3: - add the Reviewed-by tags. - rebase on the patch: [PATCH v2] ARM: dts: at91: add device tree files for at91sam9x5ek http://lists.denx.de/pipermail/u-boot/2017-February/280504.html
Changes in v2: None
board/atmel/sama5d4ek/sama5d4ek.c | 13 ++++++++++++- configs/sama5d4ek_mmc_defconfig | 6 ++++++ configs/sama5d4ek_nandflash_defconfig | 6 ++++++ configs/sama5d4ek_spiflash_defconfig | 6 ++++++ 4 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/board/atmel/sama5d4ek/sama5d4ek.c b/board/atmel/sama5d4ek/sama5d4ek.c index f2d0a472e1..ffb4a50a72 100644 --- a/board/atmel/sama5d4ek/sama5d4ek.c +++ b/board/atmel/sama5d4ek/sama5d4ek.c @@ -15,6 +15,7 @@ #include <asm/arch/sama5d3_smc.h> #include <asm/arch/sama5d4.h> #include <atmel_hlcdc.h> +#include <debug_uart.h> #include <lcd.h> #include <nand.h> #include <version.h> @@ -161,6 +162,7 @@ void lcd_show_board_info(void)
#endif /* CONFIG_LCD */
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT static void sama5d4ek_serial3_hw_init(void) { at91_pio3_set_b_periph(AT91_PIO_PORTE, 17, 1); /* TXD3 */ @@ -170,12 +172,21 @@ static void sama5d4ek_serial3_hw_init(void) at91_periph_clk_enable(ATMEL_ID_USART3); }
-int board_early_init_f(void) +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(); +#endif return 0; } +#endif
int board_init(void) { diff --git a/configs/sama5d4ek_mmc_defconfig b/configs/sama5d4ek_mmc_defconfig index cf376d00d1..8601d5622b 100644 --- a/configs/sama5d4ek_mmc_defconfig +++ b/configs/sama5d4ek_mmc_defconfig @@ -56,6 +56,12 @@ CONFIG_PINCTRL=y CONFIG_SPL_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=88000000 +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/sama5d4ek_nandflash_defconfig b/configs/sama5d4ek_nandflash_defconfig index 3e4c0a32b2..a9bcabf182 100644 --- a/configs/sama5d4ek_nandflash_defconfig +++ b/configs/sama5d4ek_nandflash_defconfig @@ -54,6 +54,12 @@ CONFIG_PINCTRL=y CONFIG_SPL_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=88000000 +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/sama5d4ek_spiflash_defconfig b/configs/sama5d4ek_spiflash_defconfig index ca3aae37fc..b56fd631f5 100644 --- a/configs/sama5d4ek_spiflash_defconfig +++ b/configs/sama5d4ek_spiflash_defconfig @@ -53,6 +53,12 @@ CONFIG_PINCTRL=y CONFIG_SPL_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=88000000 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_DM_SPI=y CONFIG_ATMEL_SPI=y

Hi Andreas,
Could you help find a time to take these patch series?
They are here for a long time.
Thank you!
Best Regards, Wenyou Yang
On 2017/3/23 14:10, Wenyou Yang wrote:
The purpose of patch set is to convert the board to support device tree and driver model, and enable the early debug UART as well. It is based on the patch set: [PATCH v8 0/2] pinctrl: at91: Add pinctrl driver https://lists.denx.de/pipermail/u-boot/2017-March/284577.html
Changes in v4:
- Convert the macb to support DM and clean up macb init code.
- Remain the SPI speed macros.
- Update the config options for SPL.
- Update the commit log.
- Remove the unneeded dbgu init during board_early_init_f stage.
- Use CONFIG_DEBUG_UART_CLOCK as the input clock for the early debug uart.
- Drop [PATCH] configs: sama5d4: move CONFIG_SYS_NO_FLASH to *defconfig
- Rebase on v2017.03.
Changes in v3:
- add the Reviewed-by tags.
- rebase on the patch: [PATCH v2] ARM: dts: at91: add device tree files for at91sam9x5ek http://lists.denx.de/pipermail/u-boot/2017-February/280504.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 (7): configs: at91-sama5_common: fix for CONFIG_AT91_GPIO board: sama5d4_xplained: update to support DM/DT board: sama5d4_xplained: clean up code board: sama5d4_xplained: enable early debug UART board: sama5d4ek: update to support DM/DT board: sama5d4ek: clean up code board: sama5d4ek: enable early debug UART
board/atmel/sama5d4_xplained/sama5d4_xplained.c | 145 +++--------------------- board/atmel/sama5d4ek/sama5d4ek.c | 145 +++--------------------- configs/sama5d4_xplained_mmc_defconfig | 37 +++++- configs/sama5d4_xplained_nandflash_defconfig | 36 +++++- configs/sama5d4_xplained_spiflash_defconfig | 37 +++++- configs/sama5d4ek_mmc_defconfig | 37 ++++++ configs/sama5d4ek_nandflash_defconfig | 38 ++++++- configs/sama5d4ek_spiflash_defconfig | 38 ++++++- include/configs/at91-sama5_common.h | 2 + include/configs/sama5d4_xplained.h | 45 +------- include/configs/sama5d4ek.h | 45 +------- 11 files changed, 253 insertions(+), 352 deletions(-)

+Tom
Hi,
On 7 April 2017 at 01:28, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Andreas,
Could you help find a time to take these patch series?
They are here for a long time.
Tom might be able to take it, or if not I could bring it in via DM I suppose, since it is a conversion.
Regards, Simon

Hi Simon,
On 2017/4/10 3:28, Simon Glass wrote:
+Tom
Hi,
On 7 April 2017 at 01:28, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Andreas,
Could you help find a time to take these patch series?
They are here for a long time.
Tom might be able to take it, or if not I could bring it in via DM I suppose, since it is a conversion.
I truly appreciate you if you take these patches.
Regards, Simon
Best Regards, Wenyou Yang

Hi,
On 10 April 2017 at 00:57, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Simon,
On 2017/4/10 3:28, Simon Glass wrote:
+Tom
Hi,
On 7 April 2017 at 01:28, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Andreas,
Could you help find a time to take these patch series?
They are here for a long time.
Tom might be able to take it, or if not I could bring it in via DM I suppose, since it is a conversion.
I truly appreciate you if you take these patches.
OK I've assigned these to myself in patchwork and will pick them up at some point.
Andreas, please feel free to grab these yourself if you like.
Regards, Simon

Hi Simon,
On 2017/4/11 21:56, Simon Glass wrote:
Hi,
On 10 April 2017 at 00:57, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Simon,
On 2017/4/10 3:28, Simon Glass wrote:
+Tom
Hi,
On 7 April 2017 at 01:28, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Andreas,
Could you help find a time to take these patch series?
They are here for a long time.
Tom might be able to take it, or if not I could bring it in via DM I suppose, since it is a conversion.
I truly appreciate you if you take these patches.
OK I've assigned these to myself in patchwork and will pick them up at some point.
Thank you very much. Any question, please let me know.
Andreas, please feel free to grab these yourself if you like.
Regards, Simon
Best Regards, Wenyou Yang

Hi Wenyou,
On 11 April 2017 at 23:00, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Simon,
On 2017/4/11 21:56, Simon Glass wrote:
Hi,
On 10 April 2017 at 00:57, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Simon,
On 2017/4/10 3:28, Simon Glass wrote:
+Tom
Hi,
On 7 April 2017 at 01:28, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Andreas,
Could you help find a time to take these patch series?
They are here for a long time.
Tom might be able to take it, or if not I could bring it in via DM I suppose, since it is a conversion.
I truly appreciate you if you take these patches.
OK I've assigned these to myself in patchwork and will pick them up at some point.
Thank you very much. Any question, please let me know.
Andreas, please feel free to grab these yourself if you like.
I picked these up and pushed to u-boot-dm/testing but got various merge conflicts and the build error below. Can you please take a look and resend the series?
04: board: sama5d4_xplained: clean up code - at91_set_pio_output(AT91_PIO_PORTC, 3, 0); - at91_set_a_periph(AT91_PIO_PORTC, 0, 0); /* SPI0_MISO */ -board/atmel/sama5d4_xplained/built-in.o: In function `sama5d4_xplained_macb0_hw_init': -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:244: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:245: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:246: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:247: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:248: undefined reference to `at91_set_a_periph' -board/atmel/sama5d4_xplained/built-in.o:build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:249: more undefined references to `at91_set_a_periph' follow -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:262: undefined reference to `at91_set_b_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:263: undefined reference to `at91_set_b_periph' -board/atmel/sama5d4_xplained/built-in.o: In function `sama5d4_xplained_spi0_hw_init': -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:54: undefined reference to `at91_set_pio_output' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:87: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:88: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:89: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:90: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:91: undefined reference to `at91_set_a_periph' -board/atmel/sama5d4_xplained/built-in.o:build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:92: more undefined references to `at91_set_a_periph' follow -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:107: undefined reference to `at91_set_pio_output' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:108: undefined reference to `at91_set_pio_output' + at91_set_a_periph(AT91_PIO_PORTC, 5, 0); /* D0 */ + at91_set_pio_output(AT91_PIO_PORTE, 11, 1); +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:170: undefined reference to `at91_set_b_periph' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:171: undefined reference to `at91_set_b_periph' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:53: undefined reference to `at91_set_a_periph' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:54: undefined reference to `at91_set_a_periph' +board/atmel/sama5d4_xplained/built-in.o:build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:55: more undefined references to `at91_set_a_periph' follow +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:70: undefined reference to `at91_set_pio_output' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:71: undefined reference to `at91_set_pio_output' w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c: In function 'spi_cs_activate': w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c:40:2: warning: implicit declaration of function 'at91_set_pio_output' [-Wimplicit-function-declaration] w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c: In function 'sama5d4_xplained_spi0_hw_init': w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c:262:2: warning: implicit declaration of function 'at91_set_b_periph' [-Wimplicit-function-declaration] w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c: In function 'sama5d4_xplained_nand_hw_init': w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c: In function 'sama5d4_xplained_usb_hw_init': w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c:70:2: warning: implicit declaration of function 'at91_set_pio_output' [-Wimplicit-function-declaration] w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c:170:2: warning: implicit declaration of function 'at91_set_b_periph' [-Wimplicit-function-declaration] 05: board: sama5d4_xplained: enable early debug UART -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:170: undefined reference to `at91_set_b_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:171: undefined reference to `at91_set_b_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:50: undefined reference to `at91_set_a_periph' -board/atmel/sama5d4_xplained/built-in.o:build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:55: more undefined references to `at91_set_a_periph' follow -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:70: undefined reference to `at91_set_pio_output' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:172: undefined reference to `at91_set_b_periph' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:173: undefined reference to `at91_set_b_periph' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:55: undefined reference to `at91_set_a_periph' +board/atmel/sama5d4_xplained/built-in.o:build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:56: more undefined references to `at91_set_a_periph' follow +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:72: undefined reference to `at91_set_pio_output' w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c:50:2: warning: implicit declaration of function 'at91_set_a_periph' [-Wimplicit-function-declaration] w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c:70:2: warning: implicit declaration of function 'at91_set_pio_output' [-Wimplicit-function-declaration] w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c:170:2: warning: implicit declaration of function 'at91_set_b_periph' [-Wimplicit-function-declaration] w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c:51:2: warning: implicit declaration of function 'at91_set_a_periph' [-Wimplicit-function-declaration] w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c:71:2: warning: implicit declaration of function 'at91_set_pio_output' [-Wimplicit-function-declaration] w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c:172:2: warning: implicit declaration of function 'at91_set_b_periph' [-Wimplicit-function-declaration]
Regards, Simon

Hi Simon,
Sorry for the inconvenience caused.
This patch set is based on the following patch sets. 1 ./ [PATCH v3 0/2] mtd: nand: atmel: use another functions to set gpio value https://lists.denx.de/pipermail/u-boot/2017-March/284597.html
2./ [U-Boot] [PATCH v8 0/2] pinctrl: at91: Add pinctrl driver https://lists.denx.de/pipermail/u-boot/2017-March/284577.html
3./ [PATCH v4 0/3] gpio: at91_gpio: add option and clock support https://lists.denx.de/pipermail/u-boot/2017-March/284580.html
4./ [PATCH v5 0/4] ARM: dts: at91: add dts files for the boards of SAMA5D3/4 https://lists.denx.de/pipermail/u-boot/2017-March/284598.html
5./ [PATCH v2 0/4] ARM: SPL: at91: update to support DM/DT https://lists.denx.de/pipermail/u-boot/2017-March/284764.html
I will send a new version to include these information.
Thank you so much.
On 2017/4/13 8:36, Simon Glass wrote:
Hi Wenyou,
On 11 April 2017 at 23:00, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Simon,
On 2017/4/11 21:56, Simon Glass wrote:
Hi,
On 10 April 2017 at 00:57, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Simon,
On 2017/4/10 3:28, Simon Glass wrote:
+Tom
Hi,
On 7 April 2017 at 01:28, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
Hi Andreas,
Could you help find a time to take these patch series?
They are here for a long time.
Tom might be able to take it, or if not I could bring it in via DM I suppose, since it is a conversion.
I truly appreciate you if you take these patches.
OK I've assigned these to myself in patchwork and will pick them up at some point.
Thank you very much. Any question, please let me know.
Andreas, please feel free to grab these yourself if you like.
I picked these up and pushed to u-boot-dm/testing but got various merge conflicts and the build error below. Can you please take a look and resend the series?
04: board: sama5d4_xplained: clean up code
- at91_set_pio_output(AT91_PIO_PORTC, 3, 0);
- at91_set_a_periph(AT91_PIO_PORTC, 0, 0); /* SPI0_MISO */
-board/atmel/sama5d4_xplained/built-in.o: In function `sama5d4_xplained_macb0_hw_init': -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:244: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:245: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:246: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:247: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:248: undefined reference to `at91_set_a_periph' -board/atmel/sama5d4_xplained/built-in.o:build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:249: more undefined references to `at91_set_a_periph' follow -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:262: undefined reference to `at91_set_b_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:263: undefined reference to `at91_set_b_periph' -board/atmel/sama5d4_xplained/built-in.o: In function `sama5d4_xplained_spi0_hw_init': -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:54: undefined reference to `at91_set_pio_output' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:87: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:88: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:89: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:90: undefined reference to `at91_set_a_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:91: undefined reference to `at91_set_a_periph' -board/atmel/sama5d4_xplained/built-in.o:build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:92: more undefined references to `at91_set_a_periph' follow -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:107: undefined reference to `at91_set_pio_output' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:108: undefined reference to `at91_set_pio_output'
- at91_set_a_periph(AT91_PIO_PORTC, 5, 0); /* D0 */
- at91_set_pio_output(AT91_PIO_PORTE, 11, 1);
+build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:170: undefined reference to `at91_set_b_periph' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:171: undefined reference to `at91_set_b_periph' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:53: undefined reference to `at91_set_a_periph' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:54: undefined reference to `at91_set_a_periph' +board/atmel/sama5d4_xplained/built-in.o:build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:55: more undefined references to `at91_set_a_periph' follow +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:70: undefined reference to `at91_set_pio_output' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:71: undefined reference to `at91_set_pio_output' w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c: In function 'spi_cs_activate': w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c:40:2: warning: implicit declaration of function 'at91_set_pio_output' [-Wimplicit-function-declaration] w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c: In function 'sama5d4_xplained_spi0_hw_init': w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c:262:2: warning: implicit declaration of function 'at91_set_b_periph' [-Wimplicit-function-declaration] w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c: In function 'sama5d4_xplained_nand_hw_init': w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c: In function 'sama5d4_xplained_usb_hw_init': w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c:70:2: warning: implicit declaration of function 'at91_set_pio_output' [-Wimplicit-function-declaration] w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c:170:2: warning: implicit declaration of function 'at91_set_b_periph' [-Wimplicit-function-declaration] 05: board: sama5d4_xplained: enable early debug UART -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:170: undefined reference to `at91_set_b_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:171: undefined reference to `at91_set_b_periph' -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:50: undefined reference to `at91_set_a_periph' -board/atmel/sama5d4_xplained/built-in.o:build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:55: more undefined references to `at91_set_a_periph' follow -build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:70: undefined reference to `at91_set_pio_output' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:172: undefined reference to `at91_set_b_periph' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:173: undefined reference to `at91_set_b_periph' +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:55: undefined reference to `at91_set_a_periph' +board/atmel/sama5d4_xplained/built-in.o:build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:56: more undefined references to `at91_set_a_periph' follow +build/../board/atmel/sama5d4_xplained/sama5d4_xplained.c:72: undefined reference to `at91_set_pio_output' w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c:50:2: warning: implicit declaration of function 'at91_set_a_periph' [-Wimplicit-function-declaration] w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c:70:2: warning: implicit declaration of function 'at91_set_pio_output' [-Wimplicit-function-declaration] w-../board/atmel/sama5d4_xplained/sama5d4_xplained.c:170:2: warning: implicit declaration of function 'at91_set_b_periph' [-Wimplicit-function-declaration] w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c:51:2: warning: implicit declaration of function 'at91_set_a_periph' [-Wimplicit-function-declaration] w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c:71:2: warning: implicit declaration of function 'at91_set_pio_output' [-Wimplicit-function-declaration] w+../board/atmel/sama5d4_xplained/sama5d4_xplained.c:172:2: warning: implicit declaration of function 'at91_set_b_periph' [-Wimplicit-function-declaration]
Regards, Simon
Best Regards, Wenyou Yang
participants (3)
-
Simon Glass
-
Wenyou Yang
-
Yang, Wenyou