linux-imx-lf-6.6.3-1.0.0 compilation error

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

linux-imx-lf-6.6.3-1.0.0 compilation error

412 Views
manux
Contributor I

Hi,

When trying to strip down kernel options to reduce the size of the generated zImage, I came across the following compilation errors:

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

/home/manu/Develop/IOT-AP-CTRL/OS/Sources/buildroot-20240201_iMX6ULLevk-20240501_manu/output/host/bin/arm-buildroot-linux-uclibcgnueabihf-ld: arch/arm/mach-imx/busfreq_ddr3.o: in function `init_mmdc_ddr3_settings_imx6_up':
busfreq_ddr3.c:(.text+0x598): undefined reference to `imx6_up_ddr3_freq_change_end'
/home/manu/Develop/IOT-AP-CTRL/OS/Sources/buildroot-20240201_iMX6ULLevk-20240501_manu/output/host/bin/arm-buildroot-linux-uclibcgnueabihf-ld: busfreq_ddr3.c:(.text+0x59c): undefined reference to `imx6_up_ddr3_freq_change'
/home/manu/Develop/IOT-AP-CTRL/OS/Sources/buildroot-20240201_iMX6ULLevk-20240501_manu/output/host/bin/arm-buildroot-linux-uclibcgnueabihf-ld: busfreq_ddr3.c:(.text+0x5a0): undefined reference to `imx6_up_ddr3_freq_change_start'
/home/manu/Develop/IOT-AP-CTRL/OS/Sources/buildroot-20240201_iMX6ULLevk-20240501_manu/output/host/bin/arm-buildroot-linux-uclibcgnueabihf-ld: arch/arm/mach-imx/busfreq_lpddr2.o: in function `init_mmdc_lpddr2_settings':
busfreq_lpddr2.c:(.text+0x18c): undefined reference to `imx6_up_lpddr2_freq_change'
make[3]: *** [scripts/Makefile.vmlinux:37: vmlinux] Error 1

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

I tracked the problem down to making the following changes in the kernel ".config":

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

# CONFIG_ARCH_MULTIPLATFORM is not set

#
# Cortex-A platforms
#
# CONFIG_SOC_IMX50 is not set
# CONFIG_SOC_IMX51 is not set
# CONFIG_SOC_IMX53 is not set
CONFIG_SOC_IMX6=y
# CONFIG_SOC_IMX6Q is not set
# CONFIG_SOC_IMX6SL is not set
# CONFIG_SOC_IMX6SLL is not set
# CONFIG_SOC_IMX6SX is not set
CONFIG_SOC_IMX6UL=y
# CONFIG_SOC_LS1021A is not set

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

The problem goes away just by re-enabling the "CONFIG_SOC_IMX6SX=y"

Why compiling for a "IMX6UL" requires the "IMX6SX" to be enabled too ?

I don't need the kernel to be compatible across multi-platform.

My application uses a "iMX6ULL" with a small QSPI flash as bootable device and I am trying to make the smallest kernel to provide as much space as possible for the "initrd" .


After further digging I found the following in "arch/arm/mach-imx/common.c"

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

#if !defined(CONFIG_SOC_IMX6SX) && !defined(CONFIG_SOC_IMX6UL)
u32 imx6_up_ddr3_freq_change_start, imx6_up_ddr3_freq_change_end;
struct imx6_busfreq_info {
} __aligned(8);
void imx6_up_ddr3_freq_change(struct imx6_busfreq_info *busfreq_info) {}
void imx6_up_lpddr2_freq_change(u32 freq, int bus_freq_mode) {}
#endif

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

Changing the "&&" in the code above by a "||" allows the compile the kernel with the "CONFIG_SOC_IMX6SX is not set".

Is this an error in the code or is there a reason that the kernel must be compiled for multiple "iMX" models to operate properly ?


Thanks

Labels (3)
Tags (3)
0 Kudos
Reply
2 Replies

374 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

This configuration is based on that both boards work with the same PN (4Gb and 8Gb is the differentiator between them).

You can proceed with the adjustments made.

Regards

0 Kudos
Reply

355 Views
manux
Contributor I

Hi Joseph,

Thanks for your reply.

Unfortunately there is probably more involve for the need to compile with option "CONFIG_SOC_IMX6SX=y" together with "CONFIG_SOC_IMX6UL=y".

Because the kernel I create using "CONFIG_SOC_IMX6UL=y" and "CONFIG_SOC_IMX6SX is not set", generate the following kernel message every time ~23sec after the kernel started:

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

[ 23.368404] 8<--- cut here ---
[ 23.371666] Unable to handle kernel NULL pointer dereference at virtual address 00000000 when write
[ 23.380918] [00000000] *pgd=00000000
[ 23.384671] Internal error: Oops: 805 [#1] PREEMPT ARM
[ 23.389958] Modules linked in: micrel mma8452 mag3110 ci_hdrc_imx usbmisc_imx ci_hdrc imx_sdma evbug secvio error fev
[ 23.406777] CPU: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.6.3 #14
[ 23.413045] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 23.419368] Workqueue: events reduce_bus_freq_handler
[ 23.424669] PC is at 0xf49040f0
[ 23.427939] LR is at update_ddr_freq_imx6_up+0xa0/0xe8
[ 23.433243] pc : [<f49040f0>] lr : [<80117d5c>] psr: 60000093
[ 23.439655] sp : a0839f08 ip : 0000000c fp : 61c88647
[ 23.445012] r10: 84005005 r9 : 80bfdff4 r8 : 80bff450
[ 23.450369] r7 : 80bff454 r6 : 80004059 r5 : 016e3600 r4 : 80bff4e8
[ 23.457046] r3 : f4904018 r2 : f4904144 r1 : f49040d4 r0 : 00000000
[ 23.463726] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
[ 23.471126] Control: 10c53c7d Table: 84340059 DAC: 00000051
[ 23.476997] Register r0 information: NULL pointer
[ 23.481872] Register r1 information: 0-page vmalloc region starting at 0xf4900000 allocated at iotable_init+0x0/0xe8
[ 23.492684] Register r2 information: 0-page vmalloc region starting at 0xf4900000 allocated at iotable_init+0x0/0xe8
[ 23.503468] Register r3 information: 0-page vmalloc region starting at 0xf4900000 allocated at iotable_init+0x0/0xe8
[ 23.514243] Register r4 information: non-slab/vmalloc memory
[ 23.520071] Register r5 information: non-paged memory
[ 23.525263] Register r6 information: non-slab/vmalloc memory
[ 23.531075] Register r7 information: non-slab/vmalloc memory
[ 23.536883] Register r8 information: non-slab/vmalloc memory
[ 23.542689] Register r9 information: non-slab/vmalloc memory
[ 23.548497] Register r10 information: slab maple_node start 84005000 pointer offset 5 size 256
[ 23.557436] Register r11 information: non-paged memory
[ 23.562721] Register r12 information: non-paged memory
[ 23.568002] Process kworker/0:0 (pid: 8, stack limit = 0xa976f449)
[ 23.574353] Stack: (0xa0839f08 to 0xa083a000)
[ 23.578870] 9f00: 80bff3a8 80bff2fc 8404f640 80116b50 00000000 00000000
[ 23.587247] 9f20: 80bff3a8 84005000 8404f640 80117170 84015d00 80132994 84015d00 84015d2c
[ 23.595622] 9f40: 80b0cb18 84015d00 8404f640 80b0cafc 80b0cafc 80b0cb18 84015d2c 80b0cb54
[ 23.603994] 9f60: 80bd6f20 8013302c 00000001 8404f640 84038600 84038c00 80132d80 84015d00
[ 23.612363] 9f80: a081dec0 00000000 00000000 80138b3c 84038600 80138a4c 00000000 00000000
[ 23.620728] 9fa0: 00000000 00000000 00000000 8010016c 00000000 00000000 00000000 00000000
[ 23.629094] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 23.637458] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 23.645861] update_ddr_freq_imx6_up from reduce_bus_freq+0x168/0x258
[ 23.652530] reduce_bus_freq from reduce_bus_freq_handler+0x20/0x44
[ 23.659003] reduce_bus_freq_handler from process_scheduled_works+0x198/0x260
[ 23.666397] process_scheduled_works from worker_thread+0x2ac/0x324
[ 23.672918] worker_thread from kthread+0xf0/0xfc
[ 23.677864] kthread from ret_from_fork+0x14/0x28
[ 23.682773] Exception stack(0xa0839fb0 to 0xa0839ff8)
[ 23.687972] 9fa0: 00000000 00000000 00000000 00000000
[ 23.696338] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 23.704698] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 23.711489] Code: 676b52f3 00000010 b66d0b63 0000001c (04008032)
[ 23.717737] ---[ end trace 0000000000000000 ]---
[ 23.722477] note: kworker/0:0[8] exited with irqs disabled
[ 64.494279] cfg80211: failed to load regulatory.db

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

The kernel doesn't hang but, it seems that something is not working right.

I think I will stick with "CONFIG_SOC_IMX6SX=y" for now as it is a cleaner solution and the kernel seems to be stable.

 

Thanks for your support.

Have a nice day.

 

Emmanuel

 

0 Kudos
Reply