Changeset 12287


Ignore:
Timestamp:
06/12/09 17:23:08 (4 years ago)
Author:
BrainSlayer
Message:

should fix the reset button factory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ar5315_microredboot/microredboot/boot/src/misc_lzma.c

    r12281 r12287  
    186186static unsigned int sectorsize = 0x10000; 
    187187static unsigned int linuxaddr = 0xbfc10000; 
     188/* 
     189 * searches for a directory entry named linux* vmlinux* or kernel and returns its flash address (it also initializes entrypoint and load address) 
     190 */ 
    188191unsigned int getLinux(void) 
    189192{ 
     
    267270static int getGPIO(int nr) 
    268271{ 
    269         unsigned int *gpio = (unsigned int *)AR2316_GPIO_DI; 
     272        volatile unsigned int *gpio = (unsigned int *)AR2316_GPIO_DI; 
    270273        if ((*gpio & 1 << nr) == (1 << nr)) 
    271274                return 1; 
     
    273276} 
    274277 
     278/* 
     279 * checks if the reset button is pressed, return 1 if the button is pressed and 0 if not 
     280 */ 
    275281static int resetTouched(void) 
    276282{ 
    277 /*puts("gpio 5:"); 
    278 print_hex(getGPIO(5)); 
    279 puts("\r\n"); 
    280 puts("gpio 6:"); 
    281 print_hex(getGPIO(6)); 
    282 puts("\r\n"); 
    283 puts("gpio 7:"); 
    284 print_hex(getGPIO(7)); 
    285 puts("\r\n"); 
    286 */ 
    287283        int trigger = getGPIO(RESETBUTTON & 0x0f); 
    288284        if (RESETBUTTON & 0xf0) 
     
    333329MACRO_END 
    334330 
     331/* 
     332 *  
     333 */ 
    335334static void delay_us(int us) 
    336335{ 
     
    629628                        break; 
    630629                } 
    631                 delay_us(20); 
     630                delay_us(200000); 
    632631                spiflash_sendcmd(STM_OP_WR_ENABLE, 0); 
    633632        } while (1); 
     
    661660                        if (!resetTouched()) // check if reset button is unpressed again 
    662661                                break; 
    663                         delay_us(1000); 
     662                        delay_us(1000000); 
    664663                } 
    665664                if (!count) { 
     
    700699                regtmp = sysRegRead(AR2316_RESET); 
    701700                sysRegWrite(AR2316_RESET, regtmp | mask); 
    702                 delay_us(10); 
     701                delay_us(10000); 
    703702 
    704703                regtmp = sysRegRead(AR2316_RESET); 
    705704                sysRegWrite(AR2316_RESET, regtmp & ~mask); 
    706                 delay_us(10); 
     705                delay_us(10000); 
    707706 
    708707                regtmp = sysRegRead(AR2316_IF_CTL); 
Note: See TracChangeset for help on using the changeset viewer.