驱动,但由于内核源码中有一个宏定义S3C2410_VA_GPIO找不到,自己根据理解,觉得应该是GPIO的基址,由于板子上的4个LED接在GPIO_F4~GPIO_F7上,按照手册,GPIO_F的基址应该是0x56000050,就#define S3C2410_VA_GPIO 0x56000050。
交叉编译都正常通过,但是在目标板加载该驱动模块的时候,出现如下错误提示:
[root@utu-linux pub]# insmod led.ko
Using led.ko
led: module license 'unspecified' taints kernel. /*这行是没有指明license产生的,应该对驱动没有影响*/
Unable to handle kernel paging request at virtual address 56000050
pgd = c2d7c000
[56000050] *pgd=00000000
Internal error: Oops: 805 [#1]
Modules linked in: led
CPU: 0
PC is at leds_init+0x48/0x98 [led]
LR is at 0x1
pc : [
sp : c3853f6c ip : 00000008 fp : c3853f7c
r10: 00000000 r9 : c3852000 r8 : c02a36c4
r7 : c02a36c4 r6 : c3852000 r5 : bf000460 r4 : 00000000
r3 : 56000050 r2 : 00000001 r1 : 00005555 r0 : 00000003
Flags: nZCv IRQs on FIQs on Mode SVC_32 Segment user
Control: C000317F Table: 32D7C000 DAC: 00000015
Process insmod (pid: 855, stack limit = 0xc3852194)
Stack: (0xc3853f6c to 0xc3854000)
3f60: c02a36d4 c3853fa4 c3853f80 c006ab5c bf002010
3f80: 00000004 00000000 00001f02 00000080 c00350e4 00000002 00000000 c3853fa8
3fa0: c0034f60 c006a99c 00000000 00001f02 00900080 4001b000 00000ae6 0007a070
3fc0: 00000004 00000000 00001f02 bee3fe94 0007a060 00000000 00000002 bee3fe30
3fe0: bee3d154 bee3d148 00028174 401369f0 60000010 00900080 00000000 00000000
Backtrace:
[
r4 = C02A36D4
[
Code: e89da810 e59f3048 e59f1048 e3a02001 (e1c310b0)
Segmentation fault