This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5708: Problem reading a device register

Part Number: AM5708


Tool/software: Linux

I'm trying to put together a device driver for a specific PWM interfacing to timed-ti-dm and it looks like I have some sort of protection problem accessing the device registers.  I simplified things a bit and tried using devmem2 to read the base register for timer 5.  I get a horrible response.

root@solix:~/> devmem2 0x48820000 w
/dev/mem opened.[   59.065543] ------------[ cut here ]------------
[   59.071468] WARNING: CPU: 0 PID: 379 at /kernel-source//drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x25c/0x378
[   59.082211] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_PER3_P3 (Read): Data Access in User mode during Functional access
[   59.093822] Modules linked in: extcon_usb_gpio c_can_platform c_can omap_aes_driver omap_sham can_dev omap_wdt bluetooth ecdh_generic ti_vpe ti_sc ti_csc ti_vpdma dwc3_omap omap_des atmel_mxt_ts des_generic crypto_engine omap_crypto sch_fq_codel
[   59.115730] CPU: 0 PID: 379 Comm: devmem2 Not tainted 4.14.54-gcc4e4e4b6a #29
[   59.122896] Hardware name: Generic DRA72X (Flattened Device Tree)
[   59.129014] Backtrace:
[   59.131481] [<c020b788>] (dump_backtrace) from [<c020ba6c>] (show_stack+0x18/0x1c)
[   59.139085]  r7:00000009 r6:60060193 r5:00000000 r4:c1043524
[   59.144772] [<c020ba54>] (show_stack) from [<c0871844>] (dump_stack+0x90/0xa4)
[   59.152032] [<c08717b4>] (dump_stack) from [<c022ab2c>] (__warn+0xec/0x104)
[   59.159024]  r7:00000009 r6:c0b9e0e4 r5:00000000 r4:ecdf5dd0
[   59.164712] [<c022aa40>] (__warn) from [<c022ab84>] (warn_slowpath_fmt+0x40/0x48)
[   59.172230]  r9:0000001b r8:ee9cd590 r7:c0b9df50 r6:00000002 r5:c0b9e010 r4:c0b9e0b4
[   59.180012] [<c022ab48>] (warn_slowpath_fmt) from [<c04fd324>] (l3_interrupt_handler+0x25c/0x378)
[   59.188921]  r3:ee9cd400 r2:c0b9e0b4
[   59.192509]  r4:80080003
[   59.195058] [<c04fd0c8>] (l3_interrupt_handler) from [<c0278254>] (__handle_irq_event_percpu+0x6c/0x134)
[   59.204581]  r10:c104460f r9:ee9a0f00 r8:00000017 r7:ecdf5ef4 r6:00000000 r5:ee9a0f00
[   59.212442]  r4:ee9cd900
[   59.214987] [<c02781e8>] (__handle_irq_event_percpu) from [<c0278340>] (handle_irq_event_percpu+0x24/0x60)
[   59.224684]  r10:bed00a40 r9:00000003 r8:ee806000 r7:00000001 r6:c10090ec r5:ee9a0f00
[   59.232546]  r4:ee9a0f00
[   59.235091] [<c027831c>] (handle_irq_event_percpu) from [<c02783bc>] (handle_irq_event+0x40/0x64)
[   59.244001]  r5:ee9a0f64 r4:ee9a0f00
[   59.247593] [<c027837c>] (handle_irq_event) from [<c027bc90>] (handle_fasteoi_irq+0xac/0x160)
[   59.256154]  r7:00000001 r6:c10090ec r5:ee9a0f64 r4:ee9a0f00
[   59.261842] [<c027bbe4>] (handle_fasteoi_irq) from [<c02774a0>] (generic_handle_irq+0x2c/0x3c)
[   59.270491]  r7:00000001 r6:00000000 r5:00000000 r4:c0e53abc
[   59.276179] [<c0277474>] (generic_handle_irq) from [<c0277a28>] (__handle_domain_irq+0x64/0xbc)
[   59.284919] [<c02779c4>] (__handle_domain_irq) from [<c020146c>] (gic_handle_irq+0x44/0x80)
[   59.293307]  r9:00000003 r8:fa213000 r7:fa212000 r6:ecdf5fb0 r5:fa21200c r4:c1003ff4
[   59.301085] [<c0201428>] (gic_handle_irq) from [<c020c968>] (__irq_usr+0x48/0x60)
[   59.308598] Exception stack(0xecdf5fb0 to 0xecdf5ff8)
[   59.313671] 5fa0:                                     000103c7 b6fd9908 bed009fc b6fd9ac0
[   59.321884] 5fc0: 00000000 00021044 b6fd6ca0 00000000 00000001 00000003 bed00a40 bed00c34
[   59.330096] 5fe0: b6fd63b8 bed009e8 000103b0 b6fb77c0 60060010 ffffffff
[   59.336740]  r9:00000003 r8:30c5387d r7:30c5387d r6:ffffffff r5:60060010 r4:b6fb77c0
[   59.344515] ---[ end trace 90e0acbb93f8c733 ]---

Memory mapped at address 0xb6fd5000.
[   59.349357] Unhandled fault: asynchronous external abort (0x1211) at 0x00000000
[   59.360020] pgd = ecf22e00
[   59.362736] [00000000] *pgd=acebd003, *pmd=fd0f1003
Read at address  0x48820000 (0xb6fd5000): 0x00000000

I get the same set of errors as my device driver exits its write routine.  The body of the init and write seem to be OK. 

What does this mean?  What an I doing wrong?  How can I fix even the basic problem of viewing the register from the command line?