Add BananaPi R3
v9 cover Add BananaPi R3
From: Frank Wunderlich <[email protected]>
This Series adds some Nodes to mt7986 devicetree and the BananaPi R3
This version is rebased on linux 6.2-rc1 and i dropped already applied Patches from v7.
i had run full dtbs-check but i end up with some strange warnings in ethernet-node that should not come up as phy-handle and sfp/managed properties are already defined. These errors also came up for mt7986a-rfb.
phy-handle made optional
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/mediatek,net.yaml#n265
property sfp/managed (which is included for mac subnode in yaml above):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ethernet-controller.yaml#n137
changes:
v9:
- drop model string override in sd-dtso
v8:
- drop model string override in emmc-dtso
- drop cs-gpios from spi-nodes
- add interrupt-settings for mt7531 switch
v7:
- rebase on next so dropped already applied patches
- squashed overlay-patch into the bpi-r3 base support
- moved regulators from mmc-dts to common dtsi
- changed dtsi to dts (as board base dtb) and mmc-dts to overlays
- renamed overlays to dtso
- removed angelos RB because of changes in bpi-r3 patch
v6:
- dropped regulators from usb-patch as suggested by chunfeng yun
- moved 3v3 regulator to mmc-patch as it is needed for emmc to work rfbs were tested by sam shih, r3 by me
- dropped RB from AngeloGioacchino from mmc-patch due to this change
- fixed links in coverletter which were broken in v5
- i hope this series is sent without errors now (my mailprovider limited mails last 2 times while sending part 10)
v5:
- changed usb ranges/reg/unit-adress
- added reviewd-by's except usb-part due to changes
v4:
- dropped RFC prefix
- rebase on matthias' mtk dts-next (for 6.2) branch
- added author information to overlays
- fixed sfp binding error
- added fix for moving wed_pcie node
- readded missing compatible patches
v3:
- changed mmc pull-ups
- added patch for board binding (sent separately before)
- added pcie node in mt7986 (not yet again in r3)
- added dt overlays
Frank Wunderlich (2):
dt-bindings: phy: mediatek,tphy: add support for mt7986
arm64: dts: mt7986: add Bananapi R3
Sam Shih (3):
arm64: dts: mt7986: add usb related device nodes
arm64: dts: mt7986: add mmc related device nodes
arm64: dts: mt7986: add pcie related device nodes
.../bindings/phy/mediatek,tphy.yaml | 1 + arch/arm64/boot/dts/mediatek/Makefile | 5 + .../mt7986a-bananapi-bpi-r3-emmc.dtso | 29 ++ .../mt7986a-bananapi-bpi-r3-nand.dtso | 55 +++ .../mediatek/mt7986a-bananapi-bpi-r3-nor.dtso | 68 +++ .../mediatek/mt7986a-bananapi-bpi-r3-sd.dtso | 23 + .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 450 ++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 120 +++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 122 +++++ arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 8 + 10 files changed, 881 insertions(+) create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nand.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nor.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
Signature · 1 line
2.34.1
PATCH v9 1/5 dt-bindings: phy: mediatek,tphy: add support for mt7986
From: Frank Wunderlich <[email protected]>
Add compatible string for mt7986.
--- Documentation/devicetree/bindings/phy/mediatek,tphy.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/phy/mediatek,tphy.yaml +1 -0
@@ -79,6 +79,7 @@ properties: - enum: - mediatek,mt2712-tphy - mediatek,mt7629-tphy + - mediatek,mt7986-tphy - mediatek,mt8183-tphy - mediatek,mt8186-tphy - mediatek,mt8192-tphy
Signature · 1 line
2.34.1
Re: [PATCH v9 1/5] dt-bindings: phy: mediatek,tphy: add support for mt7986
Quoted 3 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add compatible string for mt7986.
Applied, thanks
Signature · 6 lines
~Vinod -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH v9 2/5 arm64: dts: mt7986: add usb related device nodes
In reply to Frank WunderlichFrom: Sam Shih <[email protected]>
This patch adds USB support for MT7986.
---
changes compared to sams original version:
- reorder xhci-clocks based on yaml binding
v5:
- update ranges/reg of usb-phy
- not added RB from AngeloGioacchino for v4 because of these changes
v6:
- remove unused usb regulators
- remove 3v3 regulator (will be added with emmc-patch)
--- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 8 +++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 55 ++++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 8 +++ 3 files changed, 71 insertions(+)
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +8 -0
@@ -140,6 +140,10 @@ &spi1 { status = "okay"; }; +&ssusb { + status = "okay"; +}; + &switch { ports { #address-cells = <1>;
@@ -201,6 +205,10 @@ &uart2 { status = "okay"; }; +&usb_phy { + status = "okay"; +}; + &wifi { status = "okay"; pinctrl-names = "default", "dbdc";
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +55 -0
61 lines not on this page · raw message
arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +8 -0
@@ -167,10 +167,18 @@ &spi1 { status = "okay"; }; +&ssusb { + status = "okay"; +}; + &uart0 { status = "okay"; }; +&usb_phy { + status = "okay"; +}; + &wifi { status = "okay"; pinctrl-names = "default", "dbdc";
Signature · 1 line
2.34.1
PATCH v9 3/5 arm64: dts: mt7986: add mmc related device nodes
In reply to Frank WunderlichFrom: Sam Shih <[email protected]>
This patch adds mmc support for MT7986.
---
v2:
- update mmc-node because clocks changed
v3:
- fix pullups/pulldowns for mt7986a-rfb to have generic bias-pull-*
v6:
- add 3v3 regulator in mt7986a-rfb (was in usb patch before)
- dropped AngeloGioacchino RB because of this change
--- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 96 ++++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 15 +++ 2 files changed, 111 insertions(+)
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +96 -0
@@ -5,6 +5,8 @@ */ /dts-v1/; +#include <dt-bindings/pinctrl/mt65xx.h> + #include "mt7986a.dtsi" / {
@@ -23,6 +25,24 @@ memory@40000000 { device_type = "memory"; reg = <0 0x40000000 0 0x40000000>; }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "fixed-1.8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; }; &crypto {
@@ -58,7 +78,83 @@ switch: switch@0 { }; }; +&mmc0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + bus-width = <8>; + max-frequency = <200000000>; + cap-mmc-highspeed; + mmc-hs200-1_8v; + mmc-hs400-1_8v; + hs400-ds-delay = <0x14014>; + vmmc-supply = <®_3p3v>; + vqmmc-supply = <®_1p8v>; + non-removable; + no-sd; + no-sdio; + status = "okay"; +}; + &pio { + mmc0_pins_default: mmc0-pins { + mux { + function = "emmc"; + groups = "emmc_51"; + }; + conf-cmd-dat { + pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength = <4>; + bias-pull-up = <MTK_PUPD_SET_R1R0_01>; /* pull-up 10K */ + }; + conf-clk { + pins = "EMMC_CK"; + drive-strength = <6>; + bias-pull-down = <MTK_PUPD_SET_R1R0_10>; /* pull-down 50K */ + }; + conf-ds { + pins = "EMMC_DSL"; + bias-pull-down = <MTK_PUPD_SET_R1R0_10>; /* pull-down 50K */ + }; + conf-rst { + pins = "EMMC_RSTB"; + drive-strength = <4>; + bias-pull-up = <MTK_PUPD_SET_R1R0_01>; /* pull-up 10K */ + }; + }; + + mmc0_pins_uhs: mmc0-uhs-pins { + mux { + function = "emmc"; + groups = "emmc_51"; + }; + conf-cmd-dat { + pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength = <4>; + bias-pull-up = <MTK_PUPD_SET_R1R0_01>; /* pull-up 10K */ + }; + conf-clk { + pins = "EMMC_CK"; + drive-strength = <6>; + bias-pull-down = <MTK_PUPD_SET_R1R0_10>; /* pull-down 50K */ + }; + conf-ds { + pins = "EMMC_DSL"; + bias-pull-down = <MTK_PUPD_SET_R1R0_10>; /* pull-down 50K */ + }; + conf-rst { + pins = "EMMC_RSTB"; + drive-strength = <4>; + bias-pull-up = <MTK_PUPD_SET_R1R0_01>; /* pull-up 10K */ + }; + }; + spi_flash_pins: spi-flash-pins { mux { function = "spi";
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +15 -0
@@ -346,6 +346,21 @@ ssusb: usb@11200000 { status = "disabled"; }; + mmc0: mmc@11230000 { + compatible = "mediatek,mt7986-mmc"; + reg = <0 0x11230000 0 0x1000>, + <0 0x11c20000 0 0x1000>; + interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&topckgen CLK_TOP_EMMC_416M_SEL>, + <&infracfg CLK_INFRA_MSDC_HCK_CK>, + <&infracfg CLK_INFRA_MSDC_CK>, + <&infracfg CLK_INFRA_MSDC_133M_CK>, + <&infracfg CLK_INFRA_MSDC_66M_CK>; + clock-names = "source", "hclk", "source_cg", "bus_clk", + "sys_cg"; + status = "disabled"; + }; + usb_phy: t-phy@11e10000 { compatible = "mediatek,mt7986-tphy", "mediatek,generic-tphy-v2";
Signature · 1 line
2.34.1
PATCH v9 4/5 arm64: dts: mt7986: add pcie related device nodes
In reply to Frank WunderlichFrom: Sam Shih <[email protected]>
This patch adds PCIe support for MT7986.
---
changes compared to sams original version:
- add clock-names to pcie node
- update clocks to new binding
---
bindings-patches:
https://patchwork.kernel.org/project/linux-mediatek/list/?series=690172
--- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 16 ++++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 52 ++++++++++++++++++++ 2 files changed, 68 insertions(+)
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +16 -0
@@ -93,6 +93,15 @@ &mmc0 { non-removable; no-sd; no-sdio; +}; + +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pins>; + status = "okay"; +}; + +&pcie_phy { status = "okay"; };
@@ -155,6 +164,13 @@ conf-rst { }; }; + pcie_pins: pcie-pins { + mux { + function = "pcie"; + groups = "pcie_clk", "pcie_wake", "pcie_pereset"; + }; + }; + spi_flash_pins: spi-flash-pins { mux { function = "spi";
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +52 -0
64 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v9 5/5 arm64: dts: mt7986: add Bananapi R3
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Add support for Bananapi R3 SBC.
- SD/eMMC support (switching first 4 bits of data-bus with sw6/D)
- SPI-NAND/NOR support (switched CS by sw5/C)
- all rj45 ports and both SFP working (eth1/lan4)
- all USB-Ports + SIM-Slot tested
- i2c and all uarts tested
- wifi tested (with eeprom calibration data)
The device can boot from all 4 storage options. Both, SPI and MMC, can be switched using hardware switches on the board, see
https://wiki.banana-pi.org/Banana_Pi_BPI-R3#Jumper_setting
---
changes:
v9:
- drop model string override in sd-dtso
v8:
- drop model string override in emmc-dtso
- drop cs-gpios from spi-nodes
- add interrupt-settings for mt7531 switch
v7:
- squashed overlay-patch and converted sd/emmc dts to overlay too
- moved mmc-regulators to base dts
- changed common dtsi to (base dts) and overlay extension to dtso
v6:
- drop usb 5v regulator from bpi-r3
based on chunfengs response it is only needed if regulator is switched (like for otg), usb works without it.
v4:
- add PCIe nodes
- fix sfp-properties of sfp-1 (need to be plural)
thx to Denis Odintsov for this
v3:
- rename factory-key to reset-key
- add dcin regulator and add it as input for 3v3 (with renaming)
- remove memory-node
- dropped wifi eeprom (calibration) data
- move mmc0 pinctrl to common dtsi and drop sdcard comment
- change mmc pull-up/down to have generic bias-pull*
v2:
- remove pcie to be added later (discussion about clocks)
- some fixes based on suggestions on ML
- add key suffix like it's done in mt7622-bpi-r64 devicetree
- add dash in sfp node names
- use reg as unit for switch-node
- drop "-3-4" suffix from i2c-pins node name
- fix order in Makefile
--- arch/arm64/boot/dts/mediatek/Makefile | 5 + .../mt7986a-bananapi-bpi-r3-emmc.dtso | 29 ++ .../mt7986a-bananapi-bpi-r3-nand.dtso | 55 +++ .../mediatek/mt7986a-bananapi-bpi-r3-nor.dtso | 68 +++ .../mediatek/mt7986a-bananapi-bpi-r3-sd.dtso | 23 + .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 450 ++++++++++++++++++ 6 files changed, 630 insertions(+) create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nand.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nor.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
arch/arm64/boot/dts/mediatek/Makefile +5 -0
@@ -8,6 +8,11 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-evb.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-bananapi-bpi-r64.dtb +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3.dtb +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtbo +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dtso new file +29 -0
@@ -0,0 +1,29 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2021 MediaTek Inc. + * Author: Sam.Shih <[email protected]> + */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "bananapi,bpi-r3", "mediatek,mt7986a"; + + fragment@0 { + target-path = "/soc/mmc@11230000"; + __overlay__ { + bus-width = <8>; + max-frequency = <200000000>; + cap-mmc-highspeed; + mmc-hs200-1_8v; + mmc-hs400-1_8v; + hs400-ds-delay = <0x14014>; + non-removable; + no-sd; + no-sdio; + status = "okay"; + }; + }; +}; +
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nand.dtso new file +55 -0
55 lines not on this page · raw message
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nor.dtso new file +68 -0
68 lines not on this page · raw message
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtso new file +23 -0
@@ -0,0 +1,23 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2021 MediaTek Inc. + * Author: Sam.Shih <[email protected]> + */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "bananapi,bpi-r3", "mediatek,mt7986a"; + + fragment@0 { + target-path = "/soc/mmc@11230000"; + __overlay__ { + bus-width = <4>; + max-frequency = <52000000>; + cap-sd-highspeed; + status = "okay"; + }; + }; +}; +
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts new file +450 -0
450 lines not on this page · raw message
Signature · 1 line
2.34.1
Matthias Brugger
maintainerPatches 2-5 applied!
Thanks!
Quoted 87 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
This Series adds some Nodes to mt7986 devicetree and the BananaPi R3
This version is rebased on linux 6.2-rc1 and i dropped already applied Patches from v7.
i had run full dtbs-check but i end up with some strange warnings in ethernet-node that should not come up as phy-handle and sfp/managed properties are already defined. These errors also came up for mt7986a-rfb.
phy-handle made optional
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/mediatek,net.yaml#n265property sfp/managed (which is included for mac subnode in yaml above):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ethernet-controller.yaml#n137changes:
v9:
- drop model string override in sd-dtsov8:
- drop model string override in emmc-dtso
- drop cs-gpios from spi-nodes
- add interrupt-settings for mt7531 switchv7:
- rebase on next so dropped already applied patches
- squashed overlay-patch into the bpi-r3 base support
- moved regulators from mmc-dts to common dtsi
- changed dtsi to dts (as board base dtb) and mmc-dts to overlays
- renamed overlays to dtso
- removed angelos RB because of changes in bpi-r3 patchv6:
- dropped regulators from usb-patch as suggested by chunfeng yun
- moved 3v3 regulator to mmc-patch as it is needed for emmc to work rfbs were tested by sam shih, r3 by me
- dropped RB from AngeloGioacchino from mmc-patch due to this change
- fixed links in coverletter which were broken in v5
- i hope this series is sent without errors now (my mailprovider limited mails last 2 times while sending part 10)v5:
- changed usb ranges/reg/unit-adress
- added reviewd-by's except usb-part due to changesv4:
- dropped RFC prefix
- rebase on matthias' mtk dts-next (for 6.2) branch
- added author information to overlays
- fixed sfp binding error
- added fix for movingwed_pcienode
- readded missing compatible patchesv3:
- changed mmc pull-ups
- added patch for board binding (sent separately before)
- added pcie node in mt7986 (not yet again in r3)
- added dt overlaysFrank Wunderlich (2):
dt-bindings: phy: mediatek,tphy: add support for mt7986
arm64: dts: mt7986: add Bananapi R3Sam Shih (3):
arm64: dts: mt7986: add usb related device nodes
arm64: dts: mt7986: add mmc related device nodes
arm64: dts: mt7986: add pcie related device nodes.../bindings/phy/mediatek,tphy.yaml | 1 + arch/arm64/boot/dts/mediatek/Makefile | 5 + .../mt7986a-bananapi-bpi-r3-emmc.dtso | 29 ++ .../mt7986a-bananapi-bpi-r3-nand.dtso | 55 +++ .../mediatek/mt7986a-bananapi-bpi-r3-nor.dtso | 68 +++ .../mediatek/mt7986a-bananapi-bpi-r3-sd.dtso | 23 + .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 450 ++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 120 +++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 122 +++++ arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 8 + 10 files changed, 881 insertions(+)create mode 100644
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dtsocreate mode 100644arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nand.dtsocreate mode 100644arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nor.dtsocreate mode 100644arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtsocreate mode 100644arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts