brcm47xx: remove support for kernel version 3.3
[openwrt.git] / target / linux / brcm47xx / patches-3.6 / 191-MIPS-BCM47XX-ignore-last-memory-page.patch
1 --- a/arch/mips/bcm47xx/prom.c
2 +++ b/arch/mips/bcm47xx/prom.c
3 @@ -27,6 +27,7 @@
4  #include <linux/types.h>
5  #include <linux/kernel.h>
6  #include <linux/spinlock.h>
7 +#include <linux/smp.h>
8  #include <asm/bootinfo.h>
9  #include <asm/fw/cfe/cfe_api.h>
10  #include <asm/fw/cfe/cfe_error.h>
11 @@ -59,6 +60,7 @@ static __init void prom_init_mem(void)
12  {
13         unsigned long mem;
14         unsigned long max;
15 +       struct cpuinfo_mips *c = &current_cpu_data;
16  
17         /* Figure out memory size by finding aliases.
18          *
19 @@ -87,6 +89,14 @@ static __init void prom_init_mem(void)
20                         break;
21         }
22  
23 +       /* Ignoring the last page when ddr size is 128M. Cached
24 +        * accesses to last page is causing the processor to prefetch
25 +        * using address above 128M stepping out of the ddr address
26 +        * space.
27 +        */
28 +       if (c->cputype == CPU_74K && (mem == (128  << 20)))
29 +               mem -= 0x1000;
30 +
31         add_memory_region(0, mem, BOOT_MEM_RAM);
32  }
33