public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ARM: socfpga: Enable saveenv for SD/MMC
@ 2015-09-15 19:47 dinguyen at opensource.altera.com
  2015-09-15 20:22 ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: dinguyen at opensource.altera.com @ 2015-09-15 19:47 UTC (permalink / raw)
  To: u-boot

From: Dinh Nguyen <dinguyen@opensource.altera.com>

Enable the able to save the environment variables when SD/MMC is used.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
---
 include/configs/socfpga_common.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 38ae763..f6a79ad 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -160,6 +160,9 @@
 /* FIXME */
 /* using smaller max blk cnt to avoid flooding the limited stack we have */
 #define CONFIG_SYS_MMC_MAX_BLK_COUNT	256	/* FIXME -- SPL only? */
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		0	/* device 0 */
+#define CONFIG_ENV_OFFSET		512	/* just after the MBR */
 #endif
 
 /*
@@ -282,7 +285,9 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
 #define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
+#if !defined CONFIG_ENV_IS_IN_MMC
 #define CONFIG_ENV_IS_NOWHERE
+#endif
 #define CONFIG_ENV_SIZE			4096
 
 /*
-- 
2.4.5

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

* [U-Boot] [PATCH] ARM: socfpga: Enable saveenv for SD/MMC
  2015-09-15 19:47 [U-Boot] [PATCH] ARM: socfpga: Enable saveenv for SD/MMC dinguyen at opensource.altera.com
@ 2015-09-15 20:22 ` Marek Vasut
  2015-09-15 21:48   ` Dinh Nguyen
  2015-09-16  6:57   ` Pavel Machek
  0 siblings, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2015-09-15 20:22 UTC (permalink / raw)
  To: u-boot

On Tuesday, September 15, 2015 at 09:47:23 PM, dinguyen at opensource.altera.com 
wrote:
> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> 
> Enable the able to save the environment variables when SD/MMC is used.
> 
> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>

Hi,

this should be done per-board, so I'd suggest the following:
1) Rename include/configs/socfpga_cyclone5.h to socfpga_cyclone5_socdk.h
   (to make it in-line with the naming in boards/altera/ , sorry, I forgot
    about this bit :( You'd also have to fix the MAINTAINERS file to match
    the adjusted filename).
2) Rename socfpga_arria5.h to socfpga_arria5_socdk.h
3) Enable this for both boards in socfpga_*_socdk.h

Can you do that please ?

Thanks!

> ---
>  include/configs/socfpga_common.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/configs/socfpga_common.h
> b/include/configs/socfpga_common.h index 38ae763..f6a79ad 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -160,6 +160,9 @@
>  /* FIXME */
>  /* using smaller max blk cnt to avoid flooding the limited stack we have
> */ #define CONFIG_SYS_MMC_MAX_BLK_COUNT	256	/* FIXME -- SPL only? */
> +#define CONFIG_ENV_IS_IN_MMC
> +#define CONFIG_SYS_MMC_ENV_DEV		0	/* device 0 */
> +#define CONFIG_ENV_OFFSET		512	/* just after the MBR */
>  #endif
> 
>  /*
> @@ -282,7 +285,9 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
>  #define CONFIG_SYS_CONSOLE_IS_IN_ENV
>  #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
>  #define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
> +#if !defined CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_ENV_IS_NOWHERE
> +#endif
>  #define CONFIG_ENV_SIZE			4096
> 
>  /*

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH] ARM: socfpga: Enable saveenv for SD/MMC
  2015-09-15 20:22 ` Marek Vasut
@ 2015-09-15 21:48   ` Dinh Nguyen
  2015-09-15 22:48     ` Marek Vasut
  2015-09-16  6:57   ` Pavel Machek
  1 sibling, 1 reply; 6+ messages in thread
From: Dinh Nguyen @ 2015-09-15 21:48 UTC (permalink / raw)
  To: u-boot

On 09/15/2015 03:22 PM, Marek Vasut wrote:
> On Tuesday, September 15, 2015 at 09:47:23 PM, dinguyen at opensource.altera.com 
> wrote:
>> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>>
>> Enable the able to save the environment variables when SD/MMC is used.
>>
>> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> 
> Hi,
> 
> this should be done per-board, so I'd suggest the following:
> 1) Rename include/configs/socfpga_cyclone5.h to socfpga_cyclone5_socdk.h
>    (to make it in-line with the naming in boards/altera/ , sorry, I forgot
>     about this bit :( You'd also have to fix the MAINTAINERS file to match
>     the adjusted filename).
> 2) Rename socfpga_arria5.h to socfpga_arria5_socdk.h
> 3) Enable this for both boards in socfpga_*_socdk.h
> 
> Can you do that please ?
>

Yes, I can do that.

Dinh

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

* [U-Boot] [PATCH] ARM: socfpga: Enable saveenv for SD/MMC
  2015-09-15 21:48   ` Dinh Nguyen
@ 2015-09-15 22:48     ` Marek Vasut
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2015-09-15 22:48 UTC (permalink / raw)
  To: u-boot

On Tuesday, September 15, 2015 at 11:48:53 PM, Dinh Nguyen wrote:
> On 09/15/2015 03:22 PM, Marek Vasut wrote:
> > On Tuesday, September 15, 2015 at 09:47:23 PM,
> > dinguyen at opensource.altera.com
> > 
> > wrote:
> >> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> >> 
> >> Enable the able to save the environment variables when SD/MMC is used.
> >> 
> >> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> > 
> > Hi,
> > 
> > this should be done per-board, so I'd suggest the following:
> > 1) Rename include/configs/socfpga_cyclone5.h to socfpga_cyclone5_socdk.h
> > 
> >    (to make it in-line with the naming in boards/altera/ , sorry, I
> >    forgot
> >    
> >     about this bit :( You'd also have to fix the MAINTAINERS file to
> >     match the adjusted filename).
> > 
> > 2) Rename socfpga_arria5.h to socfpga_arria5_socdk.h
> > 3) Enable this for both boards in socfpga_*_socdk.h
> > 
> > Can you do that please ?
> 
> Yes, I can do that.

Thanks!

btw when doing the rename of the files, use git format-patch -M -C ,
this will only mark the move in the patch, without doing the removal
and insertion of a file, so the diff will be shorter while retaining
all the information.

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH] ARM: socfpga: Enable saveenv for SD/MMC
  2015-09-15 20:22 ` Marek Vasut
  2015-09-15 21:48   ` Dinh Nguyen
@ 2015-09-16  6:57   ` Pavel Machek
  2015-09-16  6:59     ` Stefan Roese
  1 sibling, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2015-09-16  6:57 UTC (permalink / raw)
  To: u-boot

On Tue 2015-09-15 22:22:33, Marek Vasut wrote:
> On Tuesday, September 15, 2015 at 09:47:23 PM, dinguyen at opensource.altera.com 
> wrote:
> > From: Dinh Nguyen <dinguyen@opensource.altera.com>
> > 
> > Enable the able to save the environment variables when SD/MMC is used.
> > 
> > Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> 
> Hi,
> 
> this should be done per-board, so I'd suggest the following:

Why? MMC layout is same on all of them...

> >  #define CONFIG_ENV_SIZE			4096

While you are changing that, bigger environment size would be
welcome. 32K?
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* [U-Boot] [PATCH] ARM: socfpga: Enable saveenv for SD/MMC
  2015-09-16  6:57   ` Pavel Machek
@ 2015-09-16  6:59     ` Stefan Roese
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2015-09-16  6:59 UTC (permalink / raw)
  To: u-boot

On 16.09.2015 08:57, Pavel Machek wrote:
> On Tue 2015-09-15 22:22:33, Marek Vasut wrote:
>> On Tuesday, September 15, 2015 at 09:47:23 PM, dinguyen at opensource.altera.com
>> wrote:
>>> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>>>
>>> Enable the able to save the environment variables when SD/MMC is used.
>>>
>>> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
>>
>> Hi,
>>
>> this should be done per-board, so I'd suggest the following:
>
> Why? MMC layout is same on all of them...

It doesn't have to be identical. And other boards might want to use e.g. 
SPI NOR as the environment storage device (I have such a custom board 
here). So this is definitely a board specific thing.

>>>   #define CONFIG_ENV_SIZE			4096
>
> While you are changing that, bigger environment size would be
> welcome. 32K?

Yes.

Thanks,
Stefan

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

end of thread, other threads:[~2015-09-16  6:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-15 19:47 [U-Boot] [PATCH] ARM: socfpga: Enable saveenv for SD/MMC dinguyen at opensource.altera.com
2015-09-15 20:22 ` Marek Vasut
2015-09-15 21:48   ` Dinh Nguyen
2015-09-15 22:48     ` Marek Vasut
2015-09-16  6:57   ` Pavel Machek
2015-09-16  6:59     ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox