linux-postmarketos-amlogic: new aport (MR 3833)

Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
This commit is contained in:
Ferass El Hafidi 2023-03-09 19:05:06 +01:00 committed by Oliver Smith
parent b0182951a3
commit 5adb3352e9
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
5 changed files with 8511 additions and 0 deletions

View file

@ -0,0 +1,86 @@
From b278353bcfc3c123b5b728134925432dc5d138b7 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Fri, 10 Feb 2023 02:16:12 +0000
Subject: [PATCH 1/3] WIP: arm64: dts: meson: gxbb-kii-pro: sort and tidy the
dts
Alpha-sort the nodes, move the default line in the LED node to where it's
normally found, and remove excess spacing. No functional changes.
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
.../boot/dts/amlogic/meson-gxbb-kii-pro.dts | 32 ++++++++-----------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts
index 6d8cc00fe..9bfdb54d9 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts
@@ -6,21 +6,22 @@
/dts-v1/;
#include "meson-gxbb-p20x.dtsi"
-
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
+
/ {
compatible = "videostrong,kii-pro", "amlogic,meson-gxbb";
model = "Videostrong KII Pro";
leds {
compatible = "gpio-leds";
+
status {
gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
- default-state = "off";
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_STATUS;
+ default-state = "off";
};
};
@@ -34,24 +35,8 @@ button-reset {
gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
};
};
-
-};
-
-
-
-&uart_A {
- status = "okay";
- pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
- pinctrl-names = "default";
- uart-has-rtscts;
-
- bluetooth {
- compatible = "brcm,bcm4335a0";
- };
};
-
-
&ethmac {
status = "okay";
pinctrl-0 = <&eth_rmii_pins>;
@@ -78,3 +63,14 @@ eth_phy0: ethernet-phy@0 {
&ir {
linux,rc-map-name = "rc-videostrong-kii-pro";
};
+
+&uart_A {
+ status = "okay";
+ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+ pinctrl-names = "default";
+ uart-has-rtscts;
+
+ bluetooth {
+ compatible = "brcm,bcm4335a0";
+ };
+};
--
2.39.1

View file

@ -0,0 +1,32 @@
From d77965a9ff66c119ec3cd702adeb99b799fed1b0 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Fri, 10 Feb 2023 02:21:08 +0000
Subject: [PATCH 2/3] WIP: arm64: dts: meson: gxbb-kii-pro: complete the
bluetooth node
Add missing content to the bluetooth node to align it with the content
used in (all) other GXBB dts files.
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts
index 9bfdb54d9..435ae2aa4 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts
@@ -72,5 +72,10 @@ &uart_A {
bluetooth {
compatible = "brcm,bcm4335a0";
+ shutdown-gpios = <&gpio GPIOX_20 GPIO_ACTIVE_HIGH>;
+ host-wakeup-gpios = <&gpio GPIOX_21 GPIO_ACTIVE_HIGH>;
+ max-speed = <2000000>;
+ clocks = <&wifi32k>;
+ clock-names = "lpo";
};
};
--
2.39.1

View file

@ -0,0 +1,100 @@
From b56967450d3aa37a7b0fc296de8a1a64801ae09f Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Fri, 10 Feb 2023 02:29:00 +0000
Subject: [PATCH 3/3] WIP: arm64: dts: meson: gxbb-kii-pro: add initial audio
support
Add initial support for HDMI and S/PDIF audio output.
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
.../boot/dts/amlogic/meson-gxbb-kii-pro.dts | 61 +++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts
index 435ae2aa4..b6ee76011 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts
@@ -9,11 +9,19 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
+#include <dt-bindings/sound/meson-aiu.h>
/ {
compatible = "videostrong,kii-pro", "amlogic,meson-gxbb";
model = "Videostrong KII Pro";
+ spdif_dit: audio-codec-0 {
+ #sound-dai-cells = <0>;
+ compatible = "linux,spdif-dit";
+ status = "okay";
+ sound-name-prefix = "DIT";
+ };
+
leds {
compatible = "gpio-leds";
@@ -35,6 +43,59 @@ button-reset {
gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
};
};
+
+ sound {
+ compatible = "amlogic,gx-sound-card";
+ model = "KII-PRO";
+ assigned-clocks = <&clkc CLKID_MPLL0>,
+ <&clkc CLKID_MPLL1>,
+ <&clkc CLKID_MPLL2>;
+ assigned-clock-parents = <0>, <0>, <0>;
+ assigned-clock-rates = <294912000>,
+ <270950400>,
+ <393216000>;
+ status = "okay";
+
+ dai-link-0 {
+ sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
+ };
+
+ dai-link-1 {
+ sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>;
+ };
+
+ dai-link-2 {
+ sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
+ dai-format = "i2s";
+ mclk-fs = <256>;
+
+ codec-0 {
+ sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
+ };
+ };
+
+ dai-link-3 {
+ sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>;
+
+ codec-0 {
+ sound-dai = <&spdif_dit>;
+ };
+ };
+
+ dai-link-4 {
+ sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+ codec-0 {
+ sound-dai = <&hdmi_tx>;
+ };
+ };
+ };
+};
+
+&aiu {
+ status = "okay";
+ pinctrl-0 = <&spdif_out_y_pins>;
+ pinctrl-names = "default";
};
&ethmac {
--
2.39.1

View file

@ -0,0 +1,72 @@
# Reference: <https://postmarketos.org/mainline>
# Kernel config based on: arch/arm64/configs/defconfig
# Maintainer: Ferass El Hafidi <vitali64pmemail@protonmail.com>
# Co-Maintainer: exkc <exxxxkc@getgoogleoff.me>
pkgname=linux-postmarketos-amlogic
pkgver=6.1.10
pkgrel=0
pkgdesc="Mainline kernel for Amlogic devices"
arch="aarch64"
_carch="arm64"
_flavor=postmarketos-amlogic
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
bash
bc
bison
devicepkg-dev
flex
openssl-dev
perl
gmp-dev
mpc1-dev
mpfr-dev
findutils
postmarketos-installkernel
gzip
"
_config="config-$_flavor.$arch"
source="
$pkgname-$pkgver.tar.xz::https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$pkgver.tar.xz
$_config
0001-WIP-arm64-dts-meson-gxbb-kii-pro-sort-and-tidy-the-d.patch
0002-WIP-arm64-dts-meson-gxbb-kii-pro-complete-the-blueto.patch
0003-WIP-arm64-dts-meson-gxbb-kii-pro-add-initial-audio-s.patch
"
builddir="$srcdir/linux-$pkgver"
prepare() {
default_prepare
cp -v "$srcdir"/$_config .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \
V=1 # See pmaports#1990
}
package() {
mkdir -p "$pkgdir"/boot
make install modules_install dtbs_install \
ARCH="$_carch" \
INSTALL_MOD_STRIP=1 \
INSTALL_PATH="$pkgdir"/boot \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_DTBS_PATH="$pkgdir/boot/dtbs" \
V=1 # See pmaports#1990
install -D "$builddir"/include/config/kernel.release \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
}
sha512sums="
7bec1d76ecafd89fdb13bc7c9c69b4f378e41b29aed33c302b235540f40f1d5e6b3c653d2dea83c2d03408e324ffa73ff3dcc7c47c685572719d62bc66a06a1d linux-postmarketos-amlogic-6.1.10.tar.xz
c215fbc93b736c22c2ce76dd29cd88bd0eb39aab889cfc73cb71643ac0d68f280d08b36607e6567c878e75c1b6f9a1315f0e9e3175dc40fcdfd6bbd0d36da04d config-postmarketos-amlogic.aarch64
182d779a91acd47dcd865eba919b404db24840493f54775dcf4508237edf65ff8aae9f84d8aa673d7aa2414934325ea972491cbf6d590434a6a5aad33eb8e20c 0001-WIP-arm64-dts-meson-gxbb-kii-pro-sort-and-tidy-the-d.patch
2a772de080dda5100a653a9806ee60130228dd2e232055362fa330ee42644374161aa032b1838f12555e952214ac29eb4ef664c587af2363796ba9f70d95dee3 0002-WIP-arm64-dts-meson-gxbb-kii-pro-complete-the-blueto.patch
a497d042112e1f6bf4b4793992907b25b99b9b6d5f77b051261b80ed90ef70022c647ef2db2385bb9dccf31e94b23fa9f3d9bc42b4d1ff1049bcf8cafb7a6b6d 0003-WIP-arm64-dts-meson-gxbb-kii-pro-add-initial-audio-s.patch
"

File diff suppressed because it is too large Load diff