setserial always results in deadlock when uart specified
I am trying to configure a PC104/16C550 modem which has jumpers to set the port address(8 ports) & irq(from 3 thru 7). The host is an Arcom Viper (PC104, Linux viper 2.6.16.28-arcom1-1-viper #1 Wed Sep 13 11:29:51 BST 2006 armv5tel unknown). This comptuer has 5 serial ports by default:
Code:
Serial: 8250/16550 driver $Revision: 1.90 $ 64 ports, IRQ sharing enabled Code:
# setserial /dev/ttyS5 baud_base 115200 port 0x2a8 irq 7 uart 16550 Code:
Unable to handle kernel NULL pointer dereference at virtual address 000002aa Code:
Backtrace: Code:
Showing all blocking locks in the system: I am however able to repeat the above command successfully but I have to exclude the uart option and setserial returns instantly. The settings were verified as being set, however any operation with the port (/dev/ttyS5) results in an I/O error (even a simple cat < /dev/ttyS5). I've removed all gettys on serial ports...what could be the problem? |
"Unable to handle kernel NULL pointer dereference at virtual address 000002aa"
This is obviously wrong...because: 1) the physical address of the PC104 bus is @ 0x30000000 2) the virtual address of 0x30000000phys = 0xf1000000 (verified in kernel source [arch=arm, machine=pxa255 w/CONFIG_VIPER=y]) 3) the port I had supplied was 0x2a8, so the above info means it was trying to send out a byte at the uart's 3rd register. it did this I guess on testing the uart (skip_test not supplied). So, I'm making a kernel module that simply maps the resources at the right places. I've got it to map the right locations (0x300002a8 physical for 8 bytes) using serial8250_register_port() which returns line 5.....ttyS5, right? Except now I just get a Read error when even trying to cat /dev/ttyS5. Is there something I'm missing in order to simply map a port and let the serial8250 driver handle it? |
I figured it out:
#1 I had to use irq 108 instead of irq 7 because 7 was my "ISA" irq. arch/arm/mach-pxa/viper.c maps ISA irqs to 101+isa_irq with some exceptions. #2 (this was the main reason it didn't work) the iotype (of the uart_port) had to be set to UPIO_MEM instead of UPIO_PORT. though I knew ARM doesn't have in/out-type instructions I thought the translation would be abstracted and not have to worry about other things. but it was pretty evident that serial_in() was using the port's iobase member (which I had set to the physical address of the 'port' [x300002a8]). So changing the port .iotype to UPIO_MEM, supplying UPF_BOOT_AUTOCONF | UPF_IOREMAP for the .flags, setting .mapbase to the physical address of the port, and using the ISA-mapped irq worked. The funny thing is that this board works using an .iotype of UPIO_PORT on a separate computer which is also ARM but a different machine type (ep93xx). However, it's a 2.4 kernel, while the stuff I'm working on is 2.6. |
PC/104 serial card on top of Viper
Hi debuser123,
I fall in the same problem as yours. But I don't really understand what you have done to solve the problem. Did you rebuild the 8250.o modul kernel or did you rebuild the setserial program. Thanks |
All times are GMT -5. The time now is 06:12 PM. |