Compare commits

..

57 Commits
dev ... 5.11

Author SHA1 Message Date
Stefan Agner
1a551c0753
Bump version 5.11 2021-01-31 00:28:57 +01:00
Pascal Vizeli
0cf378164c
Map host udev data ro to supervisor container (#1186)
* Mapp host udev data ro to container

* fix lint

* fix paths
2021-01-31 00:28:33 +01:00
Stefan Agner
3bc6e2b10a
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-31 00:27:56 +01:00
Stefan Agner
5662a6230f
RaspberryPi: Update kernel 5.4.83 - 76c49e60e742d0bebd798be972d67dd3fd007691 (#1187) 2021-01-31 00:27:32 +01:00
Pascal Vizeli
bc8db10ae6
Fix connectivity check updated NM (#1182) 2021-01-31 00:26:13 +01:00
Stefan Agner
9822625a3d
Linux: Update kernel 5.4.94 (#1195) 2021-01-31 00:24:49 +01:00
Stefan Agner
f142640e2e
Linux: Update kernel 5.4.93 (#1189) 2021-01-29 15:01:47 +01:00
Stefan Agner
e648285fca
Bump version 5.10 2020-12-31 15:07:26 +01:00
Stefan Agner
3cf1b78d55
Bump upstream Linux kernel (#1147)
* Linux: Update kernel 5.4.86

* Odroid: Update kernel 5.9.16
2020-12-31 15:06:32 +01:00
Stefan Agner
4dd3b8bc0d
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:59:53 +01:00
Stefan Agner
918c14fce0
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-31 14:59:48 +01:00
Stefan Agner
d56344414b
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:59:43 +01:00
Stefan Agner
6b51d5a8ab
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-30 16:58:38 +01:00
Stefan Agner
5c2b6bd6e3
Update buildroot to 2020.11.1 (#1135)
Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-12-30 16:57:55 +01:00
Stefan Agner
103ddb150b
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-30 16:57:40 +01:00
Stefan Agner
0e7310e8db
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-30 16:57:22 +01:00
Stefan Agner
b4d587e53b
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-30 16:56:15 +01:00
Mario Limonciello
01923727d0
Add LPSS support for intel-nuc (#1145)
This is needed for MMC to enumerate properly (Fixes: #1112)
2020-12-30 16:55:52 +01:00
Stefan Agner
8cc42b3adb
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-30 16:55:45 +01:00
Stefan Agner
fe25d03b09
Add eMMC support for Intel NUC (#1112) (#1123)
Enable CONFIG_MMC and friends for Intel NUC with eMMC.
2020-12-30 16:55:34 +01:00
Stefan Agner
e0f435bae1
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-30 16:54:11 +01:00
Stefan Agner
810de4efdb
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-30 16:53:53 +01:00
Stefan Agner
5f41501292
Bump systemd to latest stable release 246.9 (#1110) 2020-12-30 16:53:20 +01:00
Stefan Agner
45d6d287e8
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:30:18 +01:00
Stefan Agner
14ddf8800e
Bump version 5.9 2020-12-18 19:22:07 +01:00
Stefan Agner
33cc77eff0
Rel 5 bump upstream kernel (#1105)
* Linux: Update kernel 5.4.84

* Odroid: Update kernel 5.9.15
2020-12-18 19:20:00 +01:00
Stefan Agner
1bdccc83d9
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-18 16:46:11 +01:00
Stefan Agner
a0f63549f4
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-18 16:46:02 +01:00
Stefan Agner
f679638a9c
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-18 16:45:52 +01:00
Stefan Agner
ac3017fc15
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-18 16:45:44 +01:00
Stefan Agner
c98e1557bb
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-18 16:45:33 +01:00
Stefan Agner
4ffe277bcb
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-18 09:26:15 +01:00
Stefan Agner
e1c1f052dc
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-18 09:25:55 +01:00
Stefan Agner
6d5c41c682
Bump version 5.8 and deployment to production 2020-12-13 11:27:24 +01:00
Stefan Agner
9e78409db8
Upload ova (Open Virtualization Appliance) image as well 2020-12-13 11:25:07 +01:00
Stefan Agner
f649995a08
Set OS pretty name to Home Assistant OS 2020-12-13 11:25:07 +01:00
Stefan Agner
6bbf0b382c
Bump Linux kernel to 5.4.83/5.9.14 (#1083)
* Odroid: Update kernel 5.9.14

* Linux: Update kernel 5.4.83
2020-12-13 11:24:31 +01:00
Stefan Agner
abfe9da03e
Bump version 5.7 and deployment to staging 2020-12-10 22:27:53 +01:00
Stefan Agner
81275e7189
Merge branch 'dev'
Prepare release-candidate
2020-12-10 22:23:29 +01:00
Stefan Agner
9b81e50e19
Linux: Update kernel 5.4.82 2020-12-10 21:55:00 +01:00
Stefan Agner
22a7f43875
Merge pull request #1034 from home-assistant/dev
Build fixes for Pre-Release 5.6
2020-11-28 19:29:05 +01:00
Stefan Agner
fa88a04722
Merge pull request #1033 from home-assistant/dev
Pre-Release 5.6
2020-11-28 16:26:24 +01:00
Stefan Agner
a48888a2df
Merge pull request #980 from home-assistant/dev
Pre-Release 5.5
2020-11-10 22:53:32 +01:00
Pascal Vizeli
c152fdeba0
Merge pull request #924 from home-assistant/dev
Release 5.4
2020-10-22 17:07:07 +02:00
Pascal Vizeli
5583a16219
Merge pull request #893 from home-assistant/dev
Release 5.3
2020-10-11 19:37:28 +02:00
Stefan Agner
639cd41ccf 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-12 15:30:34 +00:00
Pascal Vizeli
9b3e5357c5 Revert "Use Microsoft Basic Data instead of Microsoft Reserved Partition (#847)" (#852)
This reverts commit 31bb38ffd48c5a0edfeb4691522292f81c311cf4.
2020-09-07 09:22:23 +00:00
Pascal Vizeli
d204cbda7f
Merge pull request #851 from home-assistant/dev
Release 5.2
2020-09-06 22:28:36 +02:00
Pascal Vizeli
7b14ed775b Fix RPi4 with buildroot v2020.02.4 (#815) 2020-08-08 08:25:55 +00:00
Pascal Vizeli
1be8e44cde
Merge pull request #814 from home-assistant/dev
Release 5.1
2020-08-06 21:22:21 +02:00
Pascal Vizeli
3329912511
Merge pull request #783 from home-assistant/dev
Release 5.0 dev
2020-07-24 12:26:22 +02:00
Pascal Vizeli
3c469e6f27
Merge pull request #653 from home-assistant/dev
Release 4.6 RC1
2020-05-06 11:50:29 +02:00
Pascal Vizeli
bbbaff117a
Merge pull request #644 from home-assistant/dev
Beta 4.5
2020-04-29 12:42:26 +02:00
Pascal Vizeli
6c58a94a4d
Merge pull request #604 from home-assistant/dev
Release 4.4
2020-03-07 14:08:11 +01:00
Pascal Vizeli
2b89de39e3
Merge pull request #589 from home-assistant/dev
Release 4.3
2020-02-18 13:25:14 +01:00
Pascal Vizeli
1ca4275698
Merge pull request #573 from home-assistant/dev
Release 4.2
2020-02-06 18:56:35 +01:00
Pascal Vizeli
647a461a74
Merge pull request #567 from home-assistant/dev
Release 4.1
2020-02-05 16:58:01 +01:00
12745 changed files with 507118 additions and 35585 deletions

View File

@ -1,3 +1,7 @@
# Ignore everything except what we really need
*
!scripts/
# We don't need this folder because we map the hole folder
buildroot/
buildroot-external/
buildroot-patches/
# Ignore too
release/

54
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,54 @@
<!-- 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/operating-system/releases
- Do not report issues for integrations here, please refer to https://github.com/home-assistant/core/issues
- Do not report issues for Add-Ons here, please refer to
Official Add-ons: https://github.com/home-assistant/addons/issues
Home Assistant Community Add-ons: https://github.com/hassio-addons/repository
- 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 using blocks with three backticks. Do not delete text from this template!
- Please add modifications to boot files, e.g. if you are using Raspberry Pi and did modifications in config.txt.
-->
**Hardware Environment**
<!--
Describe the Homme Assistant image you are using and the hardare environemnt
-->
- [ ] Raspberry Pi [1/2/3/4]
- [ ] ODROID [C2/C4/N2(+)/XU4]
- [ ] ASUS Tinker [S]
- [ ] Intel NUC (or compatible)
- [ ] OVA (Open Virtualization Applicance, on Intel NUC or any other hardware, please add the Hypervisor you are using)
**Home Assistant OS release:**
- [ ] Fresh installation of release x.y
- [ ] Updated from version x.y
- Additional information (if accessible):
<!--
- Home Assistant Frontend -> Configuration -> Info (use the copy button in the System Health block)
- Or use this command: `ha info`
-->
**Supervisor logs:**
<!--
- Home Assistant Frontend -> Supervisor -> System (Log Provider Supervisor)
- Or use this command: ha su logs
-->
**Journal logs:**
<!--
- Enable SSH on OS level and login, then use `journalctl`
-->
**Kernel logs:**
<!--
- use this command: dmesg
- Enable SSH on OS level and login, then use `dmesg`.
-->
**Description of problem:**
<!--
- Is the problem reproducible?
- Has this been working before (is this a regression?)
- Has there been attempt to rule out harware issues? (different SD card etc.)
-->

View File

@ -1,126 +0,0 @@
name: Report an issue with Home Assistant Operating System
description: Report an issue related to the Home Assistant Operating System.
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?
default: 0
options:
- generic-x86-64 (Generic UEFI capable x86-64 systems)
- generic-aarch64 (Generic UEFI capable aarch64 systems)
- khadas-vim3 (Khadas VIM3)
- odroid-c2 (Hardkernel ODROID-C2)
- odroid-c4 (Hardkernel ODROID-C4)
- odroid-m1 (Hardkernel ODROID-M1)
- odroid-m1s (Hardkernel ODROID-M1S)
- 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)
- rpi5-64 (Raspberry Pi 5 64-bit OS)
- tinker (ASUS Tinker Board/Tinker Board S)
- yellow (Home Assistant Yellow)
- green (Home Assistant Green)
description: >
Can be found in [Settings -> System -> Repairs -> System Information](https://my.home-assistant.io/redirect/system_health/). It is listed as the `Board` value.
[![Open your Home Assistant instance and show health information about your system.](https://my.home-assistant.io/badges/system_health.svg)](https://my.home-assistant.io/redirect/system_health/)
- type: input
validations:
required: true
attributes:
label: What version of Home Assistant Operating System is installed?
placeholder: "6.6"
description: >
Can be found in [Settings -> System -> Repairs -> System Information (top right menu)](https://my.home-assistant.io/redirect/system_health/). It is listed as the `Host Operating System` value.
- type: dropdown
validations:
required: true
attributes:
label: Did the problem occur after upgrading the Operating System?
default: 0
options:
- "No"
- "Yes"
- type: textarea
validations:
required: true
attributes:
label: Hardware details
description: >
Provide details about the hardware used for your install.
This is especially important for bare-metal x86 installations.
If you have any USB devices attached, please list them here.
For VMs, include the hypervisor type and version.
- type: textarea
validations:
required: true
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 in [Settings -> System -> Logs](https://my.home-assistant.io/redirect/logs/?provider=supervisor)
then choose `Supervisor` in the top right. Alternatively enter `ha supervisor logs` in the Home Assistant CLI.
[![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/logs/?provider=supervisor)
render: txt
- type: textarea
validations:
required: true
attributes:
label: Anything in the Host logs that might be useful for us?
description: >
Host Logs can be found in [Settings -> System -> Logs](https://my.home-assistant.io/redirect/logs/?provider=host)
then choose `Host` in the top right. Alternatively enter `ha host logs` in the Home Assistant CLI.
render: txt
- type: textarea
attributes:
label: System information
description: >
**Optional** Copy the full System Health in this text area.
System information can be found in [Settings -> System -> Repairs -> System Information (top right menu)](https://my.home-assistant.io/redirect/system_health/),
Click the copy button at the bottom of the pop-up and paste it here.
[![Open your Home Assistant instance and show health information about your system.](https://my.home-assistant.io/badges/system_health.svg)](https://my.home-assistant.io/redirect/system_health/)
- 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.

View File

@ -1,21 +0,0 @@
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/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://github.com/orgs/home-assistant/discussions
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!

View File

@ -1,97 +0,0 @@
name: 'Bump RPi Imager OS version'
description: 'Bump version of Home Assistant OS in RPi Imager'
inputs:
version:
required: true
description: "Version of Home Assistant OS to bump to."
release-date:
required: true
description: "Release date as ISO 8601 date string."
runs:
using: "composite"
steps:
- shell: bash
id: validate-input
env:
INPUTS_DATE: ${{ inputs.release-date }}
run: |
if [[ -z "$INPUTS_DATE" ]] || [[ ! "$INPUTS_DATE" =~ ^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$ ]]; then
echo "::error::Argument 'release-date' must be an ISO 8601 date string."
exit 1
else
echo "date=$(date --date=${INPUTS_DATE} +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
fi
- shell: bash
run: git clone --depth 1 https://github.com/home-assistant/version.git /tmp/version
- shell: bash
env:
INPUTS_VERSION: ${{ inputs.version }}
run: |
function bump_entry() {
json=$1
version=$2
release_date=$3
image_id=$4
image_name=$5
url="https://github.com/home-assistant/operating-system/releases/download/${version}/haos_${image_id}-${version}.img.xz"
temp_image=$(mktemp --suffix=.img.xz)
temp_out=$(mktemp)
curl -fsL -o "$temp_image" "$url"
image_download_size=$(stat --printf="%s" "$temp_image")
image_download_sha256=$(sha256sum "$temp_image" | awk '{print $1}')
unxz "$temp_image"
temp_unpacked="${temp_image%.*}"
extract_size=$(stat --printf="%s" "$temp_unpacked")
extract_sha256=$(sha256sum "$temp_unpacked" | awk '{print $1}')
entry_name="Home Assistant OS ${version} (${image_name})"
jq '
. as $data
| $data
| .os_list = [
.os_list[]
| if .name | test("Home Assistant OS .* \\(" + $image_name + "\\)") then
.name = "Home Assistant OS " + $version + " (" + $image_name + ")"
| .url = $url
| .extract_size = ($extract_size | tonumber)
| .extract_sha256 = $extract_sha256
| .release_date = $release_date
| .image_download_size = ($image_download_size | tonumber)
| .image_download_sha256 = $image_download_sha256
else .
end
]' \
--arg version "$version" \
--arg image_name "$image_name" \
--arg entry_name "$entry_name" \
--arg release_date "$release_date" \
--arg url "$url" \
--arg image_download_size "$image_download_size" \
--arg image_download_sha256 "$image_download_sha256" \
--arg extract_size "$extract_size" \
--arg extract_sha256 "$extract_sha256" \
"$json" > "$temp_out"
mv "$temp_out" "$json"
rm -rf "$temp_unpacked" "$temp_out"
}
bump_entry /tmp/version/rpi-imager-haos.json "$INPUTS_VERSION" "${{ steps.validate-input.outputs.date }}" "rpi3-64" "RPi 3"
bump_entry /tmp/version/rpi-imager-haos.json "$INPUTS_VERSION" "${{ steps.validate-input.outputs.date }}" "rpi4-64" "RPi 4/400"
bump_entry /tmp/version/rpi-imager-haos.json "$INPUTS_VERSION" "${{ steps.validate-input.outputs.date }}" "rpi5-64" "RPi 5"
bump_entry /tmp/version/rpi-imager-haos.json "$INPUTS_VERSION" "${{ steps.validate-input.outputs.date }}" "yellow" "Yellow"
- shell: bash
env:
INPUTS_VERSION: ${{ inputs.version }}
run: |
cd /tmp/version
git commit -am "Bump Home Assistant OS to ${INPUTS_VERSION} for RPi Imager"
git push
- shell: bash
run: rm -rf /tmp/version

View File

@ -1,22 +0,0 @@
name: "Run command in HAOS build container"
inputs:
image:
description: "HAOS builder image to use"
required: true
command:
description: "Command to run in the container"
required: true
runs:
using: 'composite'
steps:
- name: "Run command in HAOS build container"
shell: bash
run: |
docker run --rm --privileged \
-e BUILDER_UID="$(id -u)" \
-e BUILDER_GID="$(id -g)" \
-v "${GITHUB_WORKSPACE}:/build" \
-v "/mnt/cache:/cache" \
-v "/mnt/output:/build/output" \
${{ inputs.image }} \
${{ inputs.command }}

View File

@ -1,6 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View File

@ -1,59 +0,0 @@
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
close-reason: not planned
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
close-reason: not planned
frontend-issue:
comment: >
:wave: @{issue-author}, thanks for reporting an issue!
It looks like this issue is related to Home Assistant Frontend. Please
check the [Home Assistant Frontend](https://github.com/home-assistant/frontend/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
close-reason: not planned
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
close-reason: not planned
new-feature:
comment: >
:wave: @{issue-author}, thanks for your input!
We use this issue tracker to track issues of currently supported features.
Your request appears to request a new feature. We track potential new
features in the [Feature Request section of our Community Forum](https://community.home-assistant.io/c/feature-requests/13).
Please check if someone already requested a similar feature, or create
a new feature request with the "haos" tag in that forum. Thank you!
close: true
close-reason: not planned

View File

@ -1,40 +1,19 @@
name-template: Home Assistant OS $RESOLVED_VERSION
tag-template: $RESOLVED_VERSION
version-template: "$MAJOR.$MINOR"
categories:
- title: 'Home Assistant Operating System'
label: 'os'
- title: 'Raspberry Pi'
label: 'board/raspberrypi'
- title: 'Home Assistant Yellow'
label: 'board/yellow'
- title: 'Home Assistant Green'
label: 'board/green'
- title: 'Open Virtual Appliance'
label: 'board/ova'
- 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'
- title: 'Documentation'
label: 'documentation'
- title: 'Build System'
label: 'build'
- title: 'Dependencies'
label: 'dependencies'
filter-by-commitish: true
- title: 'Raspberry Pi'
label: 'board/raspberrypi'
- title: 'Open Virtual Appliance'
label: 'board/ova'
- title: 'Intel NUC'
label: 'board/intel-nuc'
- title: 'Hardkernel ODROID'
label: 'board/hardkernel'
- title: 'ASUS Tinker'
label: 'board/tinker'
template: |
## Changes
$CHANGES
version-resolver:
major:
labels:
- 'major'
default: minor

17
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,17 @@
# 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

View File

@ -1,102 +0,0 @@
name: Update artifacts index
on:
# Manual run for specified version
workflow_dispatch:
inputs:
version:
description: Version of HAOS to build index for
required: true
type: string
# Called by other workflows (e.g. build.yaml)
workflow_call:
inputs:
version:
description: Version of HAOS to build index for
required: true
type: string
secrets:
R2_OS_ARTIFACTS_ID:
required: true
R2_OS_ARTIFACTS_KEY:
required: true
R2_OS_ARTIFACTS_BUCKET:
required: true
R2_OS_ARTIFACTS_ENDPOINT:
required: true
CF_ZONE:
required: true
CF_PURGE_TOKEN:
required: true
env:
PYTHON_VERSION: "3.13"
jobs:
build-index:
name: Build Home Assistant OS artifacts index
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Python version ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install AWS CLI
run: pip install 'awscli<1.37.0'
- name: Create build index
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_OS_ARTIFACTS_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_OS_ARTIFACTS_KEY }}
run: |
aws s3api list-objects-v2 \
--bucket "${{ secrets.R2_OS_ARTIFACTS_BUCKET }}" \
--endpoint-url "${{ secrets.R2_OS_ARTIFACTS_ENDPOINT }}" \
--prefix "${{ inputs.version }}/" \
--query 'Contents[].Key' | jq 'map(split("/")[1]) | sort' > "${{ inputs.version }}.json"
aws s3 cp \
"${{ inputs.version }}.json" \
s3://${{ secrets.R2_OS_ARTIFACTS_BUCKET }}/indexes/ \
--endpoint-url "${{ secrets.R2_OS_ARTIFACTS_ENDPOINT }}"
- name: Regenerate artifacts index
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_OS_ARTIFACTS_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_OS_ARTIFACTS_KEY }}
run: |
aws s3api list-objects-v2 \
--bucket "${{ secrets.R2_OS_ARTIFACTS_BUCKET }}" \
--endpoint-url "${{ secrets.R2_OS_ARTIFACTS_ENDPOINT }}" \
--prefix "indexes/" \
--query 'Contents[].Key' | jq 'map(capture("indexes/(?<version>[[:digit:]].+).json").version) | sort' > .os-artifacts/index.json
aws s3 sync \
.os-artifacts/ \
s3://${{ secrets.R2_OS_ARTIFACTS_BUCKET }}/ \
--endpoint-url "${{ secrets.R2_OS_ARTIFACTS_ENDPOINT }}" \
- name: Flush CloudFlare cache
run: |
# Create purge list of all artifacts
jq -r '. | map("https://os-artifacts.home-assistant.io/${{ inputs.version }}/" + .) | join("\n")' < "${{ inputs.version }}.json" > purge_list
# Add indexes to purge list too
echo "https://os-artifacts.home-assistant.io/indexes/${{ inputs.version }}.json" >> purge_list
echo "https://os-artifacts.home-assistant.io/index.html" >> purge_list
echo "https://os-artifacts.home-assistant.io/index.json" >> purge_list
# Split to chunks of 30 files (limit of CF API)
split -d -l30 purge_list purge_list_chunked
# Convert chunked lists to JSON arrays and call CF purge API
for f in purge_list_chunked*; do
files=$(jq -R -s 'split("\n")[:-1]' < "$f")
curl --silent --show-error --fail -X POST \
"https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache" \
-H "Authorization: Bearer ${{ secrets.CF_PURGE_TOKEN }}" \
-H "Content-Type: application/json" \
--data "{\"files\": ${files}}"
done

View File

@ -1,475 +0,0 @@
# Home Assistant Operating System build workflow
name: OS build
on:
release:
types: [published]
workflow_dispatch:
inputs:
boards:
description: 'List of boards to build (comma separated identifiers)'
required: false
type: string
publish:
description: 'Publish build artifacts to R2 (not applicable to forks)'
required: true
type: boolean
default: true
hassio_channel:
description: 'Release channel to use (default: stable for GH releases, dev otherwise)'
type: choice
required: true
default: default
options:
- default
- stable
- beta
- dev
env:
PYTHON_VERSION: "3.13"
jobs:
prepare:
name: Prepare build
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: read
packages: write
outputs:
version_dev: ${{ steps.version_dev.outputs.version_dev }}
version_main: ${{ steps.version.outputs.version_main }}
version_full: ${{ steps.version.outputs.version_full }}
channel: ${{ steps.channel.outputs.channel }}
hassio_channel_option: ${{ steps.channel.outputs.hassio_channel_option }}
matrix: ${{ steps.generate_matrix.outputs.result }}
build_container_image: ghcr.io/${{ github.repository_owner }}/haos-builder@${{ steps.build_haos_builder.outputs.digest }}
publish_build: ${{ steps.check_publish.outputs.publish_build }}
self_signed_cert: ${{ steps.generate_signing_key.outputs.self_signed_cert }}
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check if build should be published
id: check_publish
env:
PUBLISH_FLAG: ${{ inputs.publish }}
run: |
if [ "${{ github.repository }}" == "home-assistant/operating-system" ]; then
if [ "${PUBLISH_FLAG}" != "true" ] && [ "${{ github.event_name }}" != "release" ]; then
echo "publish_build=false" >> "$GITHUB_OUTPUT"
else
echo "publish_build=true" >> "$GITHUB_OUTPUT"
fi
else
echo "publish_build=false" >> "$GITHUB_OUTPUT"
fi
- name: Generate development version
shell: bash
id: version_dev
if: ${{ github.event_name != 'release' }}
env:
PUBLISH_BUILD: ${{ steps.check_publish.outputs.publish_build }}
run: |
version_dev="dev$(date --utc +'%Y%m%d')"
if [ "${{ env.PUBLISH_BUILD }}" != "true" ]; then
version_dev="dev$(date +%s)"
fi
echo "Development version \"${version_dev}\""
echo "version_dev=${version_dev}" >> $GITHUB_OUTPUT
- name: Set version suffix
if: ${{ github.event_name != 'release' }}
env:
VERSION_DEV: ${{ steps.version_dev.outputs.version_dev }}
run: |
sed -i -E "s/(^VERSION_SUFFIX=\").*(\"$)/\1${VERSION_DEV}\2/" buildroot-external/meta
- name: Get version
id: version
run: |
. ${GITHUB_WORKSPACE}/buildroot-external/meta
echo "version_main=${VERSION_MAJOR}.${VERSION_MINOR}" >> $GITHUB_OUTPUT
if [ -z "${VERSION_SUFFIX}" ]; then
version_full="${VERSION_MAJOR}.${VERSION_MINOR}"
else
version_full="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_SUFFIX}"
fi
echo "version_full=${version_full}" >> $GITHUB_OUTPUT
echo "Full version number of this release is \"${version_full}\"."
- name: Validate version
id: version_check
if: ${{ github.event_name == 'release' }}
run: |
if [ "${{ steps.version.outputs.version_full }}" != "${{ github.event.release.tag_name }}" ]; then
echo "Version number in Buildroot metadata does not match tag (${{ steps.version.outputs.version_full }} vs ${{ github.event.release.tag_name }})."
exit 1
fi
- name: Get channel
id: channel
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
echo "channel=beta" >> "$GITHUB_OUTPUT"
else
echo "channel=stable" >> "$GITHUB_OUTPUT"
fi
else
echo "channel=dev" >> "$GITHUB_OUTPUT"
fi
if [[ "${{ inputs.hassio_channel }}" == "default" ]]; then
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "hassio_channel_option=BR2_PACKAGE_HASSIO_CHANNEL_STABLE" >> "$GITHUB_OUTPUT"
else
echo "hassio_channel_option=BR2_PACKAGE_HASSIO_CHANNEL_DEV" >> "$GITHUB_OUTPUT"
fi
else
if [[ "${{ inputs.hassio_channel }}" == "stable" ]]; then
echo "hassio_channel_option=BR2_PACKAGE_HASSIO_CHANNEL_STABLE" >> "$GITHUB_OUTPUT"
elif [[ "${{ inputs.hassio_channel }}" == "beta" ]]; then
echo "hassio_channel_option=BR2_PACKAGE_HASSIO_CHANNEL_BETA" >> "$GITHUB_OUTPUT"
elif [[ "${{ inputs.hassio_channel }}" == "dev" ]]; then
echo "hassio_channel_option=BR2_PACKAGE_HASSIO_CHANNEL_DEV" >> "$GITHUB_OUTPUT"
fi
fi
- name: Create build matrix
uses: actions/github-script@v7
id: generate_matrix
with:
script: |
const boards = require('./.github/workflows/matrix.json')
if ("${{ github.event_name }}" == "release") {
return { "board": boards }
}
const boardFilter = "${{ github.event.inputs.boards }}"
if (boardFilter == "") {
console.log("Run full build for all boards")
return { "board": boards }
} else {
console.log("Run partial build")
const boardSet = new Set(boardFilter.split(","))
const buildBoards = boards.filter(b => boardSet.has(b.id))
return { "board": buildBoards }
}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Log in to the GitHub container registry
uses: docker/login-action@v3.4.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v6.18.0
id: build_haos_builder
with:
context: .
file: Dockerfile
tags: ghcr.io/${{ github.repository_owner }}/haos-builder
cache-from: ghcr.io/${{ github.repository_owner }}/haos-builder:cache-${{ steps.version.outputs.version_main }}
cache-to: ghcr.io/${{ github.repository_owner }}/haos-builder:cache-${{ steps.version.outputs.version_main }}
push: true
- name: Generate self-signed certificate
id: generate_signing_key
env:
RAUC_CERTIFICATE: ${{ secrets.RAUC_CERTIFICATE }}
RAUC_PRIVATE_KEY: ${{ secrets.RAUC_PRIVATE_KEY }}
if: env.RAUC_CERTIFICATE == '' || env.RAUC_PRIVATE_KEY == ''
run: |
echo "::warning:: RAUC certificate or key is missing in the repository secrets. Building with a public self-signed certificate!"
buildroot-external/scripts/generate-signing-key.sh cert.pem key.pem
echo "self_signed_cert=true" >> $GITHUB_OUTPUT
- name: Create signing key
uses: actions/upload-artifact@v4
if: steps.generate_signing_key.outcome == 'success'
with:
name: signing-key
path: |
cert.pem
key.pem
build:
name: Build for ${{ matrix.board.id }}
permissions:
contents: write # for actions/upload-release-asset to upload release asset
needs: prepare
strategy:
fail-fast: ${{ github.event_name == 'release' }}
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
- name: Setup Python version ${{ env.PYTHON_VERSION }}
if: ${{ github.event_name != 'release' }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install AWS CLI
if: ${{ github.event_name != 'release' && needs.prepare.outputs.publish_build == 'true' }}
run: pip install 'awscli<1.37.0'
- name: Set version suffix
if: ${{ github.event_name != 'release' }}
env:
VERSION_DEV: ${{ needs.prepare.outputs.version_dev }}
run: |
sed -i -E "s/(^VERSION_SUFFIX=\").*(\"$)/\1${VERSION_DEV}\2/" buildroot-external/meta
- name: 'Add release PKI certs'
if: ${{ needs.prepare.outputs.self_signed_cert != 'true' }}
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: Get self-signed certificate from the prepare job
if: ${{ needs.prepare.outputs.self_signed_cert == 'true' }}
uses: actions/download-artifact@v4
with:
name: signing-key
- name: Free space on build drive
run: |
# Inspired by https://github.com/easimon/maximize-build-space/blob/v7/action.yml
df -h
sudo rm -rf /usr/local/lib/android/sdk/ndk
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo mkdir /mnt/cache
sudo mkdir /mnt/output
WORKSPACE_OWNER="$(stat -c '%U:%G' "${GITHUB_WORKSPACE}")"
# output directory is symlinked for easier access from workspace
# but for build container it must be mounted as a volume
sudo ln -sf /mnt/output "${GITHUB_WORKSPACE}/output"
sudo chown -R "${WORKSPACE_OWNER}" /mnt/cache
sudo chown -R "${WORKSPACE_OWNER}" /mnt/output
df -h
- name: "Restore cache: object files"
uses: actions/cache/restore@v4
with:
path: /mnt/cache/cc
key: haos-cc-${{ matrix.board.id }}
- name: Generate build config
uses: "./.github/actions/haos-builder-command"
with:
image: ${{ needs.prepare.outputs.build_container_image }}
command: make ${{ matrix.board.defconfig }}_defconfig
- name: Override release channel
if: ${{ needs.prepare.outputs.hassio_channel_option != 'BR2_PACKAGE_HASSIO_CHANNEL_STABLE' }}
uses: "./.github/actions/haos-builder-command"
with:
image: ${{ needs.prepare.outputs.build_container_image }}
command: |
bash -c 'echo "${{ needs.prepare.outputs.hassio_channel_option }}=y" >> /build/output/.config && make olddefconfig'
- name: Build
uses: "./.github/actions/haos-builder-command"
with:
image: ${{ needs.prepare.outputs.build_container_image }}
command: make
- name: Check Linux config
uses: "./.github/actions/haos-builder-command"
with:
image: ${{ needs.prepare.outputs.build_container_image }}
command: |
make BR2_CHECK_DOTCONFIG_OPTS="--github-format --strip-path-prefix=/build/" linux-check-dotconfig
- name: Upload artifacts
if: ${{ github.event_name != 'release' && needs.prepare.outputs.publish_build == 'true' }}
working-directory: output/images/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_OS_ARTIFACTS_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_OS_ARTIFACTS_KEY }}
run: |
aws s3 sync \
./ \
s3://${{ secrets.R2_OS_ARTIFACTS_BUCKET }}/${{ needs.prepare.outputs.version_full }}/ \
--exclude "*" \
--include "haos_*" \
--endpoint-url ${{ secrets.R2_OS_ARTIFACTS_ENDPOINT }}
- name: Upload release assets
if: ${{ github.event_name == 'release' }}
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: output/images/haos_*
- name: Print cache stats
run: |
echo "Cache size: $(du -sh /mnt/cache/cc)"
echo "Files total: $(find /mnt/cache/cc -mindepth 1 -type f | wc -l)"
echo "Old files to remove: $(find /mnt/cache/cc -mindepth 1 -type f -not -anewer output/Makefile | wc -l)"
find /mnt/cache/cc -mindepth 1 -type f -not -anewer output/Makefile -delete
echo "Cache size after pruning: $(du -sh /mnt/cache/cc)"
- name: "Save cache: object files"
if: github.ref == 'refs/heads/dev'
uses: actions/cache/save@v4
with:
path: /mnt/cache/cc
key: haos-cc-${{ matrix.board.id }}-${{ github.run_id }}
- name: Generate build summary
run: |
echo "# ${{ matrix.board.id }} build summary" >> $GITHUB_STEP_SUMMARY
echo "## Artifacts" >> $GITHUB_STEP_SUMMARY
echo "| File | Size (bytes) | Size (formatted) |" >> $GITHUB_STEP_SUMMARY
echo "|:-|:-|:-|" >> $GITHUB_STEP_SUMMARY
for f in output/images/haos_*; do
echo "| $(basename $f) | $(du -b $f | cut -f1) | $(du -bh $f | cut -f1) |" >> $GITHUB_STEP_SUMMARY
done
echo "## Partitions" >> $GITHUB_STEP_SUMMARY
echo "| File | Size (bytes) | Size (formatted) |" >> $GITHUB_STEP_SUMMARY
echo "|:-|:-|:-|" >> $GITHUB_STEP_SUMMARY
for f in boot.vfat kernel.img rootfs.erofs overlay.ext4 data.ext4; do
echo "| ${f} | $(du -b output/images/$f | cut -f1) | $(du -bh output/images/$f | cut -f1) |" >> $GITHUB_STEP_SUMMARY
done
- name: Upload OS image artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'release' && needs.prepare.outputs.publish_build != 'true' && matrix.board.id != 'ova' }}
with:
name: haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.img.xz
path: |
output/images/haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.img.xz
- name: Upload RAUC bundle artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'release' && needs.prepare.outputs.publish_build != 'true' }}
with:
name: haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.raucb
path: |
output/images/haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.raucb
- name: Upload Open Virtualization Format (OVA) artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'release' && needs.prepare.outputs.publish_build != 'true' && matrix.board.id == 'ova' }}
with:
name: haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.ova
path: |
output/images/haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.ova
- name: Upload QEMU disk image artifact
uses: actions/upload-artifact@v4
# Create artifact for ova every time - it's used by the called tests workflow
if: ${{ matrix.board.id == 'ova' || (github.event_name != 'release' && needs.prepare.outputs.publish_build != 'true' && matrix.board.id == 'generic-aarch64') }}
with:
name: haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.qcow2.xz
path: |
output/images/haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.qcow2.xz
- name: Upload VMware Virtual Machine Disk (VMDK) artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'release' && needs.prepare.outputs.publish_build != 'true' && (matrix.board.id == 'generic-aarch64' || matrix.board.id == 'ova') }}
with:
name: haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.vmdk.zip
path: |
output/images/haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.vmdk.zip
- name: Upload VirtualBox Virtual Disk Image (VDI) artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'release' && needs.prepare.outputs.publish_build != 'true' && matrix.board.id == 'ova' }}
with:
name: haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.vdi.zip
path: |
output/images/haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.vdi.zip
- name: Upload Virtual Hard Disk v2 (VHDX) artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'release' && needs.prepare.outputs.publish_build != 'true' && matrix.board.id == 'ova' }}
with:
name: haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.vhdx.zip
path: |
output/images/haos_${{ matrix.board.id }}-${{ needs.prepare.outputs.version_full }}.vhdx.zip
test:
name: Test OS image
needs: [ build, prepare ]
uses: ./.github/workflows/test.yaml
with:
version: ${{ needs.prepare.outputs.version_full }}
update_index:
name: Update artifacts index
if: ${{ github.event_name != 'release' && needs.prepare.outputs.publish_build == 'true' }}
needs: [ build, prepare ]
uses: home-assistant/operating-system/.github/workflows/artifacts-index.yaml@dev
with:
version: ${{ needs.prepare.outputs.version_full }}
secrets:
R2_OS_ARTIFACTS_ID: ${{ secrets.R2_OS_ARTIFACTS_ID }}
R2_OS_ARTIFACTS_KEY: ${{ secrets.R2_OS_ARTIFACTS_KEY }}
R2_OS_ARTIFACTS_BUCKET: ${{ secrets.R2_OS_ARTIFACTS_BUCKET }}
R2_OS_ARTIFACTS_ENDPOINT: ${{ secrets.R2_OS_ARTIFACTS_ENDPOINT }}
CF_ZONE: ${{ secrets.CF_ZONE }}
CF_PURGE_TOKEN: ${{ secrets.CF_PURGE_TOKEN }}
bump_version:
name: Bump ${{ needs.prepare.outputs.channel }} channel version
if: ${{ github.repository == 'home-assistant/operating-system' && needs.prepare.outputs.publish_build == 'true' }}
environment: ${{ needs.prepare.outputs.channel }}
needs: [ build, prepare ]
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
persist-credentials: false
- 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 ${{ needs.prepare.outputs.channel }} channel version
uses: home-assistant/actions/helpers/version-push@master
with:
key: "hassos[]"
key-description: "Home Assistant OS"
version: ${{ needs.prepare.outputs.version_full }}
channel: ${{ needs.prepare.outputs.channel }}
- name: Bump Home Assistant OS beta channel version on stable release
if: ${{ needs.prepare.outputs.channel == 'stable' }}
uses: home-assistant/actions/helpers/version-push@master
with:
key: "hassos[]"
key-description: "Home Assistant OS"
version: ${{ needs.prepare.outputs.version_full }}
channel: beta
- name: Bump stable Home Assistant version for RPi Imager
if: ${{ github.event_name == 'release' && needs.prepare.outputs.channel == 'stable' }}
uses: "./.github/actions/bump-rpi-imager-version"
with:
version: ${{ needs.prepare.outputs.version_full }}
release-date: ${{ github.event.release.published_at }}

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

@ -0,0 +1,89 @@
# Home Assistant Operating System build workflow
name: Development build
on:
workflow_dispatch:
jobs:
version:
name: Generate version
runs-on: [ "ubuntu-20.04" ]
outputs:
version_main: ${{ steps.version_main.outputs.version_main }}
version_dev: ${{ steps.version_dev.outputs.version_dev }}
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}"
- 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}"
build:
name: Release build for ${{ matrix.board.name }}
needs: version
strategy:
fail-fast: false
matrix:
board:
- {"name": "ova", "output": "ova", "runner": "x86-64-runner"}
- {"name": "intel_nuc", "output": "intel-nuc", "runner": "x86-64-runner"}
- {"name": "odroid_c2", "output": "odroid-c2", "runner": "aarch64-runner"}
- {"name": "odroid_c4", "output": "odroid-c4", "runner": "aarch64-runner"}
- {"name": "odroid_n2", "output": "odroid-n2", "runner": "aarch64-runner"}
- {"name": "odroid_xu4", "output": "odroid-xu4" , "runner": "aarch64-runner"}
- {"name": "rpi", "output": "rpi", "runner": "arm-runner"}
- {"name": "rpi0_w", "output": "rpi0-w", "runner": "arm-runner"}
- {"name": "rpi2", "output": "rpi2", "runner": "arm-runner"}
- {"name": "rpi3", "output": "rpi3", "runner": "arm-runner"}
- {"name": "rpi3_64", "output": "rpi3-64", "runner": "aarch64-runner"}
- {"name": "rpi4", "output": "rpi4", "runner": "arm-runner"}
- {"name": "rpi4_64", "output": "rpi4-64", "runner": "aarch64-runner"}
- {"name": "tinker", "output": "tinker", "runner": "arm-runner"}
runs-on: ${{ matrix.board.runner }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- 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" \
haos-builder make VERSION_DEV=${{ needs.version.outputs.version_dev }} ${{ matrix.board.name }}
- name: Upload images
uses: appleboy/scp-action@master
with:
host: ${{ secrets.DEV_HOST }}
username: ${{ secrets.DEV_USERNAME }}
port: ${{ secrets.DEV_PORT }}
key: ${{ secrets.DEV_SCP_KEY }}
source: "release/*"
target: ${{ secrets.DEV_TARGET_PATH }}/${{ needs.version.outputs.version_main }}.${{ needs.version.outputs.version_dev }}/
strip_components: 1

View File

@ -1,17 +0,0 @@
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@v4.0.1

View File

@ -1,25 +0,0 @@
name: Lock
on:
schedule:
- cron: "45 5 * * *"
permissions:
discussions: write
issues: write
pull-requests: write
jobs:
lock:
if: github.repository_owner == 'home-assistant'
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v5.0.1
with:
github-token: ${{ github.token }}
issue-inactive-days: "30"
exclude-issue-created-before: "2025-01-01T00:00:00Z"
issue-lock-reason: ""
pr-inactive-days: "7"
exclude-pr-created-before: "2025-01-01T00:00:00Z"
pr-lock-reason: ""

View File

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

View File

@ -6,29 +6,15 @@ on: [pull_request]
jobs:
linters:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- name: Install additional dependencies
run: |
sudo apt-get update
sudo apt-get -y install \
python3-flake8
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true
uses: actions/checkout@v1
- name: Check Dockerfile
uses: brpaz/hadolint-action@v1.5.0
uses: brpaz/hadolint-action@v1.1.0
with:
dockerfile: Dockerfile
- name: Check shell scripts
uses: ludeeus/action-shellcheck@2.0.0
uses: ludeeus/action-shellcheck@1.0.0
with:
ignore_paths: buildroot
- name: Check buildroot-external packages
run: |
buildroot/utils/check-package --exclude PackageHeader --exclude Upstream --br2-external buildroot-external/package/*/*
ignore: "buildroot"

View File

@ -4,15 +4,12 @@ on:
push:
branches:
- dev
- rel-*
- rel-4
jobs:
update_release_draft:
permissions:
contents: write # for release-drafter/release-drafter to create a github release
pull-requests: read # for release-drafter/release-drafter to read PR content and labels
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

@ -0,0 +1,169 @@
# 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 }}
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)
if [ "${major}.${build}" != "${{ github.event.release.tag_name }}" ]; then
echo "Version number in Buildroot metadata is does not match tag (${major}.${build} vs ${{ github.event.release.tag_name }})."
exit 1
fi
echo "::set-output name=version::${major}.${build}"
build:
name: Release build for ${{ matrix.board.name }}
needs: validate_release
strategy:
matrix:
board:
- {"name": "ova", "output": "ova", "runner": "x86-64-runner"}
- {"name": "intel_nuc", "output": "intel-nuc", "runner": "x86-64-runner"}
- {"name": "odroid_c2", "output": "odroid-c2", "runner": "aarch64-runner"}
- {"name": "odroid_c4", "output": "odroid-c4", "runner": "aarch64-runner"}
- {"name": "odroid_n2", "output": "odroid-n2", "runner": "aarch64-runner"}
- {"name": "odroid_xu4", "output": "odroid-xu4" , "runner": "aarch64-runner"}
- {"name": "rpi", "output": "rpi", "runner": "arm-runner"}
- {"name": "rpi0_w", "output": "rpi0-w", "runner": "arm-runner"}
- {"name": "rpi2", "output": "rpi2", "runner": "arm-runner"}
- {"name": "rpi3", "output": "rpi3", "runner": "arm-runner"}
- {"name": "rpi3_64", "output": "rpi3-64", "runner": "aarch64-runner"}
- {"name": "rpi4", "output": "rpi4", "runner": "arm-runner"}
- {"name": "rpi4_64", "output": "rpi4-64", "runner": "aarch64-runner"}
- {"name": "tinker", "output": "tinker", "runner": "arm-runner"}
runs-on: ${{ matrix.board.runner }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- 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" \
haos-builder make VERSION_DEV="" ${{ matrix.board.name }}
- name: Upload disk image
if: ${{ matrix.board.name != '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/hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.img.xz
asset_name: hassos_${{ matrix.board.output }}-${{ 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/hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.raucb
asset_name: hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.raucb
asset_content_type: application/octet-stream
- name: Upload ova image
if: ${{ matrix.board.name == '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/hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.ova
asset_name: hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.ova
asset_content_type: application/x-tar
- name: Upload qcow2 image
if: ${{ matrix.board.name == '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/hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.qcow2.xz
asset_name: hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.qcow2.xz
asset_content_type: application/x-xz
- name: Upload vdi image
if: ${{ matrix.board.name == '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/hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.vdi.xz
asset_name: hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.vdi.xz
asset_content_type: application/x-xz
- name: Upload vhdx image
if: ${{ matrix.board.name == '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/hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.vhdx.xz
asset_name: hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.vhdx.xz
asset_content_type: application/x-xz
- name: Upload vmdk image
if: ${{ matrix.board.name == '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/hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.vmdk.xz
asset_name: hassos_${{ matrix.board.output }}-${{ needs.validate_release.outputs.version }}.vmdk.xz
asset_content_type: application/x-xz
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 dev version
uses: home-assistant/actions/helpers/version-push@master
with:
key: "hassos[]"
key-description: "Home Assistant OS"
version: ${{ needs.validate_release.outputs.version }}
channel: "dev"

View File

@ -1,50 +0,0 @@
name: Stale
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "40 5 * * *"
workflow_dispatch:
jobs:
stale:
permissions:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
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@v9.1.0
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.

View File

@ -1,101 +0,0 @@
name: Test HAOS image
run-name: "Test HAOS ${{ inputs.version || format('(OS build #{0})', github.event.workflow_run.run_number) }}"
on:
# Manual test of specified version
workflow_dispatch:
inputs:
version:
description: Version of HAOS to test
required: true
type: string
# Called by other workflows (e.g. build.yaml)
workflow_call:
inputs:
use-artifact:
# Workaround for GH weirdness: https://github.com/actions/runner/discussions/1884
description: Download OS image using actions/download-artifact
required: false
type: boolean
default: true
version:
description: Version of HAOS to test (as used in the name of the qcow2 image artifact)
required: true
type: string
jobs:
test:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
name: Test in QEMU
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y qemu-system-x86 ovmf
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install Python requirements
run:
pip install -r tests/requirements.txt
- name: Download HAOS image
if: ${{ !inputs.use-artifact }}
run: |
curl -sfL -o haos.qcow2.xz https://os-artifacts.home-assistant.io/${{github.event.inputs.version}}/haos_ova-${{github.event.inputs.version}}.qcow2.xz
- name: Get OS image artifact
if: ${{ inputs.use-artifact }}
uses: actions/download-artifact@v4
with:
name: haos_ova-${{ inputs.version }}.qcow2.xz
- name: Extract OS image
run: |
xz -dc haos*.qcow2.xz > tests/haos.qcow2
rm haos*.qcow2.xz
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run tests
run: |
./tests/run_tests.sh --durations=0 --durations-min=5.0
- name: Archive logs
uses: actions/upload-artifact@v4
if: always()
with:
name: logs
path: |
tests/lg_logs/**
- name: Archive JUnit reports
uses: actions/upload-artifact@v4
if: always()
with:
name: junit_reports
path: |
tests/junit_reports/*.xml
- name: Publish test report
uses: mikepenz/action-junit-report@v5
if: always()
with:
report_paths: 'tests/junit_reports/*.xml'
annotate_only: true
detailed_summary: true

9
.gitignore vendored
View File

@ -1,12 +1,3 @@
# OS generated files
.DS_Store
# Build output dirs
/release
output*/
# Certificates
*.pem
# vscode generated files
.vscode*

4
.gitmodules vendored
View File

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

View File

@ -1,82 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Home Assistant OS - development builds</title>
<link rel="shortcut icon" href="https://brands.home-assistant.io/homeassistant/icon.png">
<style>
body {
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
.error {
color: maroon;
}
</style>
</head>
<body>
<h1>Home Assistant OS - development builds</h1>
<select id="os-builds"></select>
<div id="os-builds-list"></div>
<script>
const buildSelect = document.getElementById('os-builds');
const osBuildsList = document.getElementById('os-builds-list');
const fillVersions = async () => {
try {
const response = await fetch('/index.json');
if (!response.ok) {
const p = document.createElement('p');
p.className = "error";
p.textContent = "Could not load version index file.";
osBuildsList.appendChild(p);
return;
}
const items = await response.json();
items.reverse();
items.forEach(buildVersion => {
buildSelect.appendChild(new Option(buildVersion, buildVersion));
});
buildSelect.dispatchEvent(new Event('change'));
} catch (error) {
console.error('Error fetching data:', error);
}
}
buildSelect.addEventListener('change', async function() {
osBuildsList.innerHTML = '';
const buildVersion = this.value;
try {
const response = await fetch(`/indexes/${buildVersion}.json`);
if (!response.ok) {
const p = document.createElement('p');
p.className = "error";
p.textContent = `Could not load index file for version ${buildVersion}.`;
osBuildsList.appendChild(p);
return;
}
const images = await response.json();
const ul = document.createElement('ul');
images.forEach(image => {
const li = document.createElement('li');
const a = document.createElement('a');
a.href =`/${buildVersion}/${image}`;
a.textContent = image;
li.appendChild(a);
ul.appendChild(li);
});
osBuildsList.appendChild(ul);
} catch (error) {
console.error('Error fetching images:', error);
}
});
fillVersions();
</script>
</body>
</html>

View File

@ -1,4 +1,4 @@
FROM debian:bullseye
FROM debian:buster
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@ -12,16 +12,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gpg \
dirmngr \
software-properties-common \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/docker.gpg] \
https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list \
&& 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
RUN apt-get update && apt-get install -y --no-install-recommends \
automake \
bash \
bc \
binutils \
@ -30,27 +28,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
cpio \
file \
git \
graphviz \
help2man \
jq \
make \
ncurses-dev \
openssh-client \
patch \
perl \
pigz \
python3 \
python3-matplotlib \
python-is-python3 \
qemu-utils \
python \
rsync \
skopeo \
sudo \
texinfo \
unzip \
vim \
wget \
zip \
qemu-utils \
openssh-client \
vim \
&& rm -rf /var/lib/apt/lists/*
# Init entry

View File

@ -1,8 +1,12 @@
# Documentation
# Developer Documentation
## Contents
- [Configuration](./configuration.md) - how users can configure HAOS
- [Getting started](./getting_started_development.md) - the place for developers to begin
- [Development](./development.md) - more details for developers
- [Deployment](./deployment.md) - approach to git branching and releases
- [Configuration](./configuration.md) - how users can configure HassOS
- [Partition](./partition.md) - partition layout
- [Network](./network.md) - approach to networking
- [Bluetooth](./bluetooth.md) - approach to bluetooth
- [Kernel](./kernel.md) - kernel versions

View File

@ -4,31 +4,27 @@
The following boards/devices are supported:
- Nabu Casa
- [Home Assistant Green](https://www.home-assistant.io/green/)
- [Home Assistant Yellow](https://www.home-assistant.io/yellow/) (based custom carrier board and powered by a Raspberry Pi 4 Compute Module)
- [Home Assistant Blue](https://www.home-assistant.io/blue/) (based on ODROID-N2+)
- Raspberry Pi
- Pi 5 ([4 GB](https://www.raspberrypi.com/products/raspberry-pi-5/?variant=raspberry-pi-5-4gb) and [8 GB](https://www.raspberrypi.com/products/raspberry-pi-5/?variant=raspberry-pi-5-8gb) model) 64-bit
- Pi 4 Model B ([1 GB](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/?variant=raspberry-pi-4-model-b-1gb), [2 GB](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/?variant=raspberry-pi-4-model-b-2gb), [4 GB](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/?variant=raspberry-pi-4-model-b-4gb) and [8 GB](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/?variant=raspberry-pi-4-model-b-8gb) model) 32-bit or 64-bit (recommended)
- [Pi 3 Model B](https://www.raspberrypi.com/products/raspberry-pi-3-model-b/) and [B+](https://www.raspberrypi.com/products/raspberry-pi-3-model-b-plus/) 32-bit or 64-bit (recommended)
- [Pi 2](https://www.raspberrypi.com/products/raspberry-pi-2-model-b/) (not recommended)
- Pi 4 Model B (1 GB, 2 GB and 4 GB model) 32-bit (recommended)
- Pi 4 Model B (1 GB, 2 GB and 4 GB model) 64-bit
- Pi 3 Model B and B+ 32-bit (recommended)
- Pi 3 Model B and B+ 64-bit
- Pi 2 (not recommended)
- Pi Zero-W (not recommended)
- Pi (not recommended)
- Hardkernel
- [ODROID-C2](https://www.hardkernel.com/shop/odroid-c2/) (discontinued)
- [ODROID-C4](https://www.hardkernel.com/shop/odroid-c4/)
- [ODROID-M1](https://www.hardkernel.com/shop/odroid-m1/)
- ODROID-M1S [4 GB](https://www.hardkernel.com/shop/odroid-m1s-with-4gbyte-ram/) or [8 GB](https://www.hardkernel.com/shop/odroid-m1s-with-8gbyte-ram/)
- [ODROID-N2](https://www.hardkernel.com/shop/odroid-n2/) (discontinued)
- ODROID-N2+ [2 GB](https://www.hardkernel.com/shop/odroid-n2-with-2gbyte-ram-2/) or [4 GB](https://www.hardkernel.com/shop/odroid-n2-with-4gbyte-ram-2/)
- [ODROID-XU4](https://www.hardkernel.com/shop/odroid-xu4-special-price/)
- Odroid-C2
- Odroid-C4 (_experimental_)
- Odroid-N2
- Odroid-XU4
- Intel NUC
- Intel NUC5CPYH
- Intel NUC6CAYH
- Intel NUC10I3FNK2
- Gigabyte GB-BPCE-3455
- Others recent Intel NUC computers are likely to work too, only those listed above have been tested.
- Asus
- [Tinker Board](https://tinker-board.asus.com/product/tinker-board.html)
- Generic x86-64 (UEFI, not suited for virtualization)
- [Intel NUC5CPYH](https://www.intel.com/content/www/us/en/products/sku/85254/intel-nuc-kit-nuc5cpyh/specifications.html)
- [Intel NUC6CAYH](https://www.intel.com/content/www/us/en/products/sku/95062/intel-nuc-kit-nuc6cayh/specifications.html)
- [Intel NUC10I3FNK2](https://www.intel.com/content/www/us/en/products/sku/195503/intel-nuc-10-performance-kit-nuc10i3fnk/specifications.html)
- [Gigabyte GB-BPCE-3455](https://www.gigabyte.com/Mini-PcBarebone/GB-BPCE-3455-rev-10/sp#sp)
- Computers supporting x86-64 architecture and UEFI boot should generally work
- Tinker Board
- Virtual appliance (x86_64/UEFI):
- VMDK
- OVA ?
@ -43,20 +39,17 @@ Notes:
|Board|Build|Config|Docs|
|-----|----|------|----|
|Green |`make green` |[green](../../buildroot-external/configs/green_defconfig)|-|
|Yellow |`make yellow` |[yellow](../../buildroot-external/configs/yellow_defconfig)|-|
|Pi5 64-bit |`make rpi5_64` |[rpi5_64](../../buildroot-external/configs/rpi5_64_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi4B 64-bit |`make rpi4_64` |[rpi4_64](../../buildroot-external/configs/rpi4_64_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi4B 32-bit |`make rpi4` |[rpi4](../../buildroot-external/configs/rpi4_defconfig)|[raspberrypi](./raspberrypi/)|
|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-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-M1 |`make odroid_m1` |[odroid_m1](../../buildroot-external/configs/odroid_m1_defconfig)|[hardkernel](./hardkernel/)|
|ODROID-M1S |`make odroid_m1s` |[odroid_m1s](../../buildroot-external/configs/odroid_m1s_defconfig)|[hardkernel](./hardkernel/)|
|ODROID-N2/N2+ |`make odroid_n2` |[odroid_n2](../../buildroot-external/configs/odroid_n2_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/)|
|Pi4B 32-bit |`make rpi4` |[rpi4](../../buildroot-external/configs/rpi4_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi4B 64-bit |`make rpi4_64` |[rpi4_64](../../buildroot-external/configs/rpi4_64_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi3B 32-bit |`make rpi3` |[rpi3](../../buildroot-external/configs/rpi3_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi3B 64-bit |`make rpi3_64` |[rpi3_64](../../buildroot-external/configs/rpi3_64_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi2 |`make rpi2` |[rpi2](../../buildroot-external/configs/rpi2_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi Zero |`make rpi0_w` |[rpi0_w](../../buildroot-external/configs/rpi0_w_defconfig)|[raspberrypi](./raspberrypi/)|
|Pi |`make rpi` |[rpi](../../buildroot-external/configs/rpi_defconfig)|[raspberrypi](./raspberrypi/)|
|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-N2 |`make odroid_n2` |[odroid_n2](../../buildroot-external/configs/odroid_n2_defconfig)|[hardkernel](./hardkernel/)|
|Odroid-XU4 |`make odroid_xu4`|[odroid_xu4](../../buildroot-external/configs/odroid_xu4_defconfig)|[hardkernel](./hardkernel/)|
|NUC |`make intel_nuc` |[intel_nuc](../../buildroot-external/configs/intel_nuc_defconfig)|[intel](./intel/)|
|Tinker Board|`make tinker` |[tinker](../../buildroot-external/configs/tinker_defconfig)|[asus](./asus/)|
|OVA |`make ova` |[ova](../../buildroot-external/configs/ova_defconfig)|[ova](./ova/)|

View File

@ -1,36 +0,0 @@
# 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

@ -1,62 +0,0 @@
# 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 NUC6CAYS | 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 integrated in Intel Wireless cards working OK, other options 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

@ -4,25 +4,9 @@
| Device | Release Date | Support | Config |
|----------------|---------------|--------------|-----------|
| ODROID-C2 | 2016 | yes | [odroid_c2](../../../buildroot-external/configs/odroid_c2_defconfig) |
| ODROID-C4 | 2020 | yes | [odroid_c4](../../../buildroot-external/configs/odroid_c4_defconfig) |
| ODROID-M1 | 2022 | yes | [odroid_m1](../../../buildroot-external/configs/odroid_m1_defconfig) |
| ODROID-M1S | 2023 | yes | [odroid_m1s](../../../buildroot-external/configs/odroid_m1s_defconfig)|
| ODROID-N2 | 2019 | yes | [odroid_n2](../../../buildroot-external/configs/odroid_n2_defconfig) |
| 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

@ -1,4 +1,4 @@
# ODROID-C2
# Odroid-C2
## eMMC

View File

@ -1,10 +1,10 @@
# ODROID-C4
# 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.
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.
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

View File

@ -1,50 +0,0 @@
# ODROID-M1
Home Assistant OS 10 and newer support the ODROID-M1 board.
## SD-card
SD-card boot is supported via on-board bootloader (SPL) or recovery button.
## eMMC
eMMC boot via on-board bootloader requires a newer version of Petitboot
(spiboot 20230328 or later). To install the latest version download the SPI boot image
from [linuxfactory.or.kr][1] as follows:
1. Download `spiupdate_odroidm1_20240415.img.xz`
2. Use balenaEtcher or another tool to flash the updater onto an SD card
3. Download `spiboot-20240109.img`
4. Rename the `spiboot-20240109.img` file to`spiboot.img`.
5. Paste the `spiboot.img` file onto the FAT partition of that same SD card.
6. Plug-in that SD card to your ODROID-M1. Petitboot will update itself, you can verify the progress on the HDMI output.
7. If you see the version 20240109 in the top left corner, the installation was successful.\
If you see any other version there, the installation failed.
Once Petitboot is updated you can flash Home Assistant OS directly onto an eMMC.
## NVMe
Booting directly from NVMe is not supported. The NVMe card can be used as a data disk.
## Technical notes on boot flow
The Home Assistant OS image is bootable by the SoC directly. This means that no help
from the Hardkernel provided and pre-installed bootloader Petitboot is necessary.
However, the ODROID-M1 automatically boots from internal SPI. To boot
directly off the SD-card or eMMC you need to press the recovery button.
The SPI flashed U-Boot SPL tries searches for an U-Boot binary on the SD-card
(and from eMMC with Petitboot 20230328 and later). This mechanism allows you to
boot the Home Assistant OS U-Boot without pressing the recovery button.
## Console
By default, console access is available on the serial header (CON1) and on HDMI.
The serial console's baudrate is 1500000 by default.
The systemd startup messages will only appear on the serial console by default.
To show the messages on the HDMI console instead, add the console manually
to the `cmdline.txt` file on the boot partition (e.g. `console=tty0`).
[1]: http://ppa.linuxfactory.or.kr/images/petitboot/odroidm1/

View File

@ -1,58 +0,0 @@
# ODROID-M1S
Home Assistant OS 12 and newer support the ODROID-M1S board.
## SD-card
ODROID-M1S can boot HAOS directly from an SD card, as it has higher priority than the system on the eMMC. Simply flash the image to the SD card using your favorite tool and insert it to the micro SD slot on the board. This works even when the eMMC is wiped, or when it contains the factory-default U-Boot SPL loader, which is still able to load U-Boot provided in the HAOS image. In the second case, however, if the SD card fails to probe (e.g. due to a hardware failure), the system on the eMMC may be booted instead of HAOS.
## eMMC
HAOS can be installed directly to the eMMC using a special boot image, to do that:
1. Download the _UMS Utility_ image: [`ODROID-M1S_EMMC2UMS.img`][1]. The _UMS Utility_ is a special image that switches ODROID-M1S to USB Mass Storage device.
2. Use balenaEtcher or another tool to flash the _UMS utility_ onto an SD card.
3. Plug-in that SD card to your ODROID-M1S and boot it. Connect your PC to the Micro USB OTG port.
4. The eMMC will show as a drive on your PC and you can directly flash the HAOS image with balenaEther.
Installing HAOS replaces the firmware and SPL on the eMMC with the mainline version provided by HAOS. As a result, it is not possible to use the SD card with the EMMC2UMS image anymore, because the mainline SPL is not compatible with U-Boot in the EMMC2UMS image at this time (February 2024). This does not pose any problem for standard use, just makes it more complicated in case you want to return to the Hardkernel-provided OS.
A reliable way of reflashing the eMMC in this case is to use HAOS booted from an SD card. To do that, insert the SD card with HAOS to the micro SD slot and plug the board in. Once the device boots to the HA CLI, enter `login` to enter the root shell and use `curl` to download an image and `dd` it to the eMMC block device:
```sh
curl https://dn.odroid.com/RK3566/ODROID-M1S/Installer/ODROID-M1S_EMMC2UMS.img | dd of=/dev/mmcblk0
```
This way the device will start in the UMS mode on the next boot with the SD card removed. Alternatively you can use the [Hardkernel installer image][2] directly instead of the EMMC2UMS image.
## NVMe
Booting directly from NVMe is not supported. The NVMe card can be used as a data disk.
## Technical notes on boot flow
The Home Assistant OS image is bootable by the SoC directly. Refer to the [boot sequence documentation][3] for the details on what part of the boot is executed from the eMMC and what from the SD card. The steps documented above should however cover all scenarios that a standard user may encounter during usage.
## Console
By default, console access is available on the serial header (UART) and on HDMI.
The serial console's baudrate is 1500000 by default.
The systemd startup messages will only appear on the serial console by default.
To show the messages on the HDMI console instead, add the console manually
to the `cmdline.txt` file on the boot partition (e.g. `console=tty0`).
## GPIO
Odroid-M1S introduces a new 14pin expansion header. Refer to [the ODROID wiki][4].
At this point not all functionality is supported by the upstream kernel used by Home Assistant OS.
Supported modules include:
- UPS
- Internal USB
- Mini IO board (partial support)
[1]: https://dn.odroid.com/RK3566/ODROID-M1S/Installer/ODROID-M1S_EMMC2UMS.img
[2]: https://wiki.odroid.com/odroid-m1s/getting_started/os_installation_guide#user_installer
[3]: https://wiki.odroid.com/odroid-m1s/board_support/boot_sequence
[4]: https://wiki.odroid.com/odroid-m1s/hardware/expansion_connectors

View File

@ -1,4 +1,4 @@
# ODROID-N2
# Odroid-N2
## eMMC
@ -12,7 +12,3 @@ 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

@ -0,0 +1,56 @@
# Intel NUC
## Supported Hardware
This board configuration supports the Intel NUC mini PCs and compatibles. It should work for most recent NUC computers and, because this is a UEFI based image, it should in fact work with for any x86-64 based computer with UEFI. Hardware it has been tested with is listed below.
## Tested Hardware
| Device | Release Date | Support | Config |
|-----------------------|--------------|---------|-------------|
| Intel NUC5CPYH | Q3 2015 | yes | [intel_nuc](../../../buildroot-external/configs/intel_nuc_defconfig) |
| Intel NUC6CAYH | Q4 2016 | yes | [intel_nuc](../../../buildroot-external/configs/intel_nuc_defconfig) |
| Intel NUC10i3FNK2 | Q4 2019 | yes | [intel_nuc](../../../buildroot-external/configs/intel_nuc_defconfig) |
| Gigabyte GB-BPCE-3455 | 2017 | yes* | [intel_nuc](../../../buildroot-external/configs/intel_nuc_defconfig) |
\* needs 'nomodeset' in cmdline.txt if you want a console
## Requirements
- x86-64 support
- UEFI boot
- SATA/AHCI 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
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

@ -4,10 +4,18 @@
| 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 Zero |2015 | not recommended | [rpi](../../../buildroot-external/configs/rpi_defconfig) |
| Raspberry Pi Zero W |2017 | not recommended | [rpi0_w](../../../buildroot-external/configs/rpi0_w_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) |
| Raspberry Pi 5 |2023 | yes (beta) | [rpi5_64](../../../buildroot-external/configs/rpi5_64_defconfig) |
| Raspberry Pi 4 B |2019 | yes* | [rpi4](../../../buildroot-external/configs/rpi4_defconfig) / [rpi4_64](../../../buildroot-external/configs/rpi4_64_defconfig) |
\*1,2 and 4 GiB versions of the Raspberry Pi 4 B are supported. Support for the 8 GiB version is coming soon is part of #740.
## 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
@ -29,11 +37,9 @@ USB mass storage boot is available on Raspberry Pi 4 (64-bit only), 3B, 3B+, 3A+
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 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.
For more information see [RaspberryPi](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md).

View File

@ -23,9 +23,8 @@ hassos-xy.raucb
- 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 using `ha os import` from the CLI or by calling `systemctl restart hassos-config` on the OS shell. *The USB Stick just needs to be inserted to the device during this setup process and can be removed afterwards.*
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 inserted to the device during this setup process and can be disconnected afterwards.*
## Local
@ -53,7 +52,7 @@ Our default NTP configuration look like:
```
[Time]
NTP=time.cloudflare.com
NTP=time1.google.com time2.google.com time3.google.com
FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
```

View File

@ -0,0 +1,22 @@
# Deployment
We provide 3 different types of release builds:
- development (dev)
- staging (beta)
- 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 productive/staging 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

@ -0,0 +1,60 @@
# Development
## Boot system
`BOOT_SYS`:
- efi
- hybrid
- mbr
HassOS is using GPT. But to use GPT we need own the first 1024 of boot drive. Is that's not possible, you can use MBR for your device. This also work with SPLs.
Hybrid and SPL use both a hybrid MBR/GPT table but SPL move the GPT header 8 MB for give space to write SPL and boot images before.
`BOOT_SPL`:
- true
- false
Enable SPL update handling.
`BOOTLOADER`:
- U-Boot
- barebox
We support mainly U-Boot but for UEFI systems we can also use [barebox](https://barebox.org/). In the future, we hope to remove barebox with U-Boot also on UEFI.
`DISK_SIZE`:
Default 2. That is the size of end image in GB.
## Supervisor
`SUPERVISOR_MACHINE`:
- intel-nuc
- odroid-c2
- odroid-c4
- odroid-n2
- odroid-xu
- qemuarm
- qemuarm-64
- qemux86
- qemux86-64
- raspberrypi
- raspberrypi2
- raspberrypi3
- raspberrypi4
- raspberrypi3-64
- raspberrypi4-64
- tinker
`SUPERVISOR_ARCH`:
- amd64
- i386
- armhf
- armv7
- aarch64

View File

@ -0,0 +1,101 @@
# Getting started with HassOS development using Docker on GNU/Linux
First, install `docker-ce` 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:
```bash
$ 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:
```bash
$ 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 home-assistant/operating-system repository checkout (please adapt path names as needed), make sure your intended changes to the source tree are applied (and committed, ideally :)), and execute the `enter.sh` helper script:
```bash
$ 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:
```bash
root@somehashinhex:/build#
root@somehashinhex:/build# make help
[...]
```
The HassOS developers provide a `Makefile` that will build HassOS images for a list of targets. For example run the command below to start building the _ova_ variant, and go make a cup of tea. Or fifteen.
```bash
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:
```bash
[...]
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:
```bash
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:
```bash
root@fd292c061896:/build# gunzip release/hassos_ova-2.2.qcow2.gz
root@fd292c061896:/build# ls -lh release/
total 673M
-rw-r--r-- 1 root root 337M Oct 10 20:25 hassos_ova-2.2.qcow2
```
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 provides the "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 path names as necessary, for example if you have installed the ovmf firmware image at another location.)
```bash
$ /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 additional 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 *ha>* shell prompt will yield a root shell in the host OS.

View File

@ -1,24 +1,19 @@
# Kernel Version
Default Kernel tree: 5.4
| Board | Version |
|-------|---------|
| Open Virtual Appliance | 6.12.40 |
| Raspberry Pi | 6.12.25 |
| Raspberry Pi 0-W | 6.12.25 |
| Raspberry Pi 2 | 6.12.25 |
| Raspberry Pi 3 | 6.12.25 |
| Raspberry Pi 4 | 6.12.25 |
| Raspberry Pi 5 | 6.12.25 |
| Home Assistant Yellow | 6.12.25 |
| Home Assistant Green | 6.12.40 |
| Tinker Board | 6.12.40 |
| ODROID-C2 | 6.12.40 |
| ODROID-C4 | 6.12.40 |
| ODROID-M1 | 6.12.40 |
| ODROID-M1S | 6.12.40 |
| ODROID-N2 | 6.12.40 |
| ODROID-XU4 | 6.12.40 |
| Generic aarch64 | 6.12.40 |
| Generic x86-64 | 6.12.40 |
| Khadas VIM3 | 6.12.40 |
| Open Virtual Appliance | 5.4.94 |
| Raspberry Pi | 5.4.83 |
| Raspberry Pi 0-W | 5.4.83 |
| Raspberry Pi 2 | 5.4.83 |
| Raspberry Pi 3 | 5.4.83 |
| Raspberry Pi 4 | 5.4.83 |
| Tinker Board | 5.4.94 |
| Odroid-C2 | 5.9.16 |
| Odroid-C4 | 5.9.16 |
| Odroid-N2 | 5.9.16 |
| Odroid-XU4 | 5.9.16 |
| Intel NUC | 5.4.94 |

View File

@ -4,49 +4,23 @@ Home Assistant Operating System uses NetworkManager to control the host network.
## Configure network
By default the device will be in DHCP state.
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].
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.
## Configuration examples
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:
You can read the [NetworkManager manual][nm-manual] or find many configuration examples across the internet. 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
A preinstalled connection profile for wired network is active by default:
A preinstalled connection profile is provided by default:
```ini
[connection]
id=Home Assistant OS default
id=my-network
uuid=f62bf7c2-e565-49ff-bbfc-a4cf791e6add
type=802-3-ethernet
llmnr=2
mdns=2
[ipv4]
method=auto
@ -63,8 +37,6 @@ method=auto
id=my-network
uuid=d55162b4-6152-4310-9312-8f4c54d86afa
type=802-3-ethernet
llmnr=2
mdns=2
[ipv4]
method=auto
@ -118,24 +90,14 @@ For `address`, the value before the semicolon is the IP address and subnet prefi
### Reset network
If you want to reset the network configuration back to the default connection
profile using DHCP, use the following commands on the host console:
If you want to reset the network configuration back to the default DHCP settings, use the following commands on the host:
```bash
# rm -r /mnt/overlay/etc/NetworkManager/system-connections
# reboot
# rm /etc/NetworkManager/system-connections/*
# cp /usr/share/system-connections/* /etc/NetworkManager/system-connections/
# nmcli con reload
```
Home Assistant OS will recreate the default connection profile during boot.
### Enabling Wi-Fi
Wi-Fi is discouraged for reliability reasons. However, if you still prefer to use Wi-Fi, you can us the `ha network` command to set up Wi-Fi (example for a Raspberry Pi 4, check `ha network info` to check if your board supports Wi-Fi and the name of the Wi-Fi device):
```bash
ha network update wlan0 --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 then apply the following changes:
@ -148,7 +110,7 @@ powersave=0
## Using `nmcli` to set a static IPv4 address
Log into the the Home Assistant OS base system via a console:
Log into the the HassOS base system via a console:
```bash
Welcome to Home Assistant
@ -159,13 +121,13 @@ homeassistant login:
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.
- `# nmcli con show` will list the "HassOS default" connection in use.
- `# nmcli con show "HassOS default"` will list all the properties of the connection.
To start editing the configuration setting for "Home Assistant OS default":
To start editing the configuration setting for "HassOS default":
```bash
# nmcli con edit "Home Assistant OS default"
# nmcli con edit "HassOS default"
```
To add your static IP address (select 'yes' for manual method);
@ -188,6 +150,6 @@ If you now view the default connection `cat /etc/NetworkManager/system-connectio
Doing a `nmcli con reload` does not always work, so restart the virtual machine or the physical system.
[nm-manual]: https://networkmanager.dev/docs/api/1.40/manpages.html
[nm-manual]: https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html
[configuration-usb]: configuration.md
[uuid]: https://www.uuidgenerator.net/version4
[uuid]: https://www.uuidgenerator.net/

View File

@ -0,0 +1,63 @@
# Partition
The partition layout is a bit different than the typical setup. We prefer GPT, if possible. With SoCs which don't support GPT, we use a hybrid GPT. For more details about this topic, please refer to the [development](development.md) documentation.
The system is designed to have as few write operations to the storage media as possible. This means that we only write during the OTA updates and 5-6 times per week on the overlay partition. The data partition receives the main I/O operations and for this reason is ideal for placing on a different drive.
A visual representation looks like this:
```text
-------------------------
| Bootloader |
-------------------------
| Kernel A |
-------------------------
| System A |
| |
-------------------------
| Kernel B |
-------------------------
| System B |
| |
-------------------------
| Bootstate |
-------------------------
| Overlay |
| |
...
-------------------------
| Data |
| |
-------------------------
```
Sometime the bootloader part can look different because there can be firmware or SPLs for boot the CPU on the SoC.
## Data
The data partition is the only partition with real I/O. It will be expanded automatically at boot to the full size of the disk.
## Using datactl to move the data partition.
In a Home Assistant OS installation, the data is stored on the `/mnt/data` partition of the SD card. This is the only read+write partition on the SD drive. Using the `datactl` move command, this partition can be moved off of the SD card onto an externally connected drive, leaving the rest of the read-only system on the SD.
The storage capacity of the external drive must be larger than the storage capacity of the existing SD card.
The command needs to be run from the host console by either connecting a keyboard and monitor or making use of the [debug ssh access](https://developers.home-assistant.io/docs/operating-system/debugging/) over port 22222. The command will not work from within an SSH add-on container.
Log in as `root` to get to the Home Assistant CLI and then enter `login` to continue to the host.
Confirm your USB SSD/HD is connected and recognized using `fdisk -l`.
With the drive connected, use the following command (replacing sdx with your drive, without a partition number):
```sh
$ datactl move /dev/sdx
```
Enter "yes" to confirm the operation. This will prepare the disk, however, the
actual move will be running on next reboot. Once complete, the external drive
will contain the data and will need to be plugged in to successfully boot Home
Assistant OS.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

View File

@ -1,61 +1,52 @@
BUILDDIR:=$(shell pwd)
RELEASE_DIR = /build/release
BUILDROOT=$(BUILDDIR)/buildroot
BUILDROOT_EXTERNAL=$(BUILDDIR)/buildroot-external
BUILDROOT=/build/buildroot
BUILDROOT_EXTERNAL=/build/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
O := $(BUILDROOT)/output
else
override O := $(BUILDDIR)/$(O)
override O := $(BUILDROOT)/$(O)
endif
################################################################################
.NOTPARALLEL: $(TARGETS) $(TARGETS_CONFIG) all
COLOR_STEP := $(shell tput smso 2>/dev/null)
COLOR_WARN := $(shell (tput setab 3; tput setaf 0) 2>/dev/null)
TERM_RESET := $(shell tput sgr0 2>/dev/null)
.PHONY: $(TARGETS) $(TARGETS_CONFIG) all clean help
################################################################################
all: $(TARGETS)
.NOTPARALLEL: $(TARGETS) $(TARGETS_CONFIG) default
.PHONY: $(TARGETS) $(TARGETS_CONFIG) default buildroot-help help
# fallback target when target undefined here is given
.DEFAULT:
@echo "$(COLOR_STEP)=== Falling back to Buildroot target '$@' ===$(TERM_RESET)"
$(MAKE) -C $(BUILDROOT) O=$(O) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) "$@"
# default target when no target is given - must be first in Makefile
default:
$(MAKE) -C $(BUILDROOT) O=$(O) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL)
$(RELEASE_DIR):
mkdir -p $(RELEASE_DIR)
$(TARGETS_CONFIG): %-config:
@if [ -f $(O)/.config ] && ! grep -q 'BR2_DEFCONFIG="$(DEFCONFIG_DIR)/$*_defconfig"' $(O)/.config; then \
echo "$(COLOR_WARN)WARNING: Output directory '$(O)' already contains files for another target!$(TERM_RESET)"; \
echo " Before running build for a different target, run 'make distclean' first."; \
echo ""; \
bash -c 'read -t 10 -p "Waiting 10s, press enter to continue or Ctrl-C to abort..."' || true; \
fi
@echo "$(COLOR_STEP)=== Using $*_defconfig ===$(TERM_RESET)"
$(MAKE) -C $(BUILDROOT) O=$(O) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) "$*_defconfig"
@echo "config $*"
$(MAKE) -C $(BUILDROOT) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) "$*_defconfig"
$(TARGETS): %: %-config
@echo "$(COLOR_STEP)=== Building $@ ===$(TERM_RESET)"
$(MAKE) -C $(BUILDROOT) O=$(O) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL)
$(TARGETS): %: $(RELEASE_DIR) %-config
@echo "build $@"
$(MAKE) -C $(BUILDROOT) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) VERSION_DEV=$(VERSION_DEV)
cp -f $(O)/images/hassos_* $(RELEASE_DIR)/
buildroot-help:
$(MAKE) -C $(BUILDROOT) O=$(O) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) help
# Do not clean when building for one target
ifneq ($(words $(filter $(TARGETS),$(MAKECMDGOALS))), 1)
@echo "clean $@"
$(MAKE) -C $(BUILDROOT) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) clean
endif
@echo "finished $@"
clean:
$(MAKE) -C $(BUILDROOT) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) clean
help:
@echo "Run 'make <target>' to build a target image."
@echo "Run 'make <target>-config' to configure buildroot for a target."
@echo ""
@echo "Supported targets: $(TARGETS)"
@echo ""
@echo "Unknown Makefile targets fall back to Buildroot make - for details run 'make buildroot-help'"
@echo "Run 'make <target>' to build a target image."
@echo "Run 'make all' to build all target images."
@echo "Run 'make clean' to clean the build output."
@echo "Run 'make <target>-config' to configure buildroot for a target."

View File

@ -1,10 +1,8 @@
# Home Assistant Operating System
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/).
Home Assistant Operating System (formerly HassOS) is an operating system optimized for hosting [Home Assistant](https://www.home-assistant.io) and its [Add-ons](https://www.home-assistant.io/addons/).
Home Assistant Operating System uses Docker as its container engine. By default it deploys the Home Assistant Supervisor as a container. Home Assistant Supervisor in turn uses the Docker container engine to control Home Assistant Core and Add-Ons in separate containers. Home Assistant Operating System is **not** based on a regular Linux distribution like Ubuntu. It is built using [Buildroot](https://buildroot.org/) and it is optimized to run Home Assistant. It targets single board compute (SBC) devices like the Raspberry Pi or ODROID but also supports x86-64 systems with UEFI.
[![Home Assistant - A project from the Open Home Foundation](https://www.openhomefoundation.org/badges/home-assistant.png)](https://www.openhomefoundation.org/)
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 for running Home Assistant, especially on single board compute (SBC) devices like the Pi, ODROID, NUC and Tinker Board (see supported hardware below).
## Features
@ -12,15 +10,14 @@ Home Assistant Operating System uses Docker as its container engine. By default
- Minimized I/O
- Over The Air (OTA) updates
- Offline updates
- Modular using Docker container engine
- Modular using Docker
## Supported hardware
- Nabu Casa
- Raspberry Pi
- Hardkernel ODROID
- Intel NUC
- Asus Tinker Board
- Generic x86-64 (e.g. Intel NUC)
- Virtual appliances
See the full list and specific models [here](./Documentation/boards/README.md)
@ -31,17 +28,11 @@ If you just want to use Home Assistant the official [getting started guide](http
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
## HassOS components
- **Bootloader:**
- [GRUB](https://www.gnu.org/software/grub/) for devices that support UEFI
- [U-Boot](https://www.denx.de/wiki/U-Boot) for devices that don't support UEFI
- [Barebox](https://barebox.org/) for devices that support EFI
- [U-Boot](https://www.denx.de/wiki/U-Boot) for devices that don't support EFI
- **Operating System:**
- [Buildroot](https://buildroot.org/) LTS Linux
- **File Systems:**
@ -54,8 +45,14 @@ The Home Assistant Operating System documentation can be found on the [Home Assi
- **Security:**
- [AppArmor](https://apparmor.net/) Linux kernel security module
If you don't have experience with these, embedded systems, buildroot or the build process for Linux distributions, then please read up on these topics. The rest of the documentation in this project is for developers and assumes you have experience with embedded systems or a strong understanding of the internal workings of operating systems.
## Developer Documentation
All developer documentation is in the [Documentation](./Documentation) directory.
### 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 [https://os-artifacts.home-assistant.io/index.html](https://os-artifacts.home-assistant.io/index.html).
available at [os-builds.home-assistant.io](https://os-builds.home-assistant.io/).

@ -1 +0,0 @@
Subproject commit 01604756d2d0fc42e6ad7061fe1eb5bead732374

View File

@ -1,21 +1,8 @@
source "$BR2_EXTERNAL_HASSOS_PATH/package/bluetooth-rtl8723/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/eq3_char_loop/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/gasket/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/generic_raw_uart/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hailo8-firmware/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hailo-pci/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/bluetooth-bcm43xx/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/bluetooth-rtl8723/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hardkernel-boot/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/qemu-guest-agent/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/lxd-guest-agent/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/rockchip-blobs/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/intel-e1000e/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/tempio/Config.in.host"
source "$BR2_EXTERNAL_HASSOS_PATH/package/udisks2/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/vcgencmd/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/xe-guest-utilities/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/rtl8812au/Config.in"

View File

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

View File

@ -1,85 +0,0 @@
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
fi
if [ "$SLOT" == "B" ]; then
INDEX=1
OK=$B_OK
TRY=$B_TRY
fi
if [ "$OK" -eq 1 -a "$TRY" -lt 3 ]; then
default=$INDEX
# increment attempts and save back to slot
if [ "$TRY" -eq 1 ]; then
TRY=2
elif [ "$TRY" -eq 2 ]; then
TRY=3
else
TRY=1
fi
if [ "$SLOT" == "A" ]; then
A_TRY=$TRY
fi
if [ "$SLOT" == "B" ]; then
B_TRY=$TRY
fi
break
fi
done
# No bootable slot found, choose rescue...
if [ "$default" -eq 99 ]; then
if [ "$A_OK" -eq 1 ]; then
default=2
fi
if [ "$B_OK" -eq 1 ]; then
default=3
fi
fi
if [ "$MACHINE_ID" == "" ]; then
boot_condition="systemd.condition-first-boot=true"
fi
save_env A_TRY A_OK B_TRY B_OK ORDER MACHINE_ID
default_cmdline="rootwait zram.enabled=1 zram.num_devices=3 systemd.machine_id=$MACHINE_ID fsck.repair=yes $boot_condition"
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
}
menuentry "Slot A (rescue shell)" {
linux (${boothd},gpt2)/Image root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd $default_cmdline $cmdline rauc.slot=A systemd.unit=recovery.target
}
menuentry "Slot B (rescue shell)" {
linux (${boothd},gpt4)/Image root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 $default_cmdline $cmdline rauc.slot=B systemd.unit=recovery.target
}

View File

@ -1,31 +0,0 @@
#!/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
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set ORDER="A B"
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set A_OK=1
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv" set A_TRY=0
cp -r "${EFIPART_DATA}/"* "${BOOT_DATA}/"
}
function hassos_post_image() {
convert_disk_image_virtual vmdk
convert_disk_image_virtual vdi
convert_disk_image_virtual qcow2
convert_disk_image_zip vmdk
convert_disk_image_zip vdi
convert_disk_image_xz qcow2
convert_disk_image_xz
}

View File

@ -1,84 +0,0 @@
CONFIG_EFI_STUB=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CONNECTOR=y
CONFIG_VSOCKETS=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_MEM=m
CONFIG_VIRTIO_INPUT=m
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_CONSOLE=m
CONFIG_VIRTIO_VSOCKETS=m
CONFIG_VIRTIO_MMIO=y
CONFIG_SCSI_VIRTIO=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_VIRTIO_IOMMU=m
CONFIG_CRYPTO_ENGINE=m
CONFIG_CRYPTO_DEV_VIRTIO=m
# options for backward compatibility
CONFIG_ARMV8_DEPRECATED=y
CONFIG_SWP_EMULATION=y
CONFIG_CP15_BARRIER_EMULATION=y
CONFIG_SETEND_EMULATION=y
# These options are needed for virtio-fs
CONFIG_FUSE_FS=y
CONFIG_VIRTIO_FS=y
CONFIG_DAX=y
CONFIG_FS_DAX=y
CONFIG_ZONE_DEVICE=y
CONFIG_DMI_SYSFS=m
CONFIG_FW_CFG_SYSFS=m
CONFIG_NVME_CORE=y
CONFIG_BLK_DEV_NVME=y
CONFIG_NVME_HWMON=y
CONFIG_DRM_VIRTIO_GPU=m
CONFIG_HYPERV=y
CONFIG_HYPERV_UTILS=m
CONFIG_HYPERV_BALLOON=m
CONFIG_HYPERV_KEYBOARD=m
CONFIG_HYPERV_STORAGE=y
CONFIG_HYPERV_NET=y
CONFIG_HYPERV_VSOCKETS=m
CONFIG_PCI_HYPERV=m
CONFIG_PCI_HYPERV_INTERFACE=m
CONFIG_FB_HYPERV=y
CONFIG_I6300ESB_WDT=y
# GPIO support
CONFIG_GPIO_ZYNQ=y
CONFIG_GPIO_PCA9570=y
# PHY drivers
CONFIG_PHY_XILINX_ZYNQMP=y
# USB support
CONFIG_USB_ONBOARD_DEV=y
CONFIG_USB_ONBOARD_DEV_USB5744=y
# i2c support
CONFIG_I2C_CADENCE=y
# 1-wire
CONFIG_W1_MASTER_AMD_AXI=m
CONFIG_W1_SLAVE_THERM=m
# IIO
CONFIG_XILINX_AMS=m
# Audio drivers
CONFIG_SND_HDA_INTEL=m
CONFIG_SND_HDA_GENERIC=m

View File

@ -1,11 +0,0 @@
BOARD_ID=generic-aarch64
BOARD_NAME="Generic aarch64"
CHASSIS=embedded
BOOTLOADER=grub
KERNEL_FILE=Image
PARTITION_TABLE_TYPE=gpt
BOOT_SIZE=32M
BOOT_SPL=false
DISK_SIZE=6G
SUPERVISOR_MACHINE=qemuarm-64
SUPERVISOR_ARCH=aarch64

View File

@ -3,16 +3,20 @@
function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local SPL_IMG="$(path_spl_img)"
cp -t "${BOOT_DATA}" \
"${BINARIES_DIR}/boot.scr" \
"${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"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
echo "console=tty1" > "${BOOT_DATA}/cmdline.txt"
# SPL
create_spl_image
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
}

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -3,10 +3,8 @@ BOARD_NAME="Asus TinkerBoard"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=zImage
PARTITION_TABLE_TYPE=hybrid
BOOT_SIZE=24M
BOOT_SYS=hyprid
BOOT_SPL=true
BOOT_SPL_SIZE=8M
BOOT_ENV_SIZE=0x8000
SUPERVISOR_MACHINE=tinker
SUPERVISOR_ARCH=armv7

View File

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

View File

@ -0,0 +1,64 @@
From 2ae3821fd824560ef2db3c87cfbec985177911f6 Mon Sep 17 00:00:00 2001
Message-Id: <2ae3821fd824560ef2db3c87cfbec985177911f6.1599249626.git.stefan@agner.ch>
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Mon, 5 Nov 2018 22:03:26 +0100
Subject: [PATCH 1/2] ARM: DTS: rk3288-tinker: Setup the Bluetooth UART pins
The most essential being the RTS pin, which is clearly needed to
upload the initial configuration into the Realtek Bluetooth
chip, and make the Bluetooth chip work.
Now, the Bluetooth chip also needs 3 other GPIOS to be enabled.
I'll see how I do that through the DTS file in a near future.
The 3 GPIOS being :
Bluetooth Reset : <&gpio4 29 GPIO_ACTIVE_HIGH>
Bluetooth Wake : <&gpio4 26 GPIO_ACTIVE_HIGH>
Bluetooth Wake_Host_IRQ : <&gpio4 31 GPIO_ACTIVE_HIGH>
These are currently setup manually, through scripts. But it seems that
GPIO handling through /sys entries might not be possible in the long
term, the replacement being libgpio.
Anyway, if you're interesting in enabling the Bluetooth GPIO by hand,
here are the commands :
cd /sys/class/gpio &&
echo 146 > export &&
echo 149 > export &&
echo 151 > export &&
echo high > gpio146/direction &&
echo high > gpio149/direction &&
echo high > gpio151/direction
Resetting the chip is done like this :
echo "Resetting the Bluetooth chip"
cd /sys/class/gpio/gpio149 &&
echo 0 > value &&
sleep 1 &&
echo 1 > value &&
sleep 1
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 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index acfaa12ec239..284e7982925d 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -492,6 +492,8 @@ &tsadc {
};
&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_xfer>, <&uart0_cts>, <&uart0_rts>;
status = "okay";
};
--
2.28.0

View File

@ -1,51 +0,0 @@
From 675fbbc309e4f7c805cf4fbd7c463cfc8308b54e Mon Sep 17 00:00:00 2001
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/rockchip/rk3288.dtsi | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/arm/boot/dts/rockchip/rk3288.dtsi b/arch/arm/boot/dts/rockchip/rk3288.dtsi
index 3f1d640afafae..becf3abd8367f 100644
--- a/arch/arm/boot/dts/rockchip/rk3288.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3288.dtsi
@@ -387,8 +387,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";
@@ -402,8 +400,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";
@@ -430,8 +426,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";
@@ -445,8 +439,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";

View File

@ -1,7 +1,10 @@
From 37b4467356113f17f55066aef54db55b64daa030 Mon Sep 17 00:00:00 2001
From fc25c993bf2feb6e66d55bf03eb725ec688e47eb Mon Sep 17 00:00:00 2001
Message-Id: <fc25c993bf2feb6e66d55bf03eb725ec688e47eb.1599250914.git.stefan@agner.ch>
In-Reply-To: <2ae3821fd824560ef2db3c87cfbec985177911f6.1599250914.git.stefan@agner.ch>
References: <2ae3821fd824560ef2db3c87cfbec985177911f6.1599250914.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
Subject: [PATCH 2/3] ARM: DTS: rk3288-tinker: Defining the SPI interface
Taken from, and tested by @TonyMac32 .
@ -14,14 +17,14 @@ 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/rockchip/rk3288-tinker.dtsi | 19 +++++++++++++++++++
arch/arm/boot/dts/rk3288-tinker.dtsi | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi b/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
index 09618bb7d872c..30430d2e64b93 100644
--- a/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
@@ -483,6 +483,25 @@ &sdio0 {
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index 284e7982925d..d6cc66ab5bb1 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -485,6 +485,25 @@ &sdio0 {
status = "okay";
};
@ -47,3 +50,6 @@ index 09618bb7d872c..30430d2e64b93 100644
&tsadc {
rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
--
2.28.0

View File

@ -1,20 +1,23 @@
From 1a15fc7f6a241895a31b00c1f324d358d408a610 Mon Sep 17 00:00:00 2001
From 3a9d71847ae869ffdb2b0818aa86a36d57d96331 Mon Sep 17 00:00:00 2001
Message-Id: <3a9d71847ae869ffdb2b0818aa86a36d57d96331.1599250914.git.stefan@agner.ch>
In-Reply-To: <2ae3821fd824560ef2db3c87cfbec985177911f6.1599250914.git.stefan@agner.ch>
References: <2ae3821fd824560ef2db3c87cfbec985177911f6.1599250914.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
Subject: [PATCH 3/3] 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/rockchip/rk3288-tinker.dtsi | 8 ++++++++
arch/arm/boot/dts/rk3288-tinker.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi b/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
index 30430d2e64b93..395afc2b2283c 100644
--- a/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
@@ -342,10 +342,18 @@ regulator-state-mem {
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index d6cc66ab5bb1..7af5818ac77c 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -344,10 +344,18 @@ regulator-state-mem {
};
};
@ -33,3 +36,6 @@ index 30430d2e64b93..395afc2b2283c 100644
&i2c5 {
status = "okay";
};
--
2.28.0

View File

@ -1,28 +0,0 @@
From d6c44c231fc4518ad69bb7870a193bb10c563f2a Mon Sep 17 00:00:00 2001
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/rockchip/rk3288.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rockchip/rk3288.dtsi b/arch/arm/boot/dts/rockchip/rk3288.dtsi
index becf3abd8367f..e78fa883b9841 100644
--- a/arch/arm/boot/dts/rockchip/rk3288.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3288.dtsi
@@ -320,7 +320,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>;

View File

@ -1,25 +0,0 @@
From dfb0232e9fae1267d04247aaf171739038c1659e Mon Sep 17 00:00:00 2001
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/rockchip/rk3288-tinker.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi b/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
index 395afc2b2283c..c7e79e5947206 100644
--- a/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
@@ -184,7 +184,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 {

View File

@ -1,113 +0,0 @@
From 4955695e410289df07258b00290d4028c3ac8fb1 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 f96260fd143b4..fa779ce8fb661 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"
@@ -527,6 +532,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;
@@ -554,6 +619,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;
}

View File

@ -1,57 +0,0 @@
From 74227462bbe9236dca234dd24cce4191fa71bdf9 Mon Sep 17 00:00:00 2001
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/rockchip/rk3288-tinker.dtsi | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi b/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
index c7e79e5947206..5d261fae6e72a 100644
--- a/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3288-tinker.dtsi
@@ -386,6 +386,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>;
@@ -518,6 +532,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 {

View File

@ -1,32 +0,0 @@
From eb29ab60a69353f355b3af58b06fff1a89d17992 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <sairon@sairon.cz>
Date: Wed, 10 Jan 2024 16:29:59 +0100
Subject: [PATCH] usb-audio: add ASUS TinkerBoard's ALC4040
Converted to git-series patch from the original plain git diff file
buildroot-external/board/asus/tinker/patches/linux/3001_Tinkerboard-4.19-audio.patch
Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
---
sound/usb/card.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 9c411b82a218d..672136e25c81d 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -533,6 +533,14 @@ static void usb_audio_make_shortname(struct usb_device *dev,
}
strim(card->shortname);
+
+ /* Tinker Board ALC4040 CODEC */
+
+ if(USB_ID_VENDOR(chip->usb_id) == 0x0bda &&
+ USB_ID_PRODUCT(chip->usb_id) == 0x481a) {
+ strlcat(card->shortname, " OnBoard", sizeof(card->shortname));
+ }
+
}
static void usb_audio_make_longname(struct usb_device *dev,

View File

@ -0,0 +1,31 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,28 @@
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

@ -0,0 +1,31 @@
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

@ -0,0 +1,28 @@
From ebc29962ac27264772a4227f5abd6900cb72fa79 Mon Sep 17 00:00:00 2001
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 aa107ee41..3da1c830f 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -164,7 +164,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.16.4

View File

@ -0,0 +1,31 @@
From 3dacea70a8e434008f5b1f119a7f7da9aebc772c Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Mon, 5 Nov 2018 20:18:58 +0100
Subject: [PATCH] ARM: DTSI: rk3288-tinker: 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: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288-tinker.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index 3da1c830f..dd1090728 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -254,7 +254,8 @@
};
vccio_sd: LDO_REG5 {
+ regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vccio_sd";
--
2.16.4

View File

@ -0,0 +1,33 @@
From 487db7cefc9861fdaf30579c378a98f0360690ae Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Mon, 5 Nov 2018 20:27:14 +0100
Subject: [PATCH] ARM: DTSI: rk3288-tinker: Defining SDMMC properties
I never knew if these properties were required to fix the dreaded
reboot issue...
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288-tinker.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index dd1090728..8edd6f681 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -436,7 +436,12 @@
disable-wp; /* wp not hooked up */
pinctrl-names = "default";
pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
+ sd-uhs-sdr12;
+ sd-uhs-sdr25;
+ sd-uhs-sdr50;
+ sd-uhs-sdr104;
status = "okay";
+ supports-sd;
vmmc-supply = <&vcc33_sd>;
vqmmc-supply = <&vccio_sd>;
};
--
2.16.4

View File

@ -0,0 +1,48 @@
From d3d3fe433d9038dcd1a98f4d6711c0777ed06703 Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Mon, 25 Jun 2018 17:08:32 +0200
Subject: [PATCH 26/26] ARM: DTSI: rk3288: Set the VPU MMU power domains
Without that, the auto-activation of the VPU hardware IOMMU fails
when enabling the hardware, before the "probe" phase of its device
driver.
Basically, when loading a "of_platform" device driver targeting
the VPU devices, you'll get these errors without this patch :
[12753.996950] rk_iommu ff9c0440.iommu: Error during raw reset. MMU_DTE_ADDR is not functioning
[12754.007483] rk_iommu ff9c0440.iommu: Disable stall request timed out, status: 0xffffffff
[12754.026652] rk_iommu ff9c0440.iommu: Disable paging request timed out, status: 0xffffffff
[12754.045975] rk_iommu ff9c0440.iommu: Disable stall request timed out, status: 0xffffffff
When using this patch, the errors disappear.
This seems to be due to the IOMMU device sharing the same power domain
than the device.
When loading an "of_platform" driver, the kernel logic seems to try
enabling the associated IOMMU device before letting the driver handles
anything with the actual VPU hardware.
It appears that setting the power domain of the VPU IOMMU nodes let the
IOMMU driver enable the IOMMU shared power domain, and make the IOMMU
device useable.
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 45ec4e89..46e1b8e2 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -1262,6 +1263,7 @@
interrupt-names = "hevc_mmu";
clocks = <&cru ACLK_HEVC>, <&cru HCLK_HEVC>;
clock-names = "aclk", "iface";
+ power-domains = <&power RK3288_PD_HEVC>;
#iommu-cells = <0>;
status = "disabled";
};
--
2.16.4

View File

@ -0,0 +1,46 @@
From 4ab4f88649468dada5d609e1a6f8a71a7d5610c9 Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Sat, 29 Sep 2018 02:48:59 +0200
Subject: [PATCH 4/6] dts: 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
The original description was :
Add the VOP DCLKs to the assigned clocks list so their
parents can be set in the dts include files for
devices that do dedicate npll to a vop.
https://www.spinics.net/lists/arm-kernel/msg673162.html
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
arch/arm/boot/dts/rk3288.dtsi | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index d23c7fa55..ff04aab5e 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -867,12 +867,14 @@
rockchip,grf = <&grf>;
#clock-cells = <1>;
#reset-cells = <1>;
- assigned-clocks = <&cru PLL_GPLL>, <&cru PLL_CPLL>,
+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>,
+ <&cru PLL_GPLL>, <&cru PLL_CPLL>,
<&cru PLL_NPLL>, <&cru ACLK_CPU>,
<&cru HCLK_CPU>, <&cru PCLK_CPU>,
<&cru ACLK_PERI>, <&cru HCLK_PERI>,
<&cru PCLK_PERI>;
- assigned-clock-rates = <594000000>, <400000000>,
+ assigned-clock-rates = <0>, <0>,
+ <594000000>, <400000000>,
<500000000>, <300000000>,
<150000000>, <75000000>,
<300000000>, <150000000>,
--
2.16.4

View File

@ -0,0 +1,50 @@
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

@ -0,0 +1,116 @@
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

@ -0,0 +1,74 @@
From e7b60b10cf3fd2f4374ab26c314383121c27fe82 Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Tue, 22 Jan 2019 21:24:37 +0100
Subject: [PATCH] soc: rockchip: power-domain: export idle request for RKMPP
This function, and the added header, are required by the RKMPP driver,
provided by Randy Li. However, I can't attest that the provided code
is correct.
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
drivers/soc/rockchip/pm_domains.c | 23 +++++++++++++++++++++++
include/soc/rockchip/pm_domains.h | 15 +++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 include/soc/rockchip/pm_domains.h
diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
index 847c7c482..3e2e252cb 100644
--- a/drivers/soc/rockchip/pm_domains.c
+++ b/drivers/soc/rockchip/pm_domains.c
@@ -199,6 +199,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/soc/rockchip/pm_domains.h b/include/soc/rockchip/pm_domains.h
new file mode 100644
index 000000000..720b3314e
--- /dev/null
+++ b/include/soc/rockchip/pm_domains.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.16.4

View File

@ -0,0 +1,101 @@
FROM: Solidhal <hal@halemmerich.com>
This patch reverses commit 2b721118b7821107757eb1d37af4b60e877b27e7, as can bee seen here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2b721118b7821107757eb1d37af4b60e877b27e7
This commit caused issues on veyron speedy with ath9k and dwc2 drivers. Any ath9k device (ar9271)
would intermittently work, most of the time ending in errors as can bee seen here:
https://github.com/SolidHal/PrawnOS/issues/38
This commit fixes that issue.
This is only a temporary work around while a permenant fix is found, as this commit seems to only cause issues
with dwc2
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
--- b/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ a/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -115,10 +115,10 @@
cmd->skb = skb;
cmd->hif_dev = hif_dev;
+ usb_fill_bulk_urb(urb, hif_dev->udev,
+ usb_sndbulkpipe(hif_dev->udev, USB_REG_OUT_PIPE),
- usb_fill_int_urb(urb, hif_dev->udev,
- usb_sndintpipe(hif_dev->udev, USB_REG_OUT_PIPE),
skb->data, skb->len,
+ hif_usb_regout_cb, cmd);
- hif_usb_regout_cb, cmd, 1);
usb_anchor_urb(urb, &hif_dev->regout_submitted);
ret = usb_submit_urb(urb, GFP_KERNEL);
@@ -735,11 +735,11 @@
rx_buf->skb = nskb;
+ usb_fill_bulk_urb(urb, hif_dev->udev,
+ usb_rcvbulkpipe(hif_dev->udev,
- usb_fill_int_urb(urb, hif_dev->udev,
- usb_rcvintpipe(hif_dev->udev,
USB_REG_IN_PIPE),
nskb->data, MAX_REG_IN_BUF_SIZE,
+ ath9k_hif_usb_reg_in_cb, nskb);
- ath9k_hif_usb_reg_in_cb, rx_buf, 1);
}
resubmit:
@@ -909,11 +909,11 @@
rx_buf->hif_dev = hif_dev;
rx_buf->skb = skb;
+ usb_fill_bulk_urb(urb, hif_dev->udev,
+ usb_rcvbulkpipe(hif_dev->udev,
- usb_fill_int_urb(urb, hif_dev->udev,
- usb_rcvintpipe(hif_dev->udev,
USB_REG_IN_PIPE),
skb->data, MAX_REG_IN_BUF_SIZE,
+ ath9k_hif_usb_reg_in_cb, skb);
- ath9k_hif_usb_reg_in_cb, rx_buf, 1);
/* Anchor URB */
usb_anchor_urb(urb, &hif_dev->reg_in_submitted);
@@ -1031,7 +1031,9 @@
static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev)
{
+ struct usb_host_interface *alt = &hif_dev->interface->altsetting[0];
+ struct usb_endpoint_descriptor *endp;
+ int ret, idx;
- int ret;
ret = ath9k_hif_usb_download_fw(hif_dev);
if (ret) {
@@ -1041,6 +1043,20 @@
return ret;
}
+ /* On downloading the firmware to the target, the USB descriptor of EP4
+ * is 'patched' to change the type of the endpoint to Bulk. This will
+ * bring down CPU usage during the scan period.
+ */
+ for (idx = 0; idx < alt->desc.bNumEndpoints; idx++) {
+ endp = &alt->endpoint[idx].desc;
+ if ((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
+ == USB_ENDPOINT_XFER_INT) {
+ endp->bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK;
+ endp->bmAttributes |= USB_ENDPOINT_XFER_BULK;
+ endp->bInterval = 0;
+ }
+ }
+
/* Alloc URBs */
ret = ath9k_hif_usb_alloc_urbs(hif_dev);
if (ret) {
@@ -1252,7 +1268,7 @@
if (!buf)
return;
+ ret = usb_bulk_msg(udev, usb_sndbulkpipe(udev, USB_REG_OUT_PIPE),
- ret = usb_interrupt_msg(udev, usb_sndintpipe(udev, USB_REG_OUT_PIPE),
buf, 4, NULL, USB_MSG_TIMEOUT);
if (ret)
dev_err(&udev->dev, "ath9k_htc: USB reboot failed\n");

View File

@ -0,0 +1,178 @@
From e03d074b8ec00718337e7373e991912f6b6f9a52 Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Mon, 5 Nov 2018 19:53:43 +0100
Subject: [PATCH] clk: rockchip: 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.
Now, I still have to test if that patch does anything useful on
RK3288 boards. If it doesn't, I might just throw it away on next
versions.
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
drivers/clk/rockchip/clk-rk3288.c | 68 ++++++++++++++++++++++++++++++++-------
drivers/clk/rockchip/clk.h | 3 ++
2 files changed, 59 insertions(+), 12 deletions(-)
diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
index 13b38cb89..0d8b99b6b 100644
--- a/drivers/clk/rockchip/clk-rk3288.c
+++ b/drivers/clk/rockchip/clk-rk3288.c
@@ -215,10 +215,13 @@ 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", "unstable:usbphy480m_src" };
-PNAME(mux_pll_src_cpll_gll_usb_npll_p) = { "cpll", "gpll", "unstable: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" };
@@ -464,24 +467,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),
@@ -490,16 +493,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),
@@ -573,7 +576,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),
@@ -933,5 +936,6 @@ static void __init rk3288_clk_init(struct device_node *np)
{
struct rockchip_clk_provider *ctx;
+ s32 npll_vop = -1;
rk3288_cru_base = of_iomap(np, 0);
if (!rk3288_cru_base) {
@@ -940,6 +944,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

@ -0,0 +1,434 @@
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>
---
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index cdc304d4c..91c7dc07b 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -73,122 +73,141 @@ struct rockchip_hdmi {
struct clk *grf_clk;
struct dw_hdmi *hdmi;
struct phy *phy;
+ 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)) {
@@ -216,26 +235,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 = {
@@ -251,7 +299,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,
@@ -307,6 +387,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,
@@ -406,7 +487,6 @@ static struct rockchip_hdmi_chip_data rk3228_chip_data = {
};
static const struct dw_hdmi_plat_data rk3228_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,
@@ -423,7 +503,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,
@@ -443,7 +522,6 @@ static struct rockchip_hdmi_chip_data rk3328_chip_data = {
};
static const struct dw_hdmi_plat_data rk3328_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,
@@ -460,7 +538,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,
@@ -558,6 +635,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);
}
@@ -570,6 +648,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);
}

View File

@ -0,0 +1,22 @@
From d4d128324b8f8a9f5c441203d94703e41fa07df3 Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Mon, 5 Nov 2018 19:57:56 +0100
Subject: [PATCH] spi: Added support for Tinkerboard's SPI interface
Imported from ARMbian
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 255786f2e..3a3f2e6fd 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -665,6 +665,7 @@ static const struct of_device_id spidev_dt_ids[] = {
{ .compatible = "lwn,bk4" },
{ .compatible = "dh,dhcom-board" },
{ .compatible = "menlo,m53cpld" },
+ { .compatible = "rockchip,spi_tinker" },
{},
};
MODULE_DEVICE_TABLE(of, spidev_dt_ids);

View File

@ -0,0 +1,395 @@
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index e5b7ef1a5..f88c913ff 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -544,3 +544,6 @@
&wdt {
status = "okay";
};
+&gpiomem {
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index f3ca55496..14bbcb192 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -1418,6 +1418,12 @@
interrupts = <GIC_PPI 9 0xf04>;
};
+ gpiomem: rk3288-gpiomem@ff750000 {
+ compatible = "rockchip,rk3288-gpiomem";
+ reg = <0x0 0xff750000 0x0 0x1000>;
+ status = "disabled";
+ };
+
pinctrl: pinctrl {
compatible = "rockchip,rk3288-pinctrl";
rockchip,grf = <&grf>;
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 3143db5..9c18b74 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -5,6 +5,7 @@
menu "Character devices"
source "drivers/tty/Kconfig"
+source "drivers/char/rockchip/Kconfig"
config DEVMEM
bool "/dev/mem virtual device support"
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index d8a7579..290cb32 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -51,6 +51,8 @@ obj-$(CONFIG_PS3_FLASH) += ps3flash.o
obj-$(CONFIG_JS_RTC) += js-rtc.o
js-rtc-y = rtc.o
+obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
+
obj-$(CONFIG_XILLYBUS) += xillybus/
obj-$(CONFIG_POWERNV_OP_PANEL) += powernv-op-panel.o
obj-$(CONFIG_ADI) += adi.o
diff --git a/drivers/char/rockchip/Kconfig b/drivers/char/rockchip/Kconfig
new file mode 100644
index 0000000..6e97486
--- /dev/null
+++ b/drivers/char/rockchip/Kconfig
@@ -0,0 +1,16 @@
+#
+# Broadcom char driver config
+#
+
+menuconfig RK_CHAR_DRIVERS
+ bool "Rockchip Char Drivers"
+ help
+ Rockchip's char drivers
+
+config RK3288_DEVGPIOMEM
+ tristate "/dev/gpiomem rootless GPIO access via mmap() on the RK3288"
+ default y
+ help
+ Provides users with root-free access to the GPIO registers
+ on the 3288. Calling mmap(/dev/gpiomem) will map the GPIO
+ register page to the user's pointer.
\ No newline at end of file
diff --git a/drivers/char/rockchip/Makefile b/drivers/char/rockchip/Makefile
new file mode 100644
index 0000000..2287ec2
--- /dev/null
+++ b/drivers/char/rockchip/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_RK3288_DEVGPIOMEM)+= rk3288-gpiomem.o
\ No newline at end of file
diff --git a/drivers/char/rockchip/rk3288-gpiomem.c b/drivers/char/rockchip/rk3288-gpiomem.c
new file mode 100644
index 0000000..984471c
--- /dev/null
+++ b/drivers/char/rockchip/rk3288-gpiomem.c
@@ -0,0 +1,303 @@
+/**
+ * GPIO memory device driver
+ *
+ * Creates a chardev /dev/gpiomem which will provide user access to
+ * the rk3288's GPIO registers when it is mmap()'d.
+ * No longer need root for user GPIO access, but without relaxing permissions
+ * on /dev/mem.
+ *
+ * Written by Luke Wren <luke@raspberrypi.org>
+ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The names of the above-listed copyright holders may not be used
+ * to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2, as published by the Free
+ * Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/cdev.h>
+#include <linux/pagemap.h>
+#include <linux/io.h>
+
+#define DEVICE_NAME "rk3288-gpiomem"
+#define DRIVER_NAME "gpiomem-rk3288"
+#define DEVICE_MINOR 0
+
+struct rk3288_gpiomem_instance {
+ unsigned long gpio_regs_phys;
+ struct device *dev;
+};
+
+static struct cdev rk3288_gpiomem_cdev;
+static dev_t rk3288_gpiomem_devid;
+static struct class *rk3288_gpiomem_class;
+static struct device *rk3288_gpiomem_dev;
+static struct rk3288_gpiomem_instance *inst;
+
+
+/****************************************************************************
+*
+* GPIO mem chardev file ops
+*
+***************************************************************************/
+
+static int rk3288_gpiomem_open(struct inode *inode, struct file *file)
+{
+ int dev = iminor(inode);
+ int ret = 0;
+
+ if (dev != DEVICE_MINOR) {
+ dev_err(inst->dev, "Unknown minor device: %d", dev);
+ ret = -ENXIO;
+ }
+ return ret;
+}
+
+static int rk3288_gpiomem_release(struct inode *inode, struct file *file)
+{
+ int dev = iminor(inode);
+ int ret = 0;
+
+ if (dev != DEVICE_MINOR) {
+ dev_err(inst->dev, "Unknown minor device %d", dev);
+ ret = -ENXIO;
+ }
+ return ret;
+}
+
+static const struct vm_operations_struct rk3288_gpiomem_vm_ops = {
+#ifdef CONFIG_HAVE_IOREMAP_PROT
+ .access = generic_access_phys
+#endif
+};
+static int address_is_allowed(unsigned long pfn, unsigned long size)
+{
+ unsigned long address = pfn << PAGE_SHIFT;
+
+ dev_info(inst->dev, "address_is_allowed.pfn: 0x%08lx", address);
+
+ switch(address) {
+
+ case 0xff750000:
+ case 0xff760000:
+ case 0xff780000:
+ case 0xff790000:
+ case 0xff7a0000:
+ case 0xff7b0000:
+ case 0xff7c0000:
+ case 0xff7d0000:
+ case 0xff7e0000:
+ case 0xff7f0000:
+ case 0xff7f2000:
+ case 0xff770000:
+ case 0xff730000:
+ case 0xff680000:
+ dev_info(inst->dev, "address_is_allowed.return 1");
+ return 1;
+ break;
+ default :
+ dev_info(inst->dev, "address_is_allowed.return 0");
+ return 0;
+ }
+}
+
+static int rk3288_gpiomem_mmap(struct file *file, struct vm_area_struct *vma)
+{
+
+ size_t size;
+
+ size = vma->vm_end - vma->vm_start;
+
+
+ if (!address_is_allowed(vma->vm_pgoff, size))
+ return -EPERM;
+
+ vma->vm_page_prot = phys_mem_access_prot(file, vma->vm_pgoff,
+ size,
+ vma->vm_page_prot);
+
+ vma->vm_ops = &rk3288_gpiomem_vm_ops;
+
+ /* Remap-pfn-range will mark the range VM_IO */
+ if (remap_pfn_range(vma,
+ vma->vm_start,
+ vma->vm_pgoff,
+ size,
+ vma->vm_page_prot)) {
+ return -EAGAIN;
+ }
+
+ return 0;
+}
+
+static const struct file_operations
+rk3288_gpiomem_fops = {
+ .owner = THIS_MODULE,
+ .open = rk3288_gpiomem_open,
+ .release = rk3288_gpiomem_release,
+ .mmap = rk3288_gpiomem_mmap,
+};
+
+static int rk3288_gpiomem_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+ add_uevent_var(env, "DEVMODE=%#o", 0666);
+ return 0;
+}
+
+ /****************************************************************************
+*
+* Probe and remove functions
+*
+***************************************************************************/
+
+
+static int rk3288_gpiomem_probe(struct platform_device *pdev)
+{
+ int err;
+ void *ptr_err;
+ struct device *dev = &pdev->dev;
+ struct resource *ioresource;
+
+ /* Allocate buffers and instance data */
+
+ inst = kzalloc(sizeof(struct rk3288_gpiomem_instance), GFP_KERNEL);
+
+ if (!inst) {
+ err = -ENOMEM;
+ goto failed_inst_alloc;
+ }
+
+ inst->dev = dev;
+
+ ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (ioresource) {
+ inst->gpio_regs_phys = ioresource->start;
+ } else {
+ dev_err(inst->dev, "failed to get IO resource");
+ err = -ENOENT;
+ goto failed_get_resource;
+ }
+
+ /* Create character device entries */
+
+ err = alloc_chrdev_region(&rk3288_gpiomem_devid,
+ DEVICE_MINOR, 1, DEVICE_NAME);
+ if (err != 0) {
+ dev_err(inst->dev, "unable to allocate device number");
+ goto failed_alloc_chrdev;
+ }
+ cdev_init(&rk3288_gpiomem_cdev, &rk3288_gpiomem_fops);
+ rk3288_gpiomem_cdev.owner = THIS_MODULE;
+ err = cdev_add(&rk3288_gpiomem_cdev, rk3288_gpiomem_devid, 1);
+ if (err != 0) {
+ dev_err(inst->dev, "unable to register device");
+ goto failed_cdev_add;
+ }
+
+ /* Create sysfs entries */
+
+ rk3288_gpiomem_class = class_create(THIS_MODULE, DEVICE_NAME);
+ ptr_err = rk3288_gpiomem_class;
+ if (IS_ERR(ptr_err))
+ goto failed_class_create;
+ rk3288_gpiomem_class->dev_uevent = rk3288_gpiomem_dev_uevent;
+ rk3288_gpiomem_dev = device_create(rk3288_gpiomem_class, NULL,
+ rk3288_gpiomem_devid, NULL,
+ "gpiomem");
+ ptr_err = rk3288_gpiomem_dev;
+ if (IS_ERR(ptr_err))
+ goto failed_device_create;
+
+ dev_info(inst->dev, "Initialised: Registers at 0x%08lx",
+ inst->gpio_regs_phys);
+
+ return 0;
+
+failed_device_create:
+ class_destroy(rk3288_gpiomem_class);
+failed_class_create:
+ cdev_del(&rk3288_gpiomem_cdev);
+ err = PTR_ERR(ptr_err);
+failed_cdev_add:
+ unregister_chrdev_region(rk3288_gpiomem_devid, 1);
+failed_alloc_chrdev:
+failed_get_resource:
+ kfree(inst);
+failed_inst_alloc:
+ dev_err(inst->dev, "could not load rk3288_gpiomem");
+ return err;
+}
+
+static int rk3288_gpiomem_remove(struct platform_device *pdev)
+{
+ struct device *dev = inst->dev;
+
+ kfree(inst);
+ device_destroy(rk3288_gpiomem_class, rk3288_gpiomem_devid);
+ class_destroy(rk3288_gpiomem_class);
+ cdev_del(&rk3288_gpiomem_cdev);
+ unregister_chrdev_region(rk3288_gpiomem_devid, 1);
+
+ dev_info(dev, "GPIO mem driver removed - OK");
+ return 0;
+}
+
+ /****************************************************************************
+*
+* Register the driver with device tree
+*
+***************************************************************************/
+
+static const struct of_device_id rk3288_gpiomem_of_match[] = {
+ {.compatible = "rockchip,rk3288-gpiomem",},
+ { /* sentinel */ },
+};
+
+MODULE_DEVICE_TABLE(of, rk3288_gpiomem_of_match);
+
+static struct platform_driver rk3288_gpiomem_driver = {
+ .probe = rk3288_gpiomem_probe,
+ .remove = rk3288_gpiomem_remove,
+ .driver = {
+ .name = DRIVER_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = rk3288_gpiomem_of_match,
+ },
+};
+
+module_platform_driver(rk3288_gpiomem_driver);
+
+MODULE_ALIAS("platform:gpiomem-rk3288");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace");
+MODULE_AUTHOR("Luke Wren <luke@raspberrypi.org>");
\ No newline at end of file

View File

@ -0,0 +1,32 @@
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index bc3601a..37ae378 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -467,13 +467,6 @@
};
thermal-zones {
- reserve_thermal: reserve_thermal {
- polling-delay-passive = <1000>; /* milliseconds */
- polling-delay = <5000>; /* milliseconds */
-
- thermal-sensors = <&tsadc 0>;
- };
-
cpu_thermal: cpu_thermal {
polling-delay-passive = <100>; /* milliseconds */
polling-delay = <5000>; /* milliseconds */
@@ -539,6 +532,13 @@
};
};
};
+
+ reserve_thermal: reserve_thermal {
+ polling-delay-passive = <1000>; /* milliseconds */
+ polling-delay = <5000>; /* milliseconds */
+
+ thermal-sensors = <&tsadc 0>;
+ };
};
tsadc: tsadc@ff280000 {

View File

@ -0,0 +1,19 @@
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 2bfe4e80a..cea93aaf5 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -382,6 +382,14 @@ static void usb_audio_make_shortname(struct usb_device *dev,
}
strim(card->shortname);
+
+ /* Tinker Board ALC4040 CODEC */
+
+ if(USB_ID_VENDOR(chip->usb_id) == 0x0bda &&
+ USB_ID_PRODUCT(chip->usb_id) == 0x481a) {
+ strlcat(card->shortname, " OnBoard", sizeof(card->shortname));
+ }
+
}
static void usb_audio_make_longname(struct usb_device *dev,

View File

@ -0,0 +1,80 @@
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 58bd91539..9c0dac199 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -153,6 +153,75 @@
opp-hz = /bits/ 64 <1608000000>;
opp-microvolt = <1350000>;
};
+ 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;
+ };
};
amba {

View File

@ -0,0 +1,23 @@
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index a907d7b06..ec71996c7 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -619,13 +619,17 @@ BRCMF_FW_DEF(4354, "brcmfmac4354-sdio");
BRCMF_FW_DEF(4356, "brcmfmac4356-sdio");
BRCMF_FW_DEF(4373, "brcmfmac4373-sdio");
+/* AMPAK */
+BRCMF_FW_DEF(AP6330, "brcmfmac-ap6330-sdio");
+
static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x0000001F, 43241B0),
BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x00000020, 43241B4),
BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0xFFFFFFC0, 43241B5),
BRCMF_FW_ENTRY(BRCM_CC_4329_CHIP_ID, 0xFFFFFFFF, 4329),
- BRCMF_FW_ENTRY(BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, 4330),
+ BRCMF_FW_ENTRY(BRCM_CC_4330_CHIP_ID, 0xFFFFFFEF, 4330),
+ BRCMF_FW_ENTRY(BRCM_CC_4330_CHIP_ID, 0x10, AP6330),
BRCMF_FW_ENTRY(BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, 4334),
BRCMF_FW_ENTRY(BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF, 43340),
BRCMF_FW_ENTRY(BRCM_CC_43341_CHIP_ID, 0xFFFFFFFF, 43340),

View File

@ -0,0 +1,13 @@
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index 01be2bca9..5439e29e0 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -64,7 +64,7 @@
sound {
compatible = "simple-audio-card";
simple-audio-card,format = "i2s";
- simple-audio-card,name = "rockchip,tinker-codec";
+ simple-audio-card,name = "DW-I2S-HDMI";
simple-audio-card,mclk-fs = <512>;
simple-audio-card,codec {

View File

@ -0,0 +1,19 @@
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5bd58b95d..48ebe081f 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1684,6 +1684,14 @@ void mmc_power_off(struct mmc_host *host)
if (host->ios.power_mode == MMC_POWER_OFF)
return;
+ mmc_set_initial_signal_voltage(host);
+
+ /*
+ * This delay should be sufficient to allow the power supply
+ * to reach the minimum voltage.
+ */
+ mmc_delay(host->ios.power_delay_ms);
+
mmc_pwrseq_power_off(host);
host->ios.clock = 0;

View File

@ -0,0 +1,22 @@
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index a98dee2ae..d3cef7033 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -916,17 +916,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
rk3288-rock2-square.dtb \
rk3288-tinker.dtb \
rk3288-tinker-s.dtb \
- rk3288-veyron-brain.dtb \
- rk3288-veyron-fievel.dtb \
- rk3288-veyron-jaq.dtb \
- rk3288-veyron-jerry.dtb \
- rk3288-veyron-mickey.dtb \
- rk3288-veyron-mighty.dtb \
- rk3288-veyron-minnie.dtb \
- rk3288-veyron-pinky.dtb \
- rk3288-veyron-speedy.dtb \
- rk3288-veyron-tiger.dtb \
rk3288-vyasa.dtb
dtb-$(CONFIG_ARCH_S3C24XX) += \
s3c2416-smdk2416.dtb
dtb-$(CONFIG_ARCH_S3C64XX) += \

View File

@ -0,0 +1,37 @@
From cd1aac268ff58eea28153bbabfb33abc2df52b1f Mon Sep 17 00:00:00 2001
Message-Id: <cd1aac268ff58eea28153bbabfb33abc2df52b1f.1602103621.git.stefan@agner.ch>
From: Pascal Vizeli <pvizeli@syshack.ch>
Date: Fri, 24 Apr 2020 12:41:50 +0000
Subject: [PATCH 1/4] SPL: modify load address of U-Boot
Default load address of U-Boot is at sector 16384, which is where HAOS
has its first partition. Use 0x2000 (8192) instead.
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
configs/tinker-rk3288_defconfig | 1 +
configs/tinker-s-rk3288_defconfig | 1 +
2 files changed, 2 insertions(+)
diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
index d459c7f50d..e0682ed479 100644
--- a/configs/tinker-rk3288_defconfig
+++ b/configs/tinker-rk3288_defconfig
@@ -88,3 +88,4 @@ CONFIG_VIDEO_ROCKCHIP=y
CONFIG_DISPLAY_ROCKCHIP_HDMI=y
CONFIG_CMD_DHRYSTONE=y
CONFIG_ERRNO_STR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x2000
diff --git a/configs/tinker-s-rk3288_defconfig b/configs/tinker-s-rk3288_defconfig
index 68411d863b..1a285baf73 100644
--- a/configs/tinker-s-rk3288_defconfig
+++ b/configs/tinker-s-rk3288_defconfig
@@ -90,3 +90,4 @@ CONFIG_DISPLAY_ROCKCHIP_HDMI=y
CONFIG_CONSOLE_SCROLL_LINES=10
CONFIG_CMD_DHRYSTONE=y
CONFIG_ERRNO_STR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x2000
--
2.28.0

View File

@ -1,61 +0,0 @@
From 78bd1a46cfc585773719963ce8e0a380e9676a93 Mon Sep 17 00:00:00 2001
From: Pascal Vizeli <pvizeli@syshack.ch>
Date: Fri, 24 Apr 2020 11:37:55 +0000
Subject: [PATCH] pmic: enable LDO2 vcc33_mipi at bootup
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
---
board/rockchip/tinker_rk3288/tinker-rk3288.c | 36 ++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/board/rockchip/tinker_rk3288/tinker-rk3288.c b/board/rockchip/tinker_rk3288/tinker-rk3288.c
index e966e9f201a..2944d8c084f 100644
--- a/board/rockchip/tinker_rk3288/tinker-rk3288.c
+++ b/board/rockchip/tinker_rk3288/tinker-rk3288.c
@@ -9,6 +9,7 @@
#include <init.h>
#include <net.h>
#include <netdev.h>
+#include <power/regulator.h>
static int get_ethaddr_from_eeprom(u8 *addr)
{
@@ -34,3 +35,38 @@ int rk3288_board_late_init(void)
return 0;
}
+
+#ifdef CONFIG_DM_PMIC
+static int rockchip_set_regulator_on(const char *name, uint uv)
+{
+ struct udevice *dev;
+ int ret;
+
+ ret = regulator_get_by_platname(name, &dev);
+ if (ret) {
+ debug("%s: Cannot find regulator %s\n", __func__, name);
+ return ret;
+ }
+ ret = regulator_set_value(dev, uv);
+ if (ret) {
+ debug("%s: Cannot set regulator %s\n", __func__, name);
+ return ret;
+ }
+ ret = regulator_set_enable(dev, 1);
+ if (ret) {
+ debug("%s: Cannot enable regulator %s\n", __func__, name);
+ return ret;
+ }
+
+ return 0;
+}
+
+int power_init_board(void)
+{
+ int ret = rockchip_set_regulator_on("vcc33_mipi", 3300000);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+#endif

View File

@ -0,0 +1,55 @@
From d49ad12ee89d0d64f1f594bcad7de0e4f9631add Mon Sep 17 00:00:00 2001
Message-Id: <d49ad12ee89d0d64f1f594bcad7de0e4f9631add.1602103621.git.stefan@agner.ch>
In-Reply-To: <cd1aac268ff58eea28153bbabfb33abc2df52b1f.1602103621.git.stefan@agner.ch>
References: <cd1aac268ff58eea28153bbabfb33abc2df52b1f.1602103621.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Fri, 4 Sep 2020 15:40:55 +0200
Subject: [PATCH 2/4] rockchip: dts: tinker: move i2c node to shared device
tree
The I2C EEPROM is present on Tinker Board S as well. Move the i2c node
to the shared, U-Boot specific rk3288-tinker-u-boot.dtsi device tree.
Cc: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/dts/rk3288-tinker-u-boot.dtsi | 7 +++++++
arch/arm/dts/rk3288-tinker.dts | 7 -------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm/dts/rk3288-tinker-u-boot.dtsi b/arch/arm/dts/rk3288-tinker-u-boot.dtsi
index 732aa4f91f..3d169906fd 100644
--- a/arch/arm/dts/rk3288-tinker-u-boot.dtsi
+++ b/arch/arm/dts/rk3288-tinker-u-boot.dtsi
@@ -17,6 +17,13 @@
rockchip,sdram-params = <0x20d266a4 0x5b6 2 533000000 6 9 0>;
};
+&i2c2 {
+ m24c08@50 {
+ compatible = "at,24c08", "i2c-eeprom";
+ reg = <0x50>;
+ };
+};
+
&pinctrl {
u-boot,dm-pre-reloc;
};
diff --git a/arch/arm/dts/rk3288-tinker.dts b/arch/arm/dts/rk3288-tinker.dts
index 4b8405fd82..338670123b 100644
--- a/arch/arm/dts/rk3288-tinker.dts
+++ b/arch/arm/dts/rk3288-tinker.dts
@@ -35,10 +35,3 @@
vbus-supply = <&vcc5v0_host>;
status = "okay";
};
-
-&i2c2 {
- m24c08@50 {
- compatible = "at,24c08", "i2c-eeprom";
- reg = <0x50>;
- };
-};
--
2.28.0

View File

@ -0,0 +1,34 @@
From 07a02625ba95f68ba670b4c1cc98567acb390195 Mon Sep 17 00:00:00 2001
Message-Id: <07a02625ba95f68ba670b4c1cc98567acb390195.1602103621.git.stefan@agner.ch>
In-Reply-To: <cd1aac268ff58eea28153bbabfb33abc2df52b1f.1602103621.git.stefan@agner.ch>
References: <cd1aac268ff58eea28153bbabfb33abc2df52b1f.1602103621.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Fri, 4 Sep 2020 15:44:38 +0200
Subject: [PATCH 3/4] rockchip: dts: tinker: remove unnecessary node
The property reg-shift with the same value is present in the base
device tree already. Remove unnecessary node from rk3288-tinker.dts.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/dts/rk3288-tinker.dts | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/arm/dts/rk3288-tinker.dts b/arch/arm/dts/rk3288-tinker.dts
index 338670123b..8b1848c310 100644
--- a/arch/arm/dts/rk3288-tinker.dts
+++ b/arch/arm/dts/rk3288-tinker.dts
@@ -27,10 +27,6 @@
status = "okay";
};
-&uart2 {
- reg-shift = <2>;
-};
-
&usb_host1 {
vbus-supply = <&vcc5v0_host>;
status = "okay";
--
2.28.0

View File

@ -0,0 +1,68 @@
From 549d98c233b2a8b7cd4b0d4eb9652ad60a8a0f75 Mon Sep 17 00:00:00 2001
Message-Id: <549d98c233b2a8b7cd4b0d4eb9652ad60a8a0f75.1602103621.git.stefan@agner.ch>
In-Reply-To: <cd1aac268ff58eea28153bbabfb33abc2df52b1f.1602103621.git.stefan@agner.ch>
References: <cd1aac268ff58eea28153bbabfb33abc2df52b1f.1602103621.git.stefan@agner.ch>
From: Pascal Vizeli <pvizeli@syshack.ch>
Date: Fri, 24 Apr 2020 11:37:55 +0000
Subject: [PATCH 4/4] pmic: enable LDO2 vcc33_mipi at bootup
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
---
board/rockchip/tinker_rk3288/tinker-rk3288.c | 37 ++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/board/rockchip/tinker_rk3288/tinker-rk3288.c b/board/rockchip/tinker_rk3288/tinker-rk3288.c
index f85209c649..6fa1bb0c66 100644
--- a/board/rockchip/tinker_rk3288/tinker-rk3288.c
+++ b/board/rockchip/tinker_rk3288/tinker-rk3288.c
@@ -13,6 +13,7 @@
#include <netdev.h>
#include <asm/arch-rockchip/bootrom.h>
#include <asm/io.h>
+#include <power/regulator.h>
static int get_ethaddr_from_eeprom(u8 *addr)
{
@@ -48,3 +49,39 @@ int mmc_get_env_dev(void)
return 1;
}
+
+
+#ifdef CONFIG_DM_PMIC
+static int rockchip_set_regulator_on(const char *name, uint uv)
+{
+ struct udevice *dev;
+ int ret;
+
+ ret = regulator_get_by_platname(name, &dev);
+ if (ret) {
+ debug("%s: Cannot find regulator %s\n", __func__, name);
+ return ret;
+ }
+ ret = regulator_set_value(dev, uv);
+ if (ret) {
+ debug("%s: Cannot set regulator %s\n", __func__, name);
+ return ret;
+ }
+ ret = regulator_set_enable(dev, 1);
+ if (ret) {
+ debug("%s: Cannot enable regulator %s\n", __func__, name);
+ return ret;
+ }
+
+ return 0;
+}
+
+int power_init_board(void)
+{
+ int ret = rockchip_set_regulator_on("vcc33_mipi", 3300000);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+#endif
--
2.28.0

View File

@ -16,47 +16,21 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B"
test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
# Allows ConditionFirstBoot=
test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true"
# HassOS bootargs
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}"
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor systemd.machine_id=${MACHINE_ID} cgroup_enable=memory fsck.repair=yes"
# HassOS system A/B
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd ro rootwait"
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 ro rootwait"
# Load environment from haos-config.txt
if test -e mmc ${devnum}:1 haos-config.txt; then
fatload mmc ${devnum}:1 ${ramdisk_addr_r} haos-config.txt
env import -t ${ramdisk_addr_r} ${filesize}
fi
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro rootwait"
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro rootwait"
# Load extraargs
fileenv mmc ${devnum}:1 ${ramdisk_addr_r} cmdline.txt cmdline
# Load device tree
if test "$devnum" = "0"; then
setenv fdtfile "rk3288-tinker-s.dtb"
fatload mmc ${devnum}:1 ${fdt_addr_r} rk3288-tinker-s.dtb
else
setenv fdtfile "rk3288-tinker.dtb"
fi
echo "Loading standard device tree ${fdtfile}"
fatload mmc ${devnum}:1 ${fdt_addr_r} ${fdtfile}
fdt addr ${fdt_addr_r}
# load dt overlays
fdt resize 65536
for overlay_file in ${overlays}; do
if fatload mmc ${devnum}:1 ${ramdisk_addr_r} overlays/${overlay_file}.dtbo; then
echo "Applying kernel provided DT overlay ${overlay_file}.dtbo"
fdt apply ${ramdisk_addr_r} || setenv overlay_error "true"
fi
done
if test "${overlay_error}" = "true"; then
echo "Error applying DT overlays, restoring original DT"
fatload mmc ${devnum}:1 ${fdt_addr_r} ${fdtfile}
fatload mmc ${devnum}:1 ${fdt_addr_r} rk3288-tinker.dtb
fi
setenv bootargs
@ -67,7 +41,7 @@ for BOOT_SLOT in "${BOOT_ORDER}"; do
if test ${BOOT_A_LEFT} -gt 0; then
setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1
echo "Trying to boot slot A, ${BOOT_A_LEFT} attempts remaining. Loading kernel ..."
if load mmc ${devnum}:2 ${kernel_addr_r} zImage; then
if ext4load mmc ${devnum}:2 ${kernel_addr_r} zImage; then
setenv bootargs "${bootargs_hassos} ${bootargs_a} rauc.slot=A ${cmdline}"
fi
fi
@ -75,7 +49,7 @@ for BOOT_SLOT in "${BOOT_ORDER}"; do
if test ${BOOT_B_LEFT} -gt 0; then
setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1
echo "Trying to boot slot B, ${BOOT_B_LEFT} attempts remaining. Loading kernel ..."
if load mmc ${devnum}:4 ${kernel_addr_r} zImage; then
if ext4load mmc ${devnum}:4 ${kernel_addr_r} zImage; then
setenv bootargs "${bootargs_hassos} ${bootargs_b} rauc.slot=B ${cmdline}"
fi
fi

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