[U-Boot] mmc: meson: switch mmc slot order and allow to store environment in eMMC

In most cases Odroid C2 is used with a eMMC card. So far the eMMC slot was assigned dev number 1 (0 is the SD slot). So on uboot prompt we had to manually switch the mmc device first. Therefore change the device number assignment. Thanks to Jaehoon for the hint how to do it.
In addition allow to store the uboot environment in eMMC.
Heiner Kallweit (2): arm: dts: odroid-c2: assign mmc device number 0 to eMMC slot odroid-c2: support storing the uboot environment in eMMC
arch/arm/dts/meson-gxbb-odroidc2.dts | 2 ++ include/configs/meson-gxbb-common.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-)

In most cases Odroid C2 is used with a eMMC card. So far the eMMC slot was assigned dev number 1 (0 is the SD slot). So on uboot prompt we had to manually switch the mmc device first. Therefore change the device number assignment.
Signed-off-by: Heiner Kallweit hkallweit1@gmail.com --- arch/arm/dts/meson-gxbb-odroidc2.dts | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/meson-gxbb-odroidc2.dts b/arch/arm/dts/meson-gxbb-odroidc2.dts index c737183..5ec67ca 100644 --- a/arch/arm/dts/meson-gxbb-odroidc2.dts +++ b/arch/arm/dts/meson-gxbb-odroidc2.dts @@ -53,6 +53,8 @@
aliases { serial0 = &uart_AO; + mmc0 = &sd_emmc_c; + mmc1 = &sd_emmc_b; };
chosen {

Am 14.04.2017 um 10:24 schrieb Heiner Kallweit:
In most cases Odroid C2 is used with a eMMC card. So far the eMMC slot was assigned dev number 1 (0 is the SD slot). So on uboot prompt
U-Boot
we had to manually switch the mmc device first. Therefore change the device number assignment.
Objection, this differs from Linux and will be overwritten on next dts sync.
Regards, Andreas
Signed-off-by: Heiner Kallweit hkallweit1@gmail.com
arch/arm/dts/meson-gxbb-odroidc2.dts | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/meson-gxbb-odroidc2.dts b/arch/arm/dts/meson-gxbb-odroidc2.dts index c737183..5ec67ca 100644 --- a/arch/arm/dts/meson-gxbb-odroidc2.dts +++ b/arch/arm/dts/meson-gxbb-odroidc2.dts @@ -53,6 +53,8 @@
aliases { serial0 = &uart_AO;
mmc0 = &sd_emmc_c;
mmc1 = &sd_emmc_b;
};
chosen {

Am 14.04.2017 um 15:39 schrieb Andreas Färber:
Am 14.04.2017 um 10:24 schrieb Heiner Kallweit:
In most cases Odroid C2 is used with a eMMC card. So far the eMMC slot was assigned dev number 1 (0 is the SD slot). So on uboot prompt
U-Boot
we had to manually switch the mmc device first. Therefore change the device number assignment.
Objection, this differs from Linux and will be overwritten on next dts sync.
That's true .. From my perspective best solution would be if U-Boot wouldn't assign a device id at all to a SD slot w/o card inserted. However it seems like the current mmc core doesn't support this.
Rgds, Heiner
Regards, Andreas
Signed-off-by: Heiner Kallweit hkallweit1@gmail.com
arch/arm/dts/meson-gxbb-odroidc2.dts | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/meson-gxbb-odroidc2.dts b/arch/arm/dts/meson-gxbb-odroidc2.dts index c737183..5ec67ca 100644 --- a/arch/arm/dts/meson-gxbb-odroidc2.dts +++ b/arch/arm/dts/meson-gxbb-odroidc2.dts @@ -53,6 +53,8 @@
aliases { serial0 = &uart_AO;
mmc0 = &sd_emmc_c;
mmc1 = &sd_emmc_b;
};
chosen {

Am 14.04.2017 um 17:52 schrieb Heiner Kallweit:
Am 14.04.2017 um 15:39 schrieb Andreas Färber:
Am 14.04.2017 um 10:24 schrieb Heiner Kallweit:
In most cases Odroid C2 is used with a eMMC card. So far the eMMC slot was assigned dev number 1 (0 is the SD slot). So on uboot prompt
U-Boot
we had to manually switch the mmc device first. Therefore change the device number assignment.
Objection, this differs from Linux and will be overwritten on next dts sync.
That's true .. From my perspective best solution would be if U-Boot wouldn't assign a device id at all to a SD slot w/o card inserted. However it seems like the current mmc core doesn't support this.
It is perfectly valid to not have an SD card in the slot and then to run "mmc rescan" after inserting one. So the device should definitely not be hidden.
Regards, Andreas

Support storing uboot environment in eMMC.
Signed-off-by: Heiner Kallweit hkallweit1@gmail.com --- include/configs/meson-gxbb-common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/configs/meson-gxbb-common.h b/include/configs/meson-gxbb-common.h index cc2b5b6..5951263 100644 --- a/include/configs/meson-gxbb-common.h +++ b/include/configs/meson-gxbb-common.h @@ -11,8 +11,10 @@ #define CONFIG_CPU_ARMV8 #define CONFIG_REMAKE_ELF #define CONFIG_NR_DRAM_BANKS 1 -#define CONFIG_ENV_IS_NOWHERE 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE 0x2000 +#define CONFIG_ENV_OFFSET (SZ_1M - CONFIG_ENV_SIZE) #define CONFIG_SYS_MAXARGS 32 #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024

Am 14.04.2017 um 10:26 schrieb Heiner Kallweit:
Support storing uboot environment in eMMC.
Signed-off-by: Heiner Kallweit hkallweit1@gmail.com
include/configs/meson-gxbb-common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/configs/meson-gxbb-common.h b/include/configs/meson-gxbb-common.h index cc2b5b6..5951263 100644 --- a/include/configs/meson-gxbb-common.h +++ b/include/configs/meson-gxbb-common.h @@ -11,8 +11,10 @@ #define CONFIG_CPU_ARMV8 #define CONFIG_REMAKE_ELF #define CONFIG_NR_DRAM_BANKS 1 -#define CONFIG_ENV_IS_NOWHERE 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0
Apart from relying on the modified device order, have you tested this without eMMC?
Regards, Andreas
#define CONFIG_ENV_SIZE 0x2000 +#define CONFIG_ENV_OFFSET (SZ_1M - CONFIG_ENV_SIZE) #define CONFIG_SYS_MAXARGS 32 #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024

Am 14.04.2017 um 15:40 schrieb Andreas Färber:
Am 14.04.2017 um 10:26 schrieb Heiner Kallweit:
Support storing uboot environment in eMMC.
Signed-off-by: Heiner Kallweit hkallweit1@gmail.com
include/configs/meson-gxbb-common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/configs/meson-gxbb-common.h b/include/configs/meson-gxbb-common.h index cc2b5b6..5951263 100644 --- a/include/configs/meson-gxbb-common.h +++ b/include/configs/meson-gxbb-common.h @@ -11,8 +11,10 @@ #define CONFIG_CPU_ARMV8 #define CONFIG_REMAKE_ELF #define CONFIG_NR_DRAM_BANKS 1 -#define CONFIG_ENV_IS_NOWHERE 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0
Apart from relying on the modified device order, have you tested this without eMMC?
For testing I switched CONFIG_SYS_MMC_ENV_DEV to another number. U-Boot complained about the non-existing device and used the compiled-in default environment. I didn't test storing environment on SD card.
Rgds, Heiner
Regards, Andreas
#define CONFIG_ENV_SIZE 0x2000 +#define CONFIG_ENV_OFFSET (SZ_1M - CONFIG_ENV_SIZE) #define CONFIG_SYS_MAXARGS 32 #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024
participants (2)
-
Andreas Färber
-
Heiner Kallweit