cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP135: U-boot - No serial driver found

jhi
Senior

I'm using minimal device tree files to get a custom (MYIR MYC-YF135) board to boot. At the moment I'm stuck when OP-TEE should give the control to u-boot. The boot stops on error message: No serial driver found

 

 

 

....
F/TC:0 0 _regulator_enable:150 vdd
F/TC:0 0 _regulator_enable:188 vdd refcount: 1
F/TC:0 0 _regulator_enable:150 v3v3
F/TC:0 0 _regulator_enable:188 v3v3 refcount: 1
F/TC:0 0 _regulator_enable:150 vddcore
F/TC:0 0 _regulator_enable:188 vddcore refcount: 1
F/TC:0 0 regulator_core_dump:920 Dump Regulators
F/TC:0 0 regulator_core_dump:921 reg      name     use  en      mV      min     max     flags   supply
F/TC:0 0 regulator_core_dump:941 usb33    usb33    0    0       3300    3300    3300    0
F/TC:0 0 regulator_core_dump:941 reg18    reg18    0    1       1800    1800    1800    0       vdd
F/TC:0 0 regulator_core_dump:941 reg11    reg11    0    1       1100    1100    1100    0       vdd
F/TC:0 0 iod_get_voltage:115 sdmmc1_io: get volt
F/TC:0 0 iod_get_state:104 sdmmc1_io: get state
F/TC:0 0 regulator_core_dump:941 sdmmc1_i sdmmc1_i 1    1       3300    0       65535   0x1     vdd
F/TC:0 0 iod_get_voltage:115 sdmmc2_io: get volt
F/TC:0 0 iod_get_state:104 sdmmc2_io: get state
F/TC:0 0 regulator_core_dump:941 sdmmc2_i sdmmc2_i 1    1       3300    0       65535   0x1     vdd
F/TC:0 0 regulator_core_dump:941 vdd      vdd      1    1       3300    3300    3300    0x1
F/TC:0 0 regulator_core_dump:941 v3v3     v3v3     1    1       3300    3300    3300    0x1
F/TC:0 0 regulator_core_dump:941 vddcore  vddcore  1    1       1350    1350    1350    0x1
D/TC:0 0 call_initcalls:40 level 6 scmi_regulator_consumer_init()
F/TC:0 0 get_supply_phandle:114 voltd: supplied by 7
D/TC:0 0 scmi_regulator_consumer_init:322 scmi voltd shares reg11 (node reg11) on domain ID 0
F/TC:0 0 get_supply_phandle:114 voltd: supplied by 8
D/TC:0 0 scmi_regulator_consumer_init:322 scmi voltd shares reg18 (node reg18) on domain ID 1
F/TC:0 0 get_supply_phandle:114 voltd: supplied by 9
D/TC:0 0 scmi_regulator_consumer_init:322 scmi voltd shares usb33 (node usb33) on domain ID 2
D/TC:0 0 call_initcalls:40 level 7 stm32_rng_release()
D/TC:0 0 call_initcalls:40 level 7 regulator_core_cleanup()
F/TC:0 0 regulator_core_cleanup:1008
D/TC:0 0 regulator_core_cleanup:1012 disable usb33
D/TC:0 0 regulator_core_cleanup:1012 disable reg18
D/TC:0 0 regulator_core_cleanup:1012 disable reg11
D/TC:0 0 call_initcalls:40 level 7 release_probe_lists()
D/TC:0 0 call_finalcalls:59 level 1 release_external_dt()
I/TC: Primary CPU switching to normal world boot

<debug_uart>
serial_stm32 serial@40010000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19
serial_stm32 serial@40010000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19
serial_stm32 serial@40010000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19
serial_stm32 serial@40010000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19
No serial driver found
resetting ...
System reset not supported on this platform
### ERROR ### Please RESET the board ###

 

mx-u-boot.dts

 

 

/ {

	/* USER CODE BEGIN root */

	aliases{
		mmc0 = &sdmmc1;
	};

	config{
		u-boot,mmc-env-partition = "u-boot-env";
	};

	/* USER CODE END root */

}; /*root*/

/* USER CODE BEGIN addons */
&uart4{
	u-boot,dm-pre-reloc;
};

&uart4_pins_mx {
	u-boot,dm-pre-reloc;
	pins1 {
		u-boot,dm-pre-reloc;
	};
	pins2 {
		u-boot,dm-pre-reloc;
	};
};

 

 

mx.dts

 

 

aliases{
		serial0 = &uart4;
	};

	chosen{
		stdout-path = "serial0:115200n8";
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		framebuffer{
			compatible = "simple-framebuffer";
			clocks = <&rcc LTDC_PX>;
			status = "disabled";
		};
	};

...
&uart4{
	pinctrl-names = "default", "idle", "sleep";
	pinctrl-0 = <&uart4_pins_mx>;
	pinctrl-1 = <&uart4_idle_pins_mx>;
	pinctrl-2 = <&uart4_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN uart4 */
	/delete-property/ dmas;
	/delete-property/ dma-names;
	/* USER CODE END uart4 */
};

 

 

I can't see anything related in optee.dts what should be enabled to get access to UART4 in u-boot. So what am I missing? Where could I start to look? And what is this error? Is it related to UART4? Well, at least it can print the last error messages to it.

6 REPLIES 6
PatrickF
ST Employee

Hi @jhi 

this post might help you

https://community.st.com/t5/stm32-mpus-products/change-default-tf-a-and-u-boot-serial-linux-console/m-p/195035/highlight/true#M5683

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Yes I already saw it, but the base address (0x40010000) is correct for the UART4 (it is the default). And there are no switches in OP-TEE for UART4 as there are for USART2.

jhi
Senior

Here are my device tree files.

It is possible to attach only 3 files so the uboot-u-boot.dts is here:

// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause)
/*
 * Copyright (C) 2023, STMicroelectronics - All Rights Reserved
 * Author: STM32CubeMX code generation for STMicroelectronics.
 */

/* For more information on Device Tree configuration, please refer to
 * https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration
 */

/* USER CODE BEGIN includes */
#include "stm32mp13-u-boot.dtsi"
/* USER CODE END includes */

/ {

	/* USER CODE BEGIN root */

	aliases{
		mmc0 = &sdmmc1;
	};

	config{
		u-boot,mmc-env-partition = "u-boot-env";
	};

	/* USER CODE END root */

}; /*root*/

/* USER CODE BEGIN addons */
&uart4{
	u-boot,dm-pre-reloc;
};

&uart4_pins_mx {
	u-boot,dm-pre-reloc;
	pins1 {
		u-boot,dm-pre-reloc;
	};
	pins2 {
		u-boot,dm-pre-reloc;
	};
};
/* USER CODE END addons */

 

jhi
Senior

I have tried to debug this by adding print statements to serial-uclass.c.

In a function serial_check_stdout the chosen console is found serial0:115200n8, node 7780. Later the device uclass ID is UCLASS_SERIAL, but then the device_probe returns -ENODEV = No such device.

I did dump the tree of all devices

Class     Index  Probed  Driver                Name
-----------------------------------------------------------
 root          0  [ + ]   root_driver           root_driver
 simple_bus    0  [   ]   simple_bus            |-- soc
 clk           0  [   ]   fixed_clock           |-- clk-mco1
 serial        0  [   ]   serial_stm32          `-- serial@40010000

So the serial is found. 

uclass

uclass 95: serial
0     serial@40010000 @ c02803fc, seq 0

Driver

serial_stm32              095 serial               serial@40010000

So any ideas why it still complains that it can't find the device?

jhi
Senior

I have forgotten to write, that I'm using the bootlin buildroot release st/2023.02.10

jhi
Senior

I went down the rabbit hole and managed to find, that the problem is clock, but I still don't know what is wrong:

uclass_find_device_by_ofnode (uclass.c) tries to find device node for rcc@50000000. uclass_get will find it with the key 29 

 

Driver                    uid uclass               Devices
----------------------------------------------------------
stm32mp13_clk             029 clk                  <none>

 

and uclass_foreach_dev(dev, uc) do not anything as us->(I don't know which one) is NULL and then the uclass_find_device_by_ofnode will return -ENODEV.

 

@PatrickF  I would really appreciate a little help from your side. I don't know what the purpose of this community is, when you never get any answer. I still have few questions open and never got answer for those. I can also see, that there are lot of other questions from other users without any reaction from your side.