Changeset 20072


Ignore:
Timestamp:
2010-03-08T23:03:00+01:00 (8 years ago)
Author:
hauke
Message:

brcm47xx: fix commit r18413 "128MB ram problem"

The patch commited in r18413 was wrong.
This patch prevents prom_init_mem from scanning over 128MB ram.
This is from #6765 and #3177

Refresh all patches

Location:
trunk/target/linux/brcm47xx
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm47xx/patches-2.6.30/170-128MB_ram_bugfix.patch

    r18413 r20072  
    11--- a/arch/mips/bcm47xx/prom.c 
    22+++ b/arch/mips/bcm47xx/prom.c 
    3 @@ -141,6 +141,14 @@ static __init void prom_init_mem(void) 
     3@@ -126,6 +126,7 @@ static __init void prom_init_cmdline(voi 
     4 static __init void prom_init_mem(void) 
     5 { 
     6        unsigned long mem; 
     7+       unsigned long max; 
     8  
     9        /* Figure out memory size by finding aliases. 
     10         * 
     11@@ -134,8 +135,21 @@ static __init void prom_init_mem(void) 
     12         * want to reuse the memory used by CFE (around 4MB). That means cfe_* 
     13         * functions stop to work at some point during the boot, we should only 
     14         * call them at the beginning of the boot. 
     15+        *  
     16+        * BCM47XX uses 128MB for addressing the ram, if the system contains 
     17+        * less that that amount of ram it remaps the ram more often into the 
     18+        * available space. 
     19+        * Accessing memory after 128MB will cause an exception. 
     20+        * max contains the biggest possible address supported by the platform. 
     21+        * If the method wants to try something above we assume 128MB ram. 
     22         */ 
     23+       max = ((unsigned long)(prom_init) | ((128 << 20) - 1)); 
     24        for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) { 
     25+               if (((unsigned long)(prom_init) + mem) > max) { 
     26+                       mem = (128 << 20); 
     27+                       printk("assume 128MB RAM\n"); 
     28+                       break; 
     29+               } 
     30                if (*(unsigned long *)((unsigned long)(prom_init) + mem) == 
     31                    *(unsigned long *)(prom_init)) 
    432                        break; 
    5         } 
    6   
    7 +       /* Ignoring the last page when ddr size is 128M. Cached 
    8 +        * accesses to last page is causing the processor to prefetch 
    9 +        * using address above 128M stepping out of the ddr address 
    10 +        * space. 
    11 +        */ 
    12 +       if (mem == 0x8000000) 
    13 +               mem -= 0x1000; 
    14 + 
    15         add_memory_region(0, mem, BOOT_MEM_RAM); 
    16  } 
    17   
  • trunk/target/linux/brcm47xx/patches-2.6.30/700-ssb-gigabit-ethernet-driver.patch

    r19782 r20072  
    253253                tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl & 
    254254                       ~GRC_LCLCTRL_GPIO_OUTPUT1); 
    255 @@ -12099,6 +12168,11 @@ static int __devinit tg3_get_invariants( 
     255@@ -12099,6 +12169,11 @@ static int __devinit tg3_get_invariants( 
    256256              GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701))) 
    257257                tp->tg3_flags |= TG3_FLAG_SRAM_USE_CONFIG; 
     
    265265         * In particular, the TG3_FLG2_IS_NIC flag must be 
    266266         * determined before calling tg3_set_power_state() so that 
    267 @@ -12474,6 +12548,10 @@ static int __devinit tg3_get_device_addr 
     267@@ -12474,6 +12549,10 @@ static int __devinit tg3_get_device_addr 
    268268        } 
    269269  
     
    276276                if (!tg3_get_default_macaddr_sparc(tp)) 
    277277                        return 0; 
    278 @@ -12965,6 +13043,7 @@ static char * __devinit tg3_phy_string(s 
     278@@ -12965,6 +13044,7 @@ static char * __devinit tg3_phy_string(s 
    279279        case PHY_ID_BCM5704:    return "5704"; 
    280280        case PHY_ID_BCM5705:    return "5705"; 
     
    284284        case PHY_ID_BCM5714:    return "5714"; 
    285285        case PHY_ID_BCM5780:    return "5780"; 
    286 @@ -13175,6 +13254,13 @@ static int __devinit tg3_init_one(struct 
     286@@ -13175,6 +13255,13 @@ static int __devinit tg3_init_one(struct 
    287287                tp->msg_enable = tg3_debug; 
    288288        else 
  • trunk/target/linux/brcm47xx/patches-2.6.30/800-fix_cfe_detection.patch

    r19781 r20072  
    9191        char buf[CL_SIZE]; 
    9292  
    93 @@ -154,9 +130,12 @@ static __init void prom_init_mem(void) 
     93@@ -160,9 +136,12 @@ static __init void prom_init_mem(void) 
    9494  
    9595 void __init prom_init(void) 
  • trunk/target/linux/brcm47xx/patches-2.6.31/170-128MB_ram_bugfix.patch

    r18413 r20072  
    11--- a/arch/mips/bcm47xx/prom.c 
    22+++ b/arch/mips/bcm47xx/prom.c 
    3 @@ -141,6 +141,14 @@ static __init void prom_init_mem(void) 
     3@@ -126,6 +126,7 @@ static __init void prom_init_cmdline(voi 
     4 static __init void prom_init_mem(void) 
     5 { 
     6        unsigned long mem; 
     7+       unsigned long max; 
     8  
     9        /* Figure out memory size by finding aliases. 
     10         * 
     11@@ -134,8 +135,21 @@ static __init void prom_init_mem(void) 
     12         * want to reuse the memory used by CFE (around 4MB). That means cfe_* 
     13         * functions stop to work at some point during the boot, we should only 
     14         * call them at the beginning of the boot. 
     15+        *  
     16+        * BCM47XX uses 128MB for addressing the ram, if the system contains 
     17+        * less that that amount of ram it remaps the ram more often into the 
     18+        * available space. 
     19+        * Accessing memory after 128MB will cause an exception. 
     20+        * max contains the biggest possible address supported by the platform. 
     21+        * If the method wants to try something above we assume 128MB ram. 
     22         */ 
     23+       max = ((unsigned long)(prom_init) | ((128 << 20) - 1)); 
     24        for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) { 
     25+               if (((unsigned long)(prom_init) + mem) > max) { 
     26+                       mem = (128 << 20); 
     27+                       printk("assume 128MB RAM\n"); 
     28+                       break; 
     29+               } 
     30                if (*(unsigned long *)((unsigned long)(prom_init) + mem) == 
     31                    *(unsigned long *)(prom_init)) 
    432                        break; 
    5         } 
    6   
    7 +       /* Ignoring the last page when ddr size is 128M. Cached 
    8 +        * accesses to last page is causing the processor to prefetch 
    9 +        * using address above 128M stepping out of the ddr address 
    10 +        * space. 
    11 +        */ 
    12 +       if (mem == 0x8000000) 
    13 +               mem -= 0x1000; 
    14 + 
    15         add_memory_region(0, mem, BOOT_MEM_RAM); 
    16  } 
    17   
  • trunk/target/linux/brcm47xx/patches-2.6.31/700-ssb-gigabit-ethernet-driver.patch

    r19782 r20072  
    253253                tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl & 
    254254                       ~GRC_LCLCTRL_GPIO_OUTPUT1); 
    255 @@ -12136,6 +12205,11 @@ static int __devinit tg3_get_invariants( 
     255@@ -12136,6 +12206,11 @@ static int __devinit tg3_get_invariants( 
    256256              GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701))) 
    257257                tp->tg3_flags |= TG3_FLAG_SRAM_USE_CONFIG; 
     
    265265         * In particular, the TG3_FLG2_IS_NIC flag must be 
    266266         * determined before calling tg3_set_power_state() so that 
    267 @@ -12513,6 +12587,10 @@ static int __devinit tg3_get_device_addr 
     267@@ -12513,6 +12588,10 @@ static int __devinit tg3_get_device_addr 
    268268        } 
    269269  
     
    276276                if (!tg3_get_default_macaddr_sparc(tp)) 
    277277                        return 0; 
    278 @@ -13004,6 +13082,7 @@ static char * __devinit tg3_phy_string(s 
     278@@ -13004,6 +13083,7 @@ static char * __devinit tg3_phy_string(s 
    279279        case PHY_ID_BCM5704:    return "5704"; 
    280280        case PHY_ID_BCM5705:    return "5705"; 
     
    284284        case PHY_ID_BCM5714:    return "5714"; 
    285285        case PHY_ID_BCM5780:    return "5780"; 
    286 @@ -13214,6 +13293,13 @@ static int __devinit tg3_init_one(struct 
     286@@ -13214,6 +13294,13 @@ static int __devinit tg3_init_one(struct 
    287287                tp->msg_enable = tg3_debug; 
    288288        else 
  • trunk/target/linux/brcm47xx/patches-2.6.31/800-fix_cfe_detection.patch

    r19781 r20072  
    9191        char buf[CL_SIZE]; 
    9292  
    93 @@ -154,9 +130,12 @@ static __init void prom_init_mem(void) 
     93@@ -160,9 +136,12 @@ static __init void prom_init_mem(void) 
    9494  
    9595 void __init prom_init(void) 
  • trunk/target/linux/brcm47xx/patches-2.6.32/170-128MB_ram_bugfix.patch

    r19062 r20072  
    11--- a/arch/mips/bcm47xx/prom.c 
    22+++ b/arch/mips/bcm47xx/prom.c 
    3 @@ -141,6 +141,14 @@ static __init void prom_init_mem(void) 
     3@@ -126,6 +126,7 @@ static __init void prom_init_cmdline(voi 
     4 static __init void prom_init_mem(void) 
     5 { 
     6        unsigned long mem; 
     7+       unsigned long max; 
     8  
     9        /* Figure out memory size by finding aliases. 
     10         * 
     11@@ -134,8 +135,21 @@ static __init void prom_init_mem(void) 
     12         * want to reuse the memory used by CFE (around 4MB). That means cfe_* 
     13         * functions stop to work at some point during the boot, we should only 
     14         * call them at the beginning of the boot. 
     15+        *  
     16+        * BCM47XX uses 128MB for addressing the ram, if the system contains 
     17+        * less that that amount of ram it remaps the ram more often into the 
     18+        * available space. 
     19+        * Accessing memory after 128MB will cause an exception. 
     20+        * max contains the biggest possible address supported by the platform. 
     21+        * If the method wants to try something above we assume 128MB ram. 
     22         */ 
     23+       max = ((unsigned long)(prom_init) | ((128 << 20) - 1)); 
     24        for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) { 
     25+               if (((unsigned long)(prom_init) + mem) > max) { 
     26+                       mem = (128 << 20); 
     27+                       printk("assume 128MB RAM\n"); 
     28+                       break; 
     29+               } 
     30                if (*(unsigned long *)((unsigned long)(prom_init) + mem) == 
     31                    *(unsigned long *)(prom_init)) 
    432                        break; 
    5         } 
    6   
    7 +       /* Ignoring the last page when ddr size is 128M. Cached 
    8 +        * accesses to last page is causing the processor to prefetch 
    9 +        * using address above 128M stepping out of the ddr address 
    10 +        * space. 
    11 +        */ 
    12 +       if (mem == 0x8000000) 
    13 +               mem -= 0x1000; 
    14 + 
    15         add_memory_region(0, mem, BOOT_MEM_RAM); 
    16  } 
    17   
  • trunk/target/linux/brcm47xx/patches-2.6.32/180-ssb_extif_interrupt.patch

    r19895 r20072  
    1414 1 files changed, 4 insertions(+), 1 deletions(-) 
    1515 
    16 diff --git a/drivers/ssb/driver_mipscore.c b/drivers/ssb/driver_mipscore.c 
    17 index 3c6feed..97efce1 100644 
    1816--- a/drivers/ssb/driver_mipscore.c 
    1917+++ b/drivers/ssb/driver_mipscore.c 
    20 @@ -270,7 +270,6 @@ void ssb_mipscore_init(struct ssb_mipscore *mcore) 
     18@@ -270,7 +270,6 @@ void ssb_mipscore_init(struct ssb_mipsco 
    2119                                set_irq(dev, irq++); 
    2220                        } 
     
    2624                case SSB_DEV_ETHERNET: 
    2725                case SSB_DEV_ETHERNET_GBIT: 
    28 @@ -281,6 +280,10 @@ void ssb_mipscore_init(struct ssb_mipscore *mcore) 
     26@@ -281,6 +280,10 @@ void ssb_mipscore_init(struct ssb_mipsco 
    2927                                set_irq(dev, irq++); 
    3028                                break; 
     
    3735        } 
    3836        ssb_dprintk(KERN_INFO PFX "after irq reconfiguration\n"); 
    39 --  
    40 1.7.0 
    41  
  • trunk/target/linux/brcm47xx/patches-2.6.32/800-fix_cfe_detection.patch

    r19781 r20072  
    9191        static char buf[CL_SIZE] __initdata; 
    9292  
    93 @@ -154,9 +130,12 @@ static __init void prom_init_mem(void) 
     93@@ -160,9 +136,12 @@ static __init void prom_init_mem(void) 
    9494  
    9595 void __init prom_init(void) 
  • trunk/target/linux/brcm47xx/patches-2.6.33/800-fix_cfe_detection.patch

    r19955 r20072  
    9191        static char buf[COMMAND_LINE_SIZE] __initdata; 
    9292  
    93 @@ -154,9 +130,12 @@ static __init void prom_init_mem(void) 
     93@@ -160,9 +136,12 @@ static __init void prom_init_mem(void) 
    9494  
    9595 void __init prom_init(void) 
Note: See TracChangeset for help on using the changeset viewer.