From: Steve Rae Date: Sat, 12 Mar 2016 14:48:07 -0800 Subject: [U-Boot] [RFC PATCH v3 4/4] arm: bcm: configure NAND device and environment In-Reply-To: <1457822887-32123-1-git-send-email-srae@broadcom.com> References: <1457822887-32123-1-git-send-email-srae@broadcom.com> Message-ID: <1457822887-32123-4-git-send-email-srae@broadcom.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 */ -- 1.8.5