* [U-Boot] [PATCH v2 0/4] board: sama5d2_xplained: Convert to use device tree and drivers with DM
@ 2016-09-13 2:49 Wenyou Yang
2016-09-13 2:49 ` [U-Boot] [PATCH v2 1/4] board: sama5d2_xplained: Move config options to defconfigs Wenyou Yang
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Wenyou Yang @ 2016-09-13 2:49 UTC (permalink / raw)
To: u-boot
Convert to use the drivers which support the driver model and use the
device tree. And add the support to enable an early debug UART for
debugging.
It is based on the following patches:
- [PATCH v2] i2c: at91_i2c: Fix the wrong include file
http://lists.denx.de/pipermail/u-boot/2016-September/266413.html
- [PATCH v2] clk: at91: Fix at91-pmc and at91-sckc's class ID
http://lists.denx.de/pipermail/u-boot/2016-September/266408.html
- [PATCH v2] mmc: mmc-uclass: Add mmc_init() in mmc preinit phrase
http://lists.denx.de/pipermail/u-boot/2016-September/266409.html
- [PATCH v2 0/2] serial: atmel_usart: Support to enable an early debug UART
http://lists.denx.de/pipermail/u-boot/2016-September/266410.html
- [PATCH v9] dm: at91: Add driver model support for the spi driver
http://lists.denx.de/pipermail/u-boot/2016-September/266407.html
- [PATCH] sf: fix sf probe
http://lists.denx.de/pipermail/u-boot/2016-August/264104.html
Changes in v2:
- Collect Reviewed-by tags.
Wenyou Yang (4):
board: sama5d2_xplained: Move config options to defconfigs
board: sama5d2_xplained: Clean up code
board: sama5d2_xplained: Set 'ethaddr' got from AT24MAC
board: sama5d2_xplained: Enable an early debug UART
board/atmel/sama5d2_xplained/sama5d2_xplained.c | 167 +++++++++---------------
configs/sama5d2_xplained_mmc_defconfig | 37 +++++-
configs/sama5d2_xplained_spiflash_defconfig | 38 +++++-
include/configs/sama5d2_xplained.h | 32 +----
4 files changed, 145 insertions(+), 129 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 11+ messages in thread* [U-Boot] [PATCH v2 1/4] board: sama5d2_xplained: Move config options to defconfigs 2016-09-13 2:49 [U-Boot] [PATCH v2 0/4] board: sama5d2_xplained: Convert to use device tree and drivers with DM Wenyou Yang @ 2016-09-13 2:49 ` Wenyou Yang 2016-10-16 20:11 ` [U-Boot] [U-Boot, v2, " Andreas Bießmann 2016-09-13 2:49 ` [U-Boot] [PATCH v2 2/4] board: sama5d2_xplained: Clean up code Wenyou Yang ` (2 subsequent siblings) 3 siblings, 1 reply; 11+ messages in thread From: Wenyou Yang @ 2016-09-13 2:49 UTC (permalink / raw) To: u-boot Move the config options from the include/configs/sama5d2_xplained.h to configs/sama5d2_xplained_*_defconfig. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> --- Changes in v2: None board/atmel/sama5d2_xplained/sama5d2_xplained.c | 2 ++ configs/sama5d2_xplained_mmc_defconfig | 31 +++++++++++++++++++++++- configs/sama5d2_xplained_spiflash_defconfig | 32 ++++++++++++++++++++++++- include/configs/sama5d2_xplained.h | 26 -------------------- 4 files changed, 63 insertions(+), 28 deletions(-) diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c index 93df7ba..413a000 100644 --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c @@ -25,10 +25,12 @@ DECLARE_GLOBAL_DATA_PTR; +#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/sama5d2_xplained_mmc_defconfig b/configs/sama5d2_xplained_mmc_defconfig index 9ca2a9c..ab1b58b 100644 --- a/configs/sama5d2_xplained_mmc_defconfig +++ b/configs/sama5d2_xplained_mmc_defconfig @@ -1,6 +1,9 @@ CONFIG_ARM=y CONFIG_ARCH_AT91=y CONFIG_TARGET_SAMA5D2_XPLAINED=y +CONFIG_DM_GPIO=y +CONFIG_DM_SERIAL=y +CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d2_xplained" CONFIG_SPL=y CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D2,SYS_USE_MMC" @@ -13,13 +16,39 @@ CONFIG_CMD_BOOTZ=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_MMC=y CONFIG_CMD_SF=y +CONFIG_CMD_I2C=y CONFIG_CMD_USB=y # CONFIG_CMD_FPGA is not set 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_BLK=y +CONFIG_CLK=y +CONFIG_SPL_CLK=y +CONFIG_CLK_AT91=y +CONFIG_AT91_UTMI=y +CONFIG_AT91_H32MX=y +CONFIG_AT91_GENERIC_CLK=y +CONFIG_ATMEL_PIO4=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_AT91=y +CONFIG_DM_MMC=y +CONFIG_DM_MMC_OPS=y +CONFIG_ATMEL_SDHCI=y +CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_ATMEL=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_AT91PIO4=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_GADGET=y CONFIG_USB_GADGET_ATMEL_USBA=y -CONFIG_OF_LIBFDT=y diff --git a/configs/sama5d2_xplained_spiflash_defconfig b/configs/sama5d2_xplained_spiflash_defconfig index 617d73a..ecba5ef 100644 --- a/configs/sama5d2_xplained_spiflash_defconfig +++ b/configs/sama5d2_xplained_spiflash_defconfig @@ -1,6 +1,9 @@ CONFIG_ARM=y CONFIG_ARCH_AT91=y CONFIG_TARGET_SAMA5D2_XPLAINED=y +CONFIG_DM_GPIO=y +CONFIG_DM_SERIAL=y +CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d2_xplained" CONFIG_SPL=y CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="SAMA5D2,SYS_USE_SERIALFLASH" @@ -13,13 +16,40 @@ CONFIG_CMD_BOOTZ=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_MMC=y CONFIG_CMD_SF=y +CONFIG_CMD_I2C=y CONFIG_CMD_USB=y # CONFIG_CMD_FPGA is not set 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_BLK=y +CONFIG_CLK=y +CONFIG_SPL_CLK=y +CONFIG_CLK_AT91=y +CONFIG_AT91_UTMI=y +CONFIG_AT91_H32MX=y +CONFIG_AT91_GENERIC_CLK=y +CONFIG_ATMEL_PIO4=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_AT91=y +CONFIG_DM_MMC=y +CONFIG_DM_MMC_OPS=y +CONFIG_ATMEL_SDHCI=y +CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_ATMEL=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_AT91PIO4=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/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h index f9a8f6f..77757a3 100644 --- a/include/configs/sama5d2_xplained.h +++ b/include/configs/sama5d2_xplained.h @@ -15,11 +15,6 @@ #include "at91-sama5_common.h" -/* serial console */ -#define CONFIG_ATMEL_USART -#define CONFIG_USART_BASE ATMEL_BASE_UART1 -#define CONFIG_USART_ID ATMEL_ID_UART1 - /* SDRAM */ #define CONFIG_NR_DRAM_BANKS 1 #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS @@ -34,14 +29,8 @@ #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */ -#undef CONFIG_AT91_GPIO -#define CONFIG_ATMEL_PIO4 - /* SerialFlash */ #ifdef CONFIG_CMD_SF -#define CONFIG_ATMEL_SPI -#define CONFIG_ATMEL_SPI0 -#define CONFIG_SPI_FLASH_ATMEL #define CONFIG_SF_DEFAULT_BUS 0 #define CONFIG_SF_DEFAULT_CS 0 #define CONFIG_SF_DEFAULT_SPEED 30000000 @@ -51,24 +40,9 @@ #undef CONFIG_CMD_NAND /* MMC */ - #ifdef CONFIG_CMD_MMC -#define CONFIG_MMC #define CONFIG_GENERIC_MMC #define CONFIG_SDHCI -#define CONFIG_ATMEL_SDHCI -#define CONFIG_ATMEL_SDHCI0 -#define CONFIG_ATMEL_SDHCI1 -#define CONFIG_SUPPORT_EMMC_BOOT -#endif - -/* USB */ - -#ifdef CONFIG_CMD_USB -#define CONFIG_USB_EHCI -#define CONFIG_USB_EHCI_ATMEL -#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3 -#define CONFIG_USB_STORAGE #endif /* USB device */ -- 2.7.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [U-Boot] [U-Boot, v2, 1/4] board: sama5d2_xplained: Move config options to defconfigs 2016-09-13 2:49 ` [U-Boot] [PATCH v2 1/4] board: sama5d2_xplained: Move config options to defconfigs Wenyou Yang @ 2016-10-16 20:11 ` Andreas Bießmann 0 siblings, 0 replies; 11+ messages in thread From: Andreas Bießmann @ 2016-10-16 20:11 UTC (permalink / raw) To: u-boot On Tue, Sep 13, 2016 at 10:49:02AM +0800, Wenyou Yang wrote: > Move the config options from the include/configs/sama5d2_xplained.h > to configs/sama5d2_xplained_*_defconfig. > > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Reviewed-by: Andreas Bie?mann <andreas@biessmann.org> > --- > > Changes in v2: None > > board/atmel/sama5d2_xplained/sama5d2_xplained.c | 2 ++ > configs/sama5d2_xplained_mmc_defconfig | 31 +++++++++++++++++++++++- > configs/sama5d2_xplained_spiflash_defconfig | 32 ++++++++++++++++++++++++- > include/configs/sama5d2_xplained.h | 26 -------------------- > 4 files changed, 63 insertions(+), 28 deletions(-) > > diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c > index 93df7ba..413a000 100644 > --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c > +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c > @@ -25,10 +25,12 @@ > > DECLARE_GLOBAL_DATA_PTR; > > +#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/sama5d2_xplained_mmc_defconfig b/configs/sama5d2_xplained_mmc_defconfig > index 9ca2a9c..ab1b58b 100644 > --- a/configs/sama5d2_xplained_mmc_defconfig > +++ b/configs/sama5d2_xplained_mmc_defconfig > @@ -1,6 +1,9 @@ > CONFIG_ARM=y > CONFIG_ARCH_AT91=y > CONFIG_TARGET_SAMA5D2_XPLAINED=y > +CONFIG_DM_GPIO=y > +CONFIG_DM_SERIAL=y > +CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d2_xplained" > CONFIG_SPL=y > CONFIG_FIT=y > CONFIG_SYS_EXTRA_OPTIONS="SAMA5D2,SYS_USE_MMC" > @@ -13,13 +16,39 @@ CONFIG_CMD_BOOTZ=y > # CONFIG_CMD_FLASH is not set > CONFIG_CMD_MMC=y > CONFIG_CMD_SF=y > +CONFIG_CMD_I2C=y > CONFIG_CMD_USB=y > # CONFIG_CMD_FPGA is not set > 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_BLK=y > +CONFIG_CLK=y > +CONFIG_SPL_CLK=y > +CONFIG_CLK_AT91=y > +CONFIG_AT91_UTMI=y > +CONFIG_AT91_H32MX=y > +CONFIG_AT91_GENERIC_CLK=y > +CONFIG_ATMEL_PIO4=y > +CONFIG_DM_I2C=y > +CONFIG_SYS_I2C_AT91=y > +CONFIG_DM_MMC=y > +CONFIG_DM_MMC_OPS=y > +CONFIG_ATMEL_SDHCI=y > +CONFIG_DM_SPI_FLASH=y > CONFIG_SPI_FLASH=y > +CONFIG_SPI_FLASH_ATMEL=y > +CONFIG_PINCTRL=y > +CONFIG_PINCTRL_AT91PIO4=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_GADGET=y > CONFIG_USB_GADGET_ATMEL_USBA=y > -CONFIG_OF_LIBFDT=y > diff --git a/configs/sama5d2_xplained_spiflash_defconfig b/configs/sama5d2_xplained_spiflash_defconfig > index 617d73a..ecba5ef 100644 > --- a/configs/sama5d2_xplained_spiflash_defconfig > +++ b/configs/sama5d2_xplained_spiflash_defconfig > @@ -1,6 +1,9 @@ > CONFIG_ARM=y > CONFIG_ARCH_AT91=y > CONFIG_TARGET_SAMA5D2_XPLAINED=y > +CONFIG_DM_GPIO=y > +CONFIG_DM_SERIAL=y > +CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d2_xplained" > CONFIG_SPL=y > CONFIG_FIT=y > CONFIG_SYS_EXTRA_OPTIONS="SAMA5D2,SYS_USE_SERIALFLASH" > @@ -13,13 +16,40 @@ CONFIG_CMD_BOOTZ=y > # CONFIG_CMD_FLASH is not set > CONFIG_CMD_MMC=y > CONFIG_CMD_SF=y > +CONFIG_CMD_I2C=y > CONFIG_CMD_USB=y > # CONFIG_CMD_FPGA is not set > 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_BLK=y > +CONFIG_CLK=y > +CONFIG_SPL_CLK=y > +CONFIG_CLK_AT91=y > +CONFIG_AT91_UTMI=y > +CONFIG_AT91_H32MX=y > +CONFIG_AT91_GENERIC_CLK=y > +CONFIG_ATMEL_PIO4=y > +CONFIG_DM_I2C=y > +CONFIG_SYS_I2C_AT91=y > +CONFIG_DM_MMC=y > +CONFIG_DM_MMC_OPS=y > +CONFIG_ATMEL_SDHCI=y > +CONFIG_DM_SPI_FLASH=y > CONFIG_SPI_FLASH=y > +CONFIG_SPI_FLASH_ATMEL=y > +CONFIG_PINCTRL=y > +CONFIG_PINCTRL_AT91PIO4=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/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h > index f9a8f6f..77757a3 100644 > --- a/include/configs/sama5d2_xplained.h > +++ b/include/configs/sama5d2_xplained.h > @@ -15,11 +15,6 @@ > > #include "at91-sama5_common.h" > > -/* serial console */ > -#define CONFIG_ATMEL_USART > -#define CONFIG_USART_BASE ATMEL_BASE_UART1 > -#define CONFIG_USART_ID ATMEL_ID_UART1 > - > /* SDRAM */ > #define CONFIG_NR_DRAM_BANKS 1 > #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS > @@ -34,14 +29,8 @@ > > #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */ > > -#undef CONFIG_AT91_GPIO > -#define CONFIG_ATMEL_PIO4 > - > /* SerialFlash */ > #ifdef CONFIG_CMD_SF > -#define CONFIG_ATMEL_SPI > -#define CONFIG_ATMEL_SPI0 > -#define CONFIG_SPI_FLASH_ATMEL > #define CONFIG_SF_DEFAULT_BUS 0 > #define CONFIG_SF_DEFAULT_CS 0 > #define CONFIG_SF_DEFAULT_SPEED 30000000 > @@ -51,24 +40,9 @@ > #undef CONFIG_CMD_NAND > > /* MMC */ > - > #ifdef CONFIG_CMD_MMC > -#define CONFIG_MMC > #define CONFIG_GENERIC_MMC > #define CONFIG_SDHCI > -#define CONFIG_ATMEL_SDHCI > -#define CONFIG_ATMEL_SDHCI0 > -#define CONFIG_ATMEL_SDHCI1 > -#define CONFIG_SUPPORT_EMMC_BOOT > -#endif > - > -/* USB */ > - > -#ifdef CONFIG_CMD_USB > -#define CONFIG_USB_EHCI > -#define CONFIG_USB_EHCI_ATMEL > -#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3 > -#define CONFIG_USB_STORAGE > #endif > > /* USB device */ ^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH v2 2/4] board: sama5d2_xplained: Clean up code 2016-09-13 2:49 [U-Boot] [PATCH v2 0/4] board: sama5d2_xplained: Convert to use device tree and drivers with DM Wenyou Yang 2016-09-13 2:49 ` [U-Boot] [PATCH v2 1/4] board: sama5d2_xplained: Move config options to defconfigs Wenyou Yang @ 2016-09-13 2:49 ` Wenyou Yang 2016-10-16 20:17 ` [U-Boot] [U-Boot, v2, " Andreas Bießmann 2016-09-13 2:49 ` [U-Boot] [PATCH v2 3/4] board: sama5d2_xplained: Set 'ethaddr' got from AT24MAC Wenyou Yang 2016-09-13 2:49 ` [U-Boot] [PATCH v2 4/4] board: sama5d2_xplained: Enable an early debug UART Wenyou Yang 3 siblings, 1 reply; 11+ messages in thread From: Wenyou Yang @ 2016-09-13 2:49 UTC (permalink / raw) To: u-boot Since the introduction of pinctrl and clk driver, and the dts file, remove unneeded the pin configurations and the clock enabling code. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Reviewed-by: Simon Glass <sjg@chromium.org> --- Changes in v2: None board/atmel/sama5d2_xplained/sama5d2_xplained.c | 104 ------------------------ 1 file changed, 104 deletions(-) diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c index 413a000..7ccadf2 100644 --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c @@ -25,34 +25,6 @@ DECLARE_GLOBAL_DATA_PTR; -#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) -{ - atmel_pio4_set_pio_output(AT91_PIO_PORTA, 17, 0); -} - -void spi_cs_deactivate(struct spi_slave *slave) -{ - atmel_pio4_set_pio_output(AT91_PIO_PORTA, 17, 1); -} - -static void board_spi0_hw_init(void) -{ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 14, 0); - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 15, 0); - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 16, 0); - - atmel_pio4_set_pio_output(AT91_PIO_PORTA, 17, 1); - - at91_periph_clk_enable(ATMEL_ID_SPI0); -} - static void board_usb_hw_init(void) { atmel_pio4_set_pio_output(AT91_PIO_PORTB, 10, 1); @@ -159,55 +131,6 @@ static void board_gmac_hw_init(void) at91_periph_clk_enable(ATMEL_ID_GMAC); } -static void board_sdhci0_hw_init(void) -{ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 0, 0); /* SDMMC0_CK */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 1, 0); /* SDMMC0_CMD */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 2, 0); /* SDMMC0_DAT0 */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 3, 0); /* SDMMC0_DAT1 */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 4, 0); /* SDMMC0_DAT2 */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 5, 0); /* SDMMC0_DAT3 */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 6, 0); /* SDMMC0_DAT4 */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 7, 0); /* SDMMC0_DAT5 */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 8, 0); /* SDMMC0_DAT6 */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 9, 0); /* SDMMC0_DAT7 */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 10, 0); /* SDMMC0_RSTN */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 11, 0); /* SDMMC0_VDDSEL */ - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 13, 0); /* SDMMC0_CD */ - - at91_periph_clk_enable(ATMEL_ID_SDMMC0); - at91_enable_periph_generated_clk(ATMEL_ID_SDMMC0, - GCK_CSS_UPLL_CLK, 1); -} - -static void board_sdhci1_hw_init(void) -{ - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 18, 0); /* SDMMC1_DAT0 */ - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 19, 0); /* SDMMC1_DAT1 */ - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 20, 0); /* SDMMC1_DAT2 */ - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 21, 0); /* SDMMC1_DAT3 */ - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 22, 0); /* SDMMC1_CK */ - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 27, 0); /* SDMMC1_RSTN */ - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 28, 0); /* SDMMC1_CMD */ - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 30, 0); /* SDMMC1_CD */ - - at91_periph_clk_enable(ATMEL_ID_SDMMC1); - at91_enable_periph_generated_clk(ATMEL_ID_SDMMC1, - GCK_CSS_UPLL_CLK, 1); -} - -int board_mmc_init(bd_t *bis) -{ -#ifdef CONFIG_ATMEL_SDHCI0 - atmel_sdhci_init((void *)ATMEL_BASE_SDMMC0, ATMEL_ID_SDMMC0); -#endif -#ifdef CONFIG_ATMEL_SDHCI1 - atmel_sdhci_init((void *)ATMEL_BASE_SDMMC1, ATMEL_ID_SDMMC1); -#endif - - return 0; -} - static void board_uart1_hw_init(void) { atmel_pio4_set_a_periph(AT91_PIO_PORTD, 2, 1); /* URXD1 */ @@ -218,11 +141,6 @@ static void board_uart1_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); - board_uart1_hw_init(); return 0; @@ -233,17 +151,6 @@ int board_init(void) /* address of boot parameters */ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; -#ifdef CONFIG_ATMEL_SPI - board_spi0_hw_init(); -#endif -#ifdef CONFIG_ATMEL_SDHCI -#ifdef CONFIG_ATMEL_SDHCI0 - board_sdhci0_hw_init(); -#endif -#ifdef CONFIG_ATMEL_SDHCI1 - board_sdhci1_hw_init(); -#endif -#endif #ifdef CONFIG_MACB board_gmac_hw_init(); #endif @@ -289,17 +196,6 @@ int board_eth_init(bd_t *bis) #ifdef CONFIG_SPL_BUILD void spl_board_init(void) { -#ifdef CONFIG_SYS_USE_SERIALFLASH - board_spi0_hw_init(); -#endif -#ifdef CONFIG_ATMEL_SDHCI -#ifdef CONFIG_ATMEL_SDHCI0 - board_sdhci0_hw_init(); -#endif -#ifdef CONFIG_ATMEL_SDHCI1 - board_sdhci1_hw_init(); -#endif -#endif } static void ddrc_conf(struct atmel_mpddrc_config *ddrc) -- 2.7.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [U-Boot] [U-Boot, v2, 2/4] board: sama5d2_xplained: Clean up code 2016-09-13 2:49 ` [U-Boot] [PATCH v2 2/4] board: sama5d2_xplained: Clean up code Wenyou Yang @ 2016-10-16 20:17 ` Andreas Bießmann 0 siblings, 0 replies; 11+ messages in thread From: Andreas Bießmann @ 2016-10-16 20:17 UTC (permalink / raw) To: u-boot On Tue, Sep 13, 2016 at 10:49:03AM +0800, Wenyou Yang wrote: > Since the introduction of pinctrl and clk driver, and the dts file, > remove unneeded the pin configurations and the clock enabling code. > > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> > Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andreas Bie?mann <andreas@biessmann.org> > --- > > Changes in v2: None > > board/atmel/sama5d2_xplained/sama5d2_xplained.c | 104 ------------------------ > 1 file changed, 104 deletions(-) > > diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c > index 413a000..7ccadf2 100644 > --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c > +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c > @@ -25,34 +25,6 @@ > > DECLARE_GLOBAL_DATA_PTR; > > -#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) > -{ > - atmel_pio4_set_pio_output(AT91_PIO_PORTA, 17, 0); > -} > - > -void spi_cs_deactivate(struct spi_slave *slave) > -{ > - atmel_pio4_set_pio_output(AT91_PIO_PORTA, 17, 1); > -} > - > -static void board_spi0_hw_init(void) > -{ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 14, 0); > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 15, 0); > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 16, 0); > - > - atmel_pio4_set_pio_output(AT91_PIO_PORTA, 17, 1); > - > - at91_periph_clk_enable(ATMEL_ID_SPI0); > -} > - > static void board_usb_hw_init(void) > { > atmel_pio4_set_pio_output(AT91_PIO_PORTB, 10, 1); > @@ -159,55 +131,6 @@ static void board_gmac_hw_init(void) > at91_periph_clk_enable(ATMEL_ID_GMAC); > } > > -static void board_sdhci0_hw_init(void) > -{ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 0, 0); /* SDMMC0_CK */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 1, 0); /* SDMMC0_CMD */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 2, 0); /* SDMMC0_DAT0 */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 3, 0); /* SDMMC0_DAT1 */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 4, 0); /* SDMMC0_DAT2 */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 5, 0); /* SDMMC0_DAT3 */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 6, 0); /* SDMMC0_DAT4 */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 7, 0); /* SDMMC0_DAT5 */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 8, 0); /* SDMMC0_DAT6 */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 9, 0); /* SDMMC0_DAT7 */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 10, 0); /* SDMMC0_RSTN */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 11, 0); /* SDMMC0_VDDSEL */ > - atmel_pio4_set_a_periph(AT91_PIO_PORTA, 13, 0); /* SDMMC0_CD */ > - > - at91_periph_clk_enable(ATMEL_ID_SDMMC0); > - at91_enable_periph_generated_clk(ATMEL_ID_SDMMC0, > - GCK_CSS_UPLL_CLK, 1); > -} > - > -static void board_sdhci1_hw_init(void) > -{ > - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 18, 0); /* SDMMC1_DAT0 */ > - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 19, 0); /* SDMMC1_DAT1 */ > - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 20, 0); /* SDMMC1_DAT2 */ > - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 21, 0); /* SDMMC1_DAT3 */ > - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 22, 0); /* SDMMC1_CK */ > - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 27, 0); /* SDMMC1_RSTN */ > - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 28, 0); /* SDMMC1_CMD */ > - atmel_pio4_set_e_periph(AT91_PIO_PORTA, 30, 0); /* SDMMC1_CD */ > - > - at91_periph_clk_enable(ATMEL_ID_SDMMC1); > - at91_enable_periph_generated_clk(ATMEL_ID_SDMMC1, > - GCK_CSS_UPLL_CLK, 1); > -} > - > -int board_mmc_init(bd_t *bis) > -{ > -#ifdef CONFIG_ATMEL_SDHCI0 > - atmel_sdhci_init((void *)ATMEL_BASE_SDMMC0, ATMEL_ID_SDMMC0); > -#endif > -#ifdef CONFIG_ATMEL_SDHCI1 > - atmel_sdhci_init((void *)ATMEL_BASE_SDMMC1, ATMEL_ID_SDMMC1); > -#endif > - > - return 0; > -} > - > static void board_uart1_hw_init(void) > { > atmel_pio4_set_a_periph(AT91_PIO_PORTD, 2, 1); /* URXD1 */ > @@ -218,11 +141,6 @@ static void board_uart1_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); > - > board_uart1_hw_init(); > > return 0; > @@ -233,17 +151,6 @@ int board_init(void) > /* address of boot parameters */ > gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; > > -#ifdef CONFIG_ATMEL_SPI > - board_spi0_hw_init(); > -#endif > -#ifdef CONFIG_ATMEL_SDHCI > -#ifdef CONFIG_ATMEL_SDHCI0 > - board_sdhci0_hw_init(); > -#endif > -#ifdef CONFIG_ATMEL_SDHCI1 > - board_sdhci1_hw_init(); > -#endif > -#endif > #ifdef CONFIG_MACB > board_gmac_hw_init(); > #endif > @@ -289,17 +196,6 @@ int board_eth_init(bd_t *bis) > #ifdef CONFIG_SPL_BUILD > void spl_board_init(void) > { > -#ifdef CONFIG_SYS_USE_SERIALFLASH > - board_spi0_hw_init(); > -#endif > -#ifdef CONFIG_ATMEL_SDHCI > -#ifdef CONFIG_ATMEL_SDHCI0 > - board_sdhci0_hw_init(); > -#endif > -#ifdef CONFIG_ATMEL_SDHCI1 > - board_sdhci1_hw_init(); > -#endif > -#endif > } > > static void ddrc_conf(struct atmel_mpddrc_config *ddrc) ^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH v2 3/4] board: sama5d2_xplained: Set 'ethaddr' got from AT24MAC 2016-09-13 2:49 [U-Boot] [PATCH v2 0/4] board: sama5d2_xplained: Convert to use device tree and drivers with DM Wenyou Yang 2016-09-13 2:49 ` [U-Boot] [PATCH v2 1/4] board: sama5d2_xplained: Move config options to defconfigs Wenyou Yang 2016-09-13 2:49 ` [U-Boot] [PATCH v2 2/4] board: sama5d2_xplained: Clean up code Wenyou Yang @ 2016-09-13 2:49 ` Wenyou Yang 2016-10-16 20:18 ` [U-Boot] [U-Boot, v2, " Andreas Bießmann 2016-10-16 21:42 ` Andreas Bießmann 2016-09-13 2:49 ` [U-Boot] [PATCH v2 4/4] board: sama5d2_xplained: Enable an early debug UART Wenyou Yang 3 siblings, 2 replies; 11+ messages in thread From: Wenyou Yang @ 2016-09-13 2:49 UTC (permalink / raw) To: u-boot If 'ethaddr' is not set, we will get the ethernet address from AT24MAC, and set it to 'ethaddr' variable. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Songjun Wu <songjun.wu@microchip.com> --- Changes in v2: None board/atmel/sama5d2_xplained/sama5d2_xplained.c | 51 +++++++++++++++++++++++++ include/configs/sama5d2_xplained.h | 6 +++ 2 files changed, 57 insertions(+) diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c index 7ccadf2..c94574b 100644 --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c @@ -7,6 +7,8 @@ #include <common.h> #include <atmel_hlcdc.h> +#include <dm.h> +#include <i2c.h> #include <lcd.h> #include <mmc.h> #include <net.h> @@ -192,6 +194,55 @@ int board_eth_init(bd_t *bis) return rc; } +#ifdef CONFIG_CMD_I2C +static int set_ethaddr_from_eeprom(void) +{ + const int ETH_ADDR_LEN = 6; + unsigned char ethaddr[ETH_ADDR_LEN]; + const char *ETHADDR_NAME = "ethaddr"; + struct udevice *bus, *dev; + + if (getenv(ETHADDR_NAME)) + return 0; + + if (uclass_get_device_by_seq(UCLASS_I2C, 1, &bus)) { + printf("Cannot find I2C bus 1\n"); + return -1; + } + + if (dm_i2c_probe(bus, CONFIG_AT24MAC_ADDR, 0, &dev)) { + printf("Failed to probe I2C chip\n"); + return -1; + } + + if (dm_i2c_read(dev, CONFIG_AT24MAC_REG, ethaddr, ETH_ADDR_LEN)) { + printf("Failed to read ethernet address from EEPROM\n"); + return -1; + } + + if (!is_valid_ethaddr(ethaddr)) { + printf("The ethernet address read from EEPROM is not valid!\n"); + return -1; + } + + return eth_setenv_enetaddr(ETHADDR_NAME, ethaddr); +} +#else +static int set_ethaddr_from_eeprom(void) +{ + return 0; +} +#endif + +#ifdef CONFIG_MISC_INIT_R +int misc_init_r(void) +{ + set_ethaddr_from_eeprom(); + + return 0; +} +#endif + /* SPL */ #ifdef CONFIG_SPL_BUILD void spl_board_init(void) diff --git a/include/configs/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h index 77757a3..cada04f 100644 --- a/include/configs/sama5d2_xplained.h +++ b/include/configs/sama5d2_xplained.h @@ -15,6 +15,8 @@ #include "at91-sama5_common.h" +#define CONFIG_MISC_INIT_R + /* SDRAM */ #define CONFIG_NR_DRAM_BANKS 1 #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS @@ -54,6 +56,10 @@ #define CONFIG_DOS_PARTITION #endif +/* I2C */ +#define CONFIG_AT24MAC_ADDR 0x5c +#define CONFIG_AT24MAC_REG 0x9a + /* Ethernet Hardware */ #define CONFIG_MACB #define CONFIG_RMII -- 2.7.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [U-Boot] [U-Boot, v2, 3/4] board: sama5d2_xplained: Set 'ethaddr' got from AT24MAC 2016-09-13 2:49 ` [U-Boot] [PATCH v2 3/4] board: sama5d2_xplained: Set 'ethaddr' got from AT24MAC Wenyou Yang @ 2016-10-16 20:18 ` Andreas Bießmann 2016-10-16 21:42 ` Andreas Bießmann 1 sibling, 0 replies; 11+ messages in thread From: Andreas Bießmann @ 2016-10-16 20:18 UTC (permalink / raw) To: u-boot On Tue, Sep 13, 2016 at 10:49:04AM +0800, Wenyou Yang wrote: > If 'ethaddr' is not set, we will get the ethernet address from AT24MAC, > and set it to 'ethaddr' variable. > > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> > Signed-off-by: Songjun Wu <songjun.wu@microchip.com> Reviewed-by: Andreas Bie?mann <andreas@biessmann.org> > --- > > Changes in v2: None > > board/atmel/sama5d2_xplained/sama5d2_xplained.c | 51 +++++++++++++++++++++++++ > include/configs/sama5d2_xplained.h | 6 +++ > 2 files changed, 57 insertions(+) > > diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c > index 7ccadf2..c94574b 100644 > --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c > +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c > @@ -7,6 +7,8 @@ > > #include <common.h> > #include <atmel_hlcdc.h> > +#include <dm.h> > +#include <i2c.h> > #include <lcd.h> > #include <mmc.h> > #include <net.h> > @@ -192,6 +194,55 @@ int board_eth_init(bd_t *bis) > return rc; > } > > +#ifdef CONFIG_CMD_I2C > +static int set_ethaddr_from_eeprom(void) > +{ > + const int ETH_ADDR_LEN = 6; > + unsigned char ethaddr[ETH_ADDR_LEN]; > + const char *ETHADDR_NAME = "ethaddr"; > + struct udevice *bus, *dev; > + > + if (getenv(ETHADDR_NAME)) > + return 0; > + > + if (uclass_get_device_by_seq(UCLASS_I2C, 1, &bus)) { > + printf("Cannot find I2C bus 1\n"); > + return -1; > + } > + > + if (dm_i2c_probe(bus, CONFIG_AT24MAC_ADDR, 0, &dev)) { > + printf("Failed to probe I2C chip\n"); > + return -1; > + } > + > + if (dm_i2c_read(dev, CONFIG_AT24MAC_REG, ethaddr, ETH_ADDR_LEN)) { > + printf("Failed to read ethernet address from EEPROM\n"); > + return -1; > + } > + > + if (!is_valid_ethaddr(ethaddr)) { > + printf("The ethernet address read from EEPROM is not valid!\n"); > + return -1; > + } > + > + return eth_setenv_enetaddr(ETHADDR_NAME, ethaddr); > +} > +#else > +static int set_ethaddr_from_eeprom(void) > +{ > + return 0; > +} > +#endif > + > +#ifdef CONFIG_MISC_INIT_R > +int misc_init_r(void) > +{ > + set_ethaddr_from_eeprom(); > + > + return 0; > +} > +#endif > + > /* SPL */ > #ifdef CONFIG_SPL_BUILD > void spl_board_init(void) > diff --git a/include/configs/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h > index 77757a3..cada04f 100644 > --- a/include/configs/sama5d2_xplained.h > +++ b/include/configs/sama5d2_xplained.h > @@ -15,6 +15,8 @@ > > #include "at91-sama5_common.h" > > +#define CONFIG_MISC_INIT_R > + > /* SDRAM */ > #define CONFIG_NR_DRAM_BANKS 1 > #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS > @@ -54,6 +56,10 @@ > #define CONFIG_DOS_PARTITION > #endif > > +/* I2C */ > +#define CONFIG_AT24MAC_ADDR 0x5c > +#define CONFIG_AT24MAC_REG 0x9a > + > /* Ethernet Hardware */ > #define CONFIG_MACB > #define CONFIG_RMII ^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [U-Boot, v2, 3/4] board: sama5d2_xplained: Set 'ethaddr' got from AT24MAC 2016-09-13 2:49 ` [U-Boot] [PATCH v2 3/4] board: sama5d2_xplained: Set 'ethaddr' got from AT24MAC Wenyou Yang 2016-10-16 20:18 ` [U-Boot] [U-Boot, v2, " Andreas Bießmann @ 2016-10-16 21:42 ` Andreas Bießmann 2016-10-16 22:03 ` Tom Rini 1 sibling, 1 reply; 11+ messages in thread From: Andreas Bießmann @ 2016-10-16 21:42 UTC (permalink / raw) To: u-boot Hi Wenyou, On Tue, Sep 13, 2016 at 10:49:04AM +0800, Wenyou Yang wrote: > If 'ethaddr' is not set, we will get the ethernet address from AT24MAC, > and set it to 'ethaddr' variable. > > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> > Signed-off-by: Songjun Wu <songjun.wu@microchip.com> > Reviewed-by: Andreas Bie?mann <andreas@biessmann.org> > --- > > Changes in v2: None > > board/atmel/sama5d2_xplained/sama5d2_xplained.c | 51 +++++++++++++++++++++++++ > include/configs/sama5d2_xplained.h | 6 +++ > 2 files changed, 57 insertions(+) > <snip> > diff --git a/include/configs/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h > index 77757a3..cada04f 100644 > --- a/include/configs/sama5d2_xplained.h > +++ b/include/configs/sama5d2_xplained.h > @@ -15,6 +15,8 @@ > > #include "at91-sama5_common.h" > > +#define CONFIG_MISC_INIT_R > + > /* SDRAM */ > #define CONFIG_NR_DRAM_BANKS 1 > #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS > @@ -54,6 +56,10 @@ > #define CONFIG_DOS_PARTITION > #endif > > +/* I2C */ > +#define CONFIG_AT24MAC_ADDR 0x5c > +#define CONFIG_AT24MAC_REG 0x9a these two configs produce compile warnings due to the lately introduced check for new config options outside Kconfig. Please resend with these two options moved to Kconfig of sama5d2_xplained board. Andreas > + > /* Ethernet Hardware */ > #define CONFIG_MACB > #define CONFIG_RMII ^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [U-Boot, v2, 3/4] board: sama5d2_xplained: Set 'ethaddr' got from AT24MAC 2016-10-16 21:42 ` Andreas Bießmann @ 2016-10-16 22:03 ` Tom Rini 0 siblings, 0 replies; 11+ messages in thread From: Tom Rini @ 2016-10-16 22:03 UTC (permalink / raw) To: u-boot On Sun, Oct 16, 2016 at 11:42:01PM +0200, Andreas Bie?mann wrote: > Hi Wenyou, > > On Tue, Sep 13, 2016 at 10:49:04AM +0800, Wenyou Yang wrote: > > If 'ethaddr' is not set, we will get the ethernet address from AT24MAC, > > and set it to 'ethaddr' variable. > > > > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> > > Signed-off-by: Songjun Wu <songjun.wu@microchip.com> > > Reviewed-by: Andreas Bie?mann <andreas@biessmann.org> > > --- > > > > Changes in v2: None > > > > board/atmel/sama5d2_xplained/sama5d2_xplained.c | 51 +++++++++++++++++++++++++ > > include/configs/sama5d2_xplained.h | 6 +++ > > 2 files changed, 57 insertions(+) > > > > <snip> > > > diff --git a/include/configs/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h > > index 77757a3..cada04f 100644 > > --- a/include/configs/sama5d2_xplained.h > > +++ b/include/configs/sama5d2_xplained.h > > @@ -15,6 +15,8 @@ > > > > #include "at91-sama5_common.h" > > > > +#define CONFIG_MISC_INIT_R > > + > > /* SDRAM */ > > #define CONFIG_NR_DRAM_BANKS 1 > > #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS > > @@ -54,6 +56,10 @@ > > #define CONFIG_DOS_PARTITION > > #endif > > > > +/* I2C */ > > +#define CONFIG_AT24MAC_ADDR 0x5c > > +#define CONFIG_AT24MAC_REG 0x9a > > these two configs produce compile warnings due to the lately introduced check > for new config options outside Kconfig. > > Please resend with these two options moved to Kconfig of sama5d2_xplained > board. Or just not in CONFIG namespace if there's really no reason for them to be changed / selected. Thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161016/e3a5077e/attachment.sig> ^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH v2 4/4] board: sama5d2_xplained: Enable an early debug UART 2016-09-13 2:49 [U-Boot] [PATCH v2 0/4] board: sama5d2_xplained: Convert to use device tree and drivers with DM Wenyou Yang ` (2 preceding siblings ...) 2016-09-13 2:49 ` [U-Boot] [PATCH v2 3/4] board: sama5d2_xplained: Set 'ethaddr' got from AT24MAC Wenyou Yang @ 2016-09-13 2:49 ` Wenyou Yang 2016-10-16 20:20 ` [U-Boot] [U-Boot, v2, " Andreas Bießmann 3 siblings, 1 reply; 11+ messages in thread From: Wenyou Yang @ 2016-09-13 2:49 UTC (permalink / raw) To: u-boot Enable an 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: Simon Glass <sjg@chromium.org> --- Changes in v2: - Collect Reviewed-by tags. board/atmel/sama5d2_xplained/sama5d2_xplained.c | 14 ++++++++++++++ configs/sama5d2_xplained_mmc_defconfig | 6 ++++++ configs/sama5d2_xplained_spiflash_defconfig | 6 ++++++ include/configs/sama5d2_xplained.h | 2 ++ 4 files changed, 28 insertions(+) diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c index c94574b..0ae6a7d 100644 --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c @@ -7,6 +7,7 @@ #include <common.h> #include <atmel_hlcdc.h> +#include <debug_uart.h> #include <dm.h> #include <i2c.h> #include <lcd.h> @@ -141,12 +142,25 @@ static void board_uart1_hw_init(void) at91_periph_clk_enable(ATMEL_ID_UART1); } +#ifdef CONFIG_DEBUG_UART_BOARD_INIT +void board_debug_uart_init(void) +{ + board_uart1_hw_init(); +} +#endif + +#ifdef CONFIG_BOARD_EARLY_INIT_F int board_early_init_f(void) { +#ifdef CONFIG_DEBUG_UART + debug_uart_init(); +#else board_uart1_hw_init(); +#endif return 0; } +#endif int board_init(void) { diff --git a/configs/sama5d2_xplained_mmc_defconfig b/configs/sama5d2_xplained_mmc_defconfig index ab1b58b..ba36c8f 100644 --- a/configs/sama5d2_xplained_mmc_defconfig +++ b/configs/sama5d2_xplained_mmc_defconfig @@ -44,6 +44,12 @@ CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_ATMEL=y CONFIG_PINCTRL=y CONFIG_PINCTRL_AT91PIO4=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_ATMEL=y +CONFIG_DEBUG_UART_BASE=0xf8020000 +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/sama5d2_xplained_spiflash_defconfig b/configs/sama5d2_xplained_spiflash_defconfig index ecba5ef..85f3f9c 100644 --- a/configs/sama5d2_xplained_spiflash_defconfig +++ b/configs/sama5d2_xplained_spiflash_defconfig @@ -44,6 +44,12 @@ CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_ATMEL=y CONFIG_PINCTRL=y CONFIG_PINCTRL_AT91PIO4=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_ATMEL=y +CONFIG_DEBUG_UART_BASE=0xf8020000 +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/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h index cada04f..51fabbe 100644 --- a/include/configs/sama5d2_xplained.h +++ b/include/configs/sama5d2_xplained.h @@ -15,6 +15,8 @@ #include "at91-sama5_common.h" +#define CONFIG_BOARD_EARLY_INIT_F + #define CONFIG_MISC_INIT_R /* SDRAM */ -- 2.7.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [U-Boot] [U-Boot, v2, 4/4] board: sama5d2_xplained: Enable an early debug UART 2016-09-13 2:49 ` [U-Boot] [PATCH v2 4/4] board: sama5d2_xplained: Enable an early debug UART Wenyou Yang @ 2016-10-16 20:20 ` Andreas Bießmann 0 siblings, 0 replies; 11+ messages in thread From: Andreas Bießmann @ 2016-10-16 20:20 UTC (permalink / raw) To: u-boot On Tue, Sep 13, 2016 at 10:49:05AM +0800, Wenyou Yang wrote: > Enable an 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: Simon Glass <sjg@chromium.org> Reviewed-by: Andreas Bie?mann <andreas@biessmann.org> > --- > > Changes in v2: > - Collect Reviewed-by tags. > > board/atmel/sama5d2_xplained/sama5d2_xplained.c | 14 ++++++++++++++ > configs/sama5d2_xplained_mmc_defconfig | 6 ++++++ > configs/sama5d2_xplained_spiflash_defconfig | 6 ++++++ > include/configs/sama5d2_xplained.h | 2 ++ > 4 files changed, 28 insertions(+) > > diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c > index c94574b..0ae6a7d 100644 > --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c > +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c > @@ -7,6 +7,7 @@ > > #include <common.h> > #include <atmel_hlcdc.h> > +#include <debug_uart.h> > #include <dm.h> > #include <i2c.h> > #include <lcd.h> > @@ -141,12 +142,25 @@ static void board_uart1_hw_init(void) > at91_periph_clk_enable(ATMEL_ID_UART1); > } > > +#ifdef CONFIG_DEBUG_UART_BOARD_INIT > +void board_debug_uart_init(void) > +{ > + board_uart1_hw_init(); > +} > +#endif > + > +#ifdef CONFIG_BOARD_EARLY_INIT_F > int board_early_init_f(void) > { > +#ifdef CONFIG_DEBUG_UART > + debug_uart_init(); > +#else > board_uart1_hw_init(); > +#endif > > return 0; > } > +#endif > > int board_init(void) > { > diff --git a/configs/sama5d2_xplained_mmc_defconfig b/configs/sama5d2_xplained_mmc_defconfig > index ab1b58b..ba36c8f 100644 > --- a/configs/sama5d2_xplained_mmc_defconfig > +++ b/configs/sama5d2_xplained_mmc_defconfig > @@ -44,6 +44,12 @@ CONFIG_SPI_FLASH=y > CONFIG_SPI_FLASH_ATMEL=y > CONFIG_PINCTRL=y > CONFIG_PINCTRL_AT91PIO4=y > +CONFIG_DEBUG_UART=y > +CONFIG_DEBUG_UART_ATMEL=y > +CONFIG_DEBUG_UART_BASE=0xf8020000 > +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/sama5d2_xplained_spiflash_defconfig b/configs/sama5d2_xplained_spiflash_defconfig > index ecba5ef..85f3f9c 100644 > --- a/configs/sama5d2_xplained_spiflash_defconfig > +++ b/configs/sama5d2_xplained_spiflash_defconfig > @@ -44,6 +44,12 @@ CONFIG_SPI_FLASH=y > CONFIG_SPI_FLASH_ATMEL=y > CONFIG_PINCTRL=y > CONFIG_PINCTRL_AT91PIO4=y > +CONFIG_DEBUG_UART=y > +CONFIG_DEBUG_UART_ATMEL=y > +CONFIG_DEBUG_UART_BASE=0xf8020000 > +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/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h > index cada04f..51fabbe 100644 > --- a/include/configs/sama5d2_xplained.h > +++ b/include/configs/sama5d2_xplained.h > @@ -15,6 +15,8 @@ > > #include "at91-sama5_common.h" > > +#define CONFIG_BOARD_EARLY_INIT_F > + > #define CONFIG_MISC_INIT_R > > /* SDRAM */ ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-10-16 22:03 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-09-13 2:49 [U-Boot] [PATCH v2 0/4] board: sama5d2_xplained: Convert to use device tree and drivers with DM Wenyou Yang 2016-09-13 2:49 ` [U-Boot] [PATCH v2 1/4] board: sama5d2_xplained: Move config options to defconfigs Wenyou Yang 2016-10-16 20:11 ` [U-Boot] [U-Boot, v2, " Andreas Bießmann 2016-09-13 2:49 ` [U-Boot] [PATCH v2 2/4] board: sama5d2_xplained: Clean up code Wenyou Yang 2016-10-16 20:17 ` [U-Boot] [U-Boot, v2, " Andreas Bießmann 2016-09-13 2:49 ` [U-Boot] [PATCH v2 3/4] board: sama5d2_xplained: Set 'ethaddr' got from AT24MAC Wenyou Yang 2016-10-16 20:18 ` [U-Boot] [U-Boot, v2, " Andreas Bießmann 2016-10-16 21:42 ` Andreas Bießmann 2016-10-16 22:03 ` Tom Rini 2016-09-13 2:49 ` [U-Boot] [PATCH v2 4/4] board: sama5d2_xplained: Enable an early debug UART Wenyou Yang 2016-10-16 20:20 ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox