Skip to contentSkip to conversation

What's wrong with the serial port?

DISCUSSION Shawn Jin 2 participants 6 messages Aug 11, 2005 – Aug 17, 2005

lore
Share & tools
lore

Shawn Jin

author
#0 lore raw

Hi,

I'm porting linux 2.6.11.4 to a custom SoC with ppc440 core. The UART is 16550 compatible. U-Boot is already running fine.

When the kernel is booting, it gets to the point where console_init() is called, which calls individual early console initialization functions. In my case it's serial8250_console_init(). Before register_console() is called in serial8250_console_init(), everything seems fine because the debugging logs are printed on the serial port. But once register_console() is called, the serial port continues spitting out =E0. See the following message. What's wrong?

Any hints are appreciated!

Boot reached stage 4 =

    =20
Boot reached stage 5                                                       =
    =20
Boot reached stage 6                                                       =
    =20
OK                                                                         =
    =20
Boot reached stage 7                                                       =
    =20
Boot reached stage 8                                                       =
    =20
## Current stack ends at 0x01FC6B80 =3D> set upper limit to 0x00800000     =
      =20
## cmdline at 0x007FFF00 ... 0x007FFF10                                    =
    =20
bd address  =3D 0x01FC6F90                                                 =
      =20
memstart    =3D 0x00000000                                                 =
      =20
memsize     =3D 0x02000000                                                 =
      =20
flashstart  =3D 0x00000000                                                 =
      =20
flashsize   =3D 0x00000000                                                 =
      =20
flashoffset =3D 0x00000000                                                 =
      =20
sramstart   =3D 0x00000000                                                 =
      =20
sramsize    =3D 0x00000000                                                 =
      =20
bootflags   =3D 0x00000000                                                 =
      =20
intfreq     =3D    400 MHz                                                 =
      =20
busfreq     =3D    266 MHz                                                 =
      =20
ethaddr     =3D 00:00:00:00:00:00                                          =
      =20
IP addr     =3D 0.0.0.0                                                    =
      =20
baudrate    =3D 115200 bps                                                 =
      =20
Boot reached stage 14                                                      =
    =20
No initrd                                                                  =
    =20
## Transferring control to Linux (at address 00000000) ...                 =
    =20
Boot reached stage 15                                                      =
    =20
id mach(): done                                                            =
    =20
MMU:enter                                                                  =
    =20
MMU:hw init                                                                =
    =20
MMU:mapin                                                                  =
    =20
MMU:setio                                                                  =
    =20
MMU:exit                                                                   =
    =20
setup_arch: enter                                                          =
    =20
setup_arch: bootmem                                                        =
    =20
arch: exit                                                                 =
    =20

=E0=E0=E0=E0=E0=E0 =20

-Shawn.

#1 lore raw
Quoted 37 lines · Shawn Jin

Hi,

I'm porting linux 2.6.11.4 to a custom SoC with ppc440 core. The UART is 16550 compatible. U-Boot is already running fine.

When the kernel is booting, it gets to the point where console_init() is called, which calls individual early console initialization functions. In my case it's serial8250_console_init(). Before register_console() is called in serial8250_console_init(), everything seems fine because the debugging logs are printed on the serial port. But once register_console() is called, the serial port continues spitting out ?. See the following message. What's wrong?

Any hints are appreciated!

Boot reached stage 4
Boot reached stage 5
Boot reached stage 6
OK
Boot reached stage 7
Boot reached stage 8
## Current stack ends at 0x01FC6B80 => set upper limit to 0x00800000 ## cmdline at 0x007FFF00 ... 0x007FFF10

bd address  = 0x01FC6F90                                                        
memstart    = 0x00000000                                                        
memsize     = 0x02000000                                                        
flashstart  = 0x00000000                                                        
flashsize   = 0x00000000                                                        
flashoffset = 0x00000000                                                        
sramstart   = 0x00000000                                                        
sramsize    = 0x00000000                                                        
bootflags   = 0x00000000                                                        
intfreq     =    400 MHz                                                        
busfreq     =    266 MHz                                                        
ethaddr     = 00:00:00:00:00:00                                                 
IP addr     = 0.0.0.0                                                           
baudrate    = 115200 bps                                                        
Quoted 14 lines

Boot reached stage 14
No initrd
## Transferring control to Linux (at address 00000000) ... Boot reached stage 15
id mach(): done
MMU:enter
MMU:hw init
MMU:mapin
MMU:setio
MMU:exit
setup_arch: enter
setup_arch: bootmem
arch: exit
??????

Try disabling early text debugging (all that "MMU:..." stuff).

Signature · 1 line
Eugene
#2 lore raw
Quoted 8 lines · Eugene Surovegin
Quoted 5 lines

MMU:exit
setup_arch: enter
setup_arch: bootmem
arch: exit
??????

Try disabling early text debugging (all that "MMU:..." stuff).

Also, make sure you pass correct "console=..." line to the kernel (with correct device name and baud rate).

Signature · 1 line
Eugene
author
#3 lore raw
Quoted 7 lines · Eugene Surovegin
Quoted 6 lines · Eugene Surovegin
Quoted 5 lines

MMU:exit
setup_arch: enter
setup_arch: bootmem
arch: exit
??????

Quoted 5 lines
Quoted 2 lines

Try disabling early text debugging (all that "MMU:..." stuff).

=20
Also, make sure you pass correct "console=3D..." line to the kernel (with correct device name and baud rate).

After early text debugging is disabled and the correct "console=3DttyS0, 115200" option is passed to kernel, the problem still exists. Also I'm sure the divisor set to UART is also correct because they are the same values when U-Boot sets up the port.

Has the serial port enabled interrupt so far at this stage?

Thanks,
-Shawn.

author
#4 lore raw
Quoted 1 line

Has the serial port enabled interrupt so far at this stage?

Don't bother. I found the answer. console_init() is before local_irq_enable(). So no interrupt is enabled before local_irq_enable().

-Shawn.

author
#5 lore raw
In reply to Shawn Jin
Quoted 7 lines

When the kernel is booting, it gets to the point where console_init() is called, which calls individual early console initialization functions. In my case it's serial8250_console_init(). Before register_console() is called in serial8250_console_init(), everything seems fine because the debugging logs are printed on the serial port. But once register_console() is called, the serial port continues spitting out =E0. See the following message. What's wrong?

FYI. The problem was caused by the endianess of io mem access. My 16550-compatible uart port is on a 32-bit bus. The io mem is big endian. The current serial8250 driver always call read*/write*() to access uart control registers. These functions are implemented for little endian access only. So I have to add some awful #ifdef in the driver to call big endian access functions.

Regards,
-Shawn.