blob: 136d3a369f457f5d53e4829a492a2ac1a5fa9a17 [file] [log] [blame]
/*
* Copyright (c) 2013 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Debug-SnapShot: Debug Framework for Ramdump based debugging method
* The original code is Exynos-Snapshot for Exynos SoC
*
* Author: Hosung Kim <hosung0.kim@samsung.com>
* Author: Changki Kim <changki.kim@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef DEBUG_SNAPSHOT_HELPER_H
#define DEBUG_SNAPSHOT_HELPER_H
struct dbg_snapshot_helper_ops {
void (*soc_early_panic)(void *);
void (*soc_prepare_panic_entry)(void *);
void (*soc_prepare_panic_exit)(void *);
void (*soc_post_panic_entry)(void *);
void (*soc_post_panic_exit)(void *);
void (*soc_post_reboot_entry)(void *);
void (*soc_post_reboot_exit)(void *);
void (*soc_save_context_entry)(void *);
void (*soc_save_context_exit)(void *);
void (*soc_save_core)(void *);
void (*soc_save_context)(void *);
void (*soc_save_system)(void *);
void (*soc_dump_info)(void *);
void (*soc_start_watchdog)(void *);
void (*soc_expire_watchdog)(void *);
void (*soc_stop_watchdog)(void *);
void (*soc_kick_watchdog)(void *);
int (*soc_is_power_cpu)(void *);
int (*soc_smc_call)(unsigned long, unsigned long, unsigned long, unsigned long);
};
extern void dbg_snapshot_register_soc_ops(struct dbg_snapshot_helper_ops *ops);
extern bool dbg_snapshot_is_scratch(void);
#ifdef CONFIG_ARM64
struct dbg_snapshot_mmu_reg {
long SCTLR_EL1;
long TTBR0_EL1;
long TTBR1_EL1;
long TCR_EL1;
long ESR_EL1;
long FAR_EL1;
long CONTEXTIDR_EL1;
long TPIDR_EL0;
long TPIDRRO_EL0;
long TPIDR_EL1;
long MAIR_EL1;
long ELR_EL1;
long SP_EL0;
};
#else
struct dbg_snapshot_mmu_reg {
int SCTLR;
int TTBR0;
int TTBR1;
int TTBCR;
int DACR;
int DFSR;
int DFAR;
int IFSR;
int IFAR;
int DAFSR;
int IAFSR;
int PMRRR;
int NMRRR;
int FCSEPID;
int CONTEXT;
int URWTPID;
int UROTPID;
int POTPIDR;
};
#endif
struct err_variant {
u8 fld_end;
u8 fld_offset;
const char *fld_name;
};
struct err_variant_data {
const struct err_variant *variant;
u8 valid_bit;
const char *reg_name;
};
#define ERR_REG(variants, valid, reg) \
{ \
.variant = variants, \
.valid_bit = valid, \
.reg_name = reg, \
}
#define ERR_VAR(name, end, offset) \
{ \
.fld_end = end, \
.fld_offset = offset, \
.fld_name = name, \
}
#endif
extern void exynos_err_parse(u32 reg_idx, u64 reg, struct err_variant_data *exynos_cpu_err);