From patchwork Fri Jan 20 13:43:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 137033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id CBDB41007D5 for ; Sat, 21 Jan 2012 00:50:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0A60028122; Fri, 20 Jan 2012 14:50:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HNDnsKZ4-Vs1; Fri, 20 Jan 2012 14:50:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9A8A32807D; Fri, 20 Jan 2012 14:50:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 05D0928345 for ; Fri, 20 Jan 2012 14:50:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zEEo0+FSLQfb for ; Fri, 20 Jan 2012 14:50:10 +0100 (CET) X-Greylist: delayed 399 seconds by postgrey-1.27 at theia; Fri, 20 Jan 2012 14:50:10 CET X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from oproxy6-pub.bluehost.com (oproxy6-pub.bluehost.com [67.222.54.6]) by theia.denx.de (Postfix) with SMTP id 3F8F92833C for ; Fri, 20 Jan 2012 14:50:10 +0100 (CET) Received: (qmail 2446 invoked by uid 0); 20 Jan 2012 13:43:29 -0000 Received: from unknown (HELO box284.bluehost.com) (69.89.31.84) by cpoproxy3.bluehost.com with SMTP; 20 Jan 2012 13:43:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=boundarydevices.com; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=ztffmJv6w7SO0MlYnITaTbDEMDixILXbk7l9wHlOD5o=; b=Y/E8pH/MU6nW1HuR3fDoN08+z19uIbnJ/hy0yQI02BiYrXL7oWhEMqOxJ/KlojPj6IJcQgpHVswrFXPW0qT4Hje6URUHdOZHVzYRZ3SFRvZ33C/gH/r5H5fSpdw0v6l4; Received: from ip68-230-116-166.ph.ph.cox.net ([68.230.116.166] helo=[192.168.0.141]) by box284.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RoEka-0001zY-Pt; Fri, 20 Jan 2012 06:43:28 -0700 Message-ID: <4F196F7F.4010400@boundarydevices.com> Date: Fri, 20 Jan 2012 06:43:27 -0700 From: Eric Nelson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Thunderbird/3.1.16 MIME-Version: 1.0 To: Jason Hui References: <1326838190-13746-1-git-send-email-eric.nelson@boundarydevices.com> <1326838190-13746-7-git-send-email-eric.nelson@boundarydevices.com> In-Reply-To: X-Identified-User: {1412:box284.bluehost.com:boundar4:boundarydevices.com} {sentby:smtp auth 68.230.116.166 authed with eric.nelson@boundarydevices.com} Cc: u-boot@lists.denx.de, dirk.behme@de.bosch.com Subject: Re: [U-Boot] [PATCH 6/6] mx6q: mx6qsabrelite: Provide defaults for placing environment in serial flash X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de On 01/19/2012 08:27 PM, Jason Hui wrote: > On Wed, Jan 18, 2012 at 6:09 AM, Eric Nelson > wrote: >> Signed-off-by: Eric Nelson >> --- >> 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 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 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