Skip to content

Commit

Permalink
arm64: dts: update bpi-r4.dtsi to actual state
Browse files Browse the repository at this point in the history
squashed:
arm64: dts: mt7988: add pinctrl dropped from dtsi to r4 board dts
amr64: dts: mt7988: bpi-r4: move some nodes to be ordered alphanumerical
WIP: dts: r4: fix some compile errors
arm64: dts: mt7988: move sfp related nodes to bpi-r4.dts
arm64: dts: mt7988-bpi-r4: enable cci
arm64: dts: mt7988-bpi-r4: enable switch nodes
  • Loading branch information
frank-w committed Feb 2, 2025
1 parent ea060f1 commit 6ac17b4
Show file tree
Hide file tree
Showing 2 changed files with 230 additions and 1 deletion.
42 changes: 42 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,45 @@
/dts-v1/;

#include "mt7988a-bananapi-bpi-r4.dtsi"

/ {
/* SFP1 cage (WAN) */
sfp1: sfp1 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp1>;
los-gpios = <&pio 54 GPIO_ACTIVE_HIGH>;
mod-def0-gpios = <&pio 82 GPIO_ACTIVE_LOW>;
tx-disable-gpios = <&pio 70 GPIO_ACTIVE_HIGH>;
tx-fault-gpios = <&pio 69 GPIO_ACTIVE_HIGH>;
rate-select0-gpios = <&pio 21 GPIO_ACTIVE_LOW>;
maximum-power-milliwatt = <3000>;
};

/* SFP2 cage (LAN) */
sfp2: sfp2 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp2>;
los-gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
mod-def0-gpios = <&pio 83 GPIO_ACTIVE_LOW>;
tx-disable-gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
tx-fault-gpios = <&pio 1 GPIO_ACTIVE_HIGH>;
rate-select0-gpios = <&pio 3 GPIO_ACTIVE_LOW>;
maximum-power-milliwatt = <3000>;
};
};

&gmac1 {
sfp = <&sfp2>;
managed = "in-band-status";
phy-mode = "usxgmii";
status = "okay";
};

&gmac2 {
sfp = <&sfp1>;
managed = "in-band-status";
phy-mode = "usxgmii";
status = "okay";
};


189 changes: 188 additions & 1 deletion arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>

#include "mt7988a.dtsi"
Expand All @@ -12,8 +14,24 @@
model = "Banana Pi BPI-R4";
chassis-type = "embedded";

aliases {
ethernet0 = &gmac0;
ethernet1 = &gmac1;
ethernet2 = &gmac2;
led-boot = &led_green;
led-failsafe = &led_green;
led-running = &led_green;
led-upgrade = &led_green;
};

chosen {
stdout-path = "serial0:115200n8";
bootargs = "loglevel=8 pci=pcie_bus_perf ubi.block=0,fit root=/dev/fit0";
rootdisk-spim-nand = <&ubi_rootfs>;
};

memory {
reg = <0x00 0x40000000 0x00 0x10000000>;
};

reg_1p8v: regulator-1p8v {
Expand All @@ -33,6 +51,38 @@
regulator-boot-on;
regulator-always-on;
};

gpio-keys {
compatible = "gpio-keys";

wps {
label = "WPS";
linux,code = <KEY_RESTART>;
gpios = <&pio 14 GPIO_ACTIVE_LOW>;
};
};

gpio-leds {
compatible = "gpio-leds";

led_green: led-green {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_GREEN>;
gpios = <&pio 79 GPIO_ACTIVE_HIGH>;
default-state = "on";
};

led_blue: led-blue {
function = LED_FUNCTION_WPS;
color = <LED_COLOR_ID_BLUE>;
gpios = <&pio 63 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
};
};

&cci {
proc-supply = <&rt5190_buck3>;
};

&cpu0 {
Expand Down Expand Up @@ -79,6 +129,62 @@
};
};

&eth {
status = "okay";
};

&gmac0 {
status = "okay";
};

&switch {
status = "okay";
};

&gsw_phy0 {
pinctrl-names = "gbe-led";
pinctrl-0 = <&gbe0_led0_pins>;
};

&gsw_port0 {
label = "wan";
};

&gsw_phy0_led0 {
status = "okay";
color = <LED_COLOR_ID_GREEN>;
};

&gsw_phy1 {
pinctrl-names = "gbe-led";
pinctrl-0 = <&gbe1_led0_pins>;
};

&gsw_phy1_led0 {
status = "okay";
color = <LED_COLOR_ID_GREEN>;
};

&gsw_phy2 {
pinctrl-names = "gbe-led";
pinctrl-0 = <&gbe2_led0_pins>;
};

&gsw_phy2_led0 {
status = "okay";
color = <LED_COLOR_ID_GREEN>;
};

&gsw_phy3 {
pinctrl-names = "gbe-led";
pinctrl-0 = <&gbe3_led0_pins>;
};

&gsw_phy3_led0 {
status = "okay";
color = <LED_COLOR_ID_GREEN>;
};

&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
Expand Down Expand Up @@ -146,20 +252,24 @@
#address-cells = <1>;
#size-cells = <0>;

i2c@0 {
i2c@0 { //eeprom,rtc,ngff
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;

pcf8563: rtc@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
//interrupts = <&pio 6 IRQ_TYPE_LEVEL_LOW>;
#clock-cells = <0>;
//status = "disabled";
};

eeprom@57 {
compatible = "atmel,24c02";
reg = <0x57>;
address-bits = <8>;
page-size = <8>;
size = <256>;
};

Expand All @@ -176,6 +286,14 @@
#size-cells = <0>;
reg = <2>;
};

i2c_wifi: i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <3>;

status = "disabled";
};
};
};

Expand Down Expand Up @@ -392,10 +510,75 @@
status = "okay";
};

/*&fan {
pwms = <&pwm 0 50000>;
status = "okay";
};*/

&serial0 {
status = "okay";
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_flash_pins>;
status = "okay";

spi_nand: spi_nand@0 {
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <52000000>;
spi-tx-buswidth = <4>;
spi-rx-buswidth = <4>;
};
};

&spi1 {
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins>;
status = "okay";
};

&spi_nand {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "bl2";
reg = <0x0 0x200000>;
read-only;
};

partition@200000 {
label = "ubi";
reg = <0x200000 0x7e00000>;
compatible = "linux,ubi";

volumes {
ubi-volume-ubootenv {
volname = "ubootenv";
nvmem-layout {
compatible = "u-boot,env-redundant-bool-layout";
};
};

ubi-volume-ubootenv2 {
volname = "ubootenv2";
nvmem-layout {
compatible = "u-boot,env-redundant-bool-layout";
};
};

ubi_rootfs: ubi-volume-fit {
volname = "fit";
};
};
};
};
};

&ssusb1 {
status = "okay";
};
Expand All @@ -407,3 +590,7 @@
&watchdog {
status = "okay";
};

/*&xphy {
status = "okay";
};*/

0 comments on commit 6ac17b4

Please sign in to comment.