am3352 i2c0寄存器的访问



 模块里ioremap映射地址后直接读i2c0寄存器失败

输出:

[  854.997769] i2caddr:f9e0b000
[  855.000791] sizeof(unsigned long):4
[  855.004490] Unhandled fault: external abort on non-linefetch (0x1028) at 0xf9e0b000
[  855.012485] Internal error: : 1028 [#3]
[  855.016482] Modules linked in: i2cChy(O+) driver(O)
[  855.021585] CPU: 0    Tainted: G      D    O  (3.2.0-g468d5ac-dirty #13)
[  855.028589] PC is at i2cChy_init+0xf4/0x110 [i2cChy]
[  855.033784] LR is at console_unlock+0x170/0x1f8
[  855.038510] pc : [<bf0060f4>]    lr : [<c003ff40>]    psr: 20000013
[  855.038517] sp : c74dbe80  ip : c74dbd78  fp : c74dbe94
[  855.050489] r10: bf006000  r9 : 00000240  r8 : c610db80
[  855.055936] r7 : 00000000  r6 : c74da000  r5 : 00000000  r4 : bf0044c0
[  855.062744] r3 : f9e0b000  r2 : 00000001  r1 : 00000000  r0 : bf0042c8
[  855.069555] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  855.076997] Control: 10c5387d  Table: 862f4019  DAC: 00000015
[  855.082990] Process insmod (pid: 1897, stack limit = 0xc74da2f0)
[  855.089255] Stack: (0xc74dbe80 to 0xc74dc000)
[  855.093804] be80: c05ba700 bf00438c c74dbeec c74dbe98 c000876c bf00600c c74dbebc c74dbea8
[  855.102339] bea0: 00000002 00000002 c7528e80 00000000 c74dbedc c74dbec0 bf0043d4 bf00438c
[  855.110874] bec0: 0000001c bf0043d4 bf00438c 0000001c 00000001 c610db80 00000240 00000001
[  855.119409] bee0: c74dbfa4 c74dbef0 c006d598 c000873c bf004398 0000183c c74dbfac 00000000
[  855.127944] bf00: 46d39668 c89fd980 c89fd980 0000004c 00000000 bf00438c 00000001 c89fd000
[  855.136479] bf20: 0000183c c89fdb5c c89fda8d c89fe5fc c76bd140 000004cc 0000058c 00000000
[  855.145015] bf40: 00000000 00000014 00000015 0000000c 00000009 00000007 00000000 00000000
[  855.153550] bf60: 00000000 00000000 00000000 00000000 00000000 c0509ad0 00000002 bee97c5c
[  855.162086] bf80: 00000000 00021d90 00000080 c0014428 c74da000 00000000 00000000 c74dbfa8
[  855.170622] bfa0: c0014280 c006d4ac bee97c5c 00000000 400e4000 0000183c 46d39668 400e4000
[  855.179159] bfc0: bee97c5c 00000000 00021d90 00000080 46d39668 000210b0 0000183c 00000000
[  855.187695] bfe0: 00000000 bee97c0c 46d30a88 46cbe684 60000010 400e4000 a2cabbeb fb7bbff4
[  855.196224] Backtrace:
[  855.198791] [<bf006000>] (i2cChy_init+0x0/0x110 [i2cChy]) from [<c000876c>] (do_one_initcall+0x3c/0x180)
[  855.208683]  r5:bf00438c r4:c05ba700
[  855.212427] [<c0008730>] (do_one_initcall+0x0/0x180) from [<c006d598>] (sys_init_module+0xf8/0x1ac8)
[  855.221972] [<c006d4a0>] (sys_init_module+0x0/0x1ac8) from [<c0014280>] (ret_fast_syscall+0x0/0x30)
[  855.231413] Code: eb4f04bd e5943004 e30402c8 e34b0f00 (e5931000)
[  855.238019] ---[ end trace 2f213bbc488dfe1c ]---
Segmentation fault
root@am335x-evm:/Cwork#

前两行为模块里自己打印的提示,模块编译通过,加载时出错。

请问:这是为什么,怎么解决?

先谢谢帮助!