diff options
-rw-r--r-- | arch/sparc64/kernel/traps.c | 33 | ||||
-rw-r--r-- | arch/sparc64/mm/fault.c | 2 | ||||
-rw-r--r-- | arch/sparc64/mm/init.c | 23 | ||||
-rw-r--r-- | include/asm-sparc64/page.h | 17 | ||||
-rw-r--r-- | include/asm-sparc64/pgtable.h | 1 |
5 files changed, 29 insertions, 47 deletions
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index 1aa15990f5af..eeb1e835c423 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -757,26 +757,12 @@ void __init cheetah_ecache_flush_init(void) | |||
757 | ecache_flush_size = (2 * largest_size); | 757 | ecache_flush_size = (2 * largest_size); |
758 | ecache_flush_linesize = smallest_linesize; | 758 | ecache_flush_linesize = smallest_linesize; |
759 | 759 | ||
760 | /* Discover a physically contiguous chunk of physical | 760 | ecache_flush_physbase = find_ecache_flush_span(ecache_flush_size); |
761 | * memory in 'sp_banks' of size ecache_flush_size calculated | ||
762 | * above. Store the physical base of this area at | ||
763 | * ecache_flush_physbase. | ||
764 | */ | ||
765 | for (node = 0; ; node++) { | ||
766 | if (sp_banks[node].num_bytes == 0) | ||
767 | break; | ||
768 | if (sp_banks[node].num_bytes >= ecache_flush_size) { | ||
769 | ecache_flush_physbase = sp_banks[node].base_addr; | ||
770 | break; | ||
771 | } | ||
772 | } | ||
773 | 761 | ||
774 | /* Note: Zero would be a valid value of ecache_flush_physbase so | 762 | if (ecache_flush_physbase == ~0UL) { |
775 | * don't use that as the success test. :-) | ||
776 | */ | ||
777 | if (sp_banks[node].num_bytes == 0) { | ||
778 | prom_printf("cheetah_ecache_flush_init: Cannot find %d byte " | 763 | prom_printf("cheetah_ecache_flush_init: Cannot find %d byte " |
779 | "contiguous physical memory.\n", ecache_flush_size); | 764 | "contiguous physical memory.\n", |
765 | ecache_flush_size); | ||
780 | prom_halt(); | 766 | prom_halt(); |
781 | } | 767 | } |
782 | 768 | ||
@@ -1345,16 +1331,9 @@ static int cheetah_fix_ce(unsigned long physaddr) | |||
1345 | /* Return non-zero if PADDR is a valid physical memory address. */ | 1331 | /* Return non-zero if PADDR is a valid physical memory address. */ |
1346 | static int cheetah_check_main_memory(unsigned long paddr) | 1332 | static int cheetah_check_main_memory(unsigned long paddr) |
1347 | { | 1333 | { |
1348 | int i; | 1334 | unsigned long vaddr = PAGE_OFFSET + paddr; |
1349 | 1335 | ||
1350 | for (i = 0; ; i++) { | 1336 | return kern_addr_valid(vaddr); |
1351 | if (sp_banks[i].num_bytes == 0) | ||
1352 | break; | ||
1353 | if (paddr >= sp_banks[i].base_addr && | ||
1354 | paddr < (sp_banks[i].base_addr + sp_banks[i].num_bytes)) | ||
1355 | return 1; | ||
1356 | } | ||
1357 | return 0; | ||
1358 | } | 1337 | } |
1359 | 1338 | ||
1360 | void cheetah_cee_handler(struct pt_regs *regs, unsigned long afsr, unsigned long afar) | 1339 | void cheetah_cee_handler(struct pt_regs *regs, unsigned long afsr, unsigned long afar) |
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c index 80793d61f311..31fbc67719a1 100644 --- a/arch/sparc64/mm/fault.c +++ b/arch/sparc64/mm/fault.c | |||
@@ -32,8 +32,6 @@ | |||
32 | 32 | ||
33 | #define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0])) | 33 | #define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0])) |
34 | 34 | ||
35 | extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; | ||
36 | |||
37 | /* | 35 | /* |
38 | * To debug kernel to catch accesses to certain virtual/physical addresses. | 36 | * To debug kernel to catch accesses to certain virtual/physical addresses. |
39 | * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints. | 37 | * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints. |
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 63a7b9bafaff..48851a2e4fe1 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -41,7 +41,14 @@ | |||
41 | 41 | ||
42 | extern void device_scan(void); | 42 | extern void device_scan(void); |
43 | 43 | ||
44 | struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; | 44 | struct sparc_phys_banks { |
45 | unsigned long base_addr; | ||
46 | unsigned long num_bytes; | ||
47 | }; | ||
48 | |||
49 | #define SPARC_PHYS_BANKS 32 | ||
50 | |||
51 | static struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; | ||
45 | 52 | ||
46 | unsigned long *sparc64_valid_addr_bitmap __read_mostly; | 53 | unsigned long *sparc64_valid_addr_bitmap __read_mostly; |
47 | 54 | ||
@@ -1425,6 +1432,20 @@ void kernel_map_pages(struct page *page, int numpages, int enable) | |||
1425 | } | 1432 | } |
1426 | #endif | 1433 | #endif |
1427 | 1434 | ||
1435 | unsigned long __init find_ecache_flush_span(unsigned long size) | ||
1436 | { | ||
1437 | unsigned long i; | ||
1438 | |||
1439 | for (i = 0; ; i++) { | ||
1440 | if (sp_banks[i].num_bytes == 0) | ||
1441 | break; | ||
1442 | if (sp_banks[i].num_bytes >= size) | ||
1443 | return sp_banks[i].base_addr; | ||
1444 | } | ||
1445 | |||
1446 | return ~0UL; | ||
1447 | } | ||
1448 | |||
1428 | static void __init prom_probe_memory(void) | 1449 | static void __init prom_probe_memory(void) |
1429 | { | 1450 | { |
1430 | struct linux_mlist_p1275 *mlist; | 1451 | struct linux_mlist_p1275 *mlist; |
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index 7f8d764abc47..5426bb28a993 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h | |||
@@ -140,23 +140,6 @@ extern unsigned long page_to_pfn(struct page *); | |||
140 | #define virt_to_phys __pa | 140 | #define virt_to_phys __pa |
141 | #define phys_to_virt __va | 141 | #define phys_to_virt __va |
142 | 142 | ||
143 | /* The following structure is used to hold the physical | ||
144 | * memory configuration of the machine. This is filled in | ||
145 | * probe_memory() and is later used by mem_init() to set up | ||
146 | * mem_map[]. We statically allocate SPARC_PHYS_BANKS of | ||
147 | * these structs, this is arbitrary. The entry after the | ||
148 | * last valid one has num_bytes==0. | ||
149 | */ | ||
150 | |||
151 | struct sparc_phys_banks { | ||
152 | unsigned long base_addr; | ||
153 | unsigned long num_bytes; | ||
154 | }; | ||
155 | |||
156 | #define SPARC_PHYS_BANKS 32 | ||
157 | |||
158 | extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; | ||
159 | |||
160 | #endif /* !(__ASSEMBLY__) */ | 143 | #endif /* !(__ASSEMBLY__) */ |
161 | 144 | ||
162 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 145 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 82273c801b07..8c6dfc6c7af6 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -342,6 +342,7 @@ extern pgd_t swapper_pg_dir[2048]; | |||
342 | extern pmd_t swapper_low_pmd_dir[2048]; | 342 | extern pmd_t swapper_low_pmd_dir[2048]; |
343 | 343 | ||
344 | extern void paging_init(void); | 344 | extern void paging_init(void); |
345 | extern unsigned long find_ecache_flush_span(unsigned long size); | ||
345 | 346 | ||
346 | /* These do nothing with the way I have things setup. */ | 347 | /* These do nothing with the way I have things setup. */ |
347 | #define mmu_lockarea(vaddr, len) (vaddr) | 348 | #define mmu_lockarea(vaddr, len) (vaddr) |