Lines Matching refs:fadump_conf
31 void __init opal_fadump_dt_scan(struct fw_dump *fadump_conf, u64 node) in opal_fadump_dt_scan() argument
77 fadump_conf->boot_mem_top = be64_to_cpu(addr); in opal_fadump_dt_scan()
78 pr_debug("Preserve everything above %llx\n", fadump_conf->boot_mem_top); in opal_fadump_dt_scan()
81 fadump_conf->dump_active = 1; in opal_fadump_dt_scan()
93 static int opal_fadump_unregister(struct fw_dump *fadump_conf);
95 static void opal_fadump_update_config(struct fw_dump *fadump_conf, in opal_fadump_update_config() argument
104 fadump_conf->boot_mem_dest_addr = be64_to_cpu(fdm->rgn[0].dest); in opal_fadump_update_config()
106 fadump_conf->boot_mem_dest_addr); in opal_fadump_update_config()
108 fadump_conf->fadumphdr_addr = be64_to_cpu(fdm->fadumphdr_addr); in opal_fadump_update_config()
115 static void __init opal_fadump_get_config(struct fw_dump *fadump_conf, in opal_fadump_get_config() argument
121 if (!fadump_conf->dump_active) in opal_fadump_get_config()
126 fadump_conf->boot_memory_size = 0; in opal_fadump_get_config()
134 fadump_conf->boot_mem_addr[i] = base; in opal_fadump_get_config()
135 fadump_conf->boot_mem_sz[i] = size; in opal_fadump_get_config()
136 fadump_conf->boot_memory_size += size; in opal_fadump_get_config()
146 fadump_conf->reserve_dump_area_start = be64_to_cpu(fdm->rgn[0].dest); in opal_fadump_get_config()
173 fadump_conf->boot_mem_top = (fadump_conf->boot_memory_size + hole_size); in opal_fadump_get_config()
174 fadump_conf->boot_mem_regs_cnt = be16_to_cpu(fdm->region_cnt); in opal_fadump_get_config()
175 opal_fadump_update_config(fadump_conf, fdm); in opal_fadump_get_config()
187 static u64 opal_fadump_init_mem_struct(struct fw_dump *fadump_conf) in opal_fadump_init_mem_struct() argument
189 u64 addr = fadump_conf->reserve_dump_area_start; in opal_fadump_init_mem_struct()
193 opal_fdm = __va(fadump_conf->kernel_metadata); in opal_fadump_init_mem_struct()
198 for (i = 0; i < fadump_conf->boot_mem_regs_cnt; i++) { in opal_fadump_init_mem_struct()
199 opal_fdm->rgn[i].src = cpu_to_be64(fadump_conf->boot_mem_addr[i]); in opal_fadump_init_mem_struct()
201 opal_fdm->rgn[i].size = cpu_to_be64(fadump_conf->boot_mem_sz[i]); in opal_fadump_init_mem_struct()
204 addr += fadump_conf->boot_mem_sz[i]; in opal_fadump_init_mem_struct()
213 fadump_conf->boot_memory_size); in opal_fadump_init_mem_struct()
215 opal_fadump_update_config(fadump_conf, opal_fdm); in opal_fadump_init_mem_struct()
225 static int opal_fadump_setup_metadata(struct fw_dump *fadump_conf) in opal_fadump_setup_metadata() argument
234 fadump_conf->kernel_metadata = (fadump_conf->reserve_dump_area_start + in opal_fadump_setup_metadata()
235 fadump_conf->reserve_dump_area_size - in opal_fadump_setup_metadata()
237 pr_info("Kernel metadata addr: %llx\n", fadump_conf->kernel_metadata); in opal_fadump_setup_metadata()
240 opal_fdm = __va(fadump_conf->kernel_metadata); in opal_fadump_setup_metadata()
248 fadump_conf->kernel_metadata); in opal_fadump_setup_metadata()
259 fadump_conf->boot_mem_top); in opal_fadump_setup_metadata()
273 static int opal_fadump_register(struct fw_dump *fadump_conf) in opal_fadump_register() argument
295 fadump_conf->dump_registered = 1; in opal_fadump_register()
303 fadump_conf->dump_registered = 1; in opal_fadump_register()
311 fadump_conf->fadump_supported = 0; in opal_fadump_register()
312 fadump_conf->fadump_enabled = 0; in opal_fadump_register()
324 opal_fadump_unregister(fadump_conf); in opal_fadump_register()
329 static int opal_fadump_unregister(struct fw_dump *fadump_conf) in opal_fadump_unregister() argument
340 fadump_conf->dump_registered = 0; in opal_fadump_unregister()
344 static int opal_fadump_invalidate(struct fw_dump *fadump_conf) in opal_fadump_invalidate() argument
354 fadump_conf->dump_active = 0; in opal_fadump_invalidate()
359 static void opal_fadump_cleanup(struct fw_dump *fadump_conf) in opal_fadump_cleanup() argument
372 static bool __init is_opal_fadump_cpu_data_valid(struct fw_dump *fadump_conf) in is_opal_fadump_cpu_data_valid() argument
377 fadump_conf->cpu_state_data_version = in is_opal_fadump_cpu_data_valid()
379 fadump_conf->cpu_state_entry_size = in is_opal_fadump_cpu_data_valid()
381 fadump_conf->cpu_state_dest_vaddr = in is_opal_fadump_cpu_data_valid()
383 fadump_conf->cpu_state_data_size = in is_opal_fadump_cpu_data_valid()
386 if (fadump_conf->cpu_state_data_version != HDAT_FADUMP_CPU_DATA_VER) { in is_opal_fadump_cpu_data_valid()
389 fadump_conf->cpu_state_data_version); in is_opal_fadump_cpu_data_valid()
393 if ((fadump_conf->cpu_state_dest_vaddr == 0) || in is_opal_fadump_cpu_data_valid()
394 (fadump_conf->cpu_state_entry_size == 0) || in is_opal_fadump_cpu_data_valid()
395 (fadump_conf->cpu_state_entry_size > in is_opal_fadump_cpu_data_valid()
396 fadump_conf->cpu_state_data_size)) { in is_opal_fadump_cpu_data_valid()
417 opal_fadump_build_cpu_notes(struct fw_dump *fadump_conf, in opal_fadump_build_cpu_notes() argument
428 if (is_opal_fadump_cpu_data_valid(fadump_conf)) { in opal_fadump_build_cpu_notes()
429 size_per_thread = fadump_conf->cpu_state_entry_size; in opal_fadump_build_cpu_notes()
430 num_cpus = (fadump_conf->cpu_state_data_size / size_per_thread); in opal_fadump_build_cpu_notes()
431 bufp = __va(fadump_conf->cpu_state_dest_vaddr); in opal_fadump_build_cpu_notes()
439 note_buf = (u32 *)fadump_conf->cpu_notes_buf_vaddr; in opal_fadump_build_cpu_notes()
503 if (fadump_conf->cpu_notes_buf_vaddr == (u64)note_buf) { in opal_fadump_build_cpu_notes()
516 fadump_conf->elfcorehdr_addr); in opal_fadump_build_cpu_notes()
517 fadump_update_elfcore_header((char *)fadump_conf->elfcorehdr_addr); in opal_fadump_build_cpu_notes()
521 static int __init opal_fadump_process(struct fw_dump *fadump_conf) in opal_fadump_process() argument
526 if (!opal_fdm_active || !fadump_conf->fadumphdr_addr) in opal_fadump_process()
529 fdh = __va(fadump_conf->fadumphdr_addr); in opal_fadump_process()
543 return opal_fadump_build_cpu_notes(fadump_conf, fdh); in opal_fadump_process()
546 static void opal_fadump_region_show(struct fw_dump *fadump_conf, in opal_fadump_region_show() argument
553 if (fadump_conf->dump_active) in opal_fadump_region_show()
563 if ((fadump_conf->dump_active) && in opal_fadump_region_show()
575 if (fadump_conf->dump_active) { in opal_fadump_region_show()
577 fadump_conf->boot_mem_top); in opal_fadump_region_show()
623 void __init opal_fadump_dt_scan(struct fw_dump *fadump_conf, u64 node) in opal_fadump_dt_scan() argument
668 fadump_conf->ops = &opal_fadump_ops; in opal_fadump_dt_scan()
669 fadump_conf->fadump_supported = 1; in opal_fadump_dt_scan()
671 fadump_conf->param_area_supported = 0; in opal_fadump_dt_scan()
677 fadump_conf->max_copy_size = ALIGN_DOWN(U32_MAX, PAGE_SIZE); in opal_fadump_dt_scan()
716 fadump_conf->dump_active = 1; in opal_fadump_dt_scan()
717 opal_fadump_get_config(fadump_conf, opal_fdm_active); in opal_fadump_dt_scan()