LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Changing console port using boot args of bootloader (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/changing-console-port-using-boot-args-of-bootloader-4175444910/)

SIG_SEGV 01-09-2013 11:07 PM

Changing console port using boot args of bootloader
 
Hello guys,
I am using a board with 4 com ports (0,1,2,3). I communicate with board through minicom via com 0. Things are working fine. Now I have done RS485 test for all the com ports, except com0 (as it is a console port: engaged with minicom). Now in-order to undertake RS-485 test for com0, i have to change my board's console port to any other port (ex: com2). I tried to do this by changing the bootargs of u-boot.

Code:

set bootargs root=/dev/mtdblock1 rw rootfstype=jffs2 mtdparts=physmap-flash.0:2688k(kernel)ro,32256k(root) console=ttyS2,19200

But doing so, is not changing the linux console to com2. linux is still booting with com0 as a console. My clients are asking me for RS485 test procedure for com0. I am in hurry.....Please help me :confused:

theNbomr 01-11-2013 10:47 AM

I have seen (just yesterday, in fact) where the bootloader and the Linux kernel seem to adopt a different definition of which serial port is assigned which name. My PXE bootloader sees one port as ttyS0, while the kernel it loads sees ttyS0 as a different port. Is this perhaps what your problem is?

--- rod.

SIG_SEGV 01-16-2013 01:33 AM

Changing CONSOLE from ttyS0 to ttyS2
 
Quote:

Originally Posted by theNbomr (Post 4867870)
I have seen (just yesterday, in fact) where the bootloader and the Linux kernel seem to adopt a different definition of which serial port is assigned which name. My PXE bootloader sees one port as ttyS0, while the kernel it loads sees ttyS0 as a different port. Is this perhaps what your problem is?

--- rod.

No, no, no my friend. Its just simple as "In linux (2.6.25) the console is currently running on ttyS0 (means com0) in my board. Now i have to change the console to ttyS2 instead (there are 4 ports in my board) , inorder to use ttyS0 for other purpose. Got it???
Any suggestions for the quest???

theNbomr 01-16-2013 09:20 AM

Okay, I was just trying to make sure you aren't being sucked out by nomenclature. One man's COM1: is not always another man's ttyS0.
After you set the console port in the bootloader, what does the kernel commandline look like (visible in /proc/cmdline). Your use of kernel arguments in the bootloader looks fine to me. Since this doesn't seem to be a PC architecture (U-boot, AFAIK doesn't run on x86), is it possible that there needs to be a driver loaded to support 'COM2:, COM3:, ...', and the kernel is therefore unable to use one of those as a console? What information about the serial ports is reported in the kernel messages at boot time?

--- rod.

SIG_SEGV 01-21-2013 12:36 AM

@theNbomr

sorry, was busy.
Yes the Kernel booting shows me the below messages.

console [ttyS0] enabled

After this it even considers my KERNEL command line given from the boot loader as:
Kernel command line:root=/dev/mtdblock1 rw rootfstype=jffs2 mtdparts=physmap-flash.0:2688k(kernel)ro,62720k(root) console=ttyS2,19200

But still the kernel isn't affecting the COM2(ttyS2) of my board.
I gone through the source and finally i got the CRUX that in register_console function it has been hard coded to ttyS0 only.
So, my cmd line from boot loader has no effect on kernel w.r.t "console" parameter. Don't know why the developers has done SO....
My boss isn't accepting the kernel code change proposed by me.....

theNbomr 01-23-2013 10:31 AM

Quote:

Originally Posted by SIG_SEGV (Post 4874456)
Yes the Kernel booting shows me the below messages.

console [ttyS0] enabled

But what about the other serial ports? If the kernel doesn't know about them at boot time, it cannot use them as a console. We already knew that the ttyS0 port was supported.

--- rod.


All times are GMT -5. The time now is 11:37 AM.