This commit is contained in:
Qubot 2023-08-18 19:32:32 +08:00
parent 170dad2e99
commit b1cce2d02f
2 changed files with 62 additions and 109 deletions

View File

@ -2,23 +2,21 @@ diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 72d6696c..6126a060 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -655,7 +655,8 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \
@@ -655,7 +655,7 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \
sun50i-h6-pine-h64-model-b.dtb \
sun50i-h6-tanix-tx6.dtb
dtb-$(CONFIG_MACH_SUN50I_H616) += \
- sun50i-h616-orangepi-zero2.dtb
+ sun50i-h616-orangepi-zero2.dtb \
+ sun50i-h616-mangopi-mcore.dtb \
+ sun50i-h618-bananapi-m4b.dtb
dtb-$(CONFIG_MACH_SUN50I) += \
sun50i-a64-amarula-relic.dtb \
sun50i-a64-bananapi-m64.dtb \
diff --git a/arch/arm/dts/sun50i-h616-mangopi-mcore.dts b/arch/arm/dts/sun50i-h616-mangopi-mcore.dts
diff --git a/arch/arm/dts/sun50i-h618-bananapi-m4b.dts b/arch/arm/dts/sun50i-h618-bananapi-m4b.dts
new file mode 100644
index 00000000..177bcc74
--- /dev/null
+++ b/arch/arm/dts/sun50i-h616-mangopi-mcore.dts
@@ -0,0 +1,242 @@
+++ b/arch/arm/dts/sun50i-h618-bananapi-m4b.dts
@@ -0,0 +1,196 @@
+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+/*
+ * Copyright (C) 2020 Arm Ltd.
@ -33,11 +31,11 @@ index 00000000..177bcc74
+#include <dt-bindings/leds/common.h>
+
+/ {
+ model = "MangoPi Mcore";
+ compatible = "mgcc,mangopi-mcore", "allwinner,sun50i-h616";
+ model = "BananaPi M4 Berry";
+ compatible = "BiPai,bananapi-m4b", "allwinner,sun50i-h618";
+
+ aliases {
+ ethernet0 = &emac1;
+ ethernet0 = &emac0;
+ serial0 = &uart0;
+ };
+
@ -104,15 +102,14 @@ index 00000000..177bcc74
+ status = "okay";
+};
+
+&mdio1 {
+ rmii_phy: ethernet-phy@16 {
+&mdio0 {
+ ext_rgmii_phy: ethernet-phy@1 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <16>;
+ reg = <1>;
+ };
+};
+
+&mmc0 {
+ vmmc-supply = <&reg_dcdce>;
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
+ bus-width = <4>;
+ status = "okay";
@ -126,109 +123,64 @@ index 00000000..177bcc74
+ status = "okay";
+};
+
+&r_rsb {
+&r_i2c {
+ status = "okay";
+
+ axp305: pmic@745 {
+ compatible = "x-powers,axp305", "x-powers,axp805",
+ "x-powers,axp806";
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ reg = <0x745>;
+ axp313a: pmic@36 {
+ compatible = "x-powers,axp313a";
+ status = "okay";
+ reg = <0x36>;
+ wakeup-source;
+
+ x-powers,self-working-mode;
+ vina-supply = <&reg_vcc5v>;
+ vinb-supply = <&reg_vcc5v>;
+ vinc-supply = <&reg_vcc5v>;
+ vind-supply = <&reg_vcc5v>;
+ vine-supply = <&reg_vcc5v>;
+ aldoin-supply = <&reg_vcc5v>;
+ bldoin-supply = <&reg_vcc5v>;
+ cldoin-supply = <&reg_vcc5v>;
+ standby_param: standby_param {
+ vcc-dram = <0x4>;
+ };
+
+ regulators{
+ reg_dcdc1: dcdc1 {
+ regulator-name = "axp313a-dcdc1";
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ regulator-step-delay-us = <25>;
+ regulator-final-delay-us = <50>;
+ regulator-always-on;
+ };
+
+ reg_dcdc2: dcdc2 {
+ regulator-name = "axp313a-dcdc2";
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <1540000>;
+ regulator-step-delay-us = <25>;
+ regulator-final-delay-us = <50>;
+ regulator-ramp-delay = <200>;
+ regulator-always-on;
+ };
+
+ reg_dcdc3: dcdc3 {
+ regulator-name = "axp313a-dcdc3";
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1100000>;
+ regulator-step-delay-us = <25>;
+ regulator-final-delay-us = <50>;
+ regulator-always-on;
+ };
+
+ regulators {
+ reg_aldo1: aldo1 {
+ regulator-always-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-sys";
+ };
+
+ reg_aldo2: aldo2 { /* 3.3V on headers */
+ regulator-always-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc3v3-ext";
+ };
+
+ reg_aldo3: aldo3 { /* 3.3V on headers */
+ regulator-always-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc3v3-ext2";
+ };
+
+ reg_bldo1: bldo1 {
+ regulator-always-on;
+ regulator-name = "axp313a-aldo1";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-name = "vcc1v8";
+ };
+
+ bldo2 {
+ /* unused */
+ };
+
+ bldo3 {
+ /* unused */
+ };
+
+ bldo4 {
+ /* unused */
+ };
+
+ cldo1 {
+ /* reserved */
+ };
+
+ cldo2 {
+ /* unused */
+ };
+
+ cldo3 {
+ /* unused */
+ };
+
+ reg_dcdca: dcdca {
+ regulator-step-delay-us = <25>;
+ regulator-final-delay-us = <50>;
+ regulator-always-on;
+ regulator-min-microvolt = <810000>;
+ regulator-max-microvolt = <1080000>;
+ regulator-name = "vdd-cpu";
+ };
+
+ reg_dcdcc: dcdcc {
+ regulator-always-on;
+ regulator-min-microvolt = <810000>;
+ regulator-max-microvolt = <1080000>;
+ regulator-name = "vdd-gpu-sys";
+ };
+
+ reg_dcdcd: dcdcd {
+ regulator-always-on;
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <1500000>;
+ regulator-name = "vdd-dram";
+ };
+
+ reg_dcdce: dcdce {
+ regulator-boot-on;
+ reg_dldo1: dldo1 {
+ regulator-name = "axp313a-dldo1";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-eth-mmc";
+ };
+
+ sw {
+ /* unused */
+ regulator-step-delay-us = <25>;
+ regulator-final-delay-us = <50>;
+ regulator-always-on;
+ };
+ };
+ };
@ -261,6 +213,7 @@ index 00000000..177bcc74
+ usb1_vbus-supply = <&reg_usb1_vbus>;
+ status = "okay";
+};
diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi
index dd4d2f31..84b80156 100644
--- a/arch/arm/dts/sun50i-h616.dtsi
@ -416,15 +369,15 @@ index c4f69966..38f9a6ba 100644
}
#endif
diff --git a/configs/mangopi_mcore_defconfig b/configs/mangopi_mcore_defconfig
diff --git a/configs/bananapi_m4b_defconfig b/configs/bananapi_m4b_defconfig
new file mode 100644
index 00000000..20cbdbb1
--- /dev/null
+++ b/configs/mangopi_mcore_defconfig
+++ b/configs/bananapi_m4b_defconfig
@@ -0,0 +1,16 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h616-mangopi-mcore"
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h618-bananapi-m4b"
+CONFIG_SPL=y
+CONFIG_DRAM_SUN50I_H616_WRITE_LEVELING=y
+CONFIG_DRAM_SUN50I_H616_READ_CALIBRATION=y

View File

@ -3,7 +3,7 @@ image bootfs.vfat {
files = {
"boot.scr",
"Image",
"sun50i-h616-mangopi-mcore.dtb"
"sun50i-h618-bananapi-m4b.dtb"
}
}
size = 32M