Kernel panic when booting with an initrd on TS-7970 board (i.MX6 Quad)

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

Kernel panic when booting with an initrd on TS-7970 board (i.MX6 Quad)

Jump to solution
478 Views
apteryx
Contributor I

Hi,

I'm trying to have a Techonologic Systems TS-7970 board boot Guix System, a GNU/Linux distribution.

I'm using the reference U-Boot (https://github.com/embeddedTS/u-boot-imx), which works well.  I'm currently also using the reference kernel (https://github.com/embeddedTS/linux-tsimx), which also works well (tested with an initrd-less Buildroot image).

To allow booting Guix System, which generates a /boot/extlinux/extlinux.conf file, I've adjusted the includes/configs/ts7970.h file from U-Boot with the following Guix build phase for my u-boot-ts7970-q-2g-1000mhz-c package:

 

(add-after 'unpack 'patch-u-boot
(lambda _
(substitute* (find-files "include/configs" "^ts[0-9]{4}\\.h$")
;; Default to boot a standard zImage instead of a uImage.
(("/boot/uImage")
"/boot/zImage")
(("uimage")
"zimage")
(("bootm \\$\\{loadaddr}")
"bootz ${loadaddr}")
;; This reference DTB is not available in mainline.
(("ts7970-revf.dtb")
"ts7970.dtb")
;; Enable support for DISTRO_DEFAULTS, which enables to
;; use 'sysboot' to boot Guix System. Also enable
;; "standard" boot commands for dealing with discovery and
;; booting of syslinux configurations (extlinux.conf).

;; Disable the stock CONFIG_BOOTCOMMAND to avoid a
;; redefinition error.
(("CONFIG_BOOTCOMMAND")
"CONFIG_BOOTCOMMAND_DISABLED")
(("CONFIG_BOOTDELAY")
"CONFIG_BOOTDELAY_DISABLED")
;; Inspired by include/configs/embestmx6boards.h
(("#define CONFIG_EXTRA_ENV_SETTINGS.*" anchor)
(string-append
"#include <config_distro_defaults.h>\n\n"
"#define MEM_LAYOUT_ENV_SETTINGS \\\n"
" \"bootm_size=0x10000000\\0\" \\\n"
" \"ramdisk_addr_r=0x10800000\\0\"\\\n"
" \"kernel_addr_r=0x12000000\\0\" \\\n"
" \"fdt_addr_r=0x18000000\\0\" \\\n"
" \"scriptaddr=0x18100000\\0\" \\\n"
" \"pxefile_addr_r=0x18200000\\0\" \n\n"
"#define BOOT_TARGET_DEVICES(func) \\\n"
" func(MMC, mmc, 0) \\\n"
" func(MMC, mmc, 1) \\\n"
" func(SATA, sata, 0) \\\n"
" func(USB, usb, 0) \\\n"
" func(PXE, pxe, na) \\\n"
" func(DHCP, dhcp, na)\n\n"
"#include <config_distro_bootcmd.h>\n\n"
anchor
;; Sadly, the user config CONFIG_DEFAULT_FDT_FILE did
;; not exist in that older U-Boot, a placeholder is
;; added here, to be substituted in each TS U-Boot board
;; package.
" \"fdtfile=DEFAULT_FDT_FILE\\0\" \\\n"
" MEM_LAYOUT_ENV_SETTINGS \\\n"
" BOOTENV \\\n")))))

 


In the above snippet, you can see the memory map I used.  Flashing the operating system to the SD card and attempting to boot, it appears to crash very early (or at the time of) attempting to run the init program, which for Guix System is written in Scheme and runs with Guile (see the attached boot.log), which ends with:

 

[...]
[    7.444504] sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
[    7.461422] mmc0: new SDIO card at address 0001
[    8.222216] mmcblk2: mmc2:0001 MMC04G 3.60 GiB
[    8.223894] Freeing unused kernel memory: 1024K (80e00000 - 80f00000)
[    8.234222] mmcblk2boot0: mmc2:0001 MMC04G partition 1 16.0 MiB
GC Warning: pthread_getattr_np or[    8.240616] mmcblk2boot1: mmc2:0001 MMC04G partition 2 16.0 MiB
 pthread_attr_getstack failed for[    8.249392] mmcblk2rpmb: mmc2:0001 MMC04G partition 3 128 KiB
 main thread
GC Warning: Couldn't read /proc/stat
[    8.314248] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    8.314248]
[    8.323403] CPU1: stopping
[    8.326121] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.9.11-tsimx #1
[    8.332565] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    8.339094] Backtrace:
[    8.341580] [<80111d48>] (dump_backtrace) from [<80111f38>] (show_stack+0x18/0x1c)
[    8.349156]  r7:00000000 r6:20000193 r5:00000000 r4:80f2fecc
[    8.354830] [<80111f20>] (show_stack) from [<8054d61c>] (dump_stack+0x80/0x9c)
[    8.362061] [<8054d59c>] (dump_stack) from [<8010d8dc>] (handle_IPI+0xe0/0x178)
[    8.369373]  r7:00000000 r6:d80abf18 r5:00000001 r4:80e7f034
[    8.375040] [<8010d7fc>] (handle_IPI) from [<801014d8>] (gic_handle_irq+0x70/0x78)
[    8.382613]  r7:f4a01100 r6:80f0358c r5:f4a00100 r4:d80abf18
[    8.388284] [<80101468>] (gic_handle_irq) from [<80a0a34c>] (__irq_svc+0x6c/0xa8)
[    8.395769] Exception stack(0xd80abf18 to 0xd80abf60)
[    8.400823] bf00:                                                       00000000 dad16bc0
[    8.409006] bf20: 00000001 d80aa000 f01cf055 ef8c69a3 dad131a8 00000001 00000001 00000004
[    8.417189] bf40: 00000001 d80abf9c d80abf28 d80abf68 8018eb00 80826374 20000013 ffffffff
[    8.425370]  r7:d80abf4c r6:ffffffff r5:20000013 r4:80826374
[    8.431039] [<80826284>] (cpuidle_enter_state) from [<80826488>] (cpuidle_enter+0x1c/0x20)
[    8.439308]  r10:d80abfc0 r9:80e801a0 r8:80f030f4 r7:d80aa000 r6:00000001 r5:80f08cd4
[    8.447138]  r4:dad131a8
[    8.449686] [<8082646c>] (cpuidle_enter) from [<80165ccc>] (call_cpuidle+0x3c/0x40)
[    8.457351] [<80165c90>] (call_cpuidle) from [<80165f48>] (cpu_startup_entry+0x188/0x1a8)
[    8.465535] [<80165dc0>] (cpu_startup_entry) from [<8010d5b8>] (secondary_start_kernel+0x134/0x164)
[    8.474582]  r7:80f8d320 r4:80f14490
[    8.478166] [<8010d484>] (secondary_start_kernel) from [<1010156c>] (0x1010156c)
[    8.485566]  r7:80f8d320 r6:10c03c7d r5:00000051 r4:6809406a
[    8.491228] CPU3: stopping
[    8.493943] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.9.11-tsimx #1
[    8.500385] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    8.506912] Backtrace:
[    8.509386] [<80111d48>] (dump_backtrace) from [<80111f38>] (show_stack+0x18/0x1c)
[    8.516960]  r7:00000000 r6:20000193 r5:00000000 r4:80f2fecc
[    8.522630] [<80111f20>] (show_stack) from [<8054d61c>] (dump_stack+0x80/0x9c)
[    8.529860] [<8054d59c>] (dump_stack) from [<8010d8dc>] (handle_IPI+0xe0/0x178)
[    8.537172]  r7:00000000 r6:d80aff18 r5:00000003 r4:80e7f034
[    8.542837] [<8010d7fc>] (handle_IPI) from [<801014d8>] (gic_handle_irq+0x70/0x78)
[    8.550411]  r7:f4a01100 r6:80f0358c r5:f4a00100 r4:d80aff18
[    8.556077] [<80101468>] (gic_handle_irq) from [<80a0a34c>] (__irq_svc+0x6c/0xa8)
[    8.563561] Exception stack(0xd80aff18 to 0xd80aff60)
[    8.568615] ff00:                                                       00000000 00000001
[    8.576797] ff20: 59eaf000 dad2fec0 f01cef08 ef8c5f38 dad2f1a8 00000000 00000001 00000000
[    8.584980] ff40: 00000001 d80aff9c d80aff68 d80aff68 80826350 80826374 60000113 ffffffff
[    8.593161]  r7:d80aff4c r6:ffffffff r5:60000113 r4:80826374
[    8.598827] [<80826284>] (cpuidle_enter_state) from [<80826488>] (cpuidle_enter+0x1c/0x20)
[    8.607096]  r10:d80affc0 r9:80e801a0 r8:80f030f4 r7:d80ae000 r6:00000003 r5:80f08cd4
[    8.614926]  r4:dad2f1a8
[    8.617469] [<8082646c>] (cpuidle_enter) from [<80165ccc>] (call_cpuidle+0x3c/0x40)
[    8.625133] [<80165c90>] (call_cpuidle) from [<80165f48>] (cpu_startup_entry+0x188/0x1a8)
[    8.633317] [<80165dc0>] (cpu_startup_entry) from [<8010d5b8>] (secondary_start_kernel+0x134/0x164)
[    8.642364]  r7:80f8d320 r4:80f14490
[    8.645945] [<8010d484>] (secondary_start_kernel) from [<1010156c>] (0x1010156c)
[    8.653345]  r7:80f8d320 r6:10c03c7d r5:00000051 r4:6809406a
[    8.659007] CPU0: stopping
[    8.661722] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.11-tsimx #1
[    8.668164] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    8.674692] Backtrace:
[    8.677167] [<80111d48>] (dump_backtrace) from [<80111f38>] (show_stack+0x18/0x1c)
[    8.684742]  r7:00000000 r6:20000193 r5:00000000 r4:80f2fecc
[    8.690411] [<80111f20>] (show_stack) from [<8054d61c>] (dump_stack+0x80/0x9c)
[    8.697641] [<8054d59c>] (dump_stack) from [<8010d8dc>] (handle_IPI+0xe0/0x178)
[    8.704954]  r7:00000000 r6:80f01ee0 r5:00000000 r4:80e7f034
[    8.710620] [<8010d7fc>] (handle_IPI) from [<801014d8>] (gic_handle_irq+0x70/0x78)
[    8.718193]  r7:f4a01100 r6:80f0358c r5:f4a00100 r4:80f01ee0
[    8.723860] [<80101468>] (gic_handle_irq) from [<80a0a34c>] (__irq_svc+0x6c/0xa8)
[    8.731344] Exception stack(0x80f01ee0 to 0x80f01f28)
[    8.736403] 1ee0: 00000000 dad08bc0 00000001 80f00000 f01cf2f0 efe6458b dad051a8 00000001
[    8.744585] 1f00: 00000001 00000004 00000001 80f01f64 80f01ef0 80f01f30 8018eb00 80826374
[    8.752764] 1f20: 20000013 ffffffff
[    8.756257]  r7:80f01f14 r6:ffffffff r5:20000013 r4:80826374
[    8.761923] [<80826284>] (cpuidle_enter_state) from [<80826488>] (cpuidle_enter+0x1c/0x20)
[    8.770192]  r10:80f01f88 r9:80e801a0 r8:80f030f4 r7:80f00000 r6:00000000 r5:80f08cd4
[    8.778023]  r4:dad051a8
[    8.780566] [<8082646c>] (cpuidle_enter) from [<80165ccc>] (call_cpuidle+0x3c/0x40)
[    8.788231] [<80165c90>] (call_cpuidle) from [<80165f48>] (cpu_startup_entry+0x188/0x1a8)
[    8.796415] [<80165dc0>] (cpu_startup_entry) from [<80a04e38>] (rest_init+0x78/0x90)
[    8.804160]  r7:80f030c0 r4:00000002
[    8.807744] [<80a04dc0>] (rest_init) from [<80e00c70>] (start_kernel+0x318/0x37c)
[    8.815230]  r5:00000001 r4:80f8d04c
[    8.818811] [<80e00958>] (start_kernel) from [<1000807c>] (0x1000807c)
[    8.825351] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    8.825351]

 

 

Any ideas of things I could have overlooked?  Is the memory map I used OK?   Are there memory limitations while executing the initrd?  I'm out of ideas :-).

Thanks!

0 Kudos
1 Solution
445 Views
apteryx
Contributor I

Hi,

I've pinpointed the issue; apparently Guile 3.0.7 had problems running on this ARM Cortex A9 CPU and was segfaulting with exit status 139.  Upgrading to Guile 3.0.8 appears to resolve the issue.

I'm hitting other problems now, but they seem more manageable :-).

I'm marking this as solved; thank you!

 

View solution in original post

0 Kudos
1 Reply
446 Views
apteryx
Contributor I

Hi,

I've pinpointed the issue; apparently Guile 3.0.7 had problems running on this ARM Cortex A9 CPU and was segfaulting with exit status 139.  Upgrading to Guile 3.0.8 appears to resolve the issue.

I'm hitting other problems now, but they seem more manageable :-).

I'm marking this as solved; thank you!

 

0 Kudos