All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] mmc: meson: switch mmc slot order and allow to store environment in eMMC
@ 2017-04-14  8:22 Heiner Kallweit
  2017-04-14  8:24 ` [U-Boot] [PATCH 1/2] arm: dts: odroid-c2: assign mmc device number 0 to eMMC slot Heiner Kallweit
  2017-04-14  8:26 ` [U-Boot] [PATCH 2/2] odroid-c2: support storing the uboot environment in eMMC Heiner Kallweit
  0 siblings, 2 replies; 8+ messages in thread
From: Heiner Kallweit @ 2017-04-14  8:22 UTC (permalink / raw)
  To: u-boot

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(-)

-- 
2.12.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/2] arm: dts: odroid-c2: assign mmc device number 0 to eMMC slot
  2017-04-14  8:22 [U-Boot] mmc: meson: switch mmc slot order and allow to store environment in eMMC Heiner Kallweit
@ 2017-04-14  8:24 ` Heiner Kallweit
  2017-04-14 13:39   ` Andreas Färber
  2017-04-14  8:26 ` [U-Boot] [PATCH 2/2] odroid-c2: support storing the uboot environment in eMMC Heiner Kallweit
  1 sibling, 1 reply; 8+ messages in thread
From: Heiner Kallweit @ 2017-04-14  8:24 UTC (permalink / raw)
  To: u-boot

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 {
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/2] odroid-c2: support storing the uboot environment in eMMC
  2017-04-14  8:22 [U-Boot] mmc: meson: switch mmc slot order and allow to store environment in eMMC Heiner Kallweit
  2017-04-14  8:24 ` [U-Boot] [PATCH 1/2] arm: dts: odroid-c2: assign mmc device number 0 to eMMC slot Heiner Kallweit
@ 2017-04-14  8:26 ` Heiner Kallweit
  2017-04-14 13:40   ` Andreas Färber
  1 sibling, 1 reply; 8+ messages in thread
From: Heiner Kallweit @ 2017-04-14  8:26 UTC (permalink / raw)
  To: u-boot

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
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/2] arm: dts: odroid-c2: assign mmc device number 0 to eMMC slot
  2017-04-14  8:24 ` [U-Boot] [PATCH 1/2] arm: dts: odroid-c2: assign mmc device number 0 to eMMC slot Heiner Kallweit
@ 2017-04-14 13:39   ` Andreas Färber
  2017-04-14 15:52     ` Heiner Kallweit
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Färber @ 2017-04-14 13:39 UTC (permalink / raw)
  To: u-boot

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 {
> 


-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/2] odroid-c2: support storing the uboot environment in eMMC
  2017-04-14  8:26 ` [U-Boot] [PATCH 2/2] odroid-c2: support storing the uboot environment in eMMC Heiner Kallweit
@ 2017-04-14 13:40   ` Andreas Färber
  2017-04-14 15:48     ` Heiner Kallweit
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Färber @ 2017-04-14 13:40 UTC (permalink / raw)
  To: u-boot

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
> 


-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/2] odroid-c2: support storing the uboot environment in eMMC
  2017-04-14 13:40   ` Andreas Färber
@ 2017-04-14 15:48     ` Heiner Kallweit
  0 siblings, 0 replies; 8+ messages in thread
From: Heiner Kallweit @ 2017-04-14 15:48 UTC (permalink / raw)
  To: u-boot

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
>>
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/2] arm: dts: odroid-c2: assign mmc device number 0 to eMMC slot
  2017-04-14 13:39   ` Andreas Färber
@ 2017-04-14 15:52     ` Heiner Kallweit
  2017-04-15 18:52       ` Andreas Färber
  0 siblings, 1 reply; 8+ messages in thread
From: Heiner Kallweit @ 2017-04-14 15:52 UTC (permalink / raw)
  To: u-boot

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 {
>>
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/2] arm: dts: odroid-c2: assign mmc device number 0 to eMMC slot
  2017-04-14 15:52     ` Heiner Kallweit
@ 2017-04-15 18:52       ` Andreas Färber
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Färber @ 2017-04-15 18:52 UTC (permalink / raw)
  To: u-boot

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

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-15 18:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-14  8:22 [U-Boot] mmc: meson: switch mmc slot order and allow to store environment in eMMC Heiner Kallweit
2017-04-14  8:24 ` [U-Boot] [PATCH 1/2] arm: dts: odroid-c2: assign mmc device number 0 to eMMC slot Heiner Kallweit
2017-04-14 13:39   ` Andreas Färber
2017-04-14 15:52     ` Heiner Kallweit
2017-04-15 18:52       ` Andreas Färber
2017-04-14  8:26 ` [U-Boot] [PATCH 2/2] odroid-c2: support storing the uboot environment in eMMC Heiner Kallweit
2017-04-14 13:40   ` Andreas Färber
2017-04-14 15:48     ` Heiner Kallweit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.