raspberrypi / firmware

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

CM4s: bad dt-blob.bin? #1691

Closed nbuchwitz closed 2 years ago

nbuchwitz commented 2 years ago

Describe the bug

After booting a CM4s there is an entry in vcdbg log which complains about a potential bad dt-blob.bin:

004290.256: gpioman: configuration attempt 1 failed (error 1) - bad dt-blob.bin?
004318.190: gpioman: configuration attempt 2 succeeded - using built-in dt-blob

I tried to compile a more recent version from https://github.com/raspberrypi/firmware/blob/master/extra/dt-blob.dts (stable and master), but the message still appears in the log.

To reproduce Boot a CM4s device and run vcdbg log msg

Expected behaviour dt-blob.bin is loaded and no message is present

Actual behaviour See bug description above

System Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:

Logs vcdbg log msg

003798.145: arasan: arasan_emmc_open
004275.403: brfs: File read: /mfs/sd/config.txt
004276.284: brfs: File read: 1935 bytes
004283.935: brfs: File read: /mfs/sd/dt-blob.bin
004290.256: gpioman: configuration attempt 1 failed (error 1) - bad dt-blob.bin?
004318.190: gpioman: configuration attempt 2 succeeded - using built-in dt-blob
004334.608: HDMI0:EDID error reading EDID block 0 attempt 0
004345.640: HDMI0:EDID error reading EDID block 0 attempt 1
004356.669: HDMI0:EDID error reading EDID block 0 attempt 2
004367.700: HDMI0:EDID error reading EDID block 0 attempt 3
004378.730: HDMI0:EDID error reading EDID block 0 attempt 4
004389.761: HDMI0:EDID error reading EDID block 0 attempt 5
004400.790: HDMI0:EDID error reading EDID block 0 attempt 6
004411.821: HDMI0:EDID error reading EDID block 0 attempt 7
004422.851: HDMI0:EDID error reading EDID block 0 attempt 8
004433.882: HDMI0:EDID error reading EDID block 0 attempt 9
004434.895: HDMI0:EDID giving up on reading EDID block 0
004446.161: HDMI1:EDID error reading EDID block 0 attempt 0
004452.186: HDMI1:EDID error reading EDID block 0 attempt 1
004458.209: HDMI1:EDID error reading EDID block 0 attempt 2
004464.233: HDMI1:EDID error reading EDID block 0 attempt 3
004470.255: HDMI1:EDID error reading EDID block 0 attempt 4
004476.279: HDMI1:EDID error reading EDID block 0 attempt 5
004482.302: HDMI1:EDID error reading EDID block 0 attempt 6
004488.326: HDMI1:EDID error reading EDID block 0 attempt 7
004494.348: HDMI1:EDID error reading EDID block 0 attempt 8
004500.372: HDMI1:EDID error reading EDID block 0 attempt 9
004501.386: HDMI1:EDID giving up on reading EDID block 0
004501.468: brfs: File read: 66838 bytes
004504.495: brfs: File read: /mfs/sd/config.txt
004505.366: gpioman: gpioman_get_pin_num: pin DISPLAY_SDA not defined
004505.382: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
004517.171: gpioman: gpioman_get_pin_num: pin FLASH_0_ENABLE not defined
004517.187: gpioman: gpioman_get_pin_num: pin FLASH_0_INDICATOR not defined
004517.217: gpioman: gpioman_get_pin_num: pin FLASH_0_ENABLE not defined
004517.235: gpioman: gpioman_get_pin_num: pin FLASH_0_INDICATOR not defined
004839.215: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
004839.257: *** Restart logging
004839.277: brfs: File read: 1935 bytes
004851.659: hdmi: HDMI0:EDID error reading EDID block 0 attempt 0
004862.693: hdmi: HDMI0:EDID error reading EDID block 0 attempt 1
004873.723: hdmi: HDMI0:EDID error reading EDID block 0 attempt 2
004884.756: hdmi: HDMI0:EDID error reading EDID block 0 attempt 3
004895.788: hdmi: HDMI0:EDID error reading EDID block 0 attempt 4
004906.822: hdmi: HDMI0:EDID error reading EDID block 0 attempt 5
004917.853: hdmi: HDMI0:EDID error reading EDID block 0 attempt 6
004928.886: hdmi: HDMI0:EDID error reading EDID block 0 attempt 7
004939.917: hdmi: HDMI0:EDID error reading EDID block 0 attempt 8
004950.950: hdmi: HDMI0:EDID error reading EDID block 0 attempt 9
004951.965: hdmi: HDMI0:EDID giving up on reading EDID block 0
004962.019: hdmi: HDMI0:EDID error reading EDID block 0 attempt 0
004973.052: hdmi: HDMI0:EDID error reading EDID block 0 attempt 1
004984.083: hdmi: HDMI0:EDID error reading EDID block 0 attempt 2
004995.116: hdmi: HDMI0:EDID error reading EDID block 0 attempt 3
005006.148: hdmi: HDMI0:EDID error reading EDID block 0 attempt 4
005017.181: hdmi: HDMI0:EDID error reading EDID block 0 attempt 5
005028.213: hdmi: HDMI0:EDID error reading EDID block 0 attempt 6
005039.246: hdmi: HDMI0:EDID error reading EDID block 0 attempt 7
005050.277: hdmi: HDMI0:EDID error reading EDID block 0 attempt 8
005061.311: hdmi: HDMI0:EDID error reading EDID block 0 attempt 9
005062.325: hdmi: HDMI0:EDID giving up on reading EDID block 0
005074.587: hdmi: HDMI1:EDID error reading EDID block 0 attempt 0
005080.612: hdmi: HDMI1:EDID error reading EDID block 0 attempt 1
005086.636: hdmi: HDMI1:EDID error reading EDID block 0 attempt 2
005095.351: hdmi: HDMI1:EDID error reading EDID block 0 attempt 3
005101.398: hdmi: HDMI1:EDID error reading EDID block 0 attempt 4
005107.448: hdmi: HDMI1:EDID error reading EDID block 0 attempt 5
005113.494: hdmi: HDMI1:EDID error reading EDID block 0 attempt 6
005119.544: hdmi: HDMI1:EDID error reading EDID block 0 attempt 7
005125.591: hdmi: HDMI1:EDID error reading EDID block 0 attempt 8
005131.638: hdmi: HDMI1:EDID error reading EDID block 0 attempt 9
005132.668: hdmi: HDMI1:EDID giving up on reading EDID block 0
005137.756: hdmi: HDMI1:EDID error reading EDID block 0 attempt 0
005143.805: hdmi: HDMI1:EDID error reading EDID block 0 attempt 1
005149.851: hdmi: HDMI1:EDID error reading EDID block 0 attempt 2
005155.900: hdmi: HDMI1:EDID error reading EDID block 0 attempt 3
005161.948: hdmi: HDMI1:EDID error reading EDID block 0 attempt 4
005167.997: hdmi: HDMI1:EDID error reading EDID block 0 attempt 5
005174.044: hdmi: HDMI1:EDID error reading EDID block 0 attempt 6
005180.093: hdmi: HDMI1:EDID error reading EDID block 0 attempt 7
005186.141: hdmi: HDMI1:EDID error reading EDID block 0 attempt 8
005192.190: hdmi: HDMI1:EDID error reading EDID block 0 attempt 9
005193.219: hdmi: HDMI1:EDID giving up on reading EDID block 0
005201.193: HDMI0: hdmi_pixel_encoding: 600000000
005201.207: HDMI1: hdmi_pixel_encoding: 162000000
005202.036: gpioman: gpioman_get_pin_num: pin CAMERA_0_I2C_PORT not defined
005202.056: dtb_file 'bcm2711-rpi-cm4s.dtb'
005209.008: brfs: File read: /mfs/sd/bcm2711-rpi-cm4s.dtb
005209.024: Loading 'bcm2711-rpi-cm4s.dtb' to 0x100 size 0xbfac
005220.455: brfs: File read: 49068 bytes
005231.859: brfs: File read: /mfs/sd/overlays/overlay_map.dtb
005288.860: brfs: File read: 1703 bytes
005289.982: brfs: File read: /mfs/sd/config.txt
005290.466: dtparam: audio=off
005299.727: brfs: File read: 1935 bytes
005309.505: brfs: File read: /mfs/sd/overlays/vc4-kms-v3d-pi4.dtbo
005367.160: Loaded overlay 'vc4-kms-v3d'
005693.442: brfs: File read: 3823 bytes
005696.847: brfs: File read: /mfs/sd/overlays/dwc2.dtbo
005710.095: Loaded overlay 'dwc2'
005710.117: dtparam: dr_mode=host
005732.987: brfs: File read: 801 bytes
005740.280: brfs: File read: /mfs/sd/overlays/revpi-core.dtbo
005784.020: Loaded overlay 'revpi-core'
005784.064: dtparam: eth0_mac_hi=0xc83ea700
005786.814: dtparam: eth0_mac_lo=0x2ae5
006033.537: brfs: File read: 3987 bytes
006035.247: brfs: File read: /mfs/sd/cmdline.txt
006035.333: Read command line from file 'cmdline.txt':
006035.358: 'dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait nosplash plymouth.ignore-serial-consoles'
006088.746: CMA size reduced to 256MB (total_mem 1024MB, gpu_mem 76MB)
006290.215: brfs: File read: 154 bytes
007529.849: brfs: File read: /mfs/sd/kernel7l.img
007529.883: Loading 'kernel7l.img' to 0x8000 size 0x6afa20
007529.925: Device tree loaded to 0x2eff3300 (size 0xcc5d)
007540.732: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
009724.525: vchiq_core: vchiq_init_state: slot_zero = 0xded80000, is_master = 1
009732.336: TV service:host side not connected, dropping notification 0x00000002, 0x00000002, 0x00000004
009732.364: TV service:host side not connected, dropping notification 0x00000002, 0x00000002, 0x00000004

Additional context Add any other relevant context for the problem.

pelwell commented 2 years ago

What are you trying to achieve with dt-blob.bin? You are probably better off without it.

popcornmix commented 2 years ago

dtblob.dts "updated" to a stale version when we bumped to 5.15 from the next branch. I've updated master branch version to latest (which includes cm4s support).

pelwell commented 2 years ago

Thanks. My question still remains though, @nbuchwitz - why do you need an external dt-blob.bin?

nbuchwitz commented 2 years ago

@pelwell Nothing specific. Just stumbled over the entry in vcdbg logs, while I was debugging another issue. The dt-blob.bin exists in our image mostly for historical reasons and probably can be removed safely.

@popcornmix I tried with your updated version and the message is gone (also when the file is absent and the included one is used)

If there aren't any objections, I will close this issue. Thanks a lot!

pelwell commented 2 years ago

We rarely object to issues being closed.

l1k commented 2 years ago
What are you trying to achieve with dt-blob.bin? You are probably better off without it.

Our use cases for dt-blob.bin comprise:

We've noticed that most of what is configured in dt-blob.bin can also be configured in the HAT EEPROM, albeit only for bank 0. That's a problem for us. Is there any chance that you could extend the HAT EEPROM spec and firmware support to allow for setting up the upper banks as well on boot?

nbuchwitz commented 2 years ago

Thanks for the clarification, @l1k

l1k commented 2 years ago

@popcornmix: The dt-blob.dts contains two entries for the CM4S which look fishy:

            pin_define@EMMC_ENABLE {
               type = "internal";
               number = <49>;
            };
            pin_define@LEDS_DISK_ACTIVITY {
               type = "internal";
               number = <46>;
            };

On the CM1, EMMC_ENABLE is number 47 and on the CM3, it's number 1. On both, LEDS_DISK_ACTIVITY is absent.

Please confirm that these two CM4S settings are correct.

Moreover, the pin_config section is missing the entries for EMMC_ENABLE_N polarity, SD drive strength, SMPS_SCL/SDA and Hotplug. I'm wondering if that's on purpose or an oversight?

pelwell commented 2 years ago

GPIO49 is a signal called EMMC_DISABLE_N (i.e. EMMC_ENABLE), which is tied high. GPIO46 is inconnected, so the LEDS_DISK_ACTIVITY is vestigial (but does avoid a warning).