Changeset 33570


Ignore:
Timestamp:
2012-09-27T12:18:14+02:00 (5 years ago)
Author:
juhosg
Message:

ramips: allow to use custom code for memory size detection

Location:
trunk/target/linux/ramips/files/arch/mips
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/common.h

    r30888 r33570  
    1515extern unsigned long ramips_mem_size_min; 
    1616extern unsigned long ramips_mem_size_max; 
     17extern unsigned long (*ramips_get_mem_size)(void); 
    1718 
    1819void ramips_intc_irq_init(unsigned intc_base, unsigned irq, unsigned irq_base); 
  • trunk/target/linux/ramips/files/arch/mips/ralink/common/setup.c

    r30888 r33570  
    2222 
    2323unsigned char ramips_sys_type[RAMIPS_SYS_TYPE_LEN]; 
     24unsigned long (*ramips_get_mem_size)(void); 
    2425 
    2526const char *get_system_type(void) 
     
    3132{ 
    3233        unsigned long size; 
    33         void *base; 
    3434 
    35         base = (void *) KSEG1ADDR(detect_mem_size); 
    36         for (size = ramips_mem_size_min; size < ramips_mem_size_max; 
    37              size <<= 1 ) { 
    38                 if (!memcmp(base, base + size, 1024)) 
    39                         break; 
     35        if (ramips_get_mem_size) { 
     36                size = ramips_get_mem_size(); 
     37        } else { 
     38                void *base; 
     39 
     40                base = (void *) KSEG1ADDR(detect_mem_size); 
     41                for (size = ramips_mem_size_min; size < ramips_mem_size_max; 
     42                     size <<= 1 ) { 
     43                        if (!memcmp(base, base + size, 1024)) 
     44                                break; 
     45                } 
    4046        } 
    4147 
Note: See TracChangeset for help on using the changeset viewer.