From owner-p4-projects@FreeBSD.ORG Wed Oct 4 23:04:48 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E497816A416; Wed, 4 Oct 2006 23:04:47 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9819716A40F for ; Wed, 4 Oct 2006 23:04:47 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C10B43D53 for ; Wed, 4 Oct 2006 23:04:47 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k94N4lpp038781 for ; Wed, 4 Oct 2006 23:04:47 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k94N4ltM038773 for perforce@freebsd.org; Wed, 4 Oct 2006 23:04:47 GMT (envelope-from imp@freebsd.org) Date: Wed, 4 Oct 2006 23:04:47 GMT Message-Id: <200610042304.k94N4ltM038773@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 107275 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2006 23:04:48 -0000 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)