Please find the attached file which we modified for UART1, as UART_NR
(driver/serial/8250.c) comes equal to 2 therefore only two port will be
supported - 0 and 1.
After All these changes what we find that all base address of uart1 is
coming alright as seen during bootup.

8250.c is interrupt based so after all instillation of uart1 and
registration of irq the communication should start as per interrupt but we
found that the interrupt is not occurring and therefore no transmission and
reception is taking place in uart1 , while the same is running fine for
uart0.

Do we need to do any thing else apart from these additions in 8250.c?

If any body has done the loopback for UART1 (not Onchip but external) then
please help us.

I am not clear whether 8250.c supports multiple uart apart form legacy
serial devices.  

If we short the external pins of uart1 and then try loopback will it work?

regards,
Shreshtha Kumar, Inder
________________________________________
From: SangJae H. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 05, 2006 11:58 AM
To: shreshtha; 'Kirill Sukhonosenko';
[email protected]
Subject: Re: Anybody using UART1, UART2 ?

Dear Shreshtha.
 
Thank you for reply..
 
I try to resolve this work.
 
First  I set UART 0,1,2 mode at bootloader at davinci.c.  I add blow lines
 
 
------- at davinci.c ----------
 
*(unsigned int*) (PSC_ADDR+0xA00+4*19) = *(unsigned int*)
(PSC_ADDR+0xA00+4*19) | 0x003; //for power on
*(unsigned int*) (PSC_ADDR+0xA00+4*20) = *(unsigned int*)
(PSC_ADDR+0xA00+4*20) | 0x003; //for power on
*(unsigned int*) (PSC_ADDR+0xA00+4*21) = *(unsigned int*)
(PSC_ADDR+0xA00+4*21) | 0x003; //for power on
#define UART0PWREMU_MGMT     0x01c20030
        *(volatile unsigned int*) UART0PWREMU_MGMT = 0x0000E003; //UART 0 
 
#define UART1PWREMU_MGMT     0x01c20430
        *(volatile unsigned int*) UART1PWREMU_MGMT = 0x0000E003; //UART 1
 
#define UART2PWREMU_MGMT     0x01c20830
        *(volatile unsigned int*) UART2PWREMU_MGMT = 0x0000E003; //UART 2
#define PINMUX0     0x01C40000
#define PINMUX4     0x01C40004
 
        /* Enable UART0 MUX lines */
        *(volatile unsigned int *)PINMUX4 |= 0x7;//1; //uart0,1,2 enable;
 
 
----------davinci.c end-----------
 
In kernel, i set power and clock( board-emv.c, serial.c , clock.c )
 
at board-emv.c, I add power enable for UART ( Already bootloader set, but I
set )
 
 board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_UART0, 1);
 board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_UART1, 1);
 board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_UART2, 1);
 
at serial.c, I am add serial_platform_data for UART1 and 2
 
static struct uart_port serial_platform_data[] = {
{
 .membase  = (unsigned char __iomem *)IO_ADDRESS(DAVINCI_UART0_BASE),
 .mapbase  = (unsigned long)DAVINCI_UART0_BASE,
 .iotype   = UPIO_MEM,
 .irq      = IRQ_UARTINT0,
 .uartclk  = 27000000,
 .regshift = 2,
 .type     = PORT_16550A,
}
,
{
        .membase  = (unsigned char __iomem *)IO_ADDRESS(DAVINCI_UART1_BASE),
        .mapbase  = (unsigned long)DAVINCI_UART1_BASE,
        .iotype   = UPIO_MEM,
        .irq      = IRQ_UARTINT1,
        .uartclk  = 27000000,
        .regshift = 2,
        .type     = PORT_16550A,
}
,
{
        .membase  = (unsigned char __iomem *)IO_ADDRESS(DAVINCI_UART2_BASE),
        .mapbase  = (unsigned long)DAVINCI_UART2_BASE,
        .iotype   = UPIO_MEM,
        .irq      = IRQ_UARTINT2,
        .uartclk  = 27000000,
        .regshift = 2,
        .type     = PORT_16550A,
}
};
 
and then, at davinci_serial_init(void)
{
    early_serial_settup(&serial_platform_data[0]); 
//    early_serial_settup(&serial_platform_data[1]);  // This line is error
, Kernel holding... 
//    early_serial_settup(&serial_platform_data[2]); //  This line is error
, Kernel holding...
}
 
At clock.c . I add UART1, UART2 clock enable function
 
 
#define DAVINCI_MAX_CLK 11 //9  add for UART1,2
 
///
  {
   .name = "UART0",
   .rate = &fixedrate,
   .enable   = 1,
   .maxuse   = 1,
   .lpsc = DAVINCI_LPSC_UART0,
  },
  {
   .name = "UART1",
   .rate = &fixedrate,
   .enable   = 1,
   .maxuse   = 1,
   .lpsc = DAVINCI_LPSC_UART1,
  },
  {
   .name = "UART2",
   .rate = &fixedrate,
   .enable   = 1,
   .maxuse   = 1,
   .lpsc = DAVINCI_LPSC_UART2,
  },  
  {
   .name = "EMACCLK",
   .rate = &commonrate,
   .lpsc = DAVINCI_LPSC_EMAC_WRAPPER,
   .maxuse   = 1,
  },
 
 
Above all, I don't still see UART1, UART2 kernel message..
 
ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
ttyS1 at MMIO 0x1c20400 (irq = 41) is a 16550A

ttyS2 at MMIO 0x1c20800 (irq = 42) is a 16550A
I am try to modify the asm/serial.h( SERIAL_PORT_DFNS ). 
 
If you can send it's files to me , plz do it.
 
Thank you 
 
Best Reards.
 
----- Original Message ----- 
From: shreshtha 
To: 'Kirill Sukhonosenko' ; 'SangJae H.' ;
[email protected] 
Sent: Monday, December 04, 2006 10:57 PM
Subject: RE: Anybody using UART1, UART2 ?

As we found that two are multiplexed 
UADRMTA_CTXKD/ 1 – PIN H3 and UADRMTA_RRQXD/ 1 – PIN G1, refer page 47 of
sprs283.

So we changed the Linux code (/arch/arm/mach-davinci/board-evm.c and
clock.c) 
 to enable the power of UART1 and to select UART1 from PINMUX1 (refer PINMUX
register in page72).

We are using the MVL401 kernel (which is newer than MVL402 provided earlier)
on DVEVM.

Now if I do “cat /dev/ttys/0” and typing any character gets loopbacked
But same is not true with dev/ttys/1.

In /dev/ttys/1 it gives following error – 
“cat: /dev/tts/1: Input/output error”

While kernel boots up it displays following message with standard kernel
***************
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
Registering platform device 'serial8250'. Parent at platform
ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
***************

With our modified kernel it displays following message
**************
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
Registering platform device 'serial8250'. Parent at platform
ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
ttyS1 at MMIO 0x1c20400 (irq = 41) is a 16550A
*************


Did you got your UART working without changing any driver?
If so please help, as we were not able to do so even without above mentioned
changed.

If you want I can send you the changes done by us in board-evm.c, serial.c
and clock.c


regards,
Shreshtha Kumar, Inder
________________________________________
From: Kirill Sukhonosenko [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 04, 2006 6:50 PM
To: 'shreshtha'; 'SangJae H.';
[email protected]
Subject: RE: Anybody using UART1, UART2 ?

Hi,

I thought the problem as due invalid device name you were trying to use... 
I am using TI DVEM board and I can easily use both UARTs and ATA with kernel
(and u-boot) supplied by default. 
Have you changed the kernel or u-boot?

What software you are referring by “I'm using 1.0.0 version software” ?

Kirill

________________________________________
From: shreshtha [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 04, 2006 2:56 PM
To: 'SangJae H.'; [email protected]
Cc: 'Kirill Sukhonosenko'
Subject: RE: Anybody using UART1, UART2 ?

Presently 0 and 1 nodes are being created inside /dev/tts for UART0 and 1
respectively.
But as UART1 and ATA are multiplied and by default ATA is enabled so for
using UART1 we need to first enable at h/w level.
This h/w init can be done in UBOOT or /arch/arm/mach-davinci/board-evm.c.
and in clock.c in same directory.

This works to enable the h/w but still we are not able to use UART1 from
/dev/tts/1.

We found that all the structure info for UART1 was 0x00 for e.g. UART1 base
etc.
We passed structure for UART1 similar as done for UART0 in serial.c present
in same mach-davinci

Now the base addresses etc for UART1 is showing OK during registration of
UART1 in /driver/serial/8250.c 
U can even see this by following command
            cat /dev/tts/1

Still we are not able to get interrupt from UART1.

Kirill if u see any thing missing/wrong in above procedure please help.


regards,
Shreshtha Kumar, Inder
________________________________________
From: Kirill Sukhonosenko [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 04, 2006 3:26 PM
To: 'SangJae H.'; [email protected]
Subject: RE: Anybody using UART1, UART2 ?

Hi,

Please try those found in /dev/tts

Regards,
Kirill
________________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
SangJae H.
Sent: Monday, December 04, 2006 8:22 AM
To: [email protected]
Subject: Anybody using UART1, UART2 ?

Hi 
 
I'm using 1.0.0 version software 
 
Anybody using UART1 and UART2 ( ex. /dev/ttyS0, /dev/ttyS1, /dev/ttyS2 )
 
I see at /dev/ directory, there is not /dev/ttyS? , only /dev/console 
I see init kernel boot message blow
 
---
ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
---
 
How can I enable UART1 and UART2 ?
 
Thank you.
 
 

Attachment: clock.c
Description: Binary data

Attachment: serial.c
Description: Binary data

Attachment: board-evm.c
Description: Binary data

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to