Board: Bananapi M2S additional support

Removed WIP status
Added CONFIG_R8169=m to defconfig(s) (eth support)
Modified and added additional patches (linux 6.1 / 6.4)
U-Boot v2023.07.2 (dropped v2022.10)
Upstream BT FW (rtl8822cs) is now shared between CM4IO and M2s

Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
This commit is contained in:
Patrick Yavitz
2023-07-21 07:22:01 -04:00
committed by Igor
parent bc0e131747
commit effbb4c900
11 changed files with 425 additions and 312 deletions

View File

@@ -11,10 +11,10 @@ BOOT_FDT_FILE="amlogic/meson-g12b-bananapi-cm4-cm4io.dtb"
BOOTBRANCH_BOARD="tag:v2023.01"
BOOTPATCHDIR="v2023.01"
function post_family_tweaks_bsp__bananapicm4io_rtl_bt() {
if [[ -d "$SRC/packages/bsp/${BOARD}/rtl_bt" ]]; then
function post_family_tweaks_bsp__bananapi_rtl_bt() {
if [[ -d "$SRC/packages/bsp/bananapi/rtl_bt" ]]; then
mkdir -p "${destination}"/lib/firmware/updates/rtl_bt
display_alert "$BOARD" "Installing Upstream Firmware" "info"
cp -fr $SRC/packages/bsp/${BOARD}/rtl_bt/* "${destination}"/lib/firmware/updates/rtl_bt/
display_alert "$BOARD" "Installing upstream firmware" "info"
cp -fr $SRC/packages/bsp/bananapi/rtl_bt/* "${destination}"/lib/firmware/updates/rtl_bt/
fi
}

View File

@@ -0,0 +1,20 @@
# Amlogic A311D 4GB RAM eMMC 2xGBE USB3
BOARD_NAME="Banana Pi M2S"
BOARDFAMILY="meson-g12b"
BOARD_MAINTAINER="pyavitz"
BOOTCONFIG="bananapi-m2s_defconfig"
KERNEL_TARGET="current,edge"
FULL_DESKTOP="yes"
SERIALCON="ttyAML0"
BOOT_LOGO="desktop"
BOOT_FDT_FILE="amlogic/meson-g12b-a311d-bananapi-m2s.dtb"
BOOTBRANCH_BOARD="tag:v2023.07.02"
BOOTPATCHDIR="v2023.07.02"
function post_family_tweaks_bsp__bananapi_rtl_bt() {
if [[ -d "$SRC/packages/bsp/bananapi/rtl_bt" ]]; then
mkdir -p "${destination}"/lib/firmware/updates/rtl_bt
display_alert "$BOARD" "Installing upstream firmware" "info"
cp -fr $SRC/packages/bsp/bananapi/rtl_bt/* "${destination}"/lib/firmware/updates/rtl_bt/
fi
}

View File

@@ -1,14 +0,0 @@
# Amlogic A311D 4GB RAM eMMC 2xGBE USB3
BOARD_NAME="Banana Pi M2S"
BOARDFAMILY="meson-g12b"
BOARD_MAINTAINER="jeanrhum"
BOOTCONFIG="bananapim2s_defconfig"
KERNEL_TARGET="current,edge"
FULL_DESKTOP="yes"
SERIALCON="ttyAML0"
BOOT_LOGO="desktop"
BOOT_FDT_FILE="amlogic/meson-g12b-a311d-bananapi-m2s.dtb"
# Newer u-boot; new DT, Makefile and defconfig in patch/u-boot/v2022.10/board_bananapim2s
BOOTBRANCH_BOARD="tag:v2022.10"
BOOTPATCHDIR="v2022.10/board_bananapim2s" # this avoid the "USB first" patch in the v2022.10 folder

View File

@@ -3048,7 +3048,7 @@ CONFIG_NET_VENDOR_RDC=y
CONFIG_NET_VENDOR_REALTEK=y
# CONFIG_8139CP is not set
# CONFIG_8139TOO is not set
# CONFIG_R8169 is not set
CONFIG_R8169=m
CONFIG_NET_VENDOR_RENESAS=y
CONFIG_NET_VENDOR_ROCKER=y
CONFIG_ROCKER=m

View File

@@ -3076,7 +3076,7 @@ CONFIG_NET_VENDOR_RDC=y
CONFIG_NET_VENDOR_REALTEK=y
# CONFIG_8139CP is not set
# CONFIG_8139TOO is not set
# CONFIG_R8169 is not set
CONFIG_R8169=m
CONFIG_NET_VENDOR_RENESAS=y
CONFIG_NET_VENDOR_ROCKER=y
CONFIG_ROCKER=m

View File

@@ -1,15 +1,12 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jean Rhum <jeanrhum@gmail.com>
Date: Wed, 21 Dec 2022 17:56:18 +0100
Subject: Initial support for Bananapi M2S
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Sun, 9 July 2023 19:42:40 -0400
Subject: [PATCH] Bananapi M2S Linux 6.1.y Support
Initial support for Bananapi M2S
Bananapi M2S Linux 6.1.y Support
Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
---
Documentation/devicetree/bindings/arm/amlogic.yaml | 1 +
arch/arm64/boot/dts/amlogic/Makefile | 1 +
arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts | 593 ++++++++++
3 files changed, 595 insertions(+)
diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml
index 9fda2436c618..bbd5f6197e4d 100644
--- a/Documentation/devicetree/bindings/arm/amlogic.yaml
@@ -22,77 +19,136 @@ index 9fda2436c618..bbd5f6197e4d 100644
- const: amlogic,a311d
- const: amlogic,g12b
diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
index d4b315a05ef9..59d086050ec2 100644
--- a/arch/arm64/boot/dts/amlogic/Makefile
+++ b/arch/arm64/boot/dts/amlogic/Makefile
@@ -9,6 +9,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-g12a-sei510.dtb
diff -Naur a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
--- a/arch/arm64/boot/dts/amlogic/Makefile 2023-07-08 15:21:22.494336520 -0400
+++ b/arch/arm64/boot/dts/amlogic/Makefile 2023-07-08 15:18:22.342309412 -0400
@@ -8,6 +8,7 @@
dtb-$(CONFIG_ARCH_MESON) += meson-g12a-sei510.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12a-u200.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12a-x96-max.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-a311d-khadas-vim3.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-g12b-a311d-bananapi-m2s.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-a311d-khadas-vim3.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-cm4io.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gsking-x.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gtking-pro.dtb
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
new file mode 100644
index 000000000000..65f11dde0a7a
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts
@@ -0,0 +1,593 @@
@@ -15,6 +16,7 @@
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gtking.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2-plus.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-g12b-s922x-bananapi-m2s.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-s922x-khadas-vim3.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-ugoos-am6.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-kii-pro.dtb
--- /dev/null 2023-07-07 19:42:40.585806232 -0400
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts 2023-07-09 05:53:44.188239967 -0400
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Author: Jean Rhum <jeanrhum@gmail.com>
+ * Adapted from bananapi-m2s 4.9 dts, mainline vim3 and radxa zero2 dts(i)
+ * Copyright (c) 2023 Christian Hewitt <christianshewitt@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "meson-g12b-a311d.dtsi"
+#include "meson-g12b-bananapi.dtsi"
+
+/ {
+ compatible = "bananapi,bpi-m2s", "amlogic,a311d", "amlogic,g12b";
+ model = "BananaPi M2S";
+
+ aliases {
+ i2c0 = &i2c1;
+ i2c1 = &i2c3;
+ };
+};
+
+&reboot {
+ sd-vqen = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
+};
+
+/* Camera (CSI) bus */
+&i2c1 {
+ status = "okay";
+ pinctrl-0 = <&i2c1_sda_h6_pins>, <&i2c1_sck_h7_pins>;
+ pinctrl-names = "default";
+};
+
+/* Display (DSI) bus */
+&i2c3 {
+ status = "okay";
+ pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
+ pinctrl-names = "default";
+};
+
+//&npu {
+// status = "okay";
+//};
--- /dev/null 2023-07-07 19:42:40.585806232 -0400
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi 2023-07-09 05:53:12.027864793 -0400
@@ -0,0 +1,530 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ * Copyright (c) 2023 Christian Hewitt <christianshewitt@gmail.com>
+ */
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/gpio/meson-g12a-gpio.h>
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+
+/ {
+ compatible = "bananapi,m2s", "amlogic,a311d", "amlogic,g12b";
+ model = "Bananapi M2S";
+
+ aliases {
+ serial0 = &uart_AO;
+ serial2 = &uart_A;
+ ethernet0 = &ethmac;
+ 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";
+ };
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x0 0x0 0x80000000>;
+ reg = <0x0 0x0 0x0 0x80000000>; /* 2 GiB or 4 GiB */
+ };
+
+ leds {
+ compatible = "gpio-leds";
+ status = "okay";
+
+ blue {
+ label = "blue";
+ gpios = <0x18 0x07 0x01>;
+ default-state = "on";
+ linux,default-trigger = "default-on";
+ };
+ adc-keys {
+ compatible = "adc-keys";
+ io-channels = <&saradc 2>;
+ io-channel-names = "buttons";
+ keyup-threshold-microvolt = <1710000>;
+
+ green {
+ label = "green";
+ gpios = <0x18 0x02 0x01>;
+ default-state = "on";
+ linux,default-trigger = "timer";
+ button-function {
+ label = "RST";
+ linux,code = <KEY_POWER>;
+ press-threshold-microvolt = <10000>;
+ };
+ };
+
+
+
+ emmc_pwrseq: emmc-pwrseq {
+ compatible = "mmc-pwrseq-emmc";
+ reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
+ };
+
+ fan0: pwm-fan {
+ compatible = "pwm-fan";
+ #cooling-cells = <2>;
+ cooling-min-state = <0>;
+ cooling-max-state = <3>;
+ cooling-levels = <0 120 170 220>;
+ pwms = <&pwm_cd 1 40000 0>;
+ };
+
+ hdmi-connector {
+ compatible = "hdmi-connector";
+ type = "a";
@@ -104,10 +160,21 @@ index 000000000000..65f11dde0a7a
+ };
+ };
+
+
+ emmc_pwrseq: emmc-pwrseq {
+ compatible = "mmc-pwrseq-emmc";
+ reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
+ leds {
+ compatible = "gpio-leds";
+
+ led-0 {
+ color = <LED_COLOR_ID_BLUE>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "heartbeat";
+ };
+
+ led-1 {
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ sdio_pwrseq: sdio-pwrseq {
@@ -116,16 +183,23 @@ index 000000000000..65f11dde0a7a
+ clocks = <&wifi32k>;
+ clock-names = "ext_clock";
+ };
+
+ dc_in: regulator-dc_in {
+
+ wifi32k: wifi32k {
+ compatible = "pwm-clock";
+ #clock-cells = <0>;
+ clock-frequency = <32768>;
+ pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
+ };
+
+ dc_in: regulator-dc-in {
+ compatible = "regulator-fixed";
+ regulator-name = "DC_IN";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ };
+
+ vcc_5v: regulator-vcc_5v {
+
+ vcc_5v: regulator-vcc-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "VCC_5V";
+ regulator-min-microvolt = <5000000>;
@@ -135,8 +209,17 @@ index 000000000000..65f11dde0a7a
+ gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+ enable-active-high;
+ };
+
+ vcc_1v8: regulator-vcc_1v8 {
+
+ vcc_3v3: regulator-vcc-3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "VCC_3V3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&vsys_3v3>;
+ regulator-always-on;
+ };
+
+ vcc_1v8: regulator-vcc-1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "VCC_1V8";
+ regulator-min-microvolt = <1800000>;
@@ -145,17 +228,7 @@ index 000000000000..65f11dde0a7a
+ regulator-always-on;
+ };
+
+ vcc_3v3: regulator-vcc_3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "VCC_3V3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&vsys_3v3>;
+ regulator-always-on;
+ /* FIXME: actually controlled by VDDCPU_B_EN */
+ };
+
+ vddao_1v8: regulator-vddao_1v8 {
+ vddao_1v8: regulator-vddao-1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "VDDIO_AO1V8";
+ regulator-min-microvolt = <1800000>;
@@ -164,16 +237,31 @@ index 000000000000..65f11dde0a7a
+ regulator-always-on;
+ };
+
+ emmc_1v8: regulator-emmc_1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "EMMC_AO1V8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&vcc_3v3>;
+ vddcpu_a: regulator-vddcpu-a {
+ compatible = "pwm-regulator";
+ regulator-name = "VDDCPU_A";
+ regulator-min-microvolt = <690000>;
+ regulator-max-microvolt = <1050000>;
+ pwm-supply = <&dc_in>;
+ pwms = <&pwm_ab 0 1250 0>;
+ pwm-dutycycle-range = <100 0>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vsys_3v3: regulator-vcc_3v3 {
+
+ vddcpu_b: regulator-vddcpu-b {
+ compatible = "pwm-regulator";
+ regulator-name = "VDDCPU_B";
+ regulator-min-microvolt = <690000>;
+ regulator-max-microvolt = <1050000>;
+ pwm-supply = <&vsys_3v3>;
+ pwms = <&pwm_AO_cd 1 1250 0>;
+ pwm-dutycycle-range = <100 0>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vsys_3v3: regulator-vsys-3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "VSYS_3V3";
+ regulator-min-microvolt = <3300000>;
@@ -181,8 +269,17 @@ index 000000000000..65f11dde0a7a
+ vin-supply = <&dc_in>;
+ regulator-always-on;
+ };
+
+ usb_pwr: regulator-usb_pwr {
+
+ emmc_1v8: regulator-emmc-1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "EMMC_AO1V8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&vcc_3v3>;
+ regulator-always-on;
+ };
+
+ usb_pwr: regulator-usb-pwr {
+ compatible = "regulator-fixed";
+ regulator-name = "USB_PWR";
+ regulator-min-microvolt = <5000000>;
@@ -193,58 +290,9 @@ index 000000000000..65f11dde0a7a
+ enable-active-high;
+ };
+
+ hdmi-connector {
+ compatible = "hdmi-connector";
+ type = "a";
+
+ port {
+ hdmi_connector_in: endpoint {
+ remote-endpoint = <&hdmi_tx_tmds_out>;
+ };
+ };
+ };
+
+ vddcpu_a: regulator-vddcpu-a {
+ /*
+ * MP8756GD Regulator.
+ */
+ compatible = "pwm-regulator";
+
+ regulator-name = "VDDCPU_A";
+ regulator-min-microvolt = <690000>;
+ regulator-max-microvolt = <1050000>;
+
+ 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 {
+ /*
+ * Silergy SY8120B1ABC Regulator.
+ */
+ compatible = "pwm-regulator";
+
+ regulator-name = "VDDCPU_B";
+ regulator-min-microvolt = <690000>;
+ regulator-max-microvolt = <1050000>;
+
+ pwm-supply = <&dc_in>;
+
+ pwms = <&pwm_AO_cd 1 1250 0>;
+ pwm-dutycycle-range = <100 0>;
+
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ sound {
+ compatible = "amlogic,axg-sound-card";
+ model = "BANANAPI-M2S";
+ model = "BPI-M2S";
+ audio-aux-devs = <&tdmout_b>;
+ audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
+ "TDMOUT_B IN 1", "FRDDR_B OUT 1",
@@ -258,7 +306,6 @@ index 000000000000..65f11dde0a7a
+ assigned-clock-rates = <294912000>,
+ <270950400>,
+ <393216000>;
+ status = "okay";
+
+ dai-link-0 {
+ sound-dai = <&frddr_a>;
@@ -296,16 +343,8 @@ index 000000000000..65f11dde0a7a
+ };
+ };
+ };
+
+ 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";
+};
@@ -314,13 +353,6 @@ index 000000000000..65f11dde0a7a
+ status = "okay";
+};
+
+&cec_AO {
+ pinctrl-0 = <&cec_ao_a_h_pins>;
+ pinctrl-names = "default";
+ status = "disabled";
+ hdmi-phandle = <&hdmi_tx>;
+};
+
+&cecb_AO {
+ pinctrl-0 = <&cec_ao_b_h_pins>;
+ pinctrl-names = "default";
@@ -328,72 +360,6 @@ index 000000000000..65f11dde0a7a
+ hdmi-phandle = <&hdmi_tx>;
+};
+
+
+&cpu_thermal {
+ trips {
+ cpu_active: cpu-active {
+ temperature = <80000>; /* millicelsius */
+ hysteresis = <2000>; /* millicelsius */
+ type = "active";
+ };
+ };
+
+};
+
+
+&saradc {
+ status = "okay";
+ vref-supply = <&vddao_1v8>;
+};
+
+
+&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>;
+ };
+};
+
+&ethmac {
+ pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+ phy-mode = "rgmii";
+ phy-handle = <&external_phy>;
+ amlogic,tx-delay-ns = <2>;
+};
+
+&frddr_a {
+ status = "okay";
+};
+
+&frddr_b {
+ status = "okay";
+};
+
+&frddr_c {
+ status = "okay";
+};
+
+&hdmi_tx {
+ status = "okay";
+ pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
+ pinctrl-names = "default";
+ hdmi-supply = <&vcc_5v>;
+};
+
+&hdmi_tx_tmds_port {
+ hdmi_tx_tmds_out: endpoint {
+ remote-endpoint = <&hdmi_connector_in>;
+ };
+};
+
+
+&cpu0 {
+ cpu-supply = <&vddcpu_b>;
+ operating-points-v2 = <&cpu_opp_table_0>;
@@ -436,41 +402,106 @@ index 000000000000..65f11dde0a7a
+ clock-latency = <50000>;
+};
+
+&ethmac {
+ pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+ phy-mode = "rgmii";
+ phy-handle = <&external_phy>;
+ amlogic,tx-delay-ns = <2>;
+};
+
+&ext_mdio {
+ external_phy: ethernet-phy@0 {
+ /* Realtek RTL8211F (0x001cc916) */
+ reg = <0>;
+ max-speed = <1000>;
+
+ reset-assert-us = <10000>;
+ reset-deassert-us = <80000>;
+ reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
+
+ interrupt-parent = <&gpio_intc>;
+ /* MAC_INTR on GPIOZ_14 */
+ interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+ };
+};
+
+&frddr_a {
+ status = "okay";
+};
+
+&frddr_b {
+ status = "okay";
+};
+
+&frddr_c {
+ status = "okay";
+};
+
+&hdmi_tx {
+ status = "okay";
+ pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
+ pinctrl-names = "default";
+ hdmi-supply = <&vcc_5v>;
+};
+
+&hdmi_tx_tmds_port {
+ hdmi_tx_tmds_out: endpoint {
+ remote-endpoint = <&hdmi_connector_in>;
+ };
+};
+
+/* Main i2c bus */
+&i2c2 {
+ status = "okay";
+ pinctrl-0 = <&i2c2_sda_x_pins>, <&i2c2_sck_x_pins>;
+ pinctrl-names = "default";
+};
+
+&pcie {
+ status = "okay";
+ reset-gpios = <&gpio GPIOA_8 GPIO_ACTIVE_LOW>;
+};
+
+&pwm_ab {
+ status = "okay";
+ pinctrl-0 = <&pwm_a_e_pins>;
+ pinctrl-names = "default";
+ clocks = <&xtal>;
+ clock-names = "clkin0";
+};
+
+&pwm_cd {
+ status = "okay";
+ pinctrl-0 = <&pwm_d_x6_pins>;
+ pinctrl-names = "default";
+ pwm-gpios = <&gpio GPIOAO_10 GPIO_ACTIVE_HIGH>;
+};
+
+&pwm_ef {
+ status = "okay";
+ pinctrl-0 = <&pwm_e_pins>;
+ pinctrl-names = "default";
+ clocks = <&xtal>;
+ clock-names = "clkin2";
+ status = "okay";
+};
+
+&pwm_AO_cd {
+ pinctrl-0 = <&pwm_ao_d_e_pins>;
+ pinctrl-names = "default";
+ clocks = <&xtal>;
+ clock-names = "clkin4";
+ clock-names = "clkin1";
+ status = "okay";
+};
+
+
+&ir {
+ status = "disabled";
+ pinctrl-0 = <&remote_input_ao_pins>;
+ pinctrl-names = "default";
+&saradc {
+ status = "okay";
+ vref-supply = <&vddao_1v8>;
+};
+
+
+/* SDIO */
+&sd_emmc_a {
+ status = "okay";
+ /* enable if WiFi/BT board connected */
+ status = "disabled";
+ pinctrl-0 = <&sdio_pins>;
+ pinctrl-1 = <&sdio_clk_gate_pins>;
+ pinctrl-names = "default", "clk-gate";
@@ -478,13 +509,13 @@ index 000000000000..65f11dde0a7a
+ #size-cells = <0>;
+
+ bus-width = <4>;
+ cap-sd-highspeed;
+ max-frequency = <100000000>;
+ sd-uhs-sdr104;
+ max-frequency = <50000000>;
+
+ non-removable;
+ disable-wp;
+
+ /* WiFi firmware requires power to be kept while in suspend */
+ /* WiFi firmware requires power in suspend */
+ keep-power-in-suspend;
+
+ mmc-pwrseq = <&sdio_pwrseq>;
@@ -492,43 +523,11 @@ index 000000000000..65f11dde0a7a
+ vmmc-supply = <&vsys_3v3>;
+ vqmmc-supply = <&vddao_1v8>;
+
+ brcmf: wifi@1 {
+ rtl8822cs: wifi@1 {
+ reg = <1>;
+ compatible = "brcm,bcm4329-fmac";
+ };
+};
+
+&gpio {
+ gpio-line-names =
+ /* GPIOZ */
+ "PIN_27", "PIN_28", "PIN_7", "PIN_11", "PIN_13", "PIN_15", "PIN_18", "PIN_40",
+ "", "", "", "", "", "", "", "",
+ /* GPIOH */
+ "", "", "", "", "PIN_19", "PIN_21", "PIN_24", "PIN_23",
+ "",
+ /* BOOT */
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "EMMC_PWRSEQ", "", "", "",
+ /* GPIOC */
+ "", "", "", "", "", "", "SD_CD", "PIN_36",
+ /* GPIOA */
+ "PIN_32", "PIN_12", "PIN_35", "", "", "PIN_38", "", "",
+ "", "", "", "", "LED_GREEN", "PIN_31", "PIN_3", "PIN_5",
+ /* GPIOX */
+ "", "", "", "", "", "", "SDIO_PWRSEQ", "",
+ "", "", "", "", "", "", "", "",
+ "", "BT_SHUTDOWN", "", "";
+};
+
+&gpio_ao {
+ gpio-line-names =
+ /* GPIOAO */
+ "PIN_8", "PIN_10", "", "BTN_POWER", "", "", "", "PIN_29",
+ "PIN_33", "PIN_37", "FAN", "",
+ /* GPIOE */
+ "", "", "";
+};
+
+/* SD card */
+&sd_emmc_b {
+ status = "okay";
@@ -565,28 +564,11 @@ index 000000000000..65f11dde0a7a
+ vqmmc-supply = <&emmc_1v8>;
+};
+
+
+&tdmif_a {
+&tdmif_b {
+ status = "okay";
+};
+
+&tdmin_a {
+ status = "okay";
+};
+
+&tdmout_a {
+ status = "okay";
+};
+
+&toddr_a {
+ status = "okay";
+};
+
+&toddr_b {
+ status = "okay";
+};
+
+&toddr_c {
+&tdmout_b {
+ status = "okay";
+};
+
@@ -594,19 +576,18 @@ index 000000000000..65f11dde0a7a
+ status = "okay";
+};
+
+
+&uart_A {
+ status = "okay";
+ /* 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 = "brcm,bcm43438-bt";
+ shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
+ max-speed = <2000000>;
+ clocks = <&wifi32k>;
+ clock-names = "lpo";
+ 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>;
+ };
+};
+
@@ -631,8 +612,27 @@ index 000000000000..65f11dde0a7a
+&usb {
+ status = "okay";
+ dr_mode = "peripheral";
+ phys = <&usb2_phy0>, <&usb2_phy1>;
+ phy-names = "usb2-phy0", "usb2-phy1";
+};
--- /dev/null 2023-07-07 19:42:40.585806232 -0400
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-bananapi-m2s.dts 2023-07-09 05:54:04.824479978 -0400
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2023 Christian Hewitt <christianshewitt@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "meson-g12b-s922x.dtsi"
+#include "meson-g12b-bananapi.dtsi"
+
+/ {
+ compatible = "bananapi,bpi-m2s", "amlogic,s922x", "amlogic,g12b";
+ model = "BananaPi M2S";
+};
+
--
Armbian
+&reboot {
+ sd-vqen = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
+};

View File

@@ -53,18 +53,17 @@ Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
arch/arm64/boot/dts/amlogic/meson-g12b-radxa-zero2.dts | 576 ++++++++++
2 files changed, 577 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
index 858ae834cc9f..9e2ad0b42523 100644
--- a/arch/arm64/boot/dts/amlogic/Makefile
+++ b/arch/arm64/boot/dts/amlogic/Makefile
@@ -15,6 +15,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gtking-pro.dtb
diff -Naur a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
--- a/arch/arm64/boot/dts/amlogic/Makefile 2023-07-20 22:26:59.689503043 -0400
+++ b/arch/arm64/boot/dts/amlogic/Makefile 2023-07-20 22:24:15.725044705 -0400
@@ -15,6 +15,7 @@
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gtking.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2-plus.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-g12b-radxa-zero2.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-s922x-bananapi-m2s.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-s922x-khadas-vim3.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-g12b-ugoos-am6.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-kii-pro.dtb
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-radxa-zero2.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-radxa-zero2.dts
new file mode 100644
index 000000000000..e261ba2a4b47

View File

@@ -0,0 +1,53 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Sun, 9 July 2023 07:12:42 -0400
Subject: [PATCH] Add support for the meson64-reboot driver
Add support for the meson64-reboot driver
Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
---
diff -Naur a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts 2023-07-01 07:12:42.000000000 -0400
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-bananapi-m2s.dts 2023-07-09 07:07:01.116609978 -0400
@@ -18,6 +18,10 @@
};
};
+&reboot {
+ sd-vqen = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
+};
+
/* Camera (CSI) bus */
&i2c1 {
status = "okay";
diff -Naur a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi 2023-07-01 07:12:42.000000000 -0400
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi 2023-07-09 07:06:35.952527545 -0400
@@ -17,6 +17,15 @@
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 -Naur a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-bananapi-m2s.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-bananapi-m2s.dts
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-bananapi-m2s.dts 2023-07-01 07:12:42.000000000 -0400
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-bananapi-m2s.dts 2023-07-09 07:07:28.228667931 -0400
@@ -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>;
+};

View File

@@ -0,0 +1,55 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Thur, 20 July 2023 11:44:24 -0400
Subject: [PATCH] U-Boot v2023.07.02 Bananapi M2S Support
Allow meson-g12b-s922x-bananapi-m2s.dtb to be compiled.
HDMI doesn't come up until handing off to the kernel, at
which point it only displays in green and magenta. Removing
the default *-u-boot.dtsi and adding one specific to each variant
corrects the issue.
Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
---
diff -Naur a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
--- a/arch/arm/dts/Makefile 2023-07-11 11:20:44.000000000 -0400
+++ b/arch/arm/dts/Makefile 2023-07-20 17:54:53.990269166 -0400
@@ -221,6 +221,7 @@
meson-g12b-odroid-n2l.dtb \
meson-g12b-odroid-n2-plus.dtb \
meson-g12b-radxa-zero2.dtb \
+ meson-g12b-s922x-bananapi-m2s.dtb \
meson-sm1-bananapi-m2-pro.dtb \
meson-sm1-bananapi-m5.dtb \
meson-sm1-khadas-vim3l.dtb \
--- b/arch/arm/dts/meson-g12b-bananapi-u-boot.dtsi 2023-07-20 12:53:13.241085241 -0400
+++ /dev/null 2023-07-17 11:44:24.323953311 -0400
@@ -1,7 +0,0 @@
-// 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"
--- /dev/null 2023-07-17 11:44:24.323953311 -0400
+++ b/arch/arm/dts/meson-g12b-a311d-bananapi-m2s-u-boot.dtsi 2023-07-20 12:47:49.795706226 -0400
@@ -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"
--- /dev/null 2023-07-17 11:44:24.323953311 -0400
+++ b/arch/arm/dts/meson-g12b-s922x-bananapi-m2s-u-boot.dtsi 2023-07-20 12:49:58.590463960 -0400
@@ -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"