raspberrypi / firmware

This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
5.15k stars 1.68k forks source link

Serial console unavailable when booting Raspberry Pi 4B over network #1575

Open manuel-wagesreither opened 3 years ago

manuel-wagesreither commented 3 years ago

Problem description

When booting my Raspberry Pi 4B using a USB drive, I receive diagnostic information via UART while booting and can login through said UART afterwards. When netbooting the device and providing the exact same set of boot files (verified with md5sum) through TFTP, the device stops to send data through UART early during boot.

It seems to me, some part of the firmware forces the kernel parameter 8250.nr_uarts to 0 when netbooting. Even when I set 8250.nr_uarts=1 in cmdline.txt, I get 8250.nr_uarts=0 in /proc/cmdline of the netbooted system. This is not the case when usb booting the device.

Expected behaviour

While netbooting, the kernel sends diagnostic information over serial. After boot, it provides a console interface over serial interface.

Actual behaviour

Kernel neither sends diagnostic information, nor does it provide a console interface over UART when netboot is used.

How to reproduce

System information

Configuration

cmdline.txt: dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/sda2 rootfstype=ext4 rootwait 8250.nr_uarts=1

config.txt:

dtoverlay=vc4-fkms-v3d
arm_64bit=1
enable_uart=1
uart_2ndstage=1

Logs

/proc/cmdline of netbooted device:

coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1  smsc95xx.macaddr=DC:A6:32:B8:04:5C vc_mem.mem_base=0x3eb00000 vc_mem.mem_size=0x3ff00000  dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 root=/dev/sda2 rootfstype=ext4 rootwait 8250.nr_uarts=0

/proc/cmdline of usb booted device:

coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1  smsc95xx.macaddr=DC:A6:32:B8:04:5C vc_mem.mem_base=0x3eb00000 vc_mem.mem_size=0x3ff00000  dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 root=/dev/sda2 rootfstype=ext4 rootwait 8250.nr_uarts=1

Serial mappings on both the netbooted and usb booted system /proc/device-tree/aliases/serial0: /soc/serial@7e215040pi /proc/device-tree/aliases/serial1: /soc/serial@7e201000

Received UART data when netbooting:

PM_RSTS: 0x00000020
RPi: BOOTLOADER release VERSION:d6d82cf9 DATE: Feb 16 2021 TIME: 13:23:40 BOOTMODE: 0x00000006 part: 0 BUILD_TIMESTAMP=1613481816 0x75633c6c 0x00d03114 0x000a53fa
PM_RSTS: 0x00000020
part 00000000 reset_info 00000000
uSD voltage 3.3V
Initialising SDRAM 'Micron' 32Gb x2 total-size: 64 Gbit 3200
PCI reset
PCI reset
VLI: HUB2: 0xfff00000 0x24e6 MCU: 0xfff20000 0x15218
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ports 5 slots 32 intrs 4
Boot mode: NETWORK (02) order f14
GENET: RESET_PHY
NET_BOOT: dc:a6:32:b8:04:5c wait for link TFTP: 0.0.0.0
LINK STATUS: speed: 1000 full duplex
Link ready
GENET START: 64 16 32
GENET: UMAC_START 0xdca632b8 0x045c0000
RX: 0 IP: 0 IPV4: 0 MAC: 0 UDP: 0 UDP RECV: 0 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
DHCP src: 00:0e:c6:e2:13:18 192.168.128.1
YI_ADDR 192.168.128.119
SI_ADDR 192.168.128.1
OPTIONS:-
        op: 53 len:   1 DHCP recv OFFER (2) expect OFFER
        op: 54 len:   4 192.168.128.1
        op: 51 len:   4 
        op: 58 len:   4 
        op: 59 len:   4 
        op:  1 len:   4 255.255.255.0
        op: 28 len:   4 192.168.128.255
        op:  3 len:   4 192.168.128.1
        op: 60 len:   9 
        op: 97 len:  17 
        op: 43 len:  32 
                PXE op:  6 len:   1 
                PXE op: 10 len:   4 
                PXE op:  9 len:  20 
00000000  52 61 73 70 62 65 72 72  79 20 50 69 20 42 6f 6f |Raspberry Pi Boo|
00000010  74 ff ff 00                                      |t...            |
[43:9]: 'Raspberry Pi Boot��'

DHCP src: 00:0e:c6:e2:13:18 192.168.128.1
YI_ADDR 192.168.128.119
SI_ADDR 192.168.128.1
OPTIONS:-
        op: 53 len:   1 DHCP recv ACK (5) expect ACK
        op: 54 len:   4 192.168.128.1
        op: 51 len:   4 
        op: 58 len:   4 
        op: 59 len:   4 
        op:  1 len:   4 255.255.255.0
        op: 28 len:   4 192.168.128.255
        op:  3 len:   4 192.168.128.1
NET 192.168.128.119 255.255.255.0 gw 0.0.0.0 tftp 192.168.128.1
ARP 192.168.128.1 00:0e:c6:e2:13:18
NET 192.168.128.119 255.255.255.0 gw 0.0.0.0 tftp 192.168.128.1
RX: 3 IP: 0 IPV4: 4 MAC: 2 UDP: 2 UDP RECV: 2 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
TFTP_GET: 00:0e:c6:e2:13:18 192.168.128.1 75633c6c/start4.elf

RX: 3 IP: 0 IPV4: 4 MAC: 2 UDP: 2 UDP RECV: 2 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
TFTP 1: Datei /home/manuel/bora-proj/build/tmp/deploy/images/raspberrypi4-64/bootfiles/75633c6c/start4.elf nicht gefunden 
RX: 4 IP: 0 IPV4: 6 MAC: 3 UDP: 3 UDP RECV: 3 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
75633c6c/start4.elf not found
TFTP_GET: 00:0e:c6:e2:13:18 192.168.128.1 75633c6c/start.elf

RX: 4 IP: 0 IPV4: 6 MAC: 3 UDP: 3 UDP RECV: 3 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
TFTP 1: Datei /home/manuel/bora-proj/build/tmp/deploy/images/raspberrypi4-64/bootfiles/75633c6c/start.elf nicht gefunden 
RX: 5 IP: 0 IPV4: 8 MAC: 4 UDP: 4 UDP RECV: 4 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
75633c6c/start.elf not found
TFTP_GET: 00:0e:c6:e2:13:18 192.168.128.1 config.txt

RX: 5 IP: 0 IPV4: 8 MAC: 4 UDP: 4 UDP RECV: 4 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
TFTP: complete 36339
RX: 42 IP: 0 IPV4: 82 MAC: 41 UDP: 41 UDP RECV: 41 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
Read config.txt bytes    36339 hnd 0x00000000 
TFTP_GET: 00:0e:c6:e2:13:18 192.168.128.1 pieeprom.sig

RX: 42 IP: 0 IPV4: 82 MAC: 41 UDP: 41 UDP RECV: 41 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
TFTP 1: Datei /home/manuel/bora-proj/build/tmp/deploy/images/raspberrypi4-64/bootfiles/pieeprom.sig nicht gefunden 
RX: 43 IP: 0 IPV4: 84 MAC: 42 UDP: 42 UDP RECV: 42 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
Read pieeprom.upd failed
TFTP_GET: 00:0e:c6:e2:13:18 192.168.128.1 recover4.elf

RX: 43 IP: 0 IPV4: 84 MAC: 42 UDP: 42 UDP RECV: 42 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
TFTP 1: Datei /home/manuel/bora-proj/build/tmp/deploy/images/raspberrypi4-64/bootfiles/recover4.elf nicht gefunden 
RX: 44 IP: 0 IPV4: 86 MAC: 43 UDP: 43 UDP RECV: 43 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
Read recover4.elf failed
TFTP_GET: 00:0e:c6:e2:13:18 192.168.128.1 recovery.elf

RX: 44 IP: 0 IPV4: 86 MAC: 43 UDP: 43 UDP RECV: 43 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
TFTP 1: Datei /home/manuel/bora-proj/build/tmp/deploy/images/raspberrypi4-64/bootfiles/recovery.elf nicht gefunden 
RX: 45 IP: 0 IPV4: 88 MAC: 44 UDP: 44 UDP RECV: 44 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
Read recovery.elf failed
TFTP_GET: 00:0e:c6:e2:13:18 192.168.128.1 start4.elf

RX: 45 IP: 0 IPV4: 88 MAC: 44 UDP: 44 UDP RECV: 44 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
TFTP: complete 2283936
RX: 2277 IP: 0 IPV4: 4552 MAC: 2276 UDP: 2276 UDP RECV: 2276 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
Read start4.elf bytes  2283936 hnd 0x00000000 
TFTP_GET: 00:0e:c6:e2:13:18 192.168.128.1 fixup4.dat

RX: 2277 IP: 0 IPV4: 4552 MAC: 2276 UDP: 2276 UDP RECV: 2276 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
TFTP: complete 5422
RX: 2284 IP: 0 IPV4: 4566 MAC: 2283 UDP: 2283 UDP RECV: 2283 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
Read fixup4.dat bytes     5422 hnd 0x00000000 
Firmware: 8d19c1935e67d8ac2fe87c639d4e8b8ef250813b Aug 24 2020 18:50:56
0x00d03114 0x00000000 0x0000001f
MEM GPU: 76 ARM: 948 TOTAL: 1024
Starting start4.elf @ 0xfec00200 partition -1
Stopping network
RX: 2284 IP: 0 IPV4: 4566 MAC: 2283 UDP: 2283 UDP RECV: 2283 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
RX: 2284 IP: 0 IPV4: 4566 MAC: 2283 UDP: 2283 UDP RECV: 2283 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
RX_DISCARD: 0
  GR64: 0x00000001   GR64: 0x00000003  GR127: 0x00000005  GR255: 0x00000004 
 GR511: 0x00000001 GR1023: 0x000008de GR1518: 0x00000000  GRMGV: 0x00000000 
GR2047: 0x00000000 GR4095: 0x00000000 GR9216: 0x000008ec  GRPKT: 0x00253fd3 
 GRBYT: 0x00000000  GRMCA: 0x00000000  GRBCA: 0x00000000  GRFCS: 0x00000000 
 GRXCF: 0x00000000  GRXPF: 0x00000000  GRXUO: 0x00000000  GRALN: 0x00000000 
 GRFLR: 0x00000000  GRCDE: 0x00000000  GRFCR: 0x00000000  GROVR: 0x00000000 
 GRJBR: 0x00000000 GRMTUE: 0x000008ec  GRPOK: 0x000008ec   GRUC: 0x00000000 
 GRPPP: 0x00000000  GRCRC: 0x00000000 

  TR64: 0x000008e5  TR127: 0x00000008  TR255: 0x00000000  TR511: 0x00000003 
TR1023: 0x00000000 TR1518: 0x00000000  TRMGV: 0x00000000 TR2047: 0x00000000 
TR4095: 0x00000000 TR9216: 0x00000000  GTPKT: 0x000008f0  GTMCA: 0x00000000 
 GTBCA: 0x00000004  GTXPF: 0x00000000  GTXCF: 0x00000000  GTFCS: 0x00000000 
 GTOVR: 0x00000000  GTDRF: 0x00000000  GTEDF: 0x00000000  GTSCL: 0x00000000 
 GTMCL: 0x00000000  GTLCL: 0x00000000  GTXCL: 0x00000000  GTFRG: 0x00000000 
 GTNCL: 0x00000000  GTJBR: 0x00000000  GTBYT: 0x0002404a  GTPOK: 0x000008f0 
  GTUC: 0x000008ec 
GENET STOP: 0
PCI reset
Stop display
Display stopped
+

<reception stops at this point>

For comparison, received UART data when usb booting:

PM_RSTS: 0x00000020
RPi: BOOTLOADER release VERSION:d6d82cf9 DATE: Feb 16 2021 TIME: 13:23:40 BOOTMODE: 0x00000006 part: 0 BUILD_TIMESTAMP=1613481816 0x75633c6c 0x00d03114 0x000a53fa
PM_RSTS: 0x00000020
part 00000000 reset_info 00000000
uSD voltage 3.3V
Initialising SDRAM 'Micron' 32Gb x2 total-size: 64 Gbit 3200
PCI reset
PCI reset
VLI: HUB2: 0xfff00000 0x24e6 MCU: 0xfff20000 0x15218
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ports 5 slots 32 intrs 4
Boot mode: NETWORK (02) order f14
GENET: RESET_PHY
NET_BOOT: dc:a6:32:b8:04:5c wait for link TFTP: 0.0.0.0
LINK STATUS: speed: 1000 full duplex
Link ready
GENET START: 64 16 32
GENET: UMAC_START 0xdca632b8 0x045c0000
RX: 0 IP: 0 IPV4: 0 MAC: 0 UDP: 0 UDP RECV: 0 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
Stopping network
RX: 0 IP: 0 IPV4: 0 MAC: 0 UDP: 0 UDP RECV: 0 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
RX: 0 IP: 0 IPV4: 0 MAC: 0 UDP: 0 UDP RECV: 0 IP_CSUM_ERR: 0 UDP_CSUM_ERR: 0
RX_DISCARD: 0
  GR64: 0x00000000   GR64: 0x00000000  GR127: 0x00000000  GR255: 0x00000000 
 GR511: 0x00000000 GR1023: 0x00000000 GR1518: 0x00000000  GRMGV: 0x00000000 
GR2047: 0x00000000 GR4095: 0x00000000 GR9216: 0x00000000  GRPKT: 0x00000000 
 GRBYT: 0x00000000  GRMCA: 0x00000000  GRBCA: 0x00000000  GRFCS: 0x00000000 
 GRXCF: 0x00000000  GRXPF: 0x00000000  GRXUO: 0x00000000  GRALN: 0x00000000 
 GRFLR: 0x00000000  GRCDE: 0x00000000  GRFCR: 0x00000000  GROVR: 0x00000000 
 GRJBR: 0x00000000 GRMTUE: 0x00000000  GRPOK: 0x00000000   GRUC: 0x00000000 
 GRPPP: 0x00000000  GRCRC: 0x00000000 

  TR64: 0x00000000  TR127: 0x00000000  TR255: 0x00000000  TR511: 0x00000003 
TR1023: 0x00000000 TR1518: 0x00000000  TRMGV: 0x00000000 TR2047: 0x00000000 
TR4095: 0x00000000 TR9216: 0x00000000  GTPKT: 0x00000003  GTMCA: 0x00000000 
 GTBCA: 0x00000003  GTXPF: 0x00000000  GTXCF: 0x00000000  GTFCS: 0x00000000 
 GTOVR: 0x00000000  GTDRF: 0x00000000  GTEDF: 0x00000000  GTSCL: 0x00000000 
 GTMCL: 0x00000000  GTLCL: 0x00000000  GTXCL: 0x00000000  GTFRG: 0x00000000 
 GTNCL: 0x00000000  GTJBR: 0x00000000  GTBYT: 0x00000450  GTPOK: 0x00000003 
  GTUC: 0x00000000 
GENET STOP: 0
NETBOOT CANCEL
NETBOOT init failed
Boot mode: USB-MSD (04) order f1
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ports 5 slots 32 intrs 4
USB2[1] 400202e1 connected
USB2 root HUB port 1 init
DEV [01:00] 2.16 000000:01 class 9 VID 2109 PID 3431
HUB init [01:00] 2.16 000000:01
HUB [01:00] 2.16 000000:01 init port 1 speed 3
DEV [02:01] 2.16 000001:01 class 0 VID 0781 PID 5571
MSD device [02:01] 2.16 000001:01 conf 0 iface 0 ep 81#512 02#512
MSD [02:01] 2.16 000001:01 register MSD
MSD [02:01] 2.16 000001:01 LUN 0
MSD INQUIRY [02:01] 2.16 000001:01
MSD [02:01] 2.16 000001:01 lun 0 block-count 30595072 block-size 512
MBR: 0x00002000,  131072 type: 0x0c
MBR: 0x00022000, 4194304 type: 0x83
MBR: 0x00422000,26261504 type: 0x83
MBR: 0x00000000,       0 type: 0x00
Trying partition: 0
lba: 8192 oem: 'mkfs.fat' volume: ' BOOT       '
rsc 32 fat-sectors 1009 c-count 129022 c-size 1 r-dir 2 r-sec 0
PM_RSTS: 0x00000020
Trying partition: 0
lba: 8192 oem: 'mkfs.fat' volume: ' BOOT       '
rsc 32 fat-sectors 1009 c-count 129022 c-size 1 r-dir 2 r-sec 0
Read config.txt bytes    36339 hnd 0x0000006b 
HUB [01:00] 2.16 000000:01 init port 4 speed 2
DEV [03:01] 2.00 000004:01 class 0 VID 03f0 PID 140c
Read start4.elf bytes  2283936 hnd 0x00002458 
Read fixup4.dat bytes     5422 hnd 0x000000b9 
Firmware: 8d19c1935e67d8ac2fe87c639d4e8b8ef250813b Aug 24 2020 18:50:56
0x00d03114 0x00000000 0x0000001f
MEM GPU: 76 ARM: 947 TOTAL: 1023
Starting start4.elf @ 0xfeb00200 partition 0
Stopping network
Stop display
Display stopped
+

MESS:00:00:50.065509:0: bfs_xhci_retrieve 3ee78080
MESS:00:00:50.142233:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:50.160503:0: brfs: File read: 36339 bytes
MESS:00:00:50.186254:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:50.210674:0: brfs: File read: 36339 bytes
MESS:00:00:50.673316:0: gpioman: gpioman_get_pin_num: pin DISPLAY_DSI_PORT not defined
MESS:00:00:50.980934:0: *** Restart logging
MESS:00:00:50.985981:0: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
MESS:00:00:50.995275:0: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
MESS:00:00:51.001206:0: HDMI0: hdmi_pixel_encoding: 300000000
MESS:00:00:51.006673:0: HDMI1: hdmi_pixel_encoding: 300000000
MESS:00:00:51.017073:0: dtb_file 'bcm2711-rpi-4-b.dtb'
MESS:00:00:51.024082:0: brfs: File read: /mfs/sd/bcm2711-rpi-4-b.dtb
MESS:00:00:51.027331:0: Loading 'bcm2711-rpi-4-b.dtb' to 0x100 size 0xb99c
MESS:00:00:51.046036:0: brfs: File read: 47516 bytes
MESS:00:00:51.141813:0: brfs: File read: /mfs/sd/overlays/rpi-ft5406.dtbo
MESS:00:00:51.146282:0: Loaded overlay 'rpi-ft5406'
MESS:00:00:51.154828:0: brfs: File read: 842 bytes
MESS:00:00:51.174768:0: brfs: File read: /mfs/sd/overlays/rpi-backlight.dtbo
MESS:00:00:51.184436:0: Loaded overlay 'rpi-backlight'
MESS:00:00:51.198553:0: brfs: File read: 489 bytes
MESS:00:00:51.201776:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:51.221226:0: brfs: File read: 36339 bytes
MESS:00:00:51.246930:0: brfs: File read: /mfs/sd/overlays/vc4-fkms-v3d.dtbo
MESS:00:00:51.267499:0: Loaded overlay 'vc4-fkms-v3d'
MESS:00:00:51.308327:0: brfs: File read: 1238 bytes
MESS:00:00:51.311599:0: brfs: File read: /mfs/sd/cmdline.txt
MESS:00:00:51.315496:0: Read command line from file 'cmdline.txt':
MESS:00:00:51.321374:0: 'dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/sda2 rootfstype=ext4 rootwait 8250.nr_uarts=1'
MESS:00:00:52.409811:0: brfs: File read: 113 bytes
MESS:00:00:53.482006:0: brfs: File read: /mfs/sd/kernel8.img
MESS:00:00:53.484565:0: Loading 'kernel8.img' to 0x80000 size 0xf48a00
MESS:00:00:53.490825:0: Device tree loaded to 0x2eff4000 (size 0xbfd4)
MESS:00:00:53.497608:0: uart: Set PL011 baud rate to 103448.300000 Hz
MESS:00:00:53.506132:0: uart: Baud rate change done...
MESS:00:00:53.508154:0:[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[    0.000000] Linux version 5.4.59-v8 (oe-user@oe-host) (gcc version 9.3.0 (GCC)) #1 SMP PREEMPT Fri Aug 28 21:04:05 UTC 2020
[    0.000000] Machine model: Raspberry Pi 4 Model B Rev 1.4
[...]
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1  smsc95xx.macaddr=DC:A6:32:B8:04:5C vc_mem.mem_base=0x3eb00000 vc_mem.mem_size=0x3ff00000  dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 root=/dev/sda2 rootfstype=ext4 rootwait 8250.nr_uarts=1
[...]
[    0.191679] Serial: AMBA PL011 UART driver
[    0.204757] raspberrypi-firmware soc:firmware: Attached to firmware from 2020-08-24 18:50, variant start
[    0.208769] raspberrypi-firmware soc:firmware: Firmware hash is 8d19c1935e67d8ac2fe87c639d4e8b8ef250813b
[...]
[    1.197740] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[...]
[    1.378234] uart-pl011 fe201000.serial: cts_event_workaround enabled
[    1.379274] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 14, base_baud = 0) is a PL011 rev2
[    1.386169] printk: console [ttyS0] disabled
[    1.387233] fe215040.serial: ttyS0 at MMIO 0x0 (irq = 15, base_baud = 62500000) is a 16550
[    2.611908] printk: console [ttyS0] enabled
[...]
[  OK  ] Started Getty on tty1.
[  OK  ] Started Serial Getty on ttyS0.
[...]

Bora Horza Gobuchul (Poky-based) 1.0.0 raspberrypi4-64 ttyS0

raspberrypi4-64 login:

Additional tags for search indexer

manuel-wagesreither commented 3 years ago

The netboot firmware seems to take enable_uart=1 into account only when the whole string resides below the 0x1000 boundary. It gets ignored if the final 1 character is at ≥ 0x1000 of config.txt. This does not apply when usb-booting the device.

Here's a config.txt which boots the device but will result in 8250.nr_uarts=0. Serial console will not work.

00000fe0  61 64 20 74 68 65 20 45  44 49 44 20 64 61 74 61  |ad the EDID data|
00000ff0  20 66 72 0a 65 6e 61 62  6c 65 5f 75 61 72 74 3d  | fr.enable_uart=|
00001000  31 0a 23 23 20 20 20 20  20 64 65 76 69 63 65 0a  |1.##     device.|
00001010  23 23 0a 23 23 20 20 20  20 20 56 61 6c 75 65 20  |##.##     Value |

When you remove any character before the enable_uart=1 at line 119, 8250.nr_uart will be 1 and serial console will work as expected.

00000fe0  61 64 20 74 68 65 20 45  44 49 44 20 64 61 74 61  |ad the EDID data|
00000ff0  20 66 0a 65 6e 61 62 6c  65 5f 75 61 72 74 3d 31  | f.enable_uart=1|
00001000  0a 23 23 20 20 20 20 20  64 65 76 69 63 65 0a 23  |.##     device.#|
adudek16 commented 3 years ago

The is a difference in the two lines. The top one (broken) is
fr.enable_uart=1
The bottom on is
`f.enable_uart=1'

Looks like there is a typo, but it probably should be able to handle if the line is >_ 0x1000

Malvineous commented 3 years ago

@adudek16 The . here is used because the 0x0A character (a newline) cannot be printed in the hex view. Here the . is where the line starts, so they both say enable_uart=1, there is no typo.

caipiblack commented 2 years ago

I had the exact same problem with RaspberryPI3 booting over PXE and your issue saved my time.

I confirm that if we remove all of the comments in config.txt file, it works fine.

Did someone know where is the limit of 0x1000 exactly ? Raspberry PI bootcode ?

JamesH65 commented 2 years ago

IIRC its somewhere deep down in the file handling code in the bootloader, which we haven't touched in ten years, so people are reluctant to make changes to it. Could be wrong, sure someone will correct me if so!

albireotech commented 11 months ago

Thank you for posting this issue - it's a couple years later, but the same/similar issue still appears to be present with the serial console during a PXE boot, and shortening the config.txt resolved it for me as well, so this report was a real lifesaver. Your attention and diligent work tracking this down saved me a bunch of time, so again, thank you very much!