This solution is tested for UART1. Doing similar changes will get UART2 up and running.
These peripherals are multiplexed with ATA and Video respectively. So enabling UART1 and UART2 will disable ATA and Video. Uart1.txt contains all the required changes in the kernel to make UART1 running(with standard tty core). Rs485.c, app_485.c, Makefile, README_rs485 are for standalone (doesn't uses serial driver of linux) character driver for UART1. Cheers!!! Inder Shreshtha
README_rs485
Description: Binary data
Makefile
Description: Binary data
rs485.c
Description: Binary data
app_485.c
Description: Binary data
UART 1 Enabling in Montavista Linux for DVEVM ============================================= 1. Compile the kernel with following changes . 2. It will create a node - /dev/tts/1 3. Check the major and minor number using "ls -l /dev/tts/1" It should come out to be 4 and 65. 4. Set the line flags in the test application (see that echo is disabled) Changes in following files are made : 1.FILE: $KERNEL_DIR/arch/arm/mach-davinci/serial.c Change: Instance of "static struct uart_port" for UART1 is added along with UART0 Code: Change #1 ========= 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, .line = 0, .flags = ASYNC_SKIP_TEST, }, { .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, .line = 1, .flags = ASYNC_SKIP_TEST, } }; Change #2 ========= #ifdef CONFIG_SERIAL_8250 early_serial_setup(&serial_platform_data[0]); early_serial_setup(&serial_platform_data[1]); #endif 2.FILE: $KERNEL_DIR/arch/arm/mach-davinci/clock.c Change: Clock instance for UART1 Code: Change #1 ========= Add a member of UART1 clock in "davinci_clk", instastance of "static struct clk" { .name = "UART1", .rate = &fixedrate, .usecount = 1, .lpsc = DAVINCI_LPSC_UART1, }, Change #2 ========= Increment the value of DAVINCI_MAX_CLK by 1 to adjust for UART1 added member in "davinci_clk". Change #3 ========= Add a case in board_setup_peripheral function /* As ATA and UART1 are muxed, doing following will disable ATA */ case DAVINCI_LPSC_UART1: PINMUX0&=0xfffcffff; PINMUX1|=3; break; 3.FILE: $KERNEL_DIR/arch/arm/mach-davinci/board-evm.c Change: Power on the UART1 peripheral and reset and start the RX and TX of UART1 Code: Change #1 ========= static void board_init(void) { board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_VPSSMSTR, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_VPSSSLV, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TPCC, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TPTC0, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TPTC1, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_GPIO, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_UART1, 1); /* Turn on WatchDog timer LPSC. Needed for RESET to work */ board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TIMER2, 1); davinci_serial_init(); volatile int *ptr_pgmgt,*ptr_ier; ptr_pgmgt = (volatile int *)IO_ADDRESS(DAVINCI_UART1_BASE+0x30) ; ptr_ier =(volatile int *)IO_ADDRESS(DAVINCI_UART1_BASE+0x4); *ptr_pgmgt = 0x0; //reset tx and rx *ptr_ier = 0x0; //disable int int del=0; for(del=0; del <100000 ; del++) // For delay *ptr_pgmgt =0x6001; /* Initialize the clock configurations */ davinci_clk_init(); }
_______________________________________________ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source