public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Eric Nelson <eric.nelson@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 6/6] mx6q: mx6qsabrelite: Provide defaults for placing environment in serial flash
Date: Fri, 20 Jan 2012 06:43:27 -0700	[thread overview]
Message-ID: <4F196F7F.4010400@boundarydevices.com> (raw)
In-Reply-To: <CAFQ4atRiDDGoEmodOiAn9M45AQGSSkVzt7+ckeyW=8cYfki6ag@mail.gmail.com>


On 01/19/2012 08:27 PM, Jason Hui wrote:
> On Wed, Jan 18, 2012 at 6:09 AM, Eric Nelson
> <eric.nelson@boundarydevices.com>  wrote:
>> Signed-off-by: Eric Nelson<eric.nelson@boundarydevices.com>
>> ---
>>   include/configs/mx6qsabrelite.h |   12 +++++++++++-
>>   1 files changed, 11 insertions(+), 1 deletions(-)
>>
>> diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h
>> index 44b028a..160894c 100644
>> --- a/include/configs/mx6qsabrelite.h
>> +++ b/include/configs/mx6qsabrelite.h
>> @@ -174,10 +174,20 @@
>>   /* FLASH and environment organization */
>>   #define CONFIG_SYS_NO_FLASH
>>
>> -#define CONFIG_ENV_OFFSET              (6 * 64 * 1024)
>>   #define CONFIG_ENV_SIZE                        (8 * 1024)
>> +
>>   #define CONFIG_ENV_IS_IN_MMC
>> +/* #define CONFIG_ENV_IS_IN_SPI_FLASH */
>
> From the commit log, it says the default is in serial flash, but
> apparently in the code the env is default to MMC, which mismatch.
 > please fix it.
>

You're asking that I change the comment not the default, right?

>> +
>> +#if defined(CONFIG_ENV_IS_IN_MMC)
>> +#define CONFIG_ENV_OFFSET              (6 * 64 * 1024)
>>   #define CONFIG_SYS_MMC_ENV_DEV         0
>> +#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
>> +#define CONFIG_ENV_OFFSET              (768 * 1024)
>> +#define CONFIG_ENV_SECT_SIZE           (8 * 1024)
>> +#define CONFIG_ENV_SPI_CS              0x5300
>
> I'm wondering how the CONFIG_ENV_SPI_CS  could be 0x5300? Vague?
>

Please review the updated patch below and see whether the
expanded commit message fixes things.

Regards,


Eric
commit 0443433bf80c5203a8ce67fb4faaf4032e398e1d
Author: Eric Nelson <eric.nelson@boundarydevices.com>
Date:   Tue Jan 17 14:11:54 2012 -0700

     mx6q: mx6qsabrelite: Provide macros for environment in serial flash

     The default settings store the persistent environment on SD card
     and not serial flash (SPI NOR).

     To use SPI NOR to save the environment instead of SD card, edit
     include/configs/mx6qsabrelite.h and

         - undefine CONFIG_ENV_IS_IN_MMC
         - define   CONFIG_ENV_IS_IN_SPI_FLASH

     Note that the mxc_spi driver (drivers/spi/mxc_spi.c) uses the
     Chip-Select variable (CONFIG_ENV_SPI_CS) to allow the use of
     a GPIO if the chip-select is greater than 3. The low 8-bits
     set the chip select number and bits 8-15 set the GPIO number.

     The GPIO used on Sabre Lite is GP3:19 == 83.

     Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>

diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h
index e34f108..024a94c 100644
--- a/include/configs/mx6qsabrelite.h
+++ b/include/configs/mx6qsabrelite.h
@@ -174,10 +174,20 @@
  /* FLASH and environment organization */
  #define CONFIG_SYS_NO_FLASH

-#define CONFIG_ENV_OFFSET		(6 * 64 * 1024)
  #define CONFIG_ENV_SIZE			(8 * 1024)
+
  #define CONFIG_ENV_IS_IN_MMC
+/* #define CONFIG_ENV_IS_IN_SPI_FLASH */
+
+#if defined(CONFIG_ENV_IS_IN_MMC)
+#define CONFIG_ENV_OFFSET		(6 * 64 * 1024)
  #define CONFIG_SYS_MMC_ENV_DEV		0
+#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
+#define CONFIG_ENV_OFFSET		(768 * 1024)
+#define CONFIG_ENV_SECT_SIZE		(8 * 1024)
+#define CONFIG_ENV_SPI_CS		(0|(83<<8))
+#define CONFIG_ENV_SPI_MODE		SPI_MODE_0
+#endif

  #define CONFIG_OF_LIBFDT

  parent reply	other threads:[~2012-01-20 13:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17 22:09 [U-Boot] mxc_spi refactoring (for mx6q) Eric Nelson
2012-01-17 22:09 ` [U-Boot] [PATCH 1/6] mxc_spi: move machine specifics into CPU headers Eric Nelson
2012-01-17 22:09 ` [U-Boot] [PATCH 2/6] mx6q: Add support for ECSPI through mxc_spi driver Eric Nelson
2012-01-17 23:19   ` Marek Vasut
2012-01-18  0:36     ` Eric Nelson
2012-01-18  1:27       ` Marek Vasut
2012-01-18  1:44         ` Eric Nelson
2012-01-18  1:47           ` Marek Vasut
2012-01-18  2:02             ` Eric Nelson
2012-01-18  8:39           ` Stefano Babic
2012-01-18 16:08             ` Marek Vasut
2012-01-18 16:41               ` Stefano Babic
2012-01-18 20:05             ` Eric Nelson
2012-01-19 10:33               ` Stefano Babic
2012-01-17 22:09 ` [U-Boot] [PATCH 3/6] mx6q: mx6qsabrelite: Add ECSPI support to the Sabrelite platform Eric Nelson
2012-01-17 22:09 ` [U-Boot] [PATCH 4/6] sf command: allow default chip select through CONFIG_SPI_FLASH_CS Eric Nelson
2012-01-17 22:09 ` [U-Boot] [PATCH 5/6] mx6q: mx6qsabrelite: Provide default chip-select for serial flash Eric Nelson
2012-01-17 22:09 ` [U-Boot] [PATCH 6/6] mx6q: mx6qsabrelite: Provide defaults for placing environment in " Eric Nelson
2012-01-20  3:27   ` Jason Hui
2012-01-20  7:06     ` Dirk Behme
2012-01-20  7:48       ` Jason Hui
2012-01-20  8:47         ` Stefano Babic
2012-01-20 13:47           ` Eric Nelson
2012-01-20 13:43     ` Eric Nelson [this message]
2012-01-17 23:16 ` [U-Boot] mxc_spi refactoring (for mx6q) Marek Vasut
2012-01-18 11:51 ` Dirk Behme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F196F7F.4010400@boundarydevices.com \
    --to=eric.nelson@boundarydevices.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox