Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Sep 2006 18:09:10 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 106108 for review
Message-ID:  <200609141809.k8EI9AwH049578@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=106108

Change 106108 by imp@imp_lighthouse on 2006/09/14 18:08:18

	debugging checkpoint

Affected files ...

.. //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#10 edit

Differences ...

==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#10 (text+ko) ====

@@ -76,7 +76,6 @@
 		uint32_t sector_size;
 		uint64_t size;
 		uint32_t mode;
-		uint32_t rca;		/* Relative Card Address */
 		uint32_t flags;
 #define READ_PARTIAL	0x001
 #define WRITE_PARTIAL	0x002
@@ -160,10 +159,10 @@
 	struct at91_qdmmc_softc *sc = device_get_softc(dev);
 
 	// Send the CMD55 for application specific command
-	WR4(sc, MCI_ARGR, sc->cards[0].rca << 16);
+	WR4(sc, MCI_ARGR, sc->cards[0].addr << 16);
 	WR4(sc, MCI_CMDR, APP_CMD);
 
-	printf("CMD55: %x\n", sc->cards[0].rca << 16);
+	printf("CMD55: %x\n", sc->cards[0].addr << 16);
 
 	// wait for CMDRDY Status flag to read the response
 	do
@@ -195,7 +194,7 @@
 
 	// The RCA to be used for CMD55 in Idle state shall be the card's
 	// default RCA=0x0000.
-	sc->cards[0].rca = 0;
+	sc->cards[0].addr = 0;
  	while(!(response & AT91C_CARD_POWER_UP_BUSY)) {
 		response = at91_qdmmc_SDCard_SendAppCommand(dev,
 		    SDCARD_APP_OP_COND_CMD, AT91C_MMC_HOST_VOLTAGE_RANGE);
@@ -259,7 +258,7 @@
 	uint32_t ret_value, rca;
 	char bus_width;
 
-	rca = sc->cards[0].rca;
+	rca = sc->cards[0].addr;
 	do {
 		ret_value = at91_qdmmc_GetStatus(dev, rca);
 	} while (ret_value != 0xffffffff &&
@@ -300,13 +299,14 @@
 		printf("SD: Can't set RCA to 0\n");
 		return ENXIO;
 	}
-	sc->cards[0].rca = RD4(sc, MCI_RSPR) >> 16;
+	sc->cards[0].addr = RD4(sc, MCI_RSPR) >> 16;
+	printf("SD Card at %#x\n", sc->cards[0].addr);
 	csd = &sc->cards[0].CSD[0];
-	if (at91_qdmmc_GetCSD(dev, sc->cards[0].rca, csd) != 0) {
+	if (at91_qdmmc_GetCSD(dev, sc->cards[0].addr, csd) != 0) {
 		printf("SD: can't get csd\n");
 		return ENXIO;
 	}
-	printf("Found SD Card - CID = 0x%08x%08x%08x%08x\n",
+	printf("SD Card - CID = 0x%08x%08x%08x%08x\n",
 	    cid[0],
 	    cid[1],
 	    cid[2],
@@ -702,7 +702,7 @@
 	//printf("at91_qdmmc_strategy: called\n");
 	sc = (struct at91_qdmmc_softc *)bp->bio_disk->d_drv1;
 
-#if 0
+#if 1
 	AT91_QDMMC_LOCK(sc);
 	bioq_disksort(&sc->cards[0].bio_queue, bp);
 	wakeup(sc);
@@ -733,8 +733,8 @@
 		printf("at91_qdmmc_task: request %p\n", bp);
 		if (bp->bio_cmd == BIO_READ) {
 			status = at91_qdmmc_SendCommand(sc->dev,
-			    SEL_DESEL_CARD_CMD, (sc->cards[0].addr) << 16);
-			printf("at91_qdmmc_task: select_card-status = 0x%x\n", status);
+			    SEL_DESEL_CARD_CMD, sc->cards[0].addr << 16);
+			printf("at91_qdmmc_task: select_card-status(%x) = 0x%x\n", sc->cards[0].addr, status);
 			status = at91_qdmmc_SendCommand(sc->dev,
 			    SET_BLOCKLEN_CMD, sc->cards[0].sector_size);
 			printf("at91_qdmmc_task: set_blocklen-status = 0x%x\n", status);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609141809.k8EI9AwH049578>