LS1021A-PB: Early UART Debugging on ttyS0 (Bank-0)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1021A-PB: Early UART Debugging on ttyS0 (Bank-0)

Jump to solution
5,846 Views
skrishnakar
Contributor III

Hi,

I am trying to get the EARLY_DEBUG working for LS1021A-PB on BANK-0 i.e via. standard 8250/16550 UART and it seems the kernel hangs after "Starting Kernel..." without proceeding further, as shown below:

Bootargs appended: earlycon=uart8250,mmio,0x21c0500

-----------------------------------------------------------------------------

## Booting kernel from Legacy Image at 81000000 ...

   Image Name:   Linux-4.1.8-rt8+

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    4352576 Bytes = 4.2 MiB

   Load Address: 80008000

   Entry Point:  80008000

   Verifying Checksum ... OK

## Flattened Device Tree blob at 81f00000

   Booting using the fdt blob at 0x81f00000

   Loading Kernel Image ... OK

   Loading Device Tree to bef11000, end bef19469 ... OK

Starting kernel ...

   <<<< --- HANGS HERE ----->>>>>

-----------------------------------------------------------------------------

Kernel config options enabled:

---------------------------------------

CONFIG_DEBUG_LL=y

CONFIG_DEBUG_LL_UART_8250=y

CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"

# CONFIG_DEBUG_UART_8250 is not set

CONFIG_DEBUG_UART_PHYS=0x21c0500

CONFIG_DEBUG_UART_VIRT=0xf21c0500

CONFIG_DEBUG_UART_8250_SHIFT=2

CONFIG_SERIAL_EARLYCON=y

CONFIG_EARLY_PRINTK=y

---------------------------------------

Any inputs are highly appreciated If I am missing anything or doing something wrong in configuration.

Thanks,

SK

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
4,147 Views
skrishnakar
Contributor III

Hello Yiping,

I had already set the fdt_high to 0xffffffff looking into latest u-boot, but no success with that. However changing the virtual UART address made the board boot properly with earlycon params as seen below:

CONFIG_DEBUG_UART_PHYS=0x21c0500

CONFIG_DEBUG_UART_VIRT=0xfe1c0500

Bootargs: earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 earlyprintk

Thanks,

Skrishna

View solution in original post

0 Kudos
Reply
7 Replies
4,147 Views
jasonhendrix
Contributor V

Hi Srikanth,

I'm facing a similar problem and would like to know you figured out what the virutal address of the UART (CONFIG_DEBUG_UART_VIRT) should be.  Can you advise?  Thanks.

0 Kudos
Reply
4,147 Views
skrishnakar
Contributor III

Hi Jason,

Make sure you have following config options set:

CONFIG_EARLY_PRINTK=y

CONFIG_DEBUG_LL_UART_8250=y

CONFIG_DEBUG_UART_PHYS=0x21c0500

CONFIG_DEBUG_UART_VIRT=0xfe1c0500

CONFIG_DEBUG_UART_8250_SHIFT=0

# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set

Bootargs: earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 earlyprintk

--

Srikanth

0 Kudos
Reply
4,147 Views
jasonhendrix
Contributor V

Thanks srikanth, that actually helped - I get the message "Uncompressing Linux ... done.  Booting the Kernel" now.  Do you remember how you came up with the value 0xFE1C0500? 

More info - I started with the QORIQ SDK v1.9 for the LS1021A-TWR board, using Linux 3.12 (which is why I think our virtual addresses might differ).  

booting...
## Booting kernel from Legacy Image at 83000000 ...
Image Name: Linux-3.12.37-rt51+g67e4f3b
...

Using Device Tree in place at 98000000, end 9800792c

Starting kernel ...


Uncompressing Linux... done, booting the kernel.

Thanks again.

0 Kudos
Reply
4,149 Views
skrishnakar
Contributor III

Jason,

I have tested this on TWR-LS1021A-PB  with Qoriq SDK-v2.0 that has linux-4.1, All I see is relocation address difference in yours:

-----------------------------------

Uncompressing Linux... done, booting the kernel. 
[    0.000000] Booting Linux on physical CPU 0xf00 
[    0.000000] Initializing cgroup subsys cpu 
[    0.000000] Initializing cgroup subsys cpuacct 
[    0.000000] Linux version 4.1.8-rt8+ (root@ubuntu) (gcc version 5.2.0 (Sourcery CodeBench 2015.12-138) ) #1 SMP Mon Jul 4 16:59:39 IST 2016 
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=70c5387d 
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache 
[    0.000000] Machine model: LS1021A TWR Board 
[    0.000000] earlycon: Early serial console at MMIO 0x21c0500 (options '') 
[    0.000000] earlycon: earlycon_map: Couldn't map 0x21c0500 
[    0.000000] Malformed early option 'earlycon' 
[    0.000000] bootconsole [earlycon0] enabled 
[    0.000000] Forcing write-allocate cache policy for SMP 
[    0.000000] Memory policy: Data cache writealloc 
[    0.000000] psci: probing for conduit method from DT.

-----------------------------------

I saw the address conversion some where in the past discussion of Early uart on LS1043. It appears your kernel is entering the early debugging.. can you check If the fdt_high is set appropriately as mentioned by "Yiping" above ?

Thanks.

0 Kudos
Reply
4,149 Views
jasonhendrix
Contributor V

Hi Srikanth,

  Thanks again for taking the time to respond.  It's very possible that the virtual address you provided is also correct for my system.  The problem might not be UART config, but some other crash instead.  I'll start looking at the code around the message "Booting Linux on Physical CPU..."  I do have fdt_high set, here are my enviro variables:

=> printenv
baudrate=115200
bootargs=earlycon=uart8250,mmio,0x21d0500 console=ttyS2,115200 earlyprintk
bootdelay=3
dboot=tftp 80000000 krnld.img; source 80000000
dnsip=192.177.13.14
eth1addr=00:04:9f:03:ec:08
eth2addr=00:04:9f:03:ec:09
ethact=eTSEC1
ethaddr=00:04:9f:03:ec:07
ethprime=eTSEC1
fdt_high=0xffffffff
gatewayip=192.111.11.111
initrd_high=0xffffffff
ipaddr=192.168.11.11
netmask=255.255.255.0
serverip=192.168.11.22
stderr=serial
stdin=serial
stdout=serial

Environment size: 494/4092 bytes

0 Kudos
Reply
4,150 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Srikanth Krishnakar,

It seems that this problem is caused by dtb loading to other place, please refer to the following in your log.

Loading Device Tree to bef11000, end bef19469 ...

Please set the variable  "fdt_high=0xffffffff" in your u-boot environment to avoid fdt reloading.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
4,148 Views
skrishnakar
Contributor III

Hello Yiping,

I had already set the fdt_high to 0xffffffff looking into latest u-boot, but no success with that. However changing the virtual UART address made the board boot properly with earlycon params as seen below:

CONFIG_DEBUG_UART_PHYS=0x21c0500

CONFIG_DEBUG_UART_VIRT=0xfe1c0500

Bootargs: earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 earlyprintk

Thanks,

Skrishna

0 Kudos
Reply