From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Date: Tue, 8 Nov 2016 17:27:04 +0100 Subject: [U-Boot] [PATCH 3/7] sunxi: Enable UBI and NAND support In-Reply-To: <6c44b7aa93af6ffd76d4d0bee5713f087e082c62.1478621974.git-series.maxime.ripard@free-electrons.com> References: <6c44b7aa93af6ffd76d4d0bee5713f087e082c62.1478621974.git-series.maxime.ripard@free-electrons.com> Message-ID: <20161108172704.4faed4e2@bbrezillon> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 8 Nov 2016 17:21:13 +0100 Maxime Ripard wrote: > From: Hans de Goede > > Enable the NAND and UBI support in the configuration header so that we can > (finally) use it. > > Signed-off-by: Hans de Goede > Signed-off-by: Maxime Ripard > --- > include/configs/sunxi-common.h | 26 ++++++++++++++++++++++---- > 1 file changed, 22 insertions(+), 4 deletions(-) > > diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h > index 8363414828fa..1733767ba53b 100644 > --- a/include/configs/sunxi-common.h > +++ b/include/configs/sunxi-common.h > @@ -129,9 +129,23 @@ > #define CONFIG_SERIAL_TAG > > #ifdef CONFIG_NAND_SUNXI > +#define CONFIG_SYS_NAND_U_BOOT_OFFS (8 << 20) /* 8 MiB */ > #define CONFIG_SYS_NAND_MAX_ECCPOS 1664 > #define CONFIG_SYS_NAND_ONFI_DETECTION > #define CONFIG_SYS_MAX_NAND_DEVICE 8 > + > +/* Requirements for UBI */ > +#define CONFIG_RBTREE > +#define CONFIG_LZO > +#define CONFIG_CMD_MTDPARTS > +#define CONFIG_CMD_UBI > +#define CONFIG_CMD_UBIFS > +#define CONFIG_MTD_DEVICE > + > +#define CONFIG_MTD_PARTITIONS > + > +#define CONFIG_CMD_NAND > +#define CONFIG_CMD_NAND_TRIMFFS > #endif > > #ifdef CONFIG_SPL_SPI_SUNXI > @@ -143,7 +157,14 @@ > #define CONFIG_GENERIC_MMC > #define CONFIG_MMC_SUNXI > #define CONFIG_MMC_SUNXI_SLOT 0 > -#define CONFIG_ENV_IS_IN_MMC > +#endif > + > +#if defined(CONFIG_ENV_IS_IN_NAND) > +#define CONFIG_ENV_OFFSET 0xc00000 > +#define CONFIG_ENV_SIZE 0x400000 > +#elif defined(CONFIG_ENV_IS_IN_MMC) > +#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ > +#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ > #define CONFIG_SYS_MMC_ENV_DEV 0 /* first detected MMC controller */ > #endif > > @@ -175,9 +196,6 @@ > > #define CONFIG_SYS_MONITOR_LEN (768 << 10) /* 768 KiB */ > > -#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ > -#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ > - > #define CONFIG_FAT_WRITE /* enable write access */ > > #define CONFIG_SPL_FRAMEWORK