Changeset 20651 for trunk


Ignore:
Timestamp:
2010-04-01T19:27:59+02:00 (6 years ago)
Author:
hauke
Message:

brcm-2.4: fix commit r18413 "128MB ram problem"

This was missing in commit r20072

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm-2.4/files/arch/mips/bcm947xx/prom.c

    r18413 r20651  
    2222{ 
    2323        unsigned long mem; 
     24        unsigned long max; 
    2425 
    2526        mips_machgroup = MACH_GROUP_BRCM; 
    2627        mips_machtype = MACH_BCM947XX; 
    2728 
    28         /* Figure out memory size by finding aliases */ 
     29        /* Figure out memory size by finding aliases 
     30         *  
     31         * BCM47XX uses 128MB for addressing the ram, if the system contains 
     32         * less that that amount of ram it remaps the ram more often into the 
     33         * available space. 
     34         * Accessing memory after 128MB will cause an exception. 
     35         * max contains the biggest possible address supported by the platform. 
     36         * If the method wants to try something above we assume 128MB ram. 
     37         */ 
     38        max = ((unsigned long)(prom_init) | ((128 << 20) - 1)); 
    2939        for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) { 
     40                if (((unsigned long)(prom_init) + mem) > max) { 
     41                        mem = (128 << 20); 
     42                        printk("assume 128MB RAM\n"); 
     43                        break; 
     44                } 
    3045                if (*(unsigned long *)((unsigned long)(prom_init) + mem) ==  
    3146                    *(unsigned long *)(prom_init)) 
    3247                        break; 
    3348        } 
    34  
    35         /* Ignoring the last page when ddr size is 128M. Cached 
    36          * accesses to last page is causing the processor to prefetch 
    37          * using address above 128M stepping out of the ddr address 
    38          * space. 
    39          */ 
    40         if (mem == 0x8000000) 
    41                 mem -= 0x1000; 
    4249 
    4350        add_memory_region(0, mem, BOOT_MEM_RAM); 
Note: See TracChangeset for help on using the changeset viewer.