[PATCH v4 2/4] clk: imx8mq: Add a clock driver for the imx8mq

Angus Ainslie angus at akkea.ca
Wed Mar 16 13:35:32 CET 2022


On 2022-03-16 05:26, Heiko Thiery wrote:
> Hi,
> 
> Am Mi., 16. März 2022 um 08:14 Uhr schrieb Heiko Thiery
> <heiko.thiery at gmail.com>:
>> 
>> Hi Angus,
>> 
>> Am Di., 15. März 2022 um 16:46 Uhr schrieb Angus Ainslie
>> <angus.ainslie at puri.sm>:
>> >
>> > Hi Heiko,
>> >
>> > On 2022-03-15 08:35, Heiko Thiery wrote:
>> >
>> > Hi Angus and all,
>> >
>> >
>> >
>> >
>> > Am Di., 15. März 2022 um 14:09 Uhr schrieb Angus Ainslie <angus at akkea.ca>:
>> >>
>> >> This is a DM clock driver based off the imx8mm u-boot driver and the linux
>> >> kernel driver.
>> >>
>> >> All of the PLLs and clocks are initialized so the subsystems below are
>> >> functional and tested.
>> >>
>> >> 1) USB host and peripheral
>> >> 2) ECSPI
>> >> 3) UART
>> >> 4) I2C all busses
>> >> 5) USDHC for eMMC support
>> >> 6) USB storage
>> >> 7) GPIO
>> >> 8) DRAM
>> >>
>> >>
>> > Snip
>> >
>> >
>> > when adding this patch and enabling CLK_IMX8MQ I see the following on my board .. Any idea what I missed here?
>> >
>> > --- >8 ---
>> > U-Boot SPL 2022.04-rc4-00008-g390d9bf9a1 (Mar 15 2022 - 16:26:59 +0100)
>> > Trying to boot from SD card
>> >
>> >
>> > U-Boot 2022.04-rc4-00008-g390d9bf9a1 (Mar 15 2022 - 16:26:59 +0100)
>> >
>> > CPU:   Freescale i.MX8MQ rev2.1 at 800 MHz
>> > Reset cause: POR
>> > Model: Kontron pITX-imx8m
>> > DRAM:  alloc space exhausted
>> > alloc space exhausted
>> > alloc space exhausted
>> > alloc space exhausted
>> > alloc space exhausted
>> > alloc space exhausted
>> > alloc space exhausted
>> > alloc space exhausted
>> > alloc space exhausted
>> > alloc space exhausted
>> > alloc space exhausted
>> > alloc space exhausted
>> > 4 GiB
>> >
>> > My guess is that there was static code that was setting up the DRAM pll that isn't get executed now that there's a DM clock driver.
>> >
>> > I'd try enabling DEBUG in the clk-uclass and clk-composite drivers.
>> >
>> > Also look at what DRAM initialization code is not being run now. Our board doesn't have an DRAM specific initialization so there could be a bug in the DRAM setup.
>> 
>> The problem was the MALLOC_F_LEN value. Increasing that the "alloc
>> space exhausted" is gone.
>> 
>> But with the enabled DM_SERIAL the problem of "No serial driver found"
>> is still there and the board reboots. You said you have DM_SERIAL
>> enabled and it works?
> 
> Meanwhile I figured out what the problem is with the 'No serial driver
> found'. In the used dtb there are 'assigned-clocks' and
> 'assigned-clock-parents' set in the uart nodes. When removing this the
> serial will work. I have to admit that I do not know why this is set
> that way. I can only imagine that this was taken from the uboot-imx
> tree.
> 
> ---
> assigned-clocks = <&clk IMX8MQ_CLK_UART1>;
> assigned-clock-parents = <&clk IMX8MQ_SYS1_PLL_80M>;
> ---
> 

Does that solve the reboot ?

> see also here:
> https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/imx8mq-kontron-pitx-imx8m.dts#L315

If that works for Linux it should also work for u-boot. It may be that 
the SYS1_PLL_80M isn't set correctly or that the CLK_UART1 mux isn't 
correctly setup. If you enable DEBUG in clk-uclass I might be able to 
figure out were the problem is.



More information about the U-Boot mailing list