Lines Matching refs:fw_dump
46 static struct fw_dump fw_dump; variable
76 fw_dump.fadump_supported = 1; in early_init_dt_scan_fw_dump()
77 fw_dump.ibm_configure_kernel_dump = be32_to_cpu(*token); in early_init_dt_scan_fw_dump()
85 fw_dump.dump_active = 1; in early_init_dt_scan_fw_dump()
106 fw_dump.cpu_state_data_size = in early_init_dt_scan_fw_dump()
110 fw_dump.hpte_region_size = in early_init_dt_scan_fw_dump()
125 if (!fw_dump.dump_registered) in is_fadump_boot_memory_area()
128 return (addr + size) > RMA_START && addr <= fw_dump.boot_memory_size; in is_fadump_boot_memory_area()
133 if (!fw_dump.dump_registered || !fw_dump.fadumphdr_addr) in should_fadump_crash()
140 return fw_dump.dump_active; in is_fadump_active()
152 unsigned long end_pfn = PHYS_PFN(RMA_START + fw_dump.boot_memory_size); in is_boot_memory_area_contiguous()
179 (fw_dump.fadump_supported ? "present" : "no support")); in fadump_show_config()
181 if (!fw_dump.fadump_supported) in fadump_show_config()
185 (fw_dump.fadump_enabled ? "yes" : "no")); in fadump_show_config()
187 (fw_dump.dump_active ? "yes" : "no")); in fadump_show_config()
189 pr_debug(" CPU state data size: %lx\n", fw_dump.cpu_state_data_size); in fadump_show_config()
190 pr_debug(" HPTE region size : %lx\n", fw_dump.hpte_region_size); in fadump_show_config()
191 pr_debug("Boot memory size : %lx\n", fw_dump.boot_memory_size); in fadump_show_config()
226 fdm->cpu_state_data.source_len = cpu_to_be64(fw_dump.cpu_state_data_size); in init_fadump_mem_struct()
228 addr += fw_dump.cpu_state_data_size; in init_fadump_mem_struct()
234 fdm->hpte_region.source_len = cpu_to_be64(fw_dump.hpte_region_size); in init_fadump_mem_struct()
236 addr += fw_dump.hpte_region_size; in init_fadump_mem_struct()
242 fdm->rmr_region.source_len = cpu_to_be64(fw_dump.boot_memory_size); in init_fadump_mem_struct()
244 addr += fw_dump.boot_memory_size; in init_fadump_mem_struct()
269 if (fw_dump.reserve_bootvar) in fadump_calculate_reserve_size()
282 if (fw_dump.reserve_bootvar) in fadump_calculate_reserve_size()
285 fw_dump.reserve_bootvar = (unsigned long)size; in fadump_calculate_reserve_size()
292 if (fw_dump.reserve_bootvar > max_size) { in fadump_calculate_reserve_size()
293 fw_dump.reserve_bootvar = max_size; in fadump_calculate_reserve_size()
295 (fw_dump.reserve_bootvar >> 20)); in fadump_calculate_reserve_size()
298 return fw_dump.reserve_bootvar; in fadump_calculate_reserve_size()
299 } else if (fw_dump.reserve_bootvar) { in fadump_calculate_reserve_size()
304 return fw_dump.reserve_bootvar; in fadump_calculate_reserve_size()
328 size += fw_dump.cpu_state_data_size; in get_fadump_area_size()
329 size += fw_dump.hpte_region_size; in get_fadump_area_size()
330 size += fw_dump.boot_memory_size; in get_fadump_area_size()
365 if (!fw_dump.fadump_enabled) in fadump_reserve_mem()
368 if (!fw_dump.fadump_supported) { in fadump_reserve_mem()
371 fw_dump.fadump_enabled = 0; in fadump_reserve_mem()
380 fw_dump.boot_memory_size = be64_to_cpu(fdm_active->rmr_region.source_len); in fadump_reserve_mem()
382 fw_dump.boot_memory_size = fadump_calculate_reserve_size(); in fadump_reserve_mem()
405 if (fw_dump.dump_active) { in fadump_reserve_mem()
422 base = fw_dump.boot_memory_size; in fadump_reserve_mem()
426 fw_dump.fadumphdr_addr = in fadump_reserve_mem()
430 (void *) fw_dump.fadumphdr_addr); in fadump_reserve_mem()
440 for (base = fw_dump.boot_memory_size; in fadump_reserve_mem()
460 fw_dump.reserve_dump_area_start = base; in fadump_reserve_mem()
461 fw_dump.reserve_dump_area_size = size; in fadump_reserve_mem()
477 fw_dump.fadump_enabled = 1; in early_fadump_param()
479 fw_dump.fadump_enabled = 0; in early_fadump_param()
493 fw_dump.reserve_bootvar = memparse(p, &p); in early_fadump_reserve_mem()
507 rc = rtas_call(fw_dump.ibm_configure_kernel_dump, 3, 1, NULL, in register_fw_dump()
538 fw_dump.dump_registered = 1; in register_fw_dump()
544 fw_dump.dump_registered = 1; in register_fw_dump()
577 while (fw_dump.dump_registered) in crash_fadump()
582 fdh = __va(fw_dump.fadumphdr_addr); in crash_fadump()
684 phdr->p_paddr = fw_dump.cpu_notes_buf; in fadump_update_elfcore_header()
686 phdr->p_filesz = fw_dump.cpu_notes_buf_size; in fadump_update_elfcore_header()
687 phdr->p_memsz = fw_dump.cpu_notes_buf_size; in fadump_update_elfcore_header()
770 fw_dump.cpu_notes_buf_size = num_cpus * sizeof(note_buf_t); in fadump_build_cpu_notes()
771 fw_dump.cpu_notes_buf_size = PAGE_ALIGN(fw_dump.cpu_notes_buf_size); in fadump_build_cpu_notes()
772 note_buf = fadump_cpu_notes_buf_alloc(fw_dump.cpu_notes_buf_size); in fadump_build_cpu_notes()
775 "cpu notes buffer\n", fw_dump.cpu_notes_buf_size); in fadump_build_cpu_notes()
778 fw_dump.cpu_notes_buf = __pa(note_buf); in fadump_build_cpu_notes()
783 if (fw_dump.fadumphdr_addr) in fadump_build_cpu_notes()
784 fdh = __va(fw_dump.fadumphdr_addr); in fadump_build_cpu_notes()
819 fadump_cpu_notes_buf_free((unsigned long)__va(fw_dump.cpu_notes_buf), in fadump_build_cpu_notes()
820 fw_dump.cpu_notes_buf_size); in fadump_build_cpu_notes()
821 fw_dump.cpu_notes_buf = 0; in fadump_build_cpu_notes()
822 fw_dump.cpu_notes_buf_size = 0; in fadump_build_cpu_notes()
836 if (!fdm_active || !fw_dump.fadumphdr_addr) in process_fadump()
854 fdh = __va(fw_dump.fadumphdr_addr); in process_fadump()
956 ra_start = fw_dump.reserve_dump_area_start; in fadump_exclude_reserved_area()
957 ra_end = ra_start + fw_dump.reserve_dump_area_size; in fadump_exclude_reserved_area()
1030 ret = fadump_add_crash_memory(RMA_START, fw_dump.boot_memory_size); in fadump_setup_crash_memory_ranges()
1044 if (start < fw_dump.boot_memory_size) { in fadump_setup_crash_memory_ranges()
1045 if (end > fw_dump.boot_memory_size) in fadump_setup_crash_memory_ranges()
1046 start = fw_dump.boot_memory_size; in fadump_setup_crash_memory_ranges()
1067 if (paddr > RMA_START && paddr < fw_dump.boot_memory_size) in fadump_relocate()
1163 fw_dump.fadumphdr_addr = addr; in init_fadump_header()
1186 if (!fw_dump.reserve_dump_area_size) in register_fadump()
1214 rc = rtas_call(fw_dump.ibm_configure_kernel_dump, 3, 1, NULL, in fadump_unregister_dump()
1228 fw_dump.dump_registered = 0; in fadump_unregister_dump()
1241 rc = rtas_call(fw_dump.ibm_configure_kernel_dump, 3, 1, NULL, in fadump_invalidate_dump()
1254 fw_dump.dump_active = 0; in fadump_invalidate_dump()
1262 if (fw_dump.dump_active) { in fadump_cleanup()
1266 } else if (fw_dump.dump_registered) { in fadump_cleanup()
1324 ra_start = fw_dump.reserve_dump_area_start; in fadump_release_memory()
1325 ra_end = ra_start + fw_dump.reserve_dump_area_size; in fadump_release_memory()
1346 if (!fw_dump.dump_active) { in fadump_invalidate_release_mem()
1359 reserved_area_start = fw_dump.reserve_dump_area_start; in fadump_invalidate_release_mem()
1361 fw_dump.reserve_dump_area_size; in fadump_invalidate_release_mem()
1366 fw_dump.reserve_dump_area_start = destination_address; in fadump_invalidate_release_mem()
1367 fw_dump.reserve_dump_area_size = get_fadump_area_size(); in fadump_invalidate_release_mem()
1370 if (fw_dump.cpu_notes_buf) { in fadump_invalidate_release_mem()
1372 (unsigned long)__va(fw_dump.cpu_notes_buf), in fadump_invalidate_release_mem()
1373 fw_dump.cpu_notes_buf_size); in fadump_invalidate_release_mem()
1374 fw_dump.cpu_notes_buf = 0; in fadump_invalidate_release_mem()
1375 fw_dump.cpu_notes_buf_size = 0; in fadump_invalidate_release_mem()
1378 init_fadump_mem_struct(&fdm, fw_dump.reserve_dump_area_start); in fadump_invalidate_release_mem()
1387 if (!fw_dump.dump_active) in fadump_release_memory_store()
1412 return sprintf(buf, "%d\n", fw_dump.fadump_enabled); in fadump_enabled_show()
1419 return sprintf(buf, "%d\n", fw_dump.dump_registered); in fadump_register_show()
1429 if (!fw_dump.fadump_enabled || fdm_active) in fadump_register_store()
1439 if (fw_dump.dump_registered == 0) { in fadump_register_store()
1446 if (fw_dump.dump_registered == 1) { in fadump_register_store()
1467 if (!fw_dump.fadump_enabled) in fadump_region_show()
1504 (fw_dump.reserve_dump_area_start == in fadump_region_show()
1512 (unsigned long long)fw_dump.reserve_dump_area_start, in fadump_region_show()
1515 fw_dump.reserve_dump_area_start, in fadump_region_show()
1517 fw_dump.reserve_dump_area_start); in fadump_region_show()
1568 if (fw_dump.dump_active) { in fadump_init_files()
1582 if (!fw_dump.fadump_enabled) in setup_fadump()
1585 if (!fw_dump.fadump_supported) { in setup_fadump()
1596 if (fw_dump.dump_active) { in setup_fadump()
1605 else if (fw_dump.reserve_dump_area_size) in setup_fadump()
1606 init_fadump_mem_struct(&fdm, fw_dump.reserve_dump_area_start); in setup_fadump()