All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] stm32mp1 kernel won't boot on custom board
@ 2023-01-28 20:52 Ra C
  2023-01-28 21:21 ` Thomas Petazzoni via buildroot
  2023-01-30 14:54 ` Simon Doppler
  0 siblings, 2 replies; 5+ messages in thread
From: Ra C @ 2023-01-28 20:52 UTC (permalink / raw)
  To: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 812 bytes --]

I have a custom stm32mp157a board which runs OK with a modified 5.4 kernel.
I want to migrate to the latest stm supported kernel.
I built a stm32mp157a_dk1 target using the BR2_EXTERNAL feature described
here: https://github.com/bootlin/buildroot-external-st which builds a 5.15
kernel.

Using the same dtb , the 5.15 kernel fails to mount the root device (a
micro sd card on SDMMC1) and gets stuck in a loop looking for a device
matching the PARTUUID in class_find_device().  The only devices listed are
loop and ram.

The probe function in drivers/mmc/host/mmci.c, which gets called in the
working kernel prior to mounting the root device does not get called with
the 5.15 kernel.

I don't understand why this is happening given that the same device tree is
used in both cases and not sure where next to look.

[-- Attachment #1.2: Type: text/html, Size: 1041 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] stm32mp1 kernel won't boot on custom board
  2023-01-28 20:52 [Buildroot] stm32mp1 kernel won't boot on custom board Ra C
@ 2023-01-28 21:21 ` Thomas Petazzoni via buildroot
  2023-01-28 22:52   ` Ra C
  2023-01-30 14:54 ` Simon Doppler
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-01-28 21:21 UTC (permalink / raw)
  To: Ra C; +Cc: buildroot

On Sat, 28 Jan 2023 14:52:12 -0600
Ra C <rcrichlow9000@gmail.com> wrote:

> I have a custom stm32mp157a board which runs OK with a modified 5.4 kernel.
> I want to migrate to the latest stm supported kernel.
> I built a stm32mp157a_dk1 target using the BR2_EXTERNAL feature described
> here: https://github.com/bootlin/buildroot-external-st which builds a 5.15
> kernel.
> 
> Using the same dtb , the 5.15 kernel fails to mount the root device (a

What do you mean by "using the same DTB" ?

Make sure to use the DTB that matches the kernel version you're using.
Even though DTBs are in theory kernel-version independent, there are
quite frequently some subtle changes that causes a DTB written for
kernel version X to not work with kernel version Y.

Also, make sure to pass "rootwait" in your kernel command line, to tell
the kernel to wait for the root device to appear. As SD/MMC devices are
detected asynchronously, sometimes they are detected too late compared
to the point where the kernel attempts to mount the rootfs.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] stm32mp1 kernel won't boot on custom board
  2023-01-28 21:21 ` Thomas Petazzoni via buildroot
@ 2023-01-28 22:52   ` Ra C
  0 siblings, 0 replies; 5+ messages in thread
From: Ra C @ 2023-01-28 22:52 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 2358 bytes --]

Thomas ,
Thanks for the comments.
Here are the steps I took:
1.  Decompiled the working dtb using :  dtc --sort --symbols -I dtb -O dts
-o working.dts stm32mp157a-fsmp1b.dtb
This gives the source device tree called working.dts (with no includes).

On the 5.4 kernel buildroot:
2.  Copied working.dts into output/build/linux-custom/arch/arm/boot/dts
3.  Ran make menuconfig to add working to
the BR2_LINUX_KERNEL_INTREE_DTS_NAME
4.  Rebuilt.
5.  Copied the output/images/working.dtb onto the sdcard and modified the
extlinux.conf to use this dtb.
6.  Boots OK.

7.  Built working.dtb using the same method as above using the 5.15 kernel
buildroot.
8.  Copied it to the sdcard and tried to boot the 5.15 kernel.
9.  The 5.15 kernel cannot find the root device and loops endlessly in
class_find_device() in drivers/base/class.c

Note that the 2 dtbs built using the 5.4 kernel buildroot and the 5.15
buildroot are identical (diff'ed them).

The rootwait kernel argument is present.  I tried removing it and got a
kernel panic.

Regards, Ramon


On Sat, Jan 28, 2023 at 3:21 PM Thomas Petazzoni <
thomas.petazzoni@bootlin.com> wrote:

> On Sat, 28 Jan 2023 14:52:12 -0600
> Ra C <rcrichlow9000@gmail.com> wrote:
>
> > I have a custom stm32mp157a board which runs OK with a modified 5.4
> kernel.
> > I want to migrate to the latest stm supported kernel.
> > I built a stm32mp157a_dk1 target using the BR2_EXTERNAL feature described
> > here: https://github.com/bootlin/buildroot-external-st which builds a
> 5.15
> > kernel.
> >
> > Using the same dtb , the 5.15 kernel fails to mount the root device (a
>
> What do you mean by "using the same DTB" ?
>
> Make sure to use the DTB that matches the kernel version you're using.
> Even though DTBs are in theory kernel-version independent, there are
> quite frequently some subtle changes that causes a DTB written for
> kernel version X to not work with kernel version Y.
>
> Also, make sure to pass "rootwait" in your kernel command line, to tell
> the kernel to wait for the root device to appear. As SD/MMC devices are
> detected asynchronously, sometimes they are detected too late compared
> to the point where the kernel attempts to mount the rootfs.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
>

[-- Attachment #1.2: Type: text/html, Size: 3297 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] stm32mp1 kernel won't boot on custom board
  2023-01-28 20:52 [Buildroot] stm32mp1 kernel won't boot on custom board Ra C
  2023-01-28 21:21 ` Thomas Petazzoni via buildroot
@ 2023-01-30 14:54 ` Simon Doppler
  2023-02-08 16:30   ` Ramon Crichlow
  1 sibling, 1 reply; 5+ messages in thread
From: Simon Doppler @ 2023-01-30 14:54 UTC (permalink / raw)
  To: Ra C, buildroot

Hello Ramon,

On Sat, 2023-01-28 at 14:52 -0600, Ra C wrote:
> I have a custom stm32mp157a board which runs OK with a modified 5.4 kernel.
> I want to migrate to the latest stm supported kernel.
> I built a stm32mp157a_dk1 target using the BR2_EXTERNAL feature described here:
> https://github.com/bootlin/buildroot-external-st which builds a 5.15 kernel.
> 
> Using the same dtb , the 5.15 kernel fails to mount the root device (a micro sd card on SDMMC1)
> and gets stuck in a loop looking for a device matching the PARTUUID in class_find_device().  The
> only devices listed are loop and ram.
> 
> The probe function in drivers/mmc/host/mmci.c, which gets called in the working kernel prior to
> mounting the root device does not get called with the 5.15 kernel.
> 
> I don't understand why this is happening given that the same device tree is used in both cases and
> not sure where next to look.

Since the DTB is the same, are all the required drivers present (not as modules)? I didn't check
which drivers exactly are built in with the configs ST provides. I would especially check for the
CONFIG_MMC* values and whether the required filesystem support is built in.

Best,

Simon
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] stm32mp1 kernel won't boot on custom board
  2023-01-30 14:54 ` Simon Doppler
@ 2023-02-08 16:30   ` Ramon Crichlow
  0 siblings, 0 replies; 5+ messages in thread
From: Ramon Crichlow @ 2023-02-08 16:30 UTC (permalink / raw)
  To: Simon Doppler; +Cc: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 1651 bytes --]

The cd-gpios property of sdmmc@58005000  was different in the custom board
dts and the dk1 dts.
Modifying the dk1  uboot dts and the kernel dts (stm32mp15xx-dkx.dtsi)
allowed me to boot the custom board with the latest kernel.
The kernel wasn't getting the card detect signal so wasn't able to mount
the sd card.

Regards,
Ramon

On Mon, Jan 30, 2023 at 8:54 AM Simon Doppler <dopsi@dopsi.ch> wrote:

> Hello Ramon,
>
> On Sat, 2023-01-28 at 14:52 -0600, Ra C wrote:
> > I have a custom stm32mp157a board which runs OK with a modified 5.4
> kernel.
> > I want to migrate to the latest stm supported kernel.
> > I built a stm32mp157a_dk1 target using the BR2_EXTERNAL feature
> described here:
> > https://github.com/bootlin/buildroot-external-st which builds a 5.15
> kernel.
> >
> > Using the same dtb , the 5.15 kernel fails to mount the root device (a
> micro sd card on SDMMC1)
> > and gets stuck in a loop looking for a device matching the PARTUUID
> in class_find_device().  The
> > only devices listed are loop and ram.
> >
> > The probe function in drivers/mmc/host/mmci.c, which gets called in the
> working kernel prior to
> > mounting the root device does not get called with the 5.15 kernel.
> >
> > I don't understand why this is happening given that the same device tree
> is used in both cases and
> > not sure where next to look.
>
> Since the DTB is the same, are all the required drivers present (not as
> modules)? I didn't check
> which drivers exactly are built in with the configs ST provides. I would
> especially check for the
> CONFIG_MMC* values and whether the required filesystem support is built in.
>
> Best,
>
> Simon
>

[-- Attachment #1.2: Type: text/html, Size: 2211 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-08 16:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-28 20:52 [Buildroot] stm32mp1 kernel won't boot on custom board Ra C
2023-01-28 21:21 ` Thomas Petazzoni via buildroot
2023-01-28 22:52   ` Ra C
2023-01-30 14:54 ` Simon Doppler
2023-02-08 16:30   ` Ramon Crichlow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.