]> git.sur5r.net Git - u-boot/commitdiff
Timer: Fix at91rm9200/spi.c timer usage
authorGraeme Russ <graeme.russ@gmail.com>
Fri, 15 Jul 2011 02:20:40 +0000 (02:20 +0000)
committerWolfgang Denk <wd@denx.de>
Tue, 26 Jul 2011 12:53:55 +0000 (14:53 +0200)
arch/arm/cpu/arm920t/at91rm9200/spi.c

index f3cb5d8c2c674fd784e375bc7dd7e9b962cec0e7..c70efc6abf4d8572d1da0eccccbcfb3e76515bb4 100644 (file)
@@ -108,6 +108,7 @@ void AT91F_SpiEnable(int cs)
 unsigned int AT91F_SpiWrite ( AT91PS_DataflashDesc pDesc )
 {
        unsigned int timeout;
+       unsigned long start;
 
        pDesc->state = BUSY;
 
@@ -132,12 +133,12 @@ unsigned int AT91F_SpiWrite ( AT91PS_DataflashDesc pDesc )
        }
 
        /* arm simple, non interrupt dependent timer */
-       reset_timer_masked();
+       start = get_timer(0);
        timeout = 0;
 
        AT91C_BASE_SPI->SPI_PTCR = AT91C_PDC_TXTEN + AT91C_PDC_RXTEN;
        while(!(AT91C_BASE_SPI->SPI_SR & AT91C_SPI_RXBUFF) &&
-               ((timeout = get_timer_masked() ) < CONFIG_SYS_SPI_WRITE_TOUT));
+               ((timeout = get_timer(start) ) < CONFIG_SYS_SPI_WRITE_TOUT));
        AT91C_BASE_SPI->SPI_PTCR = AT91C_PDC_TXTDIS + AT91C_PDC_RXTDIS;
        pDesc->state = IDLE;