From owner-p4-projects@FreeBSD.ORG Thu Aug 10 23:05:33 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 D051016A4E7; Thu, 10 Aug 2006 23:05:32 +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 7610916A4E0 for ; Thu, 10 Aug 2006 23:05:32 +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 BBFCD43D53 for ; Thu, 10 Aug 2006 23:05:31 +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 k7AN5VnO078673 for ; Thu, 10 Aug 2006 23:05:31 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7AN5VlG078670 for perforce@freebsd.org; Thu, 10 Aug 2006 23:05:31 GMT (envelope-from imp@freebsd.org) Date: Thu, 10 Aug 2006 23:05:31 GMT Message-Id: <200608102305.k7AN5VlG078670@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 103615 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: Thu, 10 Aug 2006 23:05:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=103615 Change 103615 by imp@imp_lighthouse on 2006/08/10 23:05:13 More dead code elimination. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/sd-card.c#7 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/sd-card.c#7 (text+ko) ==== @@ -21,8 +21,6 @@ #define AT91C_MCI_TIMEOUT 1000000 /* For AT91F_MCIDeviceWaitReady */ #define BUFFER_SIZE_MCI_DEVICE 512 #define MASTER_CLOCK 60000000 -#define FALSE -1 -#define TRUE 1 //Private functions //static void initInts(void); @@ -252,77 +250,6 @@ } -#if 0 -//*---------------------------------------------------------------------------- -//* \fn AT91F_Test_SDCard -//* \brief Configure MCI for SDCard and complete SDCard init, then jump to Test Functions -//*---------------------------------------------------------------------------- -static int AT91F_Test_SDCard(void) -{ - ////////////////////////////////////////////////////////// - //* For SDCard Init - ////////////////////////////////////////////////////////// - - AT91F_MCI_Configure(AT91C_BASE_MCI, - AT91C_MCI_DTOR_1MEGA_CYCLES, - AT91C_MCI_MR_PDCMODE, // 15MHz for MCK = 60MHz (CLKDIV = 1) - AT91C_MCI_SDCARD_4BITS_SLOTA); - - if(AT91F_MCI_SDCard_Init(&MCI_Device) != AT91C_INIT_OK) - return FALSE; - - printf("\r\n Memory_Capacity : %x", - MCI_Device.pMCI_DeviceFeatures->Memory_Capacity); - - printf("\r\n Sector_Size : %x", - MCI_Device.pMCI_DeviceFeatures->Sector_Size); - - printf("\r\n Max_Read_DataBlock_Length : %x", - MCI_Device.pMCI_DeviceFeatures->Max_Read_DataBlock_Length); - - printf("\r\n Max_Write_DataBlock_Length : %x", - MCI_Device.pMCI_DeviceFeatures->Max_Write_DataBlock_Length); - - printf("\r\n Read_Partial : %x", - MCI_Device.pMCI_DeviceFeatures->Read_Partial); - - printf("\r\n Write_Partial : %x", - MCI_Device.pMCI_DeviceFeatures->Write_Partial); - - printf("\r\nSDCard Initialisation Successful: Enter Test\r\n"); - - // Enter Main Tests - return(AT91F_Test()); -} - -static void initInts() -{ - // Init Interrupt Controller - AT91F_AIC_Open( - AT91C_BASE_AIC, // pointer to the AIC registers - AT91C_AIC_BRANCH_OPCODE, // IRQ exception vector - AT91F_UndefHandler, // FIQ exception vector - AT91F_UndefHandler, // AIC default handler - AT91F_SpuriousHandler, // AIC spurious handler - 0); // Protect mode - - // Perform 8 End Of Interrupt Command to make sure AIC will not Lock out nIRQ - AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC); - AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC); - AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC); - AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC); - AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC); - AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC); - AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC); - AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC); - - AT91F_AIC_SetExceptionVector((unsigned int *)0x0C, AT91F_FetchAbort); - AT91F_AIC_SetExceptionVector((unsigned int *)0x10, AT91F_DataAbort); - AT91F_AIC_SetExceptionVector((unsigned int *)0x4, AT91F_Undef); - -} -#endif - static void AT91F_MCI_Handler(void) { int status; @@ -376,6 +303,6 @@ AT91C_MCI_SDCARD_4BITS_SLOTA); if(AT91F_MCI_SDCard_Init(&MCI_Device) != AT91C_INIT_OK) - return FALSE; - return TRUE; + return 0; + return 1; }