PERFORCE change 107030 for review

Warner Losh imp at FreeBSD.org
Sat Sep 30 22:45:31 PDT 2006


http://perforce.freebsd.org/chv.cgi?CH=107030

Change 107030 by imp at imp_lighthouse on 2006/10/01 05:45:06

	For each SD card we find, add it to the device tree.

Affected files ...

.. //depot/projects/arm/src/sys/dev/mmc/mmc.c#12 edit

Differences ...

==== //depot/projects/arm/src/sys/dev/mmc/mmc.c#12 (text+ko) ====

@@ -452,6 +452,7 @@
 	struct mmc_ivars *ivar;
 	int err;
 	uint32_t resp;
+	device_t child;
 
 	while (1) {
 		ivar = malloc(sizeof(struct mmc_ivars), M_DEVBUF, M_WAITOK);
@@ -471,6 +472,8 @@
 			mmc_send_csd(sc, ivar->rca, ivar->raw_csd);
 			mmc_decode_csd(1, ivar->raw_csd, &ivar->csd);
 			printf("SD CARD: %lld bytes\n", ivar->csd.capacity);
+			child = device_add_child(sc->dev, NULL, -1);
+			device_set_ivars(child, ivar);
 			break;
 		}
 		panic("Write MMC card code here");
@@ -523,13 +526,15 @@
 
 	mmcbr_set_bus_mode(dev, pushpull);
 	mmcbr_update_ios(dev);
+	bus_generic_attach(dev);
+//	mmc_update_children_sysctl(dev);
 }
 
 static int
 mmc_calculate_clock(struct mmc_softc *sc)
 {
-	// XXX write me
-	return 0;
+    // xxx
+    return 0;
 }
 
 static void


More information about the p4-projects mailing list