soc: rockchip: debug: support module

1.support module
2.export symbol of rockchip_debug_dump_pcsr,
rockchip_debug_dump_pcsr is called by fiq debugger

Change-Id: I28776fa2f6c34042a3771de82d43f1365bd01f4c
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
This commit is contained in:
Huibin Hong
2020-06-11 17:29:42 +08:00
committed by Tao Huang
parent c7def0ae7d
commit d756cc25eb
3 changed files with 23 additions and 4 deletions

View File

@@ -111,7 +111,7 @@ config ROCKCHIP_VENDOR_STORAGE_UPDATE_LOADER
The /dev/vendor_storage must set root user access only.
config ROCKCHIP_DEBUG
bool "Rockchip DEBUG"
tristate "Rockchip DEBUG"
default y
help
Print dbgpcsr for every cpu when panic.

View File

@@ -49,9 +49,10 @@
* };
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include "../../staging/android/fiq_debugger/fiq_debugger_priv.h"
@@ -70,7 +71,7 @@
static void __iomem *rockchip_cpu_debug[16];
#ifdef CONFIG_FIQ_DEBUGGER
#if IS_ENABLED(CONFIG_FIQ_DEBUGGER)
int rockchip_debug_dump_pcsr(struct fiq_debugger_output *output)
{
unsigned long dbgpcsr;
@@ -123,6 +124,7 @@ int rockchip_debug_dump_pcsr(struct fiq_debugger_output *output)
}
return NOTIFY_OK;
}
EXPORT_SYMBOL_GPL(rockchip_debug_dump_pcsr);
#endif
static int rockchip_panic_notify(struct notifier_block *nb, unsigned long event,
@@ -219,3 +221,20 @@ static int __init rockchip_debug_init(void)
return 0;
}
arch_initcall(rockchip_debug_init);
static void __exit rockchip_debug_exit(void)
{
int i = 0;
atomic_notifier_chain_unregister(&panic_notifier_list,
&rockchip_panic_nb);
while (rockchip_cpu_debug[i])
iounmap(rockchip_cpu_debug[i++]);
}
module_exit(rockchip_debug_exit);
MODULE_AUTHOR("Huibin Hong <huibin.hong@rock-chips.com>");
MODULE_DESCRIPTION("Rockchip Debugger");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:rockchip-debugger");

View File

@@ -7,7 +7,7 @@
struct fiq_debugger_output;
#ifdef CONFIG_FIQ_DEBUGGER
#if IS_ENABLED(CONFIG_FIQ_DEBUGGER)
int rockchip_debug_dump_pcsr(struct fiq_debugger_output *output);
#endif