From patchwork Tue Jul 7 11:08:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Wu X-Patchwork-Id: 492138 X-Patchwork-Delegate: andreas.biessmann@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 15B3514027F for ; Tue, 7 Jul 2015 21:03:55 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9531C4B852; Tue, 7 Jul 2015 13:03:51 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NJKGzLdRpfgT; Tue, 7 Jul 2015 13:03:51 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B68D4B842; Tue, 7 Jul 2015 13:03:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BDFAD4B842 for ; Tue, 7 Jul 2015 13:03:47 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cuiNCXQW0ZEv for ; Tue, 7 Jul 2015 13:03:47 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from SJOEDG01.corp.atmel.com (nasmtp02.atmel.com [204.2.163.16]) by theia.denx.de (Postfix) with ESMTPS id 0E6964B841 for ; Tue, 7 Jul 2015 13:03:43 +0200 (CEST) Received: from apsmtp01.atmel.com (10.168.254.30) by sjoedg01.corp.atmel.com (10.64.253.30) with Microsoft SMTP Server (TLS) id 14.3.235.1; Tue, 7 Jul 2015 04:09:07 -0700 Received: from melon.corp.atmel.com (10.168.254.13) by apsmtp01.corp.atmel.com (10.168.254.30) with Microsoft SMTP Server id 14.3.235.1; Tue, 7 Jul 2015 19:04:27 +0800 From: Josh Wu To: U-Boot Mailing List , Date: Tue, 7 Jul 2015 19:08:18 +0800 Message-ID: <1436267300-2293-1-git-send-email-josh.wu@atmel.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Subject: [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" As almost all sama5 sd/mmc env configurations are same, so move them to at91-sama5_common.h. Also we define a KERNEL_DTB_FILE_NAME as dtb file name for different board. Signed-off-by: Josh Wu --- Hi, Those patches depends on the patch: http://patchwork.ozlabs.org/patch/485339/ Best Regards, Josh Wu include/configs/at91-sama5_common.h | 17 +++++++++++++++++ include/configs/sama5d3_xplained.h | 12 +++--------- include/configs/sama5d3xek.h | 10 +--------- include/configs/sama5d4_xplained.h | 20 +++----------------- include/configs/sama5d4ek.h | 18 +++--------------- 5 files changed, 27 insertions(+), 50 deletions(-) diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h index 9289964..99fa0b1 100644 --- a/include/configs/at91-sama5_common.h +++ b/include/configs/at91-sama5_common.h @@ -56,6 +56,23 @@ #define CONFIG_CMD_DHCP #ifdef CONFIG_SYS_USE_MMC +/* u-boot env in sd/mmc card */ +#define CONFIG_ENV_IS_IN_FAT +#define CONFIG_FAT_WRITE +#define FAT_ENV_INTERFACE "mmc" +#define FAT_ENV_DEVICE_AND_PART "0" +#define FAT_ENV_FILE "uboot.env" +#define CONFIG_ENV_SIZE 0x4000 + +#ifdef KERNEL_DTB_FILE_NAME +#define CONFIG_BOOT_DTB_COMMAND "fatload mmc 0:1 0x21000000 " KERNEL_DTB_FILE_NAME "; " +#else +#define CONFIG_BOOT_DTB_COMMAND "fatload mmc 0:1 0x21000000 ${ek_name}.dtb; " +#endif + +#define CONFIG_BOOTCOMMAND CONFIG_BOOT_DTB_COMMAND \ + "fatload mmc 0:1 0x22000000 zImage; " \ + "bootz 0x22000000 - 0x21000000" #define CONFIG_BOOTARGS \ "console=ttyS0,115200 earlyprintk " \ "root=/dev/mmcblk0p2 rw rootwait" diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h index c4141a0..e5de24b 100644 --- a/include/configs/sama5d3_xplained.h +++ b/include/configs/sama5d3_xplained.h @@ -13,6 +13,8 @@ /* No NOR flash, this definition should put before common header */ #define CONFIG_SYS_NO_FLASH +#define KERNEL_DTB_FILE_NAME "at91-sama5d3_xplained.dtb" + #include "at91-sama5_common.h" /* serial console */ @@ -124,15 +126,7 @@ "nand read 0x22000000 0x200000 0x600000;" \ "bootz 0x22000000 - 0x21000000" #elif CONFIG_SYS_USE_MMC -/* bootstrap + u-boot + env in sd card */ -#define CONFIG_ENV_IS_IN_FAT -#define FAT_ENV_INTERFACE "mmc" -#define FAT_ENV_FILE "uboot.env" -#define FAT_ENV_DEVICE_AND_PART "0" -#define CONFIG_ENV_SIZE 0x4000 -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d3_xplained.dtb; " \ - "fatload mmc 0:1 0x22000000 zImage; " \ - "bootz 0x22000000 - 0x21000000" +/* override the bootcmd, bootargs and other configuration for sd/mmc env */ #else #define CONFIG_ENV_IS_NOWHERE #endif diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h index 344ae9c..71441a4 100644 --- a/include/configs/sama5d3xek.h +++ b/include/configs/sama5d3xek.h @@ -176,15 +176,7 @@ "nand read 0x22000000 0x200000 0x600000;" \ "bootm 0x22000000 - 0x21000000" #elif CONFIG_SYS_USE_MMC -/* bootstrap + u-boot + env in sd card */ -#define CONFIG_ENV_IS_IN_FAT -#define FAT_ENV_INTERFACE "mmc" -#define FAT_ENV_FILE "uboot.env" -#define FAT_ENV_DEVICE_AND_PART "0" -#define CONFIG_ENV_SIZE 0x4000 -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 ${ek_name}.dtb; " \ - "fatload mmc 0:1 0x22000000 zImage; " \ - "bootm 0x22000000 - 0x21000000" +/* override the bootcmd, bootargs and other configuration for sd/mmc env */ #else #define CONFIG_ENV_IS_NOWHERE #endif diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h index 5fb621e..a7d9e78 100644 --- a/include/configs/sama5d4_xplained.h +++ b/include/configs/sama5d4_xplained.h @@ -13,6 +13,8 @@ /* No NOR flash, this definition should put before common header */ #define CONFIG_SYS_NO_FLASH +#define KERNEL_DTB_FILE_NAME "at91-sama5d4_xplained.dtb" + #include "at91-sama5_common.h" /* serial console */ @@ -139,25 +141,9 @@ "nand read 0x22000000 0x200000 0x600000;" \ "bootz 0x22000000 - 0x21000000" #elif CONFIG_SYS_USE_MMC -/* bootstrap + u-boot + env in sd card */ -#define CONFIG_ENV_IS_IN_FAT -#define CONFIG_FAT_WRITE -#define FAT_ENV_INTERFACE "mmc" -/* - * We don't specify the part number, if device 0 has partition table, it means - * the first partition; it no partition table, then take whole device as a - * FAT file system. - */ -#define FAT_ENV_DEVICE_AND_PART "0" -#define FAT_ENV_FILE "uboot.env" -#define CONFIG_ENV_SIZE 0x4000 -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d4_xplained.dtb; " \ - "fatload mmc 0:1 0x22000000 zImage; " \ - "bootz 0x22000000 - 0x21000000" +/* override the bootcmd, bootargs and other configuration for sd/mmc env */ #endif - - /* SPL */ #define CONFIG_SPL_FRAMEWORK #define CONFIG_SPL_TEXT_BASE 0x200000 diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h index 546d7a3..8ecb6d3 100644 --- a/include/configs/sama5d4ek.h +++ b/include/configs/sama5d4ek.h @@ -13,6 +13,8 @@ /* No NOR flash, this definition should put before common header */ #define CONFIG_SYS_NO_FLASH +#define KERNEL_DTB_FILE_NAME "sama5d4ek.dtb" + #include "at91-sama5_common.h" /* serial console */ @@ -137,21 +139,7 @@ "nand read 0x22000000 0x200000 0x600000;" \ "bootz 0x22000000 - 0x21000000" #elif CONFIG_SYS_USE_MMC -/* bootstrap + u-boot + env in sd card */ -#define CONFIG_ENV_IS_IN_FAT -#define CONFIG_FAT_WRITE -#define FAT_ENV_INTERFACE "mmc" -/* - * We don't specify the part number, if device 0 has partition table, it means - * the first partition; it no partition table, then take whole device as a - * FAT file system. - */ -#define FAT_ENV_DEVICE_AND_PART "0" -#define FAT_ENV_FILE "uboot.env" -#define CONFIG_ENV_SIZE 0x4000 -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 sama5d4ek.dtb; " \ - "fatload mmc 0:1 0x22000000 zImage; " \ - "bootz 0x22000000 - 0x21000000" +/* override the bootcmd, bootargs and other configuration for sd/mmc env */ #endif /* SPL */