This commit is contained in:
Qubot 2023-11-29 20:25:44 +08:00
parent c96cc69851
commit 7ddf27bace
3 changed files with 250 additions and 17 deletions

View File

@ -359,11 +359,10 @@
drive-strength = <40>;
};
rmii_pins: rmii-pins {
pins = "PA0", "PA1", "PA2", "PA3", "PA4",
"PA5", "PA6", "PA7", "PA8", "PA9";
function = "emac1";
drive-strength = <40>;
/omit-if-no-ref/
i2c0_pi_pins: i2c0-pi-pins {
pins = "PI5", "PI6";
function = "i2c0";
};
/omit-if-no-ref/
@ -491,7 +490,7 @@
};
mmc2_pins: mmc2-pins {
pins = "PC1", "PC5", "PC6",
pins = "PC0", "PC1", "PC5", "PC6",
"PC8", "PC9", "PC10", "PC11",
"PC13", "PC14", "PC15", "PC16";
function = "mmc2";
@ -499,11 +498,23 @@
bias-pull-up;
};
mmc2_ds_pin: mmc2-ds-pin {
pins = "PC0";
function = "mmc2";
drive-strength = <30>;
bias-pull-up;
rmii_pins: rmii-pins {
pins = "PA0", "PA1", "PA2", "PA3", "PA4",
"PA5", "PA6", "PA7", "PA8", "PA9";
function = "emac1";
drive-strength = <40>;
};
/omit-if-no-ref/
spi0_pins: spi0-pins {
pins = "PC0", "PC2", "PC4";
function = "spi0";
};
/omit-if-no-ref/
spi0_cs0_pin: spi0-cs0-pin {
pins = "PC3";
function = "spi0";
};
/omit-if-no-ref/
@ -813,6 +824,21 @@
status = "disabled";
};
i2c0: i2c@5002000 {
compatible = "allwinner,sun50i-h616-i2c",
"allwinner,sun8i-v536-i2c",
"allwinner,sun6i-a31-i2c";
reg = <0x05002000 0x400>;
interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_I2C0>;
resets = <&ccu RST_BUS_I2C0>;
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pi_pins>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
i2c1: i2c@5002400 {
compatible = "allwinner,sun50i-h616-i2c",
"allwinner,sun8i-v536-i2c",
@ -873,6 +899,23 @@
#size-cells = <0>;
};
spi0: spi@5010000 {
compatible = "allwinner,sun50i-h616-spi",
"allwinner,sun8i-h3-spi";
reg = <0x05010000 0x1000>;
interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI0>;
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
dmas = <&dma 22>, <&dma 22>;
dma-names = "rx", "tx";
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
spi1: spi@5011000 {
compatible = "allwinner,sun50i-h616-spi",
"allwinner,sun8i-h3-spi";
@ -1496,4 +1539,4 @@
opp-microvolt = <1080000>;
};
};
};
};

View File

@ -14,7 +14,7 @@
/ {
model = "BananaPi M4 Berry";
compatible = "BiPai,bananapi-m4 berry", "allwinner,sun50i-h616";
compatible = "BiPai,bananapi-m4berry", "allwinner,sun50i-h616";
aliases {
ethernet0 = &emac0;
@ -40,10 +40,10 @@
leds: leds {
compatible = "gpio-leds";
led-red {
led-greed {
label = "red_led";
gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */
linux,default-trigger = "none";
linux,default-trigger = "heartbeat";
};
};
@ -110,7 +110,7 @@
&mmc2 {
pinctrl-names = "default";
pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
vmmc-supply = <&reg_dldo1>;
bus-width = <8>;
non-removable;
@ -309,4 +309,4 @@
&cpu0 {
cpu-supply = <&reg_dcdc2>;
status = "okay";
};
};

View File

@ -0,0 +1,190 @@
// SPDX-License-Identifier: (GPL-2.0+ or MIT)
/*
* Copyright (C) 2020 Arm Ltd.
*/
/dts-v1/;
#include "sun50i-h616.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/leds/common.h>
/ {
model = "Banana Pi M4 Zero";
compatible = "bananapi,bananapi-m4zero", "allwinner,sun50i-h618";
aliases {
ethernet0 = &emac0;
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:115200n8";
};
leds {
compatible = "gpio-leds";
led-0 {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_GREEN>;
gpios = <&pio 2 12 GPIO_ACTIVE_LOW>; /* PC12 */
default-state = "on";
};
};
reg_vcc5v: vcc5v {
/* board wide 5V supply directly from the USB-C socket */
compatible = "regulator-fixed";
regulator-name = "vcc-5v";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
};
reg_usb1_vbus: usb1-vbus {
compatible = "regulator-fixed";
regulator-name = "usb1-vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
vin-supply = <&reg_vcc5v>;
regulator-always-on;
status = "okay";
};
};
&ehci0 {
status = "okay";
};
&ehci1 {
status = "okay";
};
/* USB 2 & 3 are on headers only. */
&emac0 {
pinctrl-names = "default";
pinctrl-0 = <&ext_rgmii_pins>;
phy-mode = "rgmii";
phy-handle = <&ext_rgmii_phy>;
allwinner,rx-delay-ps = <3100>;
allwinner,tx-delay-ps = <700>;
status = "okay";
};
&mdio0 {
ext_rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
};
};
&mmc0 {
cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
bus-width = <4>;
non-removable;
status = "okay";
};
&mmc2 {
pinctrl-names = "default";
pinctrl-0 = <&mmc2_pins>;
bus-width = <8>;
non-removable;
status = "okay";
};
&ohci0 {
status = "okay";
};
&ohci1 {
status = "okay";
};
&r_i2c {
status = "okay";
axp313a: pmic@36 {
compatible = "x-powers,axp313a";
status = "okay";
reg = <0x36>;
wakeup-source;
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;
};
reg_aldo1: aldo1 {
regulator-name = "axp313a-aldo1";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-step-delay-us = <25>;
regulator-final-delay-us = <50>;
regulator-always-on;
};
reg_dldo1: dldo1 {
regulator-name = "axp313a-dldo1";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-step-delay-us = <25>;
regulator-final-delay-us = <50>;
regulator-always-on;
};
};
};
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_ph_pins>;
status = "okay";
};
&usbotg {
dr_mode = "peripheral";
status = "okay";
};
&usbphy {
usb1_vbus-supply = <&reg_usb1_vbus>;
status = "okay";
};