diff mbox series

imx8qxp mek: Booting mainline kernel with mainline U-Boot

Message ID 20200113165316.5368475d@crub
State New
Headers show
Series imx8qxp mek: Booting mainline kernel with mainline U-Boot | expand

Commit Message

Anatolij Gustschin Jan. 13, 2020, 3:53 p.m. UTC
Hi Fabio,

On Mon, 13 Jan 2020 12:36:20 -0300
Fabio Estevam festevam at gmail.com wrote:
...
> Starting kernel ...
> [It hangs here]
> 
> Booting a NXP kernel also did not work.
> 
> Any ideas?

Does the kernel boot if you apply following U-Boot changes ?


--
Anatolij

Comments

Fabio Estevam Jan. 13, 2020, 4:03 p.m. UTC | #1
Hi Anatolij,

On Mon, Jan 13, 2020 at 12:53 PM Anatolij Gustschin <agust at denx.de> wrote:

> Does the kernel boot if you apply following U-Boot changes ?

Thanks for your suggestion.

With these changes I start to see some kernel output at least:

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd042]
[    0.000000] Linux version 5.4.11 (fabio at fabio-OptiPlex-7010) (gcc
version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)) #31 SMP PREEMPT
Mon Jan 13 11:19:04 -03 2020
[    0.000000] Machine model: Freescale i.MX8QXP MEK
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 32 MiB at 0x00000000fe000000
[    0.000000] earlycon: lpuart32 at MMIO 0x000000005a060000 (options '')
[    0.000000] printk: bootconsole [lpuart32] enabled
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem
0x0000000080200000-0x00000008bfffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x8bf9fb800-0x8bf9fcfff]
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000008bfffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x00000000923fffff]
[    0.000000]   node   0: [mem 0x0000000094400000-0x00000000ffffffff]
[    0.000000]   node   0: [mem 0x0000000880000000-0x00000008bfffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x00000008bfffffff]
[    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] percpu: Embedded 22 pages/cpu s52952 r8192 d28968 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 765448
[    0.000000] Policy zone: Normal
[    0.000000] Kernel command line: console=ttyLP0,${baudrate}
earlycon early_printk root=/dev/mmcblk1p2 rootwait rw
[    0.000000] Dentry cache hash table entries: 524288 (order: 10,
4194304 bytes, linear)
[    0.000000] Inode-cache hash table entries: 262144 (order: 9,
2097152 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0xfa000000-0xfe000000] (64MB)
[    0.000000] Memory: 2924312K/3110912K available (12220K kernel
code, 1862K rwdata, 6428K rodata, 5056K init, 450K bss, 153832K
reserved, 32768K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000]  Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay
is 25 jiffies.
[    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] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 512 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] GICv3: Distributor has no Range Selector support
[    0.000000] GICv3: 16 PPIs implemented
[    0.000000] GICv3: no VLPI support, no direct LPI support
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000051b00000
[    0.000000] random: get_random_bytes called from
start_kernel+0x2b8/0x458 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 8.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff
max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
[    0.000005] sched_clock: 56 bits at 8MHz, resolution 125ns, wraps
every 2199023255500ns
[    0.008404] Console: colour dummy device 80x25
[    0.012587] Calibrating delay loop (skipped), value calculated
using timer frequency.. 16.00 BogoMIPS (lpj=32000)
[    0.022760] pid_max: default: 32768 minimum: 301
[    0.027451] LSM: Security Framework initializing
[    0.032044] Mount-cache hash table entries: 8192 (order: 4, 65536
bytes, linear)
[    0.039365] Mountpoint-cache hash table entries: 8192 (order: 4,
65536 bytes, linear)
[    0.071266] ASID allocator initialised with 32768 entries
[    0.084363] rcu: Hierarchical SRCU implementation.
[    0.097852] EFI services will not be available.
[    0.110068] smp: Bringing up secondary CPUs ...
[    0.146720] Detected VIPT I-cache on CPU1
[    0.146753] GICv3: CPU1: found redistributor 1 region 0:0x0000000051b20000
[    0.146794] CPU1: Booted secondary processor 0x0000000001 [0x410fd042]
[    0.178767] Detected VIPT I-cache on CPU2
[    0.178790] GICv3: CPU2: found redistributor 2 region 0:0x0000000051b40000
[    0.178816] CPU2: Booted secondary processor 0x0000000002 [0x410fd042]
[    0.210832] Detected VIPT I-cache on CPU3
[    0.210852] GICv3: CPU3: found redistributor 3 region 0:0x0000000051b60000
[    0.210873] CPU3: Booted secondary processor 0x0000000003 [0x410fd042]
[    0.210946] smp: Brought up 1 node, 4 CPUs
[    0.266844] SMP: Total of 4 processors activated.
[    0.271529] CPU features: detected: 32-bit EL0 Support
[    0.276667] CPU features: detected: CRC32 instructions
[    0.287773] CPU: All CPU(s) started at EL2
[    0.291556] alternatives: patching kernel code
[    0.297159] devtmpfs: initialized
[    0.303755] clocksource: jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.313180] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.321296] pinctrl core: initialized pinctrl subsystem
[    0.327317] DMI not present or invalid.
[    0.331210] NET: Registered protocol family 16
[    0.336580] DMA: preallocated 256 KiB pool for atomic allocations
[    0.342353] audit: initializing netlink subsys (disabled)
[    0.347912] audit: type=2000 audit(0.292:1): state=initialized
audit_enabled=0 res=1
[    0.355774] cpuidle: using governor menu
[    0.359722] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.367445] Serial: AMBA PL011 UART driver
[    0.388890] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.395273] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.401954] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.408640] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.417405] cryptd: max_cpu_qlen set to 1000
[    0.425356] ACPI: Interpreter disabled.
[    0.430089] iommu: Default domain type: Translated
[    0.434841] vgaarb: loaded
[    0.437651] SCSI subsystem initialized
[    0.441494] usbcore: registered new interface driver usbfs
[    0.446839] usbcore: registered new interface driver hub
[    0.452010] usbcore: registered new device driver usb
[    0.457570] pps_core: LinuxPPS API ver. 1 registered
[    0.462201] pps_core: Software ver. 5.3.6 - Copyright 2005-2007
Rodolfo Giometti <giometti at linux.it>
[    0.471334] PTP clock support registered
[    0.475343] EDAC MC: Ver: 3.0.0
[    0.479323] FPGA manager framework
[    0.482486] Advanced Linux Sound Architecture Driver Initialized.
[    0.489290] clocksource: Switched to clocksource arch_sys_counter
[    0.495244] VFS: Disk quotas dquot_6.6.0
[    0.499027] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.506026] pnp: PnP ACPI: disabled
[    0.515818] thermal_sys: Registered thermal governor 'step_wise'
[    0.515823] thermal_sys: Registered thermal governor 'power_allocator'
[    0.521753] NET: Registered protocol family 2
[    0.532755] tcp_listen_portaddr_hash hash table entries: 2048
(order: 3, 32768 bytes, linear)
[    0.541008] TCP established hash table entries: 32768 (order: 6,
262144 bytes, linear)
[    0.549137] TCP bind hash table entries: 32768 (order: 7, 524288
bytes, linear)
[    0.556626] TCP: Hash tables configured (established 32768 bind 32768)
[    0.562932] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear)
[    0.569585] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear)
[    0.576851] NET: Registered protocol family 1
[    0.581472] RPC: Registered named UNIX socket transport module.
[    0.587060] RPC: Registered udp transport module.
[    0.591749] RPC: Registered tcp transport module.
[    0.596440] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.602877] PCI: CLS 0 bytes, default 64
[    0.607602] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7
counters available
[    0.615229] kvm [1]: IPA Size Limit: 40bits
[    0.619913] kvm [1]: GICv3: no GICV resource entry
[    0.624370] kvm [1]: disabling GICv2 emulation
[    0.628817] kvm [1]: GIC system register CPU interface enabled
[    0.634691] kvm [1]: vgic interrupt IRQ1
[    0.638656] kvm [1]: Hyp mode initialized successfully
[    0.651074] Initialise system trusted keyrings
[    0.655382] workingset: timestamp_bits=44 max_order=20 bucket_order=0
[    0.669250] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.675594] NFS: Registering the id_resolver key type
[    0.680346] Key type id_resolver registered
[    0.684478] Key type id_legacy registered
[    0.688483] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.695354] 9p: Installing v9fs 9p2000 file system support
[    0.717745] Key type asymmetric registered
[    0.721514] Asymmetric key parser 'x509' registered
[    0.726400] Block layer SCSI generic (bsg) driver version 0.4
loaded (major 245)
[    0.733756] io scheduler mq-deadline registered
[    0.738271] io scheduler kyber registered
[    0.750589] EINJ: ACPI disabled.
[    0.772083] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.780231] SuperH (H)SCI(F) driver initialized
[    0.784918] msm_serial: driver initialized
[    0.797448] loop: module loaded
[    0.804366] libphy: Fixed MDIO Bus: probed
[    0.808498] tun: Universal TUN/TAP device driver, 1.6
[    0.813967] thunder_xcv, ver 1.0
[    0.816884] thunder_bgx, ver 1.0
[    0.820117] nicpf, ver 1.0
[    0.823344] hclge is initializing
[    0.826323] hns3: Hisilicon Ethernet Network Driver for Hip08
Family - version
[    0.833528] hns3: Copyright (c) 2017 Huawei Corporation.
[    0.838888] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    0.844650] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    0.850597] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.6.0-k
[    0.857508] igb: Copyright (c) 2007-2014 Intel Corporation.
[    0.863106] igbvf: Intel(R) Gigabit Virtual Function Network Driver
- version 2.4.0-k
[    0.870884] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[    0.877093] sky2: driver version 1.30
[    0.881069] VFIO - User Level meta-driver version: 0.3
[    0.887273] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.893481] ehci-pci: EHCI PCI platform driver
[    0.897959] ehci-platform: EHCI generic platform driver
[    0.903241] ehci-orion: EHCI orion driver
[    0.907198] ehci-exynos: EHCI EXYNOS driver
[    0.911350] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.917466] ohci-pci: OHCI PCI platform driver
[    0.921912] ohci-platform: OHCI generic platform driver
[    0.927177] ohci-exynos: OHCI EXYNOS driver
[    0.931691] usbcore: registered new interface driver usb-storage
[    0.940035] i2c /dev entries driver
[    0.948138] sdhci: Secure Digital Host Controller Interface driver
[    0.953997] sdhci: Copyright(c) Pierre Ossman
[    0.958695] Synopsys Designware Multimedia Card Interface Driver
[    0.965161] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.971959] ledtrig-cpu: registered to indicate activity on CPUs
[    0.978896] usbcore: registered new interface driver usbhid
[    0.984145] usbhid: USB HID core driver
[    0.991961] NET: Registered protocol family 17
[    0.996255] 9pnet: Installing 9P2000 support
[    1.000383] Key type dns_resolver registered
[    1.004995] registered taskstats version 1
[    1.008765] Loading compiled-in X.509 certificates
[    1.039475] imx-scu scu: NXP i.MX SCU Initialized
[    1.058681] imx8qxp-pinctrl scu:pinctrl: initialized IMX pinctrl driver
[    1.087023] 5a060000.serial: ttyLP0 at MMIO 0x5a060000 (irq = 7,
base_baud = 5000000) is a FSL_LPUAR

but then it hangs here when the serial driver is probed.
Anatolij Gustschin Jan. 14, 2020, 11:04 p.m. UTC | #2
Hi Fabio,

On Mon, 13 Jan 2020 13:03:10 -0300
Fabio Estevam festevam at gmail.com wrote:
...
> [    1.039475] imx-scu scu: NXP i.MX SCU Initialized
> [    1.058681] imx8qxp-pinctrl scu:pinctrl: initialized IMX pinctrl driver
> [    1.087023] 5a060000.serial: ttyLP0 at MMIO 0x5a060000 (irq = 7,
> base_baud = 5000000) is a FSL_LPUAR
> 
> but then it hangs here when the serial driver is probed.

Currently I do not have an i.MX8QXP MEK board with RevB CPU and cannot
test, but I have an i.MX8QXP based custom SoM with console on ttyLP2.
Here I tested with NXP BSP kernel based on branch imx_4.14.98_2.0.0_ga
and it boots successfully (with NFS rootfs or rootfs on eMMC).

I cannot test NXP 4.19.35 kernel on this SoM yet, so not sure if it
would boot.

--
Anatolij
Fabio Estevam Jan. 16, 2020, 4:38 p.m. UTC | #3
Hi Anatolij,

On Tue, Jan 14, 2020 at 8:04 PM Anatolij Gustschin <agust at denx.de> wrote:

> Currently I do not have an i.MX8QXP MEK board with RevB CPU and cannot
> test, but I have an i.MX8QXP based custom SoM with console on ttyLP2.
> Here I tested with NXP BSP kernel based on branch imx_4.14.98_2.0.0_ga
> and it boots successfully (with NFS rootfs or rootfs on eMMC).

I have just tested imx_4.14.98_2.0.0_ga and still get the same hang.

[Adding Marcel]

Just wondering if anyone else managed to boot mainline U-Boot with
mainline kernel on i.MX8QXP.

If so, what firmware combination was used?

Thanks
Anatolij Gustschin Jan. 16, 2020, 4:57 p.m. UTC | #4
Hi Fabio,

On Thu, 16 Jan 2020 13:38:26 -0300
Fabio Estevam festevam at gmail.com wrote:

> Hi Anatolij,
> 
> On Tue, Jan 14, 2020 at 8:04 PM Anatolij Gustschin <agust at denx.de> wrote:
> 
> > Currently I do not have an i.MX8QXP MEK board with RevB CPU and cannot
> > test, but I have an i.MX8QXP based custom SoM with console on ttyLP2.
> > Here I tested with NXP BSP kernel based on branch imx_4.14.98_2.0.0_ga
> > and it boots successfully (with NFS rootfs or rootfs on eMMC).  
> 
> I have just tested imx_4.14.98_2.0.0_ga and still get the same hang.

then it might be due to scfw API incompatibility?

> [Adding Marcel]
> 
> Just wondering if anyone else managed to boot mainline U-Boot with
> mainline kernel on i.MX8QXP.

yesterday I wanted to test some mainline drivers on my SoM and
created simple device tree for booting with console output.
Mainline kernel v5.5-rc6 booted successfully, (but without FEC
support).

> If so, what firmware combination was used?

Unfortunately, my i.MX8QXP SoM was damaged today and it doesn't boot
any more and it is not recoverable, so I cannot check the used firmware
hashes. I only know that it was something from 4.14.98_2.0.0_ga release.

--
Anatolij
Igor Opaniuk Jan. 16, 2020, 6:03 p.m. UTC | #5
Hi Fabio,

On Thu, Jan 16, 2020 at 6:38 PM Fabio Estevam <festevam at gmail.com> wrote:
>
> Hi Anatolij,
>
> On Tue, Jan 14, 2020 at 8:04 PM Anatolij Gustschin <agust at denx.de> wrote:
>
> > Currently I do not have an i.MX8QXP MEK board with RevB CPU and cannot
> > test, but I have an i.MX8QXP based custom SoM with console on ttyLP2.
> > Here I tested with NXP BSP kernel based on branch imx_4.14.98_2.0.0_ga
> > and it boots successfully (with NFS rootfs or rootfs on eMMC).
>
> I have just tested imx_4.14.98_2.0.0_ga and still get the same hang.
>
> [Adding Marcel]
Marcel is on vacation.

FYI, mainline U-boot is broken on all our iMX8QXP and iMX8QM SoMs
at all since f0cc4eae9a ("core: device: use dev_power_domain_on") is merged, the
status hasn't changed. I haven't got deeply into this issue, just
quickly tried different
combinations of TF-A and SECO/SCFW, none of them has any impact.
Will get back to this issue soon.
>
> Just wondering if anyone else managed to boot mainline U-Boot with
> mainline kernel on i.MX8QXP.
I can test it for you with the revert patch for f0cc4eae9a applied tomorrow.

>
> If so, what firmware combination was used?
>
> Thanks

Thanks
Tom Rini Jan. 16, 2020, 6:16 p.m. UTC | #6
On Thu, Jan 16, 2020 at 08:03:51PM +0200, Igor Opaniuk wrote:
> Hi Fabio,
> 
> On Thu, Jan 16, 2020 at 6:38 PM Fabio Estevam <festevam at gmail.com> wrote:
> >
> > Hi Anatolij,
> >
> > On Tue, Jan 14, 2020 at 8:04 PM Anatolij Gustschin <agust at denx.de> wrote:
> >
> > > Currently I do not have an i.MX8QXP MEK board with RevB CPU and cannot
> > > test, but I have an i.MX8QXP based custom SoM with console on ttyLP2.
> > > Here I tested with NXP BSP kernel based on branch imx_4.14.98_2.0.0_ga
> > > and it boots successfully (with NFS rootfs or rootfs on eMMC).
> >
> > I have just tested imx_4.14.98_2.0.0_ga and still get the same hang.
> >
> > [Adding Marcel]
> Marcel is on vacation.
> 
> FYI, mainline U-boot is broken on all our iMX8QXP and iMX8QM SoMs
> at all since f0cc4eae9a ("core: device: use dev_power_domain_on") is merged, the
> status hasn't changed. I haven't got deeply into this issue, just
> quickly tried different
> combinations of TF-A and SECO/SCFW, none of them has any impact.
> Will get back to this issue soon.
> >
> > Just wondering if anyone else managed to boot mainline U-Boot with
> > mainline kernel on i.MX8QXP.
> I can test it for you with the revert patch for f0cc4eae9a applied tomorrow.

Adding in Lokesh as he nak'd the revert before because that would break
other platforms and I chimed in saying that breaking one set of
platforms to unbreak another set of platforms isn't a trade-off I like.
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/imx8/fdt.c b/arch/arm/mach-imx/imx8/fdt.c
index 65c8ac1a7e..e51fe4b897 100644
--- a/arch/arm/mach-imx/imx8/fdt.c
+++ b/arch/arm/mach-imx/imx8/fdt.c
@@ -279,8 +279,9 @@  static int ft_add_optee_node(void *fdt, bd_t *bd)
 int ft_system_setup(void *blob, bd_t *bd)
 {
 	int ret;
-
+#if 0
 	update_fdt_with_owned_resources(blob);
+#endif
 
 	if (is_imx8qm()) {
 		ret = config_smmu_fdt(blob);
diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index 5c8dc4ad70..be041b0b4c 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -192,10 +192,11 @@  int device_remove(struct udevice *dev, uint flags)
 				__func__, dev->name);
 		}
 	}
-
+#if 0
 	if (!(drv->flags & DM_FLAG_DEFAULT_PD_CTRL_OFF) &&
 	    (dev != gd->cur_serial_dev))
 		dev_power_domain_off(dev);
+#endif
 
 	if (flags_remove(flags, drv->flags)) {
 		device_free(dev);