Skip to main content
Visitor II
October 13, 2023
Question

Various issues when starting kernel on custom stm32mp151aac board

  • October 13, 2023
  • 14 replies
  • 14083 views

I'm still trying to get a fully error free bootup on the stm32mp151 based board. I'm using ST git's for the bootstages and kernel/rootfs are build using the ST yocto layers.

But because i'm unsure which are actually errors and which are just warnings I can ignore. Nor want to start 5 threads for each one, I figured it was best to combine them in one. Chances are likely they are inter related anyway.

I get this error, but further in the bootlog optee is properly initialized, so can this be ignored?

 [ 0.109710] Driver 'scmi-optee' was unable to register with bus_type 'tee' because the bus was not initialized.

This is the main issue, am I forgetting someting in the DT? (attached)

 

[ 0.516254] sysfs: cannot create duplicate filename '/devices/platform/cpufreq-dt'
[ 0.516281] CPU: 0 PID: 38 Comm: kworker/u2:3 Not tainted 6.1.28-dirty #1
[ 0.516303] Hardware name: STM32 (Device Tree Support)
[ 0.516314] Workqueue: events_unbound deferred_probe_work_func
[ 0.516363] unwind_backtrace from show_stack+0x10/0x14
[ 0.516398] show_stack from dump_stack_lvl+0x40/0x4c
[ 0.516425] dump_stack_lvl from sysfs_warn_dup+0x58/0x64
[ 0.516455] sysfs_warn_dup from sysfs_create_dir_ns+0xe8/0xfc
[ 0.516482] sysfs_create_dir_ns from create_dir+0x1c/0x164
[ 0.516512] create_dir from kobject_add_internal+0xa4/0x208
[ 0.516540] kobject_add_internal from kobject_add+0x5c/0xcc
[ 0.516569] kobject_add from device_add+0x110/0x6a0
[ 0.516606] device_add from platform_device_add+0x120/0x250
[ 0.516641] platform_device_add from platform_device_register_full+0x108/0x158
[ 0.516674] platform_device_register_full from stm32_cpufreq_probe+0xf0/0x198
[ 0.516710] stm32_cpufreq_probe from platform_probe+0x5c/0xbc
[ 0.516740] platform_probe from really_probe+0xe0/0x414
[ 0.516767] really_probe from __driver_probe_device+0x9c/0x130
[ 0.516791] __driver_probe_device from driver_probe_device+0x30/0xc0
[ 0.516815] driver_probe_device from __device_attach_driver+0xa8/0x120
[ 0.516840] __device_attach_driver from bus_for_each_drv+0x80/0xd0
[ 0.516864] bus_for_each_drv from __device_attach+0xac/0x214
[ 0.516886] __device_attach from bus_probe_device+0x84/0x8c
[ 0.516909] bus_probe_device from deferred_probe_work_func+0x94/0xd4
[ 0.516932] deferred_probe_work_func from process_one_work+0x1d8/0x518
[ 0.516968] process_one_work from worker_thread+0x220/0x50c
[ 0.516997] worker_thread from kthread+0xd8/0xf4
[ 0.517024] kthread from ret_from_fork+0x14/0x2c
[ 0.517050] Exception stack(0xde8adfb0 to 0xde8adff8)
[ 0.517066] dfa0: 00000000 00000000 00000000 00000000
[ 0.517082] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 0.517096] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 0.517109] kobject_add_internal failed for cpufreq-dt with -EEXIST, don't try to register things with the same name in the same directory.

 

What are those device links?

 

[ 3.571308] stpmic1 0-0033: PMIC Chip Version: 0x21
[ 3.626911] stpmic1-regulator 5c002000.i2c:stpmic@33:regulators: Failed to create device link (0x180) with 0-0033
[ 3.651272] stpmic1-regulator 5c002000.i2c:stpmic@33:regulators: Failed to create device link (0x180) with 0-0033
[ 3.660104] stpmic1-regulator 5c002000.i2c:stpmic@33:regulators: Failed to create device link (0x180) with 0-0033

 

These can be ignored?

 

[ 3.904198] dwc2 49000000.usb-otg: supply vusb_d not found, using dummy regulator
[ 3.921734] dwc2 49000000.usb-otg: supply vusb_a not found, using dummy regulator

[ 9.682918] systemd[1]: Huge Pages File System was skipped because of an unmet condition check (ConditionPathExists=/sys/kernel/mm/hugepages).

[ 10.247547] systemd[1]: File System Check on Root Device was skipped because of an unmet condition check (ConditionPathIsReadWrite=!/).

[ 10.303876] systemd[1]: systemd-journald.service: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[ 10.345984] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)

 

    This topic has been closed for replies.

    14 replies

    ST Employee
    November 6, 2023

    Hello @michiel.tjampens ,

    I see in the logs "kernel-6.1.28", which means you are running EcoSystem-5.0.0, so PMIC is managed through Optee (as well as cpufreq feature).

    As you have an error related to op-tee and the beginning of the boot of the kernel, could you please share the full logs starting from the very beginning of the boot ? (including tf-a/optee/u-boot boot logs).

    BR,

    Christophe

    Visitor II
    November 6, 2023

    Attached is the log.

    Do note that since I created the post, I've changed to using Debian instead of the yocto rootfs.

    ST Employee
    November 9, 2023

    Hello,

    To investigate "scmi-optee" message, I would recommand to set optee loglevel to 4 to check if something wrong happend just before the message in optee:

    https://wiki.st.com/stm32mpu/wiki/How_to_debug_OP-TEE#Debug_with_traces

     

    In the latest log, there is the line in optee:

    I/TC: No power configuration found in DT

    This is explained because there is no "st,stm32mp1,pwr-reg" entry in the DT of Op-tee.

    It could explain why you have errors related to usb, and maybe cpufreq as well.

    Regarding PMIC, it seems you already solved the issue by yourself : https://community.st.com/t5/stm32-mpus-products/stm32mp151aac-custom-board-kernel-not-starting/m-p/596892#M10326

    BR,

    Christophe

    Visitor II
    November 9, 2023

    I'll rebuild the optee with more debug feedback, however the DT includes stm32mp151.dtsi and that has

     

     

    pwr_regulators: pwr@50001000 {
    	compatible = "st,stm32mp1,pwr-reg";
    	reg = <0x50001000 0x10>;
    	st,tzcr = <&rcc 0x0 0x1>;
    	reg11: reg11 {
    		regulator-name = "reg11";
    		regulator-min-microvolt = <1100000>;
    		regulator-max-microvolt = <1100000>;
    	};
    	reg18: reg18 {
    		regulator-name = "reg18";
    		regulator-min-microvolt = <1800000>;
    		regulator-max-microvolt = <1800000>;
    	};
    	usb33: usb33 {
    		regulator-name = "usb33";
    		regulator-min-microvolt = <3300000>;
    		regulator-max-microvolt = <3300000>;
    	};
    };

     

     

    Or does optee dt need to contain the pmic i2c section? If so, "Lab-MP15_FromPartNumber_To_BasicDeviceTree_with_CubeMx" explicitely states "Only cpu and vdd voltage levels are needed. No controlling is needed" about the optee dt. Then again, wouldn't be the first issue with that pdf.

    The 'failed to create device link' still persists.

     

    Visitor II
    November 17, 2023

    Any update on this? I'm having exactly the same error messages (custom board). I agree that "Lab" is garbage, the step from DK or EV to custom board is a struggle.

    Visitor II
    November 17, 2023

    @allard.potmaWelcome to the club (of people trying to get a custom board up and running). Good reference will problably threads by @debugging if your are using the STM32MP157. Get ready for an uphill struggle.

    No haven't worked on it, I'm actually waiting for an answer to my questions...

    Visitor II
    November 17, 2023

    Ok, but then can you please correct "Lab MP15_FromPartNumber_To_BasicDeviceTree_with_CubeMx"? Because forgot where but that document is recommended for a custom board and does more bad than good.

    I'll alter the DT's etc later and see what effect it has.

    Visitor II
    November 17, 2023

    @Christophe Guibout 

    I'm having the same errors, distribution package, followed the LAB:

     

     

     

     Driver 'scmi-optee' was unable to register with bus_type 'tee' because the bus was not initialized.

     

     

     

     

     

    [ 0.585578] sysfs: cannot create duplicate filename '/devices/platform/cpufreq-dt'
    [ 0.585607] CPU: 0 PID: 43 Comm: kworker/u2:4 Not tainted 6.1.28 #1
    [ 0.585632] Hardware name: STM32 (Device Tree Support)
    [ 0.585644] Workqueue: events_unbound deferred_probe_work_func
    [ 0.585703] unwind_backtrace from show_stack+0x10/0x14
    [ 0.585741] show_stack from dump_stack_lvl+0x40/0x4c
    [ 0.585776] dump_stack_lvl from sysfs_warn_dup+0x58/0x64
    [ 0.585809] sysfs_warn_dup from sysfs_create_dir_ns+0xf4/0x104
    [ 0.585834] sysfs_create_dir_ns from create_dir+0x1c/0x164
    [ 0.585866] create_dir from kobject_add_internal+0xa4/0x208
    [ 0.585900] kobject_add_internal from kobject_add+0x60/0xc4
    [ 0.585933] kobject_add from device_add+0xcc/0x6d4
    [ 0.585965] device_add from platform_device_add+0x100/0x244
    [ 0.585999] platform_device_add from platform_device_register_full+0x108/0x158
    [ 0.586039] platform_device_register_full from stm32_cpufreq_probe+0xfc/0x19c
    [ 0.586086] stm32_cpufreq_probe from platform_probe+0x5c/0xb0
    [ 0.586126] platform_probe from really_probe+0xe0/0x40c
    [ 0.586161] really_probe from __driver_probe_device+0x9c/0x130
    [ 0.586193] __driver_probe_device from driver_probe_device+0x30/0xc0
    [ 0.586226] driver_probe_device from __device_attach_driver+0xa8/0x120
    [ 0.586259] __device_attach_driver from bus_for_each_drv+0x88/0xd4
    [ 0.586291] bus_for_each_drv from __device_attach+0xa8/0x1ec
    [ 0.586321] __device_attach from bus_probe_device+0x84/0x8c
    [ 0.586352] bus_probe_device from deferred_probe_work_func+0x8c/0xd4
    [ 0.586383] deferred_probe_work_func from process_one_work+0x1e8/0x510
    [ 0.586414] process_one_work from worker_thread+0x208/0x504
    [ 0.586439] worker_thread from kthread+0xdc/0xf8
    [ 0.586472] kthread from ret_from_fork+0x14/0x2c
    [ 0.586502] Exception stack(0xf0a09fb0 to 0xf0a09ff8)
    [ 0.586517] 9fa0: 00000000 00000000 00000000 00000000
    [ 0.586534] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 0.586548] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
    [ 0.586561] kobject_add_internal failed for cpufreq-dt with -EEXIST, don't try to register things with the same name in the same directory.
    [ 4.212452] stpmic1-regulator 5c002000.i2c:stpmic@33:regulators: Failed to create device link (0x180) with 2-0033
    [ 4.237223] stpmic1-regulator 5c002000.i2c:stpmic@33:regulators: Failed to create device link (0x180) with 2-0033
    [ 4.246053] stpmic1-regulator 5c002000.i2c:stpmic@33:regulators: Failed to create device link (0x180) with 2-0033
    [ 4.497532] regulator regulator.11: regulator disable timed out!
    [ 4.502134] reg18: failed to disable: -ETIMEDOUT

     

     

    And loading stops at:

     

     

    Starting systemd-udevd version 253.1^
    root '/dev/disk/by-partuuid/491f6117-415d-4f53-88c9-6e0de54deac6' doesn't exist or does not contain a /dev.
    
    [ 15.217643] stm32-rproc 10000000.m4: wdg irq registered
    [ 15.230644] remoteproc remoteproc0: releasing m4
    [ 15.233994] platform 10000000.m4: deferred probe pending

     

     

    My custom hardware is running on the stm32mp151caa, LPDDR3, EMMC flash and STPMIC1B (1.8V). I've attached my optee-os dts. When I bake my image with the MACHINE set to the stm32mp157dk2 the image does load, but I still get the 'stpmic1-regulator 5c002000.i2c:stpmic@33:regulators: Failed to create device link' and 'Driver 'scmi-optee' was unable to register with bus_type 'tee' because the bus was not initialized. ', the other messages disappeared. My other device trees (TF-A, u-boot, kernel) are strongly inspired by the ones from the DK2.

    @michiel.tjampensfeel free to kick me to my own topic, but I do think we have the same problem.

    EDIT: Managed to boot, the UUID in extlinux.conf was wrong, not sure why. I assume this should be handled by yocto? All other messages are still there.

    Visitor II
    November 17, 2023

    @allard.potmaIt's probably indeed the same issue, so your posts are where they belong.

    Visitor II
    November 19, 2023

    Well I've tried adding the pmic things to the optee device tree... After building with Yocto (st recipes) result is even worse than it was before.

     

    I/TC: OP-TEE version: 3.19.0-dev (gcc version 12.2.0 (GCC)) #1 Fri Oct 14 19:00:05 UTC 2022 arm
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp151a-tios-mx.dts
    I/TC: DTB enables console (non-secure)
    E/TC:0 0 probe_dt_drivers:750 Probe sequence result: 0x80000000
    E/TC:0 0 Panic

     

     

    Building optee with the altered device tree (attached) doesn't show any issues.

    Next up was using the original one but build to show debug. For some reason, the scripts that build a working setup before now don't even manage to build something that get tf-a loaded... (no errors during build, using the same repo's, dt's identical to the yocto version etc...)

    Panic at PC : 0x2ffeb4d1

     

    Visitor II
    November 20, 2023

    Not sure if this is the problem, and why, but I think this:

    interrupts-extended = <&exti 55 IRQ_TYPE_EDGE_FALLING>;

    needs to be:

    interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;

    In optee