UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer dagan.martinez
Observer
155 Views
Registered: ‎11-05-2018

Petalinux - is the kernel meant to reset after "bootconsole [cdns0] disabled"?

Jump to solution

Hardware: ZCU102(rev 1, I think?), just using the default .bit from the BSP on the Xilinx downloads page
Software: 2019.1 Petalinux, 2018.1 U-Boot, 2019.1 SDK

I'm booting Petalinux from U-Boot. When I have a baremetal application running concurrently, Petalinux stops at "bootconsole [cdns0] disabled." When I don't have any other application (just U-Boot, FSBL, PMU-FW, ATF, and Petalinux), the kernel seems to reset after "bootconsole [cdns0] disabled" the first time, but continues after the second time:

 

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.19.0 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Thu Sep 12 17:33:27 UTC 2019
[    0.000000] Machine model: ZynqMP ZCU102 Rev1.0
[    0.000000] earlycon: cdns0 at MMIO 0x00000000ff000000 (options '115200n8')
[    0.000000] bootconsole [cdns0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 256 MiB at 0x0000000070000000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] random: get_random_bytes called from start_kernel+0x94/0x3f8 with crng_init=0
[    0.000000] percpu: Embedded 22 pages/cpu @(____ptrval____) s52504 r8192 d29416 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] CPU features: detected: Kernel page table isolation (KPTI)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 1034240
[    0.000000] Kernel command line: earlycon clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait
[    0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
[    0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] software IO TLB: mapped [mem 0x6bfff000-0x6ffff000] (64MB)
[    0.000000] Memory: 3768604K/4194304K available (10684K kernel code, 628K rwdata, 5380K rodata, 16128K init, 308K bss, 163556K reserved, 262144K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] arch_timer: cp15 timer(s) running at 99.99MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x170f8de2d3, max_idle_ns: 440795206112 ns
[    0.000003] sched_clock: 56 bits at 99MHz, resolution 10ns, wraps every 4398046511101ns
[    0.008237] Console: colour dummy device 80x25
[    0.012377] console [tty0] enabled
[    0.015744] bootconsole [cdns0] disabled
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.19.0 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Thu Sep 12 17:33:27 UTC 2019
[    0.000000] Machine model: ZynqMP ZCU102 Rev1.0
[    0.000000] earlycon: cdns0 at MMIO 0x00000000ff000000 (options '115200n8')
[    0.000000] bootconsole [cdns0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 256 MiB at 0x0000000070000000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] random: get_random_bytes called from start_kernel+0x94/0x3f8 with crng_init=0
[    0.000000] percpu: Embedded 22 pages/cpu @(____ptrval____) s52504 r8192 d29416 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] CPU features: detected: Kernel page table isolation (KPTI)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 1034240
[    0.000000] Kernel command line: earlycon clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait
[    0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
[    0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] software IO TLB: mapped [mem 0x6bfff000-0x6ffff000] (64MB)
[    0.000000] Memory: 3768604K/4194304K available (10684K kernel code, 628K rwdata, 5380K rodata, 16128K init, 308K bss, 163556K reserved, 262144K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] arch_timer: cp15 timer(s) running at 99.99MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x170f8de2d3, max_idle_ns: 440795206112 ns
[    0.000003] sched_clock: 56 bits at 99MHz, resolution 10ns, wraps every 4398046511101ns
[    0.008237] Console: colour dummy device 80x25
[    0.012377] console [tty0] enabled
[    0.015744] bootconsole [cdns0] disabled
[    0.019655] Calibrating delay loop (skipped), value calculated using timer frequency.. 199.98 BogoMIPS (lpj=399960)
[    0.019669] pid_max: default: 32768 minimum: 301
[    0.019786] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.019804] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.020486] ASID allocator initialised with 32768 entries
[    0.020538] rcu: Hierarchical SRCU implementation.

etc

 

The reset seems to happen after console_lock() in unregister_console() in kernel/printk/printk.c, but I can't find out which line is responsible for this.  Adding pr_notice statements sometimes changes the behavior in unpredictable ways, so it's hard to figure out what's going on.

My question is: is it normal for the Petalinux kernel to reset after this line? If not, what could be a reason for this? 

My thought process is that if this is not expected behavior, it could be a clue to my larger issue, and if it is, I can look elsewhere.

0 Kudos
1 Solution

Accepted Solutions
Scholar rfs613
Scholar
136 Views
Registered: ‎05-28-2013

Re: Petalinux - is the kernel meant to reset after "bootconsole [cdns0] disabled"?

Jump to solution

The kernel is not rebooting. Rather, you are seeing the boot messages twice. The reason for this is because you have "earlycon" in your kernel command line arguments.

 

Normally, the prink messages get buffered in RAM (printk ring buffer) during the early portion of the boot, eg. before the serial console is setup. But using 'earlycon' switches on an earlier facility, meant to help debug problems during the early startup.

 

Once the real console is enabled ("console [tty0] enabled"), all the buffered output gets printed - this is why you are seeing all the messages repeated a second time. Normally this would be the only copy that is shown.

 

So, I would suggest removing "earlycon" from your commandline.

 

[Edit: formatting]

0 Kudos
1 Reply
Scholar rfs613
Scholar
137 Views
Registered: ‎05-28-2013

Re: Petalinux - is the kernel meant to reset after "bootconsole [cdns0] disabled"?

Jump to solution

The kernel is not rebooting. Rather, you are seeing the boot messages twice. The reason for this is because you have "earlycon" in your kernel command line arguments.

 

Normally, the prink messages get buffered in RAM (printk ring buffer) during the early portion of the boot, eg. before the serial console is setup. But using 'earlycon' switches on an earlier facility, meant to help debug problems during the early startup.

 

Once the real console is enabled ("console [tty0] enabled"), all the buffered output gets printed - this is why you are seeing all the messages repeated a second time. Normally this would be the only copy that is shown.

 

So, I would suggest removing "earlycon" from your commandline.

 

[Edit: formatting]

0 Kudos