u-boot: update Amlogic patches for bananapi-cm4io

This commit is contained in:
Christian Hewitt 2023-03-04 07:40:07 +00:00
parent b91fd79e4a
commit 1f23cfa056
No known key found for this signature in database
25 changed files with 778 additions and 22 deletions

View File

@ -1,7 +1,7 @@
From 95ed57b0ca24cde1d7547878101c62f552cb1160 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Fri, 13 Nov 2020 02:09:36 +0000
Subject: [PATCH 01/22] LOCAL: configs: meson64: prevent stdout/stderr on
Subject: [PATCH 01/25] LOCAL: configs: meson64: prevent stdout/stderr on
videoconsole
Several devices have CONFIG_DM_VIDEO enabled which causes stdout/stderr

View File

@ -1,7 +1,7 @@
From d16384b766e1704470f678589e01d288fbb94960 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Thu, 22 Apr 2021 06:52:50 +0000
Subject: [PATCH 02/22] LOCAL: configs: meson64: remove /amlogic so fdtdir
Subject: [PATCH 02/25] LOCAL: configs: meson64: remove /amlogic so fdtdir
finds LE boot files
---

View File

@ -1,7 +1,7 @@
From a9fc1d56916fbcf4e00a1dd7543c9f53d697477a Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Tue, 3 Aug 2021 18:42:55 +0000
Subject: [PATCH 03/22] LOCAL: board: amlogic: odroid-n2: remove /amlogic/
Subject: [PATCH 03/25] LOCAL: board: amlogic: odroid-n2: remove /amlogic/
prefix for dtb path
Remove the /amlogic/ prefix to align with current LE dtb locations.

View File

@ -1,7 +1,7 @@
From 7d8355053316d3f760a5ac14156e77e27aa5f6d5 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Tue, 25 Oct 2022 14:24:21 +0000
Subject: [PATCH 04/22] BACKPORT: arm64: dts: meson: nanopi-k2: readd PHY reset
Subject: [PATCH 04/25] BACKPORT: arm64: dts: meson: nanopi-k2: readd PHY reset
properties
The sync of device-tree/bindings in 11a48a5a18c6 ("Linux 5.6-rc2") causes

View File

@ -1,7 +1,7 @@
From f72090a5d057a18fa8bceec0400c212012f56126 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Tue, 20 Apr 2021 05:19:43 +0000
Subject: [PATCH 05/22] WIP: ARM: dts: import WeTek Hub/Play2 DTs from Linux
Subject: [PATCH 05/25] WIP: ARM: dts: import WeTek Hub/Play2 DTs from Linux
5.19
Import the WeTek common dtsi and Hub/Play2 device-trees.

View File

@ -1,7 +1,7 @@
From 4df4197e1eb7e257d0c4dda60a7ff427fbd47c6f Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Tue, 20 Apr 2021 05:29:19 +0000
Subject: [PATCH 06/22] WIP: ARM: dts: use snps,reset on WeTek devices to fix
Subject: [PATCH 06/25] WIP: ARM: dts: use snps,reset on WeTek devices to fix
Ethernet
The sync of the device tree and dt-bindings from Linux v5.6-rc2

View File

@ -1,7 +1,7 @@
From cec8965a83baea925ac82ca0be5dac3cc1823915 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Thu, 22 Apr 2021 05:45:29 +0000
Subject: [PATCH 07/22] WIP: boards: amlogic: add board files for wetek-gxbb
Subject: [PATCH 07/25] WIP: boards: amlogic: add board files for wetek-gxbb
devices
These support the WeTek Hub and Play2 devices.

View File

@ -1,7 +1,7 @@
From 8b7dfec310b69a5b7cafacbe11a3ca36b497c78c Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 27 Feb 2021 06:03:00 +0000
Subject: [PATCH 08/22] WIP: boards: amlogic: add WeTek Hub defconfig
Subject: [PATCH 08/25] WIP: boards: amlogic: add WeTek Hub defconfig
Signed-of-by: Christian Hewitt <christianshewitt@gmail.com>
---

View File

@ -1,7 +1,7 @@
From e45b57304c28592eae3ad386559abb6dd3a7a802 Mon Sep 17 00:00:00 2001
From: chewitt <christianshewitt@gmail.com>
Date: Sat, 27 Feb 2021 06:04:00 +0000
Subject: [PATCH 09/22] WIP: boards: amlogic: add WeTek Play2 defconfig
Subject: [PATCH 09/25] WIP: boards: amlogic: add WeTek Play2 defconfig
Signed-off-by: Christian Hewittt <christianshewitt@gmail.com>
---

View File

@ -1,7 +1,7 @@
From 7a49690898b3af72646df09784b8cdd9b1b593fd Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 15 Jan 2022 06:17:23 +0000
Subject: [PATCH 10/22] WIP: ARM: dts: add support for Radxa Zero2
Subject: [PATCH 10/25] WIP: ARM: dts: add support for Radxa Zero2
Import the initial dts (WIP) from chewitt/amlogic-5.16.y

View File

@ -1,7 +1,7 @@
From e7babbfd6c66c20e81e9d728a6a4384a9a5885dd Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 15 Jan 2022 06:23:29 +0000
Subject: [PATCH 11/22] WIP: boards: amlogic: add Radxa Zero2 defconfig
Subject: [PATCH 11/25] WIP: boards: amlogic: add Radxa Zero2 defconfig
Add a defconfig for the Radxa Zero2 SBC, using an Amlogic A311D chip.

View File

@ -1,7 +1,7 @@
From 2fc65ac09a5698b9e2060890de1cd3310a237658 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 15 Jan 2022 06:35:47 +0000
Subject: [PATCH 12/22] WIP: doc: boards: amlogic: update for Radxa Zero2
Subject: [PATCH 12/25] WIP: doc: boards: amlogic: update for Radxa Zero2
Add documentation bits for the Radxa Zero2

View File

@ -1,7 +1,7 @@
From 7ce3779954032f9ac2591a02df06282115032cb3 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Thu, 7 Jul 2022 10:24:03 +0000
Subject: [PATCH 13/22] WIP: ARM: dts: import Beelink GT1 DT from Linux 5.21
Subject: [PATCH 13/25] WIP: ARM: dts: import Beelink GT1 DT from Linux 5.21
Import the Beelink GT1 device-tree.

View File

@ -1,7 +1,7 @@
From 7416bc16b956d7b9b2761ac5511c6b51ac8b4ca1 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Thu, 7 Jul 2022 10:27:01 +0000
Subject: [PATCH 14/22] WIP: boards: amlogic: add Beelink GT1 defconfig
Subject: [PATCH 14/25] WIP: boards: amlogic: add Beelink GT1 defconfig
Add a board config for Beelink GT1 devices

View File

@ -1,7 +1,7 @@
From 5c21b65a0efdae590e0d0ecd1191078725e4abf4 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Thu, 14 Jul 2022 19:38:41 +0000
Subject: [PATCH 15/22] WIP: doc: boards: amlogic: update for Beelink GT1
Subject: [PATCH 15/25] WIP: doc: boards: amlogic: update for Beelink GT1
Add documentation bits for the Beelink GT1 and GT1-Ultimate

View File

@ -1,7 +1,7 @@
From 0addaf5179afa1c985f493035a1dca8f1b23a4ed Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Fri, 17 Feb 2023 05:37:13 +0000
Subject: [PATCH 16/22] WIP: ARM: dts: convert bananapi-m5 to dtsi
Subject: [PATCH 16/25] WIP: ARM: dts: convert bananapi-m5 to dtsi
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---

View File

@ -1,7 +1,7 @@
From dbf80e3d843cb58b9098d7c0e24c9ab1208003a7 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Fri, 17 Feb 2023 05:38:46 +0000
Subject: [PATCH 17/22] WIP: ARM: dts: add support for BananaPi M2-Pro
Subject: [PATCH 17/25] WIP: ARM: dts: add support for BananaPi M2-Pro
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---

View File

@ -1,7 +1,7 @@
From 0be895d75648124c0bd8d7fce1fe61c3dbacbe5f Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Fri, 17 Feb 2023 05:41:36 +0000
Subject: [PATCH 18/22] WIP: boards: add BananaPi M2-Pro defconfig
Subject: [PATCH 18/25] WIP: boards: add BananaPi M2-Pro defconfig
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---

View File

@ -1,7 +1,7 @@
From b4870c47202687c6a6880b449c97a2e32ec3d278 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Fri, 17 Feb 2023 05:49:44 +0000
Subject: [PATCH 19/22] WIP: docs: boards: amlogic: update for BananaPi M2-Pro
Subject: [PATCH 19/25] WIP: docs: boards: amlogic: update for BananaPi M2-Pro
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---

View File

@ -1,7 +1,7 @@
From 665eff902425685a2278e393a89452276e4ea665 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 18 Feb 2023 08:06:04 +0000
Subject: [PATCH 20/22] WIP: boards: add BananaPi M2S defconfig
Subject: [PATCH 20/25] WIP: boards: add BananaPi M2S defconfig
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---

View File

@ -1,7 +1,7 @@
From e1484036ca5e032a9039ed2f361f2b123a8efd64 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 18 Feb 2023 08:08:42 +0000
Subject: [PATCH 21/22] WIP: docs: boards: amlogic: update for BananaPi M2S
Subject: [PATCH 21/25] WIP: docs: boards: amlogic: update for BananaPi M2S
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---

View File

@ -1,7 +1,7 @@
From 821819ff0d9185954b251d5fd197b5b67cdd08d3 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 18 Feb 2023 07:59:25 +0000
Subject: [PATCH 22/22] WIP: ARM: dts: add support for BananaPi M2S
Subject: [PATCH 22/25] WIP: ARM: dts: add support for BananaPi M2S
Import the device-tree from Linux 6.x

View File

@ -0,0 +1,102 @@
From 27b889069d184c4b6678d8dc46eef0788e385823 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 4 Mar 2023 07:33:24 +0000
Subject: [PATCH 23/25] WIP: boards: add BananaPi CM4IO defconfig
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
configs/bananapi-cm4io_defconfig | 82 ++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
create mode 100644 configs/bananapi-cm4io_defconfig
diff --git a/configs/bananapi-cm4io_defconfig b/configs/bananapi-cm4io_defconfig
new file mode 100644
index 0000000000..22442a9351
--- /dev/null
+++ b/configs/bananapi-cm4io_defconfig
@@ -0,0 +1,82 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MESON=y
+CONFIG_SYS_TEXT_BASE=0x01000000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_ENV_SIZE=0x2000
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="meson-g12b-bananapi-cm4-cm4io"
+CONFIG_MESON_G12A=y
+CONFIG_DEBUG_UART_BASE=0xff803000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_IDENT_STRING=" bpi-cm4io"
+CONFIG_SYS_LOAD_ADDR=0x1000000
+CONFIG_DEBUG_UART=y
+CONFIG_AHCI=y
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
+CONFIG_REMAKE_ELF=y
+CONFIG_OF_BOARD_SETUP=y
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_MISC_INIT_R=y
+CONFIG_SYS_MAXARGS=32
+# CONFIG_CMD_BDI is not set
+# CONFIG_CMD_IMI is not set
+CONFIG_CMD_GPIO=y
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_PCI=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_REGULATOR=y
+CONFIG_OF_CONTROL=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_ADC=y
+CONFIG_SARADC_MESON=y
+CONFIG_AHCI_PCI=y
+CONFIG_MMC_MESON_GX=y
+CONFIG_PHY_REALTEK=y
+CONFIG_DM_MDIO=y
+CONFIG_DM_MDIO_MUX=y
+CONFIG_ETH_DESIGNWARE_MESON8B=y
+CONFIG_MDIO_MUX_MESON_G12A=y
+CONFIG_PCI=y
+CONFIG_PCIE_DW_MESON=y
+CONFIG_MESON_G12A_USB_PHY=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_MESON_G12A=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MESON_EE_POWER_DOMAIN=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_RESET=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_DEBUG_UART_SKIP_INIT=y
+CONFIG_MESON_SERIAL=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_DWC3=y
+# CONFIG_USB_DWC3_GADGET is not set
+CONFIG_USB_DWC3_MESON_G12A=y
+CONFIG_USB_KEYBOARD=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e
+CONFIG_USB_GADGET_PRODUCT_NUM=0xfada
+CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_DM_VIDEO=y
+# CONFIG_VIDEO_BPP8 is not set
+# CONFIG_VIDEO_BPP16 is not set
+CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_VIDEO_MESON=y
+CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
+CONFIG_VIDEO_BMP_RLE8=y
+CONFIG_BMP_16BPP=y
+CONFIG_BMP_24BPP=y
+CONFIG_BMP_32BPP=y
+CONFIG_OF_LIBFDT_OVERLAY=y
--
2.34.1

View File

@ -0,0 +1,43 @@
From 80343fe9cb591f3448de8fdf2e33c60bb37af68f Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 4 Mar 2023 07:35:49 +0000
Subject: [PATCH 24/25] WIP: docs: boards: amlogic: update for BananaPi CM4IO
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
board/amlogic/w400/MAINTAINERS | 2 ++
doc/board/amlogic/index.rst | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/board/amlogic/w400/MAINTAINERS b/board/amlogic/w400/MAINTAINERS
index d4b4d4f91d..7d9bea8454 100644
--- a/board/amlogic/w400/MAINTAINERS
+++ b/board/amlogic/w400/MAINTAINERS
@@ -3,8 +3,10 @@ M: Neil Armstrong <neil.armstrong@linaro.org>
S: Maintained
L: u-boot-amlogic@groups.io
F: board/amlogic/w400/
+F: configs/bananapi-cm4io_defconfig
F: configs/bananapi-m2s_defconfig
F: configs/radxa-zero2_defconfig
F: doc/board/amlogic/w400.rst
+F: doc/board/amlogic/bananapi-cm4io.rst
F: doc/board/amlogic/bananapi-m2s.rst
F: doc/board/amlogic/radxa-zero2.rst
diff --git a/doc/board/amlogic/index.rst b/doc/board/amlogic/index.rst
index fd8d4185f8..f15c86b9ff 100644
--- a/doc/board/amlogic/index.rst
+++ b/doc/board/amlogic/index.rst
@@ -20,7 +20,8 @@ This matrix concerns the actual source code version.
| | P200 | LibreTech-CC v1 | Libretech-PC | | Radxa Zero | GT-King/Pro | Odroid-C4 |
| | P201 | LibreTech-AC v2 | WeTek Core2 | | | GSKing-X | Odroid-HC4 |
| | | JetHub J80 | | | | Radxa Zero2 | BPi-M2-Pro |
-| | | | | | | BPI-M2S | BPi-M5 |
+| | | | | | | BPI-CM4IO | BPi-M5 |
+| | | | | | | BPI-M2S | |
+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+
| UART | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** |
+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+
--
2.34.1

View File

@ -0,0 +1,611 @@
From dd543d9ffb5b860ad4e4e733b596236e2ed0ad7f Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 4 Mar 2023 07:39:41 +0000
Subject: [PATCH 25/25] WIP: ARM: dts: add support for BananaPi CM4IO
Import the device-tree from Linux 6.x
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
arch/arm/dts/Makefile | 1 +
.../meson-g12b-bananapi-cm4-cm4io-u-boot.dtsi | 7 +
.../arm/dts/meson-g12b-bananapi-cm4-cm4io.dts | 165 ++++++++
arch/arm/dts/meson-g12b-bananapi-cm4.dtsi | 388 ++++++++++++++++++
4 files changed, 561 insertions(+)
create mode 100644 arch/arm/dts/meson-g12b-bananapi-cm4-cm4io-u-boot.dtsi
create mode 100644 arch/arm/dts/meson-g12b-bananapi-cm4-cm4io.dts
create mode 100644 arch/arm/dts/meson-g12b-bananapi-cm4.dtsi
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 788fec93a3..9348093806 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -198,6 +198,7 @@ dtb-$(CONFIG_ARCH_MESON) += \
meson-g12a-u200.dtb \
meson-g12b-a311d-bananapi-m2s.dtb \
meson-g12b-a311d-khadas-vim3.dtb \
+ meson-g12b-bananapi-cm4-cm4io.dtb \
meson-g12b-gtking.dtb \
meson-g12b-gtking-pro.dtb \
meson-g12b-gsking-x.dtb \
diff --git a/arch/arm/dts/meson-g12b-bananapi-cm4-cm4io-u-boot.dtsi b/arch/arm/dts/meson-g12b-bananapi-cm4-cm4io-u-boot.dtsi
new file mode 100644
index 0000000000..236f2468dc
--- /dev/null
+++ b/arch/arm/dts/meson-g12b-bananapi-cm4-cm4io-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ */
+
+#include "meson-g12-common-u-boot.dtsi"
diff --git a/arch/arm/dts/meson-g12b-bananapi-cm4-cm4io.dts b/arch/arm/dts/meson-g12b-bananapi-cm4-cm4io.dts
new file mode 100644
index 0000000000..2c4a5b3f1b
--- /dev/null
+++ b/arch/arm/dts/meson-g12b-bananapi-cm4-cm4io.dts
@@ -0,0 +1,165 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2023 Neil Armstrong <neil.armstrong@linaro.org>
+ */
+
+/dts-v1/;
+
+#include "meson-g12b-bananapi-cm4.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+
+/ {
+ compatible = "bananapi,bpi-cm4io", "bananapi,bpi-cm4", "amlogic,a311d", "amlogic,g12b";
+ model = "BananaPi BPI-CM4IO Baseboard with BPI-CM4 Module";
+
+ aliases {
+ ethernet0 = &ethmac;
+ i2c0 = &i2c1;
+ i2c1 = &i2c3;
+ };
+
+ adc-keys {
+ compatible = "adc-keys";
+ io-channels = <&saradc 2>;
+ io-channel-names = "buttons";
+ keyup-threshold-microvolt = <1710000>;
+
+ button-function {
+ label = "Function";
+ linux,code = <KEY_FN>;
+ press-threshold-microvolt = <10000>;
+ };
+ };
+
+ hdmi_connector: hdmi-connector {
+ compatible = "hdmi-connector";
+ type = "a";
+
+ port {
+ hdmi_connector_in: endpoint {
+ remote-endpoint = <&hdmi_tx_tmds_out>;
+ };
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led-blue {
+ color = <LED_COLOR_ID_BLUE>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "heartbeat";
+ };
+
+ led-green {
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
+ sound {
+ compatible = "amlogic,axg-sound-card";
+ model = "BPI-CM4IO";
+ audio-aux-devs = <&tdmout_b>;
+ audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 0",
+ "TDMOUT_B IN 1", "FRDDR_B OUT 0",
+ "TDMOUT_B IN 2", "FRDDR_C OUT 0",
+ "TDM_B Playback", "TDMOUT_B OUT";
+
+ assigned-clocks = <&clkc CLKID_MPLL2>,
+ <&clkc CLKID_MPLL0>,
+ <&clkc CLKID_MPLL1>;
+ assigned-clock-parents = <0>, <0>, <0>;
+ assigned-clock-rates = <294912000>,
+ <270950400>,
+ <393216000>;
+
+ dai-link-0 {
+ sound-dai = <&frddr_a>;
+ };
+
+ dai-link-1 {
+ sound-dai = <&frddr_b>;
+ };
+
+ dai-link-2 {
+ sound-dai = <&frddr_c>;
+ };
+
+ /* 8ch hdmi interface */
+ dai-link-3 {
+ sound-dai = <&tdmif_b>;
+ dai-format = "i2s";
+ dai-tdm-slot-tx-mask-0 = <1 1>;
+ dai-tdm-slot-tx-mask-1 = <1 1>;
+ dai-tdm-slot-tx-mask-2 = <1 1>;
+ dai-tdm-slot-tx-mask-3 = <1 1>;
+ mclk-fs = <256>;
+
+ codec {
+ sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
+ };
+ };
+
+ /* hdmi glue */
+ dai-link-4 {
+ sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
+
+ codec {
+ sound-dai = <&hdmi_tx>;
+ };
+ };
+ };
+};
+
+&cecb_AO {
+ status = "okay";
+};
+
+&ethmac {
+ status = "okay";
+};
+
+&hdmi_tx {
+ status = "okay";
+};
+
+&hdmi_tx_tmds_port {
+ hdmi_tx_tmds_out: endpoint {
+ remote-endpoint = <&hdmi_connector_in>;
+ };
+};
+
+/* CSI port */
+&i2c1 {
+ status = "okay";
+};
+
+/* DSI port for touchscreen */
+&i2c3 {
+ status = "okay";
+};
+
+/* miniPCIe port with USB + SIM slot */
+&pcie {
+ status = "okay";
+};
+
+&sd_emmc_b {
+ status = "okay";
+};
+
+&tohdmitx {
+ status = "okay";
+};
+
+/* Peripheral Only USB-C port */
+&usb {
+ dr_mode = "peripheral";
+
+ status = "okay";
+};
diff --git a/arch/arm/dts/meson-g12b-bananapi-cm4.dtsi b/arch/arm/dts/meson-g12b-bananapi-cm4.dtsi
new file mode 100644
index 0000000000..dc0988c826
--- /dev/null
+++ b/arch/arm/dts/meson-g12b-bananapi-cm4.dtsi
@@ -0,0 +1,388 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2023 Neil Armstrong <neil.armstrong@linaro.org>
+ */
+
+#include "meson-g12b-a311d.dtsi"
+#include <dt-bindings/gpio/meson-g12a-gpio.h>
+
+/ {
+ aliases {
+ serial0 = &uart_AO;
+ rtc1 = &vrtc;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ emmc_pwrseq: emmc-pwrseq {
+ compatible = "mmc-pwrseq-emmc";
+ reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
+ };
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x0 0x0 0x40000000>;
+ };
+
+ sdio_pwrseq: sdio-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&gpio GPIOAO_6 GPIO_ACTIVE_LOW>;
+ clocks = <&wifi32k>;
+ clock-names = "ext_clock";
+ };
+
+ emmc_1v8: regulator-emmc_1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "EMMC_1V8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&vddao_3v3>;
+ regulator-always-on;
+ };
+
+ dc_in: regulator-dc-in {
+ compatible = "regulator-fixed";
+ regulator-name = "DC_IN";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ };
+
+ vddio_c: regulator-vddio-c {
+ compatible = "regulator-gpio";
+ regulator-name = "VDDIO_C";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+
+ enable-gpio = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>;
+ enable-active-high;
+ regulator-always-on;
+
+ gpios = <&gpio_ao GPIOAO_9 GPIO_OPEN_DRAIN>;
+ gpios-states = <1>;
+
+ states = <1800000 0>,
+ <3300000 1>;
+ };
+
+ vddao_1v8: regulator-vddao-1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "VDDAO_1V8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&vddao_3v3>;
+ regulator-always-on;
+ };
+
+ vddao_3v3: regulator-vddao-3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "VDDAO_3V3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&dc_in>;
+ regulator-always-on;
+ };
+
+ vddcpu_a: regulator-vddcpu-a {
+ /*
+ * MP8756GD DC/DC Regulator.
+ */
+ compatible = "pwm-regulator";
+
+ regulator-name = "VDDCPU_A";
+ regulator-min-microvolt = <680000>;
+ regulator-max-microvolt = <1040000>;
+
+ pwm-supply = <&dc_in>;
+
+ pwms = <&pwm_ab 0 1250 0>;
+ pwm-dutycycle-range = <100 0>;
+
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vddcpu_b: regulator-vddcpu-b {
+ /*
+ * SY8120B1ABC DC/DC Regulator.
+ */
+ compatible = "pwm-regulator";
+
+ regulator-name = "VDDCPU_B";
+ regulator-min-microvolt = <680000>;
+ regulator-max-microvolt = <1040000>;
+
+ pwm-supply = <&dc_in>;
+
+ pwms = <&pwm_AO_cd 1 1250 0>;
+ pwm-dutycycle-range = <100 0>;
+
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ wifi32k: wifi32k {
+ compatible = "pwm-clock";
+ #clock-cells = <0>;
+ clock-frequency = <32768>;
+ pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
+ };
+};
+
+&arb {
+ status = "okay";
+};
+
+&clkc_audio {
+ status = "okay";
+};
+
+&cec_AO {
+ pinctrl-0 = <&cec_ao_a_h_pins>;
+ pinctrl-names = "default";
+ hdmi-phandle = <&hdmi_tx>;
+};
+
+&cecb_AO {
+ pinctrl-0 = <&cec_ao_b_h_pins>;
+ pinctrl-names = "default";
+ hdmi-phandle = <&hdmi_tx>;
+};
+
+&cpu0 {
+ cpu-supply = <&vddcpu_b>;
+ operating-points-v2 = <&cpu_opp_table_0>;
+ clocks = <&clkc CLKID_CPU_CLK>;
+ clock-latency = <50000>;
+};
+
+&cpu1 {
+ cpu-supply = <&vddcpu_b>;
+ operating-points-v2 = <&cpu_opp_table_0>;
+ clocks = <&clkc CLKID_CPU_CLK>;
+ clock-latency = <50000>;
+};
+
+&cpu100 {
+ cpu-supply = <&vddcpu_a>;
+ operating-points-v2 = <&cpub_opp_table_1>;
+ clocks = <&clkc CLKID_CPUB_CLK>;
+ clock-latency = <50000>;
+};
+
+&cpu101 {
+ cpu-supply = <&vddcpu_a>;
+ operating-points-v2 = <&cpub_opp_table_1>;
+ clocks = <&clkc CLKID_CPUB_CLK>;
+ clock-latency = <50000>;
+};
+
+&cpu102 {
+ cpu-supply = <&vddcpu_a>;
+ operating-points-v2 = <&cpub_opp_table_1>;
+ clocks = <&clkc CLKID_CPUB_CLK>;
+ clock-latency = <50000>;
+};
+
+&cpu103 {
+ cpu-supply = <&vddcpu_a>;
+ operating-points-v2 = <&cpub_opp_table_1>;
+ clocks = <&clkc CLKID_CPUB_CLK>;
+ clock-latency = <50000>;
+};
+
+&ext_mdio {
+ external_phy: ethernet-phy@0 {
+ /* Realtek RTL8211F (0x001cc916) */
+ reg = <0>;
+ max-speed = <1000>;
+
+ interrupt-parent = <&gpio_intc>;
+ /* MAC_INTR on GPIOZ_14 */
+ interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+ };
+};
+
+/* Ethernet to be enabled in baseboard DT */
+&ethmac {
+ pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
+ pinctrl-names = "default";
+ phy-mode = "rgmii-txid";
+ phy-handle = <&external_phy>;
+};
+
+&frddr_a {
+ status = "okay";
+};
+
+&frddr_b {
+ status = "okay";
+};
+
+&frddr_c {
+ status = "okay";
+};
+
+/* HDMI to be enabled in baseboard DT */
+&hdmi_tx {
+ pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
+ pinctrl-names = "default";
+ hdmi-supply = <&dc_in>;
+};
+
+/* "Camera" I2C bus */
+&i2c1 {
+ pinctrl-0 = <&i2c1_sda_h6_pins>, <&i2c1_sck_h7_pins>;
+ pinctrl-names = "default";
+};
+
+/* Main I2C bus */
+&i2c2 {
+ pinctrl-0 = <&i2c2_sda_x_pins>, <&i2c2_sck_x_pins>;
+ pinctrl-names = "default";
+};
+
+/* "ID" I2C bus */
+&i2c3 {
+ pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
+ pinctrl-names = "default";
+};
+
+&pcie {
+ reset-gpios = <&gpio GPIOA_8 GPIO_ACTIVE_LOW>;
+};
+
+&pwm_ab {
+ pinctrl-0 = <&pwm_a_e_pins>;
+ pinctrl-names = "default";
+ clocks = <&xtal>;
+ clock-names = "clkin0";
+
+ status = "okay";
+};
+
+&pwm_ef {
+ pinctrl-0 = <&pwm_e_pins>;
+ pinctrl-names = "default";
+
+ status = "okay";
+};
+
+&pwm_AO_cd {
+ pinctrl-0 = <&pwm_ao_d_e_pins>;
+ pinctrl-names = "default";
+ clocks = <&xtal>;
+ clock-names = "clkin1";
+
+ status = "okay";
+};
+
+&saradc {
+ vref-supply = <&vddao_1v8>;
+
+ status = "okay";
+};
+
+/* on-module SDIO WiFi */
+&sd_emmc_a {
+ 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_3v3>;
+
+ status = "okay";
+
+ rtl8822cs: wifi@1 {
+ reg = <1>;
+ };
+};
+
+/* SD card to be enabled in baseboard DT */
+&sd_emmc_b {
+ pinctrl-0 = <&sdcard_c_pins>;
+ pinctrl-1 = <&sdcard_clk_gate_c_pins>;
+ pinctrl-names = "default", "clk-gate";
+
+ bus-width = <4>;
+ cap-sd-highspeed;
+ max-frequency = <50000000>;
+ disable-wp;
+
+ cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
+ vmmc-supply = <&vddao_3v3>;
+ vqmmc-supply = <&vddio_c>;
+};
+
+/* on-module eMMC */
+&sd_emmc_c {
+ pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
+ pinctrl-1 = <&emmc_clk_gate_pins>;
+ pinctrl-names = "default", "clk-gate";
+
+ bus-width = <8>;
+ cap-mmc-highspeed;
+ mmc-ddr-1_8v;
+ mmc-hs200-1_8v;
+ max-frequency = <200000000>;
+ disable-wp;
+
+ mmc-pwrseq = <&emmc_pwrseq>;
+ vmmc-supply = <&vddao_3v3>;
+ vqmmc-supply = <&vddao_1v8>;
+
+ status = "okay";
+};
+
+&tdmif_b {
+ status = "okay";
+};
+
+&tdmout_b {
+ status = "okay";
+};
+
+/* on-module UART BT */
+&uart_A {
+ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+ pinctrl-names = "default";
+ uart-has-rtscts;
+
+ status = "okay";
+
+ 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>;
+ };
+};
+
+&uart_AO {
+ pinctrl-0 = <&uart_ao_a_pins>;
+ pinctrl-names = "default";
+
+ status = "okay";
+};
+
+&usb {
+ phys = <&usb2_phy0>, <&usb2_phy1>;
+ phy-names = "usb2-phy0", "usb2-phy1";
+};
--
2.34.1