aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mm
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/blackfin/mm
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'arch/blackfin/mm')
-rw-r--r--arch/blackfin/mm/init.c15
-rw-r--r--arch/blackfin/mm/sram-alloc.c36
2 files changed, 8 insertions, 43 deletions
diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
index 9cb85537bd2..f8435cd36c7 100644
--- a/arch/blackfin/mm/init.c
+++ b/arch/blackfin/mm/init.c
@@ -8,7 +8,6 @@
8#include <linux/swap.h> 8#include <linux/swap.h>
9#include <linux/bootmem.h> 9#include <linux/bootmem.h>
10#include <linux/uaccess.h> 10#include <linux/uaccess.h>
11#include <linux/export.h>
12#include <asm/bfin-global.h> 11#include <asm/bfin-global.h>
13#include <asm/pda.h> 12#include <asm/pda.h>
14#include <asm/cplbinit.h> 13#include <asm/cplbinit.h>
@@ -48,7 +47,7 @@ void __init paging_init(void)
48 47
49 unsigned long zones_size[MAX_NR_ZONES] = { 48 unsigned long zones_size[MAX_NR_ZONES] = {
50 [0] = 0, 49 [0] = 0,
51 [ZONE_DMA] = (end_mem - CONFIG_PHY_RAM_BASE_ADDRESS) >> PAGE_SHIFT, 50 [ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT,
52 [ZONE_NORMAL] = 0, 51 [ZONE_NORMAL] = 0,
53#ifdef CONFIG_HIGHMEM 52#ifdef CONFIG_HIGHMEM
54 [ZONE_HIGHMEM] = 0, 53 [ZONE_HIGHMEM] = 0,
@@ -60,8 +59,7 @@ void __init paging_init(void)
60 59
61 pr_debug("free_area_init -> start_mem is %#lx virtual_end is %#lx\n", 60 pr_debug("free_area_init -> start_mem is %#lx virtual_end is %#lx\n",
62 PAGE_ALIGN(memory_start), end_mem); 61 PAGE_ALIGN(memory_start), end_mem);
63 free_area_init_node(0, zones_size, 62 free_area_init(zones_size);
64 CONFIG_PHY_RAM_BASE_ADDRESS >> PAGE_SHIFT, NULL);
65} 63}
66 64
67asmlinkage void __init init_pda(void) 65asmlinkage void __init init_pda(void)
@@ -76,6 +74,9 @@ asmlinkage void __init init_pda(void)
76 valid pointers to it. */ 74 valid pointers to it. */
77 memset(&cpu_pda[cpu], 0, sizeof(cpu_pda[cpu])); 75 memset(&cpu_pda[cpu], 0, sizeof(cpu_pda[cpu]));
78 76
77 cpu_pda[0].next = &cpu_pda[1];
78 cpu_pda[1].next = &cpu_pda[0];
79
79#ifdef CONFIG_EXCEPTION_L1_SCRATCH 80#ifdef CONFIG_EXCEPTION_L1_SCRATCH
80 cpu_pda[cpu].ex_stack = (unsigned long *)(L1_SCRATCH_START + \ 81 cpu_pda[cpu].ex_stack = (unsigned long *)(L1_SCRATCH_START + \
81 L1_SCRATCH_LENGTH); 82 L1_SCRATCH_LENGTH);
@@ -107,10 +108,10 @@ void __init mem_init(void)
107 totalram_pages = free_all_bootmem(); 108 totalram_pages = free_all_bootmem();
108 109
109 reservedpages = 0; 110 reservedpages = 0;
110 for (tmp = ARCH_PFN_OFFSET; tmp < max_mapnr; tmp++) 111 for (tmp = 0; tmp < max_mapnr; tmp++)
111 if (PageReserved(pfn_to_page(tmp))) 112 if (PageReserved(pfn_to_page(tmp)))
112 reservedpages++; 113 reservedpages++;
113 freepages = max_mapnr - ARCH_PFN_OFFSET - reservedpages; 114 freepages = max_mapnr - reservedpages;
114 115
115 /* do not count in kernel image between _rambase and _ramstart */ 116 /* do not count in kernel image between _rambase and _ramstart */
116 reservedpages -= (_ramstart - _rambase) >> PAGE_SHIFT; 117 reservedpages -= (_ramstart - _rambase) >> PAGE_SHIFT;
@@ -125,7 +126,7 @@ void __init mem_init(void)
125 printk(KERN_INFO 126 printk(KERN_INFO
126 "Memory available: %luk/%luk RAM, " 127 "Memory available: %luk/%luk RAM, "
127 "(%uk init code, %uk kernel code, %uk data, %uk dma, %uk reserved)\n", 128 "(%uk init code, %uk kernel code, %uk data, %uk dma, %uk reserved)\n",
128 (unsigned long) freepages << (PAGE_SHIFT-10), (_ramend - CONFIG_PHY_RAM_BASE_ADDRESS) >> 10, 129 (unsigned long) freepages << (PAGE_SHIFT-10), _ramend >> 10,
129 initk, codek, datak, DMA_UNCACHED_REGION >> 10, (reservedpages << (PAGE_SHIFT-10))); 130 initk, codek, datak, DMA_UNCACHED_REGION >> 10, (reservedpages << (PAGE_SHIFT-10)));
130} 131}
131 132
diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c
index 1f3b3ef3e10..29d98faa1ef 100644
--- a/arch/blackfin/mm/sram-alloc.c
+++ b/arch/blackfin/mm/sram-alloc.c
@@ -186,45 +186,9 @@ static void __init l1_inst_sram_init(void)
186#endif 186#endif
187} 187}
188 188
189#ifdef __ADSPBF60x__
190static irqreturn_t l2_ecc_err(int irq, void *dev_id)
191{
192 int status;
193
194 printk(KERN_ERR "L2 ecc error happened\n");
195 status = bfin_read32(L2CTL0_STAT);
196 if (status & 0x1)
197 printk(KERN_ERR "Core channel error type:0x%x, addr:0x%x\n",
198 bfin_read32(L2CTL0_ET0), bfin_read32(L2CTL0_EADDR0));
199 if (status & 0x2)
200 printk(KERN_ERR "System channel error type:0x%x, addr:0x%x\n",
201 bfin_read32(L2CTL0_ET1), bfin_read32(L2CTL0_EADDR1));
202
203 status = status >> 8;
204 if (status)
205 printk(KERN_ERR "L2 Bank%d error, addr:0x%x\n",
206 status, bfin_read32(L2CTL0_ERRADDR0 + status));
207
208 panic("L2 Ecc error");
209 return IRQ_HANDLED;
210}
211#endif
212
213static void __init l2_sram_init(void) 189static void __init l2_sram_init(void)
214{ 190{
215#if L2_LENGTH != 0 191#if L2_LENGTH != 0
216
217#ifdef __ADSPBF60x__
218 int ret;
219
220 ret = request_irq(IRQ_L2CTL0_ECC_ERR, l2_ecc_err, 0, "l2-ecc-err",
221 NULL);
222 if (unlikely(ret < 0)) {
223 printk(KERN_INFO "Fail to request l2 ecc error interrupt");
224 return;
225 }
226#endif
227
228 free_l2_sram_head.next = 192 free_l2_sram_head.next =
229 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); 193 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
230 if (!free_l2_sram_head.next) { 194 if (!free_l2_sram_head.next) {