public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH-OMAP3] OMAP3: Check for MMC card
@ 2008-12-06  7:00 Dirk Behme
  2008-12-06 16:37 ` Jason Kridner
  2008-12-06 17:46 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 4+ messages in thread
From: Dirk Behme @ 2008-12-06  7:00 UTC (permalink / raw)
  To: u-boot

mmc_init was always returning success -- now returns failure if
no card is present.

Signed-off-by: Steve Sakoman <sakoman@gmail.com>
Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>

---

* This patch applies on top of last 5 pending OMAP3 patches (in this order):

http://lists.denx.de/pipermail/u-boot/2008-November/043771.html
http://lists.denx.de/pipermail/u-boot/2008-November/043898.html
http://lists.denx.de/pipermail/u-boot/2008-November/043899.html
http://lists.denx.de/pipermail/u-boot/2008-November/044026.html
http://lists.denx.de/pipermail/u-boot/2008-November/044027.html

* Compile tested for Beagle, Overo, Panora and EVM. Boot tested on Beagle.

 drivers/mmc/omap3_mmc.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

Index: u-boot-arm/drivers/mmc/omap3_mmc.c
===================================================================
--- u-boot-arm.orig/drivers/mmc/omap3_mmc.c
+++ u-boot-arm/drivers/mmc/omap3_mmc.c
@@ -523,22 +523,22 @@ unsigned long mmc_bread(int dev_num, uns
 
 int mmc_init(int verbose)
 {
-	configure_mmc(&cur_card_data);
-
-	mmc_blk_dev.if_type = IF_TYPE_MMC;
-	mmc_blk_dev.part_type = PART_TYPE_DOS;
-	mmc_blk_dev.dev = 0;
-	mmc_blk_dev.lun = 0;
-	mmc_blk_dev.type = 0;
-
-	/* FIXME fill in the correct size (is set to 32MByte) */
-	mmc_blk_dev.blksz = MMCSD_SECTOR_SIZE;
-	mmc_blk_dev.lba = 0x10000;
-	mmc_blk_dev.removable = 0;
-	mmc_blk_dev.block_read = mmc_bread;
-
-	fat_register_device(&mmc_blk_dev, 1);
-	return 0;
+	if (configure_mmc(&cur_card_data) == 1) {
+		mmc_blk_dev.if_type = IF_TYPE_MMC;
+		mmc_blk_dev.part_type = PART_TYPE_DOS;
+		mmc_blk_dev.dev = 0;
+		mmc_blk_dev.lun = 0;
+		mmc_blk_dev.type = 0;
+
+		/* FIXME fill in the correct size (is set to 32MByte) */
+		mmc_blk_dev.blksz = MMCSD_SECTOR_SIZE;
+		mmc_blk_dev.lba = 0x10000;
+		mmc_blk_dev.removable = 0;
+		mmc_blk_dev.block_read = mmc_bread;
+
+		fat_register_device(&mmc_blk_dev, 1);
+		return 0;
+	} else return 1;
 }
 
 int mmc_read(ulong src, uchar *dst, int size)

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

* [U-Boot] [PATCH-OMAP3] OMAP3: Check for MMC card
  2008-12-06  7:00 [U-Boot] [PATCH-OMAP3] OMAP3: Check for MMC card Dirk Behme
@ 2008-12-06 16:37 ` Jason Kridner
  2008-12-06 17:46 ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 0 replies; 4+ messages in thread
From: Jason Kridner @ 2008-12-06 16:37 UTC (permalink / raw)
  To: u-boot

I've run u-boot with all of these patches and see it working well on  
Beagle.

On Dec 6, 2008, at 1:00 AM, Dirk Behme wrote:

> mmc_init was always returning success -- now returns failure if
> no card is present.
>
> Signed-off-by: Steve Sakoman <sakoman@gmail.com>
> Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
>
> ---
>
> * This patch applies on top of last 5 pending OMAP3 patches (in this  
> order):
>
> http://lists.denx.de/pipermail/u-boot/2008-November/043771.html
> http://lists.denx.de/pipermail/u-boot/2008-November/043898.html
> http://lists.denx.de/pipermail/u-boot/2008-November/043899.html
> http://lists.denx.de/pipermail/u-boot/2008-November/044026.html
> http://lists.denx.de/pipermail/u-boot/2008-November/044027.html
>
> * Compile tested for Beagle, Overo, Panora and EVM. Boot tested on  
> Beagle.
>
> drivers/mmc/omap3_mmc.c |   32 ++++++++++++++++----------------
> 1 files changed, 16 insertions(+), 16 deletions(-)
>
> Index: u-boot-arm/drivers/mmc/omap3_mmc.c
> ===================================================================
> --- u-boot-arm.orig/drivers/mmc/omap3_mmc.c
> +++ u-boot-arm/drivers/mmc/omap3_mmc.c
> @@ -523,22 +523,22 @@ unsigned long mmc_bread(int dev_num, uns
>
> int mmc_init(int verbose)
> {
> -	configure_mmc(&cur_card_data);
> -
> -	mmc_blk_dev.if_type = IF_TYPE_MMC;
> -	mmc_blk_dev.part_type = PART_TYPE_DOS;
> -	mmc_blk_dev.dev = 0;
> -	mmc_blk_dev.lun = 0;
> -	mmc_blk_dev.type = 0;
> -
> -	/* FIXME fill in the correct size (is set to 32MByte) */
> -	mmc_blk_dev.blksz = MMCSD_SECTOR_SIZE;
> -	mmc_blk_dev.lba = 0x10000;
> -	mmc_blk_dev.removable = 0;
> -	mmc_blk_dev.block_read = mmc_bread;
> -
> -	fat_register_device(&mmc_blk_dev, 1);
> -	return 0;
> +	if (configure_mmc(&cur_card_data) == 1) {
> +		mmc_blk_dev.if_type = IF_TYPE_MMC;
> +		mmc_blk_dev.part_type = PART_TYPE_DOS;
> +		mmc_blk_dev.dev = 0;
> +		mmc_blk_dev.lun = 0;
> +		mmc_blk_dev.type = 0;
> +
> +		/* FIXME fill in the correct size (is set to 32MByte) */
> +		mmc_blk_dev.blksz = MMCSD_SECTOR_SIZE;
> +		mmc_blk_dev.lba = 0x10000;
> +		mmc_blk_dev.removable = 0;
> +		mmc_blk_dev.block_read = mmc_bread;
> +
> +		fat_register_device(&mmc_blk_dev, 1);
> +		return 0;
> +	} else return 1;
> }
>
> int mmc_read(ulong src, uchar *dst, int size)
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

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

* [U-Boot] [PATCH-OMAP3] OMAP3: Check for MMC card
  2008-12-06  7:00 [U-Boot] [PATCH-OMAP3] OMAP3: Check for MMC card Dirk Behme
  2008-12-06 16:37 ` Jason Kridner
@ 2008-12-06 17:46 ` Jean-Christophe PLAGNIOL-VILLARD
  2008-12-07 16:46   ` Dirk Behme
  1 sibling, 1 reply; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-12-06 17:46 UTC (permalink / raw)
  To: u-boot

> -	fat_register_device(&mmc_blk_dev, 1);
> -	return 0;
> +	if (configure_mmc(&cur_card_data) == 1) {
> +		mmc_blk_dev.if_type = IF_TYPE_MMC;
> +		mmc_blk_dev.part_type = PART_TYPE_DOS;
> +		mmc_blk_dev.dev = 0;
> +		mmc_blk_dev.lun = 0;
> +		mmc_blk_dev.type = 0;
> +
> +		/* FIXME fill in the correct size (is set to 32MByte) */
> +		mmc_blk_dev.blksz = MMCSD_SECTOR_SIZE;
> +		mmc_blk_dev.lba = 0x10000;
> +		mmc_blk_dev.removable = 0;
> +		mmc_blk_dev.block_read = mmc_bread;
> +
> +		fat_register_device(&mmc_blk_dev, 1);
> +		return 0;
> +	} else return 1;
please use
	} else {
		return 1;
	}

just return 1;

Best Regards,
J.

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

* [U-Boot] [PATCH-OMAP3] OMAP3: Check for MMC card
  2008-12-06 17:46 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2008-12-07 16:46   ` Dirk Behme
  0 siblings, 0 replies; 4+ messages in thread
From: Dirk Behme @ 2008-12-07 16:46 UTC (permalink / raw)
  To: u-boot

Jean-Christophe PLAGNIOL-VILLARD wrote:
>>-	fat_register_device(&mmc_blk_dev, 1);
>>-	return 0;
>>+	if (configure_mmc(&cur_card_data) == 1) {
>>+		mmc_blk_dev.if_type = IF_TYPE_MMC;
>>+		mmc_blk_dev.part_type = PART_TYPE_DOS;
>>+		mmc_blk_dev.dev = 0;
>>+		mmc_blk_dev.lun = 0;
>>+		mmc_blk_dev.type = 0;
>>+
>>+		/* FIXME fill in the correct size (is set to 32MByte) */
>>+		mmc_blk_dev.blksz = MMCSD_SECTOR_SIZE;
>>+		mmc_blk_dev.lba = 0x10000;
>>+		mmc_blk_dev.removable = 0;
>>+		mmc_blk_dev.block_read = mmc_bread;
>>+
>>+		fat_register_device(&mmc_blk_dev, 1);
>>+		return 0;
>>+	} else return 1;
> 
> please use
> 	} else {
> 		return 1;
> 	}
> 
> just return 1;

This and all other pending OMAP3 patches:

http://www.sakoman.net/cgi-bin/gitweb.cgi?p=u-boot-arm.git;a=shortlog;h=refs/heads/omap3-j24

Many thanks to Steve for this!

Best regards

Dirk

Btw.: I heard doing this took ~3min ;)

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

end of thread, other threads:[~2008-12-07 16:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-06  7:00 [U-Boot] [PATCH-OMAP3] OMAP3: Check for MMC card Dirk Behme
2008-12-06 16:37 ` Jason Kridner
2008-12-06 17:46 ` Jean-Christophe PLAGNIOL-VILLARD
2008-12-07 16:46   ` Dirk Behme

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