Skip to contentSkip to conversation

nand_spl: Define nand_select function

PATCH New Vikram Narayanan 2 participants 4 messages Oct 23, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nand_spl: Define nand_select function

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.

---
 common/spl/spl_nand.c              |    1 +
 drivers/mtd/nand/nand_spl_simple.c |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletions(-)
common/spl/spl_nand.c +1 -0
index 61de5a4..5ebeb38 100644
@@ -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);
drivers/mtd/nand/nand_spl_simple.c +5 -1
index 4a4d02f..77c56fc 100644
@@ -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)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 nand_spl: Define nand_select function

Quoted 8 lines · Vikram Narayanan

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.

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.

Signature · 8 lines
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>
#2 lore raw

PATCH 1/1 nand_spl: Define nand_select function

Quoted 6 lines · Tom Rini
Quoted 4 lines · Vikram Narayanan

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.

Quoted 8 lines
Quoted 4 lines

Also use it in spl_nand_load_image function.

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

#3 lore raw

PATCH 1/1 nand_spl: Define nand_select function

Quoted 9 lines · Vikram Narayanan
Quoted 8 lines · Tom Rini
Quoted 6 lines · Vikram Narayanan

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.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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.

Signature · 8 lines
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>