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

添加 RAX 3000M NAND 版本的 256M 硬改配置 #218

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/dts-v1/;
#include "mt7981-cmcc-rax3000m-256m.dtsi"

/ {
model = "CMCC RAX3000M";
compatible = "cmcc,rax3000m", "mediatek,mt7981";

chosen {
bootargs = "console=ttyS0,115200n1 loglevel=8 \
earlycon=uart8250,mmio32,0x11002000";
};

nmbm_spim_nand {
compatible = "generic,nmbm";
#address-cells = <1>;
#size-cells = <1>;

lower-mtd-device = <&spi_nand>;
forced-create;

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

partition@0 {
label = "BL2";
reg = <0x0 0x100000>;
};

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

partition@180000 {
label = "Factory";
reg = <0x180000 0x200000>;
};

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

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

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_flash_pins>;
status = "okay";

spi_nand: spi_nand@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <52000000>;
spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;
spi-cal-enable;
spi-cal-mode = "read-data";
spi-cal-datalen = <7>;
spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; /* 'SPINAND' */
spi-cal-addrlen = <5>;
spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
};
};

&pio {
spi0_flash_pins: spi0-pins {
mux {
function = "spi";
groups = "spi0", "spi0_wp_hold";
};

conf-pu {
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
};

conf-pd {
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/dts-v1/;
#include "mt7981.dtsi"

/ {
aliases {
led-boot = &red_led;
led-failsafe = &red_led;
led-running = &green_led;
led-upgrade = &blue_led;
};

memory {
reg = <0 0x40000000 0 0x20000000>;
};

leds {
compatible = "gpio-leds";

red_led: red {
label = "rax3000m:red";
gpios = <&pio 35 GPIO_ACTIVE_LOW>;
};

green_led: green {
label = "rax3000m:green";
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
};

blue_led: blue {
label = "rax3000m:blue";
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
};
};

gpio-keys {
compatible = "gpio-keys";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
};

mesh {
label = "mesh";
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
linux,code = <BTN_9>;
linux,input-type = <EV_SW>;
};
};

gsw: gsw@0 {
compatible = "mediatek,mt753x";
mediatek,ethsys = <&ethsys>;
#address-cells = <1>;
#size-cells = <0>;
};
};

&uart0 {
status = "okay";
};

&watchdog {
status = "okay";
};

&eth {
status = "okay";

gmac0: mac@0 {
compatible = "mediatek,eth-mac";
reg = <0>;
phy-mode = "2500base-x";

fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};

gmac1: mac@1 {
compatible = "mediatek,eth-mac";
reg = <1>;
phy-mode = "gmii";
phy-handle = <&phy0>;
};

mdio: mdio-bus {
#address-cells = <1>;
#size-cells = <0>;

phy0: ethernet-phy@0 {
compatible = "ethernet-phy-id03a2.9461";
reg = <0>;
phy-mode = "gmii";
nvmem-cells = <&phy_calibration>;
nvmem-cell-names = "phy-cal-data";
};
};
};

&gsw {
mediatek,mdio = <&mdio>;
mediatek,mdio_master_pinmux = <0>;
reset-gpios = <&pio 39 0>;
interrupt-parent = <&pio>;
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
status = "okay";

port6: port@6 {
compatible = "mediatek,mt753x-port";
mediatek,ssc-on;
reg = <6>;
phy-mode = "sgmii";

fixed-link {
speed = <2500>;
full-duplex;
};
};
};

&hnat {
mtketh-wan = "eth1";
mtketh-lan = "eth0";
mtketh-max-gmac = <2>;
status = "okay";
};

&xhci {
mediatek,u3p-dis-msk = <0x0>;
phys = <&u2port0 PHY_TYPE_USB2>,
<&u3port0 PHY_TYPE_USB3>;
status = "okay";
};
18 changes: 18 additions & 0 deletions target/linux/mediatek/image/mt7981.mk
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,24 @@ define Device/cmcc_rax3000m
endef
TARGET_DEVICES += cmcc_rax3000m

define Device/cmcc_rax3000m-256m
DEVICE_VENDOR := CMCC
DEVICE_MODEL := RAX3000M NAND 256m
DEVICE_DTS := mt7981-cmcc-rax3000m-256m
DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
DEVICE_PACKAGES := $(MT7981_USB_PKGS) luci-app-ksmbd luci-i18n-ksmbd-zh-cn ksmbd-utils
SUPPORTED_DEVICES := cmcc,rax3000m
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 240128k
KERNEL_IN_UBI := 1
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += cmcc_rax3000m-256m

define Device/cmcc_rax3000m-emmc
DEVICE_VENDOR := CMCC
DEVICE_MODEL := RAX3000M eMMC
Expand Down