Compare commits

...

223 Commits
12.1 ... 14.0

Author SHA1 Message Date
Jan Čermák
2ac3fceaf4 Bump OS to release version 14.0 2024-12-03 14:16:01 +01:00
Jan Čermák
babf11d710 Bump OS to pre-release version 14.0.rc3 2024-12-02 21:22:42 +01:00
Jan Čermák
47a648392a Disable CM5's RTC to make Yellow's on-board RTC the primary one (#3706)
With both RTCs enabled, the rpi_rtc is probed as the first one, making the
on-board RTC unused by default. Since the CM5's RTC peripheral can't be used on
Yellow, as the VBAT pin is not connected, disable it completely to fix RTC.

(cherry picked from commit 9d643edb54)
2024-12-02 21:22:41 +01:00
dependabot[bot]
0b251bb950 Bump docker/build-push-action from 6.9.0 to 6.10.0 (#3704)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.9.0 to 6.10.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.9.0...v6.10.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit e0ccf398f2)
2024-12-02 17:50:31 +01:00
Jan Čermák
3df7743633 Disable CQE on mmc0 to fix I/O freezes on Yellow+CM5 (#3705)
The I/O operations on the eMMC can sometimes fail and lock up completely, and
disabling CQE on the sdio1 (mmc0) interface seems to solve the issue. While it
is a known (and potentially resolved) issue [1] for SD cards in Raspberry Pi's
Linux fork, it is not acknowledged neither resolved for CM5's eMMC. With CQE
enabled, the device usually locks up within the first 10 first boots, when the
swap file is being created. After disabling CQE, no error occurred after more
that 100 cold boots (every time with swap file removed).

[1] https://github.com/raspberrypi/linuxissues/6349

(cherry picked from commit c514d6b482)
2024-12-02 17:50:28 +01:00
Jan Čermák
a355da2075 Reduce time of mmc0 interface random hangs on Yellow+CM5 boot (#3700)
For yet unknown root cause, the eMMC interface sometimes fails to initialize
properly, delaying boot for up to 130 seconds. This can be reduced by ~100s by
disabling SD and SDIO modes on the sdio1 interface used for mmc0 before a
better patch is found.

(cherry picked from commit 489de0b2fb)
2024-12-02 17:50:24 +01:00
Jan Čermák
66405f102a Linux: Update kernel to 6.6.63 (#3697)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.63

(cherry picked from commit 22dd060183)
2024-12-02 17:50:21 +01:00
Jan Čermák
91532037bb Bump OS to pre-release version 14.0.rc2 2024-11-22 14:25:55 +01:00
Jan Čermák
55bbddad4f Enable Cypress M8 USB serial driver for all targets (#3693)
Build cypress_m8 driver as module for all targets - some of them had it in
their base defconfig while some not. It is required e.g. for UPB PIM (Powerline
Interface Module).

Fixes #3690

(cherry picked from commit d57e507764)
2024-11-22 14:25:36 +01:00
Jan Čermák
444f65ca94 Sync Yellow's DTS with plain CM5 device tree (#3688)
Sync the DTS with changes added in newer commits merged after the initial
Yellow/CM5 DTS was written. The sdio1 node now has HS400 mode enabled and
sd_io_1v8_reg has been changed to regulator-fixed.

(cherry picked from commit b288cd212a)
2024-11-22 14:25:33 +01:00
Jan Čermák
74af855056 Always use NVMe datadisk on Yellow if it's present on first boot (#3686)
If HAOS on Yellow is booted for the first time with NVMe data disk present, it
should be preferred over the empty eMMC data partition. This will ease
reinstall of the system and migration from CM4 to CM5. All other data disks
(e.g. if a USB drive is used for them) are still treated as before, requiring
manual adoption using the Supervisor repair.

(cherry picked from commit 98ac7f0170)
2024-11-22 14:25:29 +01:00
@RubenKelevra
1291848041 Disable UAS via usb-storage.quirks on RPi for JMicron JMS583
Vendor ID: 152d
Product ID: a583

fixes #3674

(cherry picked from commit a042dc01d2)
2024-11-22 14:25:25 +01:00
Jan Čermák
885f0a82ab Bump OS to pre-release version 14.0.rc1 2024-11-19 12:02:56 +01:00
Jan Čermák
eec6dfb28d Add Hailo-8 firmware for Raspberry Pi AI Kit/HAT on RPi 5 (#3680)
Add Hailo-8 firmware binary for Rasperry Pi AI accelerators. The version needs
to be determined from the Git history of the kernel sources, as the driver
source code is included in the RPi downstream kernel and the version string
can't be found in the code directly.

Fixes #3663
2024-11-18 19:01:25 +01:00
Stefan Agner
f169f78bb0 Add Kconfig option for Supervisor channel (#3618)
* Add Makefile variable for Supervisor channel

Allow to set the release channel pre-installed Home Assistant components
like Supervisor and add-on are fetched from. This channel is then also
used at runtime.

* Use choice instead of string variable

* Fix channel in Supervisor updater.json config

* Add newlines
2024-11-18 14:39:46 +01:00
Jan Čermák
71e580175e Linux: Update kernel to 6.6.62 (#3679)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.61
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.62
2024-11-18 14:09:42 +01:00
Jan Čermák
78cdaab597 Merge Yellow's RAUC post-install hook with the install hook (#3678)
As stated in the docs [1], post-install hook is not executed if the slot
already has an install hook defined. Merge the post-install hook with the
install hook to fix CM5 migration for Yellow.

[1] https://rauc.readthedocs.io/en/latest/using.html#slot-hooks
2024-11-18 12:51:58 +01:00
Jan Čermák
b9e66fbfd0 Remove unnecessary kernel post-install hook for GRUB-based targets (#3672)
The code for this hook was removed in #3457 but it wasn't removed from the
manifest. Remove it to avoid unnecessary execution of the hook.
2024-11-14 16:07:16 +01:00
Jan Čermák
9dfbdd9d12 Fix Yellow's post-install hook for config.txt migration (#3671)
The hook was missing in the manifest, enable it conditionally for Yellow and
add reminder to remove it once it's not needed.
2024-11-14 09:44:12 +01:00
Anton Starikov
b28dd8c4c4 Add iwlwifi-gl firmware needed for Intel BE200 Wi-Fi 7 card (#3668)
Add iwlwifi-gl firmware, which is required for Intel BE200 card. Targets are
generic_aarch64, generic_x86_64 and ova.

* buildroot 19027bc796...1d7407c66b (1):
  > package/linux-firmware: add iwlwifi gl firmware

Closes #3643.
2024-11-14 09:23:34 +01:00
Jan Čermák
23039ceea7 Reduce timeout for network time synchronization to 15 seconds (#3669)
The timeout of 90s was introduced before it was ensured that the timesync
systemd unit starts after network is online. Now with that, it makes less sense
to wait that long - if network is unreachable at the point the time
synchronization starts, and the server fails to reply on the first sync, the
polling interval is exponentially increased and the benefit of waiting for more
attempts is doubtful.

Since another synchronization attempt is done after network changes its state,
we should rely on that instead of having the 90 seconds interval as a waiting
period for plugging the network cable. Worst case, there are other mechanisms
that should set the time to a reasonably accurate value, making the NTP sync
less importart for most of the cases.
2024-11-13 17:14:54 +01:00
Jan Čermák
180c9ada3f Add initial support for Raspberry Pi CM5 on Yellow (#3667)
* Move RPi U-Boot patches to version-specific directory

We will need to use different series for 2024.10 which would be used as the
base for CM5 support.

* Remove common.h include from the fileenv cmd

It doesn't seem to be used and common.h has been removed in newer U-Boot.

* Use U-Boot 2024.10 with BCM2712 PCIe patches for Yellow

Use rebased patchset from v2024.01 with the first patch removed. Add patches
needed for PCIe initialization and use rpi_arm64_defconfig as the base config
for both CM4 and CM5.

* Add device tree for CM5 on HA Yellow and adjust config

Add device tree definition based on the CM5 device tree with BCM2712D0 changes
applied, and add nodes required for the on-board peripherals of Yellow.

Currently the difference in serial numbering still requires either changes in
this device tree, or userspace changes to create correct symlinks to make HA
configuration directly compatible with CM4 on Yellow.

* Add config.txt migration for conditional device_tree options

* Fix typos and minor issues found by CodeRabbit
2024-11-12 14:34:54 +01:00
Jan Čermák
6047770d7f Linux: Update kernel to 6.6.60 (#3666)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.60
2024-11-11 17:06:51 +01:00
Jan Čermák
0dc9c65d3c Fall back to max eMMC clock to fix Kingston eMMC compat with ODROID-N2 (#3665) 2024-11-09 19:04:02 +01:00
Jan Čermák
f612d42fb3 RaspberryPi: Update kernel to 6.6.51 - stable_20241008 (#3662)
* RaspberryPi: Update kernel to 6.6.51 - stable_20241008

* Update rpi-firmware to version for kernel 6.6.51

* buildroot 2ffac68a74...19027bc796 (1):
  > package/rpi-firmware: bump to version 1.20241008 for kernel 6.6.51
2024-11-05 16:02:58 +01:00
Jan Čermák
c9e2b50406 Bump Buildroot to 2024.02.7 (#3659)
* buildroot d59d09ad38...2ffac68a74 (1):
  > Merge tag '2024.02.7' into 2024.02.x-haos
2024-11-05 08:07:31 +01:00
Jan Čermák
7edde96735 Linux: Update kernel to 6.6.59 (#3657)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.58
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.59
2024-11-05 08:07:19 +01:00
xtsrthm
59851f7a51 Add support for external i2c devices (#3642)
This commit adds support for usb to i2c adapters, the i2c chardev and the bme280  famaily environment sensors
2024-11-05 08:06:52 +01:00
dependabot[bot]
8fd7f26d74 Bump mikepenz/action-junit-report from 4 to 5 (#3658)
Bumps [mikepenz/action-junit-report](https://github.com/mikepenz/action-junit-report) from 4 to 5.
- [Release notes](https://github.com/mikepenz/action-junit-report/releases)
- [Commits](https://github.com/mikepenz/action-junit-report/compare/v4...v5)

---
updated-dependencies:
- dependency-name: mikepenz/action-junit-report
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-04 14:48:00 +01:00
Stefan Agner
a2ff594a75 Add kernel options required for Atheros 12k wirelss adapters (#3640)
Add support for interrupt remapping for IO-APIC and MSI devices as
required by some ath12k devices.

Fixes: #3621
2024-10-21 21:19:40 +01:00
Stefan Agner
f459a1174d Linux: Update kernel to 6.6.57 (#3639) 2024-10-21 21:19:33 +01:00
Jan Čermák
a5cdc318d4 Bump OS to development version 14.0.dev0 2024-10-15 14:36:49 +02:00
Jan Čermák
9e00205ceb Merge branch 'main' into dev 2024-10-15 14:36:21 +02:00
Jan Čermák
3f161bc7d1 Bump OS to release version 13.2 2024-10-15 13:23:17 +02:00
Jan Čermák
bb0086addf Linux: Update kernel to 6.6.56 (#3622)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.55
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.56
2024-10-14 16:44:37 +02:00
Jan Čermák
1bd9245219 Bump OS to pre-release version 13.2.rc2 2024-10-14 15:58:11 +02:00
Jan Čermák
fb7a9c4196 Linux: Update kernel to 6.6.54 (#3614)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.54

(cherry picked from commit 1b6b40ebe7)
2024-10-14 15:54:52 +02:00
dependabot[bot]
8f69cd7fd1 Bump docker/setup-buildx-action from 3.6.1 to 3.7.1 (#3613)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 998d0e37fe)
2024-10-14 15:54:49 +02:00
Jan Čermák
67ddfe2563 Linux: Update kernel to 6.6.53 (#3605)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.53

(cherry picked from commit a4a3912b21)
2024-10-14 15:54:44 +02:00
Darren Griffin
ce8b777d74 Add OHF logo to README (#3603)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
(cherry picked from commit 5d58a25b62)
2024-10-14 15:54:34 +02:00
dependabot[bot]
82f36004f5 Bump docker/build-push-action from 6.7.0 to 6.9.0 (#3604)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit cf546d6f76)
2024-10-14 15:54:29 +02:00
Jan Čermák
1b6b40ebe7 Linux: Update kernel to 6.6.54 (#3614)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.54
2024-10-07 18:22:53 +02:00
dependabot[bot]
998d0e37fe Bump docker/setup-buildx-action from 3.6.1 to 3.7.1 (#3613)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 15:47:43 +02:00
Jan Čermák
a4a3912b21 Linux: Update kernel to 6.6.53 (#3605)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.53
2024-10-01 17:34:04 +02:00
Darren Griffin
5d58a25b62 Add OHF logo to README (#3603)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-09-30 18:47:33 +02:00
dependabot[bot]
cf546d6f76 Bump docker/build-push-action from 6.7.0 to 6.9.0 (#3604)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-30 15:57:27 +02:00
Jan Čermák
62a30ac509 Bump OS to pre-release version 13.2.rc1 2024-09-26 17:03:13 +02:00
Jan Čermák
ba73a8c3d7 Use GRUB2 legacy loader for Macbook Air A1370 (#3593)
Fix loading issues on this Intel-based platform as well. As described in the
patch commit message, there will be likely bigger collateral effect by
referring just to the CPU ID but it shouldn't have major detrimental effects.

[1] https://github.com/home-assistant/operating-system/issues/3305#issuecomment-2360633688
2024-09-25 17:13:33 +02:00
Jan Čermák
0fdf920b89 Fix guest-agent not starting with HyperV Enlightenments enabled (#3592)
Guest agent doesn't start because if HyperV Enlightenments are enabled, the
virtualization gets detected incorrectly. Backport Systemd patch that fixes the
detection, allowing the guest-agent service to meet its dependencies.

This patch should be no longer needed after update of Systemd to v256, or in
case the patch gets eventually backported to the v254 stable branch.

Fixes #3565
2024-09-25 17:13:22 +02:00
Jan Čermák
f27c429be2 Linux: Update kernel to 6.6.52 (#3591)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.52
2024-09-23 23:23:07 +02:00
Viacheslav Bocharov
e4d00de474 Update buildroot to 2024.02.x-haos in .gitmodules (#3589) 2024-09-17 15:07:28 +02:00
Jan Čermák
65789af595 Linux: Update kernel to 6.6.51 (#3587)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.51
2024-09-12 17:49:17 +02:00
Jan Čermák
39b1c6de4e Bump Buildroot to 2024.02.6 (#3586)
* buildroot c68e03d96b...d59d09ad38 (2):
  > package/procps-ng: fix build with BR2_PACKAGE_SYSTEMD enable
  > Merge tag '2024.02.6' into 2024.02.x-haos
2024-09-12 15:49:27 +02:00
Jan Čermák
2916a1c247 Relocate HAOS Systemd drop-ins to /usr/lib/systemd (#3582)
* Relocate HAOS Systemd drop-ins to /usr/lib/systemd

With some exceptions, Systemd drop-ins overriding default unit configuration
have been placed to `/etc/systemd/system`. This is meant for user overrides of
those, or per `man 5 systemd.unit` for "system unites created by the
administrator". Relocate all of these to `/usr/lib/systemd` which should be
used as path for units "installed by the distribution package manager" which is
closer to what we're trying to achieve.

This will make it easier to detect changes to unit files once we enable the
possibility to edit the content of /etc.

* Patch systemd-timesyncd.service instead of replacing it fully
2024-09-12 12:47:22 +02:00
Jan Čermák
2e6b38a0e1 Enable debug logging for GRUB rescue shell options (#3581)
If the system fails to boot, some kernel messages may not be shown before the
system fully boots. Enable the debug option for rescue shell options to have an
easy way to see those without modifying GRUB options. This will increase log
verbosity and turn on debug logging for Systemd as well [1].

[1] https://www.freedesktop.org/software/systemd/man/latest/systemd.html#debug
2024-09-11 23:30:15 +02:00
Jan Čermák
5d164b12d1 Add test for no failed Systemd units (#3583)
Test that systemctl reports no failed units at the end of the basic test.
2024-09-11 23:30:01 +02:00
Jan Čermák
e3bbe2003f Tests: update labgrid to v24.0.1 (#3584)
Bump labgrid to latest release. None of the changes require adjustments in the
tests. Remove pytest from requirements.txt, it's not needed anymore, so let pip
to resolve the correct (latest) version from labgrid's dependencies. With these
new dependencies, previous DeprecationWarnings on Python 3.12 are gone now.
2024-09-11 23:29:48 +02:00
Jan Čermák
93ac046349 Linux: Update kernel to 6.6.50 (#3580)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.50
2024-09-09 18:11:34 +02:00
Jan Čermák
d615f8c71e Linux: Update kernel to 6.6.49 (#3577)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.49
2024-09-05 00:33:38 +02:00
Jan Čermák
3977f1f039 Bump Docker to v27.2.0 (#3576)
* Update Docker to v27.2.0

Update Docker and containerd to latest supported version.

* buildroot a2c10a16a0...c68e03d96b (3):
  > package/containerd: bump version to v1.7.21
  > package/docker-cli: bump version to v27.2.0
  > package/docker-engine: bump version to v27.2.0

* package/hassio: update DinD container to v27.2
2024-09-03 15:42:43 +02:00
Jan Čermák
d9e46d6dbb Purge Cloudflare cache for all files after uploading R2 artifacts (#3568)
If an attempt to access R2 artifacts is made before the files exist, the 404
reply gets cached and it's not possible to access the file after it's been
created without purging the cache, essentially doing a cache poisoning for
future build artifacts. To avoid it, list all files that have been created by
the build and call the purge cache API.

As there's a limit for number of files that can be purged in a single API call
[1], the GNU split utility is used to split intermediary list of files to
chunks of 30 URLs, which is then converted to a JSON array and passed to the
curl command.

[1] https://developers.cloudflare.com/api/operations/zone-purge#purge-cached-content-by-url
2024-09-02 10:38:04 +02:00
Jan Čermák
b23b54bed0 Linux: Update kernel to 6.6.48 (#3570)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.48
2024-09-02 10:37:48 +02:00
Jan Čermák
5eb7ccb761 Use GRUB legacy loader for HP t520 to fix boot with GRUB 2.12 (#3562)
HP t520 have been reported to have the same issues as Atom boards with bad UEFI
firmware that doesn't work well with the new EFI loader used since GRUB 2.12.
Apply the patch to use legacy loader for its CPU ID as well.

Fixes #3557
2024-08-26 14:34:06 +02:00
Jan Čermák
c6d4e2788e Fix missing Intel AX210 firmware files, remove unused firmwares (#3556)
Fix AX210 firmware files, this time for real. In #3549 we still had only
ucode and pnvm files for AX211, AX210 was still missing the pnvm file,
because its ucode was provided through IWLWIFI_22000 without appropriate
pnvm file. Both AX210 and AX211 firmwares are now installed with
IWLWIFI_6E which includes both pnvm and ucode files.

Also some firmwares which are not used by the current kernel can be
removed, because the kernel always only loads the most recent one.

* buildroot 01188d9c38...a2c10a16a0 (2):
  > Revert "package/linux-firmware: exclude some files from compression"
  > package/linux-firmware: fix AX210 support, stick to latest supported ucode API, reorganize the split

Fixes #3477
2024-08-23 15:56:41 +02:00
Jan Čermák
14ca2ac75e Bump Buildroot to 2024.02.5 (#3550)
* buildroot 55be56d521...01188d9c38 (1):
  > Merge tag '2024.02.5' into 2024.02.x-haos
2024-08-21 17:35:30 +02:00
Jan Čermák
4fb27c2ca8 Linux: Update kernel to 6.6.47 (#3541)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.47
2024-08-21 17:34:55 +02:00
Jan Čermák
c7018054b4 Bump OS to development version 13.2.dev0 2024-08-21 17:33:16 +02:00
Jan Čermák
7f9116b7f8 Merge branch 'main' into dev 2024-08-21 17:32:55 +02:00
Jan Čermák
e97b1231dc Bump OS to release version 13.1 2024-08-21 15:29:36 +02:00
Jan Čermák
1a7dc0ca1f Fix iwlwifi driver failing to find .pnvm files for Intel 6E (AX210) (#3549)
Since updating to Buildroot 2024.02, the iwlwifi loads a different version of
firmware for Intel AX cards (reported on AX210) which also needs the pnvm file.
However, unlike firmwares, the load method is different and the driver can't
load a compressed file. Disable compression for all .pnvm files to fix this.

* buildroot baa16784d2...55be56d521 (1):
  > package/linux-firmware: exclude some files from compression

Fixes #3477

(cherry picked from commit d3a43a4ca4)
2024-08-21 15:28:47 +02:00
Jan Čermák
d3a43a4ca4 Fix iwlwifi driver failing to find .pnvm files for Intel 6E (AX210) (#3549)
Since updating to Buildroot 2024.02, the iwlwifi loads a different version of
firmware for Intel AX cards (reported on AX210) which also needs the pnvm file.
However, unlike firmwares, the load method is different and the driver can't
load a compressed file. Disable compression for all .pnvm files to fix this.

* buildroot baa16784d2...55be56d521 (1):
  > package/linux-firmware: exclude some files from compression

Fixes #3477
2024-08-21 11:14:15 +02:00
dependabot[bot]
3c2f014acb Bump docker/build-push-action from 6.6.1 to 6.7.0 (#3542)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.6.1 to 6.7.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.6.1...v6.7.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-20 16:36:37 +02:00
Jan Čermák
1b6cfbf940 Bump OS to pre-release version 13.1.rc1 2024-08-16 13:10:22 +02:00
Jan Čermák
cdee2c5838 Add LED indication for button handling in Yellow's U-Boot (#3536)
With #3523 as inspiration, it might be useful to wait for buttons to be
released, e.g. in case when they become stuck. Also indicate the button
operation (wipe, boot files removal, UMS) has been handled by turning on the
yellow LED.
2024-08-16 13:04:07 +02:00
Jan Čermák
7e7612ffeb Implement device wipe using the hardware button on Green (#3523)
* Improve LED naming in U-Boot DTS

Port Stefan's patch from Linux patchset to U-Boot.

* Implement device wipe using the hardware button on Green

Unlike Yellow, Green doesn't have a way to easily wipe the device, e.g. if the
user forgets the password - in that case the only option is to use a microSD
card and reflash the system. Fortunately, Green has a hardware button wired to
the PMIC chip which exposes the button state in one of the registers. Read this
value in U-Boot and decide if cmdline flag for device wipe should be set - same
as we do on Yellow.

Also enable LED driver and command in U-Boot. In the current implementation, if
the button is held for ~5 seconds when plugging in the device (this time
includes DDR training, SPL, etc.), the yellow LED turns solid to indicate wipe
is about the start. When the Linux kernel starts, the kernel LED driver takes
over and starts blinking in heartbeat pattern. Because it takes a while to load
the kernel, the LED stays solid for 2-3 seconds, which should be enough to
recognize it was acknowledged.

* Wait for button to be released before wiping
2024-08-16 09:35:21 +02:00
Jan Čermák
832b70bab1 Linux: Update kernel to 6.6.46 (#3529)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.46
2024-08-14 17:38:00 +02:00
lamauny
0c08acd2c3 Enable NTFS and exFAT drivers for all targets (#3516)
Enable NTFS and exFAT drivers, as they're not in defconfigs of all platforms and may be useful when mounting removable drives. 

Fixes #2723

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>
2024-08-14 17:03:59 +02:00
Jan Čermák
1467cc5f64 Enable 1.5MBd serial console on Green for new installs (#3527)
With default console on HDMI (tty0), we lost the console on the serial port. It
may be useful for debugging, let's enable it for new installs with the same
speed as bootloader (to avoid the need for baud rate switching).
2024-08-14 17:00:15 +02:00
Jan Čermák
d44d93e4a1 Fix CPU ID for D2xxx/N2xxx in GRUB2 loader patch (#3526)
Report from @ChernyaevAN in [1] revealed it's 13829424153406670433 in decimal,
which means the endianness was wrong for the CPUs I didn't have available for
testing.

[1] https://github.com/home-assistant/operating-system/issues/3305#issuecomment-2288609199
2024-08-14 17:00:03 +02:00
Jan Čermák
2fb1663a35 Bump OS to development version 13.1.dev0 2024-08-13 15:51:13 +02:00
Jan Čermák
a7617340e9 Merge branch 'main' into dev 2024-08-13 15:50:52 +02:00
Jan Čermák
77e2b92972 Bump OS to release version 13.0 2024-08-13 11:14:31 +02:00
dependabot[bot]
fd31ce14ea Bump docker/build-push-action from 6.5.0 to 6.6.1 (#3519)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.5.0 to 6.6.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.5.0...v6.6.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 19:51:32 +02:00
Jan Čermák
598e06de5d Linux: Update kernel to 6.6.45 (#3518)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.45
2024-08-12 19:23:18 +02:00
Jan Čermák
d83602c6d3 Bump OS to pre-release version 13.0.rc2 2024-08-08 18:42:56 +02:00
Jan Čermák
55b3446bd9 Enable eMMC HS200 mode in Green's U-Boot defconfig (#3511)
Follow-up to #3412. While we haven't seen any issues so far, it's mentioned in
the original patch series we took inspiration from that HS200 works more
reliably, so enable it in Green's defconfig by amending the patch.

(cherry picked from commit 0452965fb0)
2024-08-08 18:42:35 +02:00
Jan Čermák
f292ba02e2 Fix writing U-Boot environment on ODROID-M1 (#3510)
Apply the same patch we applied in #3412 for Green. At that time I thought the
patch was already applied upstream for M1 and haven't checked, but it turns out
it wasn't true. Apply it here before we get U-Boot with that patch series [1]
included.

[1] https://patchwork.ozlabs.org/project/uboot/cover/20240204205312.2342868-1-jonas@kwiboo.se/

(cherry picked from commit d6fa83a0d3)
2024-08-08 18:42:32 +02:00
Jan Čermák
42baa80900 Increase block size of kernel squashfs image to 128K (#3509)
While mksquashfs uses this value by default, Genimage's default is 4K. This is
far too low value and results in slower kernel load, especially on embedded
boards with a flash drive. Explicitly set it to 128K to generate same images as
in pre-genimage builds.

(cherry picked from commit edba18f6c4)
2024-08-08 18:42:29 +02:00
Jan Čermák
ba86720163 Bump ODROID N2's U-Boot to v2024.01 again (#3508)
We previously reverted the bump because we were unsure where the eMMC issues
are coming from. Now we know some of them were caused by incompatible eMMCs
then never worked from the beggining, and attempt to fix them (by changing the
frequency) caused some other side effects. Bump U-Boot back to the version used
generally and continue from there.

(cherry picked from commit 50a0062ee6)
2024-08-08 18:42:23 +02:00
Jan Čermák
0452965fb0 Enable eMMC HS200 mode in Green's U-Boot defconfig (#3511)
Follow-up to #3412. While we haven't seen any issues so far, it's mentioned in
the original patch series we took inspiration from that HS200 works more
reliably, so enable it in Green's defconfig by amending the patch.
2024-08-08 18:40:20 +02:00
Jan Čermák
d6fa83a0d3 Fix writing U-Boot environment on ODROID-M1 (#3510)
Apply the same patch we applied in #3412 for Green. At that time I thought the
patch was already applied upstream for M1 and haven't checked, but it turns out
it wasn't true. Apply it here before we get U-Boot with that patch series [1]
included.

[1] https://patchwork.ozlabs.org/project/uboot/cover/20240204205312.2342868-1-jonas@kwiboo.se/
2024-08-08 18:40:09 +02:00
Jan Čermák
edba18f6c4 Increase block size of kernel squashfs image to 128K (#3509)
While mksquashfs uses this value by default, Genimage's default is 4K. This is
far too low value and results in slower kernel load, especially on embedded
boards with a flash drive. Explicitly set it to 128K to generate same images as
in pre-genimage builds.
2024-08-07 20:14:13 +02:00
Jan Čermák
50a0062ee6 Bump ODROID N2's U-Boot to v2024.01 again (#3508)
We previously reverted the bump because we were unsure where the eMMC issues
are coming from. Now we know some of them were caused by incompatible eMMCs
then never worked from the beggining, and attempt to fix them (by changing the
frequency) caused some other side effects. Bump U-Boot back to the version used
generally and continue from there.
2024-08-07 20:14:06 +02:00
Franz Josef Kaiser
26c383484e Explains UMS Utility image (#3507) 2024-08-07 16:43:41 +02:00
Jan Čermák
d8baa98ae2 Add documentation and dependencies category to release-drafter config (#3506)
* add Documentation category
* add Dependencies (to easily filter them out if not needed in changelog)
* adjust the order a bit to have user-facing changes first
2024-08-07 15:06:46 +02:00
Jan Čermák
ccca13d3ca Drop "default kernel tree" line from docs (#3505)
The following table is self-explanatory and unlike this, is kept up-to-date
automatically.
2024-08-06 17:18:10 +02:00
Jan Čermák
7a19b892a5 Bump OS to pre-release version 13.0.rc1 2024-08-06 14:45:45 +02:00
Jan Čermák
66fc7d7e2a Test landing page is reachable without internet connection (#3499)
* Test landing page is reachable without internet connection

Add test that checks user is able to access the landing page even when HAOS has
no internet connection. We still need some sort of outgoing connectivity, so
outgoing connection attempts don't end up with "network is unreachable". To
simulate this, restricted network is created for the QEMU instance used in the
test, and when everything is started, unresponsive default gateway is added.

This intents to test regression that was fixed by
home-assistant/supervisor#5204, Supervisor 2024.7.0+ is thus needed for this
test to pass.

* Bump requirements for tests
2024-08-06 11:02:59 +02:00
dependabot[bot]
9cc45f65ea Bump docker/setup-buildx-action from 3.6.0 to 3.6.1 (#3501)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 15:33:44 +02:00
Jan Čermák
c2527a2ae1 Linux: Update kernel to 6.6.44 (#3500)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.44
2024-08-05 14:04:32 +02:00
Jan Čermák
a32974e1a7 Use GRUB2 legacy loader only on some Intel Atom boards specifically (#3498)
* Use GRUB2 legacy loader only on some Intel Atom boards specifically

Previous revert of GRUB2 change that introduced usage of the generic EFI loader
for all x86 boards in #3324 caused regressions, the one confirmed is #3348.
This commit adds a specific patch that identifies the broken platforms based
on SMBIOS data gathered in #3305 and falls back to the legacy loader there.

Tested on Intel D525MW (falls back) and QEMU (no fallback).

* Enable GRUB's smbios module

Having smbios command in GRUB can help in future debugging, e.g. to add more
CPUs that should use the linux loader fallback.
2024-07-31 09:22:07 +02:00
Jan Čermák
d51a0d3cec Patch genimage to force first usable LBA @ 34 to fix RPi 5/Windows issues (#3497)
Genimage sets the first usable LBA to the offset of the first partition. While
it shouldn't be an issue in theory, Windows may do some nasty things with the
GPT header afterwards which breaks the Raspberry Pi bootloader, manifesting as

Before purpose of this behavior is clarified in [1], add a downstream patch
that sets the first usable LBA back to 34, which was the value that was used
before migrating to Genimage in #3388. Since changing this value (hopefully)
doesn't have any other consequences, and the images now should be closer to
pre-genimage builds, no more side-effects are expected from this change.

[1] https://www.github.com/pengutronix/genimage/issues/262

Fixes #3437
2024-07-30 18:57:37 +02:00
dependabot[bot]
13c4bb56c0 Bump docker/setup-buildx-action from 3.5.0 to 3.6.0 (#3496)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 16:39:08 +02:00
Jan Čermák
327e9a07c9 Linux: Update kernel to 6.6.43 (#3495)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.42
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.43
2024-07-29 14:06:21 +02:00
Jan Čermák
568499072f Allow EROFS compression for Rockchip kernels (#3493)
Rockchip config fragment had EROFS compression explicitly disabled. Remove that
option and also remove the EROFS one, as it's already set in common config.
2024-07-25 21:51:36 +02:00
Stefan Agner
bc7c109163 Enable Netfilter MARK match kernel configuration (#3492)
Make the Netfitler MARK match kernel config a OS required configuration.
This config is required by the OpenThread Border Router add-on.

Fixes: https://github.com/home-assistant/addons/issues/3698
2024-07-24 16:40:37 +02:00
Jan Čermák
b0bc71a835 Reduce log spam from Docker health checks (#3491)
Reduce verbosity from deactivated Docker mounts, triggered by the Docker
healthcheck. These messages do not carry any value for us and logs supplied by
users are often spammed mostly with these. Moreover, they sometimes cause
confusion that something is wrong, see for example #3021.

Unfortunately, it's not possible to use LogFilterPatterns= here, because it's
not applied to these messages, as explicitly said in the docs:

  Filtering is based on the unit for which LogFilterPatterns= is defined
  meaning log messages coming from systemd(1) about the unit are not taken
  into account.

runc 1.2.0 supposedly should fix this, but it's unclear when it would be
available, so let's stick to this solution (reducing verbosity from debug to
notice for all units `run-docker-*.mount`) for the time being.
2024-07-24 16:34:37 +02:00
Jan Čermák
a80311a285 Use EROFS for the root filesystem (#3456)
* Use name.sh functions for paths in genimage

Paths for images generated outside of genimage were not used in genimage
definitions. Use them as the single source of truth.

Images generated by genimage itself (e.g. kernel.img) don't need to use those
functions, so remove the unused ones.

* Use EROFS instead of SquashFS for root FS

* Enabled EROFS in common kernel fragment
* RootFS image switched to EROFS with options to get decent compression
* rootfstype removed from kernel command line

* Get size of correct FS image in GH build summary
2024-07-24 16:34:26 +02:00
Jan Čermák
6de9da2560 Bump buildroot to 2024.02.4 (#3487)
* buildroot d03dda4fcf...baa16784d2 (5):
  > Merge tag '2024.02.4' into 2024.02.x-haos
  > fs/erofs: add config options for dedupe, fragments and ztailpacking
  > fs/erofs: add LZMA compression, allow configurable compression level
  > package/erofs-utils: add config option for LZMA compression
  > package/erofs-utils: bump to 1.7.1
2024-07-23 13:50:56 +02:00
dependabot[bot]
5d5bc36892 Bump docker/login-action from 3.2.0 to 3.3.0 (#3484)
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 17:30:38 +02:00
dependabot[bot]
77a28bd1df Bump docker/build-push-action from 6.4.0 to 6.5.0 (#3486)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.4.0 to 6.5.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.4.0...v6.5.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 17:29:13 +02:00
dependabot[bot]
038bfd9073 Bump docker/setup-buildx-action from 3.4.0 to 3.5.0 (#3485)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 17:11:32 +02:00
Jan Čermák
eb2bdf85e9 Linux: Update kernel to 6.6.41 (#3482)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.39
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.40
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.41
2024-07-22 12:57:35 +02:00
dependabot[bot]
d148ad2b50 Bump docker/build-push-action from 6.3.0 to 6.4.0 (#3475) 2024-07-15 18:27:37 +02:00
Jan Čermák
63a05a5a1e Revert "Revert GRUB2 patch causing boot failure on some old x86_64 BIOSes (#3324)" (#3470) 2024-07-11 00:01:52 +02:00
Jan Čermák
150be514e4 Enable i6300ESB watchdog driver for generic-aarch64 (#3468)
This is one of WDT drivers used by KVM/QEMU. For OVA it's been already enabled
in #2627 - enable it for aarch64 as well.

Fixes #3414
2024-07-10 14:39:08 +02:00
Jan Čermák
45cbd1d9b7 Linux: Update kernel to 6.6.38 (#3469)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.38
2024-07-10 14:38:51 +02:00
Jan Čermák
00171ae44c Enable aQuantia AQtion ethernet driver (#3467)
Enable driver for wide range of multi-gigabit NICs.

Fixes #3438
2024-07-09 13:01:25 +02:00
dependabot[bot]
777432913e Bump docker/setup-buildx-action from 3.3.0 to 3.4.0 (#3465)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 15:57:05 +02:00
dependabot[bot]
d57b6be01e Bump docker/build-push-action from 6.2.0 to 6.3.0 (#3466)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 15:56:48 +02:00
Jan Čermák
1f8ed07c42 Refer to GRUB instead of Barebox in top-level readme (#3464)
We don't use Barebox for over two years since d1cc7394, remove the forgotten
mention of it in readme.
2024-07-08 12:13:23 +02:00
Jan Čermák
3ef8b07676 Linux: Update kernel to 6.6.37 (#3463)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.37
2024-07-08 12:13:14 +02:00
Jan Čermák
ea286d9dad Populate grubenv with RAUC data in clean aarch64 OS image (#3458)
While not as bad as in 87a6c84, because the grubenv already exists in the
image, RAUC still complains about missing ORDER on the very first boot on
aarch64. Populate the environment in the same way as we do for other GRUB
platforms.
2024-07-08 12:12:58 +02:00
Jan Čermák
4308c45391 Remove old code from rauc-hook and GRUB env initialization (#3457)
With upgrade path enforced in standard HAOS upgrade procedure, we don't need to
keep some old code anymore. This means that upgrade from some very old HAOS
version (pre-8.0) to HAOS 13+ will fail in the install-check hook but this is
rather desirable.
2024-07-08 12:12:45 +02:00
Cyprien Laplace
33d8b538ad Fix rauc hook to save and restore the grub environment (#3451)
Without a machine-id, the next boot will be considered as a
first boot, and any external data disk will be disabled.

Fixes #3247.
2024-07-04 10:14:47 +02:00
Jan Čermák
245c0d0b03 Bump OS to development version 13.0.dev0 2024-07-03 19:38:47 +02:00
dependabot[bot]
c20841ac1e Bump docker/build-push-action from 6.1.0 to 6.2.0 (#3454)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.1.0...v6.2.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 15:51:21 +02:00
Jan Čermák
0555e89ad0 Linux: Update kernel to 6.6.36 (#3448)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.36
2024-06-27 17:53:15 +02:00
Jan Čermák
203885a7d8 Linux: Update kernel to 6.6.35 (#3443)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.35
2024-06-25 16:21:48 +02:00
dependabot[bot]
7298ffc13f Bump docker/build-push-action from 6.0.0 to 6.1.0 (#3444)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 15:51:19 +02:00
Jan Čermák
6c7b6fdebe Generate version information for RAUC when rauc.db is empty (#3436)
RAUC currently doesn't know the version of the booted slot when booted for the
first time or after wiping the data partition. As a result `ha os info` is
missing this information too.

As there's no built-in mechanism for generating these data by RAUC itself, add
a oneshot service that checks if the boot slot information is contained in the
rauc.db and if not, then generate it.

RAUC seems to cope quite well even with bogus data contained in rauc.db but in
any case, a test has been added to check that everything works as expected.
2024-06-20 16:50:14 +02:00
Jan Čermák
87a6c84025 Fix boot slot A marked as bad on the very first boot (#3435)
On the very first boot, grubenv doesn't exist and loading and saving it
silently fails. However, it is later created by the hassos-persists script and
the missing information are added by grub.cfg on the next boot. As the
consequence, when RAUC tries to get information from grubenv on the first boot,
ORDER variable is missing and the slot is reported as bad.

Fixes #3376
2024-06-20 12:57:25 +02:00
Jan Čermák
94c6930acd Merge branch 'main' into dev 2024-06-18 15:02:36 +02:00
Jan Čermák
a70ed7e81e Bump OS to release version 12.4 2024-06-18 12:26:14 +02:00
dependabot[bot]
62d7794a6c Bump docker/build-push-action from 5.4.0 to 6.0.0 (#3421)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.4.0 to 6.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5.4.0...v6.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 17:08:08 +02:00
Jan Čermák
8490b3bf70 Linux: Update kernel to 6.6.34 (#3420)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.34
2024-06-17 16:00:58 +02:00
Jan Čermák
abe018d4aa Improve resiliency of skopeo operations in hassio package (#3416)
We still face occasional build errors when fetching from the Docker registry
fails and is not retried with the Skopeo's built-in retry mechanism that was
enabled in #1866. This happens on some network failures, or when premature EOF
is returned when fetching the HTTP data. Seems we're not the only ones having
such issues [1].

To workaround this, add a generic retry shell function that simply retries when
the command ends with a non-zero status, no matter what was the actual cause of
the error.

[1] https://www.github.com/containers/common/issues/654
2024-06-13 15:44:11 +02:00
Jan Čermák
0e9e8ca2a6 Bump OS to pre-release version 12.4.rc1 2024-06-13 13:01:03 +02:00
Jan Čermák
27bc7306ff Linux: Update kernel to 6.6.33 (#3415)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.33
2024-06-13 11:39:02 +02:00
Jan Čermák
6c2d5b5006 Bump Docker to v26.1.4 (#3411)
* buildroot b9520eedc6...ad5e711bc1 (4):
  > package/containerd: bump to v1.7.17
  > package/docker-cli: bump version to v26.1.4
  > package/docker-engine: bump version to v26.1.4
  > .github: remove upstream's PR template discouraging GH usage
2024-06-12 23:04:34 +02:00
Jan Čermák
d847b9803a Add hardware details to bug issue template (#3413)
Very often we have to ask for further details about the hardware that HAOS is
running on. Add a required field that asks for these details - in the end it
should't complicate the form a lot and might result in faster turnaround of
resolving the issues.

Also adjust the question about the upgrade and swap the order (people often
don't care and keep the pre-selected value).
2024-06-12 21:52:48 +02:00
Jan Čermák
89533755bc Fix writing to eMMC in U-Boot on Green (#3412)
When Green starts, there is an error indicating the MMC write failed when
saving the bootstate:

  storing env...

  MMC write: dev # 0, block # 1214464, count 64 ... mmc write failed 0 blocks written: ERROR

This results in the boot count not being updated properly if the boot fails.

Seems to be a known issue for this platform, disabling the DDR52 mode (which is
the same what upstream does for other RK356x boards [1]) fixes the issues and
the bootstate is updated correctly.

[1] https://patchwork.ozlabs.org/project/uboot/patch/20240204205312.2342868-2-jonas@kwiboo.se/
2024-06-12 21:52:36 +02:00
Jan Čermák
6d77355c1c Temporary revert ODROID-N2 U-Boot to 2023.01 to fix eMMC issues (#3409)
As we don't have proper solution for #3319 and #3351 yet, revert to
previous U-Boot which was proven working. This is intended as a
workaround but as there's nothing in the latest U-Boot that will be
really missed on N2, we can stay on the older version for the time
being.

This also means reverting the "40 MHz hack" back to the 24 MHz one.
Since this patch only applies to N2 (meson gx), it can stay along the
common hardkernel uboot patches.
2024-06-11 19:02:40 +02:00
Jan Čermák
26f0b5a9b7 Fix linux-firmware compression after BR 2024.02.3 merge (#3407)
The compression is necessary for successful generic-x86-64 build.

* buildroot 770f939463...b9520eedc6 (1):
  > package/linux-firmware: fix compression after bad merge
2024-06-11 12:49:20 +02:00
Jan Čermák
542f69efa4 Update Buildroot to 2024.02.3 (#3406)
* Bump buildroot to 2024.02.3

* buildroot 691077e577...770f939463 (1):
  > Merge tag '2024.02.3' into 2024.02.x-haos

* package/hassio: update dind to version 26.0 used in current buildroot
2024-06-10 17:14:17 +02:00
dependabot[bot]
ae588b762a Bump docker/build-push-action from 5.3.0 to 5.4.0 (#3405)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 15:08:18 +02:00
Jan Čermák
6135ecdcc7 Use Genimage for declarative image layout (#3388)
* Use Genimage for declarative image layout instead of s[fg]disk and dd

* Change partition type to hybrid for M1, M1S and Green

This is what it really is, so just make sure only one "fix" function is
called.

* Change efi BOOT_SYS to gpt

There is no reason to have separate efi and boot sys, since all boards
that use efi also use grub as the loader.

* Change BOOT_SYS to more explanatory PARTITION_TABLE_TYPE

* Add units to DISK_SIZE

* Add forced-primary patch and use it in MBR images

* Avoid disabling SC2155, remove old comments
2024-06-07 13:44:14 +02:00
Jan Čermák
22b63ae779 Set tty0 in cmdline as the default preferred console (#3402)
The preferred console (which is used for printing the systemd boot log)
is the last one specified in the cmdline boot arguments. Make sure it is
always tty0, i.e. the first graphical console.

In some places tty1 was used - change it to tty0 which is commonly used,
and in HAOS points to tty1 anyway.

The only exception is the Yellow, which doesn't have an HDMI port, so
the serial console is used as the preferred one instead.

For ASUS Tinker, use a versioned cmdline.txt file instead of in-place
generating it in the post-build hook.
2024-06-07 12:59:21 +02:00
Jan Čermák
bd7474fc97 RaspberryPi: Update kernel to 6.6.31 - stable_20240529 (#3400)
* RaspberryPi: Update kernel to 6.6.31 - stable_20240529

* Unify Linux patches after RPi update to non-conflicting 6.6.31

* Bump buildroot to update rpi-firmware

* buildroot 9af2384782...691077e577 (1):
  > package/rpi-firmware: bump to version 1.20240529 for kernel 6.6.31
2024-06-04 17:33:51 +02:00
dependabot[bot]
5ed9057728 Bump docker/login-action from 3.1.0 to 3.2.0 (#3399)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 15:15:55 +02:00
Jan Čermák
682d59434e Linux: Update kernel to 6.6.32 (#3394)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.32
2024-05-27 15:00:13 +02:00
Jan Čermák
2c725d90f6 Reintroduce IPv6 reachability probe patch for RPi lost after refactoring (#3389)
* Reintroduce IPv6 reachability probe patch for RPi lost after refactoring

In #3384 we moved the patches around, which results in version-specific
patches not applied for RPi linux-custom build. Copy the missing IPv6
reachability probe patch to the RPi patches directory.

* Only copy IPv6 reachability probe patch to top-level linux patches

Instead of copying the patch to RPi directory and renumbering the
patches, only copy it upper level so it's applied for all linux versions
other than 6.6.31.
2024-05-24 09:30:07 +02:00
Jan Čermák
8dbc03cc76 Linux: Update kernel to 6.6.31 (#3384)
* Linux: Update kernel to 6.6.31

* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.31

* Update patch workarounding Z-Wave.me USB issues

Linux commit 480c3abbba36628dab063b9ca218bb28090e5b46 changed code that
is reverted by the patch. Use a version-specific patch directory again
for upstream Linux patches before RPi kernel is updated to 6.6.31+.
2024-05-21 21:27:51 +02:00
Jan Čermák
8aa9869e4f Use U-Boot tarball for all boards (#3361)
ODROID M1, M1S and Green historically used git repo as the source. Now
that we use the same version for all boards, use always use distribution
tarball for consistency and more efficient caching.
2024-05-14 11:23:31 +02:00
Jan Čermák
dd96b5019a Bump buildroot to update openvmtools to 12.3.0 (again) (#3370)
Cherry-picked downstream-only patch lost in Buildroot 2024.02 bump.

* buildroot 34e790c5da...9af2384782 (1):
  > package/openvmtools: bump version to 12.3.0

Fixes #3366
2024-05-14 11:06:37 +02:00
Jan Čermák
229cc7ebbb Merge branch 'main' into dev 2024-05-09 10:18:11 +02:00
Jan Čermák
ca71774e7d Linux: Update kernel to 6.6.30 (#3342)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.30
2024-05-08 21:26:45 +02:00
Jan Čermák
12597f197f Bump OS to release version 12.3 2024-05-06 14:35:19 +02:00
Stefan Agner
2c266c53f1 Enable grep context feature (#3339)
Add context feature to Busybox grep configuration. Context is really useful
when checking host logs directly on the OS shell.
2024-05-01 19:05:01 +02:00
Jan Čermák
d7338e7570 Bump OS to pre-release version 12.3.rc2 2024-04-30 11:58:55 +02:00
Jan Čermák
301bf4a377 RaspberryPi: Update kernel to 6.6.28 - stable_20240423 (#3336)
* RaspberryPi: Update kernel to 6.6.28 - stable_20240423

* Bump buildroot to update rpi-firmware

* buildroot 0a64bfe8f1...e8948ce36e (1):
  > package/rpi-firmware: bump to version 1.20240424 for kernel 6.6.28

(cherry picked from commit 9fa953745a)
2024-04-30 11:57:24 +02:00
Jan Čermák
2ea9eccf79 Fix incorrect mapping of DT overlays on RPi 5 (#3335)
RPi 5 config uses BR2_LINUX_KERNEL_INSTALL_INTREE_OVERLAYS which builds
the device tree overlays from the Linux tree when building the kernel.
The overlays directory also contains overlay_map.dtb which is necessary
to correctly map overlays without RPi version suffix to the
platform-specific ones. Without this, some peripherals may not work
correctly on Pi 5 without any obvious error messages in the kernel log
because an incorrect (Pi 4) overlay is used as the default.

Fixes #3321

* buildroot cc0481f40e...0a64bfe8f1 (1):
  > Install overlay_map.dtb when using in-tree DT overlays

(cherry picked from commit fce19b7846)
2024-04-30 11:56:55 +02:00
Jan Čermák
1a5a2c4e28 Linux: Update kernel to 6.6.29 (#3334)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.29

(cherry picked from commit 65f35c65b2)
2024-04-30 11:56:48 +02:00
Jan Čermák
7a94a2ef71 Enable kernel userspace crypto API interface for all platforms (#3330)
Enable libkcapi in generic kernel config. The bloat is minimal and the
options are enabled on most distributions. These modules are also needed
for Bluetooth Mesh and adding them fixes compatibility with some HCI USB
adapters.

Fixes #3322

(cherry picked from commit 67315f86d4)
2024-04-30 11:56:44 +02:00
Jan Čermák
ddd528b8e7 Enable KVM for running tests in GH Actions (#3329)
It was not possible on free runners previously, but it should be now:
https://github.com/actions/runner-images/discussions/7191#discussioncomment-9018826

(cherry picked from commit 4e44b101f3)
2024-04-30 11:56:33 +02:00
Jan Čermák
9fa953745a RaspberryPi: Update kernel to 6.6.28 - stable_20240423 (#3336)
* RaspberryPi: Update kernel to 6.6.28 - stable_20240423

* Bump buildroot to update rpi-firmware

* buildroot 0a64bfe8f1...e8948ce36e (1):
  > package/rpi-firmware: bump to version 1.20240424 for kernel 6.6.28
2024-04-30 11:55:13 +02:00
Jan Čermák
fce19b7846 Fix incorrect mapping of DT overlays on RPi 5 (#3335)
RPi 5 config uses BR2_LINUX_KERNEL_INSTALL_INTREE_OVERLAYS which builds
the device tree overlays from the Linux tree when building the kernel.
The overlays directory also contains overlay_map.dtb which is necessary
to correctly map overlays without RPi version suffix to the
platform-specific ones. Without this, some peripherals may not work
correctly on Pi 5 without any obvious error messages in the kernel log
because an incorrect (Pi 4) overlay is used as the default.

Fixes #3321

* buildroot cc0481f40e...0a64bfe8f1 (1):
  > Install overlay_map.dtb when using in-tree DT overlays
2024-04-29 15:20:36 +02:00
Jan Čermák
65f35c65b2 Linux: Update kernel to 6.6.29 (#3334)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.29
2024-04-29 15:12:50 +02:00
Jan Čermák
67315f86d4 Enable kernel userspace crypto API interface for all platforms (#3330)
Enable libkcapi in generic kernel config. The bloat is minimal and the
options are enabled on most distributions. These modules are also needed
for Bluetooth Mesh and adding them fixes compatibility with some HCI USB
adapters.

Fixes #3322
2024-04-26 21:27:35 +02:00
Jan Čermák
4e44b101f3 Enable KVM for running tests in GH Actions (#3329)
It was not possible on free runners previously, but it should be now:
https://github.com/actions/runner-images/discussions/7191#discussioncomment-9018826
2024-04-26 15:30:23 +02:00
Jan Čermák
21fd9e64c8 Bump OS to development version 12.4.dev0 2024-04-26 11:59:15 +02:00
Jan Čermák
9dab6908c9 Bump OS to pre-release version 12.3.rc1 2024-04-26 11:24:09 +02:00
Jan Čermák
a277854add Bump buildroot to update BlueZ to 5.75 (#3326)
* buildroot 9a506c0e75...cc0481f40e (1):
  > package/{bluez5_utils, bluez5_utils-headers}: bump to version 5.75
2024-04-25 17:49:30 +02:00
Jan Čermák
8854dd4ddb Bump buildroot to update linux-pam (#3325)
This fixes "Warning: your password will expire in 0 days." message
shown on tty login since Buildroot bump in HAOS 12.2.

* buildroot 9f5750121a...d29893dd98 (1):
  > package/linux-pam: bump to version 1.6.1
2024-04-25 08:33:10 +02:00
Jan Čermák
478538eac0 Revert GRUB2 patch causing boot failure on some old x86_64 BIOSes (#3324)
GRUB 2.12 release contains a change of the loader [1] used for loading
the kernel on x86_64 platform. This change was identified to cause boot
failure on some old Intel Atom boards with the NM10 chipset, and
possibly some others. Revert this patch before we get a more proper fix
for the issue.

[1] https://git.savannah.gnu.org/cgit/grub.git/commit/?id=cfbfae1aef0694b416aa199291cfef7596cdfc20

Fixes #3305
2024-04-25 08:33:01 +02:00
Stefan Agner
e1b11540a1 ODROID-N2/C2/C4: Force 40MHz instead of 24MHz as eMMC clock (#3319)
It seems that forcing 24MHz clocks is problematic for newer 32GB
Kingston based eMMC modules on ODROID-N2(+). Use what downstream
U-Boot is using as f_max, which is 40MHz.

Fixes: #3227
2024-04-24 20:37:14 +02:00
Salim B
82c3e2a859 Update instructions for ODROID M1 Petitboot update (#3317) 2024-04-18 09:02:17 +02:00
Jan Čermák
9272065664 Linux: Update kernel to 6.6.28 (#3316)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.28
2024-04-17 16:23:18 +02:00
Jan Čermák
77c28be3cd Increase maximum length of usb_storage.quirks in RPi kernel params (#3311)
With #3281 we hit the maximum length of the quirks parameter. Since
cmdline.txt changes are not applied on OS update, only new installs of
12.2 are affected, effectively disabling all quirks until this patch
lands in future OS release.

Fixes #3308
2024-04-15 14:27:41 +02:00
Jan Čermák
85d7c23a5f Linux: Update kernel to 6.6.27 (#3310)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.26
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.27
2024-04-15 14:27:28 +02:00
Stefan Agner
4f53947596 Update Raspberry Pi 3 device tree list (#3301)
Make sure all Raspberry Pi devices using the BCM2837 SoC (or the SiP
version RP3A0 of it) are deployed. This especially makes sure that
we only deploy the downstream device trees (named bcm2710*) and deploy
device trees for the CM3 as well as the Zero 2 and Zero 2 W consistently
for 32-bit and 64-bit.
2024-04-12 09:42:05 +02:00
Jan Čermák
dd76a1dda4 Merge branch 'main' into dev 2024-04-11 10:38:30 +02:00
Jan Čermák
c9efdea83b Bump OS to release version 12.2 2024-04-11 10:07:22 +02:00
Jan Čermák
56ae6e1cb7 Remove BT_HS from kernel configs after upstream removal (#3299)
BT_HS has been removed in e7b02296fb400ee64822fbdd81a0718449066333 and
backported to stable branches - remove it from our configs to avoid
warnings.
2024-04-10 15:53:21 +02:00
Jan Čermák
2254260dad Update Raspberry Pi Kernel to v6.6.20 (#3297)
* RaspberryPi: Update kernel to 6.6.20 - 6f16847710cc0502450788b9f12f0a14d3429668

Used version specified in RPi OS release notes [1].

[1] https://downloads.raspberrypi.org/raspios_arm64/release_notes.txt

* Update RPi Buildroot defconfigs for v6.6.y kernel

* Update RPi kernel patches for v6.6.y kernel

* Amended old patches to accomodate for new DTS paths
* Removed 6.6.25 patches -> moved to the common folder
* Added patch to fix Yellow DTS compilation

* Bump buildroot to update rpi-firmware

* buildroot b45d671fe3...9f5750121a (1):
  > package/rpi-firmware: bump to version for (untagged) kernel v6.6.20

* Remove kernel v6.1.y config fragments, as they're not needed anymore
2024-04-10 10:04:35 +02:00
Jan Čermák
3252676fde Bump OS to pre-release version 12.2.rc2 2024-04-08 19:04:20 +02:00
Jan Čermák
5dc234d14f Only run HA CLI interactively if stdout is a terminal (#3292)
* Only run HA CLI interactively if stdout is a terminal

Flags for running HA CLI commands in an interactive shell added in #3238
cause the command to fail if the process is not running in a terminal.
This is needed for example for the fsfreeze hook, otherwise the command
fails, as seen in this trace when the hook is executed:

-----------
+ '[' thaw '=' freeze ]
+ '[' thaw '=' thaw ]
+ echo 'File system thaw requested, thawing Home Assistant'
File system thaw requested, thawing Home Assistant
+ ha backups thaw
the input device is not a TTY
------------

However, for example on Proxmox this message is not logged anywhere and
the hook just fails silently (i.e. it doesn't cause the backup to fail).

Fixes #3251

* Use -i also when not running in a terminal

(cherry picked from commit 78d281fce1)
2024-04-08 19:03:35 +02:00
Jan Čermák
3e970f1e9a Linux: Update kernel to 6.6.25 (#3291)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.25

(cherry picked from commit 7013872665)
2024-04-08 19:02:54 +02:00
Jan Čermák
ea217fe5bd Update Linux patches directory for v6.6.24 (#3289)
This should have been included in #3288.

(cherry picked from commit 974812a8af)
2024-04-08 19:02:44 +02:00
Jan Čermák
bfe9943068 Linux: Update kernel to 6.6.24 (#3288)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.24

(cherry picked from commit e18c6ef4ce)
2024-04-08 19:02:38 +02:00
Stefan Agner
7166a83998 Ignore non-existing CP15 barrier instructions emulation (#3285)
CP15 barrier instruction emulation only exists on arm64 architecture.
Avoid sysctl writing an error to the journal when the setting doesn't
exist by prepending a dash.

(cherry picked from commit 889b561ca1)
2024-04-08 19:02:33 +02:00
Jan Čermák
7a69678505 Use Docker 25 for installing containers in hassio package (#3286)
Bump DinD version used for creating data partition after Docker bump
in #3271.

(cherry picked from commit 90b618b096)
2024-04-08 19:02:28 +02:00
agglrx
0c9deaeebf Disable UAS via usb-storage.quirks on RPi for ADATA SD600Q (#3281)
Booting from a ADATA SD600Q fails when connected to a USB 3.0 port on RPi4. Adding it to the quirks list resolves the issue.

(cherry picked from commit 5ee9cef8c8)
2024-04-08 19:02:22 +02:00
dependabot[bot]
de3f2c6420 Bump docker/setup-buildx-action from 3.2.0 to 3.3.0 (#3293)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 16:05:29 +02:00
Jan Čermák
78d281fce1 Only run HA CLI interactively if stdout is a terminal (#3292)
* Only run HA CLI interactively if stdout is a terminal

Flags for running HA CLI commands in an interactive shell added in #3238
cause the command to fail if the process is not running in a terminal.
This is needed for example for the fsfreeze hook, otherwise the command
fails, as seen in this trace when the hook is executed:

-----------
+ '[' thaw '=' freeze ]
+ '[' thaw '=' thaw ]
+ echo 'File system thaw requested, thawing Home Assistant'
File system thaw requested, thawing Home Assistant
+ ha backups thaw
the input device is not a TTY
------------

However, for example on Proxmox this message is not logged anywhere and
the hook just fails silently (i.e. it doesn't cause the backup to fail).

Fixes #3251

* Use -i also when not running in a terminal
2024-04-08 15:43:12 +02:00
Jan Čermák
7013872665 Linux: Update kernel to 6.6.25 (#3291)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.25
2024-04-08 12:46:54 +02:00
Jan Čermák
974812a8af Update Linux patches directory for v6.6.24 (#3289)
This should have been included in #3288.
2024-04-04 13:52:28 +02:00
Jan Čermák
e18c6ef4ce Linux: Update kernel to 6.6.24 (#3288)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.24
2024-04-04 12:56:14 +02:00
Stefan Agner
889b561ca1 Ignore non-existing CP15 barrier instructions emulation (#3285)
CP15 barrier instruction emulation only exists on arm64 architecture.
Avoid sysctl writing an error to the journal when the setting doesn't
exist by prepending a dash.
2024-04-04 00:33:45 +02:00
Jan Čermák
90b618b096 Use Docker 25 for installing containers in hassio package (#3286)
Bump DinD version used for creating data partition after Docker bump
in #3271.
2024-04-04 00:33:34 +02:00
agglrx
5ee9cef8c8 Disable UAS via usb-storage.quirks on RPi for ADATA SD600Q (#3281)
Booting from a ADATA SD600Q fails when connected to a USB 3.0 port on RPi4. Adding it to the quirks list resolves the issue.
2024-04-02 10:36:37 +02:00
Jan Čermák
040af8fd9b Bump OS to development version 12.3.dev0 2024-04-02 10:32:23 +02:00
Jan Čermák
94bf84a807 Bump OS to pre-release version 12.2.rc1 2024-03-28 11:13:08 +01:00
Jan Čermák
b564fb3fa7 Bump buildroot to fix dbus tmpfiles warning (#3273)
* buildroot f2472c23a3...b45d671fe3 (1):
  > package/dbus: set runstatedir to /run
2024-03-28 11:09:51 +01:00
Jan Čermák
2d6b731b9a Bump buildroot to add forgotten package/runc patch (#3272)
* buildroot 51c9960ed8...f2472c23a3 (1):
  > package/runc: add support for CGroup device permission updates
2024-03-27 17:33:14 +01:00
Jan Čermák
adbd449494 Bump buildroot to update Docker to v25.0.5 (#3271)
* buildroot 1c84a7493b...51c9960ed8 (2):
  > package/docker-engine: bump version to v25.0.5
  > package/docker-cli: bump version to v25.0.5
2024-03-27 17:24:40 +01:00
Jan Čermák
cff5c81cf0 Linux: Update kernel to 6.6.23 (#3270)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.23
2024-03-27 10:20:35 +01:00
Jan Čermák
aafa022800 Bump buildroot to 2024.02.1 (#3268)
* buildroot a1b2d12f32...1c84a7493b (1):
  > Merge tag '2024.02.1' into 2024.02.x-haos
2024-03-26 13:15:48 +01:00
Jan Čermák
ccf92bc87f Disable setting default keymap in systemd-vconsole-setup (#3261)
Since buildroot commit 3ceb8c97bcb6753740fa27a58b8e0dc00dbbbd19, systemd
has new option BR2_PACKAGE_SYSTEMD_VCONSOLE_DEFAULT_KEYMAP which
defaults to "us". With this option specified, systemd-console depends on
kbd package and causes the following message to be printed during
startup on HAOS:

systemd-vconsole-setup[253]: sh: gzip: not found

This comes from the loadkeys call which tries to open the gzipped file,
so likely the kbd package should also depend on gzip. However, since we
don't want the kbd package at this point, I'm leaving this for later
investigation and simply unsetting the new option to revert to
pre-2024.02 setup.
2024-03-20 12:25:43 +01:00
Jan Čermák
a45cab1756 Linux: Update kernel to 6.6.22 (#3259)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.22
2024-03-20 12:25:35 +01:00
Hedda
6c11146d9c List Nabu Casa appliances under boards README.md (#3260)
List Nabu Casa appliances under boards README.md

* Home Assistant Green
* Home Assistant Yellow (based custom carrier board and powered by a Raspberry Pi 4 Compute Module)
* Home Assistant Blue (based on ODROID-N2+)
2024-03-20 09:35:58 +01:00
dependabot[bot]
e144c2bc96 Bump docker/setup-buildx-action from 3.1.0 to 3.2.0 (#3257)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 15:35:15 +01:00
dependabot[bot]
6c7c972c5d Bump docker/build-push-action from 5.2.0 to 5.3.0 (#3256)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 15:31:55 +01:00
dependabot[bot]
1953c2afdb Bump docker/login-action from 3.0.0 to 3.1.0 (#3258)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 15:31:40 +01:00
Matthieu Baerts
6b062f3c75 kernel: enable MPTCP support (#3248)
The official description says:

  Multipath TCP (MPTCP) connections send and receive data over multiple
  subflows in order to utilize multiple network paths. Each subflow uses
  the TCP protocol, and TCP options carry header information for MPTCP.

Thanks to MPTCP, being able to use multiple paths in parallel or
simultaneously brings new use-cases:

- Seamless handovers: switching from one path to another while
  preserving established connections -- Apple is using it for this
  reason since 2013.

- Best network selection: using the "best" available path (latency,
  losses, cost, bandwidth) -- one path can be used as a "backup" one.

- Network aggregation: using multiple paths at the same time to have a
  higher throughput -- e.g. to combine a fixed an mobile network to
  send files faster.

For example, for HA, it is possible to keep a SSH connection alive when
switching from one network to another (e.g. while travelling).

To be able to use MPTCP, both ends need to support it. An application
has to request it, by creating an MPTCP socket instead of a TCP one.
The rest in unchanged. An alternative is to use 'mptcpize' tool, which
relies on LD_PRELOAD to create an MPTCP socket instead of a TCP one.

Note that a MPTCP-enabled server continues to accept regular TCP
connections that do not use the Multipath TCP extension without any
performance impact. When a connection request is received, and is linked
to a listening socket with MPTCP support, the kernel will simply check
if MPTCP options are present. If not, the accepted socket will be a
"plain" TCP one, with the same impact as before.

To use multiple paths at the same time, additional IP addresses need to
be configured, e.g. via the 'ip' tool (IPRoute2).

MPTCP in the kernel is enabled in most main Linux distributions (Debian,
Ubuntu, RedHat, Fedora, etc.), but in more specific ones like Raspbian.
It is available in the Linux kernel since v5.6.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
2024-03-14 16:51:01 +01:00
Jan Čermák
c085ff2b10 Bump OS to development version 12.2.dev0 2024-03-13 15:19:48 +01:00
Jan Čermák
454d764676 Update Buildroot to 2024.02 (#3241)
* Update Buildroot to tag 2024.02 with rebased HAOS patchset

* udisks2: update to v2.10.1

  * Updated to version 2.10.x compatible with libblockdev v3
  * Rebased patches to new codebase
  * Autoreconf patch is not needed anymore
  * libblockdev-nvme is now hard dependency of udisks daemon

* patches/grub2: remove upstreamed efidisk patch

* patches/network-manager: update multiple gateway patch

* package/os-agent: fix go download

  After the Go update, build fails with the following error on mod vendor:

    GOPROXY list is not the empty string, but contains no entries

  Turns out this step is not having the environment variables set, use
  those used for download to fix it.

* package/xe-guest-utilities: set DL env for go mod vendor

* Bump buildroot to fix missing unit file from nfs-utils

* buildroot 3f950a1aee...a1b2d12f32 (1):
  > package/nfs-utils: only install fsidd binary and unit file with enabled nfsd

* CI: install flake8 for pr-checks runner

  Use distribution package, as it's what's used in Buidlroot's Gitlab CI
  Docker image at buildroot/support/docker/Dockefile.

* Disable check for Upstream section in the patch header for now

  It was introduced in latest BR - disable it for now and re-enable
  for HAOS in a later separate PR.
2024-03-13 15:16:54 +01:00
Jan Čermák
0e3a2d016d Merge branch 'main' into dev 2024-03-13 12:21:53 +01:00
Jan Čermák
8226323a1b Fix IPv6 reachability patch not being applied (#3240)
Fix regression caused by #3224 which introduced version-specific
directory for linux patches, causing the upper-level patch not being
applied. Copy the patch to the version folder instead. Also we need
to keep it in the upper directory for RPi kernels.
2024-03-12 14:55:18 +01:00
Jan Čermák
122dd1c288 Fix test_restore_ssl_directory with HA CLI in interactive PTY (#3239)
The test was missing --no-progress flag, which only manifested after
merging #3238 - causing the CLI to run in an interactive pseudotty.
2024-03-12 14:55:10 +01:00
Stefan Agner
fe1978f98f Start HA CLI interactively and with a tty allocated (#3238)
Use -i (--interactive) and -t (--tty) to start the HA CLI interactively.
This is required by some commands like the new device wipe command added
with https://github.com/home-assistant/cli/pull/464.
2024-03-12 10:12:35 +01:00
dependabot[bot]
541afd452b Bump docker/build-push-action from 5.1.0 to 5.2.0 (#3235)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 18:28:48 +01:00
Jan Čermák
b5795a0277 Linux: Update kernel to 6.6.21 (#3234)
* https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.21
2024-03-11 18:28:36 +01:00
258 changed files with 5370 additions and 2661 deletions

View File

@@ -23,6 +23,7 @@ body:
required: true
attributes:
label: What operating system image do you use?
default: 0
options:
- generic-x86-64 (Generic UEFI capable x86-64 systems)
- generic-aarch64 (Generic UEFI capable aarch64 systems)
@@ -59,10 +60,21 @@ body:
validations:
required: true
attributes:
label: Did you upgrade the Operating System.
label: Did the problem occur after upgrading the Operating System?
default: 0
options:
- "Yes"
- "No"
- "Yes"
- type: textarea
validations:
required: true
attributes:
label: Hardware details
description: >
Provide details about the hardware used for your install.
This is especially important for bare-metal x86 installations.
If you have any USB devices attached, please list them here.
For VMs, include the hypervisor type and version.
- type: textarea
validations:
required: true

View File

@@ -4,8 +4,6 @@ version-template: "$MAJOR.$MINOR"
categories:
- title: 'Home Assistant Operating System'
label: 'os'
- title: 'Build System'
label: 'build'
- title: 'Raspberry Pi'
label: 'board/raspberrypi'
- title: 'Home Assistant Yellow'
@@ -24,6 +22,12 @@ categories:
label: 'board/khadas'
- title: 'Generic aarch64'
label: 'board/generic-aarch64'
- title: 'Documentation'
label: 'documentation'
- title: 'Build System'
label: 'build'
- title: 'Dependencies'
label: 'dependencies'
filter-by-commitish: true
template: |
## Changes

View File

@@ -83,11 +83,20 @@ jobs:
- name: Flush CloudFlare cache
run: |
curl --silent --show-error --fail -X POST \
"https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache" \
-H "Authorization: Bearer ${{ secrets.CF_PURGE_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{"files": [
"https://os-artifacts.home-assistant.io/index.html",
"https://os-artifacts.home-assistant.io/index.json"
] }'
# Create purge list of all artifacts
jq -r '. | map("https://os-artifacts.home-assistant.io/${{ inputs.version }}/" + .) | join("\n")' < "${{ inputs.version }}.json" > purge_list
# Add indexes to purge list too
echo "https://os-artifacts.home-assistant.io/indexes/${{ inputs.version }}.json" >> purge_list
echo "https://os-artifacts.home-assistant.io/index.html" >> purge_list
echo "https://os-artifacts.home-assistant.io/index.json" >> purge_list
# Split to chunks of 30 files (limit of CF API)
split -d -l30 purge_list purge_list_chunked
# Convert chunked lists to JSON arrays and call CF purge API
for f in purge_list_chunked*; do
files=$(jq -R -s 'split("\n")[:-1]' < "$f")
curl --silent --show-error --fail -X POST \
"https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache" \
-H "Authorization: Bearer ${{ secrets.CF_PURGE_TOKEN }}" \
-H "Content-Type: application/json" \
--data "{\"files\": ${files}}"
done

View File

@@ -136,15 +136,15 @@ jobs:
}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.1.0
uses: docker/setup-buildx-action@v3.7.1
- name: Log in to the GitHub container registry
uses: docker/login-action@v3.0.0
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6.10.0
id: build_haos_builder
with:
context: .
@@ -316,7 +316,7 @@ jobs:
echo "## Partitions" >> $GITHUB_STEP_SUMMARY
echo "| File | Size (bytes) | Size (formatted) |" >> $GITHUB_STEP_SUMMARY
echo "|:-|:-|:-|" >> $GITHUB_STEP_SUMMARY
for f in boot.vfat kernel.img rootfs.squashfs overlay.ext4 data.ext4; do
for f in boot.vfat kernel.img rootfs.erofs overlay.ext4 data.ext4; do
echo "| ${f} | $(du -b output/images/$f | cut -f1) | $(du -bh output/images/$f | cut -f1) |" >> $GITHUB_STEP_SUMMARY
done

View File

@@ -8,6 +8,12 @@ jobs:
linters:
runs-on: ubuntu-22.04
steps:
- name: Install additional dependencies
run: |
sudo apt-get update
sudo apt-get -y install \
python3-flake8
- name: Check out code
uses: actions/checkout@v4
with:
@@ -25,4 +31,4 @@ jobs:
- name: Check buildroot-external packages
run: |
buildroot/utils/check-package --exclude PackageHeader --br2-external buildroot-external/package/*/*
buildroot/utils/check-package --exclude PackageHeader --exclude Upstream --br2-external buildroot-external/package/*/*

View File

@@ -28,9 +28,6 @@ jobs:
test:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
env:
NO_KVM: 1
name: Test in QEMU
runs-on: ubuntu-22.04
steps:
@@ -69,6 +66,12 @@ jobs:
xz -dc haos*.qcow2.xz > tests/haos.qcow2
rm haos*.qcow2.xz
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run tests
run: |
./tests/run_tests.sh
@@ -90,7 +93,7 @@ jobs:
tests/junit_reports/*.xml
- name: Publish test report
uses: mikepenz/action-junit-report@v4
uses: mikepenz/action-junit-report@v5
if: always()
with:
report_paths: 'tests/junit_reports/*.xml'

2
.gitmodules vendored
View File

@@ -1,4 +1,4 @@
[submodule "buildroot"]
path = buildroot
url = https://github.com/home-assistant/buildroot.git
branch = 2022.02.x-haos
branch = 2024.02.x-haos

View File

@@ -4,6 +4,10 @@
The following boards/devices are supported:
- Nabu Casa
- [Home Assistant Green](https://www.home-assistant.io/green/)
- [Home Assistant Yellow](https://www.home-assistant.io/yellow/) (based custom carrier board and powered by a Raspberry Pi 4 Compute Module)
- [Home Assistant Blue](https://www.home-assistant.io/blue/) (based on ODROID-N2+)
- Raspberry Pi
- Pi 5 ([4 GB](https://www.raspberrypi.com/products/raspberry-pi-5/?variant=raspberry-pi-5-4gb) and [8 GB](https://www.raspberrypi.com/products/raspberry-pi-5/?variant=raspberry-pi-5-8gb) model) 64-bit
- Pi 4 Model B ([1 GB](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/?variant=raspberry-pi-4-model-b-1gb), [2 GB](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/?variant=raspberry-pi-4-model-b-2gb), [4 GB](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/?variant=raspberry-pi-4-model-b-4gb) and [8 GB](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/?variant=raspberry-pi-4-model-b-8gb) model) 32-bit or 64-bit (recommended)
@@ -39,6 +43,8 @@ Notes:
|Board|Build|Config|Docs|
|-----|----|------|----|
|Green |`make green` |[green](../../buildroot-external/configs/green_defconfig)|-|
|Yellow |`make yellow` |[yellow](../../buildroot-external/configs/yellow_defconfig)|-|
|Pi5 64-bit |`make rpi5_64` |[rpi5_64](../../buildroot-external/configs/rpi5_64_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi4B 64-bit |`make rpi4_64` |[rpi4_64](../../buildroot-external/configs/rpi4_64_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi4B 32-bit |`make rpi4` |[rpi4](../../buildroot-external/configs/rpi4_defconfig)|[raspberrypi](./raspberrypi/)|

View File

@@ -8,18 +8,18 @@ SD-card boot is supported via on-board bootloader (SPL) or recovery button.
## eMMC
eMMC boot via on-board bootloader requires the latest version of Petitboot
(spiboot 20230328). To install the latest version download the SPI boot image
eMMC boot via on-board bootloader requires a newer version of Petitboot
(spiboot 20230328 or later). To install the latest version download the SPI boot image
from [linuxfactory.or.kr][1] as follows:
1. Download `spiupdate_odroidm1_20220304.img.xz`
1. Download `spiupdate_odroidm1_20240415.img.xz`
2. Use balenaEtcher or another tool to flash the updater onto an SD card
3. Download `spiboot-20230328.img`
4. Rename the `spiboot-20230328.img` file to`spiboot.img`.
3. Download `spiboot-20240109.img`
4. Rename the `spiboot-20240109.img` file to`spiboot.img`.
5. Paste the `spiboot.img` file onto the FAT partition of that same SD card.
6. Plug-in that SD card to your ODROID-M1. Petitboot will update itself, you can verify the progress on the HDMI output.
7. If you see the version 20230328 in the top right corner, the installation was successful.
* If you see any other version there, the installation failed.
7. If you see the version 20240109 in the top left corner, the installation was successful.\
If you see any other version there, the installation failed.
Once Petitboot is updated you can flash Home Assistant OS directly onto an eMMC.

View File

@@ -10,8 +10,8 @@ ODROID-M1S can boot HAOS directly from an SD card, as it has higher priority tha
HAOS can be installed directly to the eMMC using a special boot image, to do that:
1. Download [`ODROID-M1S_EMMC2UMS.img`][1]
2. Use balenaEtcher or another tool to flash the UMS utility onto an SD card.
1. Download the _UMS Utility_ image: [`ODROID-M1S_EMMC2UMS.img`][1]. The _UMS Utility_ is a special image that switches ODROID-M1S to USB Mass Storage device.
2. Use balenaEtcher or another tool to flash the _UMS utility_ onto an SD card.
3. Plug-in that SD card to your ODROID-M1S and boot it. Connect your PC to the Micro USB OTG port.
4. The eMMC will show as a drive on your PC and you can directly flash the HAOS image with balenaEther.

View File

@@ -1,26 +1,24 @@
# Kernel Version
Default Kernel tree: 6.1
| Board | Version |
|-------|---------|
| Open Virtual Appliance | 6.6.20 |
| Raspberry Pi | 6.1.73 |
| Raspberry Pi 0-W | 6.1.73 |
| Raspberry Pi 2 | 6.1.73 |
| Raspberry Pi 3 | 6.1.73 |
| Raspberry Pi 4 | 6.1.73 |
| Raspberry Pi 5 | 6.1.73 |
| Home Assistant Yellow | 6.1.73 |
| Home Assistant Green | 6.6.20 |
| Tinker Board | 6.6.20 |
| ODROID-C2 | 6.6.20 |
| ODROID-C4 | 6.6.20 |
| ODROID-M1 | 6.6.20 |
| ODROID-M1S | 6.6.20 |
| ODROID-N2 | 6.6.20 |
| ODROID-XU4 | 6.6.20 |
| Generic aarch64 | 6.6.20 |
| Generic x86-64 | 6.6.20 |
| Khadas VIM3 | 6.6.20 |
| Open Virtual Appliance | 6.6.63 |
| Raspberry Pi | 6.6.51 |
| Raspberry Pi 0-W | 6.6.51 |
| Raspberry Pi 2 | 6.6.51 |
| Raspberry Pi 3 | 6.6.51 |
| Raspberry Pi 4 | 6.6.51 |
| Raspberry Pi 5 | 6.6.51 |
| Home Assistant Yellow | 6.6.51 |
| Home Assistant Green | 6.6.63 |
| Tinker Board | 6.6.63 |
| ODROID-C2 | 6.6.63 |
| ODROID-C4 | 6.6.63 |
| ODROID-M1 | 6.6.63 |
| ODROID-M1S | 6.6.63 |
| ODROID-N2 | 6.6.63 |
| ODROID-XU4 | 6.6.63 |
| Generic aarch64 | 6.6.63 |
| Generic x86-64 | 6.6.63 |
| Khadas VIM3 | 6.6.63 |

View File

@@ -4,6 +4,8 @@ Home Assistant Operating System (formerly HassOS) is a Linux based operating sys
Home Assistant Operating System uses Docker as its container engine. By default it deploys the Home Assistant Supervisor as a container. Home Assistant Supervisor in turn uses the Docker container engine to control Home Assistant Core and Add-Ons in separate containers. Home Assistant Operating System is **not** based on a regular Linux distribution like Ubuntu. It is built using [Buildroot](https://buildroot.org/) and it is optimized to run Home Assistant. It targets single board compute (SBC) devices like the Raspberry Pi or ODROID but also supports x86-64 systems with UEFI.
[![Home Assistant - A project from the Open Home Foundation](https://www.openhomefoundation.org/badges/home-assistant.png)](https://www.openhomefoundation.org/)
## Features
- Lightweight and memory-efficient
@@ -14,6 +16,7 @@ Home Assistant Operating System uses Docker as its container engine. By default
## Supported hardware
- Nabu Casa
- Raspberry Pi
- Hardkernel ODROID
- Asus Tinker Board
@@ -37,7 +40,7 @@ The Home Assistant Operating System documentation can be found on the [Home Assi
### Components
- **Bootloader:**
- [Barebox](https://barebox.org/) for devices that support UEFI
- [GRUB](https://www.gnu.org/software/grub/) for devices that support UEFI
- [U-Boot](https://www.denx.de/wiki/U-Boot) for devices that don't support UEFI
- **Operating System:**
- [Buildroot](https://buildroot.org/) LTS Linux

View File

@@ -2,6 +2,7 @@ source "$BR2_EXTERNAL_HASSOS_PATH/package/bluetooth-rtl8723/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/eq3_char_loop/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/gasket/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/generic_raw_uart/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hailo8-firmware/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hardkernel-boot/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hassio/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/khadas-boot/Config.in"

View File

@@ -1 +1 @@
console=tty1 console=ttyS0
console=ttyS0 console=tty0

View File

@@ -10,6 +10,9 @@ function hassos_pre_image() {
cp "${BOARD_DIR}/grub.cfg" "${EFIPART_DATA}/EFI/BOOT/grub.cfg"
cp "${BOARD_DIR}/cmdline.txt" "${EFIPART_DATA}/cmdline.txt"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" create
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set ORDER="A B"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set A_OK=1
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set A_TRY=0
cp -r "${EFIPART_DATA}/"* "${BOOT_DATA}/"
}
@@ -24,4 +27,3 @@ function hassos_post_image() {
convert_disk_image_xz
}

View File

@@ -55,3 +55,5 @@ CONFIG_HYPERV_VSOCKETS=m
CONFIG_PCI_HYPERV=m
CONFIG_PCI_HYPERV_INTERFACE=m
CONFIG_FB_HYPERV=y
CONFIG_I6300ESB_WDT=y

View File

@@ -3,9 +3,9 @@ BOARD_NAME="Generic aarch64"
CHASSIS=embedded
BOOTLOADER=grub
KERNEL_FILE=Image
BOOT_SYS=efi
PARTITION_TABLE_TYPE=gpt
BOOT_SIZE=32M
BOOT_SPL=false
DISK_SIZE=6
DISK_SIZE=6G
SUPERVISOR_MACHINE=qemuarm-64
SUPERVISOR_ARCH=aarch64

View File

@@ -3,7 +3,6 @@
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local SPL_IMG="$(path_spl_img)"
cp -t "${BOOT_DATA}" \
"${BINARIES_DIR}/boot.scr" \
@@ -13,13 +12,7 @@ function hassos_pre_image() {
mkdir -p "${BOOT_DATA}/overlays"
cp "${BINARIES_DIR}"/*.dtbo "${BOOT_DATA}/overlays/"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
echo "console=tty1" > "${BOOT_DATA}/cmdline.txt"
# SPL
create_spl_image
dd if="${BINARIES_DIR}/u-boot-rockchip.bin" of="${SPL_IMG}" conv=notrunc bs=512 seek=64
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
}

View File

@@ -0,0 +1 @@
console=tty0

View File

@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}
hdimage {
partition-table-type = "none"
fill = "yes"
}
partition uboot {
offset = 32k
image = "u-boot-rockchip.bin"
}
}

View File

@@ -482,7 +482,6 @@ CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=m
CONFIG_BT_HS=y
CONFIG_BT_6LOWPAN=m
CONFIG_BT_LEDS=y
CONFIG_BT_HCIBTUSB=m
@@ -1556,7 +1555,6 @@ CONFIG_SECURITY=y
CONFIG_SECURITY_APPARMOR=y
CONFIG_SECURITY_YAMA=y
CONFIG_LSM="apparmor"
CONFIG_CRYPTO_USER=m
CONFIG_CRYPTO_PCRYPT=m
CONFIG_CRYPTO_TEST=m
CONFIG_CRYPTO_DH=m
@@ -1598,10 +1596,6 @@ CONFIG_CRYPTO_ZSTD=m
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_DRBG_HASH=y
CONFIG_CRYPTO_DRBG_CTR=y
CONFIG_CRYPTO_USER_API_HASH=m
CONFIG_CRYPTO_USER_API_SKCIPHER=m
CONFIG_CRYPTO_USER_API_RNG=m
CONFIG_CRYPTO_USER_API_AEAD=m
CONFIG_CRYPTO_GHASH_ARM_CE=m
CONFIG_CRYPTO_SHA1_ARM_NEON=m
CONFIG_CRYPTO_SHA1_ARM_CE=m

View File

@@ -3,7 +3,7 @@ BOARD_NAME="Asus TinkerBoard"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=zImage
BOOT_SYS=hybrid
PARTITION_TABLE_TYPE=hybrid
BOOT_SIZE=24M
BOOT_SPL=true
BOOT_SPL_SIZE=8M

View File

@@ -0,0 +1,7 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 17k)"}
}

View File

@@ -23,8 +23,8 @@ test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=t
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}"
# HassOS system A/B
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro rootwait"
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro rootwait"
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd ro rootwait"
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 ro rootwait"
# Load environment from haos-config.txt
if test -e mmc ${devnum}:1 haos-config.txt; then

View File

@@ -1 +1 @@
console=tty0 console=ttyAML0,115200n8
console=ttyAML0,115200n8 console=tty0

View File

@@ -3,9 +3,6 @@
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local BL1="${BINARIES_DIR}/bl1.bin.hardkernel"
local UBOOT_GXBB="${BINARIES_DIR}/u-boot.gxbb"
local SPL_IMG="$(path_spl_img)"
cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}/meson-gxbb-odroidc2.dtb" "${BOOT_DATA}/meson-gxbb-odroidc2.dtb"
@@ -14,13 +11,6 @@ function hassos_pre_image() {
cp "${BINARIES_DIR}"/*.dtbo "${BOOT_DATA}/overlays/"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
# SPL
create_spl_image
dd if="${BL1}" of="${SPL_IMG}" conv=notrunc bs=1 count=440
dd if="${BL1}" of="${SPL_IMG}" conv=notrunc bs=512 skip=1 seek=1
dd if="${UBOOT_GXBB}" of="${SPL_IMG}" conv=notrunc bs=512 seek=97
}

View File

@@ -0,0 +1,20 @@
image spl.img {
size = ${BOOT_SPL_SIZE}
hdimage {
partition-table-type = "none"
fill = "yes"
}
partition bl1 {
in-partition-table = "no"
image = "bl1.bin.hardkernel"
offset = 0
}
partition u-boot {
in-partition-table = "no"
image = "u-boot.gxbb"
offset = 97s
}
}

View File

@@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-C2"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=mbr
PARTITION_TABLE_TYPE=mbr
BOOT_SIZE=24M
BOOT_SPL=true
BOOT_SPL_SIZE=8M

View File

@@ -0,0 +1,8 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(440; 512)"}
}

View File

@@ -25,8 +25,8 @@ test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=t
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}"
# HassOS system A/B
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
setenv bootargs_b "root=PARTUUID=48617373-08 rootfstype=squashfs ro rootwait"
setenv bootargs_a "root=PARTUUID=48617373-06 ro rootwait"
setenv bootargs_b "root=PARTUUID=48617373-08 ro rootwait"
# Load environment from haos-config.txt
if test -e mmc ${devnum}:1 haos-config.txt; then

View File

@@ -1 +1 @@
console=tty0 console=ttyAML0,115200n8
console=ttyAML0,115200n8 console=tty0

View File

@@ -3,8 +3,6 @@
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local UBOOT_SM1="${BINARIES_DIR}/u-boot.sm1"
local SPL_IMG="$(path_spl_img)"
cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}/meson-sm1-odroid-c4.dtb" "${BOOT_DATA}/meson-sm1-odroid-c4.dtb"
@@ -13,11 +11,6 @@ function hassos_pre_image() {
cp "${BINARIES_DIR}"/*.dtbo "${BOOT_DATA}/overlays/"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
# SPL
create_spl_image
dd if="${UBOOT_SM1}" of="${SPL_IMG}" conv=notrunc bs=512 seek=1
}

View File

@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}
hdimage {
partition-table-type = "none"
fill = "yes"
}
partition uboot {
offset = 512
image = "u-boot.sm1"
}
}

View File

@@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-C4"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=mbr
PARTITION_TABLE_TYPE=mbr
BOOT_SIZE=24M
BOOT_SPL=true
BOOT_SPL_SIZE=8M

View File

@@ -0,0 +1,7 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 512)"}
}

View File

@@ -25,8 +25,8 @@ test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=t
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 systemd.machine_id=${MACHINE_ID} clk_ignore_unused usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u ${BOOT_CONDITION}"
# HassOS system A/B
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
setenv bootargs_b "root=PARTUUID=48617373-08 rootfstype=squashfs ro rootwait"
setenv bootargs_a "root=PARTUUID=48617373-06 ro rootwait"
setenv bootargs_b "root=PARTUUID=48617373-08 ro rootwait"
# Load environment from haos-config.txt
if test -e mmc ${devnum}:1 haos-config.txt; then

View File

@@ -0,0 +1 @@
console=tty0

View File

@@ -3,18 +3,12 @@
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local SPL_IMG="$(path_spl_img)"
cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}"/*.dtb "${BOOT_DATA}/"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
# SPL
create_spl_image
dd if="${BINARIES_DIR}/u-boot-rockchip.bin" of="${SPL_IMG}" conv=notrunc bs=512 seek=64
}

View File

@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}
hdimage {
partition-table-type = "none"
fill = "yes"
}
partition uboot {
offset = 32k
image = "u-boot-rockchip.bin"
}
}

View File

@@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-M1"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=gpt
PARTITION_TABLE_TYPE=hybrid
BOOT_SIZE=16M
BOOT_SPL=true
BOOT_SPL_SIZE=16M

View File

@@ -0,0 +1,17 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 17k)", "(8M; 16M)"}
}
partition uboot {
size = 8M
offset = 8M
# FIXME: hdd-image intended to use the following, but the next one
# is in the img because of the _fix_disk_spl_gpt function
# partition-type-uuid = "21686148-6449-6e6f-744e-656564454649"
partition-type-uuid = "e3c9e316-0b5c-4db8-817d-f92df00215ae"
# no image here - already contains data from spl.img
}

View File

@@ -0,0 +1,46 @@
From 023bc5bd23d3239494bca81d807d3c093f78c131 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <sairon@sairon.cz>
Date: Thu, 8 Aug 2024 17:52:47 +0200
Subject: [PATCH] odroid-m1: Disable eMMC DDR52 mode, enable HS200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Disable DDR52 mode on odroid-m1 to fix eMMC writes. Also enable HS200,
as it's supposed to work more reliably than slower modes.
Signed-off-by: Jan Čermák <sairon@sairon.cz>
Upstream: https://patchwork.ozlabs.org/project/uboot/cover/20240204205312.2342868-1-jonas@kwiboo.se/
---
arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi | 3 ---
configs/odroid-m1-rk3568_defconfig | 2 ++
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi b/arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi
index 0fc360b06d..f9d34d3b77 100644
--- a/arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi
+++ b/arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi
@@ -14,10 +14,7 @@
&sdhci {
cap-mmc-highspeed;
- mmc-ddr-1_8v;
mmc-hs200-1_8v;
- mmc-hs400-1_8v;
- mmc-hs400-enhanced-strobe;
pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
};
diff --git a/configs/odroid-m1-rk3568_defconfig b/configs/odroid-m1-rk3568_defconfig
index 96b4e9ecda..517ac0575d 100644
--- a/configs/odroid-m1-rk3568_defconfig
+++ b/configs/odroid-m1-rk3568_defconfig
@@ -72,6 +72,8 @@ CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_MISC=y
CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_MMC_HS200_SUPPORT=y
+CONFIG_SPL_MMC_HS200_SUPPORT=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_SDHCI=y

View File

@@ -23,8 +23,8 @@ test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=t
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}"
# HassOS system A/B
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro rootwait"
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro rootwait"
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd ro rootwait"
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 ro rootwait"
part number mmc ${devnum} hassos-boot boot_partnum

View File

@@ -0,0 +1 @@
console=tty0

View File

@@ -3,18 +3,12 @@
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local SPL_IMG="$(path_spl_img)"
cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}"/*.dtb "${BOOT_DATA}/"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
# SPL
create_spl_image
dd if="${BINARIES_DIR}/u-boot-rockchip.bin" of="${SPL_IMG}" conv=notrunc bs=512 seek=64
}

View File

@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}
hdimage {
partition-table-type = "none"
fill = "yes"
}
partition uboot {
offset = 32k
image = "u-boot-rockchip.bin"
}
}

View File

@@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-M1S"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=gpt
PARTITION_TABLE_TYPE=hybrid
BOOT_SIZE=16M
BOOT_SPL=true
BOOT_SPL_SIZE=16M

View File

@@ -0,0 +1,17 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 17k)", "(8M; 16M)"}
}
partition uboot {
size = 8M
offset = 8M
# FIXME: hdd-image intended to use the following, but the next one
# is in the img because of the _fix_disk_spl_gpt function
# partition-type-uuid = "21686148-6449-6e6f-744e-656564454649"
partition-type-uuid = "e3c9e316-0b5c-4db8-817d-f92df00215ae"
# no image here - already contains data from spl.img
}

View File

@@ -23,8 +23,8 @@ test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=t
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}"
# HassOS system A/B
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro rootwait"
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro rootwait"
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd ro rootwait"
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 ro rootwait"
part number ${devtype} ${devnum} hassos-boot boot_partnum

View File

@@ -1 +1 @@
console=tty0 console=ttyAML0,115200n8
console=ttyAML0,115200n8 console=tty0

View File

@@ -3,8 +3,6 @@
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local UBOOT_G12B="${BINARIES_DIR}/u-boot.g12b"
local SPL_IMG="$(path_spl_img)"
cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}"/*.dtb "${BOOT_DATA}/"
@@ -13,11 +11,6 @@ function hassos_pre_image() {
cp "${BINARIES_DIR}"/*.dtbo "${BOOT_DATA}/overlays/"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
# SPL
create_spl_image
dd if="${UBOOT_G12B}" of="${SPL_IMG}" conv=notrunc bs=512 seek=1
}

View File

@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}
hdimage {
partition-table-type = "none"
fill = "yes"
}
partition uboot {
offset = 512
image = "u-boot.g12b"
}
}

View File

@@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-N2"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=mbr
PARTITION_TABLE_TYPE=mbr
BOOT_SIZE=24M
BOOT_SPL=true
BOOT_SPL_SIZE=8M

View File

@@ -0,0 +1,7 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 512)"}
}

View File

@@ -25,8 +25,8 @@ test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=t
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}"
# HassOS system A/B
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
setenv bootargs_b "root=PARTUUID=48617373-08 rootfstype=squashfs ro rootwait"
setenv bootargs_a "root=PARTUUID=48617373-06 ro rootwait"
setenv bootargs_b "root=PARTUUID=48617373-08 ro rootwait"
# Load environment from haos-config.txt
if test -e mmc ${devnum}:1 haos-config.txt; then

View File

@@ -1 +1 @@
console=tty1 console=ttySAC2,115200
console=ttySAC2,115200 console=tty0

View File

@@ -3,24 +3,10 @@
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local BL1="${BINARIES_DIR}/bl1.bin.hardkernel"
local BL2="${BINARIES_DIR}/bl2.bin.hardkernel.720k_uboot"
local BLTZ="${BINARIES_DIR}/tzsw.bin.hardkernel"
local UBOOT="${BINARIES_DIR}/u-boot.bin"
local spl_img="$(path_spl_img)"
cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}/exynos5422-odroidxu4.dtb" "${BOOT_DATA}/exynos5422-odroidxu4.dtb"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
# SPL
create_spl_image
dd if="${BL1}" of="${spl_img}" conv=notrunc bs=512 seek=1
dd if="${BL2}" of="${spl_img}" conv=notrunc bs=512 seek=31
dd if="${UBOOT}" of="${spl_img}" conv=notrunc bs=512 seek=63
dd if="${BLTZ}" of="${spl_img}" conv=notrunc bs=512 seek=1503
dd if=/dev/zero of="${spl_img}" conv=notrunc bs=512 count=32 seek=2015
}

View File

@@ -0,0 +1,33 @@
image spl.img {
size = ${BOOT_SPL_SIZE}
hdimage {
partition-table-type = "none"
fill = "yes"
}
partition 0 {
size = 512
fill = "yes"
}
partition bl1 {
image = "bl1.bin.hardkernel"
holes = {"(15360; 15616)"} # last 256 bytes are overwritten by bl2
}
partition bl2 {
offset = 31s
image = "bl2.bin.hardkernel.720k_uboot"
}
partition uboot {
offset = 63s
image = "u-boot.bin"
}
partition tzsw {
offset = 1503s
image = "tzsw.bin.hardkernel"
}
}

View File

@@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-XU4"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=zImage
BOOT_SYS=mbr
PARTITION_TABLE_TYPE=mbr
BOOT_SIZE=24M
BOOT_SPL=true
BOOT_SPL_SIZE=8M

View File

@@ -0,0 +1,7 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(440; 512)"}
}

View File

@@ -27,8 +27,8 @@ test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=t
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}"
# HassOS system A/B
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
setenv bootargs_b "root=PARTUUID=48617373-08 rootfstype=squashfs ro rootwait"
setenv bootargs_a "root=PARTUUID=48617373-06 ro rootwait"
setenv bootargs_b "root=PARTUUID=48617373-08 ro rootwait"
# Load extraargs
fileenv mmc ${devnum}:1 ${ramdisk_addr_r} cmdline.txt cmdline

View File

@@ -0,0 +1,81 @@
From 024796cbf752d2e210341ae8609792803641eb92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <sairon@sairon.cz>
Date: Thu, 7 Nov 2024 12:39:02 +0100
Subject: [PATCH] HACK: mmc: meson-gx: limit f_max to 24 MHz on the first try
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
To initialize some eMMCs cards properly, ODROID N2 needed to have
maximum clock rate limited to 24 MHz. This was working good until ODROID
released eMMC modules with Kingson chips which do not initialize at the
limited frequency at all - instead it seems it's best for the if
no limit is set (which would result in using 52 MHz anyway).
Instead of hard-limiting the frequency, add a boolean flag that caps the
frequency to the proven 24 MHz, and if mmc_select_mode_and_width fails,
remove this cap and use f_max set to 100 MHz, as limited in upstream
U-Boot.
Signed-off-by: Jan Čermák <sairon@sairon.cz>
---
drivers/mmc/meson_gx_mmc.c | 2 ++
drivers/mmc/mmc.c | 11 +++++++++++
include/mmc.h | 2 ++
3 files changed, 15 insertions(+)
diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
index fcf4f03d1e..715dce3522 100644
--- a/drivers/mmc/meson_gx_mmc.c
+++ b/drivers/mmc/meson_gx_mmc.c
@@ -283,6 +283,8 @@ static int meson_mmc_probe(struct udevice *dev)
cfg->b_max = 511; /* max 512 - 1 blocks */
cfg->name = dev->name;
+ mmc->meson_gx_f_max_hack = true;
+
mmc->priv = pdata;
upriv->mmc = mmc;
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index d96db7a0f8..c8dc676612 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1652,6 +1652,10 @@ int mmc_set_clock(struct mmc *mmc, uint clock, bool disable)
clock = mmc->cfg->f_min;
}
+ /* Apply 24 MHz limit that fixes issues with some cards on meson. */
+ if (mmc->meson_gx_f_max_hack && clock > 24000000)
+ clock = 24000000;
+
mmc->clock = clock;
mmc->clk_disable = disable;
@@ -2647,6 +2651,13 @@ static int mmc_startup(struct mmc *mmc)
if (err)
return err;
err = mmc_select_mode_and_width(mmc, mmc->card_caps);
+ if (err && mmc->meson_gx_f_max_hack) {
+ /* Some eMMCs (namely Kingston) do not initialize at limited frequency. */
+ printf("Card failed to initialize at %d Hz, disabling meson_gx hack.\n",
+ mmc->clock);
+ mmc->meson_gx_f_max_hack = false;
+ err = mmc_select_mode_and_width(mmc, mmc->card_caps);
+ }
}
#endif
if (err)
diff --git a/include/mmc.h b/include/mmc.h
index 1022db3ffa..0ea48c6fd9 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -739,6 +739,8 @@ struct mmc {
u8 hs400_tuning;
enum bus_mode user_speed_mode; /* input speed mode from user */
+
+ bool meson_gx_f_max_hack;
};
#if CONFIG_IS_ENABLED(DM_MMC)

View File

@@ -1,26 +0,0 @@
From 11f015e13ef0442b6d2bb734954291abde415f73 Mon Sep 17 00:00:00 2001
From: Neil Armstrong <narmstrong@baylibre.com>
Date: Mon, 2 Sep 2019 15:42:04 +0200
Subject: [PATCH] HACK: mmc: meson-gx: limit to 24MHz
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
drivers/mmc/meson_gx_mmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
index fcf4f03d1e..6ded4b619b 100644
--- a/drivers/mmc/meson_gx_mmc.c
+++ b/drivers/mmc/meson_gx_mmc.c
@@ -279,7 +279,7 @@ static int meson_mmc_probe(struct udevice *dev)
cfg->host_caps = MMC_MODE_8BIT | MMC_MODE_4BIT |
MMC_MODE_HS_52MHz | MMC_MODE_HS;
cfg->f_min = DIV_ROUND_UP(SD_EMMC_CLKSRC_24M, CLK_MAX_DIV);
- cfg->f_max = 100000000; /* 100 MHz */
+ cfg->f_max = SD_EMMC_CLKSRC_24M;
cfg->b_max = 511; /* max 512 - 1 blocks */
cfg->name = dev->name;
--
2.43.0

View File

@@ -1 +1 @@
console=tty0 console=ttyAML0,115200n8
console=ttyAML0,115200n8 console=tty0

View File

@@ -3,20 +3,12 @@
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local UBOOT_GXL="${BINARIES_DIR}/u-boot.gxl"
local SPL_IMG="$(path_spl_img)"
cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}/meson-g12b-s922x-khadas-vim3.dtb" "${BOOT_DATA}/meson-g12b-s922x-khadas-vim3.dtb"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
# SPL
create_spl_image
dd if="${UBOOT_GXL}" of="${SPL_IMG}" conv=notrunc bs=1 count=444
dd if="${UBOOT_GXL}" of="${SPL_IMG}" conv=notrunc bs=512 skip=1 seek=1
}

View File

@@ -0,0 +1,16 @@
image spl.img {
size = ${BOOT_SPL_SIZE}
# FIXME: May not be necessary, but keeping it for now for binary-identical output
exec-post = "dd if=/dev/zero of=${BINARIES_DIR}/spl.img seek=444 count=68 bs=1 conv=notrunc"
hdimage {
partition-table-type = "none"
fill = "yes"
}
partition uboot {
offset = 0
image = "u-boot.gxl"
}
}

View File

@@ -3,7 +3,7 @@ BOARD_NAME="Khadas VIM3"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=mbr
PARTITION_TABLE_TYPE=mbr
BOOT_SIZE=24M
BOOT_SPL=true
BOOT_SPL_SIZE=8M

View File

@@ -0,0 +1,7 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(440; 512)"}
}

View File

@@ -25,8 +25,8 @@ test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=t
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}"
# HassOS system A/B
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
setenv bootargs_b "root=PARTUUID=48617373-08 rootfstype=squashfs ro rootwait"
setenv bootargs_a "root=PARTUUID=48617373-06 ro rootwait"
setenv bootargs_b "root=PARTUUID=48617373-08 ro rootwait"
# Load environment from haos-config.txt
if test -e mmc ${devnum}:1 haos-config.txt; then

View File

@@ -0,0 +1 @@
console=ttyS2,1500000n8 console=tty0

View File

@@ -3,18 +3,12 @@
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local SPL_IMG="$(path_spl_img)"
cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}"/*.dtb "${BOOT_DATA}/"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
# SPL
create_spl_image
dd if="${BINARIES_DIR}/u-boot-rockchip.bin" of="${SPL_IMG}" conv=notrunc bs=512 seek=64
}

View File

@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}
hdimage {
partition-table-type = "none"
fill = "yes"
}
partition uboot {
offset = 32k
image = "u-boot-rockchip.bin"
}
}

View File

@@ -3,7 +3,7 @@ BOARD_NAME="Home Assistant Green"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=gpt
PARTITION_TABLE_TYPE=hybrid
BOOT_SIZE=16M
BOOT_SPL=true
BOOT_SPL_SIZE=16M

View File

@@ -0,0 +1,7 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 17k)"}
}

View File

@@ -0,0 +1,58 @@
From 331826e0c52d6bdd65d862e06834f23b3a750276 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <sairon@sairon.cz>
Date: Wed, 12 Jun 2024 15:20:46 +0200
Subject: [PATCH] green: Do not use eMMC DDR52 mode, enable HS200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
There is a known issue on RK356x boards that the eMMC writing fails when
DDR52 mode is used. Disable this mode and other HS modes, keep only
HS200 which works reliably with the eMMC used on Green. For more details
see the upstream commit and mailing list discussion [1].
Also enable HS200 support in defconfig.
[1] https://patchwork.ozlabs.org/project/uboot/patch/20240204205312.2342868-2-jonas@kwiboo.se/
Signed-off-by: Jan Čermák <sairon@sairon.cz>
---
arch/arm/dts/rk3566-ha-green-u-boot.dtsi | 5 +----
configs/green_defconfig | 2 ++
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/rk3566-ha-green-u-boot.dtsi b/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
index 48d7b61513..8dc1585aac 100644
--- a/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
+++ b/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
@@ -71,10 +71,7 @@
&sdhci {
cap-mmc-highspeed;
- mmc-ddr-1_8v;
mmc-hs200-1_8v;
- mmc-hs400-1_8v;
- mmc-hs400-enhanced-strobe;
};
&sfc {
@@ -115,4 +112,4 @@
&vcc5v0_usb_host {
regulator-boot-on;
-};
\ No newline at end of file
+};
diff --git a/configs/green_defconfig b/configs/green_defconfig
index 71c9257d7d..7b5a705686 100644
--- a/configs/green_defconfig
+++ b/configs/green_defconfig
@@ -65,6 +65,8 @@ CONFIG_MISC=y
CONFIG_I2C_EEPROM=y
CONFIG_SYS_I2C_EEPROM_ADDR=0x0
CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_MMC_HS200_SUPPORT=y
+CONFIG_SPL_MMC_HS200_SUPPORT=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_SDHCI=y

View File

@@ -0,0 +1,52 @@
From d3fb1ec2364b20025d71e2263514a71208cfb61e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <sairon@sairon.cz>
Date: Tue, 13 Aug 2024 17:51:29 +0200
Subject: [PATCH] arch: arm64: dts: green: Improve LED representation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix color and use labels/node names according to the LEDs functionality.
Signed-off-by: Jan Čermák <sairon@sairon.cz>
Co-authored-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/dts/rk3566-ha-green.dts | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/rk3566-ha-green.dts b/arch/arm/dts/rk3566-ha-green.dts
index 68d836911e..c3adc59904 100644
--- a/arch/arm/dts/rk3566-ha-green.dts
+++ b/arch/arm/dts/rk3566-ha-green.dts
@@ -48,16 +48,18 @@
leds {
compatible = "gpio-leds";
- led_power: led-0 {
+ led_power: led-power {
+ label = "power";
gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
function = LED_FUNCTION_POWER;
- color = <LED_COLOR_ID_RED>;
+ color = <LED_COLOR_ID_WHITE>;
default-state = "keep";
linux,default-trigger = "default-on";
pinctrl-names = "default";
pinctrl-0 = <&led_power_pin>;
};
- led_act: led-1 {
+ led_act: led-activity {
+ label = "activity";
gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
function = LED_FUNCTION_ACTIVITY;
color = <LED_COLOR_ID_GREEN>;
@@ -65,7 +67,8 @@
pinctrl-names = "default";
pinctrl-0 = <&led_act_pin>;
};
- led_user: led-2 {
+ led_user: led-user {
+ label = "user";
gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
function = LED_FUNCTION_HEARTBEAT;
color = <LED_COLOR_ID_YELLOW>;

View File

@@ -27,9 +27,39 @@ test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=t
# HassOS bootargs
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 rootwait systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}"
i2c dev 0
setenv check_btn_pressed ' \
i2c read 0x20 0xf0.1 1 ${loadaddr}; \
setexpr PWRON_STS *${loadaddr} \\\& 0x80; \
test ${PWRON_STS} -eq 0x0;'
# Check if button is held for device wipe
setenv counter 0
while test ${counter} -lt 2; do
if run check_btn_pressed; then
echo "Reset button pressed for ${counter} seconds"
setexpr counter ${counter} + 1
if test ${counter} -eq 2; then
led user on
echo "Waiting for button to be released"
while run check_btn_pressed; do
sleep 0.5
done
echo "Proceeding with device wipe"
setenv bootargs_hassos "${bootargs_hassos} haos.wipe=1"
else
sleep 1
fi
else
# U-Boot has no break statement :')
setenv counter 2
fi
done
# HassOS system A/B
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro"
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro"
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd ro"
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 ro"
part number ${devtype} ${devnum} hassos-boot boot_partnum

View File

@@ -0,0 +1,3 @@
CONFIG_LED=y
CONFIG_LED_GPIO=y
CONFIG_CMD_LED=y

View File

@@ -1 +1 @@
console=tty1
console=tty0

View File

@@ -9,14 +9,10 @@ function hassos_pre_image() {
cp "${BOARD_DIR}/../grub.cfg" "${EFIPART_DATA}/EFI/BOOT/grub.cfg"
cp "${BOARD_DIR}/cmdline.txt" "${EFIPART_DATA}/cmdline.txt"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-A" create
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-A" set ORDER="A B"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-A" set A_OK=1
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-A" set A_TRY=0
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" create
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set ORDER="B A"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set B_OK=1
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set B_TRY=0
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" create
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set ORDER="A B"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set A_OK=1
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set A_TRY=0
cp -r "${EFIPART_DATA}/"* "${BOOT_DATA}/"
}

View File

@@ -172,3 +172,6 @@ CONFIG_DLN2_ADC=m
CONFIG_IIO=m
CONFIG_BMP280=m
# Required for some PCIe devices such as ath12k
CONFIG_IRQ_REMAP=y

View File

@@ -3,9 +3,9 @@ BOARD_NAME="Generic x86-64"
CHASSIS=embedded
BOOTLOADER=grub
KERNEL_FILE=bzImage
BOOT_SYS=efi
PARTITION_TABLE_TYPE=gpt
BOOT_SIZE=32M
BOOT_SPL=false
DISK_SIZE=6
DISK_SIZE=6G
SUPERVISOR_MACHINE=generic-x86-64
SUPERVISOR_ARCH=amd64

View File

@@ -77,9 +77,9 @@ menuentry "Slot B (OK=$B_OK TRY=$B_TRY)" {
}
menuentry "Slot A (rescue shell)" {
linux (${boothd},gpt2)/bzImage root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd $default_cmdline $cmdline rauc.slot=A systemd.unit=recovery.target
linux (${boothd},gpt2)/bzImage root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd $default_cmdline $cmdline rauc.slot=A systemd.unit=recovery.target debug
}
menuentry "Slot B (rescue shell)" {
linux (${boothd},gpt4)/bzImage root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 $default_cmdline $cmdline rauc.slot=B systemd.unit=recovery.target
linux (${boothd},gpt4)/bzImage root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 $default_cmdline $cmdline rauc.slot=B systemd.unit=recovery.target debug
}

View File

@@ -1 +1 @@
console=ttyS0 console=tty1
console=ttyS0 console=tty0

View File

@@ -9,14 +9,10 @@ function hassos_pre_image() {
cp "${BOARD_DIR}/../grub.cfg" "${EFIPART_DATA}/EFI/BOOT/grub.cfg"
cp "${BOARD_DIR}/cmdline.txt" "${EFIPART_DATA}/cmdline.txt"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-A" create
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-A" set ORDER="A B"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-A" set A_OK=1
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-A" set A_TRY=0
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" create
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set ORDER="B A"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set B_OK=1
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set B_TRY=0
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" create
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set ORDER="A B"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set A_OK=1
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set A_TRY=0
cp -r "${EFIPART_DATA}/"* "${BOOT_DATA}/"
}

View File

@@ -124,4 +124,19 @@ CONFIG_DWMAC_INTEL=m
CONFIG_I6300ESB_WDT=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=m
CONFIG_I2C_MUX=y
CONFIG_I2C_TINY_USB=m
CONFIG_I2C_DLN2=m
CONFIG_GPIO_DLN2=m
CONFIG_MFD_DLN2=m
CONFIG_DLN2_ADC=m
CONFIG_IIO=m
CONFIG_BMP280=m
# Required for some PCIe devices such as ath12k
CONFIG_IRQ_REMAP=y

View File

@@ -3,9 +3,9 @@ BOARD_NAME="Open Virtual Appliance"
CHASSIS=vm
BOOTLOADER=grub
KERNEL_FILE=bzImage
BOOT_SYS=efi
PARTITION_TABLE_TYPE=gpt
BOOT_SIZE=32M
BOOT_SPL=false
DISK_SIZE=32
DISK_SIZE=32G
SUPERVISOR_MACHINE=qemux86-64
SUPERVISOR_ARCH=amd64

View File

@@ -1 +1 @@
dwc_otg.lpm_enable=0 console=tty1 usb-storage.quirks=174c:55aa:u,2109:0715:u,152d:0578:u,152d:0579:u,152d:1561:u,174c:0829:u,14b0:0206:u,174c:225c:u,7825:a2a4:u,152d:0562:u
dwc_otg.lpm_enable=0 console=tty0 usb-storage.quirks=174c:55aa:u,2109:0715:u,152d:0578:u,152d:0579:u,152d:1561:u,174c:0829:u,14b0:0206:u,174c:225c:u,7825:a2a4:u,152d:0562:u,125f:a88a:u,152d:a583:u

View File

@@ -1,5 +1,4 @@
From 57188c09ac02bfa61cce55932ccba43ec7210e54 Mon Sep 17 00:00:00 2001
Message-Id: <57188c09ac02bfa61cce55932ccba43ec7210e54.1677499675.git.stefan@agner.ch>
From e2f2644f306f44e65bb8082bac3c26cb5e699664 Mon Sep 17 00:00:00 2001
From: Pascal Vizeli <pvizeli@syshack.ch>
Date: Tue, 2 Jun 2020 21:20:08 +0000
Subject: [PATCH] ARM: dts: bcm283x: add compatible picked up by U-Boot
@@ -12,14 +11,14 @@ not using that compatible string.
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/bcm2711.dtsi | 8 ++++----
arch/arm/boot/dts/bcm283x.dtsi | 2 +-
arch/arm/boot/dts/broadcom/bcm2711.dtsi | 8 ++++----
arch/arm/boot/dts/broadcom/bcm283x.dtsi | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
index 941c4d16791b..3cd49fa4bafd 100644
--- a/arch/arm/boot/dts/bcm2711.dtsi
+++ b/arch/arm/boot/dts/bcm2711.dtsi
diff --git a/arch/arm/boot/dts/broadcom/bcm2711.dtsi b/arch/arm/boot/dts/broadcom/bcm2711.dtsi
index 4a379a14966d8..30f6ccdcef178 100644
--- a/arch/arm/boot/dts/broadcom/bcm2711.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm2711.dtsi
@@ -128,7 +128,7 @@ rng@7e104000 {
};
@@ -56,11 +55,11 @@ index 941c4d16791b..3cd49fa4bafd 100644
reg = <0x7e201a00 0x200>;
interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clocks BCM2835_CLOCK_UART>,
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index d2d9c6e67f39..7b9a2e8cf529 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -302,7 +302,7 @@ uart1_ctsrts_gpio42: uart1_ctsrts_gpio42 {
diff --git a/arch/arm/boot/dts/broadcom/bcm283x.dtsi b/arch/arm/boot/dts/broadcom/bcm283x.dtsi
index 2ca8a2505a4db..6f91c85677d89 100644
--- a/arch/arm/boot/dts/broadcom/bcm283x.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm283x.dtsi
@@ -302,7 +302,7 @@ uart1_ctsrts_gpio42: uart1-ctsrts-gpio42 {
};
uart0: serial@7e201000 {
@@ -69,6 +68,3 @@ index d2d9c6e67f39..7b9a2e8cf529 100644
reg = <0x7e201000 0x200>;
interrupts = <2 25>;
clocks = <&clocks BCM2835_CLOCK_UART>,
--
2.39.1

View File

@@ -1,677 +0,0 @@
From 74c48f9493b3e95ec1f76b92b88061194c1874fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <sairon@sairon.cz>
Date: Mon, 4 Mar 2024 13:52:34 +0100
Subject: [PATCH] Revert USB core changes causing issues with Z-Wave.me UZB
stick
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Workaround for issues described on GH [1] and reported in [2].
* Revert "USB: core: Fix oversight in SuperSpeed initialization"
This reverts commit f705617bab4766567874715eeed1b39dacb58671.
* Revert "USB: core: Fix race by not overwriting udev->descriptor in hub_port_init()"
This reverts commit 8186596a663506b1124bede9fde6f243ef9f37ee.
* Revert "USB: core: Change usb_get_device_descriptor() API"
This reverts commit d309fa69c2e3c5e6134ac9386f833f683e66ad1a.
* Revert "USB: core: Unite old scheme and new scheme descriptor reads"
This reverts commit 90b01f8df56844cb4ac8f188eed92a5ee866020a.
[1] https://github.com/home-assistant/operating-system/issues/2995
[2] https://lore.kernel.org/linux-usb/1e954652-dfb3-4248-beea-b8a449128ff0@sairon.cz/
Signed-off-by: Jan Čermák <sairon@sairon.cz>
---
drivers/usb/core/hcd.c | 10 +-
drivers/usb/core/hub.c | 349 ++++++++++++++++---------------------
drivers/usb/core/message.c | 29 +--
drivers/usb/core/usb.h | 4 +-
4 files changed, 169 insertions(+), 223 deletions(-)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index be96045e4d6e3..4e240151c06af 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -983,7 +983,6 @@ static int register_root_hub(struct usb_hcd *hcd)
{
struct device *parent_dev = hcd->self.controller;
struct usb_device *usb_dev = hcd->self.root_hub;
- struct usb_device_descriptor *descr;
const int devnum = 1;
int retval;
@@ -995,16 +994,13 @@ static int register_root_hub(struct usb_hcd *hcd)
mutex_lock(&usb_bus_idr_lock);
usb_dev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
- descr = usb_get_device_descriptor(usb_dev);
- if (IS_ERR(descr)) {
- retval = PTR_ERR(descr);
+ retval = usb_get_device_descriptor(usb_dev, USB_DT_DEVICE_SIZE);
+ if (retval != sizeof usb_dev->descriptor) {
mutex_unlock(&usb_bus_idr_lock);
dev_dbg (parent_dev, "can't read %s device descriptor %d\n",
dev_name(&usb_dev->dev), retval);
- return retval;
+ return (retval < 0) ? retval : -EMSGSIZE;
}
- usb_dev->descriptor = *descr;
- kfree(descr);
if (le16_to_cpu(usb_dev->descriptor.bcdUSB) >= 0x0201) {
retval = usb_get_bos_descriptor(usb_dev);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 574b8104a8199..708b63bcd38af 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2664,17 +2664,12 @@ int usb_authorize_device(struct usb_device *usb_dev)
}
if (usb_dev->wusb) {
- struct usb_device_descriptor *descr;
-
- descr = usb_get_device_descriptor(usb_dev);
- if (IS_ERR(descr)) {
- result = PTR_ERR(descr);
+ result = usb_get_device_descriptor(usb_dev, sizeof(usb_dev->descriptor));
+ if (result < 0) {
dev_err(&usb_dev->dev, "can't re-read device descriptor for "
"authorization: %d\n", result);
goto error_device_descriptor;
}
- usb_dev->descriptor = *descr;
- kfree(descr);
}
usb_dev->authorized = 1;
@@ -4685,67 +4680,6 @@ static int hub_enable_device(struct usb_device *udev)
return hcd->driver->enable_device(hcd, udev);
}
-/*
- * Get the bMaxPacketSize0 value during initialization by reading the
- * device's device descriptor. Since we don't already know this value,
- * the transfer is unsafe and it ignores I/O errors, only testing for
- * reasonable received values.
- *
- * For "old scheme" initialization, size will be 8 so we read just the
- * start of the device descriptor, which should work okay regardless of
- * the actual bMaxPacketSize0 value. For "new scheme" initialization,
- * size will be 64 (and buf will point to a sufficiently large buffer),
- * which might not be kosher according to the USB spec but it's what
- * Windows does and what many devices expect.
- *
- * Returns: bMaxPacketSize0 or a negative error code.
- */
-static int get_bMaxPacketSize0(struct usb_device *udev,
- struct usb_device_descriptor *buf, int size, bool first_time)
-{
- int i, rc;
-
- /*
- * Retry on all errors; some devices are flakey.
- * 255 is for WUSB devices, we actually need to use
- * 512 (WUSB1.0[4.8.1]).
- */
- for (i = 0; i < GET_MAXPACKET0_TRIES; ++i) {
- /* Start with invalid values in case the transfer fails */
- buf->bDescriptorType = buf->bMaxPacketSize0 = 0;
- rc = usb_control_msg(udev, usb_rcvaddr0pipe(),
- USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
- USB_DT_DEVICE << 8, 0,
- buf, size,
- initial_descriptor_timeout);
- switch (buf->bMaxPacketSize0) {
- case 8: case 16: case 32: case 64: case 9:
- if (buf->bDescriptorType == USB_DT_DEVICE) {
- rc = buf->bMaxPacketSize0;
- break;
- }
- fallthrough;
- default:
- if (rc >= 0)
- rc = -EPROTO;
- break;
- }
-
- /*
- * Some devices time out if they are powered on
- * when already connected. They need a second
- * reset, so return early. But only on the first
- * attempt, lest we get into a time-out/reset loop.
- */
- if (rc > 0 || (rc == -ETIMEDOUT && first_time &&
- udev->speed > USB_SPEED_FULL))
- break;
- }
- return rc;
-}
-
-#define GET_DESCRIPTOR_BUFSIZE 64
-
/* Reset device, (re)assign address, get device descriptor.
* Device connection must be stable, no more debouncing needed.
* Returns device in USB_STATE_ADDRESS, except on error.
@@ -4755,17 +4689,10 @@ static int get_bMaxPacketSize0(struct usb_device *udev,
* the port lock. For a newly detected device that is not accessible
* through any global pointers, it's not necessary to lock the device,
* but it is still necessary to lock the port.
- *
- * For a newly detected device, @dev_descr must be NULL. The device
- * descriptor retrieved from the device will then be stored in
- * @udev->descriptor. For an already existing device, @dev_descr
- * must be non-NULL. The device descriptor will be stored there,
- * not in @udev->descriptor, because descriptors for registered
- * devices are meant to be immutable.
*/
static int
hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
- int retry_counter, struct usb_device_descriptor *dev_descr)
+ int retry_counter)
{
struct usb_device *hdev = hub->hdev;
struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
@@ -4777,13 +4704,6 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
int devnum = udev->devnum;
const char *driver_name;
bool do_new_scheme;
- const bool initial = !dev_descr;
- int maxp0;
- struct usb_device_descriptor *buf, *descr;
-
- buf = kmalloc(GET_DESCRIPTOR_BUFSIZE, GFP_NOIO);
- if (!buf)
- return -ENOMEM;
/* root hub ports have a slightly longer reset period
* (from USB 2.0 spec, section 7.1.7.5)
@@ -4816,34 +4736,32 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
}
oldspeed = udev->speed;
- if (initial) {
- /* USB 2.0 section 5.5.3 talks about ep0 maxpacket ...
- * it's fixed size except for full speed devices.
- * For Wireless USB devices, ep0 max packet is always 512 (tho
- * reported as 0xff in the device descriptor). WUSB1.0[4.8.1].
+ /* USB 2.0 section 5.5.3 talks about ep0 maxpacket ...
+ * it's fixed size except for full speed devices.
+ * For Wireless USB devices, ep0 max packet is always 512 (tho
+ * reported as 0xff in the device descriptor). WUSB1.0[4.8.1].
+ */
+ switch (udev->speed) {
+ case USB_SPEED_SUPER_PLUS:
+ case USB_SPEED_SUPER:
+ case USB_SPEED_WIRELESS: /* fixed at 512 */
+ udev->ep0.desc.wMaxPacketSize = cpu_to_le16(512);
+ break;
+ case USB_SPEED_HIGH: /* fixed at 64 */
+ udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
+ break;
+ case USB_SPEED_FULL: /* 8, 16, 32, or 64 */
+ /* to determine the ep0 maxpacket size, try to read
+ * the device descriptor to get bMaxPacketSize0 and
+ * then correct our initial guess.
*/
- switch (udev->speed) {
- case USB_SPEED_SUPER_PLUS:
- case USB_SPEED_SUPER:
- case USB_SPEED_WIRELESS: /* fixed at 512 */
- udev->ep0.desc.wMaxPacketSize = cpu_to_le16(512);
- break;
- case USB_SPEED_HIGH: /* fixed at 64 */
- udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
- break;
- case USB_SPEED_FULL: /* 8, 16, 32, or 64 */
- /* to determine the ep0 maxpacket size, try to read
- * the device descriptor to get bMaxPacketSize0 and
- * then correct our initial guess.
- */
- udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
- break;
- case USB_SPEED_LOW: /* fixed at 8 */
- udev->ep0.desc.wMaxPacketSize = cpu_to_le16(8);
- break;
- default:
- goto fail;
- }
+ udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
+ break;
+ case USB_SPEED_LOW: /* fixed at 8 */
+ udev->ep0.desc.wMaxPacketSize = cpu_to_le16(8);
+ break;
+ default:
+ goto fail;
}
if (udev->speed == USB_SPEED_WIRELESS)
@@ -4866,24 +4784,22 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
if (udev->speed < USB_SPEED_SUPER)
dev_info(&udev->dev,
"%s %s USB device number %d using %s\n",
- (initial ? "new" : "reset"), speed,
+ (udev->config) ? "reset" : "new", speed,
devnum, driver_name);
- if (initial) {
- /* Set up TT records, if needed */
- if (hdev->tt) {
- udev->tt = hdev->tt;
- udev->ttport = hdev->ttport;
- } else if (udev->speed != USB_SPEED_HIGH
- && hdev->speed == USB_SPEED_HIGH) {
- if (!hub->tt.hub) {
- dev_err(&udev->dev, "parent hub has no TT\n");
- retval = -EINVAL;
- goto fail;
- }
- udev->tt = &hub->tt;
- udev->ttport = port1;
+ /* Set up TT records, if needed */
+ if (hdev->tt) {
+ udev->tt = hdev->tt;
+ udev->ttport = hdev->ttport;
+ } else if (udev->speed != USB_SPEED_HIGH
+ && hdev->speed == USB_SPEED_HIGH) {
+ if (!hub->tt.hub) {
+ dev_err(&udev->dev, "parent hub has no TT\n");
+ retval = -EINVAL;
+ goto fail;
}
+ udev->tt = &hub->tt;
+ udev->ttport = port1;
}
/* Why interleave GET_DESCRIPTOR and SET_ADDRESS this way?
@@ -4902,6 +4818,9 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
for (retries = 0; retries < GET_DESCRIPTOR_TRIES; (++retries, msleep(100))) {
if (do_new_scheme) {
+ struct usb_device_descriptor *buf;
+ int r = 0;
+
retval = hub_enable_device(udev);
if (retval < 0) {
dev_err(&udev->dev,
@@ -4910,14 +4829,52 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
goto fail;
}
- maxp0 = get_bMaxPacketSize0(udev, buf,
- GET_DESCRIPTOR_BUFSIZE, retries == 0);
- if (maxp0 > 0 && !initial &&
- maxp0 != udev->descriptor.bMaxPacketSize0) {
- dev_err(&udev->dev, "device reset changed ep0 maxpacket size!\n");
- retval = -ENODEV;
- goto fail;
+#define GET_DESCRIPTOR_BUFSIZE 64
+ buf = kmalloc(GET_DESCRIPTOR_BUFSIZE, GFP_NOIO);
+ if (!buf) {
+ retval = -ENOMEM;
+ continue;
+ }
+
+ /* Retry on all errors; some devices are flakey.
+ * 255 is for WUSB devices, we actually need to use
+ * 512 (WUSB1.0[4.8.1]).
+ */
+ for (operations = 0; operations < GET_MAXPACKET0_TRIES;
+ ++operations) {
+ buf->bMaxPacketSize0 = 0;
+ r = usb_control_msg(udev, usb_rcvaddr0pipe(),
+ USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
+ USB_DT_DEVICE << 8, 0,
+ buf, GET_DESCRIPTOR_BUFSIZE,
+ initial_descriptor_timeout);
+ switch (buf->bMaxPacketSize0) {
+ case 8: case 16: case 32: case 64: case 255:
+ if (buf->bDescriptorType ==
+ USB_DT_DEVICE) {
+ r = 0;
+ break;
+ }
+ fallthrough;
+ default:
+ if (r == 0)
+ r = -EPROTO;
+ break;
+ }
+ /*
+ * Some devices time out if they are powered on
+ * when already connected. They need a second
+ * reset. But only on the first attempt,
+ * lest we get into a time out/reset loop
+ */
+ if (r == 0 || (r == -ETIMEDOUT &&
+ retries == 0 &&
+ udev->speed > USB_SPEED_FULL))
+ break;
}
+ udev->descriptor.bMaxPacketSize0 =
+ buf->bMaxPacketSize0;
+ kfree(buf);
retval = hub_port_reset(hub, port1, udev, delay, false);
if (retval < 0) /* error or disconnect */
@@ -4928,13 +4885,14 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
retval = -ENODEV;
goto fail;
}
- if (maxp0 < 0) {
- if (maxp0 != -ENODEV)
+ if (r) {
+ if (r != -ENODEV)
dev_err(&udev->dev, "device descriptor read/64, error %d\n",
- maxp0);
- retval = maxp0;
+ r);
+ retval = -EMSGSIZE;
continue;
}
+#undef GET_DESCRIPTOR_BUFSIZE
}
/*
@@ -4980,22 +4938,18 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
break;
}
- /* !do_new_scheme || wusb */
- maxp0 = get_bMaxPacketSize0(udev, buf, 8, retries == 0);
- if (maxp0 < 0) {
- retval = maxp0;
+ retval = usb_get_device_descriptor(udev, 8);
+ if (retval < 8) {
if (retval != -ENODEV)
dev_err(&udev->dev,
"device descriptor read/8, error %d\n",
retval);
+ if (retval >= 0)
+ retval = -EMSGSIZE;
} else {
u32 delay;
- if (!initial && maxp0 != udev->descriptor.bMaxPacketSize0) {
- dev_err(&udev->dev, "device reset changed ep0 maxpacket size!\n");
- retval = -ENODEV;
- goto fail;
- }
+ retval = 0;
delay = udev->parent->hub_delay;
udev->hub_delay = min_t(u32, delay,
@@ -5014,61 +4968,48 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
goto fail;
/*
- * Check the ep0 maxpacket guess and correct it if necessary.
- * maxp0 is the value stored in the device descriptor;
- * i is the value it encodes (logarithmic for SuperSpeed or greater).
+ * Some superspeed devices have finished the link training process
+ * and attached to a superspeed hub port, but the device descriptor
+ * got from those devices show they aren't superspeed devices. Warm
+ * reset the port attached by the devices can fix them.
*/
- i = maxp0;
- if (udev->speed >= USB_SPEED_SUPER) {
- if (maxp0 <= 16)
- i = 1 << maxp0;
- else
- i = 0; /* Invalid */
- }
- if (usb_endpoint_maxp(&udev->ep0.desc) == i) {
- ; /* Initial ep0 maxpacket guess is right */
- } else if ((udev->speed == USB_SPEED_FULL ||
- udev->speed == USB_SPEED_HIGH) &&
- (i == 8 || i == 16 || i == 32 || i == 64)) {
- /* Initial guess is wrong; use the descriptor's value */
+ if ((udev->speed >= USB_SPEED_SUPER) &&
+ (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0300)) {
+ dev_err(&udev->dev, "got a wrong device descriptor, "
+ "warm reset device\n");
+ hub_port_reset(hub, port1, udev,
+ HUB_BH_RESET_TIME, true);
+ retval = -EINVAL;
+ goto fail;
+ }
+
+ if (udev->descriptor.bMaxPacketSize0 == 0xff ||
+ udev->speed >= USB_SPEED_SUPER)
+ i = 512;
+ else
+ i = udev->descriptor.bMaxPacketSize0;
+ if (usb_endpoint_maxp(&udev->ep0.desc) != i) {
+ if (udev->speed == USB_SPEED_LOW ||
+ !(i == 8 || i == 16 || i == 32 || i == 64)) {
+ dev_err(&udev->dev, "Invalid ep0 maxpacket: %d\n", i);
+ retval = -EMSGSIZE;
+ goto fail;
+ }
if (udev->speed == USB_SPEED_FULL)
dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
else
dev_warn(&udev->dev, "Using ep0 maxpacket: %d\n", i);
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
usb_ep0_reinit(udev);
- } else {
- /* Initial guess is wrong and descriptor's value is invalid */
- dev_err(&udev->dev, "Invalid ep0 maxpacket: %d\n", maxp0);
- retval = -EMSGSIZE;
- goto fail;
}
- descr = usb_get_device_descriptor(udev);
- if (IS_ERR(descr)) {
- retval = PTR_ERR(descr);
+ retval = usb_get_device_descriptor(udev, USB_DT_DEVICE_SIZE);
+ if (retval < (signed)sizeof(udev->descriptor)) {
if (retval != -ENODEV)
dev_err(&udev->dev, "device descriptor read/all, error %d\n",
retval);
- goto fail;
- }
- if (initial)
- udev->descriptor = *descr;
- else
- *dev_descr = *descr;
- kfree(descr);
-
- /*
- * Some superspeed devices have finished the link training process
- * and attached to a superspeed hub port, but the device descriptor
- * got from those devices show they aren't superspeed devices. Warm
- * reset the port attached by the devices can fix them.
- */
- if ((udev->speed >= USB_SPEED_SUPER) &&
- (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0300)) {
- dev_err(&udev->dev, "got a wrong device descriptor, warm reset device\n");
- hub_port_reset(hub, port1, udev, HUB_BH_RESET_TIME, true);
- retval = -EINVAL;
+ if (retval >= 0)
+ retval = -ENOMSG;
goto fail;
}
@@ -5094,7 +5035,6 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
hub_port_disable(hub, port1, 0);
update_devnum(udev, devnum); /* for disconnect processing */
}
- kfree(buf);
return retval;
}
@@ -5175,7 +5115,7 @@ hub_power_remaining(struct usb_hub *hub)
static int descriptors_changed(struct usb_device *udev,
- struct usb_device_descriptor *new_device_descriptor,
+ struct usb_device_descriptor *old_device_descriptor,
struct usb_host_bos *old_bos)
{
int changed = 0;
@@ -5186,8 +5126,8 @@ static int descriptors_changed(struct usb_device *udev,
int length;
char *buf;
- if (memcmp(&udev->descriptor, new_device_descriptor,
- sizeof(*new_device_descriptor)) != 0)
+ if (memcmp(&udev->descriptor, old_device_descriptor,
+ sizeof(*old_device_descriptor)) != 0)
return 1;
if ((old_bos && !udev->bos) || (!old_bos && udev->bos))
@@ -5360,7 +5300,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
}
/* reset (non-USB 3.0 devices) and get descriptor */
- status = hub_port_init(hub, udev, port1, i, NULL);
+ status = hub_port_init(hub, udev, port1, i);
if (status < 0)
goto loop;
@@ -5507,8 +5447,9 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
{
struct usb_port *port_dev = hub->ports[port1 - 1];
struct usb_device *udev = port_dev->child;
- struct usb_device_descriptor *descr;
+ struct usb_device_descriptor descriptor;
int status = -ENODEV;
+ int retval;
dev_dbg(&port_dev->dev, "status %04x, change %04x, %s\n", portstatus,
portchange, portspeed(hub, portstatus));
@@ -5535,20 +5476,23 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
* changed device descriptors before resuscitating the
* device.
*/
- descr = usb_get_device_descriptor(udev);
- if (IS_ERR(descr)) {
+ descriptor = udev->descriptor;
+ retval = usb_get_device_descriptor(udev,
+ sizeof(udev->descriptor));
+ if (retval < 0) {
dev_dbg(&udev->dev,
- "can't read device descriptor %ld\n",
- PTR_ERR(descr));
+ "can't read device descriptor %d\n",
+ retval);
} else {
- if (descriptors_changed(udev, descr,
+ if (descriptors_changed(udev, &descriptor,
udev->bos)) {
dev_dbg(&udev->dev,
"device descriptor has changed\n");
+ /* for disconnect() calls */
+ udev->descriptor = descriptor;
} else {
status = 0; /* Nothing to do */
}
- kfree(descr);
}
#ifdef CONFIG_PM
} else if (udev->state == USB_STATE_SUSPENDED &&
@@ -5986,7 +5930,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
struct usb_device *parent_hdev = udev->parent;
struct usb_hub *parent_hub;
struct usb_hcd *hcd = bus_to_hcd(udev->bus);
- struct usb_device_descriptor descriptor;
+ struct usb_device_descriptor descriptor = udev->descriptor;
struct usb_host_bos *bos;
int i, j, ret = 0;
int port1 = udev->portnum;
@@ -6018,7 +5962,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
/* ep0 maxpacket size may change; let the HCD know about it.
* Other endpoints will be handled by re-enumeration. */
usb_ep0_reinit(udev);
- ret = hub_port_init(parent_hub, udev, port1, i, &descriptor);
+ ret = hub_port_init(parent_hub, udev, port1, i);
if (ret >= 0 || ret == -ENOTCONN || ret == -ENODEV)
break;
}
@@ -6030,6 +5974,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
/* Device might have changed firmware (DFU or similar) */
if (descriptors_changed(udev, &descriptor, bos)) {
dev_info(&udev->dev, "device firmware changed\n");
+ udev->descriptor = descriptor; /* for disconnect() calls */
goto re_enumerate;
}
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 678c43234d65f..e8045997d6ec2 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1039,35 +1039,40 @@ char *usb_cache_string(struct usb_device *udev, int index)
}
/*
- * usb_get_device_descriptor - read the device descriptor
- * @udev: the device whose device descriptor should be read
+ * usb_get_device_descriptor - (re)reads the device descriptor (usbcore)
+ * @dev: the device whose device descriptor is being updated
+ * @size: how much of the descriptor to read
*
* Context: task context, might sleep.
*
+ * Updates the copy of the device descriptor stored in the device structure,
+ * which dedicates space for this purpose.
+ *
* Not exported, only for use by the core. If drivers really want to read
* the device descriptor directly, they can call usb_get_descriptor() with
* type = USB_DT_DEVICE and index = 0.
*
- * Returns: a pointer to a dynamically allocated usb_device_descriptor
- * structure (which the caller must deallocate), or an ERR_PTR value.
+ * This call is synchronous, and may not be used in an interrupt context.
+ *
+ * Return: The number of bytes received on success, or else the status code
+ * returned by the underlying usb_control_msg() call.
*/
-struct usb_device_descriptor *usb_get_device_descriptor(struct usb_device *udev)
+int usb_get_device_descriptor(struct usb_device *dev, unsigned int size)
{
struct usb_device_descriptor *desc;
int ret;
+ if (size > sizeof(*desc))
+ return -EINVAL;
desc = kmalloc(sizeof(*desc), GFP_NOIO);
if (!desc)
- return ERR_PTR(-ENOMEM);
-
- ret = usb_get_descriptor(udev, USB_DT_DEVICE, 0, desc, sizeof(*desc));
- if (ret == sizeof(*desc))
- return desc;
+ return -ENOMEM;
+ ret = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, size);
if (ret >= 0)
- ret = -EMSGSIZE;
+ memcpy(&dev->descriptor, desc, size);
kfree(desc);
- return ERR_PTR(ret);
+ return ret;
}
/*
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index 3bb2e1db42b5d..82538daac8b89 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -42,8 +42,8 @@ extern bool usb_endpoint_is_ignored(struct usb_device *udev,
struct usb_endpoint_descriptor *epd);
extern int usb_remove_device(struct usb_device *udev);
-extern struct usb_device_descriptor *usb_get_device_descriptor(
- struct usb_device *udev);
+extern int usb_get_device_descriptor(struct usb_device *dev,
+ unsigned int size);
extern int usb_set_isoch_delay(struct usb_device *dev);
extern int usb_get_bos_descriptor(struct usb_device *dev);
extern void usb_release_bos_descriptor(struct usb_device *dev);
--
2.37.3

View File

@@ -0,0 +1,30 @@
From 8b7bfad7fda35949975f359c7e207bc57bc765db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <sairon@sairon.cz>
Date: Mon, 15 Apr 2024 14:07:34 +0200
Subject: [PATCH] USB: storage: Increase maximum length of the quirks string
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Maximum length of the quirks string is 127 characters which is not sufficient
for the already long list of quirky controllers in HAOS. Increase the size of
the quirks variable to allow up to 255 characters.
Signed-off-by: Jan Čermák <sairon@sairon.cz>
---
drivers/usb/storage/usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 7b36a3334fb34..9691e6b9fe5aa 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -71,7 +71,7 @@ static unsigned int delay_use = 1;
module_param(delay_use, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(delay_use, "seconds to delay before using a new device");
-static char quirks[128];
+static char quirks[256];
module_param_string(quirks, quirks, sizeof(quirks), S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(quirks, "supplemental list of device IDs and their quirks");

Some files were not shown because too many files have changed in this diff Show More