serial console problem on imx31 target
Hi Guys,
I am trying to port linux to a custom imx31 based board which is similar to the LogicPD mx31litekit board. I have u-boot working and the kernel seems to be booting as I can see the kernel messages in the RAM ring buffer and it only panics when trying to boot the root filesystem, which I havn't provided just yet. My problem is that after the "booting kernel" message I get no serial output and have to look in the ring buffer with u-boot md to see the kernel messages. If I turn on earlyprintk by passing that kernel parameter, I see those messages, the problem is the console output is not working. Currently I am passing "noinitrd console=ttymxc0,115200n8 earlyprintk=serial,ttymxc0,115200,keep" to the kernel. I have all the CONFIG_CONSOLE_xx config options turned on for the imx in the kernel. In debugging this in the drivers/serial/mx.c file, I notice that the imx_console_xx style functions are NOT being called at all ... so not sure what I am missing here.. Can Anyone help here? EDIT: I notice that this post has gone in the Linux newbie forum, wher it was intended to go into the Hardware forum, so moderator please transfer thsi post. |
Bump! Anyone?
|
I went the next step and mounted the root filesystem via nfs ... that mounted ok, but I got a kernel panic after the warning message "Warning: no initial console found"
I guess this is all part of my problem of having no serial console working .. Question: Should I have a /dev/ttymxc0 in my /dev directory for the imx31? I only see a ttyS0 and a ttySA0 in that directory, but these don't work when passed on the kernel bootarg line either.. Can someone please help me get this serial console working ... |
Anyone on this forum??
|
help ..... Is this forum used at all? Or is it I have not provided enough info on the problem.
If the later, please indicate what info is missing ..... if the former ... I am stuffed ... |
Does your kernel have a built-in driver for the serial hardware that is present on your board? Have you been able to successfully exercise it from a userspace application? I don't see where there should be any connection between an NFS mount and a serial console. Is there a getty being spawned on the respective port? There should be a /dev/whatever device node in order to access the port. Are you sure of the name? Are you sure that the kernel uses comm's parameters (bit rate, word size, parity, etc) appropriate to your terminal setup? Does the driver require any hardware flow control or handshake on modem control lines?
I assume you've read and understand all of the usual tutorials and howtos for this kind of stuff. Linux Serial Console HOWTO Remote Serial Console HOWTO --- rod. |
Quote:
1. Does your kernel have a built-in driver for the serial hardware that is present on your board? The kernel has configuration options for the iMX31 internal serial ports, and there is a ../drivers/serial/imx.c file, so I guess the answer is yes. 2. Have you been able to successfully exercise it from a userspace application? What does this mean? I do not have a login to my kernel yet .. 3. Is there a getty being spawned on the respective port? There should be a /dev/whatever device node in order to access the port There was not a getty for the name of the port (ttySMX0) so I put one in the inittab file and created a dev/ttySMX0 device, as there was not one created. 4. Are you sure of the name? Are you sure that the kernel uses comm's parameters (bit rate, word size, parity, etc) No, I am not sure of the name, I have seen ttymxc used as well as ttySMX in reference to imx serial devices, I am sure of the baud rate etc though .. In the imx.c code I changed the "#define DEV_NAME "ttySMX" from ttymxc .... the uboot I am using shows a ttySMX device. In debugging this issue, I see that the function imx_serial_init() is called in imx.c but I see no probe call into the driver so in the kernel log all I am seeing is: Serial: IMX driver ... which is printed out by the above init function. I should be getting the following (as seen from other kernel posts for imx) Serial: IMX driver imx-uart.0: ttySMX0 at MMIO 0x1000a000 (irq = 20) is a IMX console [ttySMX0] enabled I am not getting that so the kernel is not seeing a serial device .. |
I didn't know whether you had some other way to login to the host, perhaps SSH or telnet over ethernet. Even still, it is possible to launch userspace applications as daemon processes.
That the kernel doesn't report the existence of some serial hardware seems likely to be the root of the problem. Is there any configuration issue that needs to be addressed? Jumpers on the board? BIOS/flash setup? When you changed the name of the serial port, did you make the accordant changes to the kernel commandline arguments? --- rod. |
Quote:
Since I am having this trouble getting serial console support, I tried logging in via ssh, but I get a "connection refused" error. I notice that dropbear is used as the ssh server in the image I built, but I don't even know if the init process is being called .... is there a way to verify the init process, or provide a simple inittab file that launches something simple (i.e just run dropbear ssh daemon) that I can login to .. I don't know anything about the init process, so some help here would be useful. (I am used to Archlinux which has a much simpler BSD style init process ..) Regarding configuration, I have attached some of my .config ... please see if there is a problem. and Yes, I did change the kernel arguments when I changes the serial port name. Quote:
|
From a cursory inspection, it looks like your kernel config contains everything I'd expect with respect to the serial port. What does 'CONFIG_SERIAL_NONSTANDARD' do (wondering aloud...)?
When I used the word 'configuration' I was really referring to something outside the OS; hardware or firmware. You can run anything as the init process. Many small system use busybox as the init process. As long as it is statically linked, you should be able to drop in your own simple code the exercise the serial port as a test & diagnostic of the serial port. I've been using Microcore Linux on small systems lately, and I find their init system very simple to understand and modify. --- rod. |
Quote:
Starting kernel ................. <-- This line printed by uboot Uncompressing Linux ..... done, booting the kernel. <--- This line is printed by the kernel All other kernel messages I only see in the kernel log in RAM (displayed by uboot after doing a reset of the box ..) Quote:
Thanks, B |
inittab is a configuration script used by some/most larger scale Linux distros, and is more or less standard in that class of Linux installation. The actual process that uses it is the init process (the name of the binary executable, as well as the generic name of the initial userspace process launched by the kernel). In some systems, init, the binary is just a part of busybox, and it treats it's 'inittab' script as just another shell script. As such, you can put anything in the script that you want.
I suggest you look at the Microcore Linux distro to see how they have done it. You don't have to install the system, just mount the ISO on a loop device, and browse the filesystem. Look specifically at the file '/etc/init.d/rcS' which is their version of the init startup script. It can be simplified even more that what they've provided, to the extent that the only thing you would run is some diagnostics. Or, to simplify even more, simply create a program (assuming you have the wherewithal to do so), statically linked, that does something that you can witness; blinks an LED, toggles an IO bit forever, whatever is available on your board. Specify that program as the init process in the kernel commandline args. If it gets launched by the kernel, you should be able to see it doing its thing. When you see it, you know the process is getting launched. The next step would be to see if you can access the serial port with a userspace tool. Again a simple statically linked binary that opens the serial port and repeatedly sends some data, which you should be able to see with a terminal running on another host. Of course, all of this requires a root filesystem, which upon re-reading this thread, I see that you don't yet have. Are you planning to mount an initrd, an NFS root, or some other media? How far away from being implemented is your root filesystem? I am still concerned that all of this is a moot point if the driver isn't seeing the serial port hardware. I do not know anything specific to your hardware or the respective driver, so I'm sorry I can't make any suggestion there. Is it possible to specify any details of the hardware (IO address, interrupt assignments, etc) to the serial port driver via the kernel commandline? --- rod. |
Hi Rod,
I have mounted an NFS root filesystem to see if I can get a console working, but my boot only gets to the "Freeing init memory: 104K" message, I don't see any messages on init starting up. I have created a root filesystem with openembedded, decompressed it into my /export directory on my host computer and it "seems" to be mounted correctly i.e this is from the kernel ring buffer Quote:
Quote:
|
if the device file didn't exist as expected then either
1) it is named something other than expected 2) the kernel isn't loading the driver properly was the driver compiled into the kernel or as a module? if it was compiled as a module you can either 1) re-compile the kernel with the driver built into the kernel (recommended for anything needed at time of boot since the modules load later in the boot sequence than can be used for time of boot options) 2) create an initramfs that loads the driver at boot time, then make sure the driver is in the modprobe.conf (or equivilent) for your system. (more complicated and less reliable) |
Quote:
Quote:
I still don't understand the connection between uboot and kernel when you give it a "console=ttySMX0,115200n8" kernel argument .. I know that the kernel when it sees that uses the argument as the console instead of the default tty1. But how does it know what serial port on the imx to use? If a driver gets registered (which it does) what stops it being "probed".. that bit is blank in my understanding .. |
All times are GMT -5. The time now is 11:46 PM. |