Re: [U-Boot] [PATCH v6] arm: atmel: Add SAMA5D2 Xplained board
Hi Andreas, > -Original Message- > From: Andreas Bießmann [mailto:andreas.de...@googlemail.com] > Sent: 2015年11月24日 0:29 > To: Yang, Wenyou; U-Boot Mailing List > Cc: Bo Shen > Subject: Re: [U-Boot] [PATCH v6] arm: atmel: Add SAMA5D2 Xplained board > > Hi Wenyou, > > On 30.10.15 02:55, Wenyou Yang wrote: > > The board supports following features: > > - Boot media support: SD card/e.MMC/SPI flash, > > - Support LCD display (optional, disabled by default), > > - Support ethernet, > > - Support USB mass storage. > > > > Signed-off-by: Wenyou Yang > > I'll fix a few checkpatch warnings while applying Thank you very much for your review and your help, > > Andreas > > > --- > > The patch is based on the following patches sent in mailing list. > > [PATCH] gpio: atmel: Add the PIO4 driver support > > [PATCH] arm: at91: Change the Chip ID registers' addresses > > [PATCH v4] mmc: atmel: Add atmel sdhci support > > [PATCH v3] arm: at91: clock: Add the generated clock support > > > > Changes in v6: > > 1./ change function invocation due to its declaration change, > > at91_enable_periph_generated_clk(). > > > > Changes in v5: > > 1./ remove wrong pin config for USB hw init. > > > > Changes in v4: > > 1./ remove __weak attribute for has_lcdc() added in v3. > > 2./ remove unused goto err_exit. > > > > Changes in v3: > > 1./ change defines-->definitions for more clearly in asm/arch/sama5d2.h. > > 2./ remove unused cpu_is_sama5d2x() macros. > > 3./ fix spelling error "adress". > > 4./ add __weak attribute for has_lcdc(). > > 5./ remove SPL configs. > > > > Changes in v2: > > 1./ re-order SAMA5D2 statements alphabetically. > > 2./ remove redundant "Unknown CPU type". > > 3./ rework sama5d2's macros. > > 4./ remove some #ifdef before functions. > > 5./ move CONFIG_CMD_SF to Kconfig. > > 6./ remove NAND macros from config file. > > 7./ CONFIG_BOOTCOMMAND for sf uses defines in at91-sama5_common.h. > > > > arch/arm/mach-at91/Kconfig |5 + > > arch/arm/mach-at91/armv7/Makefile|1 + > > arch/arm/mach-at91/armv7/sama5d2_devices.c | 59 + > > arch/arm/mach-at91/include/mach/at91_pmc.h |9 +- > > arch/arm/mach-at91/include/mach/atmel_usba_udc.h |3 +- > > arch/arm/mach-at91/include/mach/hardware.h |2 + > > arch/arm/mach-at91/include/mach/sama5d2.h| 203 > > board/atmel/sama5d2_xplained/Kconfig | 15 ++ > > board/atmel/sama5d2_xplained/MAINTAINERS |7 + > > board/atmel/sama5d2_xplained/Makefile|8 + > > board/atmel/sama5d2_xplained/sama5d2_xplained.c | 284 > ++ > > configs/sama5d2_xplained_mmc_defconfig | 11 + > > configs/sama5d2_xplained_spiflash_defconfig | 11 + > > include/configs/sama5d2_xplained.h | 122 ++ > > 14 files changed, 734 insertions(+), 6 deletions(-) create mode > > 100644 arch/arm/mach-at91/armv7/sama5d2_devices.c > > create mode 100644 arch/arm/mach-at91/include/mach/sama5d2.h > > create mode 100644 board/atmel/sama5d2_xplained/Kconfig > > create mode 100644 board/atmel/sama5d2_xplained/MAINTAINERS > > create mode 100644 board/atmel/sama5d2_xplained/Makefile > > create mode 100644 board/atmel/sama5d2_xplained/sama5d2_xplained.c > > create mode 100644 configs/sama5d2_xplained_mmc_defconfig > > create mode 100644 configs/sama5d2_xplained_spiflash_defconfig > > create mode 100644 include/configs/sama5d2_xplained.h Best Regards, Wenyou Yang ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v6] arm: atmel: Add SAMA5D2 Xplained board
Hi Wenyou, On 30.10.15 02:55, Wenyou Yang wrote: > The board supports following features: > - Boot media support: SD card/e.MMC/SPI flash, > - Support LCD display (optional, disabled by default), > - Support ethernet, > - Support USB mass storage. > > Signed-off-by: Wenyou Yang I'll fix a few checkpatch warnings while applying Andreas > --- > The patch is based on the following patches sent in mailing list. > [PATCH] gpio: atmel: Add the PIO4 driver support > [PATCH] arm: at91: Change the Chip ID registers' addresses > [PATCH v4] mmc: atmel: Add atmel sdhci support > [PATCH v3] arm: at91: clock: Add the generated clock support > > Changes in v6: > 1./ change function invocation due to its declaration change, > at91_enable_periph_generated_clk(). > > Changes in v5: > 1./ remove wrong pin config for USB hw init. > > Changes in v4: > 1./ remove __weak attribute for has_lcdc() added in v3. > 2./ remove unused goto err_exit. > > Changes in v3: > 1./ change defines-->definitions for more clearly in asm/arch/sama5d2.h. > 2./ remove unused cpu_is_sama5d2x() macros. > 3./ fix spelling error "adress". > 4./ add __weak attribute for has_lcdc(). > 5./ remove SPL configs. > > Changes in v2: > 1./ re-order SAMA5D2 statements alphabetically. > 2./ remove redundant "Unknown CPU type". > 3./ rework sama5d2's macros. > 4./ remove some #ifdef before functions. > 5./ move CONFIG_CMD_SF to Kconfig. > 6./ remove NAND macros from config file. > 7./ CONFIG_BOOTCOMMAND for sf uses defines in at91-sama5_common.h. > > arch/arm/mach-at91/Kconfig |5 + > arch/arm/mach-at91/armv7/Makefile|1 + > arch/arm/mach-at91/armv7/sama5d2_devices.c | 59 + > arch/arm/mach-at91/include/mach/at91_pmc.h |9 +- > arch/arm/mach-at91/include/mach/atmel_usba_udc.h |3 +- > arch/arm/mach-at91/include/mach/hardware.h |2 + > arch/arm/mach-at91/include/mach/sama5d2.h| 203 > board/atmel/sama5d2_xplained/Kconfig | 15 ++ > board/atmel/sama5d2_xplained/MAINTAINERS |7 + > board/atmel/sama5d2_xplained/Makefile|8 + > board/atmel/sama5d2_xplained/sama5d2_xplained.c | 284 > ++ > configs/sama5d2_xplained_mmc_defconfig | 11 + > configs/sama5d2_xplained_spiflash_defconfig | 11 + > include/configs/sama5d2_xplained.h | 122 ++ > 14 files changed, 734 insertions(+), 6 deletions(-) > create mode 100644 arch/arm/mach-at91/armv7/sama5d2_devices.c > create mode 100644 arch/arm/mach-at91/include/mach/sama5d2.h > create mode 100644 board/atmel/sama5d2_xplained/Kconfig > create mode 100644 board/atmel/sama5d2_xplained/MAINTAINERS > create mode 100644 board/atmel/sama5d2_xplained/Makefile > create mode 100644 board/atmel/sama5d2_xplained/sama5d2_xplained.c > create mode 100644 configs/sama5d2_xplained_mmc_defconfig > create mode 100644 configs/sama5d2_xplained_spiflash_defconfig > create mode 100644 include/configs/sama5d2_xplained.h ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6] arm: atmel: Add SAMA5D2 Xplained board
The board supports following features: - Boot media support: SD card/e.MMC/SPI flash, - Support LCD display (optional, disabled by default), - Support ethernet, - Support USB mass storage. Signed-off-by: Wenyou Yang --- The patch is based on the following patches sent in mailing list. [PATCH] gpio: atmel: Add the PIO4 driver support [PATCH] arm: at91: Change the Chip ID registers' addresses [PATCH v4] mmc: atmel: Add atmel sdhci support [PATCH v3] arm: at91: clock: Add the generated clock support Changes in v6: 1./ change function invocation due to its declaration change, at91_enable_periph_generated_clk(). Changes in v5: 1./ remove wrong pin config for USB hw init. Changes in v4: 1./ remove __weak attribute for has_lcdc() added in v3. 2./ remove unused goto err_exit. Changes in v3: 1./ change defines-->definitions for more clearly in asm/arch/sama5d2.h. 2./ remove unused cpu_is_sama5d2x() macros. 3./ fix spelling error "adress". 4./ add __weak attribute for has_lcdc(). 5./ remove SPL configs. Changes in v2: 1./ re-order SAMA5D2 statements alphabetically. 2./ remove redundant "Unknown CPU type". 3./ rework sama5d2's macros. 4./ remove some #ifdef before functions. 5./ move CONFIG_CMD_SF to Kconfig. 6./ remove NAND macros from config file. 7./ CONFIG_BOOTCOMMAND for sf uses defines in at91-sama5_common.h. arch/arm/mach-at91/Kconfig |5 + arch/arm/mach-at91/armv7/Makefile|1 + arch/arm/mach-at91/armv7/sama5d2_devices.c | 59 + arch/arm/mach-at91/include/mach/at91_pmc.h |9 +- arch/arm/mach-at91/include/mach/atmel_usba_udc.h |3 +- arch/arm/mach-at91/include/mach/hardware.h |2 + arch/arm/mach-at91/include/mach/sama5d2.h| 203 board/atmel/sama5d2_xplained/Kconfig | 15 ++ board/atmel/sama5d2_xplained/MAINTAINERS |7 + board/atmel/sama5d2_xplained/Makefile|8 + board/atmel/sama5d2_xplained/sama5d2_xplained.c | 284 ++ configs/sama5d2_xplained_mmc_defconfig | 11 + configs/sama5d2_xplained_spiflash_defconfig | 11 + include/configs/sama5d2_xplained.h | 122 ++ 14 files changed, 734 insertions(+), 6 deletions(-) create mode 100644 arch/arm/mach-at91/armv7/sama5d2_devices.c create mode 100644 arch/arm/mach-at91/include/mach/sama5d2.h create mode 100644 board/atmel/sama5d2_xplained/Kconfig create mode 100644 board/atmel/sama5d2_xplained/MAINTAINERS create mode 100644 board/atmel/sama5d2_xplained/Makefile create mode 100644 board/atmel/sama5d2_xplained/sama5d2_xplained.c create mode 100644 configs/sama5d2_xplained_mmc_defconfig create mode 100644 configs/sama5d2_xplained_spiflash_defconfig create mode 100644 include/configs/sama5d2_xplained.h diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index fdaf328..c333647 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -71,6 +71,10 @@ config TARGET_AT91SAM9X5EK select CPU_ARM926EJS select SUPPORT_SPL +config TARGET_SAMA5D2_XPLAINED + bool "SAMA5D2 Xplained board" + select CPU_V7 + config TARGET_SAMA5D3_XPLAINED bool "SAMA5D3 Xplained board" select CPU_V7 @@ -123,6 +127,7 @@ source "board/atmel/at91sam9m10g45ek/Kconfig" source "board/atmel/at91sam9n12ek/Kconfig" source "board/atmel/at91sam9rlek/Kconfig" source "board/atmel/at91sam9x5ek/Kconfig" +source "board/atmel/sama5d2_xplained/Kconfig" source "board/atmel/sama5d3_xplained/Kconfig" source "board/atmel/sama5d3xek/Kconfig" source "board/atmel/sama5d4_xplained/Kconfig" diff --git a/arch/arm/mach-at91/armv7/Makefile b/arch/arm/mach-at91/armv7/Makefile index f4f35a4..9538bc1 100644 --- a/arch/arm/mach-at91/armv7/Makefile +++ b/arch/arm/mach-at91/armv7/Makefile @@ -8,6 +8,7 @@ # SPDX-License-Identifier: GPL-2.0+ # +obj-$(CONFIG_SAMA5D2) += sama5d2_devices.o obj-$(CONFIG_SAMA5D3) += sama5d3_devices.o obj-$(CONFIG_SAMA5D4) += sama5d4_devices.o obj-y += clock.o diff --git a/arch/arm/mach-at91/armv7/sama5d2_devices.c b/arch/arm/mach-at91/armv7/sama5d2_devices.c new file mode 100644 index 000..6ebbccf --- /dev/null +++ b/arch/arm/mach-at91/armv7/sama5d2_devices.c @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2015 Atmel Corporation + * Wenyou Yang + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include +#include +#include +#include +#include + +char *get_cpu_name() +{ + unsigned int extension_id = get_extension_chip_id(); + + if (cpu_is_sama5d2()) { + switch (extension_id) { + case ARCH_EXID_SAMA5D21CU: + return "SAMA5D21"; + case ARCH_EXID_SAMA5D22CU: + return "SAMA5D22-CU"; + case ARCH_EXID_SAMA5D22CN: + return "SAMA5D22-CN"; + case ARCH_EXID_SAMA5D23CU: +