Skip to content

Commit

Permalink
WIP: add BPi-R4
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowrt authored and frank-w committed Sep 23, 2024
1 parent d1bc4e6 commit 1ea89fc
Show file tree
Hide file tree
Showing 6 changed files with 626 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/mediatek/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nor.dtb
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-wifi-mt7996a.dtbo
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-rfb.dtb
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-rfb-emmc.dtbo
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-rfb-eth1-aqr.dtbo
Expand Down
62 changes: 62 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
* Copyright (C) 2021 MediaTek Inc.
* Author: Frank Wunderlich <frank-w@public-files.de>
*/

/dts-v1/;
/plugin/;

/ {
compatible = "bananapi,bpi-r4", "mediatek,mt7988a";

fragment@0 {
target-path = "/soc/mmc@11230000";
__overlay__ {
pinctrl-names = "default", "state_uhs";
pinctrl-0 = <&mmc0_pins_emmc_51>;
pinctrl-1 = <&mmc0_pins_emmc_51>;
bus-width = <8>;
max-frequency = <200000000>;
cap-mmc-highspeed;
mmc-hs200-1_8v;
mmc-hs400-1_8v;
hs400-ds-delay = <0x12814>;
vqmmc-supply = <&reg_1p8v>;
vmmc-supply = <&reg_3p3v>;
non-removable;
no-sd;
no-sdio;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

card@0 {
compatible = "mmc-card";
reg = <0>;

block {
compatible = "block-device";
partitions {
block-partition-env {
partname = "ubootenv";
nvmem-layout {
compatible = "u-boot,env-layout";
};
};
emmc_rootfs: block-partition-production {
partname = "production";
};
};
};
};
};
};

fragment@2 {
target-path = "/chosen";
__overlay__ {
rootdisk-emmc = <&emmc_rootfs>;
};
};
};
19 changes: 19 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-rtc.dtso
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
* Copyright (C) 2023
* Author: Daniel Golle <daniel@makrotopia.org>
*/

/dts-v1/;
/plugin/;

/ {
compatible = "bananapi,bpi-r4", "mediatek,mt7988a";

fragment@0 {
target = <&pcf8563>;
__overlay__ {
status = "okay";
};
};
};
60 changes: 60 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
* Copyright (C) 2023 MediaTek Inc.
* Author: Frank Wunderlich <frank-w@public-files.de>
*/

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

/ {
compatible = "bananapi,bpi-r4", "mediatek,mt7988a";

fragment@1 {
target-path = "/soc/mmc@11230000";
__overlay__ {
pinctrl-names = "default", "state_uhs";
pinctrl-0 = <&mmc0_pins_sdcard>;
pinctrl-1 = <&mmc0_pins_sdcard>;
cd-gpios = <&pio 12 GPIO_ACTIVE_LOW>;
bus-width = <4>;
max-frequency = <52000000>;
cap-sd-highspeed;
vmmc-supply = <&reg_3p3v>;
vqmmc-supply = <&reg_3p3v>;
no-mmc;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

card@0 {
compatible = "mmc-card";
reg = <0>;

block {
compatible = "block-device";
partitions {
block-partition-env {
partname = "ubootenv";
nvmem-layout {
compatible = "u-boot,env-layout";
};
};
sd_rootfs: block-partition-production {
partname = "production";
};
};
};
};
};
};

fragment@2 {
target-path = "/chosen";
__overlay__ {
rootdisk-sd = <&sd_rootfs>;
};
};
};
101 changes: 101 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-wifi-mt7996a.dtso
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

/ {
compatible = "bananapi,bpi-r4", "mediatek,mt7988a";

fragment@0 {
target-path = "/";
__overlay__ {
wifi_12v: regulator-wifi-12v {
compatible = "regulator-fixed";
regulator-name = "wifi";
regulator-min-microvolt = <12000000>;
regulator-max-microvolt = <12000000>;
gpio = <&pio 4 GPIO_ACTIVE_HIGH>;
enable-active-high;
regulator-always-on;
};
};
};

fragment@1 {
target = <&i2c_wifi>;
__overlay__ {
status = "okay";

// 5G WIFI MAC Address EEPROM
wifi_eeprom@51 {
compatible = "atmel,24c02";
reg = <0x51>;
address-bits = <8>;
page-size = <8>;
size = <256>;

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

macaddr_5g: macaddr@0 {
reg = <0x0 0x6>;
};
};
};

// 6G WIFI MAC Address EEPROM
wifi_eeprom@52 {
compatible = "atmel,24c02";
reg = <0x52>;
address-bits = <8>;
page-size = <8>;
size = <256>;

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

macaddr_6g: macaddr@0 {
reg = <0x0 0x6>;
};
};
};
};
};

fragment@2 {
target = <&pcie0>;
__overlay__ {
pcie@0,0 {
reg = <0x0000 0 0 0 0>;

wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_5g>;
};
};
};
};

fragment@3 {
target = <&pcie1>;
__overlay__ {
pcie@0,0 {
reg = <0x0000 0 0 0 0>;

wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_6g>;
};
};
};
};
};
Loading

0 comments on commit 1ea89fc

Please sign in to comment.