Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for BananaPi BPi-R2 #1135

Closed
wants to merge 11 commits into from
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Index: linux-4.14.51/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
===================================================================
--- linux-4.14.51.orig/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
+++ linux-4.14.51/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
@@ -19,6 +19,7 @@

chosen {
stdout-path = "serial2:115200n8";
+ bootargs = "earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 block2mtd.block2mtd=/dev/mmcblk1,65536,RootFs,5 mtdparts=RootFs:512k(mbr)ro,512k(uboot)ro,512k(config)ro,512k(factory)ro,32M(kernel),32M(recovery),1024M(rootfs),2048M(usrdata),-(bmtpool) rootfstype=squashfs,jffs2";
abbradar marked this conversation as resolved.
Show resolved Hide resolved
};

memory {
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Index: linux-4.9.44/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
===================================================================
--- linux-4.9.44.orig/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts 2017-09-02 08:21:11.998199513 +0800
+++ linux-4.9.44/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts 2017-09-02 08:33:09.452252584 +0800
@@ -18,7 +18,7 @@
};
*/
memory {
- reg = <0 0x80000000 0 0x20000000>;
+ reg = <0 0x80000000 0 0x80000000>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch the dts file directly

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blogic Ping?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abbradar: mt7623n-bananapi-bpi-r2.dts is upstream DTS file, if there is something wrong in it, please send upstream patch for that

Copy link

@frank-w frank-w Nov 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

};

aliases {
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Index: linux-4.14.51/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
===================================================================
--- linux-4.14.51.orig/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
+++ linux-4.14.51/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
@@ -87,19 +87,19 @@

blue {
label = "bpi-r2:pio:blue";
- gpios = <&pio 241 GPIO_ACTIVE_HIGH>;
+ gpios = <&pio 240 GPIO_ACTIVE_LOW>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch the dts file directly

default-state = "off";
};

green {
label = "bpi-r2:pio:green";
- gpios = <&pio 240 GPIO_ACTIVE_HIGH>;
+ gpios = <&pio 241 GPIO_ACTIVE_LOW>;
default-state = "off";
};

red {
label = "bpi-r2:pio:red";
- gpios = <&pio 239 GPIO_ACTIVE_HIGH>;
+ gpios = <&pio 239 GPIO_ACTIVE_LOW>;
default-state = "off";
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Index: linux-4.14.51/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
===================================================================
--- linux-4.14.51.orig/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
+++ linux-4.14.51/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
@@ -266,6 +266,28 @@
vqmmc-supply = <&mt6323_vio18_reg>;
};

+&pcie {
+ pinctrl-names = "default";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch the dts file directly

+ pinctrl-0 = <&pcie_default>;
+ status = "okay";
+
+ pcie@0,0 {
+ status = "okay";
+ };
+
+ pcie@1,0 {
+ status = "okay";
+ };
+};
+
+&pcie0_phy {
+ status = "okay";
+};
+
+&pcie1_phy {
+ status = "okay";
+};
+
&pio {
cir_pins_a:cir@0 {
pins_cir {
@@ -433,6 +455,14 @@
};
};

+ pcie_default: pcie_pin_default {
+ pins_cmd_dat {
+ pinmux = <MT7623_PIN_208_AUD_EXT_CK1_FUNC_PCIE0_PERST_N>,
+ <MT7623_PIN_209_AUD_EXT_CK2_FUNC_PCIE1_PERST_N>;
+ bias-disable;
+ };
+ };
+
pwm_pins_a: pwm@0 {
pins_pwm {
pinmux = <MT7623_PIN_203_PWM0_FUNC_PWM0>,
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Index: linux-4.14.51/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
===================================================================
--- linux-4.14.51.orig/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
+++ linux-4.14.51/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
@@ -141,7 +141,7 @@
gmac1: mac@1 {
compatible = "mediatek,eth-mac";
reg = <1>;
- phy-mode = "rgmii";
+ phy-mode = "trgmii";

fixed-link {
speed = <1000>;
@@ -206,7 +206,7 @@
reg = <5>;
label = "cpu";
ethernet = <&gmac1>;
- phy-mode = "rgmii";
+ phy-mode = "trgmii";

fixed-link {
speed = <1000>;