Skip to content

Fix GPIO offset in BT/WL fixup script and EEPROM update and other SB related changes#1242

Merged
flowzone-app[bot] merged 7 commits into
masterfrom
alexgg/gpio-offset
Jul 4, 2025
Merged

Fix GPIO offset in BT/WL fixup script and EEPROM update and other SB related changes#1242
flowzone-app[bot] merged 7 commits into
masterfrom
alexgg/gpio-offset

Conversation

@alexgg

@alexgg alexgg commented May 9, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@alexgg alexgg requested a review from a team May 9, 2025 07:47
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com May 9, 2025 07:47 — with GitHub Actions Inactive
@alexgg alexgg had a problem deploying to bm.balena-dev.com May 9, 2025 08:52 — with GitHub Actions Error
@alexgg alexgg temporarily deployed to bm.balena-dev.com May 9, 2025 08:52 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to bm.balena-dev.com May 9, 2025 08:52 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to bm.balena-dev.com May 9, 2025 08:54 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to bm.balena-dev.com May 9, 2025 08:54 — with GitHub Actions Inactive
@alexgg alexgg had a problem deploying to bm.balena-dev.com May 9, 2025 08:54 — with GitHub Actions Failure
@alexgg alexgg marked this pull request as draft May 9, 2025 08:57
auto-merge was automatically disabled May 9, 2025 08:57

Pull request was converted to draft

@alexgg alexgg temporarily deployed to bm.balena-dev.com May 9, 2025 09:00 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to bm.balena-dev.com May 9, 2025 09:00 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to bm.balena-dev.com May 9, 2025 09:00 — with GitHub Actions Inactive
@deploynaut

deploynaut Bot commented May 22, 2025

Copy link
Copy Markdown

One or more environments require approval before deploying workflow runs.

Maintainers, please inspect changes carefully for improper handling of secrets or other sensitive information.

To approve pending deployments, submit an approved review, or a commented review with /deploy.

@klutchell klutchell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/deploy

@acostach acostach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/deploy

mtoman
mtoman previously approved these changes May 28, 2025

@mtoman mtoman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/deploy

@klutchell klutchell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/deploy

@klutchell klutchell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/deploy

@mtoman mtoman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/deploy

alexgg added 7 commits June 30, 2025 23:14
Recent changes have once again reached the initramfs limit.

Change-type: patch
Signed-off-by: Alex Gonzalez <alexg@balena.io>
When performing a hostOS update we perform atomic writes of individual
files, that is, first we copy a new file, and then we rename.

The rename operation is atomic on some filesystems like ext4, but on
vfat it has not been atomic until Linux kernel v6.0.

Even if probably no longer needed with >v6.0 kernels, we still use fatrw
to keep a checksummed copy of the file.

The boot.img that contains the kernel and initramfs has increased in size
and two copies of it no longer fits in the boot partition.

Changelog-entry: increase the boot partition size for CM4 to support secure boot
Signed-off-by: Alex Gonzalez <alexg@balena.io>
For kernel 6.12, the GPIO offsets have changed so use the new offset.

The sysfs interface is deprecated, but gpiod tools cannot be used to set
persistent GPIO values, and there doesn't seem to be a better alternative.

Changelog-entry: fix kexec fixup script on CM4/RPI4.
Signed-off-by: Alex Gonzalez <alexg@balena.io>
Recent discussions have settled around doubling the rootfs size as this
will also be the strategy used for re-partitioning.

* The current rootfs size is (700 - 40 - 20 ) / 2 = 320 MiB
* To double it (1340 - 40 - 20) / 2 = 640MiB

This commits sets the rootfs size to 655360 bytes, 640MiB.

Signed-off-by: Alex Gonzalez <alexg@balena.io>
Previously the audio driver was directly called from the device tree, and
the audio pins were owned by the audio driver.

Hence, unloading the audio driver would free pins 40/41 and they could be
dynamically assigned to SPI0 and re-used to program the EEPROM.

On recent kernels the audio driver is now a platform driver called from
the vchiq driver (message queuing to the video core), and the audio pins
are now owned by the vchiq driver which cannot be unloaded. Hence, these
pins cannot be dynamically re-assigned.

This commits remaps the audio pins to GPIOs 12/13 freeing up GPIOs 40/41
to use for re-programming. This is done only for the
raspberrypicm4-ioboard-sb given that it's a new board and we do not have
to worry about existing applications.

For other device types, in particular the Raspberrypi 4 that uses by
default pins 40/41 for the headphones output, this won't work. We will
need to move to self-update support, although that still requires to
re-program the EEPROM to configure it.

Changelog-entry: remap audio pins for raspberrypicm4-ioboard-sb
Signed-off-by: Alex Gonzalez <alexg@balena.io>
If flasher is re-run, try to prevent the previous encrypted data to be
accessible.

Change-type: patch
Signed-off-by: Alex Gonzalez <alexg@balena.io>
Make sure the encrypted partitions structure is as expected - bail out
if strange partitions are encountered.

Changelog-entry: perform encryption partition assertions on mount
Signed-off-by: Alex Gonzalez <alexg@balena.io>

@mtoman mtoman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/deploy

@mtoman mtoman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alexgg

alexgg commented Jul 3, 2025

Copy link
Copy Markdown
Contributor Author

/rebase

1 similar comment
@alexgg

alexgg commented Jul 4, 2025

Copy link
Copy Markdown
Contributor Author

/rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants