Date: Thu, 10 Aug 2006 23:05:31 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 103615 for review Message-ID: <200608102305.k7AN5VlG078670@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608102305.k7AN5VlG078670>