From fb1c43cc37ae45c6c0576d976a53b9222819691c Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 27 Feb 2017 18:22:03 +0100 Subject: common: Move environment choice to Kconfig The environment location is something that might change per board (depending on what storage options are availaible there) or depending on the user choice (when we have several options). Instead of hardcoding it in our configuration header, create a Kconfig choice with the options we use for now, and the symbols that depend on it. Once done, also remove the irrelevant sunxi defines. Signed-off-by: Maxime Ripard Reviewed-by: Tom Rini Reviewed-by: Jagan Teki --- include/configs/sunxi-common.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'include/configs/sunxi-common.h') diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 377ae00a7b..bebbe94088 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -134,7 +134,9 @@ /* mmc config */ #ifdef CONFIG_MMC #define CONFIG_MMC_SUNXI_SLOT 0 -#define CONFIG_ENV_IS_IN_MMC +#endif + +#if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 /* first detected MMC controller */ #define CONFIG_SYS_MMC_MAX_DEVICE 4 #endif @@ -164,9 +166,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 @@ -330,13 +329,6 @@ extern int soft_i2c_gpio_scl; #define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE #endif -#if !defined CONFIG_ENV_IS_IN_MMC && \ - !defined CONFIG_ENV_IS_IN_NAND && \ - !defined CONFIG_ENV_IS_IN_FAT && \ - !defined CONFIG_ENV_IS_IN_SPI_FLASH -#define CONFIG_ENV_IS_NOWHERE -#endif - #define CONFIG_MISC_INIT_R #ifndef CONFIG_SPL_BUILD -- cgit v1.2.1 From d482a8dfba417c6554f054ca74281d8d32384ed7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 27 Feb 2017 18:22:10 +0100 Subject: sunxi: Enable UBI and NAND support 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 Acked-by: Jagan Teki --- include/configs/sunxi-common.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/configs/sunxi-common.h') diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index bebbe94088..51815600d4 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -125,6 +125,9 @@ #define CONFIG_SYS_NAND_MAX_ECCPOS 1664 #define CONFIG_SYS_NAND_ONFI_DETECTION #define CONFIG_SYS_MAX_NAND_DEVICE 8 + +#define CONFIG_MTD_DEVICE +#define CONFIG_MTD_PARTITIONS #endif #ifdef CONFIG_SPL_SPI_SUNXI -- cgit v1.2.1 From c8564b24ab4862ca07d4b054cd2cdecfc22c43a9 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 27 Feb 2017 18:22:11 +0100 Subject: sunxi: Add the default mtdids and mtdparts to our env In order for the user to be able to see and modify them, add those variables to the default environment. Signed-off-by: Maxime Ripard Reviewed-by: Tom Rini Reviewed-by: Jagan Teki --- include/configs/sunxi-common.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/configs/sunxi-common.h') diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 51815600d4..e1c5fe7ea8 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -461,6 +461,20 @@ extern int soft_i2c_gpio_scl; "stderr=serial\0" #endif +#ifdef CONFIG_MTDIDS_DEFAULT +#define SUNXI_MTDIDS_DEFAULT \ + "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" +#else +#define SUNXI_MTDIDS_DEFAULT +#endif + +#ifdef CONFIG_MTDPARTS_DEFAULT +#define SUNXI_MTDPARTS_DEFAULT \ + "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" +#else +#define SUNXI_MTDPARTS_DEFAULT +#endif + #define CONSOLE_ENV_SETTINGS \ CONSOLE_STDIN_SETTINGS \ CONSOLE_STDOUT_SETTINGS @@ -471,6 +485,8 @@ extern int soft_i2c_gpio_scl; DFU_ALT_INFO_RAM \ "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ "console=ttyS0,115200\0" \ + SUNXI_MTDIDS_DEFAULT \ + SUNXI_MTDPARTS_DEFAULT \ BOOTCMD_SUNXI_COMPAT \ BOOTENV -- cgit v1.2.1 From d6a7e0cbe30d4493283b559a6e5f655e127649f2 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 20 Mar 2017 15:57:22 +0100 Subject: sunxi: Add default environment size On boards that defines ENV_IS_NOWHERE, such as the NES classic, commit 19dbe7d1a3f7 ("common: Move environment choice to Kconfig") broke the build because of a missing environment size. Reintroduce a default environment size consistent with what we had before. Signed-off-by: Maxime Ripard --- include/configs/sunxi-common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/configs/sunxi-common.h') diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index e1c5fe7ea8..171cea24ec 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -142,6 +142,8 @@ #if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 /* first detected MMC controller */ #define CONFIG_SYS_MMC_MAX_DEVICE 4 +#elif defined(CONFIG_ENV_IS_NOWHERE) +#define CONFIG_ENV_SIZE (128 << 10) #endif /* 64MB of malloc() pool */ -- cgit v1.2.1