agherzan / meta-raspberrypi

Yocto/OE BSP layer for the Raspberry Pi boards
https://www.yoctoproject.org/
MIT License
525 stars 407 forks source link

Backport 6.1 to kirkstone -> no serial console #1222

Open nandra opened 1 year ago

nandra commented 1 year ago

Hi, I'm using kirkstone release of this layer in my project but would like to use new kernel 6.1. I've backported it to my layer (basically took it from master branch). Kernel seems to boot but I cannot see any output on serial console. In kirkstone I've set console=ttyAMA0,115200 in cmdline.txt file. Does something changed between kernel releases? I've tried to change to console=ttyS0,155200 but witout success. Any ideas what else I can check please? Thanks.

agherzan commented 1 year ago

@nandra Maybe it requires a bootloader update, too. Could you cross-check a RaspberryOS? That is strange, though, as I know people booting it fine - even though I haven't tested it until now.

nandra commented 1 year ago

@agherzan I've checked and rpi-firmware is same on kirkstone & master if you mean by "bootloader update"

mainmachine commented 10 months ago

Looks like /etc/udev/rules.d/99-com.rules in a kirkstone build is different than versus bookworm. Kirkstone has this section which is absent from what I see on RPIOS:

KERNEL=="ttyAMA0", PROGRAM="/bin/sh -c '\
    ALIASES=/proc/device-tree/aliases; \
    if cmp -s $$ALIASES/uart0 $$ALIASES/serial0; then \
        echo 0;\
    elif cmp -s $$ALIASES/uart0 $$ALIASES/serial1; then \
        echo 1; \
    else \
        exit 1; \
    fi\
'", SYMLINK+="serial%c"

So udev on kirkstone is setting up a serial on uart, presumably the master branch is not doing this. About to attempt porting 6.1 to kirkstone myself so I can check this, but you can compare /etc/udev/rules.d/99-com.rules between kirkstone and master builds to verify.

kirkstone_99-com.rules.txt bookworm_99-com.rules.txt

EDIT: Master is in fact pulling this file from upstream as of this commit.

yayay commented 5 months ago

@nandra were you able to boot a 6.1 Linux kernel from the kirkstone branch?

I'm not having much success with that. I don't get any kernel log output on the serial console.

nandra commented 5 months ago

@yayay Please try to update also rpi firmware (bootfiles). It should work then.

yayay commented 5 months ago

@nandra I see. I have tried RPIFW_DATE ?= "20230405", but still no boot. (instead of RPIFW_DATE ?= "20220830") Which version are you using?

yayay commented 5 months ago

In my case, the kernel was panicking early in the boot process during a USB controller init and I wasn't getting the printout on serial console because tty numbering has changed for some reason. Now, 5.15 -> 6.1 ttyAMA0 -> ttyAMA1 ttyAMA1 -> ttyAMA5