All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] nand_spl: Define nand_select function
@ 2012-10-23 11:21 Vikram Narayanan
  2012-10-23 15:47 ` Tom Rini
  0 siblings, 1 reply; 4+ messages in thread
From: Vikram Narayanan @ 2012-10-23 11:21 UTC (permalink / raw)
  To: u-boot

Split up the selection of nand_chip from nand_init to a separate
function. This is just to make it a little consistent as we've
nand_deselect function.

Also use it in spl_nand_load_image function.

Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
Cc: Stefan Roese <sr@denx.de>
---
 common/spl/spl_nand.c              |    1 +
 drivers/mtd/nand/nand_spl_simple.c |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index 61de5a4..5ebeb38 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -34,6 +34,7 @@ void spl_nand_load_image(void)
 
 	debug("spl: nand - using hw ecc\n");
 	nand_init();
+	nand_select();
 
 	/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
 	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
diff --git a/drivers/mtd/nand/nand_spl_simple.c b/drivers/mtd/nand/nand_spl_simple.c
index 4a4d02f..77c56fc 100644
--- a/drivers/mtd/nand/nand_spl_simple.c
+++ b/drivers/mtd/nand/nand_spl_simple.c
@@ -270,12 +270,16 @@ void nand_init(void)
 		nand_chip.ecc.correct = nand_correct_data;
 	}
 #endif
+}
 
+/* Select before operation */
+void nand_select(void)
+{
 	if (nand_chip.select_chip)
 		nand_chip.select_chip(&mtd, 0);
 }
 
-/* Unselect after operation */
+/* Deselect after operation */
 void nand_deselect(void)
 {
 	if (nand_chip.select_chip)
-- 
1.7.4.1

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

* [U-Boot] [PATCH] nand_spl: Define nand_select function
  2012-10-23 11:21 [U-Boot] [PATCH] nand_spl: Define nand_select function Vikram Narayanan
@ 2012-10-23 15:47 ` Tom Rini
  2012-10-23 17:31   ` Vikram Narayanan
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Rini @ 2012-10-23 15:47 UTC (permalink / raw)
  To: u-boot

On Tue, Oct 23, 2012 at 04:51:05PM +0530, Vikram Narayanan wrote:

> Split up the selection of nand_chip from nand_init to a separate
> function. This is just to make it a little consistent as we've
> nand_deselect function.
> 
> Also use it in spl_nand_load_image function.
> 
> Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
> Cc: Stefan Roese <sr@denx.de>

What does this allow for us to do next?  We've added a few bytes to SPL
and we're already close to being too large sometimes.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121023/72742644/attachment.pgp>

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

* [U-Boot] [PATCH] nand_spl: Define nand_select function
  2012-10-23 15:47 ` Tom Rini
@ 2012-10-23 17:31   ` Vikram Narayanan
  2012-10-23 17:46     ` Tom Rini
  0 siblings, 1 reply; 4+ messages in thread
From: Vikram Narayanan @ 2012-10-23 17:31 UTC (permalink / raw)
  To: u-boot

On 10/23/2012 9:17 PM, Tom Rini wrote:
> On Tue, Oct 23, 2012 at 04:51:05PM +0530, Vikram Narayanan wrote:
>
>> Split up the selection of nand_chip from nand_init to a separate
>> function. This is just to make it a little consistent as we've
>> nand_deselect function.
>>
>> Also use it in spl_nand_load_image function.
>>
>> Signed-off-by: Vikram Narayanan<vikram186@gmail.com>
>> Cc: Stefan Roese<sr@denx.de>
>
> What does this allow for us to do next?  We've added a few bytes to SPL
> and we're already close to being too large sometimes.
>

Yep. 12 bytes added. If SPL is too much loaded to include this, the 
patch shall be dropped.

~Vikram

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

* [U-Boot] [PATCH] nand_spl: Define nand_select function
  2012-10-23 17:31   ` Vikram Narayanan
@ 2012-10-23 17:46     ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2012-10-23 17:46 UTC (permalink / raw)
  To: u-boot

On Tue, Oct 23, 2012 at 11:01:31PM +0530, Vikram Narayanan wrote:
> On 10/23/2012 9:17 PM, Tom Rini wrote:
> >On Tue, Oct 23, 2012 at 04:51:05PM +0530, Vikram Narayanan wrote:
> >
> >>Split up the selection of nand_chip from nand_init to a separate
> >>function. This is just to make it a little consistent as we've
> >>nand_deselect function.
> >>
> >>Also use it in spl_nand_load_image function.
> >>
> >>Signed-off-by: Vikram Narayanan<vikram186@gmail.com>
> >>Cc: Stefan Roese<sr@denx.de>
> >
> >What does this allow for us to do next?  We've added a few bytes to SPL
> >and we're already close to being too large sometimes.
> 
> Yep. 12 bytes added. If SPL is too much loaded to include this, the
> patch shall be dropped.

Since we're trying to squish down to 4kb and every byte counts, yes,
this might well be.  Thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121023/ad3e6057/attachment.pgp>

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

end of thread, other threads:[~2012-10-23 17:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-23 11:21 [U-Boot] [PATCH] nand_spl: Define nand_select function Vikram Narayanan
2012-10-23 15:47 ` Tom Rini
2012-10-23 17:31   ` Vikram Narayanan
2012-10-23 17:46     ` Tom Rini

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.