Changeset 33619


Ignore:
Timestamp:
2012-10-04T17:42:12+02:00 (5 years ago)
Author:
hauke
Message:

[brcm47xx]: use memcmp in mem size detection as suggested by blogic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm47xx/patches-3.3/192-MIPS-BCM47XX-improve-memory-size-detection.patch

    r33596 r33619  
    1313        unsigned long mem; 
    1414        unsigned long max; 
    15 +       unsigned long off, data, off1, data1; 
     15+       unsigned long off; 
    1616        struct cpuinfo_mips *c = &current_cpu_data; 
    1717  
    1818        /* Figure out memory size by finding aliases. 
    19 @@ -77,15 +79,19 @@ static __init void prom_init_mem(void) 
     19@@ -77,15 +79,15 @@ static __init void prom_init_mem(void) 
    2020         * max contains the biggest possible address supported by the platform. 
    2121         * If the method wants to try something above we assume 128MB ram. 
     
    2323-       max = ((unsigned long)(prom_init) | ((128 << 20) - 1)); 
    2424+       off = (unsigned long)prom_init; 
    25 +       data = *(unsigned long *)prom_init; 
    26 +       off1 = off + 4; 
    27 +       data1 = *(unsigned long *)off1; 
    2825+       max = off | ((128 << 20) - 1); 
    2926        for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) { 
     
    3633-               if (*(unsigned long *)((unsigned long)(prom_init) + mem) == 
    3734-                   *(unsigned long *)(prom_init)) 
    38 +               if ((*(unsigned long *)(off + mem) == data) && 
    39 +                       (*(unsigned long *)(off1 + mem) == data1)) 
     35+               if (!memcmp(prom_init, prom_init + mem, 32)) 
    4036                        break; 
    4137        } 
Note: See TracChangeset for help on using the changeset viewer.