Robert Tiemann
Posts: 9
Joined: Wed Jan 14, 2015 2:08 pm

Completely disable the ACT LED at very early boot stages

Thu Aug 08, 2019 2:03 pm

We have recently found a flaw in our hardware which prevents the Compute Module 1 from booting in our boards when using recent versions of bootcode.bin/start_cd.elf firmware. Forcing the activity LED off by hardware modification allows the CM1 to boot, so we figured it should be possible to boot if the LED is never used at all. (Oddly, old versions of bootcode.bin/start_cd.elf from years ago do not cause this problem, so we never noticed.)

I know about config.txt parameters dtparam=act_led_trigger=none and dtparam=act_led_activelow=off, but these only affect the Linux kernel, which is too late as the kernel is never started. The LED is still driven by any one of the boot ROM, bootcode.bin, or start_cd.elf, causing our boot problem (there is crosstalk on EMMC_DISABLE_N induced by the LED). I have found no way to deactivate the ACT LED this early in the boot process by software to confirm this.

And a software solution is key for us. We have a significant amount of this hardware in the field which we need to upgrade (coming from Linux kernel 3.18), and we cannot easily fix all the hardware out there. Further, we plan on using the same software for the Compute Module 3 and would prefer not to make any case distinctions between CM1/CM3. The CM3 actually works fine in the same hardware which is failing on the CM1, using the same exact software.

Here are the messages coming in from the UART when booting a CM1 (created a file named "UART" on the boot partition to get these):

Code: Select all

Found SD card, config.txt = 1, start.elf = 0, recovery.elf = 0, timeout = 0
Read File: config.txt, 224 (bytes)




Raspberry Pi Bootcode
Read File: config.txt, 224
Read File: start_cd.elf, 683172 (bytes)
Read File: fixup_cd.dat, 2623 (bytes)
And nothing else.

Is there anything more I can try? Is it possible to patch the firmware so to keep the LED untouched?

Thank you!

Best regards,
Robert

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7422
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Completely disable the ACT LED at very early boot stages

Thu Aug 08, 2019 2:17 pm

The firmware uses the LEDS_DISK_ACTIVITY define from dt-blob.dts/bin to determine which GPIO to wiggle for the activity LED.
With that listed as "absent" (the default) then your GPIO will adopt whatever state is defined under [email protected]

The Linux kernel does have a define in the kernel device tree for any platforms that does have a default activity LED, eg https://github.com/raspberrypi/linux/bl ... -b.dts#L91 for the original model B. There is no such define by default on the CM.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2441
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Completely disable the ACT LED at very early boot stages

Thu Aug 08, 2019 2:23 pm

I was beaten to the post, but have my answer anyway:

Compute Modules don't have an activity LED. Carriers might, but the firmware and standard kernel should not know this (although the base .dtsi file does erroneously declare one on GPIO 47 - see https://github.com/raspberrypi/linux/bl ... cm.dtsi#L8).

The firmware gets its understanding of pin functions, including the location of any disk activity LED, from the dt-blob. The one built into the firmware (published here: https://github.com/raspberrypi/firmware ... t-blob.dts) does not declare one for the Compute Module or CM3 - perhaps you have an external dt-blob.bin including one.

You will find information about the dt-blob here: https://www.raspberrypi.org/documentati ... uration.md
The activity LED is declared by the [email protected]_DISK_ACTIVITY section.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2441
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Completely disable the ACT LED at very early boot stages

Thu Aug 08, 2019 4:58 pm

Ah, I've found a likely explanation. When the Pi4 support was added, its disk activity LED GPIO (42) was added to the pins_cm section by mistake. This went out in the current Raspbian image before being fixed a few days later. If you were to rpi-update to the latest testing firmware+kernel you should find that pin a bit quieter.

Robert Tiemann
Posts: 9
Joined: Wed Jan 14, 2015 2:08 pm

Re: Completely disable the ACT LED at very early boot stages

Wed Aug 14, 2019 8:46 am

Thank you very much, I was able to fix our problem by creating a custom dt-blob.bin file. By default, GPIO 47 is configured as an output on CM1, and changing it to be an input fixed our boot problem.

By the way, putting gpio=47=ip,np into config.txt also worked in our case, but I figured it would be best to have the GPIO configuration done as soon as possible.

Return to “Compute Module”