Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/sources/families/include/meson64_common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ case $BRANCH in
declare -g KERNEL_MAJOR_MINOR="6.12"
;;
edge)
declare -g KERNEL_MAJOR_MINOR="6.18"
declare -g KERNEL_MAJOR_MINOR="6.19"
;;

esac
Expand Down
16 changes: 8 additions & 8 deletions config/sources/mainline-kernel.conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
function mainline_kernel_decide_version__upstream_release_candidate_number() {
[[ -n "${KERNELBRANCH}" ]] && return 0 # if already set, don't touch it; that way other hooks can run in any order
if [[ "${KERNEL_MAJOR_MINOR}" == "6.19" ]]; then # @TODO: roll over to next MAJOR.MINOR and MAJOR.MINOR-rc1 when it is released
declare -g KERNELBRANCH="tag:v6.19-rc1"
declare -g KERNELBRANCH="tag:v6.19-rc2"
display_alert "mainline-kernel: upstream release candidate" "Using KERNELBRANCH='${KERNELBRANCH}' for KERNEL_MAJOR_MINOR='${KERNEL_MAJOR_MINOR}'" "info"
fi
}
Expand All @@ -26,13 +26,13 @@ function mainline_kernel_decide_version__upstream_release_candidate_number() {

# # Example: 6.7-rc7 was released by Linus, but kernel.org git and google git mirrors took a while to catch up; change the source to pull directly from Linus.
# # This was necessary for a few days in late December 2023, but no longer; tag was pushed on 28/Dec/2023.
# function mainline_kernel_decide_version__750_use_torvalds_for_6.7-rc7() {
# if [[ "${KERNELBRANCH}" == 'tag:v6.7-rc7' ]]; then
# display_alert "Using Linus kernel repo for 6.7-rc7" "${KERNELBRANCH}" "warn"
# declare -g KERNELSOURCE="https://github.com/torvalds/linux.git"
# display_alert "mainline-kernel: missing torvalds tag on 6.7-rc7" "Using KERNELSOURCE='${KERNELSOURCE}' for KERNELBRANCH='${KERNELBRANCH}'" "info"
# fi
# }
function mainline_kernel_decide_version__750_use_torvalds_for_6.7-rc7() {
if [[ "${KERNELBRANCH}" == 'tag:v6.19-rc2' ]]; then
display_alert "Using Linus kernel repo for 6.19-rc2" "${KERNELBRANCH}" "warn"
declare -g KERNELSOURCE="https://github.com/torvalds/linux.git"
display_alert "mainline-kernel: missing torvalds tag on 6.9-rc2" "Using KERNELSOURCE='${KERNELSOURCE}' for KERNELBRANCH='${KERNELBRANCH}'" "info"
fi
}

### Last hooks, defaults to branch if not set by previous hooks. Use mainline_kernel_decide_version__900 or higher.
function mainline_kernel_decide_version__900_defaults() {
Expand Down
38 changes: 38 additions & 0 deletions patch/kernel/archive/meson64-6.19/0000.patching_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
config:

# Just some info stuff; not used by the patching scripts
name: meson64-6.7
kind: kernel
type: mainline # or: vendor
branch: linux-6.7.y
last-known-good-tag: v6.7.0
Comment on lines +4 to +8
Copy link
Contributor

@coderabbitai coderabbitai bot Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Version metadata mismatch.

The configuration metadata references version 6.7, but this file is for meson64-6.19. Update the following fields:

  • name: should be "meson64-6.19"
  • branch: should be "linux-6.19.y"
  • last-known-good-tag: should be "v6.19" or the appropriate 6.19 tag

Apply this diff:

-  name: meson64-6.7
+  name: meson64-6.19
   kind: kernel
   type: mainline # or: vendor
-  branch: linux-6.7.y
-  last-known-good-tag: v6.7.0
+  branch: linux-6.19.y
+  last-known-good-tag: v6.19
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
name: meson64-6.7
kind: kernel
type: mainline # or: vendor
branch: linux-6.7.y
last-known-good-tag: v6.7.0
name: meson64-6.19
kind: kernel
type: mainline # or: vendor
branch: linux-6.19.y
last-known-good-tag: v6.19
🤖 Prompt for AI Agents
In patch/kernel/archive/meson64-6.19/0000.patching_config.yaml around lines 4 to
8, the metadata incorrectly references 6.7; update the fields to match 6.19: set
name to "meson64-6.19", set branch to "linux-6.19.y", and set
last-known-good-tag to the correct 6.19 tag (e.g. "v6.19" or the precise v6.19.x
tag you intend to use).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stuff is more or less informational. Also we cannot assume that 6.19 is a known good tag.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EvilOlaf, thank you for the clarification! You're right—since this metadata is informational (as noted in the comment "not used by the patching scripts") and 6.19 is still being validated as part of this PR, it makes sense to leave last-known-good-tag pointing to a verified version rather than the new 6.19.

The name and branch fields being out of sync with the directory name is minor for informational metadata. Feel free to update them later for consistency once 6.19 is confirmed stable, or leave as-is if it's not causing any issues. 👍


🧠 Learnings used
Learnt from: amazingfate
Repo: armbian/build PR: 8619
File: config/sources/families/rockchip.conf:65-72
Timestamp: 2025-09-14T11:37:35.089Z
Learning: In the Armbian build system, patch directories referenced in BOOTPATCHDIR and KERNELPATCHDIR configurations can be non-existent without causing build failures. Empty patch directories are also ignored by git, so missing patch directories should not be flagged as errors during code review.

Learnt from: SuperKali
Repo: armbian/build PR: 8608
File: lib/functions/compilation/patch/drivers_network.sh:361-363
Timestamp: 2025-09-11T06:06:52.328Z
Learning: For the RTW88 SDIO RF path detection fix patch (004-rtw88-sdio-rf-path-detection-fix.patch), SuperKali prefers using exact version matching (eq 6.1 || eq 6.16) rather than range checks, as the patch has only been tested on those specific kernel versions and may be mainstreamed soon.

Learnt from: EvilOlaf
Repo: armbian/build PR: 8968
File: patch/u-boot/u-boot-sunxi/arm64-dts-sun50i-h6-orangepi.dtsi-Rollback-r_rsb-to-r_i2c.patch:36-36
Timestamp: 2025-11-20T18:20:11.985Z
Learning: The rewrite-patches tool (REWRITE_PATCHES=yes) in the Armbian build system can inadvertently introduce semantic changes when the u-boot/kernel git base revision differs from expected state. The tool applies patches, commits them, and re-exports them using git format-patch, which can cause the re-exported patch to reflect the base revision's state rather than preserving the original patch intent. This is particularly problematic for device tree changes like interrupt specifications. The tool currently lacks validation mechanisms to detect such semantic drift, and affected patches must be manually corrected after rewriting.

Learnt from: tabrisnet
Repo: armbian/build PR: 8661
File: lib/functions/compilation/armbian-kernel.sh:194-201
Timestamp: 2025-09-22T21:52:01.225Z
Learning: In lib/functions/compilation/armbian-kernel.sh, the kernel_config_modifying_hashes array is not universally required for all kernel configuration functions - some functions like armbian_kernel_config__netkit() operate without it, and adding entries with '=m' would be incorrect when the actual result might be '=y' for options already built-in.

Learnt from: tabrisnet
Repo: armbian/build PR: 8661
File: lib/functions/compilation/armbian-kernel.sh:194-201
Timestamp: 2025-09-22T21:52:01.225Z
Learning: In lib/functions/compilation/armbian-kernel.sh, the kernel_config_modifying_hashes array is not universally required for all kernel configuration functions - some functions like armbian_kernel_config__netkit() operate without it, and adding entries with '=m' would be incorrect when the actual result might be '=y' for options already built-in.

Learnt from: igorpecovnik
Repo: armbian/build PR: 8849
File: config/boards/radxa-e54c.csc:14-28
Timestamp: 2025-11-02T20:49:56.719Z
Learning: In Armbian board configuration files (config/boards/*.conf, *.csc, etc.), do not use kernel_config_set, kernel_config_set_m, kernel_config_set_y, or custom_kernel_config__* functions to modify kernel configuration. Kernel configuration is associated with LINUXFAMILY/BOARDFAMILY, not individual BOARD. Board-specific kernel modifications cause inconsistency in kernel packages published to the apt repository because boards within a family share the same kernel packages. Kernel configuration changes must be made in the appropriate kernel config file (e.g., config/kernel/linux-*-*.config) or in family configuration files (config/sources/families/*.conf, *.inc) instead.

Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:73-75
Timestamp: 2025-03-31T22:20:41.849Z
Learning: When porting patches between U-Boot versions (like from 2025.01 to 2025.04), rpardini prefers to maintain patches as-is rather than introducing refactoring changes, even when potential improvements are identified. This approach prioritizes consistency and reduces the risk of introducing new issues.

Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.

Learnt from: rpardini
Repo: armbian/build PR: 8820
File: config/sources/families/include/meson64_common.inc:51-53
Timestamp: 2025-10-26T12:56:29.185Z
Learning: In the Armbian build framework, scripts/config correctly handles kernel configuration option names both with and without the CONFIG_ prefix, so opts_m+=("CONFIG_RTL8822CS") and opts_m+=("RTL8822CS") are both valid and will work correctly.

Learnt from: rpardini
Repo: armbian/build PR: 8879
File: config/sources/families/uefi-x86.conf:0-0
Timestamp: 2025-11-06T15:36:04.682Z
Learning: As of PR #8879, the uefi-x86 family in the Armbian build system now includes kernel patches for the first time. The current and edge branches for uefi-x86 are specifically configured for Apple T2-based x86 machines, including T2-specific patches from the linux-t2 project and custom kernel configuration options for Apple hardware drivers.

Learnt from: EvilOlaf
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-07-21T04:12:02.439Z
Learning: In the Armbian build system, for recurring maintenance tasks like kernel version bumping, TODO comments should use generic version formats (e.g., "MAJOR.MINOR-rc1") rather than specific version numbers (e.g., "6.17-rc1") to avoid the need for frequent comment updates that would create unnecessary maintenance overhead.

Learnt from: The-going
Repo: armbian/build PR: 8147
File: config/sources/families/include/sunxi64_common.inc:38-39
Timestamp: 2025-04-30T16:16:47.150Z
Learning: The Armbian build system references Linux kernel versions in the form "tag:v6.14.4" in the KERNELBRANCH variable, even when point release tags might not be directly visible in the upstream repository in the same form.

Learnt from: tabrisnet
Repo: armbian/build PR: 8746
File: config/sources/families/filogic.conf:61-68
Timestamp: 2025-10-13T02:26:18.249Z
Learning: In the Armbian build system, the "edge" kernel branch is intended to be bleeding-edge and experimental. It does not require hardware testing or stability verification before merging, as it's expected to contain potentially unstable or untested code for early adopters and developers.

Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.

Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.

maintainers:
- { github: rpardini, name: Ricardo Pardini, email: [email protected], armbian-forum: rpardini }

# .dts files in these directories will be copied as-is to the build tree; later ones overwrite earlier ones.
# This is meant to provide a way to "add a board DTS" without having to null-patch them in.
dts-directories:
# will copy patch/kernel/archive/meson64-MAJOR.MINOR/dt-boards/*.dts to arch/arm64/boot/dts/amlogic
- { source: "dt", target: "arch/arm64/boot/dts/amlogic" }

# every file in these directories will be copied as-is to the build tree; later ones overwrite earlier ones
# This is meant as a way to have overlays, bare, in a directory, without having to null-patch them in.
# @TODO need a solution to auto-Makefile the overlays as well
overlay-directories:
# will copy patch/kernel/archive/meson64-MAJOR.MINOR/overlay/**/* to arch/arm64/boot/dts/amlogic/overlay
- { source: "overlay", target: "arch/arm64/boot/dts/amlogic/overlay" }

# the Makefile in each of these directories will be magically patched to include the dts files copied
# or patched-in; overlay subdir will be included "-y" if it exists.
# No more Makefile patching needed, yay!
auto-patch-dt-makefile:
- { directory: "arch/arm64/boot/dts/amlogic", config-var: "CONFIG_ARCH_MESON" }

# configuration for when applying patches to git / auto-rewriting patches (development cycle helpers)
patches-to-git:
do-not-commit-files:
- "MAINTAINERS" # constant churn, drop them. sorry.
- "Documentation/devicetree/bindings/arm/amlogic.yaml" # constant churn, conflicts on every bump, drop it. sorry.
do-not-commit-regexes: # Python-style regexes
- "^arch/([a-zA-Z0-9]+)/boot/dts/([a-zA-Z0-9]+)/Makefile$" # ignore DT Makefile patches, we've an auto-patcher now

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <[email protected]>
Date: Tue, 25 Jul 2023 13:31:54 -0400
Subject: arch: arm64: dts: amlogic: meson g12b bananapi cm4

Signed-off-by: Patrick Yavitz <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-cm4io.dts | 9 +++++--
arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi | 12 ++++++++--
2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-cm4io.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-cm4io.dts
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-cm4io.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-cm4io.dts
@@ -50,14 +50,15 @@ leds {
led-blue {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_STATUS;
- gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
+ gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_LOW>;
linux,default-trigger = "heartbeat";
};

led-green {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
- gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "default-on";
};
};

@@ -120,6 +121,10 @@ codec {
};
};

+&reboot {
+ sd-vqen = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
+};
+
&cecb_AO {
status = "okay";
};
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi
@@ -12,6 +12,15 @@ aliases {
rtc1 = &vrtc;
};

+ reboot: meson64-reboot {
+ compatible = "meson64,reboot";
+ sys_reset = <0x84000009>;
+ sys_poweroff = <0x84000008>;
+
+ sd-vqsw = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
+ sd-vmmc = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>;
+ };
+
chosen {
stdout-path = "serial0:115200n8";
};
@@ -359,8 +368,7 @@ &uart_A {

bluetooth {
compatible = "realtek,rtl8822cs-bt";
- enable-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
- host-wake-gpios = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>;
+ enable-gpios = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>;
device-wake-gpios = <&gpio GPIOX_18 GPIO_ACTIVE_HIGH>;
};
};
--
Armbian

62 changes: 62 additions & 0 deletions patch/kernel/archive/meson64-6.19/board-bananapi-m2s.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <[email protected]>
Date: Tue, 25 Jul 2023 13:34:18 -0400
Subject: arch: arm64: dts: amlogic: meson g12b bananapi m2s

Signed-off-by: Patrick Yavitz <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts | 4 ++++
arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi | 9 +++++++++
arch/arm64/boot/dts/amlogic/meson-g12b-s922x-bananapi-m2s.dts | 4 ++++
3 files changed, 17 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts
@@ -18,6 +18,10 @@ aliases {
};
};

+&reboot {
+ sd-vqen = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
+};
+
/* Camera (CSI) bus */
&i2c1 {
status = "okay";
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
@@ -17,6 +17,15 @@ aliases {
rtc1 = &vrtc;
};

+ reboot: meson64-reboot {
+ compatible = "meson64,reboot";
+ sys_reset = <0x84000009>;
+ sys_poweroff = <0x84000008>;
+
+ sd-vqsw = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
+ sd-vmmc = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>;
+ };
+
chosen {
stdout-path = "serial0:115200n8";
};
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-bananapi-m2s.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-bananapi-m2s.dts
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-bananapi-m2s.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-bananapi-m2s.dts
@@ -12,3 +12,7 @@ / {
compatible = "bananapi,bpi-m2s", "amlogic,s922x", "amlogic,g12b";
model = "BananaPi M2S";
};
+
+&reboot {
+ sd-vqen = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
+};
--
Armbian

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Igor Pecovnik <[email protected]>
Date: Sat, 11 Feb 2023 18:30:00 +0100
Subject: BananaPi M5: 270 clock phase, via amlogic,mmc-phase

Rework of Ricardo Pardini <[email protected]> patch.

Signed-off-by: Igor Pecovnik <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi
@@ -8,6 +8,7 @@
#include <dt-bindings/leds/common.h>
#include <dt-bindings/input/linux-event-codes.h>
#include <dt-bindings/gpio/meson-g12a-gpio.h>
+#include <dt-bindings/mmc/meson-gx-mmc.h>

/ {
adc-keys {
@@ -387,6 +388,8 @@ &sd_emmc_b {
cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
vmmc-supply = <&tflash_vdd>;
vqmmc-supply = <&vddio_c>;
+
+ amlogic,mmc-phase = <CLK_PHASE_270 CLK_PHASE_0 CLK_PHASE_0>;
};

/* eMMC */
@@ -406,6 +409,8 @@ &sd_emmc_c {
mmc-pwrseq = <&emmc_pwrseq>;
vmmc-supply = <&vddao_3v3>;
vqmmc-supply = <&emmc_1v8>;
+
+ amlogic,mmc-phase = <CLK_PHASE_270 CLK_PHASE_0 CLK_PHASE_0>;
};

&uart_AO {
--
Armbian

Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <[email protected]>
Date: Wed, 2 Aug 2023 19:36:07 -0400
Subject: WIP: arm64: dts: meson: add WiFi/BT support to BananaPi M5

The BPI-M5 has an optional RTL8822CS WiFi/BT mezzanine board. Describe
the board but mark the sd_emmc_a and uart_A nodes disabled so they can
be enabled via overlay or fdtput when the board is connected.

Signed-off-by: Christian Hewitt <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts | 66 +++++++++-
1 file changed, 65 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts
@@ -25,6 +25,20 @@ cvbs_connector_in: endpoint {
};
};

+ sdio_pwrseq: sdio-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
+ clocks = <&wifi32k>;
+ clock-names = "ext_clock";
+ };
+
+ wifi32k: wifi32k {
+ compatible = "pwm-clock";
+ #clock-cells = <0>;
+ clock-frequency = <32768>;
+ pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
+ };
+
sound {
compatible = "amlogic,axg-sound-card";
model = "BPI-M5";
@@ -153,7 +167,6 @@ &acodec {
status = "okay";
};

-
&clkc_audio {
status = "okay";
};
@@ -176,6 +189,42 @@ &frddr_c {
status = "okay";
};

+&pwm_ef {
+ status = "okay";
+ pinctrl-0 = <&pwm_e_pins>;
+ pinctrl-names = "default";
+};
+
+/* SDIO */
+&sd_emmc_a {
+ /* enable if WiFi/BT board connected */
+ status = "disabled";
+ pinctrl-0 = <&sdio_pins>;
+ pinctrl-1 = <&sdio_clk_gate_pins>;
+ pinctrl-names = "default", "clk-gate";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ bus-width = <4>;
+ sd-uhs-sdr104;
+ max-frequency = <50000000>;
+
+ non-removable;
+ disable-wp;
+
+ /* WiFi firmware requires power in suspend */
+ keep-power-in-suspend;
+
+ mmc-pwrseq = <&sdio_pwrseq>;
+
+ vmmc-supply = <&vddao_3v3>;
+ vqmmc-supply = <&vddao_1v8>;
+
+ rtl8822cs: wifi@1 {
+ reg = <1>;
+ };
+};
+
&tdmif_b {
status = "okay";
};
@@ -223,3 +272,18 @@ &toddr_b {
&toddr_c {
status = "okay";
};
+
+&uart_A {
+ /* enable if WiFi/BT board connected */
+ status = "disabled";
+ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+ pinctrl-names = "default";
+ uart-has-rtscts;
+
+ bluetooth {
+ compatible = "realtek,rtl8822cs-bt";
+ enable-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
+ host-wake-gpios = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>;
+ device-wake-gpios = <&gpio GPIOX_18 GPIO_ACTIVE_HIGH>;
+ };
+};
--
Armbian

Loading
Loading