lkml.org 
[lkml]   [2005]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Subjectselfmade serial driver problem with chipset other than VIA
From
firstly i would like to apologize cause i send this mail to linux-kernel
mailling list and not to linux serial but linux-serial@vger.kernel.org
don't accept the email.

On Mon, 2005-12-19 at 18:12 +0200, giorgos xatzipavlis wrote:
> hello people
>
> this is my first attempt to the linux serial mailling list so i
> apologize for my mistakes...
>
> i am a newbie in kernel development.
>
> i have made a serial driver cause i want to communicate with a serial
device ( a microcontroller ). I have programmed the driver in my
computer and everything is working ok. I have an AMD 1000Hz, MSI
motherboard with VIA chipset and kernel 2.4.31. I have found
> informations from Linux Deveice Drivers book. Everything is working ok
in my computer but the driver isn't working in computers with INTEL and
NVIDIA chipsets. The fact that makes me suspicious about that
> is that although my driver is registered in /proc/interrupts
> and /proc/ioports (irq 4-ioport 0x03f8) when ever i call outb from my
writer bottomhalf routine the interrupt isn't generated from the
hardware(in machines with inter or nvidia chipset).
>
> the flow chart is somethink like that:
>
> 1)user space write (getting the data from user)
>
> 2)kernel space write (generating the package that i want to send)
>
> 3)writer_bottomhalf (i have the package in writer_buffer indexed by a
> bytes_send variable. Call
"outb(writer_buffer[bytes_send],MY_UART+UART_TX)" )
>
> 4)interrupt handler (bytes_send++ ,so i can send the next character
variable,
> call "tasklet_schedule(&writer_bottomhalf)" to go to step 3)
>
> in computers with chipsets other than VIA the 4th step (interrupt
handler) is
> never executed.
>
> any ideas?
>
> thank


secondly alan cox respond with:

On Mon, 2005-12-19 at 18:03 +0000, Alan Cox wrote:
> > 2)kernel space write (generating the package that i want to send)
> > 3)writer_bottomhalf (i have the package in writer_buffer indexed by a
> > bytes_send variable. Call
"outb(writer_buffer[bytes_send],MY_UART+UART_TX)" )
> >
> > 4)interrupt handler (bytes_send++ ,so i can send the next
character variable,
> > call "tasklet_schedule(&writer_bottomhalf)" to go to step 3)
> >
> > in computers with chipsets other than VIA the 4th step (interrupt
handler) is
> > never executed.
>
>
> Have you set up the interrupt enables in the 16x50 chip. If you've not
done that step then it may depend on the vendor/BIOS what state the chip
is in when you boot.
>
> You might want to print out the registers at boot on each system and
look at the differences



in the initialization routine i enable the interrupts

"outb( UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI , eib_io+UART_IER);"
where eib_io = 0x03f8.

in the writer_bottomhalf i do:

//bytes_send :index to writer buffer which holds the package
//writer_length :length of the package i want to send
//foo :struct timeval for debugging reasons

if(bytes_send==writer_length){ // i have send the whole package
//starting timer to catch unacknowledged packages
}
else{
outb(writer[bytes_send],eib_io+UART_TX);
printk(KERN_ALERT"sending %x %ld %ld\n",
writer[bytes_send],foo.tv_sec,foo.tv_usec);
}
return;
and in interrupt handler

static void interrupt_handler(int irq, void *dev_id, struct pt_regs *regs){
// code for other interrupts

if ( inb( eib_io + UART_LSR ) & ( UART_LSR_THRE) ){
bytes_send++;
tasklet_schedule(&writer_tasklet);
return;

}
}
so whenever the interrupt handler is calling i increase the bytes_send and
i return to writer_bottomhalf to send the next character of the package.
My question is that if there are differencies in the
implementation of the UARTS between VIA and other manufacturers?
I can't understand why this piece of shit is working only in VIA.
i use 2.4.31 compiled with the same .config except the processor's type
and chipset support in block devices section(linux serial driver
compiled as a module that i don't load at all).

i can't understand what registers to print during boot as alan proposed
the registers from 0x03f8 - 0x03ff (aka /dev/ttyS0)?

thanks and sorry for the length of the message...

P.S: do i have to send every email to linux-kernel@vger.kernel.org or to
linux-serial@vger.kernel.org



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-19 22:44    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site