From patchwork Tue Dec 20 16:33:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 132446 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 29C8FB7038 for ; Wed, 21 Dec 2011 03:33:21 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DCC4028147; Tue, 20 Dec 2011 17:33:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 2YXhXAllN+4n; Tue, 20 Dec 2011 17:33:19 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AFDB12812A; Tue, 20 Dec 2011 17:33:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C56F82812A for ; Tue, 20 Dec 2011 17:33:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 qj6cP1xruLWI for ; Tue, 20 Dec 2011 17:33:14 +0100 (CET) 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 mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by theia.denx.de (Postfix) with ESMTPS id E7BB528129 for ; Tue, 20 Dec 2011 17:33:11 +0100 (CET) Received: by yenm7 with SMTP id m7so3964002yen.3 for ; Tue, 20 Dec 2011 08:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=0NZd6gDkK5/MEIDqIJQa9csHDl2jJPyOTElb73+3Vdk=; b=CrnLCSHF0womTSB2/g9LT7JNhfpQPCv0Rz1BFDaGbYpM4SeC+vgy7fz5nL+q0wNc2B el+1F8Ta2Rrdyd/m9j9GCSQg8Ez6FooUd/WKKPhMkp8y6nuXIe0srm5ZHVw05Ix5fbbB M7HZa2QLaS/6R+gg92ase0O+Qv/n7vtmSO7Bo= Received: by 10.236.83.112 with SMTP id p76mr4773674yhe.118.1324398788712; Tue, 20 Dec 2011 08:33:08 -0800 (PST) Received: from localhost.localdomain ([189.5.21.38]) by mx.google.com with ESMTPS id c44sm4104904yhm.5.2011.12.20.08.33.05 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Dec 2011 08:33:07 -0800 (PST) From: Fabio Estevam To: u-boot@lists.denx.de Date: Tue, 20 Dec 2011 14:33:01 -0200 Message-Id: <1324398781-11198-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.7.1 Cc: Fabio Estevam , Chang-Ming.Huang@freescale.com, kumar.gala@freescale.com, afleming@freescale.com Subject: [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Since commit 97039ab98 (env_mmc: Allow board code to override the environment address) mmc_get_env_addr is a weak-aliased function in common/env_mmc.c The mmc_get_env_addr implementation that exists at board/freescale/common/sdhc_boot.c is meant to be used only for PowerPC boards, but currently it is being used for all platforms that have CONFIG_ENV_IS_IN_MMC defined. Introduce CONFIG_FSL_FIXED_MMC_LOCATION so that the boards that need to use the mmc_get_env_addr version from board/freescale/common/sdhc_boot.c could activate this config option on their board file. This fixes the retrieval of CONFIG_ENV_OFFSET on non-PowerPC boards. Signed-off-by: Fabio Estevam Acked-by: Stefano Babic Acked-by: Jason Liu --- board/freescale/common/Makefile | 2 +- board/freescale/common/sdhc_boot.c | 2 ++ include/configs/MPC8536DS.h | 1 + include/configs/P1010RDB.h | 1 + include/configs/P1_P2_RDB.h | 1 + include/configs/P2020COME.h | 1 + include/configs/P2020DS.h | 1 + include/configs/P2041RDB.h | 1 + include/configs/corenet_ds.h | 1 + include/configs/p1_p2_rdb_pc.h | 1 + 10 files changed, 11 insertions(+), 1 deletions(-) diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile index 9077aaf..5f8f7c6 100644 --- a/board/freescale/common/Makefile +++ b/board/freescale/common/Makefile @@ -39,7 +39,7 @@ COBJS-$(CONFIG_PQ_MDS_PIB) += pq-mds-pib.o COBJS-$(CONFIG_ID_EEPROM) += sys_eeprom.o COBJS-$(CONFIG_FSL_SGMII_RISER) += sgmii_riser.o ifndef CONFIG_RAMBOOT_PBL -COBJS-$(CONFIG_ENV_IS_IN_MMC) += sdhc_boot.o +COBJS-$(CONFIG_FSL_FIXED_MMC_LOCATION) += sdhc_boot.o endif COBJS-$(CONFIG_MPC8541CDS) += cds_pci_ft.o diff --git a/board/freescale/common/sdhc_boot.c b/board/freescale/common/sdhc_boot.c index e432318..68c335b 100644 --- a/board/freescale/common/sdhc_boot.c +++ b/board/freescale/common/sdhc_boot.c @@ -32,6 +32,7 @@ #define ESDHC_BOOT_IMAGE_SIZE 0x48 #define ESDHC_BOOT_IMAGE_ADDR 0x50 +#ifdef CONFIG_FSL_FIXED_MMC_LOCATION int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) { u8 *tmp_buf; @@ -61,3 +62,4 @@ int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) return 0; } +#endif diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h index 16db98f..4b5373c 100644 --- a/include/configs/MPC8536DS.h +++ b/include/configs/MPC8536DS.h @@ -659,6 +659,7 @@ #define CONFIG_ENV_SECT_SIZE 0x10000 #elif defined(CONFIG_RAMBOOT_SDCARD) #define CONFIG_ENV_IS_IN_MMC +#define CONFIG_FSL_FIXED_MMC_LOCATION #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MMC_ENV_DEV 0 #else diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h index af4609f..0a22a5c 100644 --- a/include/configs/P1010RDB.h +++ b/include/configs/P1010RDB.h @@ -609,6 +609,7 @@ extern unsigned long get_sdram_size(void); #if defined(CONFIG_SYS_RAMBOOT) #if defined(CONFIG_RAMBOOT_SDCARD) #define CONFIG_ENV_IS_IN_MMC +#define CONFIG_FSL_FIXED_MMC_LOCATION #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE 0x2000 #elif defined(CONFIG_RAMBOOT_SPIFLASH) diff --git a/include/configs/P1_P2_RDB.h b/include/configs/P1_P2_RDB.h index 00fa74d..29f016b 100644 --- a/include/configs/P1_P2_RDB.h +++ b/include/configs/P1_P2_RDB.h @@ -519,6 +519,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy); #define CONFIG_ENV_OFFSET ((512 * 1024) + CONFIG_SYS_NAND_BLOCK_SIZE) #elif defined(CONFIG_RAMBOOT_SDCARD) #define CONFIG_ENV_IS_IN_MMC +#define CONFIG_FSL_FIXED_MMC_LOCATION #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MMC_ENV_DEV 0 #elif defined(CONFIG_RAMBOOT_SPIFLASH) diff --git a/include/configs/P2020COME.h b/include/configs/P2020COME.h index cf20d2b..f3d1db0 100644 --- a/include/configs/P2020COME.h +++ b/include/configs/P2020COME.h @@ -350,6 +350,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy); */ #if defined(CONFIG_RAMBOOT_SDCARD) #define CONFIG_ENV_IS_IN_MMC 1 + #define CONFIG_FSL_FIXED_MMC_LOCATION #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MMC_ENV_DEV 0 #elif defined(CONFIG_RAMBOOT_SPIFLASH) diff --git a/include/configs/P2020DS.h b/include/configs/P2020DS.h index 2d9657a..2d9b916 100644 --- a/include/configs/P2020DS.h +++ b/include/configs/P2020DS.h @@ -596,6 +596,7 @@ */ #if defined(CONFIG_SDCARD) #define CONFIG_ENV_IS_IN_MMC +#define CONFIG_FSL_FIXED_MMC_LOCATION #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MMC_ENV_DEV 0 #elif defined(CONFIG_SPIFLASH) diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h index a48055e..3c04e89 100644 --- a/include/configs/P2041RDB.h +++ b/include/configs/P2041RDB.h @@ -92,6 +92,7 @@ #elif defined(CONFIG_SDCARD) #define CONFIG_SYS_EXTRA_ENV_RELOC #define CONFIG_ENV_IS_IN_MMC + #define CONFIG_FSL_FIXED_MMC_LOCATION #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_ENV_OFFSET (512 * 1097) diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h index 7925b95..613ca49 100644 --- a/include/configs/corenet_ds.h +++ b/include/configs/corenet_ds.h @@ -88,6 +88,7 @@ #elif defined(CONFIG_SDCARD) #define CONFIG_SYS_EXTRA_ENV_RELOC #define CONFIG_ENV_IS_IN_MMC +#define CONFIG_FSL_FIXED_MMC_LOCATION #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_ENV_OFFSET (512 * 1097) diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h index 8e8fa16..1b10475 100644 --- a/include/configs/p1_p2_rdb_pc.h +++ b/include/configs/p1_p2_rdb_pc.h @@ -733,6 +733,7 @@ #define CONFIG_ENV_SECT_SIZE 0x10000 #elif defined(CONFIG_RAMBOOT_SDCARD) #define CONFIG_ENV_IS_IN_MMC +#define CONFIG_FSL_FIXED_MMC_LOCATION #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MMC_ENV_DEV 0 #elif defined(CONFIG_NAND_U_BOOT)