On Wed, Sep 22, 2010 at 11:49:25AM -0700, Ardelean, Andrei wrote:
> I am using MALTA and my goal is to port MIPS Linux on a new platform.
> Which driver (source code) is used for tty0 (console)? I see the support
> for "early console" but I think that this is not the real Linux driver
> used after boot stage.
Correct. Early console uses an extremly simple driver which in general
is separate from the full blown driver that takes over later.
> More general, how to find which code source is used for an embedded
> driver (part of the Kernel at compiling time) for each h/w resource.
> MIPS Linux distribution comes with a lot of drivers but I have
> difficulties to figure out which one is used for MALTA. Is it a files
> where all those are registered?
For any modern style driver that information is available through sysfs.
For example on this laptop here:
# cd /sys/devices/platform/serial8250
# ls -l
lrwxrwxrwx. 1 root root 0 Sep 24 12:20 driver ->
-r--r--r--. 1 root root 4096 Sep 24 12:20 modalias
drwxr-xr-x. 2 root root 0 Sep 24 12:20 power
lrwxrwxrwx. 1 root root 0 Sep 24 12:20 subsystem -> ../../../bus/platform
drwxr-xr-x. 5 root root 0 Sep 24 12:20 tty
-rw-r--r--. 1 root root 4096 Sep 24 12:20 uevent
So you see the driver being used is the 8250 driver. Similar you can
find the driver for a PCI device in /sys/devices/pci* etc.