Здравстуйте
Имеем плату SK-AT91SAM9XE512-SIM508, ядро 2.6.34.1 взял драйвер at91_gsm_gps_pwr с 28 ядра, скомпилял при запуске приходит падение
Код
static int __init at91sam9_gpio_init(void)
{
int r;
printk(KERN_DEBUG NAME ": SIM508 power management driver, major %d, minor %d.\n",major,0);
/* if (!scx200_gpio_present()) {
printk(KERN_ERR NAME ": no SCx200 gpio pins available\n");
return -ENODEV;
}*/
r = register_chrdev(major, NAME, &at91sam9_gpio_fops);
if (r < 0) {
printk(KERN_ERR NAME ": unable to register character device\n");
return r;
}
if (!major) {
major = r;
printk(KERN_DEBUG NAME ": got dynamic major %d\n", major);
}
at91_set_GPIO_periph(AT91_PIN_PC10,1);
at91_set_GPIO_periph(AT91_PIN_PC5,1);
gpio_direction_output(AT91_PIN_PC10,1);
gpio_direction_output(AT91_PIN_PC5,1);
return 0;
}
падает в gpio_direction_output(AT91_PIN_PC10,1);
Код
gpio_direction_output(AT91_PIN_PC10,1);
------------[ cut here ]------------
WARNING: at drivers/gpio/gpiolib.c:103 gpio_ensure_requested+0x5c/0xd0()
autorequest GPIO-106
Modules linked in:
Backtrace:
[<c021f008>] (dump_backtrace+0x0/0x10c) from [<c0431a64>] (dump_stack+0x18/0x1c)
r7:c3c1df30 r6:c033f5b8 r5:c04a78c2 r4:00000067
[<c0431a4c>] (dump_stack+0x0/0x1c) from [<c0232f58>] (warn_slowpath_common+0x50/
0x80)
[<c0232f08>] (warn_slowpath_common+0x0/0x80) from [<c0232fd4>] (warn_slowpath_fm
t+0x30/0x38)
r7:60000013 r6:0000006a r5:c04da2c0 r4:c051da10
[<c0232fa4>] (warn_slowpath_fmt+0x0/0x38) from [<c033f5b8>] (gpio_ensure_request
ed+0x5c/0xd0)
r3:0000006a r2:c04a7956
[<c033f55c>] (gpio_ensure_requested+0x0/0xd0) from [<c033f6a0>] (gpio_direction_
output+0x74/0x130)
r6:0000000a r5:c04e7428 r4:c04da2c0
[<c033f62c>] (gpio_direction_output+0x0/0x130) from [<c0019b2c>] (at91sam9_gpio_
init+0xb4/0x10c)
[<c0019a78>] (at91sam9_gpio_init+0x0/0x10c) from [<c021b394>] (do_one_initcall+0
x64/0x1cc)
r5:c0022fc8 r4:c0022f18
[<c021b330>] (do_one_initcall+0x0/0x1cc) from [<c00085e0>] (kernel_init+0x98/0x1
48)
r8:00000000 r7:00000000 r6:00000000 r5:c0022fc8 r4:c0022f18
[<c0008548>] (kernel_init+0x0/0x148) from [<c02362e8>] (do_exit+0x0/0x5c8)
r5:00000000 r4:00000000
---[ end trace c99f17b0ebb95ba1 ]---
:gpio_direction_output(AT91_PIN_PC5,1);
------------[ cut here ]------------
WARNING: at drivers/gpio/gpiolib.c:103 gpio_ensure_requested+0x5c/0xd0()
autorequest GPIO-101
Modules linked in:
Backtrace:
[<c021f008>] (dump_backtrace+0x0/0x10c) from [<c0431a64>] (dump_stack+0x18/0x1c)
r7:c3c1df30 r6:c033f5b8 r5:c04a78c2 r4:00000067
[<c0431a4c>] (dump_stack+0x0/0x1c) from [<c0232f58>] (warn_slowpath_common+0x50/
0x80)
[<c0232f08>] (warn_slowpath_common+0x0/0x80) from [<c0232fd4>] (warn_slowpath_fm
t+0x30/0x38)
r7:60000013 r6:00000065 r5:c04da2c0 r4:c051d9e8
[<c0232fa4>] (warn_slowpath_fmt+0x0/0x38) from [<c033f5b8>] (gpio_ensure_request
ed+0x5c/0xd0)
r3:00000065 r2:c04a7956
[<c033f55c>] (gpio_ensure_requested+0x0/0xd0) from [<c033f6a0>] (gpio_direction_
output+0x74/0x130)
r6:00000005 r5:c04e7428 r4:c04da2c0
[<c033f62c>] (gpio_direction_output+0x0/0x130) from [<c0019b40>] (at91sam9_gpio_
init+0xc8/0x10c)
[<c0019a78>] (at91sam9_gpio_init+0x0/0x10c) from [<c021b394>] (do_one_initcall+0
x64/0x1cc)
r5:c0022fc8 r4:c0022f18
[<c021b330>] (do_one_initcall+0x0/0x1cc) from [<c00085e0>] (kernel_init+0x98/0x1
48)
r8:00000000 r7:00000000 r6:00000000 r5:c0022fc8 r4:c0022f18
[<c0008548>] (kernel_init+0x0/0x148) from [<c02362e8>] (do_exit+0x0/0x5c8)
r5:00000000 r4:00000000
---[ end trace c99f17b0ebb95ba2 ]---
посмотрел что на AT91_PIN_PC10, нет инициализации CTS3, не было инициализации UART3
добавил at91_register_uart(AT91SAM9260_ID_US3, 3, ATMEL_UART_RTS | ATMEL_UART_CTS);
но тольк configure_usart3_pins изменил
Код
static inline void configure_usart3_pins(unsigned pins)
{
//at91_set_A_periph(AT91_PIN_PB10, 1); /* TXD3 */
//at91_set_A_periph(AT91_PIN_PB11, 0); /* RXD3 */
if (pins & ATMEL_UART_RTS)
at91_set_B_periph(AT91_PIN_PC8, 0); /* RTS3 */
if (pins & ATMEL_UART_CTS)
at91_set_B_periph(AT91_PIN_PC10, 0); /* CTS3 */
}
поскольку AT91_PIN_PB10 и AT91_PIN_PB11 используются в ISI, но все ровно проблема осталась , может ли это быть связано с ISI.