From patchwork Sat Mar 12 22:48:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Rae X-Patchwork-Id: 596684 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 3qMzjf2bzJz9s5w for ; Sun, 13 Mar 2016 09:49:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8FF48A770E; Sat, 12 Mar 2016 23:49:53 +0100 (CET) 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 O7Q2bnKnb5nm; Sat, 12 Mar 2016 23:49:53 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E912BA76FF; Sat, 12 Mar 2016 23:49:52 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B865BA76FA for ; Sat, 12 Mar 2016 23:49:49 +0100 (CET) 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 qzF9zLk97sEI for ; Sat, 12 Mar 2016 23:49:49 +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-gw3-out.broadcom.com (mail-gw3-out.broadcom.com [216.31.210.64]) by theia.denx.de (Postfix) with ESMTP id 13A51A76DE for ; Sat, 12 Mar 2016 23:49:48 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.24,327,1455004800"; d="scan'208";a="89932767" Received: from mail-irv-18.broadcom.com ([10.15.198.37]) by mail-gw3-out.broadcom.com with ESMTP; 12 Mar 2016 14:55:43 -0800 Received: from mail-irva-13.broadcom.com (mail-irva-13.broadcom.com [10.11.16.103]) by mail-irv-18.broadcom.com (Postfix) with ESMTP id 1036F82022; Sat, 12 Mar 2016 14:49:48 -0800 (PST) Received: from VM-host64-64-A1.ric.broadcom.com (unknown [10.136.4.105]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 5050C40FE5; Sat, 12 Mar 2016 14:49:27 -0800 (PST) From: Steve Rae To: u-boot@lists.denx.de, Scott Wood Date: Sat, 12 Mar 2016 14:48:07 -0800 Message-Id: <1457822887-32123-4-git-send-email-srae@broadcom.com> X-Mailer: git-send-email 1.8.5 In-Reply-To: <1457822887-32123-1-git-send-email-srae@broadcom.com> References: <1457822887-32123-1-git-send-email-srae@broadcom.com> Cc: Steve Rae , Tom Rini , Scott Wood , Joe Hershberger , Jiandong Zheng Subject: [U-Boot] [RFC PATCH v3 4/4] arm: bcm: configure NAND device and environment 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Configure the NAND device, define partition sizes, and create the environment space for Cygnus and NSP boards. Signed-off-by: Steve Rae --- Changes in v3: None Changes in v2: None arch/arm/include/asm/arch-bcmcygnus/configs.h | 33 +++++++++++++++++++++++++++ arch/arm/include/asm/arch-bcmnsp/configs.h | 33 +++++++++++++++++++++++++++ include/configs/bcm_ep_board.h | 3 --- 3 files changed, 66 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/arch-bcmcygnus/configs.h b/arch/arm/include/asm/arch-bcmcygnus/configs.h index 1edcbd7..cf19ffb 100644 --- a/arch/arm/include/asm/arch-bcmcygnus/configs.h +++ b/arch/arm/include/asm/arch-bcmcygnus/configs.h @@ -31,6 +31,39 @@ #define CONFIG_CMD_PING #define CONFIG_CMD_MII +/* Configuration for Micron MT29F8G08ABACA */ +#define CONFIG_NAND_CHIPSIZE (1 << 30) /* 1GB */ +#define CONFIG_NAND_BLOCKSIZE (1 << 18) /* 256KB */ +#define CONFIG_NAND_PAGE_SHIFT 12 /* 4KiB */ +#define CONFIG_NAND_BLOCK_SHIFT 18 /* 256 KiB */ + +/* Configure the Environment and the u-boot-env partition */ +#define MTD_PART_BOOT1_SIZE 0x00200000 +#define MTD_PART_GPT_SIZE 0x00100000 +#define MTD_PART_SSB_SIZE 0x00200000 +#define MTD_PART_UBOOT_SIZE 0x00200000 +#define MTD_PART_UBOOT_ENV_SIZE 0x00200000 +#define MTD_PART_DTB_SIZE 0x00100000 +#define MTD_PART_KERNEL_SIZE 0x01000000 +#define MTD_PART_ROOT_SIZE 0x1c000000 +/* + * WARNING: When changing the order of the partitions, make sure you update + * CONFIG_ENV_OFFSET accordingly. + */ +#define CONFIG_ENV_IS_IN_NAND +#define CONFIG_ENV_SIZE 0x2000 +#define CONFIG_ENV_RANGE (2 * CONFIG_NAND_BLOCKSIZE) +#define CONFIG_ENV_OFFSET (MTD_PART_BOOT1_SIZE + MTD_PART_GPT_SIZE + \ + MTD_PART_SSB_SIZE + MTD_PART_UBOOT_SIZE) +#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE) +/* + * Check that the u-boot-env partition is big enough to accomodate the + * u-boot environment data and its redundant copy + */ +#if ((2 * CONFIG_ENV_RANGE) > MTD_PART_UBOOT_ENV_SIZE) +#error u-boot-env partition size is to small +#endif + /* MTD configuration */ #define CONFIG_MTD_DEVICE #define CONFIG_MTD_PARTITIONS diff --git a/arch/arm/include/asm/arch-bcmnsp/configs.h b/arch/arm/include/asm/arch-bcmnsp/configs.h index ec326b3..cf2e086 100644 --- a/arch/arm/include/asm/arch-bcmnsp/configs.h +++ b/arch/arm/include/asm/arch-bcmnsp/configs.h @@ -17,6 +17,39 @@ #define CONFIG_CONS_INDEX 1 #define CONFIG_SYS_NS16550_COM1 0x18000300 +/* Configuration for Micron MT29F8G08ABACA */ +#define CONFIG_NAND_CHIPSIZE (1 << 30) /* 1GB */ +#define CONFIG_NAND_BLOCKSIZE (1 << 18) /* 256KB */ +#define CONFIG_NAND_PAGE_SHIFT 12 /* 4KiB */ +#define CONFIG_NAND_BLOCK_SHIFT 18 /* 256 KiB */ + +/* Configure the Environment and the u-boot-env partition */ +#define MTD_PART_BOOT1_SIZE 0x00200000 +#define MTD_PART_GPT_SIZE 0x00100000 +#define MTD_PART_SSB_SIZE 0x00200000 +#define MTD_PART_UBOOT_SIZE 0x00200000 +#define MTD_PART_UBOOT_ENV_SIZE 0x00200000 +#define MTD_PART_DTB_SIZE 0x00100000 +#define MTD_PART_KERNEL_SIZE 0x01000000 +#define MTD_PART_ROOT_SIZE 0x0c000000 +/* + * WARNING: When changing the order of the partitions, make sure you update + * CONFIG_ENV_OFFSET accordingly. + */ +#define CONFIG_ENV_IS_IN_NAND +#define CONFIG_ENV_SIZE 0x2000 +#define CONFIG_ENV_RANGE (2 * CONFIG_NAND_BLOCKSIZE) +#define CONFIG_ENV_OFFSET (MTD_PART_BOOT1_SIZE + MTD_PART_GPT_SIZE + \ + MTD_PART_SSB_SIZE + MTD_PART_UBOOT_SIZE) +#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE) +/* + * Check that the u-boot-env partition is big enough to accomodate the + * u-boot environment data and its redundant copy + */ +#if ((2 * CONFIG_ENV_RANGE) > MTD_PART_UBOOT_ENV_SIZE) +#error u-boot-env partition size is to small +#endif + /* MTD configuration */ #define CONFIG_MTD_DEVICE #define CONFIG_MTD_PARTITIONS diff --git a/include/configs/bcm_ep_board.h b/include/configs/bcm_ep_board.h index 1d4869b..fe97a40 100644 --- a/include/configs/bcm_ep_board.h +++ b/include/configs/bcm_ep_board.h @@ -50,9 +50,6 @@ #define CONFIG_BAUDRATE 115200 -#define CONFIG_ENV_SIZE 0x2000 -#define CONFIG_ENV_IS_NOWHERE - #define CONFIG_SYS_NO_FLASH /* Not using NAND/NOR unmanaged flash */ /* console configuration */