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 = 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 = fdm->fadumphdr_addr; in opal_fadump_update_config()
115 static void 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 = fdm->rgn[0].dest; in opal_fadump_get_config()
172 fadump_conf->boot_mem_top = (fadump_conf->boot_memory_size + hole_size); in opal_fadump_get_config()
173 fadump_conf->boot_mem_regs_cnt = fdm->region_cnt; in opal_fadump_get_config()
174 opal_fadump_update_config(fadump_conf, fdm); in opal_fadump_get_config()
186 static u64 opal_fadump_init_mem_struct(struct fw_dump *fadump_conf) in opal_fadump_init_mem_struct() argument
188 u64 addr = fadump_conf->reserve_dump_area_start; in opal_fadump_init_mem_struct()
191 opal_fdm = __va(fadump_conf->kernel_metadata); in opal_fadump_init_mem_struct()
195 for (i = 0; i < fadump_conf->boot_mem_regs_cnt; i++) { in opal_fadump_init_mem_struct()
196 opal_fdm->rgn[i].src = fadump_conf->boot_mem_addr[i]; in opal_fadump_init_mem_struct()
198 opal_fdm->rgn[i].size = fadump_conf->boot_mem_sz[i]; in opal_fadump_init_mem_struct()
201 addr += fadump_conf->boot_mem_sz[i]; in opal_fadump_init_mem_struct()
209 fadump_conf->boot_memory_size); in opal_fadump_init_mem_struct()
211 opal_fadump_update_config(fadump_conf, opal_fdm); in opal_fadump_init_mem_struct()
221 static int opal_fadump_setup_metadata(struct fw_dump *fadump_conf) in opal_fadump_setup_metadata() argument
230 fadump_conf->kernel_metadata = (fadump_conf->reserve_dump_area_start + in opal_fadump_setup_metadata()
231 fadump_conf->reserve_dump_area_size - in opal_fadump_setup_metadata()
233 pr_info("Kernel metadata addr: %llx\n", fadump_conf->kernel_metadata); in opal_fadump_setup_metadata()
236 opal_fdm = __va(fadump_conf->kernel_metadata); in opal_fadump_setup_metadata()
244 fadump_conf->kernel_metadata); in opal_fadump_setup_metadata()
255 fadump_conf->boot_mem_top); in opal_fadump_setup_metadata()
269 static int opal_fadump_register(struct fw_dump *fadump_conf) in opal_fadump_register() argument
288 fadump_conf->dump_registered = 1; in opal_fadump_register()
295 fadump_conf->dump_registered = 1; in opal_fadump_register()
303 fadump_conf->fadump_supported = 0; in opal_fadump_register()
304 fadump_conf->fadump_enabled = 0; in opal_fadump_register()
316 opal_fadump_unregister(fadump_conf); in opal_fadump_register()
321 static int opal_fadump_unregister(struct fw_dump *fadump_conf) in opal_fadump_unregister() argument
332 fadump_conf->dump_registered = 0; in opal_fadump_unregister()
336 static int opal_fadump_invalidate(struct fw_dump *fadump_conf) in opal_fadump_invalidate() argument
346 fadump_conf->dump_active = 0; in opal_fadump_invalidate()
351 static void opal_fadump_cleanup(struct fw_dump *fadump_conf) in opal_fadump_cleanup() argument
364 static bool __init is_opal_fadump_cpu_data_valid(struct fw_dump *fadump_conf) in is_opal_fadump_cpu_data_valid() argument
369 fadump_conf->cpu_state_data_version = in is_opal_fadump_cpu_data_valid()
371 fadump_conf->cpu_state_entry_size = in is_opal_fadump_cpu_data_valid()
373 fadump_conf->cpu_state_dest_vaddr = in is_opal_fadump_cpu_data_valid()
375 fadump_conf->cpu_state_data_size = in is_opal_fadump_cpu_data_valid()
378 if (fadump_conf->cpu_state_data_version != HDAT_FADUMP_CPU_DATA_VER) { in is_opal_fadump_cpu_data_valid()
381 fadump_conf->cpu_state_data_version); in is_opal_fadump_cpu_data_valid()
385 if ((fadump_conf->cpu_state_dest_vaddr == 0) || in is_opal_fadump_cpu_data_valid()
386 (fadump_conf->cpu_state_entry_size == 0) || in is_opal_fadump_cpu_data_valid()
387 (fadump_conf->cpu_state_entry_size > in is_opal_fadump_cpu_data_valid()
388 fadump_conf->cpu_state_data_size)) { in is_opal_fadump_cpu_data_valid()
409 opal_fadump_build_cpu_notes(struct fw_dump *fadump_conf, in opal_fadump_build_cpu_notes() argument
420 if (is_opal_fadump_cpu_data_valid(fadump_conf)) { in opal_fadump_build_cpu_notes()
421 size_per_thread = fadump_conf->cpu_state_entry_size; in opal_fadump_build_cpu_notes()
422 num_cpus = (fadump_conf->cpu_state_data_size / size_per_thread); in opal_fadump_build_cpu_notes()
423 bufp = __va(fadump_conf->cpu_state_dest_vaddr); in opal_fadump_build_cpu_notes()
431 note_buf = (u32 *)fadump_conf->cpu_notes_buf_vaddr; in opal_fadump_build_cpu_notes()
495 if (fadump_conf->cpu_notes_buf_vaddr == (u64)note_buf) { in opal_fadump_build_cpu_notes()
513 static int __init opal_fadump_process(struct fw_dump *fadump_conf) in opal_fadump_process() argument
518 if (!opal_fdm_active || !fadump_conf->fadumphdr_addr) in opal_fadump_process()
522 fdh = __va(fadump_conf->fadumphdr_addr); in opal_fadump_process()
540 rc = opal_fadump_build_cpu_notes(fadump_conf, fdh); in opal_fadump_process()
554 static void opal_fadump_region_show(struct fw_dump *fadump_conf, in opal_fadump_region_show() argument
561 if (fadump_conf->dump_active) in opal_fadump_region_show()
571 if ((fadump_conf->dump_active) && in opal_fadump_region_show()
582 if (fadump_conf->dump_active) { in opal_fadump_region_show()
584 fadump_conf->reserve_dump_area_start); 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
667 fadump_conf->ops = &opal_fadump_ops; in opal_fadump_dt_scan()
668 fadump_conf->fadump_supported = 1; in opal_fadump_dt_scan()
674 fadump_conf->max_copy_size = ALIGN_DOWN(U32_MAX, PAGE_SIZE); in opal_fadump_dt_scan()
713 fadump_conf->dump_active = 1; in opal_fadump_dt_scan()
714 opal_fadump_get_config(fadump_conf, opal_fdm_active); in opal_fadump_dt_scan()