diff options
author | Juan Gutierrez <jgutierrez@ti.com> | 2012-03-01 12:07:17 -0600 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 12:57:09 +0200 |
commit | a33cd14c91c1b86d8b78460880d1d7d72018bb25 (patch) | |
tree | f03b9489145e87273c48a67e21b294d12d915520 | |
parent | 5de1aae0e7bf0356c129624fad47ad136d139f87 (diff) | |
download | kernel_samsung_tuna-a33cd14c91c1b86d8b78460880d1d7d72018bb25.zip kernel_samsung_tuna-a33cd14c91c1b86d8b78460880d1d7d72018bb25.tar.gz kernel_samsung_tuna-a33cd14c91c1b86d8b78460880d1d7d72018bb25.tar.bz2 |
omap: remoteproc: use device-specific dump-register ops
The current omap register dump function is catering only to
ARM cores. Introduce device-specific dump register functions
so that the omap remoteproc code can call into them based on
the processor type.
This patch also adds a minimal support for dumping dsp
registers in addition to moving the existing functionality
for ARM cores to the device-specific function.
Change-Id: Ic446695a6a5a1a4b1f600c1900f74c3e5932c158
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/remoteproc.c | 63 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/remoteproc.h | 77 | ||||
-rw-r--r-- | drivers/remoteproc/omap_remoteproc.c | 41 |
3 files changed, 144 insertions, 37 deletions
diff --git a/arch/arm/mach-omap2/remoteproc.c b/arch/arm/mach-omap2/remoteproc.c index 261e8ee..5781a33 100644 --- a/arch/arm/mach-omap2/remoteproc.c +++ b/arch/arm/mach-omap2/remoteproc.c @@ -37,6 +37,67 @@ #define CONTROL_DSP_BOOTADDR (0x4A002304) +static void dump_ipu_registers(struct rproc *rproc) +{ + unsigned long flags; + char buf[64]; + struct pt_regs regs; + + if (!rproc->cdump_buf1) + return; + + remoteproc_fill_pt_regs(®s, + (struct exc_regs *)rproc->cdump_buf1); + + pr_info("REGISTER DUMP FOR REMOTEPROC %s\n", rproc->name); + pr_info("PC is at %08lx\n", instruction_pointer(®s)); + pr_info("LR is at %08lx\n", regs.ARM_lr); + pr_info("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n" + "sp : %08lx ip : %08lx fp : %08lx\n", + regs.ARM_pc, regs.ARM_lr, regs.ARM_cpsr, + regs.ARM_sp, regs.ARM_ip, regs.ARM_fp); + pr_info("r10: %08lx r9 : %08lx r8 : %08lx\n", + regs.ARM_r10, regs.ARM_r9, + regs.ARM_r8); + pr_info("r7 : %08lx r6 : %08lx r5 : %08lx r4 : %08lx\n", + regs.ARM_r7, regs.ARM_r6, + regs.ARM_r5, regs.ARM_r4); + pr_info("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n", + regs.ARM_r3, regs.ARM_r2, + regs.ARM_r1, regs.ARM_r0); + + flags = regs.ARM_cpsr; + buf[0] = flags & PSR_N_BIT ? 'N' : 'n'; + buf[1] = flags & PSR_Z_BIT ? 'Z' : 'z'; + buf[2] = flags & PSR_C_BIT ? 'C' : 'c'; + buf[3] = flags & PSR_V_BIT ? 'V' : 'v'; + buf[4] = '\0'; + + pr_info("Flags: %s IRQs o%s FIQs o%s\n", + buf, interrupts_enabled(®s) ? "n" : "ff", + fast_interrupts_enabled(®s) ? "n" : "ff"); +} + +static void dump_dsp_registers(struct rproc *rproc) +{ + struct exc_dspRegs *regs; + + regs = (struct exc_dspRegs *)rproc->cdump_buf0; + + pr_info("REGISTER DUMP FOR REMOTEPROC %s\n", rproc->name); + pr_info("PC is at %08x\n", regs->IRP); + pr_info("SP is at %08x\n", regs->b15); + pr_info("pc : [<%08x>] sp : [<%08x>]", regs->IRP, regs->b15); +} + +static struct rproc_ops ipu_ops = { + .dump_registers = dump_ipu_registers, +}; + +static struct rproc_ops dsp_ops = { + .dump_registers = dump_dsp_registers, +}; + static struct omap_rproc_timers_info ipu_timers[] = { { .id = 3 }, { .id = 4 }, @@ -66,6 +127,7 @@ static struct omap_rproc_pdata omap4_rproc_data[] = { .sus_timeout = 5000, .sus_mbox_name = "mailbox-2", .boot_reg = CONTROL_DSP_BOOTADDR, + .ops = &dsp_ops, }, { .name = "ipu", @@ -82,6 +144,7 @@ static struct omap_rproc_pdata omap4_rproc_data[] = { .suspend_mask = ~0, .sus_timeout = 5000, .sus_mbox_name = "mailbox-1", + .ops = &ipu_ops, }, }; diff --git a/arch/arm/plat-omap/include/plat/remoteproc.h b/arch/arm/plat-omap/include/plat/remoteproc.h index 569774a..74a54c9 100644 --- a/arch/arm/plat-omap/include/plat/remoteproc.h +++ b/arch/arm/plat-omap/include/plat/remoteproc.h @@ -146,6 +146,83 @@ struct exc_regs { u32 AFSR; }; +struct exc_dspRegs { + u32 ILC; + u32 RILC; + u32 AMR; + u32 SSR; + u32 IRP; + u32 NRP; + u32 ITSR; + u32 NTSR; + u32 EFR; + u32 IERR; + u32 b30; + u32 b31; + u32 b28; + u32 b29; + u32 b26; + u32 b27; + u32 b24; + u32 b25; + u32 b22; + u32 b23; + u32 b20; + u32 b21; + u32 b18; + u32 b19; + u32 b16; + u32 b17; + u32 b14; + u32 b15; + u32 b12; + u32 b13; + u32 b10; + u32 b11; + u32 b8; + u32 b9; + u32 b6; + u32 b7; + u32 b4; + u32 b5; + u32 b2; + u32 b3; + u32 b0; + u32 b1; + u32 a30; + u32 a31; + u32 a28; + u32 a29; + u32 a26; + u32 a27; + u32 a24; + u32 a25; + u32 a22; + u32 a23; + u32 a20; + u32 a21; + u32 a18; + u32 a19; + u32 a16; + u32 a17; + u32 a14; + u32 a15; + u32 a12; + u32 a13; + u32 a10; + u32 a11; + u32 a8; + u32 a9; + u32 a6; + u32 a7; + u32 a4; + u32 a5; + u32 a2; + u32 a3; + u32 a0; + u32 a1; +}; + static inline void remoteproc_fill_pt_regs(struct pt_regs *regs, struct exc_regs *xregs) { diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index 3f24db8..7bb5dc6 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -85,43 +85,10 @@ static int omap_suspend(struct rproc *rproc, bool force) static void omap_rproc_dump_registers(struct rproc *rproc) { - unsigned long flags; - char buf[64]; - struct pt_regs regs; - - if (!rproc->cdump_buf1) - return; - - remoteproc_fill_pt_regs(®s, - (struct exc_regs *)rproc->cdump_buf1); - - pr_info("REGISTER DUMP FOR REMOTEPROC %s\n", rproc->name); - pr_info("PC is at %08lx\n", instruction_pointer(®s)); - pr_info("LR is at %08lx\n", regs.ARM_lr); - pr_info("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n" - "sp : %08lx ip : %08lx fp : %08lx\n", - regs.ARM_pc, regs.ARM_lr, regs.ARM_cpsr, - regs.ARM_sp, regs.ARM_ip, regs.ARM_fp); - pr_info("r10: %08lx r9 : %08lx r8 : %08lx\n", - regs.ARM_r10, regs.ARM_r9, - regs.ARM_r8); - pr_info("r7 : %08lx r6 : %08lx r5 : %08lx r4 : %08lx\n", - regs.ARM_r7, regs.ARM_r6, - regs.ARM_r5, regs.ARM_r4); - pr_info("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n", - regs.ARM_r3, regs.ARM_r2, - regs.ARM_r1, regs.ARM_r0); - - flags = regs.ARM_cpsr; - buf[0] = flags & PSR_N_BIT ? 'N' : 'n'; - buf[1] = flags & PSR_Z_BIT ? 'Z' : 'z'; - buf[2] = flags & PSR_C_BIT ? 'C' : 'c'; - buf[3] = flags & PSR_V_BIT ? 'V' : 'v'; - buf[4] = '\0'; - - pr_info("Flags: %s IRQs o%s FIQs o%s\n", - buf, interrupts_enabled(®s) ? "n" : "ff", - fast_interrupts_enabled(®s) ? "n" : "ff"); + struct device *dev = rproc->dev; + struct omap_rproc_pdata *pdata = dev->platform_data; + + pdata->ops->dump_registers(rproc); } static int |