Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Oct 2006 23:04:47 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 107275 for review
Message-ID:  <200610042304.k94N4ltM038773@repoman.freebsd.org>

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

Change 107275 by imp@imp_lighthouse on 2006/10/04 23:03:50

	30MHz works too, you know...  Use it instead.  Don't know why 15MHz
	was selected, nor why Linux limits the speed to 25MHz.
	
	This shaves 2s off the boot time.

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/at91/libat91/sd-card.c#11 edit

Differences ...

==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/sd-card.c#11 (text+ko) ====

@@ -83,7 +83,6 @@
 	}
 	while( !(status & AT91C_MCI_NOTBUSY)  && (timeout>0) );	
 
-	//TODO: Make interrupts work!
 	AT91F_MCI_Handler();
 }
 
@@ -96,35 +95,6 @@
 	AT91S_MCIDeviceStatus status;
 	int sizeToWrite;
 
-	//See if we are requested to write partial sectors, and have the capability to do so
-	if ((length % sectorLength) && !(MCI_Device_Features.Write_Partial))
-		//Return error if appropriat
-		return MCI_UNSUPP_SIZE_ERROR;
-
-	//See if we are requested to write to anywhere but a sectors' boundary
-	//and have the capability to do so
-	if ((offset) && !(MCI_Device_Features.Write_Partial))
-		//Return error if appropriat
-		return MCI_UNSUPP_OFFSET_ERROR;
-
-	//If the address we're trying to write != sector boundary
-	if (offset)
-	{
-		//* Wait MCI Device Ready
-		AT91F_MCIDeviceWaitReady(AT91C_MCI_TIMEOUT);
-
-		//Calculate the nr of bytes to write
-		sizeToWrite = sectorLength - offset;
-		//Do the writing
-		status = AT91F_MCI_WriteBlock(&MCI_Device, dest, (unsigned int*)source, sizeToWrite);
-		//TODO:Status checking
-
-		//Update counters & pointers
-		length -= sizeToWrite;
-		dest += sizeToWrite;
-		source += sizeToWrite;
-	}
-
 	//As long as there is data to write
 	while (length)
 	{
@@ -257,7 +227,7 @@
 
 	AT91F_MCI_Configure(AT91C_BASE_MCI,
 	    AT91C_MCI_DTOR_1MEGA_CYCLES,
-	    AT91C_MCI_MR_PDCMODE,			// 15MHz for MCK = 60MHz (CLKDIV = 1)
+	    AT91C_MCI_PDCMODE,
 	    AT91C_MCI_SDCARD_4BITS_SLOTA);
 	
 	if (AT91F_MCI_SDCard_Init(&MCI_Device) != AT91C_INIT_OK)



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