Skip to content

Commit

Permalink
add r3mini as new board
Browse files Browse the repository at this point in the history
use dts from immortalwrt

immortalwrt/immortalwrt@14e2410

squashed:
defconfig: r3mini: add options for pcie, nvme and cache
dts: r3mini: prepare second phy
dts: r3mini: define enable-gpio as regulator
defconfig: r3mini: add pstore
defconfig: r3mini: add ext4 support
  • Loading branch information
frank-w committed Jul 23, 2024
1 parent 76b4745 commit 269d3ee
Show file tree
Hide file tree
Showing 5 changed files with 425 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/arm/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7981-sd-rfb.dtb \
mt7986a-bpi-r3-sd.dtb \
mt7986a-bpi-r3-emmc.dtb \
mt7986a-bpi-r3-mini.dtb \
mt7986a-rfb.dtb \
mt7986b-rfb.dtb \
mt7986a-sd-rfb.dtb \
Expand Down
286 changes: 286 additions & 0 deletions arch/arm/dts/mt7986a-bpi-r3-mini.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
// SPDX-License-Identifier: GPL-2.0-or-later

/dts-v1/;
#include "mt7986.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/linux-event-codes.h>

/ {
#address-cells = <1>;
#size-cells = <1>;
model = "Bananapi BPi-R3 Mini";
compatible = "mediatek,mt7986", "mediatek,mt7986-rfb";

chosen {
stdout-path = &uart0;
tick-timer = &timer0;
};

memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x80000000>;
};

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

button-reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
};
};

leds {
compatible = "gpio-leds";

status_led: led-0 {
label = "green:status";
gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
};

led-1 {
label = "blue:wlan2g";
gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
};

led-2 {
label = "blue:wlan5g";
gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
};
};

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

en8811_a: regulator-phy1 {
compatible = "regulator-fixed";
regulator-name = "phy1";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = <&gpio 16 GPIO_ACTIVE_LOW>;
enable-active-low;
regulator-boot-on;
regulator-always-on;
};

/*en8811_b: regulator-phy2 {
compatible = "regulator-fixed";
regulator-name = "phy2";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = <&gpio 17 GPIO_ACTIVE_LOW>;
enable-active-low;
regulator-boot-on;
regulator-always-on;
};*/
};

&eth {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&mdio_pins>;//, <&en8811_pwr_a>;

mediatek,gmac-id = <0>;
phy-mode = "2500base-x";
phy-handle = <&phy14>;

phy14: eth-phy@14 {
compatible = "ethernet-phy-id03a2.a411";
reg = <14>;

airoha,rx-pol-reverse;

reset-gpios = <&gpio 49 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <20000>;
};

/*phy15: eth-phy@15 {
compatible = "ethernet-phy-id03a2.a411";
reg = <15>;

airoha,rx-pol-reverse;

reset-gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <20000>;
};*/
};

&mmc0 {
pinctrl-names = "default";
pinctrl-0 = <&mmc0_pins_default>;
bus-width = <8>;
max-frequency = <200000000>;
cap-mmc-highspeed;
cap-mmc-hw-reset;
vmmc-supply = <&reg_3p3v>;
vqmmc-supply = <&reg_1p8v>;
non-removable;
status = "okay";
};

&pinctrl {
/*en8811_pwr_a: en8811-pwr-a {
pins = "GPIO_11";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
output-low;
};

en8811_pwr_b: en8811-pwr-b {
pins = "GPIO_12";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
output-low;
};*/

mdio_pins: mdio-pins {
mux {
function = "eth";
groups = "mdc_mdio";
};
};

mmc0_pins_default: mmc0default {
mux {
function = "flash";
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 = <MTK_DRIVE_4mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
};

conf-clk {
pins = "EMMC_CK";
drive-strength = <MTK_DRIVE_6mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
};

conf-dsl {
pins = "EMMC_DSL";
bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
};

conf-rst {
pins = "EMMC_RSTB";
drive-strength = <MTK_DRIVE_4mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
};
};

spi_flash_pins: spi0-pins-func-1 {
mux {
function = "flash";
groups = "spi0", "spi0_wp_hold";
};

conf-pu {
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
};

conf-pd {
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
};
};

pwm_pins: pwm0-pins-func-1 {
mux {
function = "pwm";
groups = "pwm0";
};
};
};

&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm_pins>;
status = "okay";
};

&spi0 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&spi_flash_pins>;
status = "okay";
must_tx;
enhance_timing;
dma_ext;
ipm_design;
support_quad;
tick_dly = <1>;
sample_sel = <0>;

spi_nand@0 {
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <52000000>;

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

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

partition@100000 {
label = "orig-env";
reg = <0x100000 0x80000>;
};

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

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

partition@580000 {
label = "ubi";
reg = <0x580000 0x7a80000>;
};
};
};

};

&uart0 {
status = "okay";
};

&watchdog {
status = "disabled";
};
1 change: 1 addition & 0 deletions build.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ board=bpi-r2
#board=bpi-r64
#board=bpi-r2pro
#board=bpi-r3
#board=bpi-r3mini
#board=bpi-r4

#device=emmc
Expand Down
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ case $board in
export CROSS_COMPILE=aarch64-linux-gnu-
UBOOT_FILE=u-boot-rockchip.bin
;;
"bpi-r3")
"bpi-r3"|"bpi-r3mini")
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-

Expand All @@ -105,6 +105,11 @@ case $board in
FILE_DEFCFG=mt7986a_bpir3_${dev}_defconfig

DTS=mt7986a-bpi-r3-${dev}
if [[ "$board" == "bpi-r3mini" ]];
then
FILE_DEFCFG=mt7986a_bpir3mini_emmc_defconfig
DTS=mt7986a-bpi-r3-mini
fi
FILE_DTS=arch/arm/dts/${DTS}.dts
FILE_DTSI=arch/arm/dts/mt7986.dtsi

Expand Down
Loading

0 comments on commit 269d3ee

Please sign in to comment.