Date: Thu, 4 May 2006 20:01:18 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96664 for review Message-ID: <200605042001.k44K1IAV069903@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96664 Change 96664 by imp@imp_hammer on 2006/05/04 20:00:28 Slim down by about 160 bytes: a little better code and eliminate the get ID command, since it is unused. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.c#10 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.c#10 (text+ko) ==== @@ -73,14 +73,10 @@ static char GetFlashStatus(void) { - + p_memset((char *)&spi_command, 0, sizeof(spi_command)); p_memset(tx_commandBuffer, 0, 8); tx_commandBuffer[0] = STATUS_REGISTER_READ; p_memset(rx_commandBuffer, 0, 8); - spi_command.tx_data_size = 0; - spi_command.tx_data = 0; - spi_command.rx_data_size = 0; - spi_command.rx_data = 0; spi_command.tx_cmd = tx_commandBuffer; spi_command.rx_cmd = rx_commandBuffer; spi_command.rx_cmd_size = 2; @@ -89,26 +85,6 @@ return (rx_commandBuffer[1]); } -void -SPI_GetId(unsigned *id) -{ - - p_memset(tx_commandBuffer, 0, 8); - tx_commandBuffer[0] = 0x9f; - p_memset(rx_commandBuffer, 0, 8); - spi_command.tx_data_size = 0; - spi_command.tx_data = 0; - spi_command.rx_data_size = 0; - spi_command.rx_data = 0; - spi_command.tx_cmd = tx_commandBuffer; - spi_command.rx_cmd = rx_commandBuffer; - spi_command.rx_cmd_size = 5; - spi_command.tx_cmd_size = 5; - SendCommand(&spi_command); - *id = rx_commandBuffer[1] | (rx_commandBuffer[2] << 8) | - (rx_commandBuffer[3] << 16); -} - /* * .KB_C_FN_DEFINITION_START * void WaitForDeviceReady(void)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605042001.k44K1IAV069903>