From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22954 invoked by alias); 22 Aug 2006 13:00:04 -0000 Received: (qmail 22813 invoked by uid 22791); 22 Aug 2006 13:00:01 -0000 X-Spam-Check-By: sourceware.org Received: from sta-204-188-98-27.rockynet.com (HELO hermes.chez-thomas.org) (204.188.98.27) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 22 Aug 2006 12:59:56 +0000 Received: by hermes.chez-thomas.org (Postfix, from userid 999) id 1C3C41950174; Tue, 22 Aug 2006 06:59:53 -0600 (MDT) Received: from [192.168.1.101] (hermes_local [192.168.1.101]) by hermes.chez-thomas.org (Postfix) with ESMTP id 5DA58195009A; Tue, 22 Aug 2006 06:59:51 -0600 (MDT) Message-ID: <44EAFFC5.5070306@mlbassoc.com> Date: Tue, 22 Aug 2006 13:00:00 -0000 From: Gary Thomas User-Agent: Thunderbird 1.5.0.5 (X11/20060808) MIME-Version: 1.0 To: Himanshu Patel CC: ecos-discuss@ecos.sourceware.org References: <001d01c6c5e9$7f8da940$8c00000a@himanshu> In-Reply-To: <001d01c6c5e9$7f8da940$8c00000a@himanshu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Serial Driver (Interrupt Mode) for PXA250 X-SW-Source: 2006-08/txt/msg00208.txt.bz2 Himanshu Patel wrote: > ----- Original Message ----- > From: Himanshu Patel > To: ecos-discuss@ecos.sourceware.org > Sent: Tuesday, August 22, 2006 6:17 PM > Subject: Re: [ECOS] Serial Driver (Interrupt Mode) for PXA250 > > > Hi, > > Any ideas? Let me know if any additional information is required. Why aren't you just using the generic 16x5x driver? Look at how I did it for the uE250 which is another PXA250 based system. > > Regards, > > Himanshu Patel > ----- Original Message ----- > From: Himanshu Patel > To: ecos-discuss@ecos.sourceware.org > Sent: Monday, August 21, 2006 7:11 PM > Subject: [ECOS] Serial Driver (Interrupt Mode) for PXA250 > > > Hi, > > I am working on PXA250 development board. ISR (and hence DSR) is not > getting fired for FFUART (Serial Driver works well in Polling Mode). > > Sending herewith code for Initialization and Configuration for reference: > > #define PXA2X0_FFUART0 0x40100000 > #define CYGNUM_HAL_INTERRUPT_USART0 (22) > > static bool triton_serial_config_port(serial_channel *chan, > cyg_serial_info_t *new_config, bool init) > { > triton_serial_info *triton_chan = (triton_serial_info *)chan->dev_priv; > CYG_ADDRWORD base = triton_chan->base; > cyg_uint32 baudrate; > cyg_uint32 parity = select_parity((cyg_uint32) new_config->parity); > cyg_uint32 word_length = select_word_length((cyg_uint32) > new_config->word_length); > cyg_uint32 stop_bits = select_stop_bits((cyg_uint32) new_config->stop); > if ((word_length == 0xFF) || (parity == 0xFF) || (stop_bits == 0xFF)) > { > return false; // Unsupported configuration > } > // Enable Divisor Latch Access Bit in Line Control Register. > HAL_WRITE_UINT32(base + PXA2X0_UART_LCR, PXA2X0_UART_LCR_DLAB); > baudrate = select_baudrate((cyg_uint32) new_config->baud); > // Divisor Latch Low Register > HAL_WRITE_UINT32(base + PXA2X0_UART_DLL, (baudrate & 0xFF)); > // Divisor Latch High Register > HAL_WRITE_UINT32(base + PXA2X0_UART_DLH, ((baudrate & 0xFF00) >> 8)); > // Disable Divisor Latch Access Bit in Line Control Register. > // Reset the Line Control Register. > HAL_WRITE_UINT32(base + PXA2X0_UART_LCR, 0x00); > // Configure Line Control Register > HAL_WRITE_UINT32(base + PXA2X0_UART_LCR, parity | word_length | stop_bits); > // Disable UART interrupts. > HAL_WRITE_UINT32(base + PXA2X0_UART_IER, 0x00000000); > // Enable UART Unit. > HAL_WRITE_UINT32(base + PXA2X0_UART_IER, PXA2X0_UART_IER_UUE); > #if CYGNUM_IO_SERIAL_ARM_TRITON_SERIAL0_BUFSIZE > 0 > // Enable Transmit and Receive FIFO > HAL_WRITE_UINT32(base + PXA2X0_UART_FCR, PXA2X0_UART_FCR_FCR0 | > PXA2X0_UART_FCR_FCR1 | PXA2X0_UART_FCR_FCR2); > // Enable Transmit, Receive interrupt. > HAL_WRITE_UINT32(base + PXA2X0_UART_IER, PXA2X0_UART_IER_TIE | > PXA2X0_UART_IER_RAVIE | PXA2X0_UART_IER_UUE); > #endif > return true; > } > > static bool triton_serial_init(struct cyg_devtab_entry *tab) > { > serial_channel *chan = (serial_channel *)tab->priv; > triton_serial_info *triton_chan = (triton_serial_info *) chan->dev_priv; > int res; > #ifdef CYGDBG_IO_INIT > diag_printf("TRITON SERIAL init - dev: %x.%d\n", triton_chan->base, > triton_chan->int_num); > #endif > // Really only required for interrupt driven devices. > (chan->callbacks->serial_init)(chan); > if(chan->out_cbuf.len != 0) > { > cyg_drv_interrupt_create(triton_chan->int_num, > 4, // Priority > (cyg_addrword_t)chan, // Data item passed > to interrupt handler > (cyg_ISR_t *)&triton_serial_ISR, > (cyg_DSR_t *)&triton_serial_DSR, > &triton_chan->serial_interrupt_handle, > &triton_chan->serial_interrupt); > cyg_drv_interrupt_attach(triton_chan->serial_interrupt_handle); > cyg_drv_interrupt_unmask(triton_chan->int_num); > } > res = triton_serial_config_port(chan, &chan->config, true); > return res; > } > > Any help would be greatly appreciated. > > Regards, > > Himanshu Patel > > -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss