나는 교육 목적 (이미 드라이버를 알고있는 존재)에 대한 Pandaboard (OMAP4)의 워치 독 타이머 장치 드라이버를 쓰고 있어요를 작성. 내가 워치 독 타이머 레지스터에 액세스 할 수있는 방법을 알고 싶어 커널 공간에서 (예를 들어, WDT_WLDR (타이머로드 레지스터) 주소 오프셋 0x0000002C 및 물리적 L4 상호 연결 주소 0x4A31402C있다). 필자 스스로 watchdog 장치 드라이버를 작성할 수 있도록 쓰기 방향으로 안내하십시오. 감사 읽고 레지스터 리눅스 디바이스 드라이버
============================================ ====================================== 는 지금은, 그러나 그것은 어떻게 작동하지 않습니다이 모듈을 썼다 이 이ioread32 (reg_WLDR)가 0
을 반환 있어야하는데 =============================== ================================================== =
dmesg를 반환
[ 72.798461] Now in kernel space
[ 72.798583] Starting to read
[ 72.798583]
[ 72.798645] 0
[ 72.798645] ------------[ cut here ]------------
[ 72.798645] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:113 l3_interrupt_handler+0x)
[ 72.798706] L3 custom error: MASTER:MPU TARGET:L4CFG
[ 72.798706] Modules linked in: test_device(O+)
[ 72.798706] 2nd Read
[ 72.798736]
[ 72.798736] (null)
[ 72.798736]
[ 72.798797] [<c001a0f4>] (unwind_backtrace+0x0/0xec) from [<c003a298>] (warn_slowpath)
[ 72.798797] [<c003a298>] (warn_slowpath_common+0x4c/0x64) from [<c003a344>] (warn_slo)
[ 72.798797] [<c003a344>] (warn_slowpath_fmt+0x30/0x40) from [<c002efe8>] (l3_interrup)
[ 72.798858] [<c002efe8>] (l3_interrupt_handler+0x120/0x16c) from [<c0092af4>] (handle)
[ 72.798889] [<c0092af4>] (handle_irq_event_percpu+0x74/0x1f8) from [<c0092cb4>] (hand)
[ 72.798889] [<c0092cb4>] (handle_irq_event+0x3c/0x5c) from [<c0095958>] (handle_faste)
[ 72.798950] [<c0095958>] (handle_fasteoi_irq+0xd4/0x110) from [<c00925b4>] (generic_h)
[ 72.798950] [<c00925b4>] (generic_handle_irq+0x30/0x48) from [<c0014208>] (handle_IRQ)
[ 72.798950] [<c0014208>] (handle_IRQ+0x78/0xb8) from [<c00084b8>] (gic_handle_irq+0x8)
[ 72.799072] [<c00084b8>] (gic_handle_irq+0x80/0xac) from [<c04b74c4>] (__irq_svc+0x44)
[ 72.799072] Exception stack(0xece47ec0 to 0xece47f08)
[ 72.799102] 7ec0: ecdbc0e0 00000004 c0748c64 00000000 000080d0 c0743a88 ecdbc0e0 ee270
[ 72.799102] 7ee0: c0013328 00000000 c0c99720 00020348 ece46000 ece47f08 c0081c38 c03ac
[ 72.799102] 7f00: 60000013 ffffffff
[ 72.799102] [<c04b74c4>] (__irq_svc+0x44/0x60) from [<c03a610c>] (sk_prot_alloc+0x50/)
[ 72.799102] [<c03a610c>] (sk_prot_alloc+0x50/0x14c) from [<c03a6268>] (sk_alloc+0x1c/)
[ 72.799102] [<c03a6268>] (sk_alloc+0x1c/0xd8) from [<c042789c>] (unix_create1+0x50/0x)
[ 72.799255] [<c042789c>] (unix_create1+0x50/0x178) from [<c0427a34>] (unix_create+0x7)
[ 72.799255] [<c0427a34>] (unix_create+0x70/0x90) from [<c03a3878>] (__sock_create+0x1)
[ 72.799255] [<c03a3878>] (__sock_create+0x19c/0x2b8) from [<c03a3a10>] (sock_create+0)
[ 72.799316] [<c03a3a10>] (sock_create+0x40/0x48) from [<c03a3b8c>] (sys_socket+0x2c/0)
[ 72.799346] [<c03a3b8c>] (sys_socket+0x2c/0x68) from [<c0013160>] (ret_fast_syscall+0)
[ 72.799346] ---[ end trace 4316415ef3b8cf4c ]---
,
================================================ ==================================
코드
#include </home/salman/kernel_panda_compile/linux/include/linux/version.h>
#include </home/salman/kernel_panda_compile/linux/include/linux/module.h>
#include </home/salman/kernel_panda_compile/linux/include/linux/miscdevice.h>
#include </home/salman/kernel_panda_compile/linux/include/linux/highmem.h>
#include </home/salman/kernel_panda_compile/linux/include/linux/fs.h>
#include </home/salman/kernel_panda_compile/linux/arch/arm/include/asm/unistd.h>
#include </home/salman/kernel_panda_compile/linux/include/linux/unistd.h>
#include </home/salman/kernel_panda_compile/linux/include/linux/kernel.h>
#include </home/salman/kernel_panda_compile/linux/include/linux/moduleparam.h>
#include </home/salman/kernel_panda_compile/linux/include/linux/io.h>
#include </home/salman/kernel_panda_compile/linux/arch/arm/include/asm/io.h>
#include </home/salman/kernel_panda_compile/linux/include/linux/ioport.h>
static void *reg_WLDR;
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Muhammad Salman Khalid");
MODULE_VERSION("0.100");
static int start_module(void)
{
int retval;
printk(KERN_INFO "Now in kernel space\n");
// retval = misc_register(&our_device);
reg_WLDR = ioremap(0x4A31402C,0x001);//0x4A31402C is the physical address (L4 Interconnect) of WDT_WLDR register of watchdog timer(pandaboard omap4) it is readable & writeable
iowrite32(252,reg_WLDR);
printk(KERN_ALERT "Starting to read\n");
printk(KERN_ALERT "\n%d\n",ioread32(reg_WLDR));
printk(KERN_ALERT "2nd Read\n");
printk(KERN_ALERT "\n%p\n",ioread32(reg_WLDR));
iounmap(reg_WLDR);
return retval;
}
static void finish_module(void)
{
printk(KERN_INFO "Leaving kernel space\n");
// misc_deregister(&our_device);
return;
}
module_init(start_module);
module_exit(finish_module);
당신은 그것을 해결 했습니까? 나는 같은 오류가있다. 회신 해주십시오. – ransh