Compare commits

...

636 Commits
4.2 ... 8.2

Author SHA1 Message Date
Stefan Agner
da4ba283bb Bump version to 8.2 2022-06-08 22:34:41 +02:00
Stefan Agner
909b66eed3 Increase maximum socket receive and send buffer size (#1964) (#1968)
Some applications try to increase the buffers for performance reason. The
QUIC Go implementation for instance tries to request a 2048 kiB buffer
size.

The kernel default depends on skubuf size (which is architecture
dependent), but it is memory size independet and typically around 200 kiB
(see [1]).

Other network tuning guides suggest 16MiB for 1GB ethernet, as well as
changing the default as well as maximum bufffer size (see [2]). This
conservatively increases the maximum buffer size to 4MiB.

[1]: https://elixir.bootlin.com/linux/v5.15.45/source/include/net/sock.h#L2742
[2]: https://nateware.com/2013/04/06/linux-network-tuning-for-2013/
2022-06-08 22:34:17 +02:00
Stefan Agner
091b4e3a9a Linux: Update kernel 5.15.45 (#1967) 2022-06-08 22:34:11 +02:00
Stefan Agner
72b3c46bfc Bump buildroot (#1958)
* buildroot 2eebdbad5c...7995541510 (1):
  > Merge tag '2022.02.2' into 2022.02.x-haos
2022-06-08 22:34:01 +02:00
Stefan Agner
306c07b1b1 NVMe patches are applied for all Raspberry Pi based boards now (#1959) 2022-06-08 22:33:48 +02:00
Stefan Agner
ad2f3a3570 Apply NVMe fixes to all Raspberry Pi boards (#1911) (#1957) 2022-06-08 22:33:40 +02:00
Stefan Agner
083d894c50 Linux: Update kernel 5.15.44 (#1951) 2022-06-08 22:33:16 +02:00
Stefan Agner
b4edaef3ba Bump version to 8.1 2022-05-19 21:47:50 +02:00
Stefan Agner
def80b9bbc Make NTP dispatch script executable (#1798) (#1933)
* Make NTP dispatch script executable (#1798)

* Address shellcheck issues
2022-05-19 21:47:50 +02:00
Stefan Agner
9856c9523b Bump buildroot (#1932)
* buildroot de7aa15c65...2eebdbad5c (1):
  > package/openvmtools: Allow build on AArch64
2022-05-19 18:02:48 +02:00
Stefan Agner
c01297a0e5 Avoid using simplefb for generic-x86-64 to fix boot crashes (#1920) (#1930) 2022-05-19 16:37:19 +02:00
Stefan Agner
bcf2adac53 Align GRUB2 disk read buffers to block size to fix boot issues (#1912) (#1929) 2022-05-19 16:37:19 +02:00
Stefan Agner
4305ab6bbd Linux: Update kernel 5.15.41 (#1928) 2022-05-19 16:37:19 +02:00
Jens Maus
882c4a0252 Updat generic_raw_uart packeg to 1.26 to fix issues with HB-RF-USB-2 and HB-RF-ETH (#1927) 2022-05-19 16:37:19 +02:00
Stefan Agner
94662c545a Add NVMe boot support to Generic AArch64 (#1050) (#1918) 2022-05-19 16:37:19 +02:00
Stefan Agner
e90379e2b8 Add open-vm-tools to AArch64 for better VMware support (#1050) (#1915)
* Add open-vm-tools to AArch64 for better VMware support (#1050)

* Bump buildroot

* buildroot 666868435d...de7aa15c65 (1):
  > package/openvmtools: bump version to 11.3.5
2022-05-19 16:37:19 +02:00
Greg Kroah-Hartman
07f2f140a1 Linux: Update kernel 5.15.40 (#1907)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-19 16:37:19 +02:00
Jens Maus
d078152a1c Update qemu-guest-agent to 7.0.0 for improved agent functionality (#1904) 2022-05-19 16:37:19 +02:00
Jens Maus
7f8a74f3d6 Update RPI-RF-MOD/HM-MOD-RPI-PCB/HmIP-RFUSB related packages (#1901) 2022-05-19 16:37:18 +02:00
sol
0eb42d8495 Add support for rtl8821cu WiFi Dongle (#1899)
* Add rtl8821cu driver

* buildroot ee56159464...666868435d (1):
  > Merge pull request #2 from s-ol/fix-usb_modeswitch-systemd

* Add rtl8821cu support to all boards

Signed-off-by: s-ol <s+removethis@s-ol.nu>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2022-05-19 16:37:18 +02:00
Stefan Agner
d8bf7a67a5 Add support RTL88x2BU USB WiFi adapters to OVA (#1903) (#1906) 2022-05-19 16:37:18 +02:00
Stefan Agner
a6f2f81182 Shutdown immeaditly on ACPI Power Button events (#1896) (#1898)
For phyiscal hardware the default Power Button action has been disabled
to avoid accidentally power down the machine.

However, for virtual machine this method is often used to shutdown the
virtual machine gracefully. Use the regular power settings for virtual
machines.
2022-05-19 16:34:15 +02:00
Stefan Agner
80079db997 Set deployment type to production 2022-05-11 10:39:10 +02:00
Stefan Agner
3c5ba17b58 Fix boot issue on Khadas VIM3 (#1894)
Make sure pin controller is enabled.
2022-05-11 10:36:48 +02:00
Stefan Agner
925984c09f Improve GRUB2 boot to also adhere UEFI spec (#1830) (#1893) 2022-05-11 01:51:30 +02:00
Stefan Agner
ba8bda73fa Fix Bluetooth on ASUS Tinker (#1891) (#1892)
* Use upstream Linux driver for Bluetooth on ASUS Tinker

* Drop unnecessary Bluetooth initialization systemd service

Bluetooth is now entirely handled by the kernel.
2022-05-11 01:51:19 +02:00
Stefan Agner
4a42d578fe Linux: Update kernel 5.15.38 (#1890) 2022-05-10 23:29:55 +02:00
Stefan Agner
e98edce5d3 Extend USB storage quirks for Raspberry Pi (#1883)
Add StarTech.com SATA to USB Cable - USB 3.0 to 2.5" SATA III Hard Drive
Adapter.
2022-05-05 18:49:36 +02:00
Stefan Agner
42d4b5f2a2 Linux: Update kernel 5.15.37 (#1882) 2022-05-05 16:53:41 +02:00
Stefan Agner
fdf7823887 Fix booting on certain UEFI systems (#1830) (#1881) 2022-05-05 16:53:26 +02:00
Stefan Agner
87319b6e29 Recreate defconfigs using savedefconfig target (#1876)
* Recreate defconfigs using savedefconfig target

Buildroot allows to generate minimal defconfigs using the savedefconfig
target. Regenerate all our configurations so they all look alive and are
minimalistc.

* Fix generic_aarch64_defconfig
2022-04-27 22:52:15 +02:00
Stefan Agner
d284a1dee7 Small Yellow improvements (#1875)
* Enable additional LED triggers

* Improve Yellow device tree

Fix soundcard name and use BTN_1 as key code.

* Add input-event-daemon configuration

Add minimal input-event-daemon configuration to avoid the default
configuration taking effect. This minimal configuration triggers
the USB configuration import on button press.
2022-04-27 22:51:55 +02:00
Stefan Agner
a9c2eedc71 Handle long-press system keys only (#1874)
Only handle long-press system power, reboot and sleep keys.
2022-04-27 20:33:39 +02:00
Stefan Agner
bd52b7e97b Enable Intel Wireless WiFi DVM Firmware support (#1872) (#1873) 2022-04-27 20:28:17 +02:00
Stefan Agner
46ff688c20 Add Network options required for OpenThread Border Router (#1870)
* Support firewall matching by pkttype

Matching by pkttype is required by the reference OTBR firewall script.

* Add additional Kernel configurations required for OpenThread.
2022-04-27 20:28:02 +02:00
Stefan Agner
be584a8a00 Support NVMe boot on Home Assistant Yellow (#1868) 2022-04-26 00:54:42 +02:00
Stefan Agner
fd7d0253f3 Linux: Update kernel 5.15.35 (#1867) 2022-04-25 14:58:31 +02:00
Stefan Agner
2114dd328f Make container fetching more reliable (#1866)
It seems that the GitHub container registry sometimes returns 503
service unavailable temporarily ("Error fetching tags list: invalid status
code from registry 503"). Use skopeo's retry mechanism to try up to 5
times before failing.
2022-04-25 14:58:22 +02:00
Stefan Agner
e61246f5ba Cleanup Yellow config.txt (#1865) 2022-04-25 14:58:12 +02:00
Stefan Agner
2ac8222f19 Add USB storage quirks for Raspberry Pi by default (#1864)
Add VID/PID of some known problematic USB SSD controllers to USB storage
quirk list. This should make most USB SSD's work with Home Assistant OS
out-of-the box.
2022-04-25 14:58:04 +02:00
Stefan Agner
5bd466c27d Use board information from json for release builds (#1863)
* Use board information from json for release builds
2022-04-25 14:57:53 +02:00
Karol Stosik
56baadc829 Update configuration.md (#1856)
With CR LF my configuration wasn't used at all.
2022-04-25 14:35:01 +02:00
Stefan Agner
91d2092938 Add bugfix in GRUB2 squash4 squashfs code (#1830) (#1858) 2022-04-20 14:07:13 +02:00
Stefan Agner
4310cfe916 Enable file system check for FAT boot partition (#1857) 2022-04-20 14:06:56 +02:00
Stefan Agner
8994a59dfc Add Intel WiFi 22000 series firmwares (#1853) (#1855)
* Bump buildroot

* buildroot 34328de0d9...ee56159464 (2):
  > package/linux-firmware: Add more Intel WiFi 22000 series variants
  > package/linux-firmware: Add Intel WiFi 22000 series

* Add Intel WiFi 22000 series firmwares
2022-04-20 10:41:09 +02:00
Stefan Agner
734323eb1e Bump buildroot (#1854)
* buildroot c62532023d...34328de0d9 (2):
  > package/dhcp: build internal bind tool gen for host (not target)
  > Merge tag '2022.02.1' into 2022.02.x-haos
2022-04-19 17:25:47 +02:00
Stefan Agner
cb495af05a Drop Coral drivers for non-PCIe platforms (#1851) 2022-04-15 16:55:39 +02:00
Stefan Agner
2e03490fe6 Linux: Update kernel 5.15.34 (#1849) 2022-04-15 13:04:45 +02:00
Stefan Agner
f2106c6990 Add out-of-tree Gasket driver for Google Coral support (#1848)
The Google Gasket driver has been removed from the main kernels staging
tree between 5.10 and 5.15 development window. Readd Google's
out-of-tree driver to continiue support Google Coral devices.
2022-04-15 13:04:37 +02:00
Stefan Agner
2c20e5db3e Yellow: Make UART5 the default UART in U-Boot (#1847) 2022-04-14 18:27:06 +02:00
Stefan Agner
aaf2bf8317 Cleanup Buildroot package for Raspberry Pi Bluetooth support (#1846)
* Replace bluetooth-bcm43xx with pi-bluetooth Buildroot package

The new pi-bluetooth packages the scripts and systemd service from
the Raspberry distribution package directly:
https://github.com/RPi-Distro/pi-bluetooth

* Update to latest pi-bluetooth service files

* Update busybox configuration to 1.35.0

The new/deleted configurations are generated automatically, no actual
change in this patch.

* Enable busybox xxd command

The xxd tool is useful for conversion in scripts.

* Prevent start erros on Compute Module 4 without WiFi/Bluetooth
2022-04-14 18:26:06 +02:00
Stefan Agner
38b2eefe0d Bump Home Assistant Yellow to Raspberry Pi Linux kernel 1.20220331 (#1842) 2022-04-11 15:41:14 +02:00
Stefan Agner
4022d797d9 Fix WiFi/Bt firmware deployment for Raspberry Pi 3/4 (#1837) (#1841) 2022-04-11 11:31:23 +02:00
Stefan Agner
7fba67cefe Fix release drafter for release branches (#1836)
* Fix release drafter for release branches

* Add Home Assistant Yellow

* Add Generic aarch64 machine
2022-04-11 11:30:55 +02:00
Stefan Agner
feebc0abe9 Bind mount output directory in release builds (#1834) 2022-04-07 19:56:35 +02:00
Stefan Agner
88aa4c7651 Bump Raspberry Pi kernel/firmware to 1.20220331 (#1833)
* RaspberryPi: Update kernel 5.15.32 - 1.20220331

* Bump buildroot

* buildroot 949a683071...c62532023d (1):
  > package/rpi-firmware: bump version to 1.20220331
2022-04-07 16:51:54 +02:00
Stefan Agner
d9ec603164 Enable IPv6 forwarding by default (#1832)
Enable IPv6 forwarding by default which is useful to run IPv6 based
OpenThread Border Router.

Currently Docker enables IPv4 forwarding by default. Enabling IPv6
support will enable IPv6 routing as well, but we are not ready yet to
enable IPv6 support for Docker at this point.

Enabling IPv6 forwarding should be harmless as there are no IPv6
addresses configured internally and Home Assistant OS is not typically
dual-homed. In cases where it is dual-homed (e.g. VPN), routing is
often used and firewalling is setup as part of that add-on.
2022-04-07 13:24:13 +02:00
Stefan Agner
afff68ca4d Deploy bootcode.bin for Raspberry Pi 2 and 3 (#1831)
* Drop unnecessary rpi-firmware.mk overrides

* Deploy bootcode.bin for Raspberry Pi 2 and 3
2022-04-04 15:44:15 +02:00
Stefan Agner
dceba8bb43 Add Intel WiFi 3945ABG/BG/4965AGN drivers and firmware (#1826) (#1827)
* Enable Intel WiFi 3945ABG/BG/4965AGN drivers and firmware

* buildroot a98c1c31a0...949a683071 (1):
  > package/linux-firmware: Add Intel WiFi 3945ABG/BG/4965AGN
2022-04-04 15:43:38 +02:00
Guglielmo De Concini
f0032a39f2 Enable wext backend for wpa_supplicant to support r8188eu (#1811)
* Enable wext and nl80211 drivers for wpa_supplicant for all devices

* Enable r8188eu module globally and add related firmware to all devices config

Co-authored-by: Stefan Agner <stefan@agner.ch>
2022-04-01 18:39:28 +02:00
Stefan Agner
66303c1078 Use anonymous Docker volume as build output (#1825)
* Use anonymous Docker volume as build output

Use anonymous Docker volumes as build output. This makes sure
every build is using a clean output directory.
2022-03-31 23:43:37 +02:00
Stefan Agner
23e58009f2 Enable nftables packet filtering as modules (#1812) (#1824) 2022-03-31 21:27:38 +02:00
Stefan Agner
6b3440f4fd Set GRUB2 bootloader timeout to 1s (#1823)
This aligns with what we used to have in Barebox. Most of the time the
user is not expected to make a choice, so keeping the timeout short is
sensible.
2022-03-31 21:26:50 +02:00
Stefan Agner
31b9c46a79 Enable 32-bit UEFI support (#1752) (#1819) 2022-03-31 17:48:06 +02:00
Stefan Agner
e8f487f96e Linux: Update kernel 5.15.32 (#1818)
* Linux: Update kernel 5.15.32

* Fix kernel update script
2022-03-31 17:47:54 +02:00
Stefan Agner
9bdd810e76 Yellow: Bump Raspberry Pi kernel to 1.20220308 (#1817)
Update kernel to Raspberry Pi kernel 1.20220308 and rebase Yellow
specific patches.
2022-03-29 01:06:23 +02:00
Stefan Agner
99be958c4f Drop NetworkManager default config (#1813)
* Drop default NetworkManager configuration

NetworkManager will automatically connect using the global defaults.
Also Supervisor today will create a profiles once the user configures
the network explicitly.

* Create system-connection directory
2022-03-25 08:53:30 +01:00
Stefan Agner
59d69209dc Use correct path for tempio (#1807) 2022-03-21 01:06:55 +01:00
Stefan Agner
1b7f9cd42f Bump Raspberry Pi kernel/firmware to 1.20220308 (#1806)
* RaspberryPi: Update kernel 5.10.103 - 1.20220308

* Bump buildroot

* buildroot 8b00576a77...a98c1c31a0 (1):
  > package/rpi-firmware: bump version to 1.20220308
2022-03-21 00:41:21 +01:00
Guglielmo De Concini
a9ea934edc Add RTL_81XX firmware to raspberry pi devices (#1804) 2022-03-21 00:41:08 +01:00
redgryphon
f62fee2ff7 Add support for NTP configuration via DHCP (fixes #689) (#1798)
* Add support for NTP configuration via DHCP.

* Default fallback NTP pool is the Cloudflare's one
2022-03-21 00:40:43 +01:00
Stefan Agner
616c406e8e Use tempio to generate RAUC configuration files (#1797)
* Add tempio host package

tempio is a template helper using Go's template engine and sprig
functions.

* Use tempio to generate rauc manifest

* Use tempio to generate rauc system.conf
2022-03-17 20:28:40 +01:00
Stefan Agner
dde7a7b809 Revert "Remove git submodules before git checkout (#1611)" (#1799)
This reverts commit ff07728fa3.

Removing the .git file from the git submodule is problematic when
updating buildroot: Files deleted stay present in the buildroot
directory (since their origin is no longer known).

The workaround has been introduced to allow building non-git submodule
releases (rel-6) on the same runners. Since rel-7 uses git submodule and
we stay with git submodule for the forseeable future, remove this work
around.
2022-03-17 13:40:02 +01:00
Stefan Agner
829b5941e1 Update to Buildroot 2022.02 (#1781)
* Update board configurations for Buildroot 2022.02

* Bump buildroot

* buildroot 962ff8c0d4...8b00576a77 (3445):
  > Revert "package/systemd: set cgroups default-hierarchy to unified"
  > package/linux-firmware: Add Broadcom BNX2 firmware
  > package/rpi-firmware: bump version to 1.20220120
  > package/linux-firmware: add rtl8761b/rtl8761bu firmware
  > package/docker-proxy: bump version to 64b7a4574d14
  > network-manager: wpa_supplicant
  > Update for 2022.02
2022-03-17 12:26:54 +01:00
Stefan Agner
4390fa7acd Add IP set support for iptables (#1778) (#1780) 2022-03-16 15:38:34 +01:00
Stefan Agner
62de5f53a8 Improve OS 8 GRUB upgrade (#1793)
* Drop unnecessary device tree utilities

They have been used for Barebox which uses device tree to configure the
state storage and its location. With the change to GRUB the tools are no
longer required.

* Determine manual GRUB update depending on installed tools

Manually update the GRUB environment if no grub environment tools are
installed. This makes a upgrade work even after a previous downgrade (in
that case a grubenv file might still be present in the UEFI ESP).
2022-03-16 15:38:18 +01:00
Stefan Agner
bf0aa61d87 Bump Khadas VIM3 to Linux 5.15.25 (#1779) 2022-03-02 15:35:42 +01:00
Stefan Agner
7ca62cb53a Fix Linux kernel 5.15 bump fallout (#1777)
* Add generic-aarch64 to the list of Kernels

* Bump buildroot

* buildroot 8bbb32c16a...962ff8c0d4 (1):
  > package/rtl8812au-aircrack-ng: bump version to 3a6402e

* Fix kernel version for Raspberry Pi kernel based boards
2022-03-02 12:16:22 +01:00
Stefan Agner
cd87324452 Don't fail update even if files are missing (#1776)
Don't fail the boot slot update even if files are missing in the current
boot directory.
2022-03-02 11:44:56 +01:00
Stefan Agner
de21729578 Update to latest Linux LTS kernel 5.15.25 (#1774)
* Linux: Update kernel 5.15.25

Use highest available kernel version in Buildroot 2021.08 (5.13)

* Update Hardkernel patches to Linux 5.15

* Update generic-x86-64/ova kernel config/patches for 5.15

* Drop Intel e1000e Sourceforge driver

The driver has been discontinued sometime last year. The main reason the
out-of-tree kernel has been enabled was for support for the i219-V
network chips which meanwhile are supported in mainline.
2022-03-01 23:40:25 +01:00
Stefan Agner
fc0f1e20d5 Fix GRUB2 update using post-install hook (#1770)
* Use shell functions for install hooks

* Use post-install hook to initialize GRUB2 bootloader env

Unfortunately the boot name to be updated (RAUC_SLOT_BOOTNAME) is not
available when updating the "boot" slot. Instead, initialize the boot
slot in a kernel post-install slot.
2022-02-28 16:49:34 +01:00
Stefan Agner
22f5a83dcc Fix migration from Barebox GRUB for OVA (#1769) 2022-02-28 00:17:49 +01:00
Stefan Agner
f509e9ce5d Shutdown HA CLI properly (#1768)
Drop IgnoreOnIsolate to make sure the service is shutdown during
shutdown.
2022-02-25 19:17:57 +01:00
Stefan Agner
381026758a Fix migration from Barebox GRUB (#1767)
* Fix migration from Barebox GRUB

Create GRUB env which defaults to the boot slot we are updating to. This
makes sure that the newly installed OS version will be booted on next
reboot even if installed on boot slot B.
2022-02-25 19:17:49 +01:00
Stefan Agner
5a409ec0ec Linux: Update kernel 5.10.102 (#1765)
* Linux: Update kernel 5.10.102
2022-02-24 13:42:30 +01:00
Stefan Agner
d1cc7394b5 Use GRUB bootloader for all UEFI platforms (#1762)
* Use GRUB bootloader for all UEFI platforms
* Introduce and use file_env command
* Compress squashfs for aarch64 as well
2022-02-24 13:42:17 +01:00
Stefan Agner
b0bbe70315 Bump U-Boot to 2022.01 (#1761) 2022-02-24 13:22:21 +01:00
Mark Dietzer
0f4016c180 Add support for AArch64/ARM64 EFI architecture (#1757)
* Add AArch64/ARM64 EFI boot support (for QEMU and some boards)
* Allow GRUB to load cmdline.txt-like
* Enable qcow2/vmdk disk images

Co-authored-by: Stefan Agner <stefan@agner.ch>
2022-02-23 10:42:02 +01:00
kyangk
81b3bc8787 Add support for RTL88x2BU USB WiFi dongles (#1742)
* buildroot: package/rtl88x2bu: add rtl88x2bu package

Signed-off-by: Kevin Yang <kangyang@google.com>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2022-02-21 17:32:23 +01:00
Stefan Agner
061a6e9860 Add Intel WiFi driver fix to avoid crash on Intel NUC systems (#1739) (#1745) 2022-02-08 16:13:13 +01:00
Stefan Agner
c29f95678f Linux: Update kernel 5.10.98 (#1744) 2022-02-08 16:13:03 +01:00
Calvin Vette
fed57ec5a3 network.md doc - add WiFi example with caveat (#1719)
Add example command to enabling WiFi with note about caveat.

Co-authored-by: Stefan Agner <stefan@agner.ch>
2022-02-08 14:41:34 +01:00
Stefan Agner
d9f463322b Add Broadcom BNX2/BNX2X firmware (#1732) (#1735)
* buildroot e2ac9b528a...8bbb32c16a (1):
  > package/linux-firmware: Add Broadcom BNX2 firmware

* Add Broadcom BNX2/BNX2X firmware (#1732)

Signed-off-by: Stefan Agner <stefan@agner.ch>
2022-02-02 16:57:32 +01:00
Stefan Agner
6d75b47865 Linux: Update kernel 5.10.96 (#1736) 2022-02-02 16:41:36 +01:00
Stefan Agner
feb045b32d Bump raspberry pi kernel firmware to 1.20220120 (#1731)
* Bump buildroot

* buildroot 3cedcad616...e2ac9b528a (1):
  > package/rpi-firmware: bump version to 1.20220120

* RaspberryPi: Update kernel 5.10.92 - 1.20220120
2022-01-26 13:53:38 +01:00
Jens Maus
c1bd178021 Integrate dual HomeMatic+HomeMatic IP support for HmIP-RFUSB (#1683)
* updated generic_raw_uart to latest version which comes with dualcopro
support for the HmIP-RFUSB usb rf-sticks by eQ3/ELV.

* remove 99-hmip-rfusb.rules to keep a HmIP-RFUSB device free from being
occupied by the cp210x driver but use the new generic_raw_uart support
instead allowing for advanced dualcopro support for HomeMatic/BidCos-RF
and homematicIP support in parallel.
2022-01-26 13:53:16 +01:00
Stefan Agner
260a7c7d05 Update issue template with directions to the new locations (#1727) 2022-01-26 11:56:06 +01:00
Stefan Agner
5291fbf999 Fix reboot on ODROID-N2 (again) (#1722)
To make HDMI CEC work, we have to compile MESON_DRM as a module
(see #1717). However, this essentially reverts #1347, which fixed the
reboot problem by compiling the driver into the kernel.

Hence we need to reintroduce the earlier fix from #1345, which reverts
the offending commit causing the reboot problem.
2022-01-16 12:44:42 +01:00
Stefan Agner
a5949bbc0b Remove reference to non-existing patch directory to fix ODROID-C2 build (#1718) 2022-01-15 14:50:56 +01:00
Stefan Agner
d17a739f48 Fix HDMI CEC on ODROID-N2(+) (#1717)
Build HDMI graphics driver as a module which seems to fix HDMI CEC on
ODROID-N2(+).
2022-01-15 14:41:39 +01:00
Stefan Agner
3c582190d6 Add Intel SoC sound drivers (#1690) (#1715) 2022-01-13 17:38:16 +01:00
Stefan Agner
186107e089 Disable DW-HDMI CEC driver to avoid non-working CEC device file (#1216) (#1714)
The DW HDMI CEC implementation is not used in Amlogic SoC. Disable the
driver to avoid it claiming /dev/cec0 and getting used by user space
tools.

See also: https://lore.kernel.org/all/20210416092737.1971876-3-narmstrong@baylibre.com/T/
2022-01-13 17:37:48 +01:00
Stefan Agner
4399b28d2f Linux: Update kernel 5.10.91 (#1713) 2022-01-13 17:37:34 +01:00
Stefan Agner
c1acccf30e Home Assistant Yellow fixes (#1709)
* Fix enable USB host mode kernel patch

Update to a new patch which applies the device tree change such that the
USB controller actually gets enabled.

* Update Home Assistant Yellow board config

Update config to match changes which have been made to other baords as
well.
2022-01-12 11:11:02 +01:00
Stefan Agner
51b8836af0 Rename Home Assistant Amber to Yellow (#1708)
* Rename Home Assistant Amber to Yellow

Rename the board from "amber" to "yellow" as Home Assistant Yellow is
the official name now.

* Add Home Assistant Yellow to the build matrix
2022-01-07 18:14:25 +01:00
Stefan Agner
76d4485639 Bump buildroot (#1700)
* buildroot 4c6c8fb767...3cedcad616 (1):
  > Merge tag '2021.08.3' into 2021.08.x-haos
2021-12-29 16:49:35 +01:00
Stefan Agner
abfee18363 ODROID XU4: Update U-Boot on eMMC boot partition (#1699)
* ODROID XU4: Update U-Boot on eMMC boot partition

Update the U-Boot on the eMMC boot partition if present. Only write the
first megabyte as the eMMC boot partition might be smaller than the SPL
image and only the first megabyte is occupied by FW/BL1/BL2/TZSW (see
https://wiki.odroid.com/odroid-xu4/software/partition_table#tab__odroid-xu341).
2021-12-29 15:19:31 +01:00
Stefan Agner
5d2154cc97 Update Raspberry Pi kernel and firmware to oldstable_20211201/71bd3109/Linux 5.10.63 (#1119) (#1696)
* Bump buildroot

* buildroot 907739ed48...4c6c8fb767 (1):
  > package/rpi-firmware: bump version to 71bd3109

* RaspberryPi: Update kernel 5.10.63 - oldstable_20211201

* Add Raspberry Pi Zero 2 W device tree
2021-12-28 15:58:18 +01:00
Stefan Agner
24615739ea Use LSI Logic SCSI controller (#1695)
* Use LSI Logic SCSI controller in vmdk descriptor as well

For some reason, the vmdk disk format's descriptor contains the
controller type as well. By default, qemu-img sets it to "ide", which
seems not optimal especially for VMware's ESXi. Set adapter type to
commonly supported "lsilogic".

* Move ova image generation to hdd-image.sh
2021-12-27 14:58:27 +01:00
Stefan Agner
55c9b54b13 Check if Busybox supports oflag (#1692) (#1694)
* Check if Busybox supports oflag

It seems that Busybox' dd shipped with OS release 5 and earlier does not
support oflag. Check if the flag is supported before making use of it.

* Exit if a command in the update scripts returns an error

This makes sure that the update isn't marked as successful in case there
is an error in the update script.
2021-12-27 14:58:19 +01:00
Stefan Agner
580e541f77 Linux: Update kernel 5.10.88 (#1693) 2021-12-27 14:58:11 +01:00
Łukasz Szeremeta
7ed97e89a3 Devices description update (#1684)
* Devices description update

Updating the list of supported devices according to https://www.home-assistant.io/installation/

* Intel NUC -> Generic x86-64 (e.g. Intel NUC)

* Remove unsupported Raspberry Pi and Raspberry Pi Zero
2021-12-24 11:08:28 +01:00
Stefan Agner
1e94f9a79e Adjust ova to support VMware ESXi (#826) (#1674)
* Use OpenSSL to generate OVA manifest file (#826)

It seems that sha256sum adds a space after the hash algorithm which
causes "Invalid OVF checksum algorithm" on certain VMware virtualization
products.

Using OpenSSL avoids the space and makes the manifest file compatible
wiht VMware products.

* Use Buildroot provided OpenSSL binary

* Use SCSI controller by default
2021-12-15 12:11:26 +00:00
Stefan Agner
b7a7805262 Re-upload rebuilt files (#1676)
Make sure to overwrite existing files on upload. This allows to trigger
rebuilds and have the latest builds on the os-builds server.

Note: When using GitHub Actions, the release/ directory is cleared at
the beginning (by the checkout action, which has the clean option set
by default which also causes files in .gitignore to be deleted).
2021-12-14 21:59:27 +00:00
Stefan Agner
19a135edac Avoid race condition when fetching containers during build (#1671)
* Avoid race condition when fetching containers during build

So far only a single builder was active for each architecture. This
toghether with the naming scheme to include architecture/machine name
made sure that an image could only be fetched or used by a single
builder.

However, since most systems are now aarch64, multiple runners are now
active for a single architecture. This makes it necessary to lock
fetching/coping of container images to avoid race conditions.
2021-12-13 15:43:42 +00:00
Stefan Agner
c99927f3c4 Add patch for iwlwifi to fix beacon timeout (#1655) (#1670)
Allow to configure missed beacons using the iwlwifi.beacon_timeout
kernel parameter.
2021-12-13 12:52:29 +00:00
Stefan Agner
f5be7693de rtl8812au: use buildroot provided aircrack-ng driver (#1660) (#1669)
Use rtl8812au driver provided by buildroot. This uses a newer verison of
the v5.6.4.2 branch which works with newer kernel and seems to be the
recommended branch.

Note: It seems that our buildroot package currently fails to properly
deploy the 88XXau.ko kernel module. Instead of fixing our version, just
move to the buildroot version.
2021-12-13 12:52:13 +00:00
geftactics
a4be500bf9 Update download URL for package intel-e1000e (#1668) 2021-12-13 11:30:03 +00:00
Stefan Agner
cc0d4f8b62 Linux: Update kernel 5.10.83 (#1658) 2021-12-03 15:44:08 +00:00
Alexander Reinert
26c36a8caf Updated to latest generic_raw_uart package (#1653) 2021-12-03 15:05:43 +00:00
Stefan Agner
b5c9c9df22 Enable Broadcom and Atheros Ethernet drivers (#1650) (#1651) 2021-11-14 01:36:21 +01:00
Stefan Agner
19616b05d7 Update Linux kernel patches for Home Assistant Amber (#1649)
* Update Linux kernel patches for Home Assistant Amber

Fix user LED polarity. Also rebase the patchset ontop of the Raspberry Pi
kernel 1.20211029.

* Add RTC as well
2021-11-13 16:06:16 +01:00
Stefan Agner
3f28023dc4 Bump OS release version to 8 (#1648) 2021-11-13 16:05:57 +01:00
Stefan Agner
2b34503524 Update Raspberry Pi kernel and firmware to 1.20211029/Linux 5.10.63 (#1645)
* Bump buildroot

* buildroot a46737692c...907739ed48 (1):
  > package/rpi-firmware: bump version to 1.20211029

* RaspberryPi: Update kernel 5.10.63 - 1.20211029
2021-11-11 12:10:21 +01:00
Stefan Agner
b1f6c3a87a Bump buildroot to 2021.08.2 (#1643)
* buildroot 5b5dff3136...a46737692c (1):
  > Merge tag '2021.08.2' into 2021.08.x-haos
2021-11-10 22:53:43 +01:00
Stefan Agner
d065287acd Linux: Update kernel 5.10.78 (#1642) 2021-11-10 22:08:33 +01:00
Stefan Agner
cb8b2e3f5f Drop Raspberry Pi 1/Zero W support (#1638)
These boards support the rather ancient ARMv6 architecture only. We
officially stopped supporting them already two releases ago, its time to
say goodbye.
2021-11-10 14:50:37 +01:00
Stefan Agner
1638097485 Use GitHub issue form (#1637)
* Use GitHub issue form

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-11-09 14:28:16 +01:00
Stefan Agner
b1c59f4f6e Add label action workflow (#1631)
* Add label action workflow
2021-11-05 10:17:41 +01:00
Stefan Agner
5fd943c936 Expose systemd-journal-gatewayd to Supervisor (#1627)
* Add systemd-journal-remote to the image

This allows to access journald's log from within Supervisor and expose
more system logs to users.

* Allow to access systemd-journal-gatewayd from Supervisor

Create a systemd-journal-gatewayd.socket service using a Unix socket and
bind mount it into the Supervisor container. This allows to query
systemd-journald from Supervisor directly.
2021-11-04 15:38:35 +01:00
Stefan Agner
e63aa1a5f4 Update Linux kernel patches for Home Assistant Amber (#1626)
Support the user LED available on the latest revision of the PCB. Also
rebase the patchset ontop of the Raspberry Pi kernel 1.20210928.
2021-11-03 00:54:15 +01:00
Stefan Agner
06a1c21b82 Support Realtek 8152/8153/8156 USB Ethernet adapter (#1604) (#1625)
* Bump buildroot

* buildroot 73991f0fee...5b5dff3136 (1):
  > package/linux-firmware: Add RTL8152/8153/8156 firmware

* Enable Realtek 8152/8153/8156 USB Ethernet adapter support

Enable kernel driver and install firmware for Realtek USB Ethernet
adapter. While at it, also enable some other common USB Ethernet
adapters which don't require firmwares.
2021-11-02 23:53:48 +01:00
Pascal Vizeli
8c1ff000f0 Simplify AppArmor with new OS-Agent SU (#1622) 2021-11-01 15:24:28 +01:00
Stefan Agner
8058392043 Compile Btrfs support as a module (#1623)
We don't use Btrfs as root file system, so there is no need to have it
compiled in by default.
2021-11-01 14:33:42 +01:00
Stefan Agner
6a8b69f793 Update Raspberry Pi kernel and firmware to 1.20211007/Linux 5.10.63 (#1618)
* RaspberryPi: Update kernel 5.10.63 - 1.20211007

* Bump buildroot

* buildroot 5ffdf6ccc5...73991f0fee (1):
  > package/rpi-firmware: bump version to 1.20211007
2021-10-28 10:50:24 +02:00
Stefan Agner
fe4468d789 Reintroduce systemd patches to fix hostname configuration (#1617)
Even though upstream changed the way hostname gets set, it still
requires changes to make it work on a bind mounted /etc/hostname file.
2021-10-28 01:39:16 +02:00
annuges
323cba6777 Add support for Btrfs (#1612)
Add support for Btrfs file system to the kernel to allow host OS and Add-ons to mount external disks formatted with it.
2021-10-28 01:35:37 +02:00
Stefan Agner
ff07728fa3 Remove git submodules before git checkout (#1611)
If a git submodule is converted to a regular git directory (e.g. when
moving from dev -> rel-6 branch), the directory is not properly cleaned
by the checkout action.

Remove the git submodule .git files which makes sure that git properly
reinitialize subdirectories, even if they have been a submodule before.

See also: https://github.com/actions/checkout/issues/624
2021-10-27 11:02:24 +02:00
Stefan Agner
e83e6f4712 Add Amber as new machine (#1569)
* Add Amber machine

Introduce a new machine for Amber. Store it under Raspberry Pi boards
since Amber is based on the Raspberry Pi Compute Module 4. This way we
can reuse existing scripts.

* Add kernel patches for Amber

Add kernel patches which add a custom device tree for Amber.

* Add device wipe support via GPIO button

Allow to wipe the device by pressing and holding the red button.

* Enable serial console by default

Enable serial console on the on-board USB-to-UART adapter as well as on
the GPIO header.

* Use 64-bit mode by default

Support only 64-bit for Amber, it is mature enough.
2021-10-22 11:25:50 +02:00
Stefan Agner
c7ec9468c0 Remove developer documentation (#1580)
Remove developer documentation in favor of the developer docs website.
2021-10-21 16:57:01 +02:00
Stefan Agner
b72acfa648 Synchronize Raspberry Pi config.txt with Raspberry Pi OS (#1601)
It seems that Raspberry Pi OS by default applies an overlay for
Raspberry Pi 4. Apply this change to the HAOS config.txt as well.
2021-10-19 01:43:59 +02:00
Stefan Agner
74fe7d4cb8 Make AppArmor independent of Supervisor service (#1592)
Currently the hassos-apparmor.service wants the
hassos-supervisor.service and vice-versa. This is unnecessary and leads
to activation of hassos-supervisor.service when reload/restart
hassos-apparmor.service (Supervisor is doing that on startup).

Make hassos-apparmor.service independent and add dependency as well as
ordering from hassos-supervisor.service side.
2021-10-15 01:36:02 +02:00
Stefan Agner
ce566167f2 Improve OS logging (#1590)
* Avoid duplicate log entries

So far the hassos-supervisor.service starts the hassos-supervisor script
which in turn attaches to the Supervisor container. This causes stdout
and stderr to be forwarded to the service unit, which in turn logs it in
the journal.

However, Docker too logs all stdout/stderr to the journal through the
systemd-journald log driver.

Do not attach to the Supervisor container to avoid logging the
Supervisor twice.

Note that this no longer forwards signals to the container. However, the
hassos-supervisor.service uses the ExecStop= setting to make sure the
container gets gracefully stopped.

* Use image and container name as syslog identifier

By default Docker users the container id as syslog identifier. This
leads to log messages which cannot easily be attributed to a particular
container (since the container id is a random hex string).

Use the image and container name as syslog identifier.

Note that the Docker journald log driver still stores the container id
as a separate field (CONTAINER_ID), in case the particular instance need
to be tracked.
2021-10-13 16:12:05 +02:00
Stefan Agner
b211c653c7 Fix y2038 file system warnings (#1589)
* Bump buildroot

* buildroot 3c5f87185d...5ffdf6ccc5 (1):
  > package/e2fsprogs: Create y2038 capable file systems by default

* Use inode size of 256 bytes for overlayfs

By default older versions of mkfs.ext4 create file systems with inode
size of 128 bytes. This does not allow for 64-bit timestamps, which
leads to y2038 compatibility warnings. Use 256 bytes inodes.
2021-10-13 16:07:13 +02:00
Stefan Agner
53dcfd3134 Fix fallout from Buildroot 2021.08.1 update (#1588)
* Remove dt-utils patches applied upstream

All patches are now applied upstream. With 2021.03.0 release no more
downstream patches are required.

* Bump buildroot to fix linux-firmware build issues

* buildroot f10577b836...3c5f87185d (3):
  > package/linux-firmware: add rtl8761b/rtl8761bu firmware
  > package/linux-firmware: bump version to 20210919
  > Revert "package/linux-firmware: add rtl8761b/rtl8761bu firmware"
2021-10-12 11:49:58 +02:00
Stefan Agner
eed6302ad8 Bump buildroot to 2021.08.1 (#1587)
* Bump to Buildroot 2021.08.1

Move to Buildroot 2021.08.1 using the 2021.08.x-haos branch. Some
patches on the previous branch 2021.02.x-haos have been applied upstream
meanwhile. Others required rather trivial rebasing.

This latest Buildroot release brings new versions of the following
components:
 - glibc 2.33
 - systemd 249.3
 - Networkmanager 1.32.2
 - BlueZ 5.60
 - Docker 20.10.8

The patch "Fix dhcp client" seems not to be necessary anymore. The
directory /var/lib/dhcp seems not in use when NetworkManager invokes
dhclient. It seems the leases which are typically stored in that
directory are managed inside NetworkManager.

* buildroot 2021.08.1..2021.08.x-haos (6)
  > package/rpi-firmware: bump version to 1.20210805
  > package/rpi-wifi-firmware: bump version to 883b726
  > package/linux-firmware: add rtl8761b/rtl8761bu firmware
  > package/docker-proxy: bump version to 64b7a4574d14
  > package/rpi-firmware: Allow to deploy multiple firmware files
  > network-manager: wpa_supplicant

* Bump Raspberry Pi Bluetooth helper scripts

With the update to Buildroot 2021.08.1, the bthelper fails with an error
org.bluez.Error.Busy when trying to power off the device. Presumably this
is a race condition which surfaced due to a change in Bluez 5.60:
348feb005a

Oct 11 14:32:21 homeassistant systemd[1]: Reached target Bluetooth Support.
...
Oct 11 14:32:21 homeassistant bluetoothd[412]: Bluetooth management interface 1.18 initialized
Oct 11 14:32:21 homeassistant systemd[1]: Started Raspberry Pi bluetooth helper.
Oct 11 14:32:21 homeassistant bthelper[417]: Raspberry Pi BDADDR already set
Oct 11 14:32:21 homeassistant bthelper[426]: [58B blob data]
Oct 11 14:32:21 homeassistant bthelper[426]: [59B blob data]
Oct 11 14:32:21 homeassistant bthelper[426]: Failed to set power off: org.bluez.Error.Busy
Oct 11 14:32:21 homeassistant systemd[1]: bthelper@hci0.service: Main process exited, code=exited, status=1/FAILURE
Oct 11 14:32:21 homeassistant systemd[1]: bthelper@hci0.service: Failed with result 'exit-code'.

The latest version of the pi-bluetooth package introduced a sleep before
powering off the device, however, presumably for a different reason:
ae2efdeee8 (diff-609c8a23261988c47afd40be9b012feb1d167de8761c1301e44e1864635c19e3)

Anyways, this latest version seems to also fix the above mentioned race
condition.
2021-10-12 01:08:04 +02:00
Stefan Agner
e0e270df1a Wait for Docker daemon (#1586)
Sometimes the first command after starting the Docker daemon container
fails, presumably because the container did not start yet. Wait until
the Docker daemon is ready.
2021-10-11 16:06:36 +02:00
TJ Horner
f012f09d4f Change barebox boot configs to support USB booting (#1575) 2021-10-07 21:43:49 +02:00
Stefan Agner
e819f05927 Fix Compute Module 4 USB driver (#1281) (#1577)
The BCM2711 has two USB 2.0 IPs: A Broadcom XHCI USB 2.0 controller and
a Synopsys DWC2 USB 2.0 Host/Device controller. When USB boot is used
the former is active. Make sure the driver has the correct device tree
compatible.
2021-10-07 14:02:04 +02:00
Stefan Agner
e916d9f93c Move patch to fix U-Boot 2021.10 build (#1576)
We only have a single U-Boot version currently, so there is no value in
storing the patch file in a version specific directory. This makes sure
U-Boot 2021.10 final release also has fileenv support.
2021-10-07 14:01:55 +02:00
Stefan Agner
d8dfa88fb8 Replace Stale Bot with Stale GitHub Action (#1573) 2021-10-06 12:18:38 +02:00
Stefan Agner
565c473a75 Raspberry Pi U-Boot fixes (#1572)
* Add NVMe and XHCI USB driver fix for Raspberry Pi

Add patch which fixes NVMe read reliability and allows to compile the
XHCI USB driver (for Compute Module 4).

* Enable Broadcom XHCI driver for Compute Module 4

The BCM2711 has two USB 2.0 IPs: A Broadcom XHCI USB 2.0 controller and
a Synopsys DWC2 USB 2.0 Host/Device controller. When USB boot is used
the former is active. Make sure U-Boot has the driver built-in for that
IP.
2021-10-05 19:16:16 +02:00
Stefan Agner
a19870947a Bump U-Boot to stable release 2021.10 (#1571) 2021-10-05 19:15:59 +02:00
Stefan Agner
bdc319d3df Use file for cmdline.txt (#1568)
* Remove duplicate config.txt copy statement

* Use static cmdline.txt file

Instead of dynamically creating cmdline.txt use a static version of it.
This aligns with other boot loader/firmware configuration files and makes
it easier to customize the file per board.
2021-10-04 14:38:52 +02:00
Stefan Agner
8d69f395c2 Support board specific RPi firmware configuration (#1567)
Support optional board specific default RPi firmware configuration file
(config.txt). Also rename from boot-env.txt to config.txt since this
file is not read by the U-Boot boot loader but the Raspberry Pi specific
boot firmware.
2021-10-04 11:51:31 +02:00
Stefan Agner
8049dfb30c Bump buildroot (#1565)
* buildroot f0b9df907a...291b4156c7 (2):
  > Merge tag '2021.02.5' into 2021.02.x-haos
  > package/rpi-firmware: bump version to 1.20210831
2021-10-04 10:31:02 +02:00
Stefan Agner
a4edece719 Linux: Update kernel 5.10.70 (#1564) 2021-10-04 10:06:37 +02:00
Stefan Agner
762f098c14 Use skopeo and DIND to download container images (#1561)
* Use skopeo to download container images

Separate container download from image build. This will allow to share
the downloaded images between multiple builds.

We won't store the Supervisor container with the version tag, just with
the latest tag. This allows to simplify the procedure a bit. It seems
there is no downside to this approach.

* Use official Docker in Docker images to build data partition

Instead of building our own Debian based image let's use the official
Docker in Docker image. This avoids building an image for the hassio
data partition and speeds up build as well.

This calls mount commands using sudo to mount the data partition as part
of the buildroot build now. This is not much different from before as
mount has been called as root inside the container, essentially equates
to the same "isolation" level.

* Use image digest as part of the file name

The landing page has no version information in the tag. To avoid
potentially source caching issues, use the digest as part of the file
name.
2021-10-04 10:06:26 +02:00
Stefan Agner
693507aaca Bump build container to Debian bullseye (#1560) 2021-09-30 09:47:20 +02:00
Stefan Agner
b7bbb63a26 Support development builds in pull-requests (#1464)
Use the "run-dev-build" label to trigger a development build. This will
only generate a build for the machines the PR has been tagged with.
2021-09-29 22:04:30 +02:00
Stefan Agner
631c0c5d53 Make sure Intel BT gets built as a module (#1558)
CONFIG_BT_HCIBTUSB selects CONFIG_BT_INTEL. That causes CONFIG_BT_INTEL
to be built-in instead of being built as a kernel module.

When the driver is built-in, loading firmware fails during early boot
with the following error message:
[ 1.058941] bluetooth hci0: Direct firmware load for intel/ibt-17-16-1.sfi failed with error -2

Make sure the driver is built as a module which should fix firmware
loading.
2021-09-29 10:13:16 +02:00
Stefan Agner
55568f597f Bump OS Agent to 1.2.1 (#1559)
This should make the D-Bus method ReloadDevice working and show the
current data disk correctly.
2021-09-29 09:58:15 +02:00
Stefan Agner
7592143322 Add NVMe boot support for RPi Compute Module 4 (#1557)
* Add U-Boot patches for NVMe boot support

Add NVMe to boot order. Fix NVMe support on 64-bit Raspberry Pi devices.
This is useful for Raspberry Pi Compute Module 4 IO Board where a native
NVMe can be plugged in.

* Enable NVMe support for Raspberry Pi 4

Our machine configuration rpi4 and rpi4_64 work on the Compute Module IO
Board. In this configuration a NVMe SSD can be used. Therefor, enable
support for NVMe in the Raspberry Pi 4 configurations.

Note: Regular Raspberry Pi devices will not notice a difference as the
"nvme scan" command will return very quickly and not find a NVMe on the
PCIe bus.

* Use built-in NVMe support in Kernel for NVMe boot support
2021-09-28 10:51:43 +02:00
Stefan Agner
008fb3fb74 Bump to U-Boot 2021.10-rc5 (#1556)
The bump to U-Boot 2021.10-rc5 also makes quite some patches obsolete
since they are already part of U-Boot.

This also removes a patch which disables framebuffer support on
Raspberry Pi: Framebuffer support seems to work fine in todays
U-Boot/Linux combination. It can help debug boot problems on Raspberry
Pi devices. Without the patch framebuffer support will be enabled by
default.
2021-09-28 10:02:52 +02:00
Pascal Vizeli
a7c237f93d Update OS-Agent 1.2.0 & adjust datadisk support (#1554)
* Update OS-Agent & adjust datadisk support

* Update Documentation/partition.md

Co-authored-by: Stefan Agner <stefan@agner.ch>
2021-09-28 09:54:04 +02:00
Stefan Agner
3d42d3690b Add USB stall handling for U-Boot (#1011, #1544) (#1553)
Some USB devices cause the USB stack to get stuck with a stall error.
This adds a patch which recovers from this situation.

This avoids an U-Boot crash when Arduino Mega R3 devices are connected,
which cause an USB stall when trying to read the product string.
2021-09-27 14:44:36 +02:00
Christian Knittl-Frank
1e7cd66165 Fix datactl for NVMe devices (#1550)
Add "p" in partition names ending with digit.

See https://community.home-assistant.io/t/datactl-help/276117 and https://unix.stackexchange.com/a/500910/334933
2021-09-21 00:24:08 +02:00
Stefan Agner
7d187405de Fix hybrid spelling (#1548)
Fix misspelled word "hybrid" for hybrid GPT/MBR partition tables.
2021-09-20 13:44:45 +02:00
Stefan Agner
66d5957310 Wait until Internet is available before starting AppArmor (#1547)
This makes sure that internet connectivity is available to replace the
AppArmor configuration in case the device has been wiped.
2021-09-20 13:44:09 +02:00
Stefan Agner
7ca4e90885 Fix buffer overflow when initialize USB keyboard in U-Boot (#1538) (#1541)
When a USB keyboard is connected to Raspberry Pi 32-bit versions of
U-Boot crashed in certain situations just before booting Linux. This
seems to be cause by a buffer overflow when removing the USB keyboard
before hand-over to Linux.
2021-09-07 21:56:37 +02:00
Stefan Agner
7d5ebfcd31 Linux: Update kernel 5.10.62 (#1536) 2021-09-06 14:05:14 +02:00
Stefan Agner
5af4942607 Add USB DS9490R 1-wire master support (#1513) (#1527)
* Add USB DS9490R 1-wire master support (#1513)

* Add 1-Wire support via GPIO as well
2021-09-04 14:47:02 +02:00
Jens Maus
97dffedbcd Add a buildroot utils/check-package linter check to pr-checks.yml (#1523)
Add buildroot utils/check-package check to the pr-checks.yml workflow.
It checks for common errors/mistakes when creating own buildroot
packages. Also fixed all warnings this utility output for our existing packages.
2021-09-04 10:46:55 +02:00
Stefan Agner
b6b8e3b1dc Fix U-Boot USB initialization failure (#1203, #1490) (#1529)
Add a patch to fix a U-Boot issue causing troubles when enumerating USB
devices (required when booting from USB devices).
2021-09-03 16:33:47 +02:00
Stefan Agner
33280dc4cd Linux: Update kernel 5.10.61 for ODROID-N2 (#1512) (#1528)
* Linux: Update kernel 5.10.61 for ODROID-N2 (#1512)

Update the kernel to 5.10.61 for ODROID-N2 and fix the update script
to update kernel for ODROID-N2 next time too.

* Move ODROID kernel patches to non-kernel version specific directory
2021-09-03 13:44:42 +02:00
Stefan Agner
0d31ddfa43 Add Mediatek MT7601U support (#1526) 2021-09-03 01:18:26 +02:00
Stefan Agner
6bc5c3e5d0 Increase minimal free memory for Raspberry Pis (#1525)
The minimal memory reserved parameter vm.min_free_kbytes should be
between 1-3% according to RedHat.

However, the kernel by default reserves around 3MB (e.g. only 3285 on a
32-bit Raspberry Pi 4 2GB installation). This seems to be too low for
network intensive applications such as ours: Under memory pressure
"page allocation failure" on various orders have been observed.

Raspberry Pi OS uses a fixed value of 16MB. Follow this setting for now.

Note: We cannot set this globally for Home Assistant: x86-64 machines
can have quite a bit more memory, which also requires increased
min_free_kbytes parameter. ODROID-N2 on the other hand uses transparent
huge pages: If enabled, the kernel requires higher min_free_kbytes
values, and sets those also by default (e.g. on ODROID-N2+ with 4GB
memory its set to 22528 by default).
2021-09-03 00:28:33 +02:00
Jens Maus
9582183458 Update eq3_char_loop and rpi-rf-mod package to latest (#1517)
Update eq3_char_loop and rpi-rf-mod package to latest versions. Add proper hash files accordingly.
2021-09-02 09:54:38 +02:00
Jens Maus
57d7059dae updated generic_raw_uart to latest 1.20 version. (#1516) 2021-09-02 09:51:13 +02:00
Stefan Agner
50749052ae Linux: Update kernel 5.10.61 (#1512) 2021-08-26 19:35:25 +02:00
Stefan Agner
222cfff8b8 Bump buildroot (#1511)
* buildroot c92d04a431...f0b9df907a (1):
  > Merge tag '2021.02.4' into 2021.02.x-haos
2021-08-26 19:16:30 +02:00
Stefan Agner
a504869cbb Add Intel WiFi firmwares (#1505) (#1506)
Add all available Intel WiFi firmwares.
2021-08-26 17:54:03 +02:00
Rob VDM
5bb42ff43c Add support for Keyspan USB-Serial adapters (#1509) 2021-08-19 12:00:28 +02:00
Stefan Agner
cbce0f2a2e Add Khadas VIM3 to GitHub Actions (#1498)
* Add Khadas VIM3 to GitHub Actions/Issue Template
2021-08-06 14:45:51 +02:00
Stefan Agner
6c3bcb708f Enable HDMI CEC drivers for ODROID-N2 (#1216) (#1497) 2021-08-06 14:35:41 +02:00
Stefan Agner
ac407a6679 Add Khadas VIM3 (#1473)
* Add Khadas VIM3

Add Khadas VIM3 board support.

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2021-08-06 14:14:09 +02:00
Stefan Agner
f47b371f23 Fix Ralink RT73 package selection (#1496) 2021-08-06 11:01:43 +02:00
marengaz
ecfb744fe7 Typo (#1495) 2021-08-05 18:32:15 +02:00
Stefan Agner
511169b31b Bump buildroot (#1486)
* buildroot c8de13c113...c92d04a431 (1):
  > package/rpi-firmware: bump version to 1.20210527
2021-07-28 19:13:37 +02:00
Stefan Agner
df167910e1 Add Bluetooth firmware file for Raspberry Pi 400 (#1469) (#1484) 2021-07-28 18:04:50 +02:00
Stefan Agner
965198e8a1 Bump buildroot (#1482)
* buildroot f358c8ba53...c8de13c113 (1):
  > package/rpi-wifi-firmware: bump version to 883b726
2021-07-28 18:02:58 +02:00
Stefan Agner
c8f6c6c2b0 Add firmware for Realtek 87xx/88xx Bluetooth devices (#1427) (#1480) 2021-07-27 23:56:23 +02:00
Stefan Agner
99319542b9 Enable support for Ralink rt27xx/rt28xx/rt30xx and rt73 devices (#1443) (#1479)
This includes device support for RT2870 or RT5572 among many others.
2021-07-27 23:48:33 +02:00
Stefan Agner
2c9ce139d4 Remove duplicated patch file (#1477)
The patch file is already present in the board specific patch directory.
2021-07-27 23:48:25 +02:00
Stefan Agner
720390862a board: hardkernel: Fix random crash on Linux kernel 5.10 and newer (#1476)
Don't fail adding reserved memory when a memory region already has been
reserved (e.g. via  memreserve). This avoids conflicting no-map setting
and makes sure memory is properly reserved.
2021-07-26 17:29:19 +02:00
Stefan Agner
be3afe8b68 Update to Linux 5.10.53 (#1475)
* Linux: Update kernel 5.10.53

Move back to the LTS kernel 5.10.

* Remove ODROID-N2 specific kernel update script
2021-07-26 17:25:01 +02:00
Stefan Agner
bdc9909117 Improve Xen support (#1459)
* Enable some useful kernel configurations

* Add xe-guest-utilities for better Xen support

Add guest utilities and make sure the Xen guest daemon gets started
when running under Xen virtualization.
2021-07-17 02:20:57 +02:00
Stefan Agner
54fa9899eb Avoid using tar when uploading dev builds (#1462)
* Avoid using tar when uploading dev builds

The GitHub action to upload the images to the os-builds server uses
tar before uploading. This creates unnecessary copies and takes a while.
Switch to a GitHub action which uploads the images using rsync instead.
2021-07-14 13:30:29 +02:00
Stefan Agner
c58a568f64 Remove original images when creating zip (#1461)
Other compression methods remove the original image file at compression.
Add the -m (move) command to zip to do the same when compressing with
zip. This saves some space in the builds image/release directory.
2021-07-14 09:51:39 +02:00
Stefan Agner
ad8ee5610d RaspberryPi: Update kernel 5.10.17 - raspberrypi-kernel_1.20210527-1 (#1456) 2021-07-12 16:07:04 +02:00
Stefan Agner
1ef4d43d4e Use sparse file for pre-composed data partition (#1454) 2021-07-12 16:06:53 +02:00
Stefan Agner
d40fa3beea Ignore build output directory (#1453)
Avoid Docker sending the complete build output directory when trying to
build the builder image.
2021-07-09 16:16:34 +02:00
Stefan Agner
b03482996f Drop superseeded CRDA utility (#1452)
The CRDA (Central Regulatory Domain Agent) utility has been used as a
user space helper to load regulatory information for WiFi drivers.
However, since Linux 4.15 the kernel can load the regulatory information
directly from a signed firmware file "regulatory.db".

The regulatory.db file is provided by the WIRELESS_REGDB package, which
has been already installed since its a dependency of CRDA.

Drop CRDA and select WIRELESS_REGDB package explicitly to make sure the
regulatory.db file is present.
2021-07-09 16:12:03 +02:00
Stefan Agner
0c6888cdd0 buildroot: package/lvm2: install dmsetup only (#1449)
LVM2 is not really required in the embedded use case. Opt out of
installing the standard installation which will install only dmsetup.
This requires a backported fix for the lvm2 package to not install
unnecessary systemd services.

Fixes: #1448
2021-07-08 19:43:17 +02:00
Pascal Vizeli
269246c412 Using image name from version file (#1437)
* Using image name from version file

* Use jq for arch/machine substitution

Co-authored-by: Stefan Agner <stefan@agner.ch>
2021-07-08 19:43:03 +02:00
Stefan Agner
6c79ce0f98 Use git submodule for buildroot (#1445)
* Drop buildroot from git repository

Manage buildroot in a separate git repository and use a git submodule
to include it into the HAOS source tree.

This makes it easier to manage changes to buildroot since it can be
managed by git. A buildroot fork repository is being maintained with
the changes we currently have. It makes the buildroot-patches unnecessary
and should make it easier to rebase and upstream changes to buildroot.

* Remove buildroot-patches

Now that buildroot changes are managed in the buildroot fork repository
there is no need to manage patches in a separate directory.

* Initialize git submodule if necessary

* Move build directory to root

This avoids conflict/local modification issues with the buildroot
git submodule.
2021-07-08 16:19:37 +02:00
Stefan Agner
166537bf00 Dockerfile: Add dependencies for make graph-depends/-size targets (#1444)
Install buildroot dependencies so make graph-depends/-size targets can
be used.
2021-07-08 11:51:15 +02:00
Alexander Reinert
c2ac8b5763 Update generic_raw_uart module to latest version (#1430) 2021-06-22 22:50:09 +02:00
Joakim Sørensen
a538ac2c8a Adjust recommended platforms (#1429) 2021-06-22 17:35:30 +02:00
Stefan Agner
e5933c4ed4 Add firmware for RTL8761B/BU devices (#1392) (#1423) 2021-06-20 01:07:56 +02:00
Stefan Agner
94432dad88 Linux: Update kernel 5.10.45 (#1424) 2021-06-20 01:07:37 +02:00
Stefan Agner
9c8172df40 Update buildroot to 2021.02.3 (#1422)
Signed-off-by: Stefan Agner <stefan@agner.ch>
2021-06-19 19:26:55 +02:00
Stefan Agner
96a8ab17c1 Improve kernel update scripts (#1413)
* Improve kernel update scripts

Use separate script for ODROID-N2 for now. Also warn if there are kernel
patches with a specific kernel version number in the source tree: They
typically can be just moved to the new kernel version, but one should
compile check them before committing.
2021-06-19 19:26:44 +02:00
Stefan Agner
f6d639f2bf Use compressed squashfs for kernel (#1418)
* Add squashfs with LZ4 and LZO compression to Barebox

* Add squashfs with LZO compression to U-Boot

* Use squashfs for Linux kernel partition

Generate a squashfs image with LZO compression for the Linux kernel
partition. Adjust the boot scripts to be file system independent commands
to boot from squashfs.
2021-06-17 01:53:35 +02:00
Jens Maus
44cca729f0 Update generic_raw_uart module to latest version (#1417) 2021-06-16 07:50:48 +02:00
Stefan Agner
f39ee8b863 rtl8812au: bump to latest aircrack-ng 5.7.0 version (#1416)
Bump to the latest git version of this out-of-tree driver. This allows
to compile the driver against Linux 5.12.
2021-06-15 08:46:00 +02:00
Stefan Agner
64d3cd88a1 Move ODROID patches (#1415)
The patches for ODROID-C2/C4 don't apply to Linux 5.12 used in
ODROID-N2. Move ODROID-C2/C4 patches to kernel version specific
directory so they don't get applied for ODROID-N2.
2021-06-14 22:10:24 +02:00
Stefan Agner
084636b6cf Bump ODROID-N2 to Linux 5.12 (#1414)
Use the latest Linux stable release 5.12 for ODROID-N2. This allows to
test if we see the random kernel crashes observed with 5.10 in latest
stable 5.12 as well.
2021-06-14 19:04:54 +02:00
Stefan Agner
f7c5154bda Remove unnecessary ODROID-N2 kernel patches (#1412)
For ODROID-N2, release 6 is using Linux 5.9.16. On dev branch we most
likely will move to latest stable and skip 5.10. Drop those unnecessary
patches.
2021-06-14 18:18:55 +02:00
Stefan Agner
9bf12a8648 Use direct I/O for SPL update (#1408)
The rauc hook for the spl slotclass writes to the disk directly. Make
sure the changes do not end up in cache in case the device looses power
or is otherwise not properly rebooted.

Also use the same partition label detection we are using in
hassos-expand.
2021-06-14 11:27:03 +02:00
Stefan Agner
cfb68c5b39 Use file system extents for the kernel partition (#1406)
In the past file system extents have been deactivated to get better
performance in U-Boot. However, the performance issue has been addressed
with commit d5aee659f217 ("fs: ext4: cache extent data") in U-Boot. The
performance should be equal to regular files using no extents.

Enabling extents has an advantage however: Files are stored more
efficently, especially relatively large files like a kernel image. The
impact is not all that big (~100KiB), but worthwhile nonetheless.
2021-06-14 11:26:29 +02:00
Andrew Dunham
cceb5dcf39 pc/ova: support virtio-fs (#1400) 2021-06-14 11:26:12 +02:00
Stefan Agner
582ec82f83 Bump OS release version to 7 (#1404) 2021-06-13 16:51:41 +02:00
Stefan Agner
cb0fa11eeb Fix release builds without dev part in version number (#1396) 2021-06-09 01:18:42 +02:00
Stefan Agner
89c4d57b18 Bump linux to 5.10.42 (#1395)
* Linux: Update kernel 5.10.42

* Fix kernel version documentation
2021-06-08 23:59:31 +02:00
Stefan Agner
a66f3380e3 Enable Wireless Extension for proc API (#1389) (#1394)
The Wireless Extension framework is deprecated, but it seems that the
Wireless Extensions proc API is still popular (/proc/net/wireless).
Enable the minimal set of Wireless Extension to get the proc API.
2021-06-08 23:44:06 +02:00
Marius
288f4a0082 Verify Power Supply Rating (#1393)
* Add paragraph on Power Supply

see: https://jamesachambers.com/raspberry-pi-4-ubuntu-20-04-usb-mass-storage-boot-guide/
2021-06-07 11:51:06 +02:00
Stefan Agner
622cbb806d Restart console on tty1 on exit (#1387) (#1391)
Since we start the HomeAssistant shell directly on tty the service
responsible for starting did not restart the shell on exit. Remove the
RemainAfterExit flag to make sure that the shell restarts on exit.
2021-06-05 15:17:14 +02:00
Herr Frei
5c8a0307fb Add thinkpad_acpi module (#1388)
* Add defconfig entry for thinkpad_acpi module
2021-06-05 15:16:56 +02:00
Stefan Agner
51e80cb7bc Avoid spurious shutdown on ODROID-XU4 (#1385) (#1386)
It seems that the TPU (thermal monitoring) sometimes reports
unreasonable high temperatures, leading the kernel to trigger a thermal
shutdown. Add a patch which filters out such spurious temperature
readings.
2021-06-04 15:20:10 +02:00
Stefan Agner
9e921ed9ad Add additional directories to .dockerignore (#1382) 2021-05-30 21:43:44 +02:00
Stefan Agner
56730adf48 Keep Linux patches for 5.10.37 for other ODROID boards (#1381) 2021-05-27 11:57:26 +02:00
Stefan Agner
22aa316483 Update Barebox to 2021.05.0 (#1380)
* Remove CONFIG_CLOCKSOURCE_EFI configuration

It seems to cause messages like this on some machines:
EFI Event timer too slow freq = 100 Hz

The Barebox efi_defconfig configurationd doesn't enable it either.
Disable it by default as well.

* Enable CONFIG_CMD_ECHO_E to fix menutree

It seems that menutree needs CONFIG_CMD_ECHO_E to properly display the
boot menu.

Also enable other useful commands such as edit or reset.

* Bump Barebox to 2021.05.0
2021-05-27 00:33:34 +02:00
Stefan Agner
d60272b79a Revert ODROID-N2(+) back to use Linux 5.9 (#1379)
Since the move to 5.10 multiple users experience stability issues
leading to random crashes. All reboots follow a SError Interrupt:
[48112.247242] SError Interrupt on CPU5, code 0xbf000000 -- SError
...

Revert back to Linux 5.9.16 for now.
2021-05-27 00:29:20 +02:00
Stefan Agner
068a57763c Enable serial console as well (#1339) (#1378)
Using console focused virtualization environments such as virsh having
a serial console is the easiest way to interact with a virtual machine.
It also saves resources since no video memory needs to be allocated.
Enable serial console besides tty1 by default.

Note: The bootloader as well as the kernel shows its boot messages on
all consoles. However, only the last console is mapped to /dev/console,
which systemd is using to show service startup messages. Putting tty1 as
last console makes sure that systemd messages are still shown on the
console screen.
2021-05-27 00:29:06 +02:00
Stefan Agner
6810659f9b Pass ha command with quotes to CLI container (#1377)
When using quotes currently, they are not passed to HA due to $*. This
doesn't allow to use some commands properly, e.g. snapshot restore with
a passwort with spaces:

```
ha snapshot restore c31f3c93 --password "test test"
...
time="2021-05-26T11:24:19+02:00" level=fatal msg="Error while executing rootCmd: accepts 1 arg(s), received 2"
```

Properly pass all arguments using $@ in quotes.
2021-05-26 14:16:43 +02:00
Stefan Agner
8020671ca6 Drop directories when creating zip file (#1372)
We zip a single file nested in a rather deep directory tree which stems
from the build system. This doesn't need to be exposed to users.
2021-05-25 19:32:42 +02:00
Stefan Agner
0f57b55b4c Add minimal message of the day (#1373)
Add a minimal motd so users know what kind of system they just logged
in. Also add the hint that the Home Assistant CLI is still available
using the command ha.
2021-05-25 14:40:54 +02:00
Stefan Agner
c7909de767 Recreate Supervisor container on OS upgrade/downgrade (#1368)
* Recreate Supervisor container on OS upgrade/downgrade

When the operating system gets upgraded or downgraded the Supervisor
start script might start the Supervisor slightly differently (e.g. with
RT scheduling support). If the container has already been created, a OS
upgrade or downgrade won't recreate the Supervisor container.

* Move startup script version file to /mnt/data
2021-05-19 22:27:16 +02:00
Stefan Agner
c1c6a6ce21 Update buildroot to 2021.02.2 (#1370) 2021-05-19 22:20:50 +02:00
Stefan Agner
111018b911 Remove obsolete Busybox ACPI config (#1369) 2021-05-19 14:41:30 +02:00
Stefan Agner
40b4d5ca2e Start Home Assistant CLI on tty1 without login (#1366)
* Start ha-cli on tty1 instead of a getty

Instead of starting a getty start the ha-cli directly. This will show
the banner right on startup with the important information such as IP
address of the instance or the URL to reach it.

* Use default shell as root shell instead of HA CLI

Instead of using the ha-cli.sh script as login shell use the regular
shell. Amongst other things, this allows to run VS Code devcontainers
remotely via SSH or using scp. The HA CLI is still available using the
`ha` command.
2021-05-19 13:18:02 +02:00
Stefan Agner
25d1f5d7d1 RaspberryPi: Update kernel 5.10.17 - 3a33f11c48572b9dd0fecac164b3990fc9234da8 (#1365) 2021-05-19 09:59:54 +02:00
Stefan Agner
d6a86c29f9 Linux: Update kernel 5.10.37 (#1364) 2021-05-19 09:50:45 +02:00
Stefan Agner
2d3119ef22 Delay Supervisor start until time has been sychronized (#1360)
* Enable systemd-time-wait-sync.service by default

Enable the systemd-time-wait-sync.service by default. This allows to use
the time-sync.target which allows to make sure services only get started
once the time is synchronized.

* Make sure time is synchronized when starting  hassos-supervisor.service

Use the time-sync.target to make sure that the Supervisor gets stsarted
after the time has been synchronized.

* Set timeout for systemd-time-wait-sync.service

Don't delay startup forever in case time synchronization doesn't work.
This allows to boot the system even without Internet connection.
2021-05-12 17:47:42 +02:00
Pascal Vizeli
9dd269d766 Fix NM connectivity URL (#1359) 2021-05-12 14:37:37 +02:00
Ajinkya Bawaskar
3c6897e2cd Update getting_started_development.md (#1355)
Changed name of the repository cloned from `hassos` to `operating-system`
2021-05-09 11:19:51 +02:00
Krzysztof Karol
7afe867fd5 Fix typos in issue template (#1356) 2021-05-09 11:08:47 +02:00
Stefan Agner
779dc0bcb8 Make sure to upload correct image files in release pipeline (#1353)
The images have been renamed from hassos to haos. Make sure to upload
the correct files.
2021-05-07 00:24:21 +02:00
Stefan Agner
70d6252eae Support OS releases with custom dev part (#1352)
Support OS releases (tags) with custom dev part (3rd group of the
release number). This allows to create tagged release candidates with
the form 6.0.rc1.
2021-05-07 00:14:33 +02:00
Jens Maus
9ed200a70e add ODROID-C2/C4/N2/N2+ support for RPI-RF-MOD/HM-MOD-RPI-PCB integration (#1323)
* add ODROID-C2/C4/N2/N2+ support for RPI-RF-MOD/HM-MOD-RPI-PCB integration

* updated rpi-rf-mod package to latest version with dtbo fixes
2021-05-04 20:42:57 +02:00
Stefan Agner
be2cfd7622 Enable UART and I2C on J2 header (#1349)
Enable UART as well as I2C on the J2 header. Also backport the upstream
version of the I2C3/RTC patch.
2021-04-29 23:04:34 +02:00
Stefan Agner
367fc1561b Use upstream SoC version detection (#1348)
With U-Boot 2021.04 we can use the upstream SoC revision detection by
enabling runtime variables and using the "soc_rev" variable.
2021-04-29 22:52:46 +02:00
Stefan Agner
5ac85a4c45 Use built-in Meson DRM driver (#1347)
It seems that the crash of the Meson DRM driver on shutdown can also be
fixed by compiling it in. The driver is also built-in in LibreELEC,
hence this is better tested by the upstream community.

Note the underlying issue seems to be a disabled clock: Since the
introduction of meson_drv_shutdown some registers are touched at a very
late stage. Those clock get disabled in meson_ee_pwrc_shutdown. It seems
that when the driver is built-in, meson_drv_shutdown gets called before
meson_ee_pwrc_shutdown and hence sidesteps the problem.

Note: This increases the kernel by a bit since DRM needs to be built-in
as well. Configure some less common used file systems as modules
(ext3/NFS).
2021-04-29 22:52:27 +02:00
Stefan Agner
3d793dc7ef Drop global patch from Raspberry Pi patchset (#1346)
Since 0001-CMD-read-string-from-fileinto-env.patch is in the global
directory to be applied for U-Boot, drop it from the Raspberry Pi
specific patch directory.
2021-04-29 11:26:55 +02:00
Stefan Agner
b76d55283d Fix reboot issue on ODROID-N2+ on Linux 5.10 (#1345)
In Linux 5.10.24 a regression has been introduced which broke reboot on
ODROID-N2(+). Interestingly the patch should improve reboot stability
for VIM3, which uses the same SoC. However, it seems that in the
ODROID-N2 case, this causes more problems then it fixes. Revert the
offending patch.
2021-04-29 01:31:13 +02:00
Stefan Agner
422bf2d1e1 Add fileenv patch for U-Boot 2021.04 (#1344)
Update of this patch has been missed. Also drop the versions for U-Boot
2020.01 and 2020.10 since they are no longer required.
2021-04-29 01:30:55 +02:00
Stefan Agner
33e0ccb9ce Linux: Update kernel 5.10.33 (#1343) 2021-04-29 01:17:02 +02:00
Stefan Agner
f86fcbd609 Fix shellcheck issues (#1341)
* Fix issue with latest shellcheck version

The latest shellcheck versions use a new error number for non-POSIX
string replacement. Change to ignore this new error number.

* Ignore shellcheck issue about not following sourced files

Newer shellcheck versions also warn when shellcheck does not follow
sourcing of files with known path:
  Not following: ./meta was not specified as input (see shellcheck -x).

We check those files separately so ignore this error for the two scripts
affected.
2021-04-29 01:15:47 +02:00
Stefan Agner
99a4d4ea75 Bump Raspberry Pi firmware to 1.20210303 (#1334) 2021-04-19 23:56:54 +02:00
Stefan Agner
0b1c349a8f Bump Raspberry Pi kernel to 1.20210303-1 (#1333)
* Update docs, the default kernel version is now 5.10

* RaspberryPi: Update kernel v5.10.17 - 623ca2ba45d86eb1b0323637330295c3f8d93c76
2021-04-19 23:56:33 +02:00
Stefan Agner
2a910b0e45 Use zip file format for virtual disk images (#1327)
Virtual Disk images are often used on Windows and/or Mac platforms where
xz is not a widely known file ending and also not supported by dafault.
Use zip which is much better known.

Keep using xz for boards since those are not meant to be extracted by
users but directly used in Etcher. Also keep using xz for qcow2, since
qcow2 is mostly used on Linux platforms where xz is available by default
and zip usually needs an extra package.
2021-04-19 10:53:22 +02:00
Stefan Agner
05ba57e006 Bump Docker to 20.10.6 (#1328)
Bump Docker to latest release 20.10.6. Also make sure to upgrade
docker-proxy with various IPv6 releated features and fixes.
2021-04-15 18:10:56 +02:00
Stefan Agner
56e0d941d0 Use sparse files when generating image (#1326)
Use sparse files instead of files written full of zeros. This speeds up
the image generation process significantly. It also makes sure that
virtual disk image formats are minimal in size.

Note: qemu-img automatically generates sparse files when detecting a
block full of zeros. But this is applied on the write side, after image
convertion: The disk image format itself still thinks the whole image
is allocated, leading to larger image than necessary. Also some output
format seem to regonize chunks of zero and create sparse files themself.

With this change, the raw source image file is a sparse file. This is
regocnized by qemu-img at read time (see block/file-posix.c), and leads
to "native" sparse files in the output format.

Some numbers
- qcow2 1.8G -> 862M (same on-disk size)
- vdi 15G -> 888M (same on-disk size)
- vhdx 30G -> 1.1G (918M -> 861M on-disk size)
- vmdk 1.8G -> 866M (about the same on-disk size)

Obviously this also affects the compressed size. But because there are
still lots of zeros, the difference in compressed size is not that big.
2021-04-15 16:27:02 +02:00
Stefan Agner
2d9540117f script/enter.sh: Exit if there is an error (#1325) 2021-04-15 13:06:43 +02:00
Pascal Vizeli
5cae40c396 Update to OS Agent 1.1.0 (#1319) 2021-04-11 21:35:18 +02:00
Stefan Agner
ae0aeb84f5 Update to OS Agent 1.0.0 (#1317)
* Update to OS Agent 1.0.0

* Use new D-Bus path/interface/object in haos-wipe.service
2021-04-08 20:22:19 +02:00
Stefan Agner
c9d091c1b3 Change OS name from HassOS to HAOS in user visible places (#1316) 2021-04-08 16:01:57 +02:00
Stefan Agner
a52f7ae02c Enable Intel IGC driver for I225-LM/I225-V Ethernet support (#1309) (#1315) 2021-04-08 15:52:29 +02:00
Stefan Agner
366bb0e495 Push dev to dev channel (#1313) 2021-04-08 15:51:59 +02:00
Stefan Agner
aff28ce60e Update buildroot to 2021.02.1 (#1312)
Signed-off-by: Stefan Agner <stefan@agner.ch>
2021-04-08 15:51:24 +02:00
Stefan Agner
40a705bbd3 Linux: Update kernel 5.10.28 (#1310) 2021-04-08 15:51:14 +02:00
Stefan Agner
1e1d10570c Use interface-name to exclude veth (#1314)
* Use interface-name to exclude veth

The type veth is not a valid type (see [1] for how to obtain a list of
valid device types. Use `driver` to filter veth.

Note: It seems that NetworkManager did not manage veth so far, so this
change seems not to be relevant in practice.

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2021-04-08 15:50:56 +02:00
Stefan Agner
fe1083822d Fix file name of generic-x86-64 defconfig (#1311) 2021-04-08 11:11:58 +02:00
Malachi Soord
b4710290b6 Typo fix in issue template (#1307) 2021-04-07 23:28:33 +02:00
Stefan Agner
bb7964ff02 Fix ODROID-C2 Ethernet on some boards (#1202) (#1305) 2021-04-07 19:21:30 +02:00
Pascal Vizeli
7f934b4470 Use updater instead of config version (#1301) 2021-04-07 15:46:56 +02:00
Jens Maus
0eef6473ba Support for RPI-RF-MOD/HM-MOD-RPI-PCB for HomeMatic/homematicIP communication (#1266)
* add eq3_char_loop package (eQ-3 char loopback kernel module)

* add generic_raw_uart package (low-latency raw UART kernel driver)

* add rpi-rf-mod package 

* add device tree overlay support for RPI-RF-MOD/HM-MOD-RPI-PCB on Raspberry Pi

* enable GPIOLIB and GPIO_SYSFS required for RPI-RF-MOD/HM-MOD-RPI-PCB support.

* add basic RPI-RF-MOD/HM-MOD-RPI-PCB support for ASUS Tinker Board

* add device tree overlay support for ASUS Tinker Board and add
haos-config.txt loading support to U-Boot boot script
2021-04-07 15:17:41 +02:00
Stefan Agner
9c6cb6e1f0 Update to U-Boot 2021.04 (#1300)
* Re-add patches missed with U-Boot 2021.04-rc4 upgrade

Also add patches for Raspberry Pi again.

* Regenerate patches for U-Boot 2021.04

* Update to U-Boot 2021.04
2021-04-07 00:37:41 +02:00
Pascal Vizeli
98ce2bec4a Remove OS mount in favor of os-agent (#1297) 2021-04-07 00:36:56 +02:00
Stefan Agner
1d6ab42f88 Re-add patches missed with U-Boot 2021.04-rc4 upgrade (#1293) 2021-04-06 19:51:07 +02:00
Stefan Agner
dde7f1d073 Bump to latest OS Agent version to support Device Wipe (#1292)
The latest version of OS Agent sets haos.wipe=1 as kernel argument to
trigger a device wipe. Let systemd pickup this kernel command line
argument and start haos-wipe.service.

This rather complex architecture allows to add other triggers in the
future, e.g. a button read in the boot loader.
2021-03-31 23:43:26 +02:00
capstan1
ef25289a6d Update datactl move documentation (#1290)
Add reboot command to the instructions. Also document how to check if data move has been successful.
2021-03-31 23:40:09 +02:00
Stefan Agner
82db02756c Make D-Bus and udisks2 available early (#1291)
* Disable systemd-logind support for udisks2

Currently udisks2 uses systemd-logind to prevent the system from
rebooting or similar operations while udisks operations are ongoing.
Unfortunately this stops us from using udisks2 during early boot since
systemd-logind is not ready at this point. Make the dependency
configureable so we can opt-out of using systemd-logind.

* Make dbus.service/socket and udisks2.service/socket available early

Disable default dependencies. This avoids those services to be ordered
after sysinit.target, and makes them available before local-fs.target
is reached. All mounts like mnt-data.mount are ordered before
local-fs.target, so breaking this dependency allows to use D-Bus before
mounting local file systems.

This seems fine when using the system bus directly from /run (instead of
/var/run, which is anyway a symlink to /run normally). It seems that
udisks misses /var/lib/udisks2 but it seems not to be required for the
features used so far.
2021-03-31 21:46:02 +02:00
Stefan Agner
905aa21e8c Only start the HA CLI if we are in the default.target (#1287)
This makes sure that we always get a Linux shell in other targets such
as the rescue.target.
2021-03-24 19:14:06 +01:00
Stefan Agner
ab19c8c6cf Improve dropbear.service to avoid failed state after stop (#1286)
So far the exit code has been evaluated, which seems to be non-zero even
with a regular term signal. With that systemd assumed the service is in
a failed state, when in fact this seems the regular behavior of dropbear
when shutting it down.
2021-03-24 19:13:43 +01:00
Stefan Agner
fdd8c246dd Add udisks2 dameon and udisks2 OS agent support (#1284)
* Add udisks2 package

Add latest release of udisks2 as a package. Also disable polkit to avoid
excessive dependencies.

* Add udisks2 and os-agent to Home Assistant OS

* Bump OS Agent to latest version with udisks support
2021-03-22 23:43:09 +01:00
Stefan Agner
23fb6b8dd3 Enable Realtek Bluetooth firmwares (#1283)
* Add RTL87xx/RTL88xx Bluetooth firmware

Enable Realtek Bluetooth dongles by adding firmware for RTL87xx and
RTL8xx devices.

* Enable Wireless firmwares for OVA and Generic x86-64 machines

Virtual machines might use hardware pass through functionality to get
direct access to wireless hardware. Add all firmwares we use in Generic
x86-64 image also to the OVA image. Also enable Ralink devices for the
two machines.

* Add RTL87xx/RTL88xx Bluetooth firmwares (#1273)

Add RTL87xx/RTL88xx Bluetooth to all devices without on-board Bluetooth.
2021-03-22 23:37:53 +01:00
Stefan Agner
45abe203f5 Restore AppArmor profile when not present on the system (#1278)
Restore our default AppArmor profile when not present on the system.
This allows to implement factory reset.
2021-03-19 10:53:49 +01:00
Stefan Agner
86cabd3d1a Remove unnecessary avahi-daemon.service configs (#1280)
The avahi-daemon.service has been removed a while ago, this extra
systemd configurations are no longer necessary.
2021-03-19 10:53:32 +01:00
Stefan Agner
8fe1d2ddbe Rename NetworkManager default profile (#1277)
* Rename NetworkManager default profile

Rename the NetworkManager default profile to "Home Assistant OS
default". Improve documentation on how to reset to default
configuration.
2021-03-18 17:35:04 +01:00
Stefan Agner
a15671a530 Remove unnecessary avahi-daemon.service configs (#1279)
The avahi-daemon.service has been removed a while ago, this extra
systemd configurations are no longer necessary.
2021-03-18 16:06:51 +01:00
Stefan Agner
6f512527aa Bump to U-Boot 2021.04-rc4 (#1275)
Bump to the latest U-Boot release 2021.04-rc4. This alows to drop quite
some patches which have been sent to the mailing list or picked from the
mailing list and have been merged upstream now.
2021-03-16 21:36:11 +01:00
Stefan Agner
7e702a2ab2 Clarify network configuration support (#1276)
Clarify what type of network configuration is supported.

Related to: #1262
2021-03-16 12:52:41 +01:00
Stefan Agner
37d2f13e49 Update Buildroot to 2021.02 (#1274) 2021-03-16 11:45:43 +01:00
Stefan Agner
0a2fdf47b3 Add OS agent (#1269)
* Add OS Agent

* Do go vendoring as part of the buildroot build

* Allow to skip confirmation in datactl
2021-03-12 18:00:39 +01:00
Stefan Agner
55f8704523 Update Github Actions to use generic-x86-64 (#1267) 2021-03-11 23:29:21 +01:00
Stefan Agner
19c03729f3 Accept installation with intel-nuc in compatible string (#1265)
* Accept installation with intel-nuc in compatible string

For the OS release 6 intel-nuc gets renamed to generic-x86-64. Since
the machine name is in the OS compatible string we need to make sure
OS release 5 installation can update to release 6 despite the new
machine name.
2021-03-09 23:53:15 +01:00
Stefan Agner
66e5ea3b4b Rename hassos to haos (#1213)
* Change HASSOS_ID from hassos to haos

Use a rauc install-check hook to make this update compatible with OS
releases using hassos in the compatible string.

* Use home-assistant as organization in CPE_NAME

Align with Home Assistant core which uses home-assistant with a dash as
organization in CPE_NAME.
2021-03-09 15:27:12 +01:00
Stefan Agner
28e3b109b7 Rename Intel NUC machine to Generic x86-64 (#1209)
* Rename Intel NUC machine to Generic x86-64

The Intel NUC machine has evolved and supports various x86-64 machines
today. Rename the board.

Note that this does not address the migration issue. This will be
handled separately.

* Update Scripts/Documentation
2021-03-09 15:25:35 +01:00
ryddler
a5256fb2d0 Adding gasket/apex kernel modules so that Google Coral EdgeTPU pcie devices can be used. (#1263) 2021-03-08 11:15:19 +01:00
Stefan Agner
f358f322da Bump Buildroot to 2021.02-rc3 (#1260)
* Rebase patches to Buildroot 2021.02-rc3

* Update Buildroot to 2021.02-rc3

* Declare Kernel headers to be Linux version 5.10 (since they are, and new Buildroot knows about 5.10)
2021-03-04 00:50:33 +01:00
Stefan Agner
b77d633382 Remove the no longer required busybox-acpid service (#1261)
The BusyBox option has been disabled in #1210.
2021-03-04 00:49:04 +01:00
Stefan Agner
cd022e6d5e Update Raspberry Pi to Linux 5.10 (raspberrypi-kernel_1.20210201-1) (#1258)
Move to the new Linux 5.10 based kernel for all Raspberry Pi boards.
This uses the version of the last OS version used in Raspberry Pi OS
raspberrypi-kernel_1.20210201-1.
2021-03-02 15:33:36 +01:00
Stefan Agner
27e6aa60fd Add Ralink rt27xx/rt28xx/rt30xx driver and firmware (#1242) (#1248)
* Add Ralink rt27xx/rt28xx/rt30xx firmware (#1242)

Add Ralink firmware for devices which have the driver enabled. The
firmware's are rather small at 20KiB in total.

* Remove Ralink and other WiFi drivers from Tinker Board

The board has on-board WiFi, no need for Ralink drivers to be enabled.

* Add Ralink WiFi drivers and firmware to ODROID boards
2021-03-01 22:34:49 +01:00
Stefan Agner
dc795cfc51 Update Bluetooth firmware for CYW43455 (Raspberry Pi 3 B+/4) (#1250)
This matches the 1.2-4+rpt8 release of Raspberry Pi OS' bluez-firmware
package. It addresses mainly addresses Spectra fix for CYW43455
(CVE-2020-10370).

Also update the Bluetooth start scripts with CM4 support and some
minor improvements.
2021-03-01 16:40:29 +01:00
Fredrik Erlandsson
4d2229e50b Fix: ovf:id to get Synology VMM detect Guest Agent (#1233) 2021-02-26 18:38:42 +01:00
Stefan Agner
82a40de894 Add --cpu-rt-runtime to allow Docker allocate real-time CPU time (#1235) (#1236)
* Add --cpu-rt-runtime to allow Docker allocate real-time CPU time (#1235)

* Enable Supervisor's CPU bandwith allocation feature (#1235)

Since we have CONFIG_RT_GROUP_SCHED enabled in the Home Assistant OS
kernel the Supervisor needs to enable CPU bandwith allocation for
Add-Ons which need real-time scheduling. Set the appropriate environment
variable.
2021-02-25 18:40:24 +01:00
Stefan Agner
5c17e0974b Don't filter previous releases on dev branch (#1246)
It seems that the release drafter filters commits which have been made
before the last release has been made. If the last release is a
unrelated stable release, this clears the full changelog for the next
major release. It seems `filter-by-commitish` should prevent that.

While at it, also set `commitish` to be dev (which is the default, but
being explicit certainly doesn't hurt).
2021-02-25 15:43:08 +01:00
Stefan Agner
9db5dc7ab8 Fix Bluetooth on ASUS Tinker (#1234)
* Improve ASUS Tinker Board support for 5.10

Remove patches which are unnecessary. Revert DMA for UART as it seems to
cause more problems (its also what Armbian is doing). With that
Bluetooth firmware seems to load without errors when loaded before the
bluetooth daemon is running!

Note: It seems that the board overheats quite quickly. With Armbian,
without load, that seems not to be a big deal, but HAOS does quite a
bunch at startup, leading the CPU to reach the 90°C trip point. Maybe it
was related to the rather closed shelf I have the ASUS Tinker board
running, but only after using a fan the board behaved for me.

* Use hardware flow control explicitly

The rtk_hciattach program uses hardware flow control by default (judging
from tty settings after starting the program). Just to be sure,
explicitly request 115200 and hardware flow control.
2021-02-19 23:53:18 +01:00
Stefan Agner
9ba4dd5524 Linux: Update kernel 5.10.17 (#1231) 2021-02-18 11:05:36 +01:00
pergolafabio
32b037af32 Add SocketCAN support (#1228)
* Add SocketCAN support

A Controller Area Network (CAN bus) is a robust vehicle bus standard designed to allow microcontrollers and devices to communicate with each other's applications without a host computer. It is a message-based protocol, designed originally for multiplex electrical wiring within automobiles to save on copper, but it can also be used in many other contexts. For each device, the data in a frame is transmitted sequentially but in such a way that if more than one device transmits at the same time, the highest priority device can continue while the others back off. Frames are received by all devices, including by the transmitting device.

* Update also for GS_USB support

There is a port of the candleLight USB to CAN firmware for CANable. The port works very well under Linux using the gs_usb driver. This firmware does not use slcan, so it is not interchangeable with the stock firmware. However, the CANable appears as a CAN interface natively in Linux

With the candlelight firmware, simply plug in the CANable and the device will enumerate as can0. Set the baud rate and bring the interface up with the following command, and you're good to go!

ip link set can0 up type can bitrate 500000

* Update for Peak PCAN-USB Support
2021-02-17 10:26:00 +01:00
Stefan Agner
c2c05312a0 Increase maximum IGMP memberships (#1222)
Currently Linux has a limit of IGMP memberships of 20. When trying to
add membership to more than that, Linux fails with:
OSError: [Errno 105] No buffer space available

Allowing more memberships should not really be problematic as memory is
allocated dynamically when membership is actually added.

However, there is a protocol limit of how many memberships a host can be
in. The number of memberships needs to fit in a single group report
datagram of 64kB. In total 5459 group records fit in a datagram, but due
to IP header options this might be slightly smaller in practise.
(see https://github.com/home-assistant/core/issues/45957).

Use a limit of 1024, which should be plenty of headroom in both
directions.

Related to: https://github.com/home-assistant/core/issues/45957
2021-02-15 19:27:35 +01:00
Stefan Agner
b91c432fa8 Deploy all variants of the Raspberry Pi firmwares (#947) (#1219) 2021-02-09 14:06:13 +01:00
Stefan Agner
023d0b27f5 Bump out-of-tree Intel e1000e driver to build with Linux 5.10 (#1215) 2021-02-09 14:06:00 +01:00
Stefan Agner
57ffd6444b Update Linux kernel to 5.10 LTS (#1214)
* Drop ODROID specific kernel update script

With the jump to Linux 5.10 LTS we can use the same upstream kernel for
Hardkernel ODROID boards as well. Extend the update-kernel-upstream.sh
to support the ODROID boards.

* Linux: Update kernel 5.10.13
2021-02-05 18:52:16 +01:00
Stefan Agner
8bbc330407 Disable acpid (#1210)
Disable Busybox' acpid since systemd-logind provides the same
functionality.
2021-02-05 17:11:13 +01:00
Stefan Agner
76853d1171 RaspberryPi: Update firmware 0d458874a89921fbe460e422b239695e1e101e2b (#1211)
* RaspberryPi: Update firmware 0d458874a89921fbe460e422b239695e1e101e2b

* update-firmware-rpi.sh: Fix to work with new hash files
2021-02-05 16:30:31 +01:00
Stefan Agner
0daf748c97 Fix partition resize for MBR for all sizes (#1193) (#1204)
It seems that Busybox shell (ash) cannot calculate the disk size
properly probably due to integer overflow. Use jq to calculate the last
usable LBA which seems to be able to handle large integers.
2021-02-03 17:42:04 +01:00
Stefan Agner
8aabf65bb7 Bump systemd to latest stable release 246.10 (#1205) 2021-02-03 17:41:51 +01:00
Stefan Agner
825ef58f85 Update buildroot to 2020.11.2 (#1200)
Signed-off-by: Stefan Agner <stefan@agner.ch>
2021-02-03 17:23:40 +01:00
Pascal Vizeli
614ff50394 Map host udev data ro to supervisor container (#1186)
* Mapp host udev data ro to container

* fix lint

* fix paths
2021-01-29 17:47:24 +01:00
Stefan Agner
907857985a Disable fsck.fat for boot partition (might help #1125) (#1190)
There are incident reports on the internet where poeple report that
fsck.(v)fat actually leads to problems rather file system fixes. Around
the time when Home Assistant OS added fsck.fat for the boot partition,
reports of empty boot partitions or file with weired filenames started
to appear. This could be caused by fsck.fat.

Disable fsck on the boot partition.
2021-01-29 15:02:08 +01:00
Stefan Agner
846512a283 RaspberryPi: Update kernel 5.4.83 - 76c49e60e742d0bebd798be972d67dd3fd007691 (#1187) 2021-01-29 15:01:21 +01:00
Pascal Vizeli
e646650a7e Fix connectivity check updated NM (#1182) 2021-01-28 10:36:00 +01:00
Stefan Agner
038f1b4bd6 Add GPIO fan support for ODROID-N2 (#1117) (#1166) 2021-01-11 22:50:30 +01:00
Mario Limonciello
d7c09e15b9 Allow setting BUILDDIR in the build to dictate where to find directories (#1153)
This allows building many components without elevated permissions or
needing to do it within a container.
2021-01-11 19:56:51 +01:00
Stefan Agner
2c3c066ea0 Add GPIO power button support for ODROID-N2 (#1161) (#1165) 2021-01-11 18:14:07 +01:00
Mario Limonciello
184eb9e048 Add r8169 firmware into intel_nuc build (Fixes: #1150) (#1152) 2021-01-08 23:23:56 +01:00
Stefan Agner
ce1f07126f Enable memory and CPU hotplugging for virtual machines (#1156) (#1158)
Use udev rules to set the CPU online. For memory, we let the kernel
bring memory online automatically. This is preferred as udev rule
processing might be delayed in a low memory situation, see:
https://lwn.net/Articles/668944/
2021-01-05 23:19:42 +01:00
Stefan Agner
0188f24a0d Fix partition resize for MBR (#1149)
Partition handling for disks with 4k sectors broke partition resizing
when using MBR disk label. It seems that sfdisk doesn't calculate the
last LBA for diks with MBR label. Calculate the last usable LBA ourselfs
in the MBR case.
2020-12-31 14:58:21 +01:00
Stefan Agner
581de22a06 Fix boot from eMMC on ODROID-C2 (#1142) (#1148)
Latest U-Boot broke boot from eMMC on ODROID-C2. Revert the offending
device tree change to make the system boot again.
2020-12-31 14:45:31 +01:00
Stefan Agner
9764273894 Fix handling of disks with 4k sector size (#1141) (#1146)
The calculation whether to resize the partition only works with disks
with 512 byte sector size. Use values provided by sfdisk exclusively to
make sure comparing the same sector size.

Furthermore, it seems that sgdisk does not like sfdisk's backup GPT
placement:
$ sgdisk -e /dev/zram1
Warning! Secondary partition table overlaps the last partition by 250 blocks!

Today it seems sfdisk can handle GPT quite well. Use sfdisk for all
operations in hassos-expand.
2020-12-30 18:12:44 +01:00
Mario Limonciello
cc53ad4fd6 Add LPSS support for intel-nuc (#1145)
This is needed for MMC to enumerate properly (Fixes: #1112)
2020-12-30 16:04:34 +01:00
Stefan Agner
142e7df6cf Drop e2scrub (#1144)
The e2scrub utilities only make sense on system which use LVM. They
come with e2fsprogs and can't be disabled currently. Drop them manually
in our post-build script.
2020-12-29 23:55:38 +01:00
Stefan Agner
4d6991fd45 Fix 64-bit image to boot on Raspberry Pi 400 (#1134) (#1143)
Add the missing PCIe node to make U-Boot's PCIe driver happy on
Raspberry Pi 400 as well.
2020-12-29 23:55:27 +01:00
Stefan Agner
98ab22c119 Add sulogin to make the systemd recovery.target work (#1139)
The systemd recovery.target starts a shell using sulogin. This can be
useful to debug Home Assistant OS if it isn't able to boot completely
anymore.
2020-12-29 20:57:52 +01:00
Stefan Agner
381d2aa8f7 Fix systemd-udevd rule warning (#1136)
systemd-udevd substitutes variables starting with $ in the PROGRAM
argument. If a shell variable is to be used, two $ need to be used to
escape properly. This fixes three instances of the following warning:
Invalid value "..." for PROGRAM (char 58: invalid substitution type), ignoring, but please fix it.
2020-12-29 20:57:29 +01:00
carras
594c24eab7 Update network.md (#1114)
* Mention Supervisor network configuration capabilities
2020-12-29 13:48:06 +01:00
Stefan Agner
be2a64f4d2 Add hassos-apparmor dependency to supervisor (#1140)
The supervisor container requires the "hassio-supervisor" AppArmor
profile. Make sure our AppArmor service hassos-apparmor is a dependency
of the hassos-supervisor.service.
2020-12-29 13:46:40 +01:00
Stefan Agner
51bd8bd0e5 Add eMMC support for Intel NUC with ACPI (#1112) (#1137)
Also enable CONFIG_MMC_SDHCI_ACPI which seems to be required for Intel
NUC with eMMC.
2020-12-29 00:37:24 +01:00
Stefan Agner
4fa3329d59 Update buildroot to 2020.11.1 (#1135)
Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-12-28 23:48:23 +01:00
Stefan Agner
7959113c97 Use systemd-growfs (#1133)
* Use systemd-growfs instead of resize2fs (#1106)

Since systemd 236 systemd has a built-in file system growing mechanism.
The mechanism relies on the kernels online file system resize
capabilities instead of the external resize2fs utility. Online resizing
is supposedly much faster since the kernel takes care of things.

This also makes sure that external file systems get resized which
previously have not been taken care of.

* Drop HA OS specific file system resizing

Since we have systemd-growfs in place now we can drop our file system
resizing code.

* Make sure /dev/disk/by-label/hassos-data is present after resizing

Note: systemd will retry mnt-data.mount later, so at least in theory
this shouldn't really matter. However, the journal has a lot of churn
due to that reordering.
2020-12-28 23:46:55 +01:00
Stefan Agner
cd385be81f Don't use page table mapping for compressed pages (#1129) (#1132)
It seems that page table mappings for compressed tables cause issues in
certain situation leading to "zram: Decompression failed!" errors.
Upstream Linux seems to have recognized the problem and a patch to drop
the functionality entirly has been proposed:
https://lore.kernel.org/linux-mm/20201117135632.GA27763@infradead.org/
2020-12-28 15:43:21 +01:00
Stefan Agner
8ed6bc2e31 Add firmware for TI 3410/5052 USB to UART adapters (#1124) (#1126)
* Add firmware for TI 3410/5052 USB to UART adapters (#1124)
2020-12-28 15:40:53 +01:00
Stefan Agner
68e63d15e5 Add eMMC support for Intel NUC (#1112) (#1123)
Enable CONFIG_MMC and friends for Intel NUC with eMMC.
2020-12-22 18:43:19 +01:00
Stefan Agner
89c31bb967 Enable hidraw driver (#1120) (#1122)
* Enable hidraw driver (#1120)

The hidraw driver is required by some IoT devices such as Wyze sense or
Jablotron JA-100. Enable the driver on all platforms by default.
2020-12-22 18:43:12 +01:00
Stefan Agner
e3120df5d0 Disable DNS over TLS by default (#1113) (#1121)
It seems that on certain setups the default DNS over TLS mode
"opportunistic" causes delays of ~10s when trying to resolve names. This
is probably caused by providers and/or firewall setups not properly rejecting
connections on port 853.

It seems that also other distributions (such as Arch Linux) still
disable DNS over TLS currently. Side step issues with DNS over TLS by
disabling it for now.
2020-12-22 18:42:58 +01:00
Thanasis
59b687f0db Mention potential need for quirks on usb boot (#1111)
Directing people from discord to this page but there wasn't any mention they will likely be needing quirks enabled for usb boot on Rpi4. Also some minor layout adjustments on that section.
2020-12-21 11:31:02 +01:00
Stefan Agner
cee0123105 Bump systemd to latest stable release 246.9 (#1110) 2020-12-20 17:26:31 +01:00
Stefan Agner
22aede0278 Copy the Raspberry Pi 4 EEPROM only if we deploy the package (#1104)
Fix build by only copy the EEPROM update to the boot partition if we
actually enable the EEPROM package.
2020-12-18 19:29:46 +01:00
Stefan Agner
dadc82ae37 Document Hardkernel WiFi modules WiFi status (#1099) 2020-12-18 16:41:13 +01:00
Stefan Agner
26af1dd907 Disable Raspberry Pi EEPROM upgrade (#1045) (#1103)
The EEPROM upgrade 2020-10-28 causes issues with JMS583 or JMS580
controller from Jmicron. Others reported that the same update fixes
reboot issues. Currently there is no Raspberry Pi 4 firmware which works
for all cases. Therefor don't ship an EEPROM upgrade so users can flash
and continue using what works for their setup.
2020-12-17 16:30:02 +01:00
Stefan Agner
c515dd19f2 Don't suspend Home Assistant OS on closed lids (#1093) (#1100)
Old Laptops are a popular choice to run Home Assistant: They have low
power consumption, are relatively fast and cheap to come by. However,
closing their lid by default puts a Linux system into suspend. This is
not what the typical user of Home Assistant OS wants. Ignore lid
activity in any state by default.
2020-12-17 16:29:45 +01:00
Stefan Agner
a39b8576e8 Deploy firmware for RTL8188CUS chipset (#1098)
The Hardkernel WiFi Module 3 comes with a Realtek RTL8188CUS chipset.
Make sure to ship the latest firmware files provided by kernel.org.
2020-12-17 16:28:50 +01:00
Stefan Agner
a4d8e8492f Add RTL8812AU driver from aircrack-ng (#1097)
* Add Realtek RTL8812AU out-of-tree driver

This adds support for Realtek RTL8812AU devices such as the Hardkernel
WiFi Module 5A (with the RTL8811AU chipset, supported by this driver as
well). This patch uses Realtek driver 5.9.3.2 which has been made to
compile up to Linux 5.10.

Note: This driver does not seem to support 5GHz networks! But it seems
the only driver which supports the RTL8811AU chipset and also works with
recent mainline drivers...

* Enable RTL8812AU driver for Hardkernel modules

The WiFi Module 5A comes with a RTL8811AU chipset. Enable the driver for
all Hardkernel modules.
2020-12-17 16:28:36 +01:00
Stefan Agner
323f415fa8 Mount boot partition sync (#1092) (#1101)
When we write the update to the boot partiton, there is nothing which
makes sure that data is written to disk. This leaves a rather large
window (probably around 30s) where a machine reset/poweroff can lead
to a corrupted boot partition. Use the sync mount option to minimize the
corruption window.

Note that sync is not ideal for flash drives normally. But since we
write very little and typically only on OS update to the boot partition,
this shouldn't be a problem.
2020-12-17 14:09:43 +01:00
Stefan Agner
4255425b93 Deploy Raspberry Pi 400 and Compute Module 4 device tree (#1094)
To properly support those devices the dedicated device tree should be
present on the boot partition. Make sure those device trees get
deployed.
2020-12-16 21:23:22 +01:00
Stefan Agner
7c70e3ef84 Increasee disk image capacity to 32GB in OVF as well (#1084) (#1088)
After increasing the actual disk image size the capacity field in the
OVF description file still was mentioning 6GB. This seems to be
problematic for VMware hypervisor. Increase the size to 32GB as well.
2020-12-15 13:22:42 +01:00
Pascal Vizeli
d42f80c65e Update data disk documentation (#1082)
* Add Data disk picture to documentation

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2020-12-13 11:08:59 +01:00
Stefan Agner
c3cc81249b Upload ova (Open Virtualization Appliance) image as well (#1080) 2020-12-12 12:57:37 +01:00
Stefan Agner
d8273af0ad Bump version to 6.0 2020-12-12 11:49:46 +01:00
Stefan Agner
a6bdf2c1c9 Set OS pretty name to Home Assistant OS 2020-12-11 12:59:17 +01:00
Stefan Agner
14bb885ce9 Odroid: Update kernel 5.9.13 (#1077) 2020-12-10 22:19:00 +01:00
Stefan Agner
e5eefc9978 Use correct label for ODROID boards in release drafter (#1078)
The correct label for Hardkernel's ODROID is board/odroid.
2020-12-10 22:08:41 +01:00
Stefan Agner
6001c34091 Linux: Update kernel 5.4.82 (#1076) 2020-12-10 22:03:50 +01:00
Stefan Agner
17d0cdf823 Fix another boot script syntax error on Tinker Board (S) (#1074) (#1075) 2020-12-10 15:06:56 +01:00
Stefan Agner
8aceb287de Add major.minor to development build sub-directory (#1073) 2020-12-10 00:45:31 +01:00
Stefan Agner
e42835f163 Cap eMMC frequency to 24MHz in U-Boot for ODROID-N2(+) (#1072)
* Revert "Fix boot from 128GB Micron eMMC on ODROID-N2(+) (#1064)"

This reverts commit 162084082e.

This patches seem to cause issue on a ODROID-N2 with 32GB eMMC.

* Cap eMMC frequency to 24MHz in U-Boot for ODROID-N2(+)

Also remove the ODROID-C4 specific patch.
2020-12-10 00:45:05 +01:00
Stefan Agner
1a8f9ca2e3 Avoid waiting for external drive unnecessarily (#1066)
* Avoid waiting for external drive unnecessarily

Even though the condition to start hassos-data.service is not met (the
file /mnt/overlay/data-move is not there by default), it seems that
systemd waits for the dependencies for hassos-data.service. Don't
Require or Wants any dependencies which might not be present by
default.

* Use systemd to wait for partition using partlabel device

* Use sfdisk which allows to wipe filesystem signatures

Even though we zap the partition table using sgdisk, the file system
superblock (which contains the file system label) does survive. This
can cause problems when trying to reuse a disk previously already
labeled using hassos-data: It might take precendence on next boot
over the existing data partition on the eMMC.

Make sure to clean all file system signatures using sfdisk.
2020-12-08 01:11:00 +01:00
Stefan Agner
162084082e Fix boot from 128GB Micron eMMC on ODROID-N2(+) (#1064) 2020-12-07 22:18:35 +01:00
Pascal Vizeli
c2098e1cf4 No random mac for wifi scan (#1061) 2020-12-05 22:31:19 +01:00
Stefan Agner
22c668b500 Add support for LSI53C10XX SCSI controller commonly used in VMs (#1056) (#1060)
VMware as well as Qemu emulate LSI53C1030 SCSI controller when choosing
a SCSI controller has host interface for disks. For VMware this seems
to be the default choice. Enable the driver by default.
2020-12-05 19:16:07 +01:00
Stefan Agner
6672046b6f Make the datactl command more robust (#1059)
* Make the datactl command more robust

Validate target disk (partition) size to avoid a copy attempt which will
fail. If e2image operation fails, make sure the leftover copy is not
regonized as data partition.

* Fix hassos-data service device unit dependencies
2020-12-04 20:55:35 +01:00
Stefan Agner
78b456d05c Fix U-Boot crash seen on RPi400 (#1057) (#1058) 2020-12-04 20:54:49 +01:00
Stefan Agner
2cc78abe56 Enter console if data partition is missing (#1055)
In case the data partition is missing avoid using the Docker command.
The Docker command triggers a socket activation, which in turn makes
systemd wait for the data partition. This blocks entry into the shell
forever.

Just enter the shell in case data partition is not mounted.
2020-12-03 20:29:07 +01:00
Stefan Agner
46bb12844f Rewrite datactl command (#1046)
* Rewrite datactl command

Prepare the target partition as part of the datactl command. Rely on
partlabel for the target disk since we are always using GPT on the
target disk. Use systemd and partlabel mechanism to wait and find
the target data disk. Keep using the file system label to identify
the source disk.

Also use e2image instead of raw dd to move data. This should
speed up the processes significantly.

* Fix corner case when reusing same disk again
2020-12-03 20:05:02 +01:00
Stefan Agner
1537d02408 Lower console log level after boot-up (#1054)
Some console logs are really not helpful in practise and are more
confusing then helpful. Show warnings and higher on console after
boot-up.
2020-12-03 15:38:10 +01:00
Stefan Agner
a66591166f Update BusyBox configuration (#1053)
* Add find utility helpful to find things

* Add hwclock utility useful to debug RTC issues

* Remove several utilities which are provided by util-linux (such as
  dmesg, mount, blkid etc.)

* Drop unused utilities e.g. for raw nand (nandread/write/ubi)
2020-12-03 15:37:29 +01:00
Stefan Agner
7443c45001 Add explicit apparmor dependency for Docker (#1052)
Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-12-03 15:36:45 +01:00
Stefan Agner
a4f5670cd8 Update buildroot to 2020.11 (#1051)
Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-12-03 12:34:02 +01:00
Stefan Agner
c9c5f1b3e9 Fix boot script issue on Tinker Board (S) (#1043) (#1044) 2020-12-02 13:44:28 +01:00
Stefan Agner
b4c9f2fce2 Fix ethernet link not comming up on ODROID-C2 (#1042)
Use the latest patches from the mailing list to fix Ethernet on
ODROID-C2/N2(+).
2020-12-01 14:54:41 +01:00
Pascal Vizeli
c48184cf91 Set NetworkManager default value / fix mDNS in OTA updates (#1041)
* Set NetworkManager default values / fix mDNS in OTA updates
2020-12-01 10:15:06 +01:00
Stefan Agner
681fe1421a Merge pull request #1039 from agners/fix-ethernet-link-restart
Fix ethernet link not comming up (#1038)
2020-12-01 01:03:22 +01:00
Stefan Agner
acc293b662 Fix ethernet link not comming up (#1038)
Fix ethernet PHY reset timing to make sure the link comes up when
reconfiguring the link.

Also drop 0006-clk-meson-g12a-mark-fclk_div2-as-critical.patch which has
been applied in v5.9.2 stable release.
2020-12-01 00:53:18 +01:00
Stefan Agner
3a67e2e8c4 Merge pull request #1036 from agners/fix-barebox-use-run
Fix Barebox Environment handling
2020-11-30 17:03:08 +01:00
Stefan Agner
8682d8af78 Fix Barebox Environment handling (#1037)
Similar to U-Boot dt-utils (barebox-state in particular) use /var/lock
as location for lockfiles. Use the recommended location /run.
2020-11-29 22:34:06 +01:00
Stefan Agner
b82707ff9a Pass empty VERSION_DEV variable to make for release builds 2020-11-28 19:27:12 +01:00
Stefan Agner
525dcfedfb Upload xz output files instead of gz 2020-11-28 19:27:11 +01:00
Stefan Agner
18cc261e35 Bump linux buildroot (#1032)
* Update buildroot to 2020.11-rc3

Signed-off-by: Stefan Agner <stefan@agner.ch>

* ODROID: Update kernel 5.9.11

* Remove patch which has been applied upstream

* Linux: Update kernel 5.4.80
2020-11-28 16:19:21 +01:00
Stefan Agner
bda9c3d715 Fix ODROID-N2(+) SoC version banner (#1031)
The version banner was showing "Amlogic Meson G12A (Unknown) Revision
28:0 (0:0)" in all cases instead of the correct SoC name and revision.
Make sure the SoC revision is properly read also for the banner.
2020-11-27 16:37:04 +01:00
Stefan Agner
4cbbeeb7dc Improve OVF descriptor (#1030)
* Add sound card by default using the hdaudio driver (#925)

* Use virtio-net for VirtualBox

The virtio-net driver is a paravirtualization driver which means less
overhead than virtualizing a full network card. The driver is supported
by VirtualBox since several releases by now.

* Use full OS name in product name.
2020-11-27 16:36:44 +01:00
Stefan Agner
beaad9ac9b Fix boot script issues (#1024) (#1026)
The change "Avoid trying to boot non-existing kernel image in failover
case" introduced a broken boot script on Raspberry Pi (when booting from
partition B) and ODROID-XU4.
2020-11-27 13:47:46 +01:00
Stefan Agner
bf1eaf44d5 Raspberry Pi: Add RPi400 and CM4 support (#1025)
Backport patches for RPi400 and CM4 support. Tested on a RPi400 which
seems to successfully boot and run Home Assistant OS with this.
2020-11-26 23:13:57 +01:00
Stefan Agner
c94f7933ef RaspberryPi: Update kernel 5.4.79 - 9797f1a4938c20139b00a25de93cc99efb5c291b (#1023) 2020-11-26 23:04:39 +01:00
Stefan Agner
01475a8c45 Fix boot from USB for Raspberry Pi 32-bit installations (#987) (#1022) 2020-11-26 23:04:24 +01:00
Stefan Agner
9436661958 Bump dev channel after build (#1021)
* Bump dev channel after build

Bump version on dev channel automatically when building a dev branch
pre-release.

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2020-11-26 23:04:05 +01:00
Stefan Agner
e88ae15272 Add sub-directory per development build (#1020)
HAOS builds add a lot of files and things get quickly messy. Use a
directory per build.

Also don't abort the complete build if a single board failed, we still
might be interested in the rest.
2020-11-26 00:34:46 +01:00
Aman Gupta Karmani
1fa53bc3dc Add rpi-eeprom firmware (#939)
* Add 2020-10-28 beta EEPROM

This improves boot from USB and speeds up boot times.
also includes sd card v1 boot reliability.
see https://github.com/raspberrypi/rpi-eeprom/pull/246

Also add HDMI_DELAY=0 so HDMI display is always visible
for easier debugging.
2020-11-26 00:33:48 +01:00
Stefan Agner
1a6dcbbf5b Compress images using xz instead of gzip (#1018)
The xz compression allows higher compression rates and higher speeds,
a quick measurement lead to this numbers:
gzip --best: compression 131.11s, decompression 9.797s (299M)
xz -3 (single thread): compression 95.13s, decompression 14.902s (228M)
xz -3 (multi thread): compression 12.146s, decompression 14.902s (228M)
2020-11-26 00:29:11 +01:00
Stefan Agner
4be3dee0b4 Add dev build workflow (#1017)
* Add development build version part to version number

Add third part in the version number to indicate development builds.
Generate a default version number based on the date, e.g.
"5.6.dev20201124".

* Add GitHub Action workflow for development builds

Add another GitHub workflow for development builds. Make it triggered
only for now. The version number is generated by the workflow and
passed to all builds to make sure all builds have the same development
build version.

* Add documentation
2020-11-25 10:52:28 +01:00
Stefan Agner
5756969be9 Avoid trying to boot non-existing kernel image in failover case (#1016)
* Avoid trying to boot non-existing kernel image in fail-over case

The A/B update system automatically switches to the other boot slot when
booting fails. However, in a fresh installation, only boot slot A
exists. If booting fails three times (e.g. if somebody plugs out power
before the slot can be marked as good), then the system switches to boot
slot B which does not contain a kernel image yet. Avoid trying to boot
the non-existing kernel image.

With this change, if slot B is empty U-Boot will restore both slots to 3
attempts and retry booting from slot A on next reboot:

```
Trying to boot slot B, 2 attempts remaining. Loading kernel ...
** Unrecognized filesystem type **
No valid slot found, resetting tries to 3
storing env...
```

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-11-24 17:33:44 +01:00
Stefan Agner
8442d2ccfa ODROID: disable USB enumeration (#1015)
* Fix N2+ boot by disabling USB enumeration

On some devices USB enumeration in U-Boot seems to freeze:
starting USB...
Bus usb@ff500000: Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb@ff500000 for devices... <freeze>

We don't use USB currenty in the U-Boot script, disable it for now.

* Disable USB enumeration on all ODROID devices
2020-11-23 11:10:55 +01:00
Stefan Agner
300986f129 Increase OVA disk image default size to 32GB (#1009)
The current default size of 6GB can fill up pretty quickly. Since most
disk images we offer resize dynamically its not really problem to ship
with a bigger default size. It avoids support cases when people forget
to increase the disk image size.
2020-11-21 10:21:38 +01:00
Stefan Agner
08cbbe8988 Improve issue reporting template (#1008) 2020-11-20 21:57:24 +01:00
Stefan Agner
827c97f0ca Make sure ALSA modprobe parameters get applied (#1007)
* Remove busybox Linux module support

Since systemd relies on the upstream Linux kernel module handling
utility "kmod" the busybox implementations are not required. Already
today the official "kmod" utility takes precedence:
haos # ls -la /usr/sbin/*mod*
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/depmod -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/insmod -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/lsmod -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/modinfo -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/modprobe -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/rmmod -> ../bin/kmod

* Move modprobe configuration alsa-base.conf to correct location

The official modprobe package from kmod checks three locations:
/etc/modprobe.d/, /lib/modprobe.d/ and /run/modprobe.d/. Since usr-move
/lib is a symlink to /usr/lib, the correct location for distribution
provided modprobe files is /usr/lib/modprobe.d.
2020-11-20 19:35:20 +01:00
Stefan Agner
3f5b28a0b4 Use GitHub Actions (#1005)
* Initial version of release workflow using GitHub Actions

Add release workflow using GitHub Actions to replace the current Azure
DevOps pipeline. Currently the same functionality is implemented. This
uses multiple builds in parallel to make better use of CPU resources.

Remove Azure DevOps pipeline.

* Add GitHub Actions workflow for pull-request checks

Lint Dockerfile and shell scripts when PRs are opened.

* Use multiple runners in parallel

Buildroot has stretches where CPU resources are not fully utilized.
Spawn multiple builds accross builders to increase load. Also sort them
by architecture to maximize ccache hit rate.

* Checkout before validate version
2020-11-19 12:29:21 +01:00
Stefan Agner
7c25f7c187 Fix DNS resolving (#1004)
* Add resolved.conf to disable stub resolver and DNSSEC

There are Add-Ons which try to bind port 53 on all interfaces including
127.0.0.53. Disable the stub resolver to make them continue working. We
don't need the resolver currently anyway.

Also disable DNSSEC to make sure the baords can access a NTP time server
even when their time is incorrect (since DNSSEC validation may fail).
This is a known chicken-egg problem with systemd-resolved/systemd-timesyncd
and might be addressed in a future version, with what we can reenable
DNSSEC:
https://github.com/systemd/systemd/issues/5873

* Make sure resolve gets added only once to nsswitch.conf

Only add resolve to nsswitch.conf if not already present.
2020-11-18 09:56:38 +01:00
Stefan Agner
52e21c9ccf Fix shellcheck warnings (#1003)
* Use double quote to prevent globbing and exit with error in case
  directory doesn't exit in hassos-hook.sh

* echo flags are undefined in POSIX, use bash instead in
  bluetooth-rtl8723
2020-11-17 20:06:03 +01:00
Stefan Agner
8d448a130c Set permissions for builder on entry (#1002)
Make sure the builder can write the ccache directory. This is useful
e.g. when using a Docker volume or a newly created directory.
2020-11-17 16:27:30 +01:00
Stefan Agner
39debca9fc Fix U-Boot environment handling (#1001)
* Use /run as default location for lock files for U-Boot tools

While there is a command line parameter to set the lock file explicitly,
there are other tools invoking fw_setenv (in particular rauc) which do
not set the lock file. Using /run by default makes fw_setenv use the
correct lock file in all situations.

* Don't explicitly set lock file location

Since we patch U-Boot tools to use /run by default setting it explicitly
is unnecessary.
2020-11-17 15:15:50 +01:00
Stefan Agner
29e92f4231 Add on-board RTC support for ODROID-N2+ (#999)
Make the NXP PCF8563TS on-board RTC the primary RTC of the system.
2020-11-17 10:49:01 +01:00
Stefan Agner
0797bccc36 Improve release drafter (#998)
* Change titels to reflect official/new naming

* Use GitHub Actions to trigger Release Drafter

The Add-On is no longer developed and GitHub Actions is the recommended
way to use the Release Drafter
2020-11-16 22:13:01 +01:00
Stefan Agner
e8c2bacae6 Use upstream fix for zram on 32-bit ARM with LPAE (RPi4) (#996) 2020-11-16 15:09:12 +01:00
Stefan Agner
80f02b8ab6 Update buildroot to 2020.11-rc2 (#995)
Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-11-16 11:06:25 +01:00
Stefan Agner
a0871be6c0 Bump buildroot to 2020.11-rc1 (#985)
* Update buildroot-patches for 2020.11-rc1 buildroot

* Update buildroot to 2020.11-rc1

Signed-off-by: Stefan Agner <stefan@agner.ch>

* Don't rely on sfdisk --list-free output

The --list-free (-F) argument does not allow machine readable mode. And
it seems that the output format changes over time (different spacing,
using size postfixes instead of raw blocks).

Use sfdisk json output and calculate free partition space ourselfs. This
works for 2.35 and 2.36 and is more robust since we rely on output which
is meant for scripts to parse.

* Migrate defconfigs for Buildroot 2020.11-rc1

In particular, rename BR2_TARGET_UBOOT_BOOT_SCRIPT(_SOURCE) to
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT(_SOURCE).

* Rebase/remove systemd patches for systemd 246

* Drop apparmor/libapparmor from buildroot-external

* hassos-persists: use /run as directory for lockfiles

The U-Boot tools use /var/lock by default which is not created any more
by systemd by default (it is under tmpfiles legacy.conf, which we no
longer install).

* Disable systemd-update-done.service

The service is not suited for pure read-only systems. In particular the
service needs to be able to write a file in /etc and /var. Remove the
service. Note: This is a static service and cannot be removed using
systemd-preset.

* Disable apparmor.service for now

The service loads all default profiles. Some might actually cause
problems. E.g. the profile for ping seems not to match our setup for
/etc/resolv.conf:
[85503.634653] audit: type=1400 audit(1605286002.684:236): apparmor="DENIED" operation="open" profile="ping" name="/run/resolv.conf" pid=27585 comm="ping" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
2020-11-13 18:25:44 +01:00
Stefan Agner
25a0dd3082 Use systemd-resolved to announce hostname via mDNS and LLMNR (#986)
Drop AVAHI and use systemd-resolved to announce hostname via mDNS
and LLMNR. Also continue to offer the _workstation._tcp.local service
since it is used by the CoreDNS mDNS plug-in.
2020-11-13 17:43:46 +01:00
Stefan Agner
50d304d7f3 Drop services we don't offer (#988)
Stop announcing services using DNS-SD we don't offer.
2020-11-13 15:26:30 +01:00
Stefan Agner
021b2c0357 Bump version 5.6 2020-11-10 22:55:18 +01:00
Stefan Agner
f922c14f15 Enable dropbear client to make scp work (#951) (#979)
When trying to use scp it fails due to missing /usr/bin/dbclient. For
debugging/testing scp can be helpful and is rather slim. Add it to all
configs.
2020-11-10 22:21:32 +01:00
Stefan Agner
92541b7280 Move patch for the RPi Linux kernel to the correct location (#978) 2020-11-10 21:30:32 +01:00
Stefan Agner
f5ff224358 Bump Raspberry Pis to 5.4 kernel (#956)
* Bump Raspberry Pi kernel to 5.4

Bump kernel to the downstream Raspberry Pi 5.4 kernel. Drop patches
already merged upstream and use rebased patches for USB reset
controller (required for U-Boot 2020.10 for USB SSD boot).

* Add compatible node for upstream U-Boot

Add brcm,bcm2835-pl011 to make upstream U-Boot bind with the
bcm283x_pl011 driver. This allows to boot with the device tree provided
by the Raspberry Pi Linux kernel 5.4 even without enable_uart=1.
2020-11-10 18:25:51 +01:00
Stefan Agner
6bc6300149 ODROID: Update kernel 5.9.6 (#976)
The CDC ACM cooldown fix is now part of upstream Linux, so we can drop
our patch.
2020-11-10 14:25:39 +01:00
Stefan Agner
fe9fc1cbd2 Use performance governor to avoid frequency scaling (#973)
After running HAOS on my ODROID N2+ several hours I see freezes and
sometimes stack traces which point to a problem in CPU frequency
scaling. This crash seems not to appear on Hardkernel's 18.04 Ubuntu
stable release. However, Hardkernel's Ubuntu uses the performance
governor. Use the performance governor as well to avoid crashes on N2+.
2020-11-10 13:40:39 +01:00
Stefan Agner
4f28a284be Make self healing capabilities more robust (#960)
In case a container image is corrupted `docker inspect` might fail:
  # docker inspect --format='{{.Id}}' "${SUPERVISOR_IMAGE}"

  Error response from daemon: readlink /mnt/data/docker/overlay2: invalid argument

In that same state the `docker images` command still shows the images.
Since `docker inspect` returns an error SUPERVISOR_IMAGE_ID will be empty
and a simple `docker pull` will be attempted. That does not suffice to
recover from a corrupted container image.

Use `docker images` to get the image ids and make sure to delete all
image ids found by that command.

Also don't use RuntimeDirectory since it deletes the runtime directory
between the service start attempts which defeats the purpose.
2020-11-09 13:05:54 +01:00
Stefan Agner
094208492e ODROID-C4 fixes (#963)
* Add machine specific landingpage container to ODROID-C4 as well (#949)

* Fetch script from new repo location and layout as well
2020-11-07 19:46:42 +01:00
Stefan Agner
ce95fdccd3 Revert "use GPT partition table for RPi4 (#936)" (#969)
This reverts commit c92b4b54be.

Pure GPT would be nice, but older EEPROM/firmware version seem not to
handle it properly (before EEPROM 2020-09-03/firmware 2020-10-22). Since
devices still get shipped with older EEPROM we currently moving to pure
GPT would make those devices not booting.

Stick with hybrid mode for now to make sure HAOS boots on all devices no
matter if a new or old EEPROM is in use.
2020-11-07 19:46:17 +01:00
Jakub Bartkowiak
2c335a4dd9 Fix configuration.md link in raspberrypi README.md (#967) 2020-11-07 13:39:29 +01:00
Stefan Agner
1a99d07cae Update ODROID-N2 binary blobs to those built with latest U-Boot (#961) 2020-11-06 10:10:26 +01:00
Stefan Agner
58d4b79376 Update ODROID N2 U-Boot reference to get latest DDR timings (#958)
The DDR timings are taken direclty from the checked out hardkernel
U-Boot tree. Make sure to use the lastest hash to get the latest timing
changes.
2020-11-05 15:51:16 +01:00
ubergeek801
0b52271b3a Support ODROID C4 SBC (#926)
* initial ODROID-C4 support
* setting clk_ignore_unused
2020-11-05 10:40:25 +01:00
Stefan Agner
503117d8bf Move RuntimeDirectory to the Service section (#957)
RuntimeDirectory needs to be in the [Service] section to take effect.
2020-11-04 16:55:19 +01:00
Aman Gupta Karmani
c92b4b54be use GPT partition table for RPi4 (#936)
* use GPT partition table for RPi4
2020-11-04 11:10:57 +01:00
Stefan Agner
5e44dcc681 RaspberryPi: Update firmware 2ba11f2a07760588546821aed578010252c9ecb3 (#954) 2020-11-04 11:09:06 +01:00
Stefan Agner
2d257bd671 Simplify self healing capabilities of Supervisor service (#952)
* Simplify self healing capabilities of Supervisor service

Instead of relying on time based information on how long the container
has been running use a startup marker file to infer if the last startup
has been successful.

* Update buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-11-04 10:05:38 +01:00
Aman Gupta Karmani
8ed04ed73c reboot kernels on panic so u-boot can fallback to previous update (#937) 2020-11-03 18:31:59 +01:00
Stefan Agner
737a6f18c3 Add machine specific landingpage container at build time (#949)
The landingpage container is a minimal webserver with built-in zeroconf
annoucement. Preinstall the machine specific landingpage container to
make sure it will show up right after startup.
2020-11-02 13:35:00 +01:00
Aman Gupta Karmani
ac942b8ed9 add fsck.repair=yes to all uboot kernel cmdline args (#943) 2020-10-30 21:54:20 +01:00
Aman Gupta Karmani
a8bad54efc automatically fsck to repair issues after an unclean shutdown (#938)
* automatically fsck to repair partitions

* add fsck.fat so rpi boot partition can be repaired

* Use Wants= instead of Requires=

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>

* add dosfstools to all images

* run hassos-data and hassos-expand after fsck

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-10-30 21:52:24 +01:00
Stefan Agner
481a79eb28 Revert "bump rpi-firmware to latest stable release (sep 2020) (#899)" (#928) (#942)
This reverts commit dade3adf80.
The new firmware lead to black screens and rainbow screen on various
Raspberry Pis.
2020-10-27 09:42:21 +01:00
Aman Gupta Karmani
8cd7dfe822 make it easier to edit and transfer files in the docker builder (#935) 2020-10-27 09:32:32 +01:00
Aman Gupta Karmani
2416c6c26c add .DS_Store to .gitignore (#934) 2020-10-27 09:26:03 +01:00
Harsh Kevadia
4eb0cd6460 Update README.md (#930)
* Update README.md

* Update based on PR comments
2020-10-25 18:36:15 +01:00
Stefan Agner
e43747c2e9 ODROID N2+ fixes (#929)
* Make sure to set board_rev for N2+ correctly

For some reason the code to set the environment did not make it into the
ODROID N2 board code. Fix the patch to correctly set board_rev for N2(+).
Also remove the w400 patch as it is no longer required.

* Use latest ODROID-N2+ patches

Use the queued patches (and fixes) for upstream ODROID-N2+ support.
This uses the clock settings from meson-g12b-a311d.dtsi running the
CPUs at the following clocks:
- 4xA73@2.2GHz
- 2xA53@1.8GHz
2020-10-24 18:45:41 +02:00
Pascal Vizeli
5f8aeb1c6d Bump version 5.5 2020-10-22 17:07:52 +02:00
Pascal Vizeli
dcfb296dcf Update buildroot to 2020.02.7 (#923)
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-10-22 17:05:36 +02:00
Stefan Agner
fdcb94f0d8 Actually fix CDC ACM error recovery path (#712) (#921)
Instead of reverting the CDC ACM cool-down patch fix the intention of
that change. This should fix the error recovery paths in the CDC ACM
driver and allow CDC ACM devices to continue working even in the event
of USB issues.
2020-10-21 20:34:26 +02:00
Stefan Agner
5f0a8fe627 Bump firmware to RPi bluez-firmware 1.2-4+rpt6 release (#918)
This addresses recent Bluetooth secruity vulnerabilities.
2020-10-20 22:39:59 +02:00
Pascal Vizeli
0495ba25ad RaspberryPI: Fix issue with correct SYMLINK with ttyAMA (#915) 2020-10-20 19:08:19 +02:00
Pascal Vizeli
fa242e32d7 Remove not needed partition magic (#901)
* Update Documentation/partition.md

Co-authored-by: Stefan Agner <stefan@agner.ch>
2020-10-18 15:08:11 +02:00
Stefan Agner
fc3b098170 Fix CDC ACM error recovery path (#712) (#905)
Revert CDC ACM cool-down patch. This should fix the error recovery paths
in the CDC ACM driver and allow CDC ACM devices to continue working even
in the event of USB issues.
2020-10-17 13:16:08 +02:00
Stefan Agner
2b0fff31a3 Bump ODROID boards to Linux 5.9 (#898)
* Bump ODROID boards to Linux 5.9.1

This makes quite some patches obsolete which since have been upstreamed.

* Drop Linux 5.7 header symbols

Since we do not introduce new packages which actually require a newer
kernel headers, there is no value in having config symbols for the new
kernel version. Buildroot is still using the headers from our kernel,
and hence gets the latest version of the headers.
2020-10-17 13:14:47 +02:00
Aman Gupta Karmani
dade3adf80 bump rpi-firmware to latest stable release (sep 2020) (#899) 2020-10-16 15:12:35 +02:00
Souradip Mookerjee
b4fad03613 Make clear this should be with UNIX line endings (#884) 2020-10-15 11:49:08 +02:00
Aman Gupta Karmani
59b8636bc8 Fix systemd-time-wait-sync getting stuck with upstream patches (#897) 2020-10-13 00:38:04 +02:00
Aman Gupta Karmani
3337cd0f79 Fix var-lib-NetworkManager.mount dependencies (#895) 2020-10-12 21:41:12 +02:00
Pascal Vizeli
0c7cd8023e Bump version 5.4 2020-10-11 19:38:10 +02:00
Stefan Agner
502ef82b80 Bump U-Boot to 2020.10 for all boards using U-Boot (#889) 2020-10-10 12:27:47 +02:00
Stefan Agner
1708ed11b4 Fix Docker socket path (#885)
The Docker socket path is /run/docker.sock. Also only one path can be
used per property. This fixes the supervisor service, which currently
refuses to start due to missing Docker socket.
2020-10-06 12:17:39 +02:00
cogneato
59b9d82a55 Clean up initial description (#886) 2020-10-05 22:11:19 +02:00
Stefan Agner
39babd5368 Extend RPi default config.txt (#875)
Add commented out commands to enable serial console (useful for
debugging) and to disable SD card poll (useful for USB SSD boot).
2020-09-25 08:46:27 +02:00
Stefan Agner
2595dd815b Enable drivers for Intel Network devices with Virtual Function (#754) (#878) 2020-09-25 08:45:22 +02:00
Stefan Agner
d1577a6a65 Enable Hyper-V PCI support (#872) (#877) 2020-09-25 08:43:39 +02:00
Pascal Vizeli
f219f239d8 Improve handling with services on supervisor (#867)
* Improve handling with services on supervisor

* add condition

* move dbus to required, since we can't start the supervisor
2020-09-24 13:40:39 +02:00
Stefan Agner
ebc93692f5 Drop UART write retry patch from U-Boot (#873)
The patch causes U-Boot freezes in some configurations. The root cause
is that U-Boot does not allow to use the bss section in pre-relocation
code (which is where the UART is used). Drop the patch as it is not
required currently.

See also:
http://u-boot.10912.n7.nabble.com/RPi4-U-Boot-freeze-td424432.html#a427198
2020-09-24 13:37:44 +02:00
Pascal Vizeli
3af31c2265 Add observer plugin (#864) 2020-09-14 10:21:03 +02:00
Stefan Agner
f4f6908c80 Make sure udev rule only applies to first PL011 UART (#778) (#862)
The to symlink serial0/1 currently might apply to the first or second
ttyAMAX instance. In downstream, a patch makes sure that the first
PL011 is always ttyAMA0. However, upstream the numbering depends on the
UART alias, which leads to the first PL011 being ttyAMA1.

Check the actual iobase too to make sure we are dealing with the first
PL011 instance.

See also:
05cfe136f7 (diff-2678c183f503319c8d8c09c818af789a)
2020-09-12 09:08:27 +02:00
Stefan Agner
31fc13cf03 Resize serial terminal on login (#860) (#863)
The new readline utilty used by the CLI add-on requires the size of the
terminal to be set. Use the resize command to initialize terminal size
on login if we are running on a serial terminal.
2020-09-12 09:07:03 +02:00
Stefan Agner
ec1561661b Make sure U-Boot built idbloader.img gets copied (#854)
The U-Boot build system creates a ready to use idbloader.img. A earlier
commit dropped the HAOS code to create the same. However, the commit
missed copying the one built by U-Boot. Make sure idbloader.img gets
copied to the image output directory.
2020-09-10 10:55:41 +02:00
Pascal Vizeli
272430a58c Revert "Use Microsoft Basic Data instead of Microsoft Reserved Partition (#847)" (#852)
This reverts commit 31bb38ffd4.
2020-09-07 11:19:03 +02:00
Pascal Vizeli
1537e14dfc Bump version 5.3 2020-09-06 22:29:39 +02:00
Pascal Vizeli
22f7777099 Make getty for serial/tty same (#850)
* Make getty for serial/tty same

* adjust log output
2020-09-06 22:18:19 +02:00
Pascal Vizeli
813030bb4c Linux: Update kernel 5.4.63 / 5.7.13 (#849)
* Odroid: Update kernel 5.7.19

* Linux: Update kernel 5.4.63
2020-09-06 22:17:13 +02:00
Stefan Agner
31bb38ffd4 Use Microsoft Basic Data instead of Microsoft Reserved Partition (#847)
Currently the Microsoft Reserved Partition GUID is used for this FAT32
formatted partition. This GUID is a rather Microsoft Windows specific
GUID and not commonly used on Linux.

On Linux systems partitions of this type do not get automatically
mounted (see /usr/lib/udev/rules.d/80-udisks2.rules). However, since
this partition contains some files user commonly need to adjust
(config.txt, cmdline.txt) it would be good if the partition does get
mounted.

Use Microsoft Basic Data instead, which is used by default for FAT32
partition (even by Linux partitioning tools such as gparted). Tested
on ASUS Tinker Board and RPi4.
2020-09-06 11:57:17 +02:00
Stefan Agner
b6cfe04422 Do not attempt to resize on every boot (#843) (#848)
The hassos-expand script calls sfdisk to find free disk space. It seems
that today it considers the space before the first partition as free:
$ sudo sfdisk -Fq /dev/sdi
Start   End Sectors Size
 2048 16383   14336   7M

This causes the script to always resize. It seems not to cause harm to
the partition table (it does not resize really). However, the call to
partx seems to confuse systemd and kill the mnt-data.mount process
(presumably because udev causes remove/add events for the by-label
device units).

Consider everything below 8MiB to not be worthy of a size change. This
avoids missdetection and resize attempts where there is no need.
2020-09-06 11:22:43 +02:00
Stefan Agner
0ae67991d1 Cleanup Tinker Board patches (#846)
* Remove rk3288-xt-q8l-v10.dts related patches

We only support ASUS Tinker Board, so no need for those patches.

* Remove unnecessary patches and rebase some for Tinker Board S

Some patches only apply to the Tinker Board device tree. Rebase them to
apply to the dtsi file so they apply for both boards, the Tinker Board
and the Tinker Board S board.
2020-09-05 11:11:18 +02:00
Stefan Agner
f892334077 Support custom output directory (#842)
Support custom output directories akin to how buildroot supports O=.
This allows to use separate output directory per board, e.g. using
make O=output_odroid-n2.
2020-09-04 21:07:32 +02:00
Stefan Agner
2e2f6e893b Fix Tinker Board S (eMMC) boot (#650) (#845)
* Fix Tinker Board S (eMMC) boot (#650)

Use Tinker Board S U-Boot configuration which is capable to boot from
eMMC as well as from SD card.

Note that this makes U-Boot always claiming to run on Tinker Board S:
..
Model: Rockchip RK3288 Asus Tinker Board S
..

It seems that there is no generic Tinker Board configuration. However,
Tinker Board S configuration really seems to work well with Tinker Board
as well, so just use it.

Also today the U-Boot Makefile seems to generate a working idbloader.img
already. Drop our special handling.

* Use Tinker Board S device tree if booting from eMMC for Linux

Instead of patching the Tinker Board device tree, select the device tree
based on what device we are booting from.

Note: This boots the non-S device tree when booting a Tinker Board S
from SD card! But there is no reliable detection otherwise, so let's
just live with that fact.

* Document how to use our U-Boot to flash eMMC
2020-09-04 21:05:49 +02:00
Stefan Agner
a2a4cf8668 Align all partitions to 1MiB boundary (#808)
Aligning partitions (and hence file system structures) to higher level
then 512 byte sectors is common practise and highly recommended for flash
backed block devices. It makes sure that the underlaying flash translation
layer (FTL) does not amplify writes due to missalignment of its erase
block size. Use a 1MiB boundary which is what a modern fdisk is doing.

Before this change:

 # fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.35.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/mmcblk0: 14.57 GiB, 15634268160 bytes, 30535680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x48617373

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *      16384    65537    49154   24M  c W95 FAT32 (LBA)
/dev/mmcblk0p2        65539  1228814  1163276  568M  5 Extended
/dev/mmcblk0p3      1228816  1425425   196610   96M 83 Linux
/dev/mmcblk0p4      1425427 30535679 29110253 13.9G 83 Linux
/dev/mmcblk0p5        65540   114693    49154   24M 83 Linux
/dev/mmcblk0p6       114695   638984   524290  256M 83 Linux
/dev/mmcblk0p7       638986   688139    49154   24M 83 Linux
/dev/mmcblk0p8       688141  1212430   524290  256M 83 Linux
/dev/mmcblk0p9      1212432  1228814    16383    8M 83 Linux

After this change:

 # fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.35.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/mmcblk0: 14.57 GiB, 15634268160 bytes, 30535680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x48617373

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *      16384    65535    49152   24M  c W95 FAT32 (LBA)
/dev/mmcblk0p2        65536  1239039  1173504  573M  5 Extended
/dev/mmcblk0p3      1241088  1437695   196608   96M 83 Linux
/dev/mmcblk0p4      1439744 30535679 29095936 13.9G 83 Linux
/dev/mmcblk0p5        67584   116735    49152   24M 83 Linux
/dev/mmcblk0p6       118784   643071   524288  256M 83 Linux
/dev/mmcblk0p7       645120   694271    49152   24M 83 Linux
/dev/mmcblk0p8       696320  1220607   524288  256M 83 Linux
/dev/mmcblk0p9      1222656  1239039    16384    8M 83 Linux

See also:
https://unix.stackexchange.com/questions/248939/how-to-achieve-optimal-alignment-for-emmc-partition
http://3gfp.com/wp/2014/07/formatting-sd-cards-for-speed-and-lifetime/
2020-09-01 22:54:19 +02:00
Stefan Agner
b8cf3face0 Load socinfo only once (#838)
Remove code duplication and make sure to load socinfo only once. Also
set board_rev before MAC address to make sure board_rev is set even if
loading MAC address from efuses fails.
2020-09-01 19:07:07 +02:00
mikebaz
1c991c229d Update network.md (#833)
small change to reflect the renaming of the OS as shown in the top-level README
2020-08-28 10:37:01 +02:00
Stefan Agner
a3c5e670ef Fix ODROID-N2(+) SD card boot (#835) (#836) 2020-08-28 10:18:50 +02:00
Pascal Vizeli
ffc75a5053 Optimize overlay driver (#831)
* Optimize overlay driver

https://www.youtube.com/watch?v=fSyr_IXM21Y&feature=youtu.be

Not sure about the INDEX, but the other should be safe.

* Update buildroot-external/kernel/docker.config

Co-authored-by: Stefan Agner <stefan@agner.ch>

Co-authored-by: Stefan Agner <stefan@agner.ch>
2020-08-27 11:50:16 +02:00
Stefan Agner
4d6246be4d RPi4 fix WiFi with 802.11r fast roaming enabled (#733) (#830)
Add brcmfmac patch which adds 802.11r fast roaming support.
2020-08-22 15:08:14 +02:00
Stefan Agner
c6a1e668f4 Load loop module before starting the container (#824)
This makes sure that the kernel module loop is loaded, the loop devices
under /dev have been created before the container starts. Docker uses
the current /dev as template for the container /dev. If the loop entries
are missing, loop devices can't be used inside the container. Use
losetup which does not make assumption weather loop support is built-in.

This fixes issues seen on my machine when entering the build environment
the first time after build:
  mount: /mnt/data: failed to setup loop device for /export/data.ext4.
  make[2]: *** [package/pkg-generic.mk:364: /build/buildroot/output_rpi4/build/hassio-1.0.0/.stamp_target_installed] Error 32
2020-08-18 10:46:28 +02:00
Pascal Vizeli
b19f83d74d N2: fix possible issue with end up in not working device (#818) 2020-08-10 09:59:49 +02:00
Pascal Vizeli
a877e0c3dd Fix RPi4 with buildroot v2020.02.4 (#815) 2020-08-07 12:49:52 +02:00
Pascal Vizeli
265cb08e79 Bump version 5.2 2020-08-06 21:23:03 +02:00
Pascal Vizeli
c473aca701 Add support for USB wifi (#813)
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-08-06 21:20:29 +02:00
Pascal Vizeli
f93f8e34b3 Kernel 5.4.56 / Odroid 5.7.13 (#812)
* Linux: Update kernel 5.4.56

* Odroid: Update kernel 5.7.13
2020-08-06 21:12:41 +02:00
Pascal Vizeli
fa53c7bc99 Update buildroot v2020.02.4 (#811)
* Update buildroot to 2020.02.4

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* fix patches

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-08-06 20:54:14 +02:00
Pascal Vizeli
1f4bd67f7e Improve the compatibility (#810)
* Improve the compatibility

* small style fix
2020-08-06 20:49:42 +02:00
Pascal Vizeli
0c427d0dee Update rauc 1.4 to fix mounted boot partition issue (#809)
* Update rauc 1.4 to fix mounted boot partition issue

* applay update

* fix characters

* fix CI

* Support old format

* fix mcopy prefix

* fix lint

* fix lint

* clean style

* Fix script

* fix syntax

* Support all system

* fix shell

* Fix script
2020-08-06 19:37:52 +02:00
Konpon96
701e4f78aa Enable systemd-logind (#797)
Signed-off-by: Konrad Ponichtera <konpon96@gmail.com>
2020-08-06 08:38:14 +02:00
Stefan Agner
cd5cb880ea Do not break device tree changes made by audio patches (#807) 2020-08-06 08:32:25 +02:00
Stefan Agner
cf033ec49d hardkernel: Fix build warning when building U-Boot (#806)
Drop const since we actually modify the buffer in meson_get_soc_rev
2020-08-05 12:07:53 +02:00
Pascal Vizeli
0ec506470a Fix amlogic patch for soc rev (#804) 2020-08-04 16:46:26 +02:00
cogneato
606da02461 Fix duplicate link and typo in documentation (#805) 2020-08-04 16:44:37 +02:00
Pascal Vizeli
e49f8fe630 Update kernel mainline 5.4.55 / Odroid 5.7.12 (#803)
* Odroid: Update kernel 5.7.12

* Linux: Update kernel 5.4.55

* Fix patch
2020-08-03 22:58:40 +02:00
Adam Griffiths
02836524ce Documentation (#769)
* spelling correction

* Restuctured, added "features", "supported hardware", intro for developers and links to the developer documentation.

* Spelling correction

* URL correction

* Documentation restructure

* Moving developer documentation index from top level README to Documentation directory README

* fixing URLS

* Restructuring and adding to board config

* Improving navigation of docs oon github

* New line after first heading

(https://github.com/home-assistant/operating-system/pull/768#discussion_r453336692)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update README.md

https://github.com/home-assistant/operating-system/pull/768#discussion_r453336871

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update README.md

(https://github.com/home-assistant/operating-system/pull/768#discussion_r453336999)
- Surround headings with newlines
- ODROID
- Use dashes for unordered lists

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update README.md

- new line after heading
(https://github.com/home-assistant/operating-system/pull/768#discussion_r453337043)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update README.md

- \- for unordered lists
- new line after heading
(https://github.com/home-assistant/operating-system/pull/768#discussion_r453337101)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update README.md

- new line after heading
- \- for unordered lists
(https://github.com/home-assistant/operating-system/pull/768#discussion_r453337183)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Spelling correction, to ensure /Dpcumentation/kernel.mdhas the correct spelling

* capitalisation

* using - for unordered lists

* Adding links to config files

* fixing links to _defconfig files

* fixing link for rpi0_w

* fixing link for rpi3_64 and rpi4_64

* making the ova README consistent with the others

* formmating

* fixing numbered list

* fixing indent for sub-bullets

* questions regarding Tinker S and OVA support

* resolving PR comment from fabaff

* resolving PR comment from fabaff

* https://github.com/home-assistant/operating-system/pull/769\#discussion_r456774209

* Changing uBoot to U-Boot (https://github.com/home-assistant/operating-system/pull/769#discussion_r456774290)

* s/boot sector/eMMC boot partition/ (See https://github.com/home-assistant/operating-system/pull/769#discussion_r456774329)

* As per comments here:
https://github.com/home-assistant/operating-system/pull/769#discussion_r456791491
https://github.com/home-assistant/operating-system/pull/769#discussion_r456791580

* HassOS is no longer the official name (https://github.com/home-assistant/operating-system/pull/769#discussion_r456791863)

* Should be Home Assistant Operating System (or OS) (see https://community.home-assistant.io/t/changing-the-home-assistant-brand/167500/16). See also commennts here https://github.com/home-assistant/operating-system/pull/769#discussion_r456793030, taken in to account along with previous comments about this paragraph.

* s/HassOS/Home Assistant Operating System/

* 8Gb Pi 4 will be supported soon (see comment https://github.com/home-assistant/operating-system/pull/769#discussion_r459768349)

* resolving conflict with main dev branch.

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-08-03 16:31:36 +02:00
Pascal Vizeli
50176a0e3b Add support for snapshots/restore on OS level (#801) 2020-08-03 16:28:08 +02:00
Pascal Vizeli
06e7ee7efb Change VM naming handling (#794) 2020-07-29 11:19:00 +02:00
Stefan Agner
e08bbd7047 Add ODROID-N2+ support (#793)
* Add ODROID-N2+ support

Add ODROID-N2+ support with the new SoC revision c. Extend the U-Boot
script: Assume ODROID-N2 if the SoC revision is "a" (there are only "a"
revision SoCs on ODROID N2) and assume N2+ otherwise.

Currently using overclock mode as proposed in the upstream kernel patches.

* Update hassos-hook.sh

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-07-29 11:06:01 +02:00
Pascal Vizeli
653bcbe3ae Add functionts for RPi to handle kernel options (#792) 2020-07-27 12:09:43 +02:00
Pascal Vizeli
3700516097 Show board info on startup & Cleanup unused functionality (#784)
* Show board info on startup & Cleanup unused functionality

* Add patch for get env

* move patch
2020-07-27 11:54:25 +02:00
Pascal Vizeli
3fe09a4e6a Bump version to 5.1 2020-07-24 12:27:02 +02:00
Pascal Vizeli
2b8dc1c913 Fix deployment questions 2020-07-24 12:20:08 +02:00
Pascal Vizeli
9f7a846d6b RaspberryPi: Update kernel 4.19.127 - cc39f1c9f82f6fe5a437836811d906c709e0661c 2020-07-24 10:17:10 +00:00
Pascal Vizeli
466225806e Linux: Update kernel 5.4.53 2020-07-24 10:15:39 +00:00
Pascal Vizeli
8e42ad5536 Cleanup boot files & Kenrel 5.7.10 (#782)
* Odroid: Update kernel 5.7.10

* Cleanup boot files

* Fix patches
2020-07-23 18:52:01 +02:00
Pascal Vizeli
39e78a1014 fix lint 2020-07-23 12:20:50 +02:00
Stefan Agner
cc4a6ebf96 Allow to execute commands using enter.sh directly (#781)
This is useful e.g. if one just wants to run a build.
2020-07-22 23:40:45 +02:00
Pascal Vizeli
4a3837374f Fix linter 2020-07-22 17:53:10 +02:00
Pascal Vizeli
f70067c570 Add update script (#780) 2020-07-21 18:06:07 +02:00
Brad Simmons
24b6463fbb Update network.md for bad NetworkManager.conf link (#779)
Corrected bad link for Gnome NetworkManager.conf
2020-07-19 14:20:37 -07:00
Stefan Agner
78152db78f Add boot from USB mass storage device support for RPi 4 (#746) (#776)
* Backport USB PCIe/XHCI patches to U-Boot 2020.07

Backport relevant patches required to make PCIe/USB XHCI work.

* Backport/integrate PCIe device tree changes from upstream Linux

U-Boot uses the device tree provided by upstream Linux. Make sure the
device tree has the relevant chanages to make VL805 USB controller
reset work.

* Document RPi 4 USB mass storage support (#746)
2020-07-19 13:59:10 +02:00
Stefan Agner
985f3b8e3d Bump RPi 64-bit to U-Boot 2020.07 release to fix RPi 4 8GB boot (#740) (#775)
Unfortunately builds for 32-bit seem to lead to freezes. Conservatively
only update to 2020.07 for 64-bit builds.

Co-authored-by: Malcolm Lashley <mlashley@gmail.com>

Co-authored-by: Malcolm Lashley <mlashley@gmail.com>
2020-07-18 23:32:19 +02:00
kdhoermann
245dc7603f Add sound card support to OVA. (#770)
* Add sound card support to OVA.

* Audio device support for all platforms
2020-07-15 19:06:18 +02:00
Simon Opelt
53bbc43ff3 Add NUC (10) support info (#766) 2020-07-08 13:33:07 +02:00
Simon Opelt
ad6ac0a770 add out-of-tree intel e1000e ethernet module (#765)
* add intel-e1000e net module for nuc (e.g. i219v)

* disable mainline E1000E

* fix hash case

* add e1000e module make opts

* add missing newline

* remove redundant MD5

* Update intel-e1000e.hash

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-07-06 13:46:00 +02:00
cogneato
de67752a46 Update datactl docs (#756)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2020-07-05 11:58:42 +02:00
Pascal Vizeli
a5eb7ffc8e Fix tinker for 5.4.50 (#764) 2020-07-05 00:17:26 +02:00
Pascal Vizeli
b09e5b5688 Revert DTS rpi4 2020-07-03 07:38:38 +00:00
Sean Mooney
a4c65b3fd1 Update issue template (#760) 2020-07-02 15:09:36 -07:00
Pascal Vizeli
ec6f7978b5 cleanup patch 2020-07-02 13:22:09 +00:00
Pascal Vizeli
c9033551f2 Fix patch for 5.4.50 (#758) 2020-07-02 14:42:48 +02:00
Pascal Vizeli
375e688938 Update kernel 20200702 (#757)
* Odroid: Update kernel 5.7.7

* Linux: Update kernel 5.4.50

* RaspberryPi: Update kernel 4.19.127 - a03605b08ae73107100c72dc92c92adf0dde3e42

* Fix script

* Add bcm2711-rpi-cm4
2020-07-02 11:28:39 +02:00
Pascal Vizeli
9d6b3a1d0b Kernel improvments for Amlogic / Odroid (#747)
* Kernel improvments for Amlogic / Odroid

* Odroid: Update kernel 5.7.4

* Fix script

* include audio into kernel
2020-06-27 10:48:08 +02:00
thecode
43e4bc81d3 Add condition to run QEMU guest agent for QEMU hypervisor (#752)
The proposed changed is to run the qemu guest agent for QEMU hypervisor. QEMU hypervisor and KVM hypervisor are using the same guest agent.
systemd allow detecting the difference between the two hypervisors. The change is using OR trigger, meaning it will trigger if one of the "ConditionVirtualization" rules is true.
2020-06-27 10:47:28 +02:00
Pascal Vizeli
4bcba322ff Fix jitters during first update/boot (#742)
* Fix jitters during first update/boot

* Address comments

* fix lint
2020-06-15 14:48:58 +02:00
Pascal Vizeli
0991cc1c25 Fix version json name if image is missing (#741)
* Fix version json name if image is missing

* Update hassos-supervisor
2020-06-15 14:48:02 +02:00
Bram Kragten
83cbc37422 Add line about Raspberry Pi overlays (#736)
* Add line about Raspberry Pi overlays

* Update .github/ISSUE_TEMPLATE.md

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-06-11 13:20:21 +02:00
Bram Kragten
0909462d51 Add overlay message (#735) 2020-06-11 11:44:40 +02:00
Franck Nijhof
27fc2de146 Fix missing wmv namespace in ovf definition (#732) 2020-06-08 15:36:38 +02:00
Pascal Vizeli
be7228c7e6 Bump wireguard linux compat for RPi kernel 2020-06-06 22:54:26 +00:00
Pascal Vizeli
e51b1bd9eb Make odroid upstream again (#724)
* Make odroid upstream again

* Fix question

* Linux 5.7

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* Add patch

* Add DT sound

* fix build

* Fix kernel options

* working audio
2020-06-06 11:44:41 +02:00
Franck Nijhof
2706b4d866 Improve self healing capabilities of Supervisor service (#726)
* Improve self healing capabilities of Supervisor service

* Fixes shellcheck linter warnings
2020-06-05 23:28:05 +02:00
Franck Nijhof
83af2731a8 Fix Supervisor container name reference in hassos-supervisor service (#727) 2020-06-05 22:14:34 +02:00
Pascal Vizeli
f66fbda032 RaspberryPi move back to 4.19 Kernel (#723)
* RaspberryPi: Update kernel 4.19.126 - f6b3ac28f0a9137d4c24c0b8832e693bbd16f5b7

* RaspberryPi: Update firmware 7caead9416f64b2d33361c703fb243b8e157eba4

* Remove kernel for 5.4
2020-06-05 16:08:50 +02:00
Pascal Vizeli
d215e81fb1 Update kernel Upstream/RPi (#708)
* Linux: Update kernel 5.4.44

* RaspberryPi: Update kernel 5.4.42 - 3d1e5203531fd1791762f018538e670bf10f722c

* RaspberryPi: Update firmware f382cc150445b3ef07de941e4877a5890d665aa7
2020-06-03 13:36:26 +02:00
Pascal Vizeli
afe39c279b Fix RPi4 uart 2-5 (#706) 2020-06-02 23:32:49 +02:00
Pascal Vizeli
ee13d1fb45 Add emergency Console (#705)
* Add emergency Console

* fix lint
2020-06-02 23:28:13 +02:00
Pascal Vizeli
917f022614 Fix issue with RPi2 armhf / armv7 2020-06-02 21:56:41 +02:00
Sergey Avdeev
fc68bce7d9 Update home-assistant.ovf (#696) 2020-06-02 10:56:30 +02:00
Adorem
0363ddab37 Update link to operating-system/debugging in configuration.md (#699) 2020-05-30 11:23:35 +02:00
Adorem
f18345a6c4 Update link to partition.md (#698) 2020-05-30 11:23:05 +02:00
Pascal Vizeli
8b13cfd902 RaspberryPi: Update firmware 62fc8c01165a80021054a430182b504f7b877c2d 2020-05-27 20:22:25 +00:00
Pascal Vizeli
16313059d9 RaspberryPi: Update kernel 5.4.42 - 5e5024f643caa53ff59a6e00f40a9b55f7fc4e17 2020-05-27 20:20:20 +00:00
Pascal Vizeli
deb072cb76 Linux: Update kernel 5.4.43 2020-05-27 20:17:42 +00:00
Pascal Vizeli
b206787520 Fix issue with mbr partition remove on MBR (#694) 2020-05-27 16:30:07 +02:00
Pascal Vizeli
0db61e85b0 Fix issue with Odroid-N2 on USB (#693) 2020-05-27 15:54:44 +02:00
Pascal Vizeli
c3fba76142 Use odroid defconfig for XU4 (#690) 2020-05-27 11:01:28 +02:00
Pascal Vizeli
7fc9c7d03b Fix build issues with gcc (#685)
* Fix build issues with gcc

* fix qemu
2020-05-26 08:02:53 +02:00
Pascal Vizeli
70c41b5690 Fix doc 2020-05-25 11:34:29 +00:00
Pascal Vizeli
68522d2062 Bump version to 5.0 2020-05-25 13:33:07 +02:00
Pascal Vizeli
3bb6442117 Mark stable release 2020-05-25 11:31:18 +00:00
Pascal Vizeli
2b3e806e56 Cleanup U-boot 2020-05-25 07:24:03 +00:00
Pascal Vizeli
a034fc9997 RaspberryPi: Update firmware a6c9b6b48ce86ef2527586a50760d52f1b33f642 2020-05-25 07:07:51 +00:00
Pascal Vizeli
4861cc58ce Linux: Update kernel 5.4.42 2020-05-25 07:06:32 +00:00
Pascal Vizeli
3160b59730 RaspberryPi: Update kernel 5.4.42 - 79495a5ecdfba69de51e88701a69c42d09806d84 2020-05-25 07:06:10 +00:00
Pascal Vizeli
032af2f56d Odroid: Update kernel 5.4.41 - 237731e3d2c145bd711bd1dcad0479c912b9fb4f 2020-05-25 07:05:20 +00:00
Pascal Vizeli
035e3884d8 Update Buildroot 2020.02.2 (#682)
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-05-20 17:32:11 +02:00
Pascal Vizeli
ce3c80641b cleanup-device (#681) 2020-05-19 21:29:57 +02:00
Pascal Vizeli
4eda8a1ff3 Wait until device is exists for moving data (#680)
* Wait until device is exists for moving data

* Update hassos-data

* Update hassos-data

* Update hassos-data
2020-05-19 15:21:08 +02:00
Pascal Vizeli
b410b70814 Update the old partition layout not just partial (#679) 2020-05-19 10:38:27 +02:00
Pascal Vizeli
eca72c9898 Fix vmware OS-Type for OVA (#677) 2020-05-18 11:43:45 +02:00
Fabian Affolter
71974edfd7 Update the README file (#666) 2020-05-14 09:27:11 +02:00
Fabian Affolter
613604ea74 Update style and static IPv4 address section (#667) 2020-05-14 09:25:31 +02:00
Fabian Affolter
6c62029a74 Fix typos (#668) 2020-05-14 09:21:53 +02:00
Fabian Affolter
a5209dc400 Fix typo and style (#669) 2020-05-14 09:17:04 +02:00
Fabian Affolter
1118335b1c Fix some typos and use the upstream project's spelling (#670) 2020-05-14 09:16:22 +02:00
Fabian Affolter
f96163f04e Keep the packages sorted and one per line (as above) (#672) 2020-05-14 08:54:18 +02:00
Fabian Affolter
b0dbbf963c Update spelling (#671) 2020-05-14 01:02:35 +02:00
Pascal Vizeli
a38bf6e75a Fix issue with loop devices (#659)
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-05-08 10:21:40 +02:00
Pascal Vizeli
0d892dbf23 Remove wrong support on the docs for Tinker S (#658) 2020-05-08 09:38:48 +02:00
Pascal Vizeli
a403b790f7 Update docker proxy (#657) 2020-05-07 22:55:37 +02:00
Pascal Vizeli
43aa64bb86 Add CRDA packages (#656)
* Add CRDA packages

* add ova too
2020-05-07 10:38:00 +02:00
Pascal Vizeli
ba17e542c5 Fix nl80211 crda errors (#655) 2020-05-07 09:48:07 +02:00
Pascal Vizeli
73dedf35de Bump version 4.7 2020-05-06 11:51:10 +02:00
Pascal Vizeli
96c622b36f Update deployment.md 2020-05-06 11:50:19 +02:00
Pascal Vizeli
698f2bb7d4 Move to staging 2020-05-06 09:42:39 +00:00
Pascal Vizeli
be39da4855 RaspberryPi: Update firmware 7eff9f6774bb43bfd61e749a0b45ffddc98c2311 2020-05-06 09:41:24 +00:00
Pascal Vizeli
b14d0223c2 Linux: Update kernel 5.4.39 2020-05-06 09:35:40 +00:00
Pascal Vizeli
fcfd951f2b RaspberryPi: Update kernel 5.4.38 - c41ae7cf543c1d680b4ac1afae40ca5bb0a96661 2020-05-06 09:35:18 +00:00
Pascal Vizeli
fcefb1e515 expand 2020-05-06 08:33:48 +00:00
Pascal Vizeli
3070b52a3e fix spell 2020-05-06 08:29:26 +00:00
Pascal Vizeli
37639fc3ff cleanup badge 2020-05-06 08:27:59 +00:00
Pascal Vizeli
770bcb62a0 Update docs 2020-05-06 08:26:44 +00:00
Pascal Vizeli
b3530d1ce1 Allow easy move data partition (#651)
* Allow easy move data partition

* Cleanup handling systemd

* Improve handling

* fix pipeline

* pipeline

* fix shell handling

* fix scripts

* Add bin folder

* fix lint

* Fix service handling

* Fix loading

* hide output

* Fix handling
2020-05-06 00:00:28 +02:00
Pascal Vizeli
ba9d1bac1e Use older Kernel for N2 (#652)
* Use older Kernel for N2

* Update docs

* Update kernel-amlogic.config
2020-05-05 14:23:17 +02:00
Pascal Vizeli
db184bf5d3 Make machine-id persist (#649)
* Make machine-id persist

* update

* Adjustments

* cleanup

* fix cleanups

* small cleanup
2020-05-04 15:11:43 +02:00
Pascal Vizeli
15a80bb405 Odroid N2 - update boot firmware (#647) 2020-04-30 17:09:30 +02:00
Pascal Vizeli
f0b5be41fe Bugfix qemu agent 4.2.0 (#646) 2020-04-29 22:09:47 +02:00
Pascal Vizeli
517abe0ea9 Check keyring of ota update file (#645) 2020-04-29 14:49:32 +02:00
Pascal Vizeli
ca90fa515d Bump version 4.6 2020-04-29 12:43:10 +02:00
Pascal Vizeli
6605b1511f Kernel updates (#643)
* Odroid: Update kernel 5.35 - f2eb401e73e9b54432cf4234722cb4fad1b334f2

* RaspberryPi: Update kernel 5.4.35 - 9a583229eff3263202522945a594a9115d49fcc6

* Odroid: Update kernel 5.4.35 - f2eb401e73e9b54432cf4234722cb4fad1b334f2

* Fix script

* RaspberryPi: Update firmware 2b731476edc463f2d6b3d751cb47c515b4b5853f

* Add script for rpi update

* RaspberryPi: Update firmware 2b731476edc463f2d6b3d751cb47c515b4b5853f

* fix script
2020-04-29 11:16:38 +02:00
Pascal Vizeli
f8b24f4b70 Make odroid downstream (#642)
* Make odroid downstream

* Fix patch

* Fix config

* audio support exynos

* Cleanup scripts

* Fix commit message

* clean options

* Extend options

* Cleanup
2020-04-28 22:23:08 +02:00
Pascal Vizeli
ada03f6736 Update qemu guest agent 4.2.0 (#639) 2020-04-26 12:33:54 +02:00
Pascal Vizeli
04e679798a Fix workstation avahi handling & add NSS mdns to host (#638)
* Fix workstation avahi handling & add NSS mdns to host

* disable avahi daemon on internal
2020-04-26 11:19:28 +02:00
Pascal Vizeli
6a49aa1c2b Create OVA file from release (#636)
* Create OVA file from release

* Fix name & add boot flag

* revert name

* style cleanup

* Fix script

* Add cleanup
2020-04-26 01:09:51 +02:00
Pascal Vizeli
34b7bbd68d New approach for uboot and rpi 5.4 (#635)
* New approach for uboot and rpi 5.4

* fix dts

* Update firmware to next
2020-04-25 11:17:03 +02:00
Pascal Vizeli
c0d8e14c2a Rpi update (#633)
* RaspberryPi: Update kernel 9daf4531948808f4a1913e6767fae6f421fb7896

* Update firmware
2020-04-24 18:28:08 +02:00
Pascal Vizeli
c017b43456 Tinker linux5.4 (#632)
* Migrate Tinker to linux 5.4

* Update bootloader
2020-04-24 15:12:57 +02:00
Pascal Vizeli
98f13d9282 RPi 5.4 (#631)
* RaspberryPi: Update kernel 68fd7d52c9fc7c40b996d6b91acaf3e03b2c3ea0

* update kernel config

* update bootloader

* Fix boot

* work

* fix boot

* Fix script

* optimize script
2020-04-23 23:05:28 +02:00
Pascal Vizeli
5ef1e83197 Update apparmor 2.13.4 (#630) 2020-04-22 22:54:58 +02:00
Pascal Vizeli
4df2ab6013 Use default CloudFlare anycast time service (#629) 2020-04-21 14:41:13 +02:00
Pascal Vizeli
45c62716cb New way to install/run supervisor + plugins (#620)
* Use new layout for CLI/Supervisor

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* Fix install script

* Fix config

* Add docs

* Fix shellcheck

* Fix issue

* rename package

* Fix build

* Fix apparmor
2020-04-21 14:37:25 +02:00
Pascal Vizeli
48f3045854 Support NVMe & update barebox (#626)
* Support NVMe & Update barebox

* same for ova
2020-04-19 01:33:45 +02:00
Pascal Vizeli
3281cbd365 Optimize GCC9 & busybox (#623)
* Optimize GCC9 & busybox

* Move to o2 for stable

* fix shell issue
2020-04-17 14:44:34 +02:00
Pascal Vizeli
5a6678147e Update buildroot 2020.02.01 (#622)
* Update buildroot 2020.02.01

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* Fix LN

* Fix wpa

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* Fix lint

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* fix-network

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* Fix script

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-04-16 20:03:01 +02:00
Pascal Vizeli
0c2b5aff65 Update azure-pipelines-release.yml 2020-04-15 16:21:55 +02:00
Pascal Vizeli
9dca4fc837 Update enter.sh 2020-04-15 16:08:16 +02:00
Pascal Vizeli
fff08c6101 Fix script 2020-04-15 14:06:39 +00:00
Pascal Vizeli
1022053aef Fix enter script & permission 2020-04-15 11:55:53 +00:00
Pascal Vizeli
0629c58d31 Update azure-pipelines-release.yml for Azure Pipelines 2020-04-15 12:37:36 +02:00
Pascal Vizeli
bc2afe33b0 Update rpi kernel/firmware (#621)
* RaspberryPi: Update kernel 2e79fd01b4b9a7eea5acb234ad4e4cdca8449d5a

* Update rpi firmware & kernel
2020-04-15 11:52:11 +02:00
Pascal Vizeli
2c963fcd05 Add dbus config for pulseaudio (#619) 2020-04-03 14:53:42 +02:00
lucagiove
d4a403b640 Fixed bluetooth-bcm43xx build (#616)
Brutally added patch command after download.

> I'm not a buildroot expert but the best way seemed to move the
> upstream btuart download in a PRE_PATCH_HOOK so that standard
> buildroot way of patching can be applied.

I've been finally able to test it and the PRE_PATCH_HOOK does not work
seems it's never triggered.
I tried also th POST_RSYNC_HOOK that works but still patch is not
applied.
I think that patch is not detected (odd, patch naming seems complient)
or since source code is not downloaded buildroot thinks that patch is
not needed, couldn't sort it out.
2020-04-03 10:27:55 +02:00
Perry Naseck
89cb68f7b7 Add USB video kernel support (#609)
* Add USB video kernel support for intel_nuc

* Add USB video kernel support for all boards

* Support USB video capture devices only, not tuners
2020-04-03 10:26:06 +02:00
lucagiove
c371e45144 Attempt to fix bluetooth communication problem on rpi3b (#614)
This problem is referenced in many different issues, some of them:
Bluetooth: hci0: Frame reassembly failed (-84)
https://github.com/raspberrypi/firmware/issues/1150

Error communicating with local bluetooth adapter (RPi3)
https://github.com/home-assistant/core/issues/30147

Xiaomi BLE Temperature and Humidity sensor no longer working after update from 0.95.4 to .096.5
https://github.com/home-assistant/core/issues/25704

Xiaomi BLE Temperature and Humidity sensor
https://github.com/home-assistant/core/issues/24313#issuecomment-578554315

Solution seemed to reeduce the boud rate of the serial connection to BT
on rpi3b where flow control is missing.

The patch to the original btuart file is to reduce the baudrate only for
rpi3b models where flow control is missing:

-		$HCIATTACH /dev/serial1 bcm43xx 921600 noflow - $BDADDR
+		$HCIATTACH /dev/serial1 bcm43xx 460800 noflow - $BDADDR

I'm not a buildroot expert but the best way seemed to move the
upstream btuart download in a PRE_PATCH_HOOK so that standard
buildroot way of patching can be applied.
2020-03-31 11:03:14 +02:00
Pascal Vizeli
2e7e039899 Optimize SND kernel module handling (#606)
* Optimize SND kernel module handling

* Update alsa-base.conf

* Update alsa-base.conf
2020-03-10 10:28:45 +01:00
Pascal Vizeli
c6e01d3468 Bump version to 4.5 2020-03-07 14:08:39 +01:00
Pascal Vizeli
5336e17a06 Update Kernel 5.4.24 (#603) 2020-03-07 14:07:05 +01:00
Pascal Vizeli
a017fae49d OS: Update CLI 21 2020-03-07 11:13:34 +00:00
Pascal Vizeli
96d59c2a40 OS: Update supervisor 209 2020-03-07 11:13:30 +00:00
Pascal Vizeli
1f23c3ac72 Replace on upload 2020-03-06 11:59:02 +01:00
Pascal Vizeli
3f26a61d9a Update RaspberryPi Kernel & Firmware 4.19.106 (#601)
* RaspberryPi: Update kernel ecb440abef61d198478b6e598b3510ff6680090a

* Update RaspberryPi kernel 4.19.106
2020-03-05 16:33:48 +01:00
nepozs
6a728d916f Update nuc.md (#591) 2020-02-20 21:42:23 +01:00
Pascal Vizeli
7f0ab07752 Bump version to 4.4 2020-02-18 13:25:39 +01:00
Pascal Vizeli
7d7a52732d Fix supervisor name on cli config (#588) 2020-02-17 13:25:44 +01:00
Pascal Vizeli
2d6f692a4c Rename Hass.io (#587) 2020-02-17 09:53:09 +01:00
Pascal Vizeli
279a4c4db1 Change uptime for offline update (#585) 2020-02-16 11:46:41 +01:00
Pascal Vizeli
a65db13c9e Support better armv7 emulation N2/C2 (#584)
* Support better armv7 emulation N2/C2

* Update kernel.config
2020-02-16 11:46:25 +01:00
Pascal Vizeli
a592fc9866 Change handling for SPL based images (#578)
* Change handling for SPL based images

* Fix script

* Fix path for rauc-hook
2020-02-10 14:52:03 +01:00
Pascal Vizeli
66c1b016c9 Bump version to 4.3 2020-02-06 18:57:20 +01:00
11638 changed files with 20438 additions and 870970 deletions

View File

@@ -3,5 +3,10 @@ buildroot/
buildroot-external/
buildroot-patches/
# Ignore too
# Output/Release directory gets created using build scripts
output*/
release/
# Ignore hidden directories as well
.git/
.github/

View File

@@ -1,32 +0,0 @@
<!-- READ THIS FIRST:
- If you need additional help with this template please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Do not report issues for components here, plaese refer to https://github.com/home-assistant/home-assistant/issues
- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests
- Provide as many details as possible. Paste logs, configuration sample and code into the backticks. Do not delete any text from this template!
- If you have a problem with a Add-on, make a issue on there repository.
-->
**HassOS release with the issue:**
<!--
- Frontend -> Developer tools -> Info
- Or use this command: hass --version
-->
**Supervisor logs:**
<!--
- Frontend -> Hass.io -> System
- Or use this command: hassio su logs
-->
**Journal logs:**
<!--
- use this command: journalctl
-->
**Kernel logs:**
<!--
- use this command: dmesg
-->
**Description of problem:**

105
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,105 @@
name: Bug Report Form
description: Report an issue related to the Home Assistant Operating System.
labels: bug
body:
- type: markdown
attributes:
value: |
Make sure to test with the last version of the Operating System before reporting a bug.
If the bug appears to be a regression, make sure to check if the bug indeed disappears
from the previous version. Use `ha os update --version x.y` command to downgrade.
- type: textarea
validations:
required: true
attributes:
label: Describe the issue you are experiencing
description: Provide a clear and concise description of what the bug is.
- type: markdown
attributes:
value: |
## Environment
- type: dropdown
validations:
required: true
attributes:
label: What operating system image do you use?
options:
- generic-x86-64 (Generic UEFI capable x86-64 systems)
- khadas-vim3 (Khadas VIM3)
- odroid-c2 (Hardkernel ODROID-C2)
- odroid-c4 (Hardkernel ODROID-C4)
- odroid-n2 (Hardkernel ODROID-N2/N2+)
- odroid-xu4 (Hardkernel ODROID-XU4)
- ova (for Virtual Machines)
- rpi2 (Raspberry Pi 2)
- rpi3 (Raspberry Pi 3 32-bit OS)
- rpi3-64 (Raspberry Pi 3 64-bit OS)
- rpi4 (Raspberry Pi 4/400 32-bit OS)
- rpi4-64 (Raspberry Pi 4/400 64-bit OS)
- tinker (ASUS Tinker Board/Tinker Board S)
description: >
Can be found in the [Configuration panel -> Settings -> Info](https://my.home-assistant.io/redirect/info/). It is listed as the `Board` value.
[![Open your Home Assistant instance and show your Home Assistant version information.](https://my.home-assistant.io/badges/info.svg)](https://my.home-assistant.io/redirect/info/)
- type: input
validations:
required: true
attributes:
label: What version of Home Assistant Operating System is installed?
placeholder: "6.6"
description: >
Can be found in the [Configuration panel -> Settings -> Info](https://my.home-assistant.io/redirect/info/). It is listed as the `Host Operating System` value.
- type: dropdown
validations:
required: true
attributes:
label: Did you upgrade the Operating System.
options:
- "Yes"
- "No"
- type: textarea
validations:
required: true
attributes:
label: Steps to reproduce the issue
description: |
Please tell us exactly how to reproduce your issue.
Provide clear and concise step by step instructions and add code snippets if needed.
value: |
1.
2.
3.
...
- type: textarea
validations:
required: true
attributes:
label: Anything in the Supervisor logs that might be useful for us?
description: >
Supervisor Logs can be found under [Configuration panel -> Add-ons, Backup & Supervisor -> System](https://my.home-assistant.io/redirect/supervisor_logs/), then choose Log Provider `Supervisor`.
[![Open your Home Assistant instance and show your Supervisor system logs.](https://my.home-assistant.io/badges/supervisor_logs.svg)](https://my.home-assistant.io/redirect/supervisor_logs/)
render: txt
- type: textarea
validations:
required: true
attributes:
label: Anything in the Host logs that might be useful for us?
description: >
Supervisor Logs can be found under [Configuration panel -> Add-ons, Backup & Supervisor -> System](https://my.home-assistant.io/redirect/supervisor_logs/), then choose Log Provider `Host`.
render: txt
- type: textarea
attributes:
label: System Health information
description: >
**Optional** Copy the full System Health in this text area.
Can be found in the [Configuration panel -> Settings -> Info](https://my.home-assistant.io/redirect/info/).
Use the copy icon on top right and choose `For GitHub`.
- type: textarea
attributes:
label: Additional information
description: >
**Optional** If you have any additional information for us, use the field below.
Please note, you can attach screenshots or screen recordings here, by
dragging and dropping files in the field below.

21
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
blank_issues_enabled: false
contact_links:
- name: Report incorrect or missing information on our documentation
url: https://github.com/home-assistant/home-assistant.io/issues
about: Our documentation has its own issue tracker. Please report issues with the website there.
- name: Report incorrect or missing information on our developer documentation
url: https://github.com/home-assistant/developers.home-assistant.io/issues
about: Our developer documentation has its own issue tracker. Please report issues with the website there.
- name: Request a feature for the Operating System
url: https://community.home-assistant.io/c/feature-requests
about: Request an new feature for the Operating System.
- name: I have a question or need support
url: https://www.home-assistant.io/help
about: We use GitHub for tracking bugs, check our website for resources on getting help.
- name: I'm unsure where to go?
url: https://www.home-assistant.io/join-chat
about: If you are unsure where to go, then joining our chat is recommended; Just ask!

32
.github/label-actions.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
assume-fixed:
comment: >
:wave: @{issue-author}, thanks for reporting an issue!
This issue is assumed to be fixed in the latest stable release. Please
reopen in case you can still reproduce the issue with the latest stable
release. You can find the latest stable release at
https://github.com/home-assistant/operating-system/releases/latest
close: true
core-issue:
comment: >
:wave: @{issue-author}, thanks for reporting an issue!
It looks like this issue is related to Home Assistant Core. Please check
the [Home Assistant Core](https://github.com/home-assistant/core/issues)
repository, the issue might have been reported already. Open a new issue
in that repository if you can't find a matching issue.
close: true
supervisor-issue:
comment: >
:wave: @{issue-author}, thanks for reporting an issue!
It looks like this issue is related to Home Assistant Supervisor. Please
check the [Home Assistant Supervisor](https://github.com/home-assistant/supervisor/issues)
repository, the issue might have been reported already. Open a new issue
in that repository if you can't find a matching issue.
close: true

View File

@@ -1,16 +1,27 @@
name-template: Home Assistant OS $NEXT_MINOR_VERSION
version-template: "$MAJOR.$MINOR"
categories:
- title: 'HassOS Core'
- title: 'Home Assistant Operating System'
label: 'os'
- title: 'Build'
- title: 'Build System'
label: 'build'
- title: 'Raspberry Pi'
label: 'board/raspberrypi'
- title: 'Home Assistant Yellow'
label: 'board/yellow'
- title: 'Open Virtual Appliance'
label: 'board/ova'
- title: 'Intel-Nuc'
label: 'board/intel-nuc'
- title: 'Hardkernel'
label: 'board/hardkernel'
- title: 'Generic x86-64'
label: 'board/generic-x86-64'
- title: 'Hardkernel ODROID'
label: 'board/odroid'
- title: 'ASUS Tinker'
label: 'board/tinker'
- title: 'Khadas VIM Series'
label: 'board/khadas'
- title: 'Generic aarch64'
label: 'board/generic-aarch64'
filter-by-commitish: true
template: |
## Changes

17
.github/stale.yml vendored
View File

@@ -1,17 +0,0 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

140
.github/workflows/dev.yml vendored Normal file
View File

@@ -0,0 +1,140 @@
# Home Assistant Operating System build workflow
name: Development build
on:
workflow_dispatch:
pull_request_target:
types: [opened,synchronize,labeled]
jobs:
prepare:
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run-dev-build') }}
name: Prepare build
runs-on: [ "ubuntu-20.04" ]
outputs:
version_main: ${{ steps.version_main.outputs.version_main }}
version_dev: ${{ steps.version_dev.outputs.version_dev }}${{ steps.version_pr.outputs.version_pr }}
matrix: ${{ steps.generate_matrix.outputs.result }}
steps:
- name: Generate Development build version
shell: bash
id: version_dev
run: |
version_dev="dev$(date --utc +'%Y%m%d')"
echo "Development version \"${version_dev}\""
echo "::set-output name=version_dev::${version_dev}"
- name: Generate Development build version for PR
if: ${{ github.event.pull_request }}
shell: bash
id: version_pr
run: |
version_pr=$(printf "%05d" ${{ github.event.pull_request.number }})
echo "Development build for PR #${{ github.event.pull_request.number }}"
echo "::set-output name=version_pr::${version_pr}"
- uses: actions/checkout@v2
- name: Get Major/Minor version
id: version_main
run: |
major=$(cat ${GITHUB_WORKSPACE}/buildroot-external/meta | grep VERSION_MAJOR | cut -d'=' -f2)
build=$(cat ${GITHUB_WORKSPACE}/buildroot-external/meta | grep VERSION_BUILD | cut -d'=' -f2)
echo "::set-output name=version_main::${major}.${build}"
- name: Create build matrix
uses: actions/github-script@v4
id: generate_matrix
with:
script: |
const boards = require('./.github/workflows/matrix.json')
if (context.eventName == "workflow_dispatch") {
console.log("Run full build for all boards")
return { "board": boards }
}
const labels = context.payload.pull_request.labels.map(l => l.name)
const labelsSet = new Set(labels)
const buildBoards = boards.filter(b => labelsSet.has(b.label))
return { "board": buildBoards }
build:
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run-dev-build') }}
name: Development build for ${{ matrix.board.id }}
environment: "dev_build"
needs: prepare
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
runs-on: ${{ matrix.board.runner }}
steps:
- name: Define git reference
uses: actions/github-script@v4
id: generate_gitref
with:
script: |
if (context.eventName == "workflow_dispatch")
return { "ref": context.ref }
return { "ref": context.payload.pull_request.head.sha }
- name: Checkout source
uses: actions/checkout@v2
with:
submodules: true
persist-credentials: false
ref: ${{ fromJSON(steps.generate_gitref.outputs.result).ref }}
- name: Build container
run: docker build -t haos-builder .
- name: 'Add release PKI certs'
env:
RAUC_CERTIFICATE: ${{ secrets.RAUC_CERTIFICATE }}
RAUC_PRIVATE_KEY: ${{ secrets.RAUC_PRIVATE_KEY }}
run: |
echo -e "-----BEGIN CERTIFICATE-----\n${RAUC_CERTIFICATE}\n-----END CERTIFICATE-----" > cert.pem
echo -e "-----BEGIN PRIVATE KEY-----\n${RAUC_PRIVATE_KEY}\n-----END PRIVATE KEY-----" > key.pem
- name: Build
run: |
BUILDER_UID="$(id -u)"
BUILDER_GID="$(id -g)"
docker run --rm --privileged -v "${GITHUB_WORKSPACE}:/build" \
-e BUILDER_UID="${BUILDER_UID}" -e BUILDER_GID="${BUILDER_GID}" \
-v "${{ matrix.board.runner }}-build-cache:/cache" \
-v "/build/output" \
haos-builder make BUILDDIR=/build VERSION_DEV=${{ needs.prepare.outputs.version_dev }} ${{ matrix.board.defconfig }}
- name: Upload images
uses: burnett01/rsync-deployments@4.1
with:
rsh: -q
switches: -aW
path: release/
remote_path: ${{ secrets.DEV_TARGET_PATH }}/${{ needs.prepare.outputs.version_main }}.${{ needs.prepare.outputs.version_dev }}/
remote_host: ${{ secrets.DEV_HOST }}
remote_port: ${{ secrets.DEV_PORT }}
remote_user: ${{ secrets.DEV_USERNAME }}
remote_key: ${{ secrets.DEV_SSH_KEY }}
bump_version:
name: Bump dev channel version
if: ${{ github.event_name == 'workflow_dispatch' }}
needs: [ build, prepare ]
runs-on: [ "ubuntu-20.04" ]
steps:
- name: Initialize git
uses: home-assistant/actions/helpers/git-init@master
with:
name: ${{ secrets.GIT_NAME }}
email: ${{ secrets.GIT_EMAIL }}
token: ${{ secrets.GIT_TOKEN }}
- name: Bump Home Assistant OS dev channel version to ${{ needs.prepare.outputs.version_main }}.${{ needs.prepare.outputs.version_dev }}
uses: home-assistant/actions/helpers/version-push@master
with:
key: "hassos[]"
key-description: "Home Assistant OS"
version: ${{ needs.prepare.outputs.version_main }}.${{ needs.prepare.outputs.version_dev }}
channel: "dev"

17
.github/workflows/label-actions.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: 'Label Actions'
on:
issues:
types: [labeled, unlabeled]
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/label-actions@v2

92
.github/workflows/matrix.json vendored Normal file
View File

@@ -0,0 +1,92 @@
[
{
"id": "ova",
"defconfig": "ova",
"runner": "x86-64-runner",
"label": "board/ova"
},
{
"id": "generic-x86-64",
"defconfig": "generic_x86_64",
"runner": "x86-64-runner",
"label": "board/generic-x86-64"
},
{
"id": "generic-aarch64",
"defconfig": "generic_aarch64",
"runner": "aarch64-runner",
"label": "board/generic-aarch64"
},
{
"id": "khadas-vim3",
"defconfig": "khadas_vim3",
"runner": "aarch64-runner",
"label": "board/khadas"
},
{
"id": "odroid-c2",
"defconfig": "odroid_c2",
"runner": "aarch64-runner",
"label": "board/odroid"
},
{
"id": "odroid-c4",
"defconfig": "odroid_c4",
"runner": "aarch64-runner",
"label": "board/odroid"
},
{
"id": "odroid-n2",
"defconfig": "odroid_n2",
"runner": "aarch64-runner",
"label": "board/odroid"
},
{
"id": "odroid-xu4",
"defconfig": "odroid_xu4",
"runner": "aarch64-runner",
"label": "board/odroid"
},
{
"id": "rpi2",
"defconfig": "rpi2",
"runner": "arm-runner",
"label": "board/raspberrypi"
},
{
"id": "rpi3",
"defconfig": "rpi3",
"runner": "arm-runner",
"label": "board/raspberrypi"
},
{
"id": "rpi3-64",
"defconfig": "rpi3_64",
"runner": "aarch64-runner",
"label": "board/raspberrypi"
},
{
"id": "rpi4",
"defconfig": "rpi4",
"runner": "arm-runner",
"label": "board/raspberrypi"
},
{
"id": "rpi4-64",
"defconfig": "rpi4_64",
"runner": "aarch64-runner",
"label": "board/raspberrypi"
},
{
"id": "yellow",
"defconfig": "yellow",
"runner": "aarch64-runner",
"label": "board/yellow"
},
{
"id": "tinker",
"defconfig": "tinker",
"runner": "arm-runner",
"label": "board/tinker"
}
]

28
.github/workflows/pr-checks.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
# Home Assistant Operating System pull-request checks
name: PR checks
on: [pull_request]
jobs:
linters:
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true
- name: Check Dockerfile
uses: brpaz/hadolint-action@v1.1.0
with:
dockerfile: Dockerfile
- name: Check shell scripts
uses: ludeeus/action-shellcheck@1.1.0
with:
ignore: buildroot buildroot-external/package/xe-guest-utilities
- name: Check buildroot-external packages
run: |
buildroot/utils/check-package --exclude PackageHeader --br2-external buildroot-external/package/*/*

15
.github/workflows/release-drafter.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Release Drafter
on:
push:
branches:
- dev
- rel-*
jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

175
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,175 @@
# Home Assistant Operating System release build workflow
name: Release build
on:
release:
types: [published]
jobs:
validate_release:
name: Validate release
runs-on: [ "ubuntu-20.04" ]
outputs:
version: ${{ steps.version_check.outputs.version }}
version_dev: ${{ steps.version_check.outputs.version_dev }}
matrix: ${{ steps.generate_matrix.outputs.result }}
steps:
- uses: actions/checkout@v2
- name: Validate version
id: version_check
run: |
major=$(cat ${GITHUB_WORKSPACE}/buildroot-external/meta | grep VERSION_MAJOR | cut -d'=' -f2)
build=$(cat ${GITHUB_WORKSPACE}/buildroot-external/meta | grep VERSION_BUILD | cut -d'=' -f2)
tag_major=$(echo "${{ github.event.release.tag_name }}" | cut -d '.' -f 1)
tag_build=$(echo "${{ github.event.release.tag_name }}" | cut -d '.' -f 2)
tag_dev=$(echo "${{ github.event.release.tag_name }}" | cut -d '.' -f 3)
if [ "${major}.${build}" != "${tag_major}.${tag_build}" ]; then
echo "Version number in Buildroot metadata is does not match tag (${major}.${build} vs ${{ github.event.release.tag_name }})."
exit 1
fi
if [ "" != "${tag_dev}" ]; then
echo "Note: Release build with custom dev part: ${tag_dev}."
echo "::set-output name=version::${major}.${build}.${tag_dev}"
else
echo "::set-output name=version::${major}.${build}"
fi
echo "::set-output name=version_dev::${tag_dev}"
- name: Create build matrix
uses: actions/github-script@v4
id: generate_matrix
with:
script: |
const boards = require('./.github/workflows/matrix.json')
return { "board": boards }
build:
name: Release build for ${{ matrix.board.id }}
needs: validate_release
strategy:
matrix: ${{ fromJson(needs.validate_release.outputs.matrix) }}
runs-on: ${{ matrix.board.runner }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: true
- name: Build container
run: docker build -t haos-builder .
- name: 'Add release PKI certs'
env:
RAUC_CERTIFICATE: ${{ secrets.RAUC_CERTIFICATE }}
RAUC_PRIVATE_KEY: ${{ secrets.RAUC_PRIVATE_KEY }}
run: |
echo -e "-----BEGIN CERTIFICATE-----\n${RAUC_CERTIFICATE}\n-----END CERTIFICATE-----" > cert.pem
echo -e "-----BEGIN PRIVATE KEY-----\n${RAUC_PRIVATE_KEY}\n-----END PRIVATE KEY-----" > key.pem
- name: Build
run: |
BUILDER_UID="$(id -u)"
BUILDER_GID="$(id -g)"
docker run --rm --privileged -v "${GITHUB_WORKSPACE}:/build" \
-e BUILDER_UID="${BUILDER_UID}" -e BUILDER_GID="${BUILDER_GID}" \
-v "${{ matrix.board.runner }}-build-cache:/cache" \
-v "/build/output" \
haos-builder make BUILDDIR=/build VERSION_DEV=${{ needs.validate_release.outputs.version_dev }} ${{ matrix.board.defconfig }}
- name: Upload disk image
if: ${{ matrix.board.id != 'ova' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ github.workspace }}/release/haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.img.xz
asset_name: haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.img.xz
asset_content_type: application/x-xz
- name: Upload rauc update
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ github.workspace }}/release/haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.raucb
asset_name: haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.raucb
asset_content_type: application/octet-stream
- name: Upload ova image
if: ${{ matrix.board.id == 'ova' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ github.workspace }}/release/haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.ova
asset_name: haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.ova
asset_content_type: application/x-tar
- name: Upload qcow2 image
if: ${{ matrix.board.id == 'ova' || matrix.board.id == 'generic-aarch64' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ github.workspace }}/release/haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.qcow2.xz
asset_name: haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.qcow2.xz
asset_content_type: application/x-xz
- name: Upload vdi image
if: ${{ matrix.board.id == 'ova' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ github.workspace }}/release/haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.vdi.zip
asset_name: haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.vdi.zip
asset_content_type: application/zip
- name: Upload vhdx image
if: ${{ matrix.board.id == 'ova' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ github.workspace }}/release/haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.vhdx.zip
asset_name: haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.vhdx.zip
asset_content_type: application/zip
- name: Upload vmdk image
if: ${{ matrix.board.id == 'ova' || matrix.board.id == 'generic-aarch64' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ github.workspace }}/release/haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.vmdk.zip
asset_name: haos_${{ matrix.board.id }}-${{ needs.validate_release.outputs.version }}.vmdk.zip
asset_content_type: application/zip
bump_version:
name: Bump dev version to ${{ needs.validate_release.outputs.version }}
needs: [ build, validate_release ]
runs-on: [ "ubuntu-20.04" ]
steps:
- name: Initialize git
uses: home-assistant/actions/helpers/git-init@master
with:
name: ${{ secrets.GIT_NAME }}
email: ${{ secrets.GIT_EMAIL }}
token: ${{ secrets.GIT_TOKEN }}
- name: Bump Home Assistant OS beta version
uses: home-assistant/actions/helpers/version-push@master
with:
key: "hassos[]"
key-description: "Home Assistant OS"
version: ${{ needs.validate_release.outputs.version }}
channel: "beta"

47
.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: Stale
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
steps:
# The 90 day stale policy
# Used for:
# - Issues & PRs
# - No PRs marked as no-stale or pinned
# - No issues marked as no-stale, help-wanted or pinned
- name: 90 days stale issues & PRs policy
uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 90
days-before-close: 7
operations-per-run: 150
remove-stale-when-updated: true
stale-issue-label: "stale"
exempt-issue-labels: "no-stale,help-wanted,pinned,enhancement"
stale-issue-message: >
There hasn't been any activity on this issue recently. To keep our
backlog manageable we have to clean old issues, as many of them have
already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant OS version and
check if that solves the issue. Let us know if that works for you by
adding a comment 👍
This issue has now been marked as stale and will be closed if no
further activity occurs. Thank you for your contributions.
stale-pr-label: "stale"
exempt-pr-labels: "no-stale,pinned"
stale-pr-message: >
There hasn't been any activity on this pull request recently. This
pull request has been automatically marked as stale because of that
and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

2
.gitignore vendored
View File

@@ -1,2 +1,4 @@
.DS_Store
/release
*.pem
output*/

4
.gitmodules vendored Normal file
View File

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

View File

@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM debian:bullseye
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@@ -9,17 +9,46 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gpg-agent \
gpg \
dirmngr \
software-properties-common \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
&& apt-get update && apt-get install -y --no-install-recommends \
docker-ce \
&& rm -rf /var/lib/apt/lists/*
# Build Tools
# Build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
wget patch vim cpio python unzip rsync bc bzip2 ncurses-dev sudo \
git make g++ file perl bash binutils locales qemu-utils bison flex \
bash \
bc \
binutils \
build-essential \
bzip2 \
cpio \
file \
git \
make \
ncurses-dev \
patch \
perl \
python3 \
python3-matplotlib \
python-is-python3 \
graphviz \
rsync \
sudo \
unzip \
zip \
wget \
qemu-utils \
openssh-client \
vim \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
skopeo \
jq \
&& rm -rf /var/lib/apt/lists/*
# Init entry

9
Documentation/README.md Normal file
View File

@@ -0,0 +1,9 @@
# Documentation
## Contents
- [Configuration](./configuration.md) - how users can configure HAOS
- [Network](./network.md) - approach to networking
- [Bluetooth](./bluetooth.md) - approach to bluetooth
- [Kernel](./kernel.md) - kernel versions
- [Boards](./boards/README.md) - board specific documentation

View File

@@ -0,0 +1,54 @@
# Boards
## Overview
The following boards/devices are supported:
- Raspberry Pi
- Pi 4 Model B (1 GB, 2 GB, 4 GB and 8 GB model) 64-bit (recommended)
- Pi 4 Model B (1 GB, 2 GB, 4 GB and 8 GB model) 32-bit
- Pi 3 Model B and B+ 64-bit (recommended)
- Pi 3 Model B and B+ 32-bit
- Pi 2 (not recommended)
- Pi Zero-W (not recommended)
- Pi (not recommended)
- Hardkernel
- Odroid-N2
- Odroid-N2+
- Odroid-C2
- Odroid-C4
- Odroid-XU4
- Asus
- Tinker Board
- Generic x86-64 (UEFI, not suited for virtualization)
- Intel NUC5CPYH
- Intel NUC6CAYH
- Intel NUC10I3FNK2
- Gigabyte GB-BPCE-3455
- Computers supporting x86-64 architecture and UEFI boot should generally work
- Virtual appliance (x86_64/UEFI):
- VMDK
- OVA ?
- VHDX ?
- VDI ?
- QCOW2 ?
Notes:
- see ? above: are these currently supported? see ova documentation which explains issues with previous OVA distribution)
## Board specifics
|Board|Build|Config|Docs|
|-----|----|------|----|
|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/)|
|Pi3B 64-bit |`make rpi3_64` |[rpi3_64](../../buildroot-external/configs/rpi3_64_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi3B 32-bit |`make rpi3` |[rpi3](../../buildroot-external/configs/rpi3_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi2 |`make rpi2` |[rpi2](../../buildroot-external/configs/rpi2_defconfig)|[raspberrypi](./raspberrypi/)|
|Odroid-N2/N2+ |`make odroid_n2` |[odroid_n2](../../buildroot-external/configs/odroid_n2_defconfig)|[hardkernel](./hardkernel/)|
|Odroid-C2 |`make odroid_c2` |[odroid_c2](../../buildroot-external/configs/odroid_c2_defconfig)|[hardkernel](./hardkernel/)|
|Odroid-C4 |`make odroid_c4` |[odroid_c4](../../buildroot-external/configs/odroid_c4_defconfig)|[hardkernel](./hardkernel/)|
|Odroid-XU4 |`make odroid_xu4` |[odroid_xu4](../../buildroot-external/configs/odroid_xu4_defconfig)|[hardkernel](./hardkernel/)|
|Tinker Board |`make tinker` |[tinker](../../buildroot-external/configs/tinker_defconfig)|[asus](./asus/)|
|Generic x86-64|`make generic_x86_64`|[generic_x86_64](../../buildroot-external/configs/generic_x86_64_defconfig)|[generic-x86-64](./generic-x86-64/)|
|OVA |`make ova` |[ova](../../buildroot-external/configs/ova_defconfig)|[ova](./ova/)|

View File

@@ -0,0 +1,31 @@
# Tinker Board
## Supported Hardware
| Device | Release Date | Support | Config |
|----------------|---------------|---------|----------|
| Tinker RK3288 | April 2017 | yes | [tinker](../../../buildroot-external/configs/tinker_defconfig) |
| Tinker S RK3288| January 2018 | yes | [tinker](../../../buildroot-external/configs/tinker_defconfig) |
| Tinker Edge T | November 2019 | no? | |
| Tinker Edge R | November 2019 | no? | |
## eMMC
eMMC support is provided with the same image. Just flash the image to the eMMC by connecting your Tinker Board S to your PC via Micro-USB. Refer to the Tinkerboard documentation how-to flash using Micro-USB and UMS.
The Home Assistant OS provided U-Boot does support UMS as well,
however manual intervention is necessary:
1. Set the jumper between Micro-USB and HDMI the maskrom mode
2. Insert SD card and connect the board via Micro-USB to your PC
3. Continusly press Ctrl+C to interrupt boot
4. Set the jumper back to the park position
5. Start UMS using:
```
ums 0 mmc 0
```
6. A mass storage device should appear. Flash Home Assistant OS to it.
## Serial console
To access the terminal over serial console, add `console=ttyS2,115200` to `cmdline.txt`. GPIO pins are: 34 = GND / 32 = UART TXD / 33 = UART RXD.

View File

@@ -0,0 +1,36 @@
# Generic aarch64
## Supported Hardware
This board configuration aims to support most aarch64 systems with UEFI boot
Hardware it has been tested with is listed below.
## Tested Hardware
| Device | Release Date | Support | Config |
|-----------------------|--------------|---------|-------------|
| QEMU | QEMU | yes | [generic_aarch64](../../../buildroot-external/configs/generic_aarch64_defconfig) |
## Requirements
- aarch64 support
- UEFI boot
## Wifi
WiFi is untested.
## Bluetooth
Bluetooth is untested.
## Installation
Make sure secure boot is disabled in the UEFI BIOS settings.
Currently there is no shiny installation method. Checklist:
- Boot PC to live environment using PXE or USB
- Copy or download the Home Assistant OS image into your live environment
- unxz the image and dd to the local hard disk
- Reboot

View File

@@ -0,0 +1,61 @@
# Generic x86-64
## Supported Hardware
This board configuration aims to support most x86-64 systems with UEFI boot. The
main aim is to support Intel NUC mini PCs and similar systems. Hardware it has
been tested with is listed below.
## Tested Hardware
| Device | Release Date | Support | Config |
|-----------------------|--------------|---------|-------------|
| Intel NUC5CPYH | Q3 2015 | yes | [generic_x86_64](../../../buildroot-external/configs/generic_x86_64_defconfig) |
| Intel NUC6CAYH | Q4 2016 | yes | [generic_x86_64](../../../buildroot-external/configs/generic_x86_64_defconfig) |
| Intel NUC7i3DNHE | Q3 2017 | yes | [generic_x86_64](../../../buildroot-external/configs/generic_x86_64_defconfig) |
| Intel NUC10i3FNK2 | Q4 2019 | yes | [generic_x86_64](../../../buildroot-external/configs/generic_x86_64_defconfig) |
| Gigabyte GB-BPCE-3455 | 2017 | yes* | [generic_x86_64](../../../buildroot-external/configs/generic_x86_64_defconfig) |
\* needs 'nomodeset' in cmdline.txt if you want a console
## Requirements
- x86-64 support
- UEFI boot
- SATA/AHCI or eMMC storage
- Supported NIC:
- Intel Gigabit NIC (e1000, igb - via Linux mainline)
- Intel PCIe Gigabit NIC (e1000e - via out-of-tree module in *buildroot-external/package/intel-e1000e*)
- Realtek Gigabit NIC (r8169)
- Intel Wireless Wifi 802.11ac (iwlwifi, see below)
## Wifi
The following cards are supported:
- Intel Wireless 3160
- Intel Wireless 7260
- Intel Wireless 7265
- Intel Wireless-AC 3165
- Intel Wireless-AC 3168
- Intel Wireless-AC 8260
- Intel Wireless-AC 8265
- Intel Wireless-AC 9260
- Intel Wireless-AC 9461
- Intel Wireless-AC 9462
- Intel Wireless-AC 9560
## Bluetooth
Bluetooth is untested.
## Installation
Make sure secure boot is disabled in the UEFI BIOS settings.
Currently there is no shiny installation method. Checklist:
- Boot PC to live environment using PXE or USB
- Copy or download the Home Assistant OS image into your live environment
- unxz the image and dd to the local hard disk
- Reboot

View File

@@ -0,0 +1,26 @@
# ODROID
## Supported Hardware
| Device | Release Date | Support | Config |
|----------------|---------------|--------------|-----------|
| ODROID-XU4 | 2015 | yes | [odroid_xu4](../../../buildroot-external/configs/odroid_xu4_defconfig)|
| ODROID-C2 | 2016 | yes | [odroid_c2](../../../buildroot-external/configs/odroid_c2_defconfig) |
| ODROID-C4 | 2020 | experimental | [odroid_c4](../../../buildroot-external/configs/odroid_c4_defconfig) |
| ODROID-N2 | 2019 | yes | [odroid_n2](../../../buildroot-external/configs/odroid_n2_defconfig) |
See separate documentation for each board.
## Connectivity devices
### Wi-Fi
The following devices have been tested on Home Assistant OS 5.8:
- [Bluetooth Module 2](https://www.hardkernel.com/shop/bluetooth-module-2/)
- [WiFi Module 3](https://www.hardkernel.com/shop/wifi-module-3/)
The [WiFi Module 5A](https://www.hardkernel.com/shop/wifi-module-5a/) is not
recommended as there is no upstream driver support available. The driver
currently compatible with recent Linux kernel version seems to have issues
connecting to 5GHz networks.

View File

@@ -0,0 +1,16 @@
# Odroid-C4
## Experimental
Odroid-C4 support is based heavily on the Odroid-C2 and N2 configurations. Given the similarity of the SoCs, as well as the comparable level of support in the Linux kernel, the C4 should hopefully present few surprises. However, Home Assistant support should be regarded as experimental.
Please also refer to the documentation pages for the [Odroid-C2](./odroid-c2.md) and [Odroid-N2](./odroid-n2.md), as some of that information may apply to the C4 as well.
Common C4 issues that have been specifically tested and appear to be working:
- boot from SD
- boot from eMMC
- MAC address obtained from eFuse
## GPIO
Refer to [the odroid wiki](https://wiki.odroid.com/odroid-c4/hardware/expansion_connectors).

View File

@@ -12,3 +12,7 @@ eg. `console=ttyAML0,115200n8 console=tty0`
## GPIO
Refer to [the odroid wiki](https://wiki.odroid.com/odroid-n2/hardware/expansion_connectors).
At this point not all functionality is supported by the upstream kernel used
by Home Assistant OS.
The GPIO on pin 11 is used as a low active power button input.

View File

@@ -1,22 +1,24 @@
# Odroid-XU4
# ODROID-XU4
## eMMC
The Odroid XU4 has a hidden boot sector that is only visible on the Odroid itself (can't be written by a card reader). There are a couple possibilities:
1) If the eMMC already had a working image before flashing HassOS:
* It will be booting to uBoot (but no further).
* If you have the serial adapter, you should be able to enter `distro_bootcmd` at the uboot prompt to continue booting.
* If not, flash the HassOS image to an SD card and boot off that temporarily (while the eMMC is also plugged in).
* Once booted, login at the prompts and then enter `dd if=/dev/mmcblk0 of=/dev/mmcblk0boot0 bs=512 skip=63 seek=62 count=1440` at the linux prompt.
* Reboot with eMMC (don't forget to flip the boot switch to eMMC)
2) Clean/wiped/corruped boot sector:
* You'll need to follow [Hardkernel's instructions](https://forum.odroid.com/viewtopic.php?f=53&t=6173) to get a working boot sector. Then flash HassOS and follow instructions above.
* Alternatively, you can try flash HassOS to both an SD and eMMC, then boot off the SD with the eMMC also plugged in, then run `dd if=/dev/mmcblk1 of=/dev/mmcblk0boot0 bs=512 skip=1 seek=0 count=16381` at the Linux prompt. Note that this is untested, but in theory should work..
The ODROID XU4 uses the eMMC boot partition to boot from. Typically eMMC readers can't write to this eMMC boot partition. There are a couple of possibilities:
1. **Working** e.g. the eMMC already had a working image before flashing HassOS:
- It will be booting to U-Boot (but no further).
- If you have the serial adapter, you should be able to enter `distro_bootcmd` at the uboot prompt to continue booting.
- If not, flash the HassOS image to an SD card and boot off that temporarily (while the eMMC is also plugged in).
- Once booted, login at the prompts and then enter `dd if=/dev/mmcblk0 of=/dev/mmcblk0boot0 bs=512 skip=63 seek=62 count=1440` at the linux prompt.
- Reboot with eMMC (don't forget to flip the boot switch to eMMC)
2. **Not Working** e.g. a clean/wiped/corruped eMMC boot partition:
- You'll need to follow [Hardkernel's instructions](https://forum.odroid.com/viewtopic.php?f=53&t=6173) to get a working boot sector. Then flash HassOS and follow instructions above.
- Alternatively, you can try flash HassOS to both an SD and eMMC, then boot off the SD with the eMMC also plugged in, then run `dd if=/dev/mmcblk1 of=/dev/mmcblk0boot0 bs=512 skip=1 seek=0 count=16381` at the Linux prompt. Note that this is untested, but in theory should work..
If you are getting permissions issues when using the dd command, try disabling RO:
`echo 0 > /sys/block/mmcblk0boot0/force_ro`
to re-enable after running dd:
`echo 1 > /sys/block/mmcblk0boot0/force_ro`
## Console
By default, console access is granted over the serial header and over HDMI. Certain startup messages will only appear on the serial console by default. To show the messages on the HDMI console instead, swap the order of the two consoles in the `cmdline.txt` file on the boot partition. You can also delete the SAC2 console if you don't plan on using the serial adapter.

View File

@@ -1,50 +0,0 @@
# Intel NUC
This board configuration supports the Intel NUC mini PCs and compatibles.
Probably most recent computers will work.
Requirements:
- x86-64 support
- UEFI boot
- SATA/AHCI storage
- Supported NIC:
- Intel Gigabit NIC (e1000, e1000e, igb)
- Realtek Gigabit NIC (r8169)
- Intel Wireless Wifi 802.11ac (iwlwifi, see below)
## Tested Hardware
| Device | Quirks |
|--------|-----------|
| Intel NUC5CPYH | |
| Gigabyte GB-BPCE-3455 | needs 'nomodeset' in cmdline.txt if you want a console |
## Wifi
The following cards are supported:
- Intel Wireless 3160
- Intel Wireless 7260
- Intel Wireless 7265
- Intel Wireless-AC 3165
- Intel Wireless-AC 3168
- Intel Wireless-AC 8260
- Intel Wireless-AC 8265
- Intel Wireless-AC 9260
- Intel Wireless-AC 9461
- Intel Wireless-AC 9462
- Intel Wireless-AC 9560
## Bluetooth
Bluetooth is untested.
## Installation
Currently there is no shiny installation method. Checklist:
- Boot PC to live-environment using PXE or USB
- Copy or download the hassos image into your live environment
- zcat the image to local harddisk
- Reboot

View File

@@ -1,18 +0,0 @@
# Virtual Machine
Using this VMDK in a virtual machine requires the following:
- Operating system: Other 4.x or later Linux (64-bit)
- Enabled support for UEFI boot
- SATA disk controller
- Minimal of 1GB RAM
- At least 2x vCPU
- An assigned network
# OVA (Open Virtual Appliance)
Currently, we only publish a VMDK virtual disk, due to issues with our previous OVA distribution. We are currently investigating our options to bring back the OVA distribution. However, the VMDK works on the following hypervisors:
- HyperV
- VirtualBox
- VMware

View File

@@ -0,0 +1,22 @@
# Virtual Machine
## Supported Hypervisors
| Hypervisor | Vendor | Support | Config |
|---------------------|-----------|-----------------|--------------------|
| HyperV | Microsoft | yes, via VMDK | [ova](../../../buildroot-external/configs/ova_defconfig) |
| VirtualBox | Oracle | yes, via VMDK | [ova](../../../buildroot-external/configs/ova_defconfig) |
| VMware | VMware | yes, via VMDK | [ova](../../../buildroot-external/configs/ova_defconfig) |
Currently we only publish a VMDK virtual disk due to issues with our previous OVA distribution. We are investigating our options to bring back the OVA distribution, however, the VMDK works for the hypervisors listed above.
## Requirements
Using this VMDK in a virtual machine requires the following:
- Operating system: Other 4.x or later Linux (64-bit)
- Enabled support for UEFI boot
- SATA disk controller
- Minimal of 1GB RAM
- At least 2x vCPU
- An assigned network

View File

@@ -1,49 +0,0 @@
# Raspberry PI
Supported Hardware:
| Device | Board |
|--------|-----------|
| Raspberry Pi A+/B/B+| rpi |
| Raspberry Pi Zero | rpi |
| Raspberry Pi Zero W | rpi0-w |
| Raspberry Pi 2 B | rpi2 |
| Raspberry Pi 3 B/B+ | rpi3 / rpi3-64 |
| Raspberry Pi 4 B | rpi4 / rpi4-64 |
## Limitation 64bit
The 64bit version is under development by RPi-Team. It work very nice but it could have some impacts. Actual we see that the SDcard access with ext4 are a bit slower than on 32bit.
## Serial console
For access to terminal over serial console, add `console=ttyAMA0,115200` to `cmdline.txt` and `enable_uart=1`, `dtoverlay=pi3-disable-bt` into `config.txt`. GPIO pins are: 6 = GND / 8 = UART TXD / 10 = UART RXD.
## I2C
Add `dtparam=i2c1=on` and `dtparam=i2c_arm=on` to `config.txt`. After that we create a module file on host with [config usb stick][config] or direct into `/etc/modules-load.d`.
rpi-i2c.conf:
```
i2c-dev
i2c-bcm2708
```
## USB Boot
USB mass storage boot is available on Raspberry Pi 3B, 3B+, 3A+, and 2B v1.2.
To enable USB boot, add `program_usb_boot_mode=1` into `config.txt`. Note that this **permanently** alters the one-time programmable memory of the device.
For more information see [RaspberryPi](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md).
### Caveats
* All bootable SD cards must be removed.
* Boot time can be significantly longer with USB. This is due to the boot process first attempting to boot from SD card, failing, and resorting to USB.
* Many USB drives simply do not work for boot. This is likely due to minimal driver support in uboot and will not be fixed. If you can't get it to boot on one drive, try a different brand/model. SanDisk Cruzer drives seem to have a higher rate of issues.
## Tweaks
If you don't need bluetooth, disabled it with add `dtoverlay=pi3-disable-bt` into `config.txt`.
[config]: ../configuration.md#automatic

View File

@@ -0,0 +1,50 @@
# Raspberry PI
## Supported Hardware
| Device | Release Date | Support | Config |
|---------------------|---------------|-----------------|--------------------|
| Raspberry Pi B/B+/A+|2012/2014/2014 | not recommended | [rpi](../../../buildroot-external/configs/rpi_defconfig) |
| Raspberry Pi 2 B |2015 | not recommended | [rpi2](../../../buildroot-external/configs/rpi2_defconfig) |
| Raspberry Pi 3 B/B+ |2016/2018 | yes | [rpi3](../../../buildroot-external/configs/rpi3_defconfig) / [rpi3_64](../../../buildroot-external/configs/rpi3_64_defconfig) |
| Raspberry Pi 4 B |2019 | yes | [rpi4](../../../buildroot-external/configs/rpi4_defconfig) / [rpi4_64](../../../buildroot-external/configs/rpi4_64_defconfig) |
## Serial console
For access to terminal over serial console, add `console=ttyAMA0,115200` to `cmdline.txt` and `enable_uart=1`, `dtoverlay=pi3-disable-bt` into `config.txt`. GPIO pins are: 6 = GND / 8 = UART TXD / 10 = UART RXD.
## I2C
Add `dtparam=i2c1=on` and `dtparam=i2c_arm=on` to `config.txt`. After that we create a module file on host with [config usb stick][config] or direct into `/etc/modules-load.d`.
rpi-i2c.conf:
```
i2c-dev
i2c-bcm2708
```
## USB Boot
USB mass storage boot is available on Raspberry Pi 4 (64-bit only), 3B, 3B+, 3A+, and 2B v1.2.
For Raspberry 3B, 3A+ and 2B v1.2, to enable USB boot, add `program_usb_boot_mode=1` into `config.txt`. Note that this **permanently** alters the one-time programmable memory of the device.
For Raspberry 4
* Make sure to update the bootloader to a stable release supporting USB mass storage boot (see [bcm2711_bootloader_config.md](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md#usbmassstorageboot)).
* If no SD card is used add `sd_poll_once=on` to `dtparam` in `config.txt` (comma separated). This gets rid of `mmc0: timeout waiting for hardware interrupt` kernel errors.
* If install still fails, then your SSD likely needs quirks enabled to work correctly (see [Finding the VID and PID of your USB SSD](https://www.raspberrypi.org/forums/viewtopic.php?t=245931)). Once you find your adapter's ID, add the quirks parameter in `cmdline.txt`.
For more information see [RaspberryPi](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md).
### Caveats
* All bootable SD cards must be removed.
* Boot time can be significantly longer with USB. This is due to the boot process first attempting to boot from SD card, failing, and resorting to USB.
* Many USB drives simply do not work for boot. This is likely due to minimal driver support in uboot and will not be fixed. If you can't get it to boot on one drive, try a different brand/model. SanDisk Cruzer drives seem to have a higher rate of issues.
## Tweaks
If you don't need bluetooth, disabled it with add `dtoverlay=pi3-disable-bt` into `config.txt`.
[config]: ../../configuration.md#automatic

View File

@@ -1,17 +0,0 @@
# Tinker Board
Supported Hardware:
| Device | Board |
|--------|-----------|
| Tinker RK3288 | tinker |
| Tinker S RK3288 | tinker |
## eMMC
eMMC support is provided transparently. Just flash the image to the eMMC by connecting your Tinker Board S to your PC via Micro-USB.
## Serial console
To access the terminal over serial console, add `console=ttyS2,115200` to `cmdline.txt`. GPIO pins are: 34 = GND / 32 = UART TXD / 33 = UART RXD.

View File

@@ -3,7 +3,7 @@
## Automatic
You can use an USB drive with HassOS to configure network options, SSH access to the host and to install updates.
Format a USB stick with FAT32/EXT4/NTFS and name it `CONFIG` (in all capitals). Alternative you can create a `CONFIG` folder inside boot partition. Use the following directory structure within the USB drive:
Format a USB stick with FAT32/EXT4/NTFS and name it `CONFIG` (in all capitals). Alternative you can create a `CONFIG` folder inside the `boot` partition. Use the following directory structure within the USB drive:
```text
network/
@@ -19,12 +19,14 @@ hassos-xy.raucb
- The `modules` folder is for modules-load configuration files.
- The `modprobe` folder is for modules configuration files (/etc/modprobe.d)
- The `udev` folder is for udev rules files.
- The `authorized_keys` file activates debug SSH access on port `22222`. See [Debugging Hassio][debug-hassio].
- The `authorized_keys` file activates debug SSH access on port `22222`. See [Debugging Home Assistant][debug-homeassistant].
- The `timesyncd.conf` file allow you to set different NTP servers. HassOS won't boot without correct working time servers!
- The `hassos-*.raucb` file is a firmware OTA update which will be installed. These can be found on on the [release][hassos-release] page.
Text files that are on USB stick must have Unix (LF) end of line characters. If you create USB stick on Windows machine, be sure to use Notepad++, Visual Studio Code or any other editor, that supports different line endings. In Notepad++ LF EOL can be enabled with setting `Edit -> EOL Conversion -> Unix (LF)`.
You can put this USB stick into the device and it will be read on startup and files written to the correct places. You can also trigger this process later over the
API/UI or by calling `systemctl restart hassos-config` on the host. *The USB Stick just needs to be insterted to the device during this setup process and can be disconnected afterwards.*
API/UI or by calling `systemctl restart hassos-config` on the host. *The USB Stick just needs to be inserted to the device during this setup process and can be disconnected afterwards.*
## Local
@@ -47,7 +49,9 @@ You can manual add, edit or remove connections configurations from `/etc/Network
### NTP
You can manual edit the systemd timesync file on `/etc/systemd/timesyncd.conf`.
Our default ntp configuration look like:
Our default NTP configuration look like:
```
[Time]
NTP=time1.google.com time2.google.com time3.google.com
@@ -57,4 +61,4 @@ FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
[systemd-modules]: https://www.freedesktop.org/software/systemd/man/modules-load.d.html
[network.md]: network.md
[hassos-release]: https://github.com/home-assistant/hassos/releases/
[debug-hassio]: https://developers.home-assistant.io/docs/en/hassio_debugging.html
[debug-homeassistant]: https://developers.home-assistant.io/docs/operating-system/debugging

View File

@@ -1,22 +0,0 @@
# Deployment
We provide 3 different types of release builds:
- development (beta/dev)
- staging (rc)
- production (stable)
## Versioning
The format of version is *MAJOR.BUILD*. Everytime we create a new release with same userland, we bump the build number.
The development number they will be bump for the stable release version and the development version go to next major number.
## Git branch/Tag
The branch `dev` ist the actual development branch and from there we never make a release. The `master` branch contains the development version and from there we build a beta release.
If we create a new staging/productive release, we create a new branch `rel-{MAJOR}`. They will be used for the whole cycle of this release.
## Upload release files
We use [ghr](https://github.com/tcnksm/ghr) to upload files to our repository. A binary version is available inside `scripts`.

View File

@@ -1,24 +0,0 @@
# Development
## Boot system
`BOOT_SYS`:
- efi
- hyprid
- spl
- mbr
HassOS is basicly used GPT. But for use GPT we need own the first 1024 of
boot drive. Is that not possible, you can use MBR for your device, they work also with SPLs.
Hyprid and SPL use both a hyprid MBR/GPT table but SPL move the GPT header 8MB for give space to write SPL and boot images before.
`BOOTLOADER`:
- uboot
- barebox
We support mainly uboot but for uefi system we can also use barebox. In future we hope to remove barebox with uboot also on uefi.
`DISK_SIZE`:
Default 2. That is the size of end image in GB.

View File

@@ -1,106 +0,0 @@
Getting started with Hassos development using Docker on GNU/Linux
=================================================================
First, install **docker** for your distribution - I'd advise to use your distro's provided packages, since that will make sure permissions et al. are sanely set up for what you are about to run. You're also expected to have your current user properly set up in in your sudoers policy, so that this account may elevate to root and execute arbitrary commands as UID 0 (this is required, since at some point during the build process, a new loopback device-backed filesystem image will be mounted inside a docker container - which requires a "privileged" container to run, which can only be done as root).
Next, make sure the docker daemon is running:
```
$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: https://docs.docker.com
```
My desktop distro doesn't start newly installed services by default, which means I'll have to manually fire up the `docker` service:
```
$ sudo systemctl start docker
$ sudo systemctl --no-pager status docker -n0
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2018-10-10 21:08:23 CEST; 25s ago
Docs: https://docs.docker.com
Main PID: 1531 (dockerd)
Tasks: 27 (limit: 4915)
Memory: 163.4M
CGroup: /system.slice/docker.service
├─1531 /usr/bin/dockerd -H fd://
└─1539 docker-containerd --config /var/run/docker/containerd/containerd.toml
```
Now, change your working directory to your hassos repo checkout (please adapt pathnames as needed), make sure your intended changes to the source tree are applied (and committed, ideally :)), and execute the `enter.sh` helper script:
```
$ cd ~/codebase/hassos/
$ sudo scripts/enter.sh
Sending build context to Docker daemon 30.48MB
Step 1/6 : FROM ubuntu:18.04
[...]
---> 4dc25a21556b
Successfully built 4dc25a21556b
Successfully tagged hassbuildroot:latest
```
Note that the current iteration of `enter.sh` will try to load the **overlayfs** kernel module, which is not strictly required for docker's operation, as far as I can tell. It's OK if loading that module fails; the shell script will continue executing. If everything works out, you will find yourself in an interactive login shell inside your docker container/build environment, where you can peek around:
```
root@somehashinhex:/build#
root@somehashinhex:/build# make help
[...]
```
The _hassos_ developers provide a Makefile that will build hassos images for a (rather long!) list of targets. For example run the command below to start building the _ova_ variant, and go make a cup of tea. Or fifteen.
```
root@0db6f7079872:/build# make ova
[...]
```
That will result in a single VMDK image file at the very end of the build process. This image file is a compressed block device dump with a proper GPT partition table, prepared to ship into any OVA-compatible hypervisor's innards. For me, the end of the **ova** build steps looks like this:
```
[...]
2097152+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 12.2145 s, 87.9 MB/s
make: Leaving directory '/build/buildroot'
make: Entering directory '/build/buildroot'
rm -rf /build/buildroot/output/target /build/buildroot/output/images /build/buildroot/output/host \
/build/buildroot/output/build /build/buildroot/output/staging \
/build/buildroot/output/legal-info /build/buildroot/output/graphs
make: Leaving directory '/build/buildroot'
```
The artifacts you just built are placed in the `target/` subdirectory:
```
root@fd292c061896:/build# ls -lh release/
total 141M
-rw-r--r-- 1 root root 141M Oct 10 20:22 hassos_ova-2.2.vmdk.gz
```
In order to be able to use this image file with the **qemu** hypervisor, you'll need to unpack it, and convert it to an image format that qemu can work with. Conveniently, the _hassos_ buildenv already provides all the tools we need for this conversion:
```
root@fd292c061896:/build# gunzip release/hassos_ova-2.2.vmdk.gz
root@fd292c061896:/build# qemu-img convert -O qcow2 release/hassos_ova-2.2.vmdk release/hassos_ova-2.2.qcow2
root@fd292c061896:/build# ls -lh release/
total 673M
-rw-r--r-- 1 root root 337M Oct 10 20:25 hassos_ova-2.2.qcow2
-rw-r--r-- 1 root root 337M Oct 10 20:22 hassos_ova-2.2.vmdk
```
Now, exit the docker container's environment, and find the build artifacts in the `releases/` directory beneath your repository checkout dir. (The generated files will be owned by _root_; make sure to `chown` them to your user account, if needed.)
From there, qemu can try to boot it. Since the generated image assumes UEFI support in the host/hypervisor, this is slightly more tricky than with "classic"(/legacy) MBR-based images. On the *Debian* host I use to run my qemu virtual machine on, you'll need to install the **ovmf** package, which is described as providing "UEFI firmware for 64-bit x86 virtual machines". That package will install a _TianoCore_-derived qemu UEFI image build at `/usr/share/OVMF/OVMF_CODE.fd`, which we'll use with qemu to boot the generated qcow2 image. (Please adapt pathnames as necessary, for example if you have installed the ovmf firmware image at another location.)
```
$ /usr/bin/qemu-system-x86_64 -enable-kvm -name hassos_ova -smp 2 -m 1024 -drive file=release/hassos_ova-2.2.qcow2,index=0,media=disk,if=ide,cache=none,format=qcow2 -drive file=/usr/share/ovmf/x64/OVMF_CODE.fd,if=pflash,format=raw,readonly=on
```
This should pop up qemu's SDL frontend, displaying _hassos_' VT/CLI environment. Specifying addtional options and flags to qemu for network access, keyboard layout et al. are left as an exercise for the reader.
After the boot process has finished, you can log in to _hassos_ without a password, providing *root* as the username. From there, executing `login` on the *hassio>* shell prompt will yield a root shell in the host OS.
Happy hacking! :)

View File

@@ -1,14 +1,22 @@
# Kernel Version
Default Kernel tree: 5.4
Default Kernel tree: 5.15
| Board | Version |
|-------|---------|
| Open Virtual Applicance | 5.4.18 |
| Raspberry Pi | 4.19.93 |
| Tinker Board | 4.19.88 |
| Odroid-C2 | 5.4.18 |
| Odroid-N2 | 5.4.18 |
| Odroid-XU4 | 5.4.18 |
| Intel NUC | 5.4.18 |
| Open Virtual Appliance | 5.15.45 |
| Raspberry Pi | 5.15.32 |
| Raspberry Pi 0-W | 5.15.32 |
| Raspberry Pi 2 | 5.15.32 |
| Raspberry Pi 3 | 5.15.32 |
| Raspberry Pi 4 | 5.15.32 |
| Home Assistant Yellow | 5.15.32 |
| Tinker Board | 5.15.45 |
| Odroid-C2 | 5.15.45 |
| Odroid-C4 | 5.15.45 |
| Odroid-N2 | 5.15.45 |
| Odroid-XU4 | 5.15.45 |
| Generic aarch64 | 5.15.45 |
| Generic x86-64 | 5.15.45 |
| Khadas VIM3 | 5.15.45 |

View File

@@ -1,21 +1,52 @@
# Network
## Configure Network
HassOS uses NetworkManager to control the host network. In future releases, you will be able to set up the configuration using the API/UI. Currently only a manual configuration using NetworkManager connection files is supported. Without a configuration file, the device will use DHCP by default. These network connection files can be placed on a USB drive and imported to the host as described in [Configuration][configuration-usb].
Home Assistant Operating System uses NetworkManager to control the host network.
## Configuration Examples
## Configure network
You can read the [Official Manual][keyfile] or find many configuration examples across the internet. The system is read-only, if you don't want the IP address to change on every boot, you should set the UUID property with a generic [UUID4][uuid]. Inside `\CONFIG\network\` on the USB or SD, create a file called `my-network` and add the appropriate contents below:
By default the device will be in DHCP state.
Basic network settings can be set through the Supervisor frontend in the System
tab. Advanced configurations such as VLAN are also available through the
`ha network` CLI command.
To restore the default configuration the `ha network` CLI command can be used as
well:
```
ha network update default --ipv4-method auto
```
If more advanced network settings are required network connection files can be
placed on a USB drive and imported to the host as described in
[Configuration][configuration-usb].
## Manual Network Configuration
If the frontend or `ha network` CLI cannot meet your use case, it is still
possible to configure the underlying NetworkManager manually.
You can read the [NetworkManager manual][nm-manual] or find many configuration
examples across the internet. Note that changes to `NetworkManager.conf` are
not supported currently, only connection keyfiles are supported. Keep in mind
that the system is read-only. If you don't want the IP address to change on
every boot, you should modify the UUID property to a generic [UUID4][uuid].
Inside the `\CONFIG\network\` directory on the USB drive or SD card, create a
file called `my-network` and add the appropriate contents below:
**NOTE: Please make sure to save this file with UNIX line endings (LF, and not Windows' default CRLF endings). You can do this using Notepad these days!**
### Default
We have a preinstalled connection profile:
A preinstalled connection profile for wired network is active by default:
```ini
[connection]
id=my-network
id=Home Assistant OS default
uuid=f62bf7c2-e565-49ff-bbfc-a4cf791e6add
type=802-3-ethernet
llmnr=2
mdns=2
[ipv4]
method=auto
@@ -25,13 +56,15 @@ addr-gen-mode=stable-privacy
method=auto
```
### LAN
### Wired connection to the LAN
```ini
[connection]
id=my-network
uuid=d55162b4-6152-4310-9312-8f4c54d86afa
type=802-3-ethernet
llmnr=2
mdns=2
[ipv4]
method=auto
@@ -41,7 +74,7 @@ addr-gen-mode=stable-privacy
method=auto
```
### Wireless WPA/PSK
### Wireless LAN WPA/PSK
```ini
[connection]
@@ -78,68 +111,83 @@ method=manual
address=192.168.1.111/24;192.168.1.1
dns=8.8.8.8;8.8.4.4;
```
For address, the value before the semicolon is the IP address and subnet prefix bitlength; the second value is the IP address of the gateway.
For `address`, the value before the semicolon is the IP address and subnet prefix bitlength. The second value (after the semicolon) is the IP address of the local gateway.
## Tips
### Reset network
If you want to reset the network configuration back to the default DHCP settings, use the following commands on the host:
If you want to reset the network configuration back to the default connection
profile using DHCP, use the following commands on the host console:
```bash
$ rm /etc/NetworkManager/system-connections/*
$ cp /usr/share/system-connections/* /etc/NetworkManager/system-connections/
$ nmcli con reload
# rm -r /mnt/overlay/etc/NetworkManager/system-connections
# reboot
```
Home Assistant OS will recreate the default connection profile during boot.
### Enabling WiFi
WiFi is discouraged for reliability reasons. However if you're still like to use WiFi, you can us the `ha network` command to set up WiFi (example for a Raspberry Pi 4, check `ha network info` to check if your board supports WiFi and the name of the WiFi device):
```bash
ha network update wlan0 --enabled --ipv4-method auto --wifi-auth wpa-psk --wifi-mode infrastructure --wifi-ssid MY-SSID --wifi-psk MY_PASS
````
### Powersave
If you have trouble with powersave you can do following:
If you have trouble with powersave then apply the following changes:
```ini
[wifi]
# Values are 0 (use default), 1 (ignore/don't touch), 2 (disable) or 3 (enable).
powersave=0
```
## Using nmcli to set a static IPV4 address
Log into the HASSOS base system via a console:
## Using `nmcli` to set a static IPv4 address
Log into the the Home Assistant OS base system via a console:
```bash
Welcome to Home Assistant
homeassistant login:
```
Welcome to HassOS
Hassio login:
- Login as `root` (no password needed). At the `ha >` prompt, type `login` (as instructed).
From there you use the `nmcli` configuration tool.
- `# nmcli con show` will list the "Home Assistant OS default" connection in use.
- `# nmcli con show "Home Assistant OS default"` will list all the properties of the connection.
To start editing the configuration setting for "Home Assistant OS default":
```bash
# nmcli con edit "Home Assistant OS default"
```
Login as `root` (no password needed)
At the `hassio >` prompt, type `login` (as instructed).
From here you will use the `nmcli` configuration tool.
`# nmcli connection show` will list the “HassOS default” connection in use.
`# nmcli con show "HassOS default"` will list all the properties of the connection.
`# nmcli con edit "HassOS default"` will put you in a position to edit the connection.
`nmcli> print ipv4` will show you the ipv4 properties of this connection.
To add your static IP address (select 'yes' for manual method);
```
```bash
nmcli> set ipv4.addresses 192.168.100.10/24
Do you also want to set 'ipv4.method' to 'manual'? [yes]:
```
In addition I have found it is wise to set the dns server and the local gateway. For most home routers these will be the same address. If you are using Pi-Hole you can set the dns to that.
```
In addition, it's recommended to set the DNS server and the local gateway. For most home routers the DNS server will have the same IP address as the router itself. If you are using Pi-Hole or a third-party DNS system then you can set the DNS server to that.
```bash
nmcli> set ipv4.dns 192.168.100.1
nmcli> set ipv4.gateway 192.168.100.1
nmcli> save
nmcli> quit
```
`nmcli> print ipv4` will show you the IPv4 properties of this connection. With `nmcli> save` you will save the changes afterwards.
If you now view the default connection `cat /etc/NetworkManager/system-connections/default` you should see the method is manual and the address is set.
Doing a `nmcli con reload` does not always work so restart the VM.
Doing a `nmcli con reload` does not always work, so restart the virtual machine or the physical system.
[keyfile]: https://developer.gnome.org/NetworkManager/stable/nm-settings.html
[nm-manual]: https://developer.gnome.org/NetworkManager/stable/manpages.html
[configuration-usb]: configuration.md
[uuid]: https://www.uuidgenerator.net/

BIN
Documentation/usb-disk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View File

@@ -1,12 +1,22 @@
RELEASE_DIR = /build/release
BUILDDIR:=$(shell pwd)
RELEASE_DIR = $(BUILDDIR)/release
BUILDROOT=/build/buildroot
BUILDROOT_EXTERNAL=/build/buildroot-external
BUILDROOT=$(BUILDDIR)/buildroot
BUILDROOT_EXTERNAL=$(BUILDDIR)/buildroot-external
DEFCONFIG_DIR = $(BUILDROOT_EXTERNAL)/configs
VERSION_DATE := $(shell date --utc +'%Y%m%d')
VERSION_DEV := "dev$(VERSION_DATE)"
TARGETS := $(notdir $(patsubst %_defconfig,%,$(wildcard $(DEFCONFIG_DIR)/*_defconfig)))
TARGETS_CONFIG := $(notdir $(patsubst %_defconfig,%-config,$(wildcard $(DEFCONFIG_DIR)/*_defconfig)))
# Set O variable if not already done on the command line
ifneq ("$(origin O)", "command line")
O := $(BUILDDIR)/output
else
override O := $(BUILDDIR)/$(O)
endif
.NOTPARALLEL: $(TARGETS) $(TARGETS_CONFIG) all
.PHONY: $(TARGETS) $(TARGETS_CONFIG) all clean help
@@ -16,24 +26,28 @@ all: $(TARGETS)
$(RELEASE_DIR):
mkdir -p $(RELEASE_DIR)
savedefconfig:
@echo "config $*"
$(MAKE) -C $(BUILDROOT) O=$(O) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) "savedefconfig"
$(TARGETS_CONFIG): %-config:
@echo "config $*"
$(MAKE) -C $(BUILDROOT) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) "$*_defconfig"
$(MAKE) -C $(BUILDROOT) O=$(O) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) "$*_defconfig"
$(TARGETS): %: $(RELEASE_DIR) %-config
@echo "build $@"
$(MAKE) -C $(BUILDROOT) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL)
cp -f $(BUILDROOT)/output/images/hassos_* $(RELEASE_DIR)/
$(MAKE) -C $(BUILDROOT) O=$(O) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) VERSION_DEV=$(VERSION_DEV)
cp -f $(O)/images/haos_* $(RELEASE_DIR)/
# Do not clean when building for one target
ifneq ($(words $(filter $(TARGETS),$(MAKECMDGOALS))), 1)
@echo "clean $@"
$(MAKE) -C $(BUILDROOT) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) clean
$(MAKE) -C $(BUILDROOT) O=$(O) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) clean
endif
@echo "finished $@"
clean:
$(MAKE) -C $(BUILDROOT) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) clean
$(MAKE) -C $(BUILDROOT) O=$(O) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) clean
help:
@echo "Supported targets: $(TARGETS)"

View File

@@ -1,15 +1,58 @@
[![Build Status](https://dev.azure.com/home-assistant/Hass.io/_apis/build/status/hassos?branchName=dev)](https://dev.azure.com/home-assistant/Hass.io/_build/latest?definitionId=13&branchName=dev)
# Home Assistant Operating System
# HassOS
Hass.io OS based on [buildroot](https://buildroot.org/). It's a hypervisor for Docker and supports various kind of IoT hardware. It is also available as virtual appliance. The whole system is optimized for embedded system and security. You can update the system simple with OTA updates or offline updates.
Home Assistant Operating System (formerly HassOS) is a Linux based operating system optimized to host [Home Assistant](https://www.home-assistant.io) and its [Add-ons](https://www.home-assistant.io/addons/).
## Focus
Home Assistant Operating System uses Docker as Container engine. It by default 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.
- Barebox as bootloader on EFI
- U-Boot as bootloader on IoT
- Linux/Buildroot LTS
- RAUC for OTA updates
- SquashFS LZ4 as filesystem
- Docker-CE
- AppArmor protected
- ZRAM LZ4 for /tmp, /var, swap
## Features
- Lightweight and memory-efficient
- Minimized I/O
- Over The Air (OTA) updates
- Offline updates
- Modular using Docker container engine
## Supported hardware
- Raspberry Pi
- Hardkernel ODROID
- Asus Tinker Board
- Generic x86-64 (e.g. Intel NUC)
- Virtual appliances
See the full list and specific models [here](./Documentation/boards/README.md)
## Getting Started
If you just want to use Home Assistant the official [getting started guide](https://www.home-assistant.io/getting-started/) and [installation instructions](https://www.home-assistant.io/hassio/installation/) take you through how to download Home Assistant Operating System and get it running on your machine.
If you're interested in finding out more about Home Assistant Operating System and how it works read on...
## Development
If you don't have experience with embedded systems, Buildroot or the build process for Linux distributions it is recommended to read up on these topics first (e.g. [Bootlin](https://bootlin.com/docs/) has excellent resources).
The Home Assistant Operating System documentation can be found on the [Home Assistant Developer Docs website](https://developers.home-assistant.io/docs/operating-system).
### Components
- **Bootloader:**
- [Barebox](https://barebox.org/) 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
- **File Systems:**
- [SquashFS](https://www.kernel.org/doc/Documentation/filesystems/squashfs.txt) for read-only file systems (using LZ4 compression)
- [ZRAM](https://www.kernel.org/doc/Documentation/blockdev/zram.txt) for `/tmp`, `/var` and swap (using LZ4 compression)
- **Container Platform:**
- [Docker Engine](https://docs.docker.com/engine/) for running Home Assistant components in containers
- **Updates:**
- [RAUC](https://rauc.io/) for Over The Air (OTA) and USB updates
- **Security:**
- [AppArmor](https://apparmor.net/) Linux kernel security module
### Development builds
The Development build GitHub Action Workflow is a manually triggered workflow
which creates Home Assistant OS development builds. The development builds are
available at [os-builds.home-assistant.io](https://os-builds.home-assistant.io/).

View File

@@ -1,49 +0,0 @@
# https://dev.azure.com/home-assistant
trigger:
batch: true
branches:
include:
- dev
pr:
- dev
variables:
- name: versionHadolint
value: 'v1.17.2'
- name: versionShellCheck
value: 'v0.7.0'
jobs:
- job: 'Hadolint'
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
sudo docker pull hadolint/hadolint:$(versionHadolint)
displayName: 'Install Hadolint'
- script: |
sudo docker run --rm -i \
-v $(pwd)/.hadolint.yaml:/.hadolint.yaml:ro \
hadolint/hadolint:$(versionHadolint) < Dockerfile
displayName: 'Run Hadolint'
- job: 'ShellCheck'
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
sudo docker pull koalaman/shellcheck:$(versionShellCheck)
displayName: 'Install ShellCheck'
- script: |
sudo docker run --rm -i \
-v $(pwd):/mnt:ro koalaman/shellcheck:$(versionShellCheck) \
scripts/*.sh \
buildroot-external/scripts/*.sh \
buildroot-external/board/**/*.sh \
buildroot-external/rootfs-overlay/usr/sbin/* \
buildroot-external/rootfs-overlay/usr/libexec/* \
buildroot-external/rootfs-overlay/usr/lib/rauc/*
displayName: 'Run ShellCheck'

View File

@@ -1,95 +0,0 @@
# https://dev.azure.com/home-assistant
trigger:
batch: true
tags:
include:
- '*'
exclude:
- untagged*
pr: none
variables:
- name: versionGHR
value: 'v0.13.0'
- group: github
- group: rauc
jobs:
- job: 'VersionValidate'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
. buildroot-external/meta
if [ "${VERSION_MAJOR}.${VERSION_BUILD}" != "$(Build.SourceBranchName)" ]; then
exit 1
fi
displayName: 'Check version of branch/tag'
- job: 'Release'
dependsOn:
- 'VersionValidate'
timeoutInMinutes: 240
pool:
name: 'Buildroot'
strategy:
maxParallel: 1
matrix:
OpenVirtualAppliance:
board: 'ova'
IntelNuc:
board: 'intel_nuc'
OdroidC2:
board: 'odroid_c2'
OdroidN2:
board: 'odroid_n2'
OdroidXU4:
board: 'odroid_xu4'
RaspberryPi:
board: 'rpi'
RaspberryPi0-W:
board: 'rpi0_w'
RaspberryPi2:
board: 'rpi2'
RaspberryPi3:
board: 'rpi3'
RaspberryPi3-64:
board: 'rpi3_64'
RaspberryPi4:
board: 'rpi4'
RaspberryPi4-64:
board: 'rpi4_64'
AsusTinker:
board: 'tinker'
workspace:
clean: 'all'
steps:
- script: |
echo -e "-----BEGIN CERTIFICATE-----\n$(releaseCertificate)\n-----END CERTIFICATE-----" > cert.pem
echo -e "-----BEGIN PRIVATE KEY-----\n$(releaseKey)\n-----END PRIVATE KEY-----" > key.pem
displayName: 'Add release PKI certs'
- script: |
sudo docker build -t hassos:azure .
displayName: 'Build container for HassOS'
- script: |
curl -SsL https://github.com/tcnksm/ghr/releases/download/$(versionGHR)/ghr_$(versionGHR)_linux_amd64.tar.gz | tar xzf -
cp ghr_$(versionGHR)_linux_amd64/ghr .
rm -rf ghr_$(versionGHR)_linux_amd64
displayName: 'Install GHR'
- script: |
BUILDER_UID="$(id -u)"
BUILDER_GID="$(id -g)"
sudo docker run --rm --privileged -v "$(pwd):/build" \
-e BUILDER_UID="${BUILDER_UID}" -e BUILDER_GID="${BUILDER_GID}" \
-v "/mnt/build-cache:/cache" \
hassos:azure make $(board)
displayName: 'Build $(board)'
- script: |
./ghr -t $(githubToken) $(Build.SourceBranchName) release/
displayName: 'Upload $(board)'

1
buildroot Submodule

Submodule buildroot added at 7995541510

View File

@@ -1,7 +1,17 @@
source "$BR2_EXTERNAL_HASSOS_PATH/package/hassos/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/libapparmor/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/apparmor/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/bluetooth-bcm43xx/Config.in"
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/hardkernel-boot/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hassio/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/khadas-boot/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/os-agent/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/pi-bluetooth/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/qemu-guest-agent/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/rpi-eeprom/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/rpi-rf-mod/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/rtl88x2bu/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/rtl8821cu/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/tempio/Config.in.host"
source "$BR2_EXTERNAL_HASSOS_PATH/package/udisks2/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/xe-guest-utilities/Config.in"

View File

@@ -0,0 +1 @@
console=tty1 console=ttyS0

View File

@@ -0,0 +1,59 @@
set default=99
set timeout=1
set ORDER="A B"
set A_OK=0
set B_OK=0
set A_TRY=0
set B_TRY=0
set MACHINE_ID=""
load_env
# select bootable slot
for SLOT in $ORDER; do
if [ "$SLOT" == "A" ]; then
INDEX=0
OK=$A_OK
TRY=$A_TRY
A_TRY=1
fi
if [ "$SLOT" == "B" ]; then
INDEX=1
OK=$B_OK
TRY=$B_TRY
B_TRY=1
fi
if [ "$OK" -eq 1 -a "$TRY" -eq 0 ]; then
default=$INDEX
break
fi
done
# reset booted flags
if [ "$default" -eq 99 ]; then
if [ "$A_OK" -eq 1 -a "$A_TRY" -eq 1 ]; then
A_TRY=0
fi
if [ "$B_OK" -eq 1 -a "$B_TRY" -eq 1 ]; then
B_TRY=0
fi
default=0
fi
save_env A_TRY A_OK B_TRY B_OK ORDER MACHINE_ID
default_cmdline="rootwait zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor systemd.machine_id=$MACHINE_ID cgroup_enable=memory fsck.repair=yes"
file_env -f ($root)/cmdline.txt cmdline
# root is a full HDD/partition definition in GRUB format like hd0,gpt1
# We extract the part before the comma to then append our own partition index
# at the end. This is hacky but the best way I found
regexp --set 1:boothd (.+),.+ ${root}
menuentry "Slot A (OK=$A_OK TRY=$A_TRY)" {
linux (${boothd},gpt2)/Image root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd $default_cmdline $cmdline rauc.slot=A
}
menuentry "Slot B (OK=$B_OK TRY=$B_TRY)" {
linux (${boothd},gpt4)/Image root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 $default_cmdline $cmdline rauc.slot=B
}

View File

@@ -0,0 +1,27 @@
#!/bin/bash
# shellcheck disable=SC2155
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local EFIPART_DATA="${BINARIES_DIR}/efi-part"
mkdir -p "${BOOT_DATA}/EFI/BOOT"
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
cp -r "${EFIPART_DATA}/"* "${BOOT_DATA}/"
}
function hassos_post_image() {
convert_disk_image_virtual vmdk
convert_disk_image_virtual qcow2
convert_disk_image_zip vmdk
convert_disk_image_xz qcow2
convert_disk_image_xz
}

View File

@@ -0,0 +1,20 @@
CONFIG_EFI_STUB=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_INPUT=m
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_BLK_SCSI=y
CONFIG_VIRTIO_CONSOLE=m
CONFIG_VIRTIO_VSOCKETS=m
CONFIG_VIRTIO_MMIO=y
CONFIG_SCSI_VIRTIO=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_NVME_CORE=y
CONFIG_BLK_DEV_NVME=y
CONFIG_NVME_HWMON=y
CONFIG_DRM_VIRTIO_GPU=m

View File

@@ -0,0 +1,10 @@
BOARD_ID=generic-aarch64
BOARD_NAME="Generic aarch64"
CHASSIS=embedded
BOOTLOADER=grub
KERNEL_FILE=Image
BOOT_SYS=efi
BOOT_SPL=false
DISK_SIZE=6
SUPERVISOR_MACHINE=qemuarm-64
SUPERVISOR_ARCH=aarch64

View File

@@ -7,22 +7,23 @@ function hassos_pre_image() {
cp -t "${BOOT_DATA}" \
"${BINARIES_DIR}/boot.scr" \
"${BINARIES_DIR}/rk3288-tinker.dtb"
"${BINARIES_DIR}/rk3288-tinker.dtb" \
"${BINARIES_DIR}/rk3288-tinker-s.dtb"
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"
# Create boot binary
rm -f "${BINARIES_DIR}/u-boot-spl-dtb.img"
mkimage -n rk3288 -T rksd -d "${BINARIES_DIR}/u-boot-spl-dtb.bin" "${BINARIES_DIR}/u-boot-spl-dtb.img"
cat "${BINARIES_DIR}/u-boot-dtb.bin" >> "${BINARIES_DIR}/u-boot-spl-dtb.img"
# SPL
create_spl_image
dd if="${BINARIES_DIR}/u-boot-spl-dtb.img" of="${SPL_IMG}" conv=notrunc bs=512 seek=64
dd if="${BINARIES_DIR}/idbloader.img" of="${SPL_IMG}" conv=notrunc bs=512 seek=64
dd if="${BINARIES_DIR}/u-boot-dtb.img" of="${SPL_IMG}" conv=notrunc bs=512 seek=8192
}
function hassos_post_image() {
convert_disk_image_gz
convert_disk_image_xz
}

View File

@@ -0,0 +1,2 @@
# Uncomment this to enable GPIO support for RPI-RF-MOD/HM-MOD-RPI-PCB
#overlays=rpi-rf-mod

View File

@@ -1517,7 +1517,7 @@ CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIBTUSB_BCM=y
CONFIG_BT_HCIBTUSB_RTL=y
CONFIG_BT_HCIBTSDIO=y
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_SERDEV=y
CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_NOKIA is not set
@@ -1527,6 +1527,7 @@ CONFIG_BT_HCIUART_ATH3K=y
CONFIG_BT_HCIUART_3WIRE=y
# CONFIG_BT_HCIUART_INTEL is not set
# CONFIG_BT_HCIUART_BCM is not set
CONFIG_BT_HCIUART_RTL=y
# CONFIG_BT_HCIUART_QCA is not set
# CONFIG_BT_HCIUART_AG6XX is not set
# CONFIG_BT_HCIUART_MRVL is not set
@@ -1556,7 +1557,6 @@ CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y
CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y
CONFIG_CFG80211_DEFAULT_PS=y
CONFIG_CFG80211_DEBUGFS=y
CONFIG_CFG80211_CRDA_SUPPORT=y
CONFIG_CFG80211_WEXT=y
CONFIG_LIB80211=y
CONFIG_LIB80211_CRYPT_WEP=y
@@ -2109,7 +2109,7 @@ CONFIG_ATH10K_USB=m
# CONFIG_ATH10K_TRACING is not set
CONFIG_WCN36XX=m
# CONFIG_WCN36XX_DEBUGFS is not set
CONFIG_RTL8188EU=m
# CONFIG_ATH11K is not set
CONFIG_WLAN_VENDOR_ATMEL=y
CONFIG_AT76C50X_USB=m
CONFIG_WLAN_VENDOR_BROADCOM=y
@@ -2130,50 +2130,14 @@ CONFIG_HOSTAP=y
CONFIG_HOSTAP_FIRMWARE=y
CONFIG_HOSTAP_FIRMWARE_NVRAM=y
# CONFIG_P54_COMMON is not set
CONFIG_WLAN_VENDOR_MARVELL=y
CONFIG_LIBERTAS=m
CONFIG_LIBERTAS_USB=m
CONFIG_LIBERTAS_SDIO=m
CONFIG_LIBERTAS_SPI=m
# CONFIG_LIBERTAS_DEBUG is not set
# CONFIG_LIBERTAS_MESH is not set
CONFIG_LIBERTAS_THINFIRM=y
# CONFIG_LIBERTAS_THINFIRM_DEBUG is not set
CONFIG_LIBERTAS_THINFIRM_USB=m
CONFIG_MWIFIEX=y
CONFIG_MWIFIEX_SDIO=y
CONFIG_MWIFIEX_USB=m
CONFIG_WLAN_VENDOR_MEDIATEK=y
CONFIG_MT7601U=m
CONFIG_MT76_CORE=m
CONFIG_MT76_LEDS=y
CONFIG_MT76_USB=m
CONFIG_MT76x2_COMMON=m
CONFIG_MT76x0U=m
CONFIG_MT76x2U=m
CONFIG_WLAN_VENDOR_RALINK=y
CONFIG_RT2X00=y
CONFIG_RT2500USB=y
CONFIG_RT73USB=y
CONFIG_RT2800USB=y
CONFIG_RT2800USB_RT33XX=y
CONFIG_RT2800USB_RT35XX=y
CONFIG_RT2800USB_RT3573=y
CONFIG_RT2800USB_RT53XX=y
CONFIG_RT2800USB_RT55XX=y
CONFIG_RT2800USB_UNKNOWN=y
CONFIG_RT2800_LIB=y
CONFIG_RT2X00_LIB_USB=y
CONFIG_RT2X00_LIB=y
CONFIG_RT2X00_LIB_FIRMWARE=y
CONFIG_RT2X00_LIB_CRYPTO=y
CONFIG_RT2X00_LIB_LEDS=y
# CONFIG_RT2X00_LIB_DEBUGFS is not set
# CONFIG_RT2X00_DEBUG is not set
# CONFIG_WLAN_VENDOR_MARVELL is not set
# CONFIG_WLAN_VENDOR_MEDIATEK is not set
# CONFIG_WLAN_VENDOR_MICROCHIP is not set
# CONFIG_WLAN_VENDOR_RALINK is not set
CONFIG_WLAN_VENDOR_REALTEK=y
CONFIG_RTL8187=m
CONFIG_RTL8187_LEDS=y
CONFIG_RTL_CARDS=m
CONFIG_RTL_CARDS=y
CONFIG_RTL8192CU=m
CONFIG_RTLWIFI=m
CONFIG_RTLWIFI_USB=m
@@ -2183,9 +2147,9 @@ CONFIG_RTL8XXXU=y
# CONFIG_RTL8XXXU_UNTESTED is not set
CONFIG_WLAN_VENDOR_RSI=y
# CONFIG_RSI_91X is not set
CONFIG_WLAN_VENDOR_ST=y
# CONFIG_WLAN_VENDOR_ST is not set
# CONFIG_CW1200 is not set
CONFIG_WLAN_VENDOR_TI=y
# CONFIG_WLAN_VENDOR_TI is not set
# CONFIG_WL1251 is not set
# CONFIG_WL12XX is not set
# CONFIG_WL18XX is not set
@@ -2511,7 +2475,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
# CONFIG_SERIAL_ST_ASC is not set
CONFIG_SERIAL_DEV_BUS=y
# CONFIG_SERIAL_DEV_CTRL_TTYPORT is not set
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
# CONFIG_TTY_PRINTK is not set
# CONFIG_HVC_DCC is not set
# CONFIG_IPMI_HANDLER is not set

View File

@@ -3,5 +3,8 @@ BOARD_NAME="Asus TinkerBoard"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=zImage
BOOT_SYS=spl
BOOT_SYS=hybrid
BOOT_SPL=true
BOOT_ENV_SIZE=0x8000
SUPERVISOR_MACHINE=tinker
SUPERVISOR_ARCH=armv7

View File

@@ -1,122 +0,0 @@
From 7ba71967a2678e119bcd819ac92d08bd038e1879 Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Mon, 17 Jul 2017 18:34:33 +0000
Subject: [PATCH 5/5] Mali midgard r19p0 fixes for 4.13 kernels
Mostly due to DMA structure members renamed, and some signatures
modifications done during the development of Linux 4.11.
* mm, fs: reduce fault, page_mkwrite, and pfn_mkwrite to take only vmf
11bac80004499ea59f361ef2a5516c84b6eab675
v4.11-rc1
* sched/headers: Move task->mm handling methods to <linux/sched/mm.h>
68e21be2916b359fd8afb536c1911dc014cfd03e
v4.11-rc1
* sched/headers: Move task-stack related APIs from <linux/sched.h> to
<linux/sched/task_stack.h>
f3ac60671954c8d413532627b1be13a76f394c49
v4.11-rc1
* dma-fence: Introduce drm_fence_set_error() helper
a009e975da5c7d42a7f5eaadc54946eb5f76c9af
v4.11-rc1
Signed-off-by: Myy <myy@miouyouyou.fr>
---
drivers/gpu/arm/midgard/mali_kbase.h | 4 ++++
drivers/gpu/arm/midgard/mali_kbase_fence.h | 4 ++++
drivers/gpu/arm/midgard/mali_kbase_mem_linux.c | 6 ++++++
drivers/gpu/arm/midgard/mali_kbase_sync_file.c | 12 ++++++++++++
4 files changed, 26 insertions(+)
diff --git a/drivers/gpu/arm/midgard/mali_kbase.h b/drivers/gpu/arm/midgard/mali_kbase.h
index d77f186..5ee47c4 100644
--- a/drivers/gpu/arm/midgard/mali_kbase.h
+++ b/drivers/gpu/arm/midgard/mali_kbase.h
@@ -35,6 +35,10 @@
#include <linux/mutex.h>
#include <linux/rwsem.h>
#include <linux/sched.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#include <linux/sched/task_stack.h>
+#include <linux/sched/mm.h>
+#endif
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/vmalloc.h>
diff --git a/drivers/gpu/arm/midgard/mali_kbase_fence.h b/drivers/gpu/arm/midgard/mali_kbase_fence.h
index 8d39299..3c2e3a9 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_fence.h
+++ b/drivers/gpu/arm/midgard/mali_kbase_fence.h
@@ -134,7 +134,11 @@ static inline bool kbase_fence_out_is_ours(struct kbase_jd_atom *katom)
static inline int kbase_fence_out_signal(struct kbase_jd_atom *katom,
int status)
{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0))
katom->dma_fence.fence->status = status;
+#else
+ katom->dma_fence.fence->error = status;
+#endif
return dma_fence_signal(katom->dma_fence.fence);
}
diff --git a/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c b/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c
index b1f2c46..896aa35 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c
+++ b/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c
@@ -1788,8 +1788,14 @@ static void kbase_cpu_vm_close(struct vm_area_struct *vma)
KBASE_EXPORT_TEST_API(kbase_cpu_vm_close);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0))
static int kbase_cpu_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
+#else
+static int kbase_cpu_vm_fault(struct vm_fault *vmf)
+{
+ struct vm_area_struct *vma = vmf->vma;
+#endif
struct kbase_cpu_mapping *map = vma->vm_private_data;
pgoff_t rel_pgoff;
size_t i;
diff --git a/drivers/gpu/arm/midgard/mali_kbase_sync_file.c b/drivers/gpu/arm/midgard/mali_kbase_sync_file.c
index 4e1621c..d84a54e 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_sync_file.c
+++ b/drivers/gpu/arm/midgard/mali_kbase_sync_file.c
@@ -161,8 +161,13 @@ static void kbase_fence_wait_callback(struct dma_fence *fence,
struct kbase_context *kctx = katom->kctx;
/* Cancel atom if fence is erroneous */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0))
if (dma_fence_is_signaled(kcb->fence) && kcb->fence->status < 0)
katom->event_code = BASE_JD_EVENT_JOB_CANCELLED;
+#else
+ if (dma_fence_is_signaled(kcb->fence) && kcb->fence->error < 0)
+ katom->event_code = BASE_JD_EVENT_JOB_CANCELLED;
+#endif
if (kbase_fence_dep_count_dec_and_test(katom)) {
/* We take responsibility of handling this */
@@ -273,10 +278,17 @@ static void kbase_sync_fence_info_get(struct dma_fence *fence,
* 1 : signaled
*/
if (dma_fence_is_signaled(fence)) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0))
if (fence->status < 0)
info->status = fence->status; /* signaled with error */
else
info->status = 1; /* signaled with success */
+#else
+ if (fence->error < 0)
+ info->status = fence->error; /* signaled with error */
+ else
+ info->status = 1; /* signaled with success */
+#endif
} else {
info->status = 0; /* still active (unsignaled) */
}
--
2.10.2

View File

@@ -0,0 +1,55 @@
From ff0c5c49024da05b47d4fcc4d115761c43eef7a6 Mon Sep 17 00:00:00 2001
Message-Id: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Wed, 17 Feb 2021 19:55:41 +0100
Subject: [PATCH] Revert "ARM: dts: rockchip: use DMA channels for UARTs for
RK3288"
This reverts commit 3425fe335c29310f6628faf9a7947d07f32d8962.
---
arch/arm/boot/dts/rk3288.dtsi | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 4dcdcf17c977..ff6faa82192b 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -378,8 +378,6 @@ uart0: serial@ff180000 {
reg-io-width = <4>;
clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>;
clock-names = "baudclk", "apb_pclk";
- dmas = <&dmac_peri 1>, <&dmac_peri 2>;
- dma-names = "tx", "rx";
pinctrl-names = "default";
pinctrl-0 = <&uart0_xfer>;
status = "disabled";
@@ -393,8 +391,6 @@ uart1: serial@ff190000 {
reg-io-width = <4>;
clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>;
clock-names = "baudclk", "apb_pclk";
- dmas = <&dmac_peri 3>, <&dmac_peri 4>;
- dma-names = "tx", "rx";
pinctrl-names = "default";
pinctrl-0 = <&uart1_xfer>;
status = "disabled";
@@ -421,8 +417,6 @@ uart3: serial@ff1b0000 {
reg-io-width = <4>;
clocks = <&cru SCLK_UART3>, <&cru PCLK_UART3>;
clock-names = "baudclk", "apb_pclk";
- dmas = <&dmac_peri 7>, <&dmac_peri 8>;
- dma-names = "tx", "rx";
pinctrl-names = "default";
pinctrl-0 = <&uart3_xfer>;
status = "disabled";
@@ -436,8 +430,6 @@ uart4: serial@ff1c0000 {
reg-io-width = <4>;
clocks = <&cru SCLK_UART4>, <&cru PCLK_UART4>;
clock-names = "baudclk", "apb_pclk";
- dmas = <&dmac_peri 9>, <&dmac_peri 10>;
- dma-names = "tx", "rx";
pinctrl-names = "default";
pinctrl-0 = <&uart4_xfer>;
status = "disabled";
--
2.36.1

View File

@@ -0,0 +1,55 @@
From e73b4b762a0842cc75b2784e4c4267f6f4fc50c4 Mon Sep 17 00:00:00 2001
Message-Id: <e73b4b762a0842cc75b2784e4c4267f6f4fc50c4.1652225232.git.stefan@agner.ch>
In-Reply-To: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
References: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Mon, 5 Nov 2018 22:15:14 +0100
Subject: [PATCH] ARM: DTS: rk3288-tinker: Defining the SPI interface
Taken from, and tested by @TonyMac32 .
Well, the original one was tested by him but I had to adapt the
registers definitions to the new 64-bits LPAE-compliant syntax.
Therefore that *might* break, along with a few other patches.
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
[move change to rk3288-tinker.dtsi]
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/rk3288-tinker.dtsi | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index 9c1e38c54eae..cf278bcc91ad 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -485,6 +485,25 @@ &sdio0 {
status = "okay";
};
+&spi2 {
+ max-freq = <50000000>;
+ status = "okay";
+
+ spidev@0 {
+ compatible = "rockchip,spi_tinker";
+ reg = <0x0 0>;
+ spi-max-frequency = <50000000>;
+ spi-cpha = <1>;
+ };
+
+ spidev@1 {
+ compatible = "rockchip,spi_tinker";
+ reg = <0x1>;
+ spi-max-frequency = <50000000>;
+ spi-cpha = <1>;
+ };
+};
+
&tsadc {
rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
--
2.36.1

View File

@@ -1,36 +0,0 @@
From f76c9c58669a3bba0456191431be558ab8054f50 Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Mon, 17 Jul 2017 11:43:00 +0000
Subject: [PATCH 3/5] Using the new header on 4.12 kernels for copy_*_user
These changes are due to :
* generic ...copy_..._user primitives
d597580d373774b1bdab84b3d26ff0b55162b916
Version : 4.12-rc1
Signed-off-by: Myy <myy@miouyouyou.fr>
---
drivers/base/ump/src/linux/ump_kernel_linux.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/base/ump/src/linux/ump_kernel_linux.c b/drivers/base/ump/src/linux/ump_kernel_linux.c
index d6c3c53..bb3a7f0 100644
--- a/drivers/base/ump/src/linux/ump_kernel_linux.c
+++ b/drivers/base/ump/src/linux/ump_kernel_linux.c
@@ -20,7 +20,12 @@
#include <linux/ump-ioctl.h>
#include <linux/ump.h>
-#include <asm/uaccess.h> /* copy_*_user */
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
+#include <asm/uaccess.h> /* copy_*_user */
+#else
+#include <linux/uaccess.h> /* copy_*_user */
+#endif
#include <linux/compat.h>
#include <linux/module.h> /* kernel module definitions */
#include <linux/fs.h> /* file system operations */
--
2.10.2

View File

@@ -0,0 +1,41 @@
From 00de5155d12a178b83961f459ddccd7fa08ec25c Mon Sep 17 00:00:00 2001
Message-Id: <00de5155d12a178b83961f459ddccd7fa08ec25c.1652225232.git.stefan@agner.ch>
In-Reply-To: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
References: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Fri, 4 Sep 2020 21:57:55 +0200
Subject: [PATCH] ARM: dts: rockchip: enable I2C1/4 on rk3288-tinker
Enable I2C devices which are accessible via 40-pin header.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/rk3288-tinker.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index cf278bcc91ad..f23c6efd39d4 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -344,10 +344,18 @@ regulator-state-mem {
};
};
+&i2c1 {
+ status = "okay";
+};
+
&i2c2 {
status = "okay";
};
+&i2c4 {
+ status = "okay";
+};
+
&i2c5 {
status = "okay";
};
--
2.36.1

View File

@@ -1,46 +0,0 @@
From 63c110cdebc2c692964e1250c6f74f9e8c47c85d Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Tue, 10 Jan 2017 04:28:48 +0000
Subject: [PATCH 4/5] Adapt get_user_pages calls to use the new calling
procedure
These changes are due to this commit:
mm: replace get_user_pages_remote() write/force parameters with gup_flags
9beae1ea89305a9667ceaab6d0bf46a045ad71e7
Kernel: 4.9.0-rc
Signed-off-by: Myy <myy@miouyouyou.fr>
---
drivers/base/ump/src/linux/ump_kernel_linux_mem.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/base/ump/src/linux/ump_kernel_linux_mem.c b/drivers/base/ump/src/linux/ump_kernel_linux_mem.c
index 9186dd0..def4c0e 100644
--- a/drivers/base/ump/src/linux/ump_kernel_linux_mem.c
+++ b/drivers/base/ump/src/linux/ump_kernel_linux_mem.c
@@ -35,6 +35,10 @@
#include <ump_arch.h>
#include <common/ump_kernel_priv.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
+#include <linux/pfn_t.h>
+#endif
+
static void umpp_vm_close(struct vm_area_struct *vma)
{
umpp_cpu_mapping * mapping;
@@ -222,7 +226,11 @@ int umpp_linux_mmap(struct file * filp, struct vm_area_struct * vma)
paddr = alloc->block_array[block_idx].addr;
}
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4,4,0))
err = vm_insert_mixed(vma, vma->vm_start + (i << PAGE_SHIFT), paddr >> PAGE_SHIFT);
+#else
+ err = vm_insert_mixed(vma, vma->vm_start + (i << PAGE_SHIFT), __pfn_to_pfn_t(paddr >> PAGE_SHIFT, PFN_DEV));
+#endif
paddr += PAGE_SIZE;
}
--
2.10.2

View File

@@ -1,40 +0,0 @@
From 7c27055687c595e9f9eca484314f4fe3866a4260 Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Tue, 18 Jul 2017 17:35:16 +0000
Subject: [PATCH 2/2] Don't be TOO severe when looking for the IRQ names
Using strncmp with an all caps result in the driver being unable to
initialize itself when using the mainlined RK3288 DTS files, since they
define the IRQ names as "job", "mmu" and "gpu" instead of "JOB", "MMU"
and "GPU".
strncmp calls have been replaced by strncasecmp calls in order to
avoid such issue.
Signed-off-by: Myy <myy@miouyouyou.fr>
---
drivers/gpu/arm/midgard/mali_kbase_core_linux.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/arm/midgard/mali_kbase_core_linux.c b/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
index 0cccb0b..9cc65d2 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
+++ b/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
@@ -938,11 +938,11 @@ static int assign_irqs(struct platform_device *pdev)
}
#ifdef CONFIG_OF
- if (!strncmp(irq_res->name, "JOB", 4)) {
+ if (!strncasecmp(irq_res->name, "JOB", 4)) {
irqtag = JOB_IRQ_TAG;
- } else if (!strncmp(irq_res->name, "MMU", 4)) {
+ } else if (!strncasecmp(irq_res->name, "MMU", 4)) {
irqtag = MMU_IRQ_TAG;
- } else if (!strncmp(irq_res->name, "GPU", 4)) {
+ } else if (!strncasecmp(irq_res->name, "GPU", 4)) {
irqtag = GPU_IRQ_TAG;
} else {
dev_err(&pdev->dev, "Invalid irq res name: '%s'\n",
--
2.10.2

View File

@@ -0,0 +1,34 @@
From e45da42e71e4f92995d5ec11679ca00b0971dbfe Mon Sep 17 00:00:00 2001
Message-Id: <e45da42e71e4f92995d5ec11679ca00b0971dbfe.1652225232.git.stefan@agner.ch>
In-Reply-To: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
References: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 21:24:47 +0200
Subject: [PATCH] RK3288: DTSI: rk3288.dtsi: Add missing SPI2 pinctrl
The spi2_cs1 pin reference is missing in the spi2 first pin control
definition.
This patch is taken from the patches provided by the ARMbian team.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index ff6faa82192b..5061c5418d75 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -311,7 +311,7 @@ spi2: spi@ff130000 {
dma-names = "tx", "rx";
interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
pinctrl-names = "default";
- pinctrl-0 = <&spi2_clk &spi2_tx &spi2_rx &spi2_cs0>;
+ pinctrl-0 = <&spi2_clk &spi2_tx &spi2_rx &spi2_cs0 &spi2_cs1>;
reg = <0x0 0xff130000 0x0 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
--
2.36.1

View File

@@ -0,0 +1,31 @@
From e33d3ba4c34d0893d9d07b62ad4eea41d2e8bbc0 Mon Sep 17 00:00:00 2001
Message-Id: <e33d3ba4c34d0893d9d07b62ad4eea41d2e8bbc0.1652225232.git.stefan@agner.ch>
In-Reply-To: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
References: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Mon, 5 Nov 2018 20:16:05 +0100
Subject: [PATCH] ARM: DTSI: rk3288-tinker: Improving the CPU max voltage
Taken from the various patches provided by @TonyMac32 .
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288-tinker.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index f23c6efd39d4..cdff130d1292 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -186,7 +186,7 @@ vdd_cpu: DCDC_REG1 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <750000>;
- regulator-max-microvolt = <1400000>;
+ regulator-max-microvolt = <1450000>;
regulator-name = "vdd_arm";
regulator-ramp-delay = <6000>;
regulator-state-mem {
--
2.36.1

View File

@@ -1,42 +0,0 @@
From ef7689887c31d2b1336e14f2c089185e8f60a9f1 Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Mon, 7 Aug 2017 19:22:39 +0000
Subject: [PATCH] Added the new "compatible" list, mainly used by Rockchip
Because, you know, all the Mali Midgard GPU used to define the GPU
using the 'compatible = "arm,mali-midgard"' property, which worked fine.
But it was removed.
They replaced the "arm,mali-midgard" node by "arm,mali-tXXX" where XXX
is the GPU series, and added "arm,rk3288-mali" which is used by nothing.
Which broke the Mali Midgard GPL kernel driver.
This patch fixes this issue.
Signed-off-by: Myy <myy@miouyouyou.fr>
---
drivers/gpu/arm/midgard/mali_kbase_core_linux.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/arm/midgard/mali_kbase_core_linux.c b/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
index 27dcd9c1..cc4932a4 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
+++ b/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
@@ -4742,6 +4742,12 @@ static const struct dev_pm_ops kbase_pm_ops = {
static const struct of_device_id kbase_dt_ids[] = {
{ .compatible = "arm,malit6xx" },
{ .compatible = "arm,mali-midgard" },
+ { .compatible = "arm,mali-t720" },
+ { .compatible = "arm,mali-t760" },
+ { .compatible = "arm,mali-t820" },
+ { .compatible = "arm,mali-t830" },
+ { .compatible = "arm,mali-t860" },
+ { .compatible = "arm,mali-t880" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, kbase_dt_ids);
--
2.13.0

View File

@@ -0,0 +1,119 @@
From e073d75cd0dbfbcbbf1b46e565b326db37b75e6a Mon Sep 17 00:00:00 2001
Message-Id: <e073d75cd0dbfbcbbf1b46e565b326db37b75e6a.1652225232.git.stefan@agner.ch>
In-Reply-To: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
References: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Sun, 7 Jan 2018 01:52:44 +0100
Subject: [PATCH] drivers: mmc: dw-mci-rockchip: Handle ASUS Tinkerboard reboot
On ASUS Tinkerboard systems, if the SDMMC hardware is shutdown before
rebooting, the system will be dead, as the SDMMC is the only way to
boot anything, and the hardware doesn't power up the SDMMC hardware
automatically when rebooting.
So, when using an ASUS Tinkerboard system, a new reboot handler is
installed. This reboot handler takes care of powering the SDMMC
hardware again before restarting the system, resolving the issue.
The code was inspired by the pwrseq_emmc.c, which seems to overcome
similar effects with eMMC hardware.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
drivers/mmc/host/dw_mmc-rockchip.c | 66 ++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
index d36991acd6df..a526927e29df 100644
--- a/drivers/mmc/host/dw_mmc-rockchip.c
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
@@ -12,6 +12,11 @@
#include <linux/pm_runtime.h>
#include <linux/slab.h>
+#include <linux/regulator/consumer.h>
+#include <linux/reboot.h>
+#include <linux/delay.h>
+#include "../core/core.h"
+
#include "dw_mmc.h"
#include "dw_mmc-pltfm.h"
@@ -330,6 +335,66 @@ static const struct of_device_id dw_mci_rockchip_match[] = {
};
MODULE_DEVICE_TABLE(of, dw_mci_rockchip_match);
+struct dw_mci_rockchip_broken_boards_data {
+ struct notifier_block reset_nb;
+ struct platform_device *pdev;
+};
+
+/* This reboot handler handles cases where disabling the SDMMC on
+ * reboot will cause the hardware to be unable to start correctly
+ * after rebooting.
+ *
+ * This happens with Tinkerboard systems...
+ */
+static int dw_mci_rockchip_broken_boards_reset_nb(
+ struct notifier_block *this,
+ unsigned long mode, void *cmd)
+{
+ struct dw_mci_rockchip_broken_boards_data const *data =
+ container_of(this,
+ struct dw_mci_rockchip_broken_boards_data,
+ reset_nb);
+ struct dw_mci *host = platform_get_drvdata(data->pdev);
+ struct mmc_host *mmc = host->slot->mmc;
+
+ printk(KERN_ERR "Meow.\n");
+
+ mmc_power_off(mmc);
+
+ mdelay(20);
+
+ if (!IS_ERR(mmc->supply.vmmc))
+ regulator_enable(mmc->supply.vmmc);
+
+ if (!IS_ERR(mmc->supply.vqmmc))
+ regulator_set_voltage(mmc->supply.vqmmc, 3000000, 3300000);
+
+ printk(KERN_ERR "woeM.\n");
+
+ return NOTIFY_DONE;
+}
+
+static void dw_mci_rockchip_register_broken_boards_reboot_handler(
+ struct platform_device *pdev)
+{
+ struct dw_mci_rockchip_broken_boards_data *data;
+
+ if (!of_machine_is_compatible("asus,rk3288-tinker"))
+ return;
+
+ data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+
+ if (!data)
+ return;
+
+ data->reset_nb.notifier_call =
+ dw_mci_rockchip_broken_boards_reset_nb;
+ data->reset_nb.priority = 255;
+ register_restart_handler(&data->reset_nb);
+
+ data->pdev = pdev;
+}
+
static int dw_mci_rockchip_probe(struct platform_device *pdev)
{
const struct dw_mci_drv_data *drv_data;
@@ -357,6 +422,7 @@ static int dw_mci_rockchip_probe(struct platform_device *pdev)
}
pm_runtime_put_autosuspend(&pdev->dev);
+ dw_mci_rockchip_register_broken_boards_reboot_handler(pdev);
return 0;
}
--
2.36.1

View File

@@ -1,98 +0,0 @@
From ee7f0a678fff8316ec0be973f1b3780a63f50942 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Mon, 11 Dec 2017 21:04:56 +0100
Subject: [PATCH] gpu: arm: Midgard: setup_timer() -> timer_setup()
This patch is due the changes provoked by series of commit ending
at 513ae785c63c30741e46f43960213d4ae5382ec0, and removing the
setup_timer macros.
The previous patches replaced made sure that timers were all set
up with setup_timer and replaced setup_timer calls by timer_setup
calls.
This changed was introduced in the 4.15-rc1.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
drivers/gpu/arm/midgard/mali_kbase.h | 2 +-
drivers/gpu/arm/midgard/mali_kbase_context.c | 4 ++--
drivers/gpu/arm/midgard/mali_kbase_softjobs.c | 4 ++--
drivers/gpu/arm/midgard/mali_kbase_tlstream.c | 6 ++----
4 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/arm/midgard/mali_kbase.h b/drivers/gpu/arm/midgard/mali_kbase.h
index a4ceab9e0..27bde3b71 100644
--- a/drivers/gpu/arm/midgard/mali_kbase.h
+++ b/drivers/gpu/arm/midgard/mali_kbase.h
@@ -213,7 +213,7 @@ int kbase_soft_event_update(struct kbase_context *kctx,
bool kbase_replay_process(struct kbase_jd_atom *katom);
-void kbasep_soft_job_timeout_worker(unsigned long data);
+void kbasep_soft_job_timeout_worker(struct timer_list *t);
void kbasep_complete_triggered_soft_events(struct kbase_context *kctx, u64 evt);
/* api used internally for register access. Contains validation and tracing */
diff --git a/drivers/gpu/arm/midgard/mali_kbase_context.c b/drivers/gpu/arm/midgard/mali_kbase_context.c
index f43db48fd..589df768c 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_context.c
+++ b/drivers/gpu/arm/midgard/mali_kbase_context.c
@@ -165,9 +165,9 @@ kbase_create_context(struct kbase_device *kbdev, bool is_compat)
mutex_init(&kctx->vinstr_cli_lock);
- setup_timer(&kctx->soft_job_timeout,
+ timer_setup(&kctx->soft_job_timeout,
kbasep_soft_job_timeout_worker,
- (uintptr_t)kctx);
+ 0);
return kctx;
diff --git a/drivers/gpu/arm/midgard/mali_kbase_softjobs.c b/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
index 127ada07f..019edf562 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
+++ b/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
@@ -370,9 +370,9 @@ static void kbase_fence_debug_timeout(struct kbase_jd_atom *katom)
}
#endif /* CONFIG_MALI_FENCE_DEBUG */
-void kbasep_soft_job_timeout_worker(unsigned long data)
+void kbasep_soft_job_timeout_worker(struct timer_list *t)
{
- struct kbase_context *kctx = (struct kbase_context *)data;
+ struct kbase_context *kctx = from_timer(kctx, t, soft_job_timeout);
u32 timeout_ms = (u32)atomic_read(
&kctx->kbdev->js_data.soft_job_timeout_ms);
struct timer_list *timer = &kctx->soft_job_timeout;
diff --git a/drivers/gpu/arm/midgard/mali_kbase_tlstream.c b/drivers/gpu/arm/midgard/mali_kbase_tlstream.c
index d01aa23b2..11d8b59c7 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_tlstream.c
+++ b/drivers/gpu/arm/midgard/mali_kbase_tlstream.c
@@ -1042,13 +1042,11 @@ static void kbasep_tlstream_flush_stream(enum tl_stream_type stype)
* Timer is executed periodically to check if any of the stream contains
* buffer ready to be submitted to user space.
*/
-static void kbasep_tlstream_autoflush_timer_callback(unsigned long data)
+static void kbasep_tlstream_autoflush_timer_callback(struct timer_list *unused)
{
enum tl_stream_type stype;
int rcode;
- CSTD_UNUSED(data);
-
for (stype = 0; stype < TL_STREAM_TYPE_COUNT; stype++) {
struct tl_stream *stream = tl_stream[stype];
unsigned long flags;
@@ -1371,7 +1369,7 @@ int kbase_tlstream_init(void)
/* Initialize autoflush timer. */
atomic_set(&autoflush_timer_active, 0);
- setup_timer(&autoflush_timer,
+ timer_setup(&autoflush_timer,
kbasep_tlstream_autoflush_timer_callback,
0);
--
2.14.1

View File

@@ -0,0 +1,63 @@
From 392472dc977300a9f2a62159c105a6dfed878643 Mon Sep 17 00:00:00 2001
Message-Id: <392472dc977300a9f2a62159c105a6dfed878643.1652225232.git.stefan@agner.ch>
In-Reply-To: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
References: <ff0c5c49024da05b47d4fcc4d115761c43eef7a6.1652225232.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Tue, 10 May 2022 22:57:26 +0200
Subject: [PATCH] ARM: dts: rockchip: Add Bluetooth to rk3288-tinker
Enable Bluetooth support via UART0. Use the existing bindings
for Realtek rtl8723bs Bluetooth device.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/rk3288-tinker.dtsi | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index cdff130d1292..e904c130dedc 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -388,6 +388,20 @@ bl_en: bl-en {
};
};
+ bluetooth {
+ bt_enable_pin: bt-enable-pin {
+ rockchip,pins = <4 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+
+ bt_device_wake_pin: bt-device-wake-pin {
+ rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+
+ bt_host_wake_pin: bt-host-wake-pin {
+ rockchip,pins = <4 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
buttons {
pwrbtn: pwrbtn {
rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
@@ -520,6 +534,18 @@ &tsadc {
&uart0 {
status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
+ uart-has-rtscts;
+
+ bluetooth {
+ compatible = "realtek,rtl8723bs-bt";
+ pinctrl-names = "default";
+ pinctrl-0 = <&bt_device_wake_pin &bt_host_wake_pin &bt_enable_pin>;
+ enable-gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;
+ device-wake-gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
+ host-wake-gpios = <&gpio4 RK_PD7 GPIO_ACTIVE_HIGH>;
+ };
};
&uart1 {
--
2.36.1

View File

@@ -1,35 +0,0 @@
From 44a5ba2e969adfb64c84f294c16490194988dcc7 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Sun, 24 Dec 2017 19:30:12 +0100
Subject: [PATCH] drivers: gpu: Arm: Midgard: Replace ACCESS_ONCE by READ_ONCE
The ACCESS_ONCE macro has now been removed in the 4.15.0-rc4,
and every ACCESS_ONCE call has been replaced by either READ_ONCE or
WRITE_ONCE calls.
Since the Midgard GPU drivers are not mainlined, the change
needs to be applied manually.
See commit b899a850431e2dd0943205a63a68573f3e312d0d and its parents,
for more informations.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
drivers/gpu/arm/midgard/mali_kbase_mem.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/arm/midgard/mali_kbase_mem.h b/drivers/gpu/arm/midgard/mali_kbase_mem.h
index e9a8d5dd6..eac685699 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_mem.h
+++ b/drivers/gpu/arm/midgard/mali_kbase_mem.h
@@ -591,7 +591,7 @@ void kbase_mem_pool_free_pages(struct kbase_mem_pool *pool, size_t nr_pages,
*/
static inline size_t kbase_mem_pool_size(struct kbase_mem_pool *pool)
{
- return ACCESS_ONCE(pool->cur_size);
+ return READ_ONCE(pool->cur_size);
}
/**
--
2.14.1

View File

@@ -1,32 +0,0 @@
From 47e8aad9419ff8843a373c3e5aa2c9d261d8cd07 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Mon, 23 Apr 2018 20:54:13 +0200
Subject: [PATCH] gpu: arm: midgard: Remove sys_close references
sys_close is now replaced by ksys_close in an effort to remove
in-kernel system calls references.
See 2ca2a09d6215fd9621aa3e2db7cc9428a61f2911 and
https://lkml.org/lkml/2018/3/25/93 for more details.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
drivers/gpu/arm/midgard/mali_kbase_sync.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/arm/midgard/mali_kbase_sync.h b/drivers/gpu/arm/midgard/mali_kbase_sync.h
index de72147d..33b58059 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_sync.h
+++ b/drivers/gpu/arm/midgard/mali_kbase_sync.h
@@ -156,7 +156,7 @@ void kbase_sync_fence_out_remove(struct kbase_jd_atom *katom);
*/
static inline void kbase_sync_fence_close_fd(int fd)
{
- sys_close(fd);
+ ksys_close(fd);
}
/**
--
2.14.1

View File

@@ -1,34 +0,0 @@
From 9812105eb6220863af05fc72591118f0a48e1c4e Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Mon, 21 May 2018 22:32:59 +0200
Subject: [PATCH] GPU: ARM: Midgard: Adapt to the new mmap call checks.
Now, I don't know if this driver is just one of these "buggy" drivers
Linus is talking about, or if this is just standard GPU procedure.
Anyway, this patch is due to this change by Linus Torvalds :
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=be83bbf806822b1b89e0a0f23cd87cddc409e429
And the fix is inspired by :
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76ef6b28ea4f81c3d511866a9b31392caa833126
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
drivers/gpu/arm/midgard/mali_kbase_core_linux.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/arm/midgard/mali_kbase_core_linux.c b/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
index cc4932a4ead7..89b4cca27cf1 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
+++ b/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
@@ -1087,6 +1087,7 @@ static int kbase_open(struct inode *inode, struct file *filp)
init_waitqueue_head(&kctx->event_queue);
filp->private_data = kctx;
+ filp->f_mode |= FMODE_UNSIGNED_OFFSET;
kctx->filp = filp;
if (kbdev->infinite_cache_active_default)
--
2.17.0

View File

@@ -1,76 +0,0 @@
From 9bf91a052d8ceddfd5808547a51e167fb7463754 Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Wed, 18 Jul 2018 19:59:21 +0200
Subject: [PATCH] GPU: Mali: Midgard: remove rcu_read_lock references
This patch is actually based on @mihailescu2m patch.
This removes references to rcu_read_lock when acquiring the OPP table,
as it is useless since.
See :
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/base/power/opp/core.c?id=5b650b388844f26c61c70564865598836d05dcb3
The current rcu_read_lock actually generates some issues with recent
kernels.
See here :
https://community.arm.com/graphics/f/discussions/9207/midgard-r20p0-kernel-drivers-errors
The patch has been recreated since it does not apply directly on r19p0
sources (I guess the affected line numbers slightly differ...).
@mihailescu2m patch for the Mali Midgard r20p0 kernel driver can be
acquired here :
https://github.com/mihailescu2m/linux/commit/bbe73c3c1143e5991bdcaee3afaecf5c31af0647
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c
index e280322e..bf69d897 100644
--- a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c
+++ b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c
@@ -87,10 +87,9 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags)
freq = *target_freq;
- rcu_read_lock();
opp = devfreq_recommended_opp(dev, &freq, flags);
voltage = dev_pm_opp_get_voltage(opp);
- rcu_read_unlock();
+
if (IS_ERR_OR_NULL(opp)) {
dev_err(dev, "Failed to get opp (%ld)\n", PTR_ERR(opp));
return PTR_ERR(opp);
@@ -186,20 +185,17 @@ static int kbase_devfreq_init_freq_table(struct kbase_device *kbdev,
unsigned long freq;
struct dev_pm_opp *opp;
- rcu_read_lock();
count = dev_pm_opp_get_opp_count(kbdev->dev);
if (count < 0) {
rcu_read_unlock();
return count;
}
- rcu_read_unlock();
dp->freq_table = kmalloc_array(count, sizeof(dp->freq_table[0]),
GFP_KERNEL);
if (!dp->freq_table)
return -ENOMEM;
- rcu_read_lock();
for (i = 0, freq = ULONG_MAX; i < count; i++, freq--) {
opp = dev_pm_opp_find_freq_floor(kbdev->dev, &freq);
if (IS_ERR(opp))
@@ -207,7 +203,6 @@ static int kbase_devfreq_init_freq_table(struct kbase_device *kbdev,
dp->freq_table[i] = freq;
}
- rcu_read_unlock();
if (count != i)
dev_warn(kbdev->dev, "Unable to enumerate all OPPs (%d!=%d\n",
--
2.16.4

View File

@@ -1,74 +0,0 @@
Patches act8846 regulator providing the proper reset handle and exploit
the SIPC bit in GLB_POWER_OFF register. Mainly used to reset some rockchip
boards.
Origin: <https://patchwork.kernel.org/patch/6409521/>
diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index 2ff73d7..836d10b 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -27,6 +27,7 @@
#include <linux/of_device.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regmap.h>
+#include <linux/reboot.h>
/*
* ACT8600 Global Register Map.
@@ -133,6 +134,8 @@
#define ACT8865_VOLTAGE_NUM 64
#define ACT8600_SUDCDC_VOLTAGE_NUM 255
+#define ACT8846_SIPC_MASK 0x01
+
struct act8865 {
struct regmap *regmap;
int off_reg;
@@ -402,6 +405,22 @@ static void act8865_power_off(void)
while (1);
}
+static int act8846_power_cycle(struct notifier_block *this,
+ unsigned long code, void *unused)
+{
+ struct act8865 *act8846;
+
+ act8846 = i2c_get_clientdata(act8865_i2c_client);
+ regmap_write(act8846->regmap, ACT8846_GLB_OFF_CTRL, ACT8846_SIPC_MASK);
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block act8846_restart_handler = {
+ .notifier_call = act8846_power_cycle,
+ .priority = 129,
+};
+
static int act8865_pmic_probe(struct i2c_client *client,
const struct i2c_device_id *i2c_id)
{
@@ -484,6 +503,8 @@ static int act8865_pmic_probe(struct i2c_client *client,
}
if (of_device_is_system_power_controller(dev->of_node)) {
+ int ret;
+
if (!pm_power_off && (off_reg > 0)) {
act8865_i2c_client = client;
act8865->off_reg = off_reg;
@@ -492,6 +513,14 @@ static int act8865_pmic_probe(struct i2c_client *client,
} else {
dev_err(dev, "Failed to set poweroff capability, already defined\n");
}
+
+ if (type == ACT8846) {
+ act8865_i2c_client = client;
+ ret = register_restart_handler(&act8846_restart_handler);
+ if (ret)
+ pr_err("%s: cannot register restart handler, %d\n",
+ __func__, ret);
+ }
}
/* Finally register devices */

View File

@@ -1,39 +0,0 @@
From fe85565d9ed8212cbda2148d4731418a36a8d088 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Mon, 11 Dec 2017 21:53:28 +0100
Subject: [PATCH 1/3] drivers: Integrating Mali Midgard video and gpu drivers.
I'm dropping the UMP drivers. They are not maintained.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
drivers/gpu/Makefile | 2 +-
drivers/video/Kconfig | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile
index e9ed439a5..66386b42a 100644
--- a/drivers/gpu/Makefile
+++ b/drivers/gpu/Makefile
@@ -2,5 +2,5 @@
# taken to initialize them in the correct order. Link order is the only way
# to ensure this currently.
obj-$(CONFIG_TEGRA_HOST1X) += host1x/
-obj-y += drm/ vga/
+obj-y += drm/ vga/ arm/
obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3c20af999..041e15f2c 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -17,6 +17,7 @@ source "drivers/gpu/vga/Kconfig"
source "drivers/gpu/host1x/Kconfig"
source "drivers/gpu/ipu-v3/Kconfig"
+source "drivers/gpu/arm/midgard/Kconfig"
source "drivers/gpu/drm/Kconfig"
--
2.14.1

View File

@@ -1,50 +0,0 @@
From e0c5a419cf5464cd02996431afa98e3b22dc6801 Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Mon, 17 Jul 2017 23:14:48 +0000
Subject: [PATCH] clk: rockchip: add all known operating points to the allowed
CPU freqs
Patch from Willy Tarreau
Original commit message :
At least 1920 MHz runs stable on the MiQi even on openssl speed -multi 4,
which is by far the most intensive workload, and 1992/2016 work fine on
the CS-008 until it starts to heat too much. So add all of them so that
the device tree can simply manipulate them.
Signed-off-by: Myy <myy@miouyouyou.fr>
---
drivers/clk/rockchip/clk-rk3288.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
index 753c649..fd2058f 100644
--- a/drivers/clk/rockchip/clk-rk3288.c
+++ b/drivers/clk/rockchip/clk-rk3288.c
@@ -145,6 +145,23 @@ static struct rockchip_pll_rate_table rk3288_pll_rates[] = {
}
static struct rockchip_cpuclk_rate_table rk3288_cpuclk_rates[] __initdata = {
+ RK3288_CPUCLK_RATE(2208000000U, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(2184000000U, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(2160000000U, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(2136000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(2112000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(2088000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(2064000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(2040000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(2016000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(1992000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(1968000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(1944000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(1920000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(1896000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(1872000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(1848000000, 1, 3, 1, 3, 3),
+ RK3288_CPUCLK_RATE(1824000000, 1, 3, 1, 3, 3),
RK3288_CPUCLK_RATE(1800000000, 1, 3, 1, 3, 3),
RK3288_CPUCLK_RATE(1704000000, 1, 3, 1, 3, 3),
RK3288_CPUCLK_RATE(1608000000, 1, 3, 1, 3, 3),
--
2.10.2

View File

@@ -1,30 +0,0 @@
From 239a5e3016b7f676bc3f56ea509ed172bf954001 Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Sat, 22 Jul 2017 04:07:36 +0000
Subject: [PATCH] Remove the dependency to the clk_mali symbol.
Inspired by @wzzy2 patch
https://github.com/rockchip-linux/rockchip_forwardports/commit/359865c617129fe5fcc5530f4a88abcfaa6a5cb4
Signed-off-by: Myy <myy@miouyouyou.fr>
---
drivers/gpu/arm/midgard/mali_kbase_core_linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/arm/midgard/mali_kbase_core_linux.c b/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
index 9cc65d2..27dcd9c 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
+++ b/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
@@ -3793,7 +3793,7 @@ static int power_control_init(struct platform_device *pdev)
}
#endif /* LINUX_VERSION_CODE >= 3, 12, 0 */
- kbdev->clock = clk_get(kbdev->dev, "clk_mali");
+ kbdev->clock = of_clk_get(kbdev->dev->of_node, 0);
if (IS_ERR_OR_NULL(kbdev->clock)) {
err = PTR_ERR(kbdev->clock);
kbdev->clock = NULL;
--
2.10.2

View File

@@ -1,157 +0,0 @@
From bf9b932f6ae506baf5b79c8407089448ed77fc56 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Sun, 17 Dec 2017 16:15:03 +0100
Subject: [PATCH] ASUS Tinkerboard: Stupid reboot patch
This patch is ugly as shit and will be reworked when possible.
Meanwhile, this fixes an issue with the ASUS Tinkerboard which
cannot reboot correctly. The issue is that the MMC hardware is
shutdown during the reboot phase and is not powered again after
the power cycle, leading to a dead board awaiting a hard power
cycle.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
drivers/mmc/host/dw_mmc-rockchip.c | 24 ++++++++++++++++++++++++
drivers/mmc/host/dw_mmc.c | 28 ++++++++++++++++++++++++++++
include/linux/reboot.h | 2 ++
kernel/reboot.c | 1 +
4 files changed, 55 insertions(+)
diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
index a3f1c2b30..52c13733f 100644
--- a/drivers/mmc/host/dw_mmc-rockchip.c
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
@@ -14,10 +14,12 @@
#include <linux/of_address.h>
#include <linux/mmc/slot-gpio.h>
#include <linux/pm_runtime.h>
+#include <linux/regulator/consumer.h> // Stupid Tinkerboard Hack
#include <linux/slab.h>
#include "dw_mmc.h"
#include "dw_mmc-pltfm.h"
+#include "../core/core.h" // Stupid Tinkerboard Hack
#define RK3288_CLKGEN_DIV 2
@@ -365,6 +367,27 @@ static int dw_mci_rockchip_probe(struct platform_device *pdev)
return 0;
}
+/* Stupid Tinkerboard Hack */
+static void dw_mci_rockchip_platfm_shutdown(struct platform_device *pdev)
+{
+ struct dw_mci *host = platform_get_drvdata(pdev);
+ struct mmc_host *mmc = host->slot->mmc;
+ int ret;
+
+ if(of_machine_is_compatible("asus,rk3288-tinker")){
+
+ mmc_power_off(mmc);
+
+ mdelay(20);
+
+ if (!IS_ERR(mmc->supply.vmmc))
+ ret = regulator_enable(mmc->supply.vmmc);
+
+ if (!IS_ERR(mmc->supply.vqmmc))
+ regulator_set_voltage(mmc->supply.vqmmc, 3000000, 3300000);
+ }
+}
+
static int dw_mci_rockchip_remove(struct platform_device *pdev)
{
pm_runtime_get_sync(&pdev->dev);
@@ -385,6 +408,7 @@ static const struct dev_pm_ops dw_mci_rockchip_dev_pm_ops = {
static struct platform_driver dw_mci_rockchip_pltfm_driver = {
.probe = dw_mci_rockchip_probe,
.remove = dw_mci_rockchip_remove,
+ .shutdown = dw_mci_rockchip_platfm_shutdown, // Stupid Tinkerboard Hack
.driver = {
.name = "dwmmc_rockchip",
.of_match_table = dw_mci_rockchip_match,
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 0aa39975f..70f7ce21b 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -39,8 +39,10 @@
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/mmc/slot-gpio.h>
+#include <linux/reboot.h> // Stupid Tinkerboard Hack
#include "dw_mmc.h"
+#include "../core/core.h" // Stupid Tinkerboard Hack
/* Common flag combinations */
#define DW_MCI_DATA_ERROR_FLAGS (SDMMC_INT_DRTO | SDMMC_INT_DCRC | \
@@ -2778,6 +2780,29 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
+/* Stupid Tinkerboard Hack */
+struct dw_mci *mSdhost;
+void setmmcEmergency() {
+ struct mmc_host *mmc;
+ int ret;
+
+ printk(KERN_ERR "Emergency route taken.\n");
+ if (of_machine_is_compatible("asus,rk3288-tinker")) {
+ mmc = mSdhost->slot->mmc;
+
+ mmc_power_off(mmc);
+
+ mdelay(20);
+
+ if (!IS_ERR(mmc->supply.vmmc))
+ ret = regulator_enable(mmc->supply.vmmc);
+
+ if (!IS_ERR(mmc->supply.vqmmc))
+ regulator_set_voltage(mmc->supply.vqmmc, 3000000, 3300000);
+ }
+}
+EXPORT_SYMBOL(setmmcEmergency);
+
static int dw_mci_init_slot(struct dw_mci *host)
{
struct mmc_host *mmc;
@@ -2809,6 +2834,9 @@ static int dw_mci_init_slot(struct dw_mci *host)
mmc->f_max = freq[1];
}
+ /* Stupid Tinkerboard Hack */
+ if (of_find_property(host->dev->of_node, "supports-sd", NULL))
+ mSdhost = host;
/*if there are external regulators, get them*/
ret = mmc_regulator_get_supply(mmc);
if (ret)
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index e63799a6e..057d3ce0c 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -77,6 +77,8 @@ extern char poweroff_cmd[POWEROFF_CMD_PATH_LEN];
extern void orderly_poweroff(bool force);
extern void orderly_reboot(void);
+/* Stupid Tinkerboard Hack */
+extern void setmmcEmergency(void);
/*
* Emergency restart, callable from an interrupt handler.
diff --git a/kernel/reboot.c b/kernel/reboot.c
index e4ced883d..c8e678ce6 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -61,6 +61,7 @@ void (*pm_power_off_prepare)(void);
void emergency_restart(void)
{
kmsg_dump(KMSG_DUMP_EMERG);
+ setmmcEmergency(); // Stupid Tinkerboard Hack
machine_emergency_restart();
}
EXPORT_SYMBOL_GPL(emergency_restart);
--
2.14.1

View File

@@ -1,116 +0,0 @@
From 302cd9b8a9f1f8a7735fabea3b9a7645dc40f9cc Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Sun, 7 Jan 2018 01:52:44 +0100
Subject: [PATCH] drivers: mmc: dw-mci-rockchip: Handle ASUS Tinkerboard reboot
On ASUS Tinkerboard systems, if the SDMMC hardware is shutdown before
rebooting, the system will be dead, as the SDMMC is the only way to
boot anything, and the hardware doesn't power up the SDMMC hardware
automatically when rebooting.
So, when using an ASUS Tinkerboard system, a new reboot handler is
installed. This reboot handler takes care of powering the SDMMC
hardware again before restarting the system, resolving the issue.
The code was inspired by the pwrseq_emmc.c, which seems to overcome
similar effects with eMMC hardware.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
drivers/mmc/host/dw_mmc-rockchip.c | 66 ++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
index a3f1c2b30..7eac1f221 100644
--- a/drivers/mmc/host/dw_mmc-rockchip.c
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
@@ -16,6 +16,11 @@
#include <linux/pm_runtime.h>
#include <linux/slab.h>
+#include <linux/regulator/consumer.h>
+#include <linux/reboot.h>
+#include <linux/delay.h>
+#include "../core/core.h"
+
#include "dw_mmc.h"
#include "dw_mmc-pltfm.h"
@@ -334,6 +339,66 @@ static const struct of_device_id dw_mci_rockchip_match[] = {
};
MODULE_DEVICE_TABLE(of, dw_mci_rockchip_match);
+struct dw_mci_rockchip_broken_boards_data {
+ struct notifier_block reset_nb;
+ struct platform_device *pdev;
+};
+
+/* This reboot handler handles cases where disabling the SDMMC on
+ * reboot will cause the hardware to be unable to start correctly
+ * after rebooting.
+ *
+ * This happens with Tinkerboard systems...
+ */
+static int dw_mci_rockchip_broken_boards_reset_nb(
+ struct notifier_block *this,
+ unsigned long mode, void *cmd)
+{
+ struct dw_mci_rockchip_broken_boards_data const *data =
+ container_of(this,
+ struct dw_mci_rockchip_broken_boards_data,
+ reset_nb);
+ struct dw_mci *host = platform_get_drvdata(data->pdev);
+ struct mmc_host *mmc = host->slot->mmc;
+
+ printk(KERN_ERR "Meow.\n");
+
+ mmc_power_off(mmc);
+
+ mdelay(20);
+
+ if (!IS_ERR(mmc->supply.vmmc))
+ regulator_enable(mmc->supply.vmmc);
+
+ if (!IS_ERR(mmc->supply.vqmmc))
+ regulator_set_voltage(mmc->supply.vqmmc, 3000000, 3300000);
+
+ printk(KERN_ERR "woeM.\n");
+
+ return NOTIFY_DONE;
+}
+
+static void dw_mci_rockchip_register_broken_boards_reboot_handler(
+ struct platform_device *pdev)
+{
+ struct dw_mci_rockchip_broken_boards_data *data;
+
+ if (!of_machine_is_compatible("asus,rk3288-tinker"))
+ return;
+
+ data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+
+ if (!data)
+ return;
+
+ data->reset_nb.notifier_call =
+ dw_mci_rockchip_broken_boards_reset_nb;
+ data->reset_nb.priority = 255;
+ register_restart_handler(&data->reset_nb);
+
+ data->pdev = pdev;
+}
+
static int dw_mci_rockchip_probe(struct platform_device *pdev)
{
const struct dw_mci_drv_data *drv_data;
@@ -361,6 +426,7 @@ static int dw_mci_rockchip_probe(struct platform_device *pdev)
}
pm_runtime_put_autosuspend(&pdev->dev);
+ dw_mci_rockchip_register_broken_boards_reboot_handler(pdev);
return 0;
}
--
2.14.1

View File

@@ -1,82 +0,0 @@
From 4ffe79de7272234408a9179aa4c403ee1b67a362 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 7 Dec 2017 21:27:52 +0100
Subject: [PATCH] soc: rockchip: power-domain: export idle request
We need to put the power status of HEVC/RKVDEC IP into IDLE
unless we can't reset that IP or the SoC would crash down.
rockchip_pmu_idle_request(dev, true)---> enter idle
rockchip_pmu_idle_request(dev, false)---> exit idle
Only the video codec drivers of rockchip platform would
request this patch currently.
I am not sure whether it is necessary to add a new function
at generic power domain. I want someone give me some advises
here.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
drivers/soc/rockchip/pm_domains.c | 23 +++++++++++++++++++++++
include/linux/rockchip_pmu.h | 15 +++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 include/linux/rockchip_pmu.h
diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
index 40b75748..0006ed53 100644
--- a/drivers/soc/rockchip/pm_domains.c
+++ b/drivers/soc/rockchip/pm_domains.c
@@ -180,6 +180,29 @@ static int rockchip_pmu_set_idle_request(struct rockchip_pm_domain *pd,
return 0;
}
+int rockchip_pmu_idle_request(struct device *dev, bool idle)
+{
+ struct generic_pm_domain *genpd;
+ struct rockchip_pm_domain *pd;
+ int ret;
+
+ if (IS_ERR_OR_NULL(dev))
+ return -EINVAL;
+
+ if (IS_ERR_OR_NULL(dev->pm_domain))
+ return -EINVAL;
+
+ genpd = pd_to_genpd(dev->pm_domain);
+ pd = to_rockchip_pd(genpd);
+
+ mutex_lock(&pd->pmu->mutex);
+ ret = rockchip_pmu_set_idle_request(pd, idle);
+ mutex_unlock(&pd->pmu->mutex);
+
+ return ret;
+}
+EXPORT_SYMBOL(rockchip_pmu_idle_request);
+
static int rockchip_pmu_save_qos(struct rockchip_pm_domain *pd)
{
int i;
diff --git a/include/linux/rockchip_pmu.h b/include/linux/rockchip_pmu.h
new file mode 100644
index 00000000..720b3314
--- /dev/null
+++ b/include/linux/rockchip_pmu.h
@@ -0,0 +1,15 @@
+/*
+ * pm_domain.h - Definitions and headers related to device power domains.
+ *
+ * Copyright (C) 2017 Randy Li <ayaka@soulik.info>.
+ *
+ * This file is released under the GPLv2.
+ */
+
+#ifndef _LINUX_ROCKCHIP_PM_H
+#define _LINUX_ROCKCHIP_PM_H
+#include <linux/device.h>
+
+int rockchip_pmu_idle_request(struct device *dev, bool idle);
+
+#endif /* _LINUX_ROCKCHIP_PM_H */
--
2.14.1

View File

@@ -1,228 +0,0 @@
From bc16cd0aa3cdaaff27b9bf2d3282ccfff81d8784 Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Sat, 29 Sep 2018 02:56:32 +0200
Subject: [PATCH 5/6] drivers: clk-rk3288: support for dedicating NPLL to a VOP
This patch is taken from Urja Rannikko ( @urjaman ) patchset here :
https://github.com/urjaman/arch-c201/blob/master/linux-c201/0020-RK3288-HDMI-clock-hacks-combined.patch
https://www.spinics.net/lists/arm-kernel/msg673156.html
I'm not really sure what this does exactly. It basically sets the
parent clock of the newly added clocks, if the newly added property
"rockchip,npll-for-vop" is detected and set.
I have no clear idea how HDMI Neuronal PLL (and PLL in general) work,
so I cannot comment on what it's doing and if it's a good idea in
general.
The only thing I know from this patchset is that it works and have
resolved some purple line issue at the left of my HDMI screen, when
connected to MiQi or Tinkerboard devices.
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
drivers/clk/rockchip/clk-rk3288.c | 98 ++++++++++++++++++++++++++++++++-------
drivers/clk/rockchip/clk.h | 3 ++
2 files changed, 85 insertions(+), 16 deletions(-)
diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
index fd2058f7d..b5b56169d 100644
--- a/drivers/clk/rockchip/clk-rk3288.c
+++ b/drivers/clk/rockchip/clk-rk3288.c
@@ -83,22 +83,43 @@ static struct rockchip_pll_rate_table rk3288_pll_rates[] = {
RK3066_PLL_RATE( 768000000, 1, 64, 2),
RK3066_PLL_RATE( 742500000, 8, 495, 2),
RK3066_PLL_RATE( 696000000, 1, 58, 2),
+ RK3066_PLL_RATE_NB(621000000, 1, 207, 8, 1),
RK3066_PLL_RATE( 600000000, 1, 50, 2),
RK3066_PLL_RATE_NB(594000000, 1, 198, 8, 1),
RK3066_PLL_RATE( 552000000, 1, 46, 2),
RK3066_PLL_RATE( 504000000, 1, 84, 4),
RK3066_PLL_RATE( 500000000, 3, 125, 2),
RK3066_PLL_RATE( 456000000, 1, 76, 4),
+ RK3066_PLL_RATE( 428000000, 1, 107, 6),
RK3066_PLL_RATE( 408000000, 1, 68, 4),
RK3066_PLL_RATE( 400000000, 3, 100, 2),
+ RK3066_PLL_RATE_NB( 394000000, 1, 197, 12, 1),
RK3066_PLL_RATE( 384000000, 2, 128, 4),
RK3066_PLL_RATE( 360000000, 1, 60, 4),
+ RK3066_PLL_RATE_NB( 356000000, 1, 178, 12, 1),
+ RK3066_PLL_RATE_NB( 324000000, 1, 189, 14, 1),
RK3066_PLL_RATE( 312000000, 1, 52, 4),
- RK3066_PLL_RATE( 300000000, 1, 50, 4),
- RK3066_PLL_RATE( 297000000, 2, 198, 8),
+ RK3066_PLL_RATE_NB( 308000000, 1, 154, 12, 1),
+ RK3066_PLL_RATE_NB( 303000000, 1, 202, 16, 1),
+ RK3066_PLL_RATE( 300000000, 1, 75, 6),
+ RK3066_PLL_RATE_NB( 297750000, 2, 397, 16, 1),
+ RK3066_PLL_RATE_NB( 293250000, 2, 391, 16, 1),
+ RK3066_PLL_RATE_NB( 292500000, 1, 195, 16, 1),
+ RK3066_PLL_RATE( 273600000, 1, 114, 10),
+ RK3066_PLL_RATE_NB( 273000000, 1, 182, 16, 1),
+ RK3066_PLL_RATE_NB( 270000000, 1, 180, 16, 1),
+ RK3066_PLL_RATE_NB( 266250000, 2, 355, 16, 1),
+ RK3066_PLL_RATE_NB( 256500000, 1, 171, 16, 1),
RK3066_PLL_RATE( 252000000, 1, 84, 8),
- RK3066_PLL_RATE( 216000000, 1, 72, 8),
- RK3066_PLL_RATE( 148500000, 2, 99, 8),
+ RK3066_PLL_RATE_NB( 250500000, 1, 167, 16, 1),
+ RK3066_PLL_RATE_NB( 243428571, 1, 142, 14, 1),
+ RK3066_PLL_RATE( 238000000, 1, 119, 12),
+ RK3066_PLL_RATE_NB( 219750000, 2, 293, 16, 1),
+ RK3066_PLL_RATE_NB( 216000000, 1, 144, 16, 1),
+ RK3066_PLL_RATE_NB( 213000000, 1, 142, 16, 1),
+ RK3066_PLL_RATE( 195428571, 1, 114, 14),
+ RK3066_PLL_RATE( 160000000, 1, 80, 12),
+ RK3066_PLL_RATE( 157500000, 1, 105, 16),
RK3066_PLL_RATE( 126000000, 1, 84, 16),
RK3066_PLL_RATE( 48000000, 1, 64, 32),
{ /* sentinel */ },
@@ -194,10 +215,14 @@ PNAME(mux_ddrphy_p) = { "dpll_ddr", "gpll_ddr" };
PNAME(mux_aclk_cpu_src_p) = { "cpll_aclk_cpu", "gpll_aclk_cpu" };
PNAME(mux_pll_src_cpll_gpll_p) = { "cpll", "gpll" };
-PNAME(mux_pll_src_npll_cpll_gpll_p) = { "npll", "cpll", "gpll" };
-PNAME(mux_pll_src_cpll_gpll_npll_p) = { "cpll", "gpll", "npll" };
+PNAME_ED(mux_pll_src_npll_cpll_gpll_p) = { "npll", "cpll", "gpll" };
+
+PNAME_ED(mux_pll_src_cgn_pll_nonvop_p) = { "cpll", "gpll", "npll" };
+PNAME_ED(mux_pll_src_cgn_pll_vop0_p) = { "cpll", "gpll", "npll" };
+PNAME_ED(mux_pll_src_cgn_pll_vop1_p) = { "cpll", "gpll", "npll" };
+
PNAME(mux_pll_src_cpll_gpll_usb480m_p) = { "cpll", "gpll", "usbphy480m_src" };
-PNAME(mux_pll_src_cpll_gll_usb_npll_p) = { "cpll", "gpll", "usbphy480m_src", "npll" };
+PNAME_ED(mux_pll_src_cpll_gll_usb_npll_p) = { "cpll", "gpll", "usbphy480m_src", "npll" };
PNAME(mux_mmc_src_p) = { "cpll", "gpll", "xin24m", "xin24m" };
PNAME(mux_i2s_pre_p) = { "i2s_src", "i2s_frac", "ext_i2s", "xin12m" };
@@ -443,24 +468,24 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
RK3288_CLKSEL_CON(30), 14, 2, MFLAGS, 8, 5, DFLAGS,
RK3288_CLKGATE_CON(3), 4, GFLAGS),
- COMPOSITE(DCLK_VOP0, "dclk_vop0", mux_pll_src_cpll_gpll_npll_p, 0,
+ COMPOSITE(DCLK_VOP0, "dclk_vop0", mux_pll_src_cgn_pll_vop0_p, 0,
RK3288_CLKSEL_CON(27), 0, 2, MFLAGS, 8, 8, DFLAGS,
RK3288_CLKGATE_CON(3), 1, GFLAGS),
- COMPOSITE(DCLK_VOP1, "dclk_vop1", mux_pll_src_cpll_gpll_npll_p, 0,
+ COMPOSITE(DCLK_VOP1, "dclk_vop1", mux_pll_src_cgn_pll_vop1_p, 0,
RK3288_CLKSEL_CON(29), 6, 2, MFLAGS, 8, 8, DFLAGS,
RK3288_CLKGATE_CON(3), 3, GFLAGS),
COMPOSITE_NODIV(SCLK_EDP_24M, "sclk_edp_24m", mux_edp_24m_p, 0,
RK3288_CLKSEL_CON(28), 15, 1, MFLAGS,
RK3288_CLKGATE_CON(3), 12, GFLAGS),
- COMPOSITE(SCLK_EDP, "sclk_edp", mux_pll_src_cpll_gpll_npll_p, 0,
+ COMPOSITE(SCLK_EDP, "sclk_edp", mux_pll_src_cgn_pll_nonvop_p, 0,
RK3288_CLKSEL_CON(28), 6, 2, MFLAGS, 0, 6, DFLAGS,
RK3288_CLKGATE_CON(3), 13, GFLAGS),
- COMPOSITE(SCLK_ISP, "sclk_isp", mux_pll_src_cpll_gpll_npll_p, 0,
+ COMPOSITE(SCLK_ISP, "sclk_isp", mux_pll_src_cgn_pll_nonvop_p, 0,
RK3288_CLKSEL_CON(6), 6, 2, MFLAGS, 0, 6, DFLAGS,
RK3288_CLKGATE_CON(3), 14, GFLAGS),
- COMPOSITE(SCLK_ISP_JPE, "sclk_isp_jpe", mux_pll_src_cpll_gpll_npll_p, 0,
+ COMPOSITE(SCLK_ISP_JPE, "sclk_isp_jpe", mux_pll_src_cgn_pll_nonvop_p, 0,
RK3288_CLKSEL_CON(6), 14, 2, MFLAGS, 8, 6, DFLAGS,
RK3288_CLKGATE_CON(3), 15, GFLAGS),
@@ -469,16 +494,16 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
GATE(SCLK_HDMI_CEC, "sclk_hdmi_cec", "xin32k", 0,
RK3288_CLKGATE_CON(5), 11, GFLAGS),
- COMPOSITE(ACLK_HEVC, "aclk_hevc", mux_pll_src_cpll_gpll_npll_p, 0,
+ COMPOSITE(ACLK_HEVC, "aclk_hevc", mux_pll_src_cgn_pll_nonvop_p, 0,
RK3288_CLKSEL_CON(39), 14, 2, MFLAGS, 8, 5, DFLAGS,
RK3288_CLKGATE_CON(13), 13, GFLAGS),
DIV(HCLK_HEVC, "hclk_hevc", "aclk_hevc", 0,
RK3288_CLKSEL_CON(40), 12, 2, DFLAGS),
- COMPOSITE(SCLK_HEVC_CABAC, "sclk_hevc_cabac", mux_pll_src_cpll_gpll_npll_p, 0,
+ COMPOSITE(SCLK_HEVC_CABAC, "sclk_hevc_cabac", mux_pll_src_cgn_pll_nonvop_p, 0,
RK3288_CLKSEL_CON(42), 6, 2, MFLAGS, 0, 5, DFLAGS,
RK3288_CLKGATE_CON(13), 14, GFLAGS),
- COMPOSITE(SCLK_HEVC_CORE, "sclk_hevc_core", mux_pll_src_cpll_gpll_npll_p, 0,
+ COMPOSITE(SCLK_HEVC_CORE, "sclk_hevc_core", mux_pll_src_cgn_pll_nonvop_p, 0,
RK3288_CLKSEL_CON(42), 14, 2, MFLAGS, 8, 5, DFLAGS,
RK3288_CLKGATE_CON(13), 15, GFLAGS),
@@ -552,7 +577,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
COMPOSITE(0, "sclk_tspout", mux_tspout_p, 0,
RK3288_CLKSEL_CON(35), 14, 2, MFLAGS, 8, 5, DFLAGS,
RK3288_CLKGATE_CON(4), 11, GFLAGS),
- COMPOSITE(0, "sclk_tsp", mux_pll_src_cpll_gpll_npll_p, 0,
+ COMPOSITE(0, "sclk_tsp", mux_pll_src_cgn_pll_nonvop_p, 0,
RK3288_CLKSEL_CON(35), 6, 2, MFLAGS, 0, 5, DFLAGS,
RK3288_CLKGATE_CON(4), 10, GFLAGS),
@@ -912,6 +937,7 @@ static void __init rk3288_clk_init(struct device_node *np)
{
struct rockchip_clk_provider *ctx;
struct clk *clk;
+ s32 npll_vop = -1;
rk3288_cru_base = of_iomap(np, 0);
if (!rk3288_cru_base) {
@@ -919,6 +945,46 @@ static void __init rk3288_clk_init(struct device_node *np)
return;
}
+ if (!of_property_read_s32(np, "rockchip,npll-for-vop", &npll_vop)) {
+ if ((npll_vop < -1) || (npll_vop > 1)) {
+ pr_warn("%s: invalid VOP to dedicate NPLL to: %d\n",
+ __func__, npll_vop);
+ } else if (npll_vop >= 0) {
+ unsigned int vop_clk_id;
+ const char ** npll_names;
+ const char ** non_npll_names;
+ int i;
+
+ /* Firstly, not-VOP needs to not use npll */
+ mux_pll_src_npll_cpll_gpll_p[0] = "dummy_npll";
+ mux_pll_src_cgn_pll_nonvop_p[2] = "dummy_npll";
+ mux_pll_src_cpll_gll_usb_npll_p[3] = "dummy_npll";
+
+ /* Then the npll VOP needs to only use npll, and the other one not use npll. */
+ if (npll_vop) {
+ vop_clk_id = DCLK_VOP1;
+ npll_names = mux_pll_src_cgn_pll_vop1_p;
+ non_npll_names = mux_pll_src_cgn_pll_vop0_p;
+ } else {
+ vop_clk_id = DCLK_VOP0;
+ npll_names = mux_pll_src_cgn_pll_vop0_p;
+ non_npll_names = mux_pll_src_cgn_pll_vop1_p;
+ }
+ npll_names[0] = "dummy_cpll";
+ npll_names[1] = "dummy_gpll";
+ non_npll_names[2] = "dummy_npll";
+
+ /* Lastly the npll-dedicated-VOP needs to be able to control npll. */
+ for (i = 0; i < ARRAY_SIZE(rk3288_clk_branches); i++) {
+ if (rk3288_clk_branches[i].id == vop_clk_id) {
+ rk3288_clk_branches[i].flags |= CLK_SET_RATE_PARENT;
+ break;
+ }
+ }
+ pr_debug("%s: npll dedicated for VOP %d\n", __func__, npll_vop);
+ }
+ }
+
ctx = rockchip_clk_init(np, rk3288_cru_base, CLK_NR_CLKS);
if (IS_ERR(ctx)) {
pr_err("%s: rockchip clk init failed\n", __func__);
diff --git a/drivers/clk/rockchip/clk.h b/drivers/clk/rockchip/clk.h
index 6b53fff4c..dbda9d281 100644
--- a/drivers/clk/rockchip/clk.h
+++ b/drivers/clk/rockchip/clk.h
@@ -382,6 +382,9 @@ struct clk *rockchip_clk_register_muxgrf(const char *name,
#define PNAME(x) static const char *const x[] __initconst
+/* For when you want to be able to modify the pointers. */
+#define PNAME_ED(x) static const char * x[] __initdata
+
enum rockchip_clk_branch_type {
branch_composite,
branch_mux,
--
2.16.4

View File

@@ -1,424 +0,0 @@
From 6c86916e81fa18394d9b57b4af44f9948e100e96 Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Sat, 29 Sep 2018 03:02:10 +0200
Subject: [PATCH 6/6] drm: dw_hdmi-rockchip: better clock selection logic and
dts-based rate list
This patch is taken from Urja Rannikko ( @urjaman ) patchset here :
https://github.com/urjaman/arch-c201/blob/master/linux-c201/0020-RK3288-HDMI-clock-hacks-combined.patch
https://www.spinics.net/lists/arm-kernel/msg673156.html
The original description was :
This contains traces of the following commits from the ChromeOS 3.14
tree, which improve RF/EMI performance and detach the clock selection
logic from the HDMI PHY configurations, plus support for configuring
the allowed clock rates via device tree as they are dependent on
PLL configuration and maybe even the PCB layout and other hardware things,
eg. interference to wifi or such (EMI).
Rates that were allowed previous to this patch are added as the fallback
list if no dts configuration exists.
CHROMIUM: drm: rockchip/dw_hdmi-rockchip: Adjust rockchip_mpll_cfg for 146.25
CHROMIUM: drm: rockchip/dw_hdmi-rockchip: expand the informal mpll config
CHROMIUM: drm: rockchip/dw_hdmi-rockchip: add slop to more tables
CHROMIUM: drm: rockchip/dw_hdmi-rockchip: redo rockchip hdmi to allow slop
CHROMIUM: drm: rockchip/dw_hdmi-rockchip: Use auto-generated tables
CHROMIUM: drm: rockchip/dw_hdmi-rockchip: Fixup the clock to be what we expect
CHROMIUM: drm/rockchip: hdmi: adjust cklvl & txlvl for RF/EMI
CHROMIUM: drm: rockchip/dw_hdmi-rockchip: Set cur_ctr to 0 always
CHROMIUM: drm: rockchip/dw_hdmi-rockchip: Decrease slop
https://www.spinics.net/lists/arm-kernel/msg673163.html
This is the patch that takes into account the new property
"rockchip,hdmi-rates-hz" that allows the definition of the HDMI
frequencies in the DTS file.
This also change a lot of HDMI frequencies definition, so that
*will* require some extensive testing.
Still, if it works fine, this should make tinkering the HDMI
frequencies easier, in case you have a very special HDMI screen.
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 269 ++++++++++++++++++----------
1 file changed, 175 insertions(+), 94 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 11309a2a4..740b0aeea 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -49,122 +49,141 @@ struct rockchip_hdmi {
struct clk *vpll_clk;
struct clk *grf_clk;
struct dw_hdmi *hdmi;
+ u32* rates;
+ u32 rates_cnt;
};
+#define CLK_SLOP(clk) ((clk) / 1000)
+#define CLK_PLUS_SLOP(clk) ((clk) + CLK_SLOP(clk))
+
#define to_rockchip_hdmi(x) container_of(x, struct rockchip_hdmi, x)
+/* These were the rates allowed by the driver before rates list in device tree,
+ * so keep them around as a fallback */
+static const u32 dw_hdmi_fallback_rates[] = {
+ 27000000,
+ 36000000,
+ 40000000,
+ 54000000,
+ 65000000,
+ 66000000,
+ 74250000,
+ 83500000,
+ 106500000,
+ 108000000,
+ 146250000,
+ 148500000
+};
+
static const struct dw_hdmi_mpll_config rockchip_mpll_cfg[] = {
{
- 27000000, {
- { 0x00b3, 0x0000},
- { 0x2153, 0x0000},
- { 0x40f3, 0x0000}
+ 30666000, {
+ { 0x00b3, 0x0000 },
+ { 0x2153, 0x0000 },
+ { 0x40f3, 0x0000 },
+ },
+ }, {
+ 36800000, {
+ { 0x00b3, 0x0000 },
+ { 0x2153, 0x0000 },
+ { 0x40a2, 0x0001 },
},
- }, {
- 36000000, {
- { 0x00b3, 0x0000},
- { 0x2153, 0x0000},
- { 0x40f3, 0x0000}
+ }, {
+ 46000000, {
+ { 0x00b3, 0x0000 },
+ { 0x2142, 0x0001 },
+ { 0x40a2, 0x0001 },
},
- }, {
- 40000000, {
- { 0x00b3, 0x0000},
- { 0x2153, 0x0000},
- { 0x40f3, 0x0000}
+ }, {
+ 61333000, {
+ { 0x0072, 0x0001 },
+ { 0x2142, 0x0001 },
+ { 0x40a2, 0x0001 },
},
- }, {
- 54000000, {
- { 0x0072, 0x0001},
- { 0x2142, 0x0001},
- { 0x40a2, 0x0001},
+ }, {
+ 73600000, {
+ { 0x0072, 0x0001 },
+ { 0x2142, 0x0001 },
+ { 0x4061, 0x0002 },
},
- }, {
- 65000000, {
- { 0x0072, 0x0001},
- { 0x2142, 0x0001},
- { 0x40a2, 0x0001},
+ }, {
+ 92000000, {
+ { 0x0072, 0x0001 },
+ { 0x2145, 0x0002 },
+ { 0x4061, 0x0002 },
},
- }, {
- 66000000, {
- { 0x013e, 0x0003},
- { 0x217e, 0x0002},
- { 0x4061, 0x0002}
+ }, {
+ 122666000, {
+ { 0x0051, 0x0002 },
+ { 0x2145, 0x0002 },
+ { 0x4061, 0x0002 },
},
- }, {
- 74250000, {
- { 0x0072, 0x0001},
- { 0x2145, 0x0002},
- { 0x4061, 0x0002}
+ }, {
+ 147200000, {
+ { 0x0051, 0x0002 },
+ { 0x2145, 0x0002 },
+ { 0x4064, 0x0003 },
},
- }, {
- 83500000, {
- { 0x0072, 0x0001},
+ }, {
+ 184000000, {
+ { 0x0051, 0x0002 },
+ { 0x214c, 0x0003 },
+ { 0x4064, 0x0003 },
},
- }, {
- 108000000, {
- { 0x0051, 0x0002},
- { 0x2145, 0x0002},
- { 0x4061, 0x0002}
+ }, {
+ 226666000, {
+ { 0x0040, 0x0003 },
+ { 0x214c, 0x0003 },
+ { 0x4064, 0x0003 },
},
- }, {
- 106500000, {
- { 0x0051, 0x0002},
- { 0x2145, 0x0002},
- { 0x4061, 0x0002}
+ }, {
+ 272000000, {
+ { 0x0040, 0x0003 },
+ { 0x214c, 0x0003 },
+ { 0x5a64, 0x0003 },
},
- }, {
- 146250000, {
- { 0x0051, 0x0002},
- { 0x2145, 0x0002},
- { 0x4061, 0x0002}
+ }, {
+ 340000000, {
+ { 0x0040, 0x0003 },
+ { 0x3b4c, 0x0003 },
+ { 0x5a64, 0x0003 },
},
- }, {
- 148500000, {
- { 0x0051, 0x0003},
- { 0x214c, 0x0003},
- { 0x4064, 0x0003}
+ }, {
+ 600000000, {
+ { 0x1a40, 0x0003 },
+ { 0x3b4c, 0x0003 },
+ { 0x5a64, 0x0003 },
},
- }, {
+ }, {
~0UL, {
- { 0x00a0, 0x000a },
- { 0x2001, 0x000f },
- { 0x4002, 0x000f },
+ { 0x0000, 0x0000 },
+ { 0x0000, 0x0000 },
+ { 0x0000, 0x0000 },
},
}
};
static const struct dw_hdmi_curr_ctrl rockchip_cur_ctr[] = {
- /* pixelclk bpp8 bpp10 bpp12 */
+ /* pixelclk bpp8 bpp10 bpp12 */
{
- 40000000, { 0x0018, 0x0018, 0x0018 },
- }, {
- 65000000, { 0x0028, 0x0028, 0x0028 },
- }, {
- 66000000, { 0x0038, 0x0038, 0x0038 },
- }, {
- 74250000, { 0x0028, 0x0038, 0x0038 },
- }, {
- 83500000, { 0x0028, 0x0038, 0x0038 },
- }, {
- 146250000, { 0x0038, 0x0038, 0x0038 },
- }, {
- 148500000, { 0x0000, 0x0038, 0x0038 },
- }, {
- ~0UL, { 0x0000, 0x0000, 0x0000},
- }
+ 600000000, { 0x0000, 0x0000, 0x0000 },
+ }, {
+ ~0UL, { 0x0000, 0x0000, 0x0000 },
+ },
};
static const struct dw_hdmi_phy_config rockchip_phy_config[] = {
/*pixelclk symbol term vlev*/
- { 74250000, 0x8009, 0x0004, 0x0272},
- { 148500000, 0x802b, 0x0004, 0x028d},
- { 297000000, 0x8039, 0x0005, 0x028d},
- { ~0UL, 0x0000, 0x0000, 0x0000}
+ { CLK_PLUS_SLOP(74250000), 0x8009, 0x0004, 0x0272},
+ { CLK_PLUS_SLOP(165000000), 0x802b, 0x0004, 0x0209},
+ { CLK_PLUS_SLOP(297000000), 0x8039, 0x0005, 0x028d},
+ { ~0UL, 0x0000, 0x0000, 0x0000}
};
static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi)
{
struct device_node *np = hdmi->dev->of_node;
+ int rates_cnt;
hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
if (IS_ERR(hdmi->regmap)) {
@@ -192,26 +211,55 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi)
return PTR_ERR(hdmi->grf_clk);
}
+ if ((rates_cnt = of_property_count_u32_elems(np, "rockchip,hdmi-rates-hz")) > 0) {
+ int rv;
+ u32 *rates = devm_kmalloc_array(hdmi->dev, rates_cnt, sizeof(u32), GFP_KERNEL);
+ if (!rates)
+ return -ENOMEM;
+ rv = of_property_read_u32_array(np, "rockchip,hdmi-rates-hz", rates, rates_cnt);
+ if (rv)
+ return rv;
+ hdmi->rates = rates;
+ hdmi->rates_cnt = rates_cnt;
+ } else {
+ rates_cnt = ARRAY_SIZE(dw_hdmi_fallback_rates);
+ hdmi->rates = devm_kmalloc_array(hdmi->dev, rates_cnt, sizeof(u32), GFP_KERNEL);
+ if (!hdmi->rates)
+ return -ENOMEM;
+ memcpy(hdmi->rates, dw_hdmi_fallback_rates, rates_cnt * sizeof(u32));
+ hdmi->rates_cnt = rates_cnt;
+ }
+
+
return 0;
}
static enum drm_mode_status
-dw_hdmi_rockchip_mode_valid(struct drm_connector *connector,
+dw_hdmi_rockchip_encoder_mode_valid(struct drm_encoder *encoder,
const struct drm_display_mode *mode)
{
- const struct dw_hdmi_mpll_config *mpll_cfg = rockchip_mpll_cfg;
+ struct rockchip_hdmi *hdmi = to_rockchip_hdmi(encoder);
int pclk = mode->clock * 1000;
- bool valid = false;
+ int num_rates = hdmi->rates_cnt;
int i;
- for (i = 0; mpll_cfg[i].mpixelclock != (~0UL); i++) {
- if (pclk == mpll_cfg[i].mpixelclock) {
- valid = true;
- break;
- }
+ /*
+ * Pixel clocks we support are always < 2GHz and so fit in an
+ * int. We should make sure source rate does too so we don't get
+ * overflow when we multiply by 1000.
+ */
+ if (mode->clock > INT_MAX / 1000)
+ return MODE_BAD;
+
+ for (i = 0; i < num_rates; i++) {
+ int slop = CLK_SLOP(pclk);
+
+ if ((pclk >= hdmi->rates[i] - slop) &&
+ (pclk <= hdmi->rates[i] + slop))
+ return MODE_OK;
}
- return (valid) ? MODE_OK : MODE_BAD;
+ return MODE_BAD;
}
static const struct drm_encoder_funcs dw_hdmi_rockchip_encoder_funcs = {
@@ -227,7 +275,39 @@ dw_hdmi_rockchip_encoder_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adj_mode)
{
- return true;
+ struct rockchip_hdmi *hdmi = to_rockchip_hdmi(encoder);
+ int pclk = adj_mode->clock * 1000;
+ int best_diff = INT_MAX;
+ int best_clock = 0;
+ int slop;
+ int i;
+
+ /* Pick the best clock */
+ for (i = 0; i < hdmi->rates_cnt; i++) {
+ int diff = hdmi->rates[i] - pclk;
+
+ if (diff < 0)
+ diff = -diff;
+ if (diff < best_diff) {
+ best_diff = diff;
+ best_clock = hdmi->rates[i];
+
+ /* Bail early if we're exact */
+ if (best_diff == 0)
+ return true;
+ }
+ }
+
+ /* Double check that it's OK */
+ slop = CLK_SLOP(pclk);
+ if ((pclk >= best_clock - slop) && (pclk <= best_clock + slop)) {
+ adj_mode->clock = DIV_ROUND_UP(best_clock, 1000);
+ return true;
+ }
+
+ /* Shoudn't be here; we should have said rate wasn't valid */
+ dev_warn(hdmi->dev, "tried to set invalid rate %d\n", adj_mode->clock);
+ return false;
}
static void dw_hdmi_rockchip_encoder_mode_set(struct drm_encoder *encoder,
@@ -280,6 +360,7 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder *encoder,
}
static const struct drm_encoder_helper_funcs dw_hdmi_rockchip_encoder_helper_funcs = {
+ .mode_valid = dw_hdmi_rockchip_encoder_mode_valid,
.mode_fixup = dw_hdmi_rockchip_encoder_mode_fixup,
.mode_set = dw_hdmi_rockchip_encoder_mode_set,
.enable = dw_hdmi_rockchip_encoder_enable,
@@ -294,7 +375,6 @@ static struct rockchip_hdmi_chip_data rk3288_chip_data = {
};
static const struct dw_hdmi_plat_data rk3288_hdmi_drv_data = {
- .mode_valid = dw_hdmi_rockchip_mode_valid,
.mpll_cfg = rockchip_mpll_cfg,
.cur_ctr = rockchip_cur_ctr,
.phy_config = rockchip_phy_config,
@@ -308,7 +388,6 @@ static struct rockchip_hdmi_chip_data rk3399_chip_data = {
};
static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = {
- .mode_valid = dw_hdmi_rockchip_mode_valid,
.mpll_cfg = rockchip_mpll_cfg,
.cur_ctr = rockchip_cur_ctr,
.phy_config = rockchip_phy_config,
@@ -387,6 +466,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
*/
if (IS_ERR(hdmi->hdmi)) {
ret = PTR_ERR(hdmi->hdmi);
+ devm_kfree(hdmi->dev, hdmi->rates);
drm_encoder_cleanup(encoder);
clk_disable_unprepare(hdmi->vpll_clk);
}
@@ -399,6 +479,7 @@ static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master,
{
struct rockchip_hdmi *hdmi = dev_get_drvdata(dev);
+ devm_kfree(hdmi->dev, hdmi->rates);
dw_hdmi_unbind(hdmi->hdmi);
clk_disable_unprepare(hdmi->vpll_clk);
}
--
2.16.4

View File

@@ -1,63 +0,0 @@
From 1680a655127a62e74cbcfb84782e04a9c55dcf81 Mon Sep 17 00:00:00 2001
From: Shunqian Zheng <zhengsq@rock-chips.com>
Date: Wed, 5 Sep 2018 19:00:09 -0300
Subject: [PATCH 3/6] media: Add JPEG_RAW format
Add V4L2_PIX_FMT_JPEG_RAW format that does not contain
JPEG header in the output frame.
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
Documentation/media/uapi/v4l/pixfmt-compressed.rst | 9 +++++++++
drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
include/uapi/linux/videodev2.h | 1 +
3 files changed, 11 insertions(+)
diff --git a/Documentation/media/uapi/v4l/pixfmt-compressed.rst b/Documentation/media/uapi/v4l/pixfmt-compressed.rst
index d382e7a5..4dffe400 100644
--- a/Documentation/media/uapi/v4l/pixfmt-compressed.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-compressed.rst
@@ -23,6 +23,15 @@ Compressed Formats
- 'JPEG'
- TBD. See also :ref:`VIDIOC_G_JPEGCOMP <VIDIOC_G_JPEGCOMP>`,
:ref:`VIDIOC_S_JPEGCOMP <VIDIOC_G_JPEGCOMP>`.
+ * .. _V4L2-PIX-FMT-JPEG-RAW:
+
+ - ``V4L2_PIX_FMT_JPEG_RAW``
+ - 'Raw JPEG'
+ - Raw JPEG bitstream, containing a compressed payload. This format
+ contains an image scan, i.e. without any metadata or headers.
+ The user is expected to set the needed metadata such as
+ quantization and entropy encoding tables, via ``V4L2_CID_JPEG``
+ controls, see :ref:`jpeg-control-id`.
* .. _V4L2-PIX-FMT-MPEG:
- ``V4L2_PIX_FMT_MPEG``
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 54afc9c7..0dcd95f4 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1301,6 +1301,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
/* Max description length mask: descr = "0123456789012345678901234567890" */
case V4L2_PIX_FMT_MJPEG: descr = "Motion-JPEG"; break;
case V4L2_PIX_FMT_JPEG: descr = "JFIF JPEG"; break;
+ case V4L2_PIX_FMT_JPEG_RAW: descr = "Raw JPEG"; break;
case V4L2_PIX_FMT_DV: descr = "1394"; break;
case V4L2_PIX_FMT_MPEG: descr = "MPEG-1/2/4"; break;
case V4L2_PIX_FMT_H264: descr = "H.264"; break;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 5d1a3685..f271048c 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -627,6 +627,7 @@ struct v4l2_pix_format {
/* compressed formats */
#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */
#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */
+#define V4L2_PIX_FMT_JPEG_RAW v4l2_fourcc('J', 'P', 'G', 'R') /* JFIF JPEG RAW without headers */
#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */
#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
--
2.16.4

View File

@@ -1,153 +0,0 @@
From 82da876c36ccc7791d5b20e7ee8b50379f7b19aa Mon Sep 17 00:00:00 2001
From: Shunqian Zheng <zhengsq@rock-chips.com>
Date: Wed, 5 Sep 2018 19:00:10 -0300
Subject: [PATCH 4/6] media: Add controls for JPEG quantization tables
Add V4L2_CID_JPEG_QUANTIZATION compound control to allow userspace
configure the JPEG quantization tables.
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
Documentation/media/uapi/v4l/extended-controls.rst | 31 ++++++++++++++++++++++
Documentation/media/videodev2.h.rst.exceptions | 1 +
drivers/media/v4l2-core/v4l2-ctrls.c | 10 +++++++
include/uapi/linux/v4l2-controls.h | 12 +++++++++
include/uapi/linux/videodev2.h | 1 +
5 files changed, 55 insertions(+)
diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
index 9f7312bf..1335d27d 100644
--- a/Documentation/media/uapi/v4l/extended-controls.rst
+++ b/Documentation/media/uapi/v4l/extended-controls.rst
@@ -3354,7 +3354,38 @@ JPEG Control IDs
Specify which JPEG markers are included in compressed stream. This
control is valid only for encoders.
+.. _jpeg-quant-tables-control:
+``V4L2_CID_JPEG_QUANTIZATION (struct)``
+ Specifies the luma and chroma quantization matrices for encoding
+ or decoding a V4L2_PIX_FMT_JPEG_RAW format buffer. The :ref:`itu-t81`
+ specification allows 8-bit quantization coefficients for
+ baseline profile images, and 8-bit or 16-bit for extended profile
+ images. Supporting or not 16-bit precision coefficients is driver-specific.
+ Coefficients must be set in JPEG zigzag scan order.
+
+
+.. c:type:: struct v4l2_ctrl_jpeg_quantization
+
+.. cssclass:: longtable
+
+.. flat-table:: struct v4l2_ctrl_jpeg_quantization
+ :header-rows: 0
+ :stub-columns: 0
+ :widths: 1 1 2
+
+ * - __u8
+ - ``precision``
+ - Specifies the coefficient precision. User shall set 0
+ for 8-bit, and 1 for 16-bit.
+
+ * - __u16
+ - ``luma_quantization_matrix[64]``
+ - Sets the luma quantization table.
+
+ * - __u16
+ - ``chroma_quantization_matrix[64]``
+ - Sets the chroma quantization table.
.. flat-table::
:header-rows: 0
diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions
index ca9f0edc..a0a38e92 100644
--- a/Documentation/media/videodev2.h.rst.exceptions
+++ b/Documentation/media/videodev2.h.rst.exceptions
@@ -129,6 +129,7 @@ replace symbol V4L2_CTRL_TYPE_STRING :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_U16 :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_U32 :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_U8 :c:type:`v4l2_ctrl_type`
+replace symbol V4L2_CTRL_TYPE_JPEG_QUANTIZATION :c:type:`v4l2_ctrl_type`
# V4L2 capability defines
replace define V4L2_CAP_VIDEO_CAPTURE device-capabilities
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 599c1cbf..305bd7a9 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -999,6 +999,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_JPEG_RESTART_INTERVAL: return "Restart Interval";
case V4L2_CID_JPEG_COMPRESSION_QUALITY: return "Compression Quality";
case V4L2_CID_JPEG_ACTIVE_MARKER: return "Active Markers";
+ case V4L2_CID_JPEG_QUANTIZATION: return "JPEG Quantization Tables";
/* Image source controls */
/* Keep the order of the 'case's the same as in v4l2-controls.h! */
@@ -1286,6 +1287,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
case V4L2_CID_DETECT_MD_REGION_GRID:
*type = V4L2_CTRL_TYPE_U8;
break;
+ case V4L2_CID_JPEG_QUANTIZATION:
+ *type = V4L2_CTRL_TYPE_JPEG_QUANTIZATION;
+ break;
case V4L2_CID_DETECT_MD_THRESHOLD_GRID:
*type = V4L2_CTRL_TYPE_U16;
break;
@@ -1612,6 +1616,9 @@ static int std_validate(const struct v4l2_ctrl *ctrl, u32 idx,
return -ERANGE;
return 0;
+ case V4L2_CTRL_TYPE_JPEG_QUANTIZATION:
+ return 0;
+
default:
return -EINVAL;
}
@@ -2133,6 +2140,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl,
case V4L2_CTRL_TYPE_U32:
elem_size = sizeof(u32);
break;
+ case V4L2_CTRL_TYPE_JPEG_QUANTIZATION:
+ elem_size = sizeof(struct v4l2_ctrl_jpeg_quantization);
+ break;
default:
if (type < V4L2_CTRL_COMPOUND_TYPES)
elem_size = sizeof(s32);
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index e4ee10ee..856b3325 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -987,6 +987,18 @@ enum v4l2_jpeg_chroma_subsampling {
#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
+#define V4L2_CID_JPEG_QUANTIZATION (V4L2_CID_JPEG_CLASS_BASE + 5)
+struct v4l2_ctrl_jpeg_quantization {
+ /* ITU-T.81 specifies two quantization coefficient precisions:
+ * 8-bit for baseline profile,
+ * 8-bit or 16-bit for extended profile.
+ *
+ * User shall set "precision" to 0 for 8-bit and 1 for 16-bit.
+ */
+ __u8 precision;
+ __u16 luma_quantization_matrix[64];
+ __u16 chroma_quantization_matrix[64];
+};
/* Image source controls */
#define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900)
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index f271048c..e998d074 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -1630,6 +1630,7 @@ enum v4l2_ctrl_type {
V4L2_CTRL_TYPE_U8 = 0x0100,
V4L2_CTRL_TYPE_U16 = 0x0101,
V4L2_CTRL_TYPE_U32 = 0x0102,
+ V4L2_CTRL_TYPE_JPEG_QUANTIZATION = 0x0103,
};
/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
--
2.16.4

View File

@@ -1,35 +0,0 @@
From 604ea7fc311af2b3a41e7fe3b4fbde0ee03dfb9c Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 21:09:50 +0200
Subject: [PATCH 04/28] dts: rk3288: miqi: Enabling the Mali GPU node
Why is the MiQi the only one left without a working mali GPU node ?
Seriously, is there a rk3288 chipset WITHOUT a mali GPU ? Couldn't
they enable it once in the DTSI, instead of defining it as "disabled"
and enabling it in every DTS file ?
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288-miqi.dts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
index 4d923aa6..3cd60674 100644
--- a/arch/arm/boot/dts/rk3288-miqi.dts
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
@@ -149,6 +149,11 @@
status = "ok";
};
+&gpu {
+ mali-supply = <&vdd_gpu>;
+ status = "okay";
+};
+
&hdmi {
ddc-i2c-bus = <&i2c5>;
status = "okay";
--
2.11.0

View File

@@ -1,45 +0,0 @@
From 89e5763110ca77d68a4be00cd97a638adc2401d5 Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Tue, 2 Aug 2016 08:31:00 +0200
Subject: [PATCH 05/28] ARM: dts: rockchip: fix the regulator's voltage range
on MiQi board
The board declared too narrow a voltage range for the CPU and GPU
regulators, preventing it from using the full CPU frequency range.
The regulators support 712500 to 1500000 microvolts.
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 95330e63a9295a2632cee8cce5db80677f01857a)
---
arch/arm/boot/dts/rk3288-miqi.dts | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
index 3cd60674..a1c3cdaa 100644
--- a/arch/arm/boot/dts/rk3288-miqi.dts
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
@@ -168,8 +168,8 @@
fcs,suspend-voltage-selector = <1>;
reg = <0x40>;
regulator-name = "vdd_cpu";
- regulator-min-microvolt = <850000>;
- regulator-max-microvolt = <1350000>;
+ regulator-min-microvolt = <712500>;
+ regulator-max-microvolt = <1500000>;
regulator-always-on;
regulator-boot-on;
regulator-enable-ramp-delay = <300>;
@@ -182,8 +182,8 @@
fcs,suspend-voltage-selector = <1>;
reg = <0x41>;
regulator-name = "vdd_gpu";
- regulator-min-microvolt = <850000>;
- regulator-max-microvolt = <1350000>;
+ regulator-min-microvolt = <712500>;
+ regulator-max-microvolt = <1500000>;
regulator-always-on;
vin-supply = <&vcc_sys>;
};
--
2.11.0

View File

@@ -1,46 +0,0 @@
From c27e445527e949f3ef46d5326066196969c17d23 Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Sun, 12 Mar 2017 19:43:15 +0000
Subject: [PATCH 06/28] ARM: dts: rockchip: add the MiQi board's fan definition
The MiQi board is sold with an enclosure in which a fan is connected
to the second LED output, and configured by default in "heartbeat"
mode so that it rotates slowly and increases when the CPU load
increases, ensuring appropriate cooling by default. This LED output
is called "Fan" in the original kernel and connected to GPIO18
(gpiochip 0, pin 18). Here we called it "miqi:green:fan" to stay
consistent with the kernel's naming conventions.
It's worth noting that without this patch the fan doesn't work at
all, risking to make the board overheat.
Fixes: 162718c (v4.7)
Cc: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Myy <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288-miqi.dts | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
index a1c3cdaa..0e383595 100644
--- a/arch/arm/boot/dts/rk3288-miqi.dts
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
@@ -67,6 +67,13 @@
leds {
compatible = "gpio-leds";
+ fan {
+ gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
+ label = "miqi:green:fan";
+ linux,default-trigger = "heartbeat";
+ };
+
+
work {
gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
label = "miqi:green:user";
--
2.11.0

View File

@@ -1,41 +0,0 @@
From e7e092be197c51b4d222a3b4e6638318067b7e6a Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Tue, 2 Aug 2016 08:20:53 +0200
Subject: [PATCH 07/28] ARM: dts: rockchip: add support for 1800 MHz operation
on MiQi board
This board happily supports 1800 MHz operations (and even more), so
let's enable it.
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit a0b82a29e7873a81f49ac5f50be3df1c7d312a14)
---
arch/arm/boot/dts/rk3288-miqi.dts | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
index 0e383595..80603a3d 100644
--- a/arch/arm/boot/dts/rk3288-miqi.dts
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
@@ -126,6 +126,18 @@
&cpu0 {
cpu0-supply = <&vdd_cpu>;
+ operating-points = <
+ /* KHz uV */
+ 1800000 1400000
+ 1704000 1350000
+ 1608000 1300000
+ 1512000 1250000
+ 1416000 1200000
+ 1200000 1100000
+ 1008000 1050000
+ 816000 1000000
+ 600000 900000
+ >;
};
&emmc {
--
2.11.0

View File

@@ -1,170 +0,0 @@
From de9dcd5ecab0686022eee243464f35d2c7a34c97 Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Mon, 16 Jan 2017 12:44:56 +0000
Subject: [PATCH 08/28] Readapt: ARM: dts: rockchip: miqi: add turbo-mode
operating points
Readaptation of Willy Tarreau patch.
Here's the original commit message:
By switching to opp-v2 we can declare "turbo-mode" operating points
which are only enabled when /sys/devices/system/cpu/cpufreq/boost is
set. It is convenient because it allows to boot, set a safe powersave
governor, enable boost, limit scaling_max_freq to a safe value, then
change the governor to performance or ondemand, and the frequency can
then be manually adjusted by only touching scaling_max_freq.
New values are 1896, 1920, 1992, 2016, 2040 MHz, 2064, 2088, 2112,
2136, 2160, 2184, 2208. MiQi boards work fine up to 2112 with a very
good power supply (5.2V/3A real) and a strong heatsink. Higher
frequencies may randomly work. At least 1992 is rock solid for hours
using "openssl speed -multi 4". The other ones have only been tested
for a few minutes. Frequencies of 1896 and 1920 MHz use 1.425V.
1992 MHz uses 1.45V. 2016, 2040 and 2064 use 1.475V. 2088 and above
use 1.500V. 2160, 2184 and 2208 cause the lowest frequency to be
picked. It's obvious that it's a sign issue somewhere in the kernel
but this one was not found yet.
Signed-off-by: Myy <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288-miqi.dts | 120 +++++++++++++++++++++++++++++++++-----
1 file changed, 107 insertions(+), 13 deletions(-)
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
index 80603a3d..d7fde483 100644
--- a/arch/arm/boot/dts/rk3288-miqi.dts
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
@@ -122,22 +122,116 @@
regulator-always-on;
regulator-boot-on;
};
-};
+
+ cpu0_opp_table: opp_table0 {
+ compatible = "operating-points-v2";
+ opp-shared;
+
+ opp@600000000 {
+ opp-hz = /bits/ 64 <600000000>;
+ opp-microvolt = <900000>;
+ };
+ opp@816000000 {
+ opp-hz = /bits/ 64 <816000000>;
+ opp-microvolt = <1000000>;
+ };
+ opp@1008000000 {
+ opp-hz = /bits/ 64 <1008000000>;
+ opp-microvolt = <1050000>;
+ };
+ opp@1200000000 {
+ opp-hz = /bits/ 64 <1200000000>;
+ opp-microvolt = <1100000>;
+ };
+ opp@1416000000 {
+ opp-hz = /bits/ 64 <1416000000>;
+ opp-microvolt = <1200000>;
+ };
+ opp@1512000000 {
+ opp-hz = /bits/ 64 <1512000000>;
+ opp-microvolt = <1250000>;
+ };
+ opp@1608000000 {
+ opp-hz = /bits/ 64 <1608000000>;
+ opp-microvolt = <1300000>;
+ };
+ opp@1704000000 {
+ opp-hz = /bits/ 64 <1704000000>;
+ opp-microvolt = <1350000>;
+ };
+ opp@1800000000 {
+ opp-hz = /bits/ 64 <1800000000>;
+ opp-microvolt = <1400000>;
+ };
+ /* boot-only frequencies below */
+ opp@1896000000 {
+ opp-hz = /bits/ 64 <1896000000>;
+ opp-microvolt = <1425000>;
+ turbo-mode;
+ };
+ opp@1920000000 {
+ opp-hz = /bits/ 64 <1920000000>;
+ opp-microvolt = <1425000>;
+ turbo-mode;
+ };
+ opp@1992000000 {
+ opp-hz = /bits/ 64 <1992000000>;
+ opp-microvolt = <1450000>;
+ turbo-mode;
+ };
+ opp@2016000000 {
+ opp-hz = /bits/ 64 <2016000000>;
+ opp-microvolt = <1475000>;
+ turbo-mode;
+ };
+ opp@2040000000 {
+ opp-hz = /bits/ 64 <2040000000>;
+ opp-microvolt = <1475000>;
+ turbo-mode;
+ };
+ opp@2064000000 {
+ opp-hz = /bits/ 64 <2064000000>;
+ opp-microvolt = <1475000>;
+ turbo-mode;
+ };
+ opp@2088000000 {
+ opp-hz = /bits/ 64 <2088000000>;
+ opp-microvolt = <1500000>;
+ turbo-mode;
+ };
+ opp@2112000000 {
+ opp-hz = /bits/ 64 <2112000000>;
+ opp-microvolt = <1500000>;
+ turbo-mode;
+ };
+ opp@2136000000 {
+ opp-hz = /bits/ 64 <2136000000>;
+ opp-microvolt = <1500000>;
+ turbo-mode;
+ };
+ opp@2160000000 {
+ opp-hz = /bits/ 64 <2160000000>;
+ opp-microvolt = <1500000>;
+ turbo-mode;
+ };
+ opp@2184000000 {
+ opp-hz = /bits/ 64 <2184000000>;
+ opp-microvolt = <1500000>;
+ turbo-mode;
+ };
+ opp@2208000000 {
+ opp-hz = /bits/ 64 <2208000000>;
+ opp-microvolt = <1500000>;
+ turbo-mode;
+ };
+ };
+};
+
&cpu0 {
cpu0-supply = <&vdd_cpu>;
- operating-points = <
- /* KHz uV */
- 1800000 1400000
- 1704000 1350000
- 1608000 1300000
- 1512000 1250000
- 1416000 1200000
- 1200000 1100000
- 1008000 1050000
- 816000 1000000
- 600000 900000
- >;
+
+ operating-points-v2 = <&cpu0_opp_table>;
};
&emmc {
--
2.11.0

View File

@@ -1,61 +0,0 @@
From 771bcfe1735e42650b763e52a042a9fd98b2fa5b Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 21:20:43 +0200
Subject: [PATCH 09/28] ARM: DTSI: rk3288.dtsi: Missing GRF handles
Add missing GRF handles.
This patch is taken from the patches provided by the ARMbian team.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 356ed1e6..5b789528 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -547,6 +547,7 @@
pinctrl-2 = <&otp_gpio>;
#thermal-sensor-cells = <1>;
rockchip,hw-tshut-temp = <95000>;
+ rockchip,grf = <&grf>;
status = "disabled";
};
@@ -655,6 +656,7 @@
pinctrl-0 = <&pwm0_pin>;
clocks = <&cru PCLK_PWM>;
clock-names = "pwm";
+ rockchip,grf = <&grf>;
status = "disabled";
};
@@ -666,6 +668,7 @@
pinctrl-0 = <&pwm1_pin>;
clocks = <&cru PCLK_PWM>;
clock-names = "pwm";
+ rockchip,grf = <&grf>;
status = "disabled";
};
@@ -677,6 +680,7 @@
pinctrl-0 = <&pwm2_pin>;
clocks = <&cru PCLK_PWM>;
clock-names = "pwm";
+ rockchip,grf = <&grf>;
status = "disabled";
};
@@ -688,6 +692,7 @@
pinctrl-0 = <&pwm3_pin>;
clocks = <&cru PCLK_PWM>;
clock-names = "pwm";
+ rockchip,grf = <&grf>;
status = "disabled";
};
--
2.11.0

View File

@@ -1,31 +0,0 @@
From 062488e4b8fd552c01e1104b3bc91a6f7ffe6c41 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 21:24:47 +0200
Subject: [PATCH 10/28] RK3288: DTSI: rk3288.dtsi: Add missing SPI2 pinctrl
The spi2_cs1 pin reference is missing in the spi2 first pin control
definition.
This patch is taken from the patches provided by the ARMbian team.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 5b789528..9ed532cc 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -334,7 +334,7 @@
dma-names = "tx", "rx";
interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
pinctrl-names = "default";
- pinctrl-0 = <&spi2_clk &spi2_tx &spi2_rx &spi2_cs0>;
+ pinctrl-0 = <&spi2_clk &spi2_tx &spi2_rx &spi2_cs0 &spi2_cs1>;
reg = <0x0 0xff130000 0x0 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
--
2.11.0

View File

@@ -1,27 +0,0 @@
From af8d73ec0df1dde1e2fe1674c5708d4c30385ba9 Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Mon, 5 Jun 2017 12:37:17 +0000
Subject: [PATCH 11/28] Added support for Tinkerboard's SPI interface
Imported from ARMbian
Signed-off-by: Myy <myy@miouyouyou.fr>
---
drivers/spi/spidev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index cda10719..a6287475 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -669,6 +669,7 @@ static const struct of_device_id spidev_dt_ids[] = {
{ .compatible = "lineartechnology,ltc2488" },
{ .compatible = "ge,achc" },
{ .compatible = "semtech,sx1301" },
+ { .compatible = "rockchip,spi_tinker" },
{},
};
MODULE_DEVICE_TABLE(of, spidev_dt_ids);
--
2.11.0

View File

@@ -1,56 +0,0 @@
From 7af8d2bf732cb3baab7d926ed8a7e061e7a09ad9 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 21:39:00 +0200
Subject: [PATCH 13/28] ARM: DTSI: rk3288.dtsi: Adding cells addresses and
sizes of MMC nodes
Imported from the Rockchip 4.4 patches.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index be985f02..14ef8202 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -236,6 +236,8 @@
clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
fifo-depth = <0x100>;
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <0x0 0xff0c0000 0x0 0x4000>;
resets = <&cru SRST_MMC0>;
reset-names = "reset";
@@ -250,6 +252,8 @@
clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
fifo-depth = <0x100>;
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <0x0 0xff0d0000 0x0 0x4000>;
resets = <&cru SRST_SDIO0>;
reset-names = "reset";
@@ -264,6 +268,8 @@
clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
fifo-depth = <0x100>;
interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <0x0 0xff0e0000 0x0 0x4000>;
resets = <&cru SRST_SDIO1>;
reset-names = "reset";
@@ -278,6 +284,8 @@
clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
fifo-depth = <0x100>;
interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <0x0 0xff0f0000 0x0 0x4000>;
resets = <&cru SRST_EMMC>;
reset-names = "reset";
--
2.11.0

View File

@@ -1,27 +0,0 @@
From ac220d592aa38b9b717d36f7bb93f7be5a08f6b3 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 21:43:51 +0200
Subject: [PATCH 14/28] ARM: DTSI: rk3288.dtsi: Adding missing EDP power domain
Imported from Rockchip 4.4 kernel patches.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 14ef8202..10ecebb4 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -1105,6 +1105,7 @@
interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cru SCLK_EDP>, <&cru PCLK_EDP_CTRL>;
clock-names = "dp", "pclk";
+ power-domains = <&power RK3288_PD_VIO>;
phys = <&edp_phy>;
phy-names = "dp";
resets = <&cru SRST_EDP>;
--
2.11.0

View File

@@ -1,28 +0,0 @@
From c5af6798c9a411b3f550f463182a4b4904a21ec2 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 21:51:14 +0200
Subject: [PATCH 16/28] ARM: DTSI: rk3288.dtsi: Adding missing VOPB registers
Imported from @wzyy2 patches... I think...
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 455446f6..125f8835 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -987,7 +987,7 @@
vopb: vop@ff930000 {
compatible = "rockchip,rk3288-vop";
- reg = <0x0 0xff930000 0x0 0x19c>;
+ reg = <0x0 0xff930000 0x0 0x19c>, <0x0 0xff931000 0x0 0x1000>;
interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cru ACLK_VOP0>, <&cru DCLK_VOP0>, <&cru HCLK_VOP0>;
clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
--
2.11.0

View File

@@ -1,31 +0,0 @@
From a0602b2724893de7ac9b4190a7a6bb66458da2d5 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 21:54:37 +0200
Subject: [PATCH 17/28] ARM: DTSI: rk3288.dtsi: Fixed the SPDIF node address
Now, the typo is only in the name of the node itself, not in the
actual registers addresses definition.
Still, this ought to be fixed one day !
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 125f8835..e5d3d3c9 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -922,7 +922,7 @@
status = "disabled";
};
- spdif: sound@ff88b0000 {
+ spdif: sound@ff8b0000 {
compatible = "rockchip,rk3288-spdif", "rockchip,rk3066-spdif";
reg = <0x0 0xff8b0000 0x0 0x10000>;
#sound-dai-cells = <0>;
--
2.11.0

View File

@@ -1,165 +0,0 @@
From 2715f4a9ab5c169c546029a61eebb0bde6619b0e Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 22:12:48 +0200
Subject: [PATCH 18/28] ARM: DTS: rk3288-tinker.dts: Enabling SDIO, Wireless
and Bluetooth
Adding the appropriate nodes in order to exploit the WiFi capabilities
of the board.
Since these capabilities are provided through SDIO, and the SDIO
nodes were not defined, these were added too.
These seems to depend on each other so they are added in one big
patch.
Split if necessary.
Bluetooth and uart0 (AKA Bluetooth UART) definitions were also added
in order to deal with all the wireless techs in one patch.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288-tinker.dts | 82 ++++++++++++++++++++++++++++++++++++-
1 file changed, 81 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts
index 346b0d8b..c552fd95 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dts
+++ b/arch/arm/boot/dts/rk3288-tinker.dts
@@ -44,6 +44,7 @@
#include "rk3288.dtsi"
#include <dt-bindings/input/input.h>
+#include <dt-bindings/clock/rockchip,rk808.h>
/ {
model = "Rockchip RK3288 Tinker Board";
@@ -114,6 +115,24 @@
};
};
+ /* This is essential to get SDIO devices working.
+ The Wifi depends on SDIO ! */
+ sdio_pwrseq: sdio-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ clocks = <&rk808 RK808_CLKOUT1>;
+ clock-names = "ext_clock";
+ pinctrl-names = "default";
+ pinctrl-0 = <&chip_enable_h>, <&wifi_enable_h>;
+
+ /*
+ * On the module itself this is one of these (depending
+ * on the actual card populated):
+ * - SDIO_RESET_L_WL_REG_ON
+ * - PDN (power down when low)
+ */
+ reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>, <&gpio4 RK_PD3 GPIO_ACTIVE_LOW>;
+ };
+
vcc_sys: vsys-regulator {
compatible = "regulator-fixed";
regulator-name = "vcc_sys";
@@ -134,6 +153,28 @@
startup-delay-us = <100000>;
vin-supply = <&vcc_io>;
};
+
+ wireless-wlan {
+ compatible = "wlan-platdata";
+ rockchip,grf = <&grf>;
+ wifi_chip_type = "8723bs";
+ sdio_vref = <1800>;
+ WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
+ status = "okay";
+ };
+
+ wireless-bluetooth {
+ compatible = "bluetooth-platdata";
+ uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
+ pinctrl-names = "default","rts_gpio";
+ pinctrl-0 = <&uart0_rts>;
+ pinctrl-1 = <&uart0_gpios>;
+ BT,reset_gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+ BT,wake_gpio = <&gpio4 26 GPIO_ACTIVE_HIGH>;
+ BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
+ status = "okay";
+ };
+
};
&cpu0 {
@@ -373,10 +414,30 @@
&io_domains {
status = "okay";
-
+ rockchip,grf = <&grf>;
+ wifi-supply = <&vcc_18>;
sdcard-supply = <&vccio_sd>;
};
+&sdio0 {
+ status = "okay";
+ clock-frequency = <50000000>;
+ clock-freq-min-max = <200000 50000000>;
+ bus-width = <4>;
+ cap-sd-highspeed;
+ cap-sdio-irq;
+ disable-wp;
+ keep-power-in-suspend;
+ mmc-pwrseq = <&sdio_pwrseq>;
+ non-removable;
+ num-slots = <1>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+ sd-uhs-sdr104;
+ supports-sdio;
+
+};
+
&pinctrl {
pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
drive-strength = <8>;
@@ -422,6 +483,16 @@
};
};
+ sdio-pwrseq {
+ wifi_enable_h: wifienable-h {
+ rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+
+ chip_enable_h: chip-enable-h {
+ rockchip,pins = <4 27 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
sdmmc {
sdmmc_bus4: sdmmc-bus4 {
rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
@@ -453,6 +524,13 @@
rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
+
+ wireless-bluetooth {
+ uart0_gpios: uart0-gpios {
+ rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
};
&pwm0 {
@@ -485,6 +563,8 @@
&uart0 {
status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
};
&uart1 {
--
2.11.0

View File

@@ -1,30 +0,0 @@
diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts
index 07b4af4..7755426 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dts
+++ b/arch/arm/boot/dts/rk3288-tinker.dts
@@ -162,7 +162,7 @@
WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
status = "okay";
};
-
+/*
wireless-bluetooth {
compatible = "bluetooth-platdata";
uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
@@ -174,6 +174,7 @@
BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
status = "okay";
};
+*/
};
@@ -620,7 +621,7 @@
&uart0 {
status = "okay";
pinctrl-names = "default";
- pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
+ pinctrl-0 = <&uart0_xfer>, <&uart0_cts>, <&uart0_rts>;
};
&uart1 {

View File

@@ -1,29 +0,0 @@
From d4775f623b25009039a8ef3f28332033c7766ecc Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 22:20:33 +0200
Subject: [PATCH 19/28] ARM: DTS: rk3288-tinker.dts: Improving the CPU max
voltage
Taken from the various patches provided by @TonyMac32 .
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288-tinker.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts
index c552fd95..4ce94698 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dts
+++ b/arch/arm/boot/dts/rk3288-tinker.dts
@@ -243,7 +243,7 @@
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <750000>;
- regulator-max-microvolt = <1350000>;
+ regulator-max-microvolt = <1450000>;
regulator-name = "vdd_arm";
regulator-ramp-delay = <6000>;
regulator-state-mem {
--
2.11.0

View File

@@ -1,40 +0,0 @@
From 39e50ab508d8104a733771a8681908a66a300edd Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 22:25:03 +0200
Subject: [PATCH 20/28] ARM: DTS: rk3288-tinker.dts: Setting up the SD
regulators
Some are needed and some are not. Playing with these parameters is
required to get reboot working on these boards.
I still can't believe that these boards can't soft reset correctly.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288-tinker.dts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts
index 4ce94698..90c1a251 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dts
+++ b/arch/arm/boot/dts/rk3288-tinker.dts
@@ -333,6 +333,8 @@
};
vccio_sd: LDO_REG5 {
+ regulator-always-on;
+ regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vccio_sd";
@@ -379,7 +381,6 @@
};
vcc33_sd: SWITCH_REG1 {
- regulator-always-on;
regulator-boot-on;
regulator-name = "vcc33_sd";
regulator-state-mem {
--
2.11.0

View File

@@ -1,53 +0,0 @@
From b0a552add28bf4590b979abb3530b14b6811eec1 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Thu, 19 Oct 2017 22:33:39 +0200
Subject: [PATCH 21/28] ARM: DTS: rk3288-tinker.dts: Defined the I2C interfaces
And all the hardware behind.
Taken from, and tested by @TonyMac32 .
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288-tinker.dts | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts
index 90c1a251..67a3ce6f 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dts
+++ b/arch/arm/boot/dts/rk3288-tinker.dts
@@ -400,8 +400,31 @@
};
};
+&i2c1 {
+ status = "okay";
+};
+
&i2c2 {
status = "okay";
+
+ afc0:af-controller@0 {
+ status = "okay";
+ compatible = "silicon touch,vm149C-v4l2-i2c-subdev";
+ reg = <0x0c>;
+ };
+
+ eeprom:m24c08@50 {
+ compatible = "at,24c08";
+ reg = <0x50>;
+ };
+};
+
+&i2c3 {
+ status = "okay";
+};
+
+&i2c4 {
+ status = "okay";
};
&i2c5 {
--
2.11.0

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