Skip to content

Commit

Permalink
arm64: dts: mt7986: add Bananapi R3
Browse files Browse the repository at this point in the history
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

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Link: https://lore.kernel.org/r/20230106152845.88717-6-linux@fw-web.de
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
  • Loading branch information
Frank Wunderlich authored and Matthias Brugger committed Jan 13, 2023
1 parent 918aed7 commit 8e01fb1
Show file tree
Hide file tree
Showing 6 changed files with 630 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/arm64/boot/dts/mediatek/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dtso
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
* Copyright (C) 2021 MediaTek Inc.
* Author: Sam.Shih <sam.shih@mediatek.com>
*/

/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";
};
};
};

55 changes: 55 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nand.dtso
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
/*
* Authors: Daniel Golle <daniel@makrotopia.org>
* Frank Wunderlich <frank-w@public-files.de>
*/

/dts-v1/;
/plugin/;

/ {
compatible = "bananapi,bpi-r3", "mediatek,mt7986a";

fragment@0 {
target-path = "/soc/spi@1100a000";
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
spi_nand: spi_nand@0 {
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <10000000>;
spi-tx-buswidth = <4>;
spi-rx-buswidth = <4>;

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

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

partition@80000 {
label = "reserved";
reg = <0x80000 0x300000>;
};

partition@380000 {
label = "fip";
reg = <0x380000 0x200000>;
read-only;
};

partition@580000 {
label = "ubi";
reg = <0x580000 0x7a80000>;
};
};
};
};
};
};
68 changes: 68 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nor.dtso
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
/*
* Authors: Daniel Golle <daniel@makrotopia.org>
* Frank Wunderlich <frank-w@public-files.de>
*/

/dts-v1/;
/plugin/;

/ {
compatible = "bananapi,bpi-r3", "mediatek,mt7986a";

fragment@0 {
target-path = "/soc/spi@1100a000";
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;

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

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

partition@20000 {
label = "reserved";
reg = <0x20000 0x20000>;
};

partition@40000 {
label = "u-boot-env";
reg = <0x40000 0x40000>;
};

partition@80000 {
label = "reserved2";
reg = <0x80000 0x80000>;
};

partition@100000 {
label = "fip";
reg = <0x100000 0x80000>;
read-only;
};

partition@180000 {
label = "recovery";
reg = <0x180000 0xa80000>;
};

partition@c00000 {
label = "fit";
reg = <0xc00000 0x1400000>;
};
};
};
};
};
};
23 changes: 23 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtso
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
* Copyright (C) 2021 MediaTek Inc.
* Author: Sam.Shih <sam.shih@mediatek.com>
*/

/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";
};
};
};

Loading

0 comments on commit 8e01fb1

Please sign in to comment.