mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-24 13:36:31 +00:00
Opi prime updates (#315)
* Backport support for Linux 4.19 Signed-off-by: Alastair D'Silva <alastair@d-silva.org> * OPI: Update Orange Pi Prime config to use Linux 4.19 Signed-off-by: Alastair D'Silva <alastair@d-silva.org> * OPI: Enable I2C0 on the Orange Pi Prime Signed-off-by: Alastair D'Silva <alastair@d-silva.org> * OPI: Enable GPIO via sysfs Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
This commit is contained in:
parent
4aa07960d8
commit
e858c774d2
@ -7,5 +7,5 @@
|
||||
| Raspberry Pi | 4.14.81 |
|
||||
| Tinker Board | 4.14.82 |
|
||||
| Odroid-C2 | 4.18.20 |
|
||||
| Orangepi-Prime | 4.18.20 |
|
||||
| Orangepi-Prime | 4.19.13 |
|
||||
| Intel NUC | 4.14.82 |
|
||||
|
@ -9,8 +9,8 @@ function hassos_pre_image() {
|
||||
|
||||
cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
|
||||
cp "${BINARIES_DIR}/sun50i-h5-orangepi-prime.dtb" "${BOOT_DATA}/sun50i-h5-orangepi-prime.dtb"
|
||||
cp "${BOARD_DIR}/config.txt" "${BOOT_DATA}/config.txt"
|
||||
touch "${BOOT_DATA}/cmdline.txt"
|
||||
touch "${BOOT_DATA}/config.txt"
|
||||
|
||||
# SPL
|
||||
create_spl_image
|
||||
|
3
buildroot-external/board/orangepi/kernel.config
Normal file
3
buildroot-external/board/orangepi/kernel.config
Normal file
@ -0,0 +1,3 @@
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_SYSFS=y
|
||||
|
3
buildroot-external/board/orangepi/prime/config.txt
Normal file
3
buildroot-external/board/orangepi/prime/config.txt
Normal file
@ -0,0 +1,3 @@
|
||||
i2c0_enable=true
|
||||
i2c1_enable=false
|
||||
i2c2_enable=false
|
@ -11,10 +11,6 @@ setenv storebootstate " \
|
||||
env export -c -s 0x8000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \
|
||||
mmc write ${ramdisk_addr_r} ${mmc_env} 0x40;"
|
||||
|
||||
if load mmc ${devnum}:1 ${ramdisk_addr_r} config.txt; then
|
||||
env import -t ${ramdisk_addr_r} ${filesize};
|
||||
fi
|
||||
|
||||
run loadbootstate
|
||||
test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B"
|
||||
test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3
|
||||
@ -32,6 +28,23 @@ fileenv mmc ${devnum}:1 ${ramdisk_addr_r} cmdline.txt cmdline
|
||||
|
||||
# Load device tree
|
||||
fatload mmc ${devnum}:1 ${fdt_addr_r} sun50i-h5-orangepi-prime.dtb
|
||||
fdt addr ${fdt_addr_r}
|
||||
|
||||
if load mmc ${devnum}:1 ${ramdisk_addr_r} config.txt; then
|
||||
env import -t ${ramdisk_addr_r} ${filesize};
|
||||
fi
|
||||
|
||||
if test "${i2c0_enable}" != "false"; then
|
||||
fdt set /soc/i2c@1c2ac00 status "okay"
|
||||
fi
|
||||
|
||||
if test "${i2c1_enable}" != "false"; then
|
||||
fdt set /soc/i2c@1c2b000 status "okay"
|
||||
fi
|
||||
|
||||
if test "${i2c2_enable}" != "false"; then
|
||||
fdt set /soc/i2c@1c2b400 status "okay"
|
||||
fi
|
||||
|
||||
setenv bootargs
|
||||
for BOOT_SLOT in "${BOOT_ORDER}"; do
|
||||
|
@ -6,7 +6,7 @@ BR2_CCACHE=y
|
||||
BR2_CCACHE_DIR="/cache/cc"
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/orangepi/patches"
|
||||
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_18=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
|
||||
BR2_GCC_VERSION_7_X=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_BINUTILS_ENABLE_LTO=y
|
||||
@ -38,14 +38,14 @@ BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE="$(BR2_EXTERNAL_HASSOS_PATH)/board/orangepi/
|
||||
BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/bootloader/uboot.config $(BR2_EXTERNAL_HASSOS_PATH)/board/orangepi/prime/uboot.config"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.18.20"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.13"
|
||||
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun50i-h5-orangepi-prime"
|
||||
BR2_LINUX_KERNEL_LZ4=y
|
||||
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
|
||||
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
|
||||
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/orangepi/kernel.config"
|
||||
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay"
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh"
|
||||
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
|
27
buildroot-patches/0013-linux-bump-default-to-4.19.2.patch
Normal file
27
buildroot-patches/0013-linux-bump-default-to-4.19.2.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From 377944f65a74670075c1878a0b6b61ad84856ed5 Mon Sep 17 00:00:00 2001
|
||||
From: Baruch Siach <baruch@tkos.co.il>
|
||||
Date: Tue, 20 Nov 2018 15:30:08 +0200
|
||||
Subject: [PATCH] linux: bump default to 4.19.2
|
||||
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
||||
---
|
||||
linux/Config.in | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/linux/Config.in b/linux/Config.in
|
||||
index ecb12d0b16..c75e149a37 100644
|
||||
--- a/linux/Config.in
|
||||
+++ b/linux/Config.in
|
||||
@@ -30,7 +30,7 @@ choice
|
||||
prompt "Kernel version"
|
||||
|
||||
config BR2_LINUX_KERNEL_LATEST_VERSION
|
||||
- bool "Latest version (4.18)"
|
||||
+ bool "Latest version (4.19)"
|
||||
|
||||
config BR2_LINUX_KERNEL_LATEST_CIP_VERSION
|
||||
bool "Latest CIP SLTS version (v4.4.138-cip25)"
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,50 @@
|
||||
From 561770fd032744b4daac186c1ede9bce1d4b4c45 Mon Sep 17 00:00:00 2001
|
||||
From: Baruch Siach <baruch@tkos.co.il>
|
||||
Date: Tue, 20 Nov 2018 15:30:06 +0200
|
||||
Subject: [PATCH] toolchain: add 4.19.x choice for headers
|
||||
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
||||
---
|
||||
toolchain/Config.in | 5 +++++
|
||||
.../toolchain-external-custom/Config.in.options | 4 ++++
|
||||
2 files changed, 9 insertions(+)
|
||||
|
||||
diff --git a/toolchain/Config.in b/toolchain/Config.in
|
||||
index c2192a52b1..474e3c8bba 100644
|
||||
--- a/toolchain/Config.in
|
||||
+++ b/toolchain/Config.in
|
||||
@@ -361,10 +361,15 @@ config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
|
||||
bool
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
|
||||
|
||||
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
|
||||
+ bool
|
||||
+ select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
|
||||
+
|
||||
# This order guarantees that the highest version is set, as kconfig
|
||||
# stops affecting a value on the first matching default.
|
||||
config BR2_TOOLCHAIN_HEADERS_AT_LEAST
|
||||
string
|
||||
+ default "4.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
|
||||
default "4.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
|
||||
default "4.17" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
|
||||
default "4.16" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
|
||||
diff --git a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
|
||||
index 8665d2e2a7..288fc3f3e0 100644
|
||||
--- a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
|
||||
+++ b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
|
||||
@@ -123,6 +123,10 @@ choice
|
||||
m = ( LINUX_VERSION_CODE >> 8 ) & 0xFF
|
||||
p = ( LINUX_VERSION_CODE >> 0 ) & 0xFF
|
||||
|
||||
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19
|
||||
+ bool "4.19.x"
|
||||
+ select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
|
||||
+
|
||||
config BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_18
|
||||
bool "4.18.x"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
|
||||
--
|
||||
2.17.1
|
||||
|
@ -30,7 +30,7 @@ choice
|
||||
prompt "Kernel version"
|
||||
|
||||
config BR2_LINUX_KERNEL_LATEST_VERSION
|
||||
bool "Latest version (4.18)"
|
||||
bool "Latest version (4.19)"
|
||||
|
||||
config BR2_LINUX_KERNEL_LATEST_CIP_VERSION
|
||||
bool "Latest CIP SLTS version (v4.4.154-cip28)"
|
||||
|
@ -6,7 +6,7 @@ config BR2_PACKAGE_HOST_LINUX_HEADERS
|
||||
choice
|
||||
prompt "Kernel Headers"
|
||||
default BR2_KERNEL_HEADERS_AS_KERNEL if BR2_LINUX_KERNEL
|
||||
default BR2_KERNEL_HEADERS_4_18
|
||||
default BR2_KERNEL_HEADERS_4_19
|
||||
help
|
||||
Select the kernel version to get headers from.
|
||||
|
||||
@ -60,6 +60,10 @@ config BR2_KERNEL_HEADERS_4_18
|
||||
bool "Linux 4.18.x kernel headers"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
|
||||
|
||||
config BR2_KERNEL_HEADERS_4_19
|
||||
bool "Linux 4.19.x kernel headers"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
|
||||
|
||||
config BR2_KERNEL_HEADERS_VERSION
|
||||
bool "Manually specified Linux version"
|
||||
help
|
||||
@ -125,6 +129,10 @@ choice
|
||||
This is used to hide/show some packages that have strict
|
||||
requirements on the version of kernel headers.
|
||||
|
||||
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19
|
||||
bool "4.19.x"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
|
||||
|
||||
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_18
|
||||
bool "4.18.x"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
|
||||
|
@ -366,10 +366,15 @@ config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
|
||||
bool
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
|
||||
|
||||
config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
|
||||
bool
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
|
||||
|
||||
# This order guarantees that the highest version is set, as kconfig
|
||||
# stops affecting a value on the first matching default.
|
||||
config BR2_TOOLCHAIN_HEADERS_AT_LEAST
|
||||
string
|
||||
default "4.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
|
||||
default "4.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
|
||||
default "4.17" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
|
||||
default "4.16" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
|
||||
|
@ -123,6 +123,10 @@ choice
|
||||
m = ( LINUX_VERSION_CODE >> 8 ) & 0xFF
|
||||
p = ( LINUX_VERSION_CODE >> 0 ) & 0xFF
|
||||
|
||||
config BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19
|
||||
bool "4.19.x"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
|
||||
|
||||
config BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_18
|
||||
bool "4.18.x"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
|
||||
|
Loading…
x
Reference in New Issue
Block a user