Skip to content

Commit

Permalink
ramips: add support for jdcloud_re-cp-02
Browse files Browse the repository at this point in the history
Signed-off-by: lyq1996 <lyq123233@gmail.com>
  • Loading branch information
lyq1996 committed Jan 25, 2022
1 parent 3388306 commit 7ec11db
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package/boot/uboot-envtools/files/ramips
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ sitecom,wlr-4100-v1-002)
;;
allnet,all0256n-4m|\
allnet,all0256n-8m|\
allnet,all5002)
allnet,all5002|\
jdcloud,re-cp-02)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
;;
ampedwireless,ally-00x19k|\
Expand Down
162 changes: 162 additions & 0 deletions target/linux/ramips/dts/mt7621_jdcloud_re-cp-02.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "mt7621.dtsi"

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

/ {
compatible = "jdcloud,re-cp-02", "mediatek,mt7621-soc";
model = "JD-Cloud RE-CP-02";

aliases {
led-boot = &led_green;
led-failsafe = &led_red;
led-running = &led_blue;
led-upgrade = &led_red;
label-mac-device = &gmac0;
};

chosen {
bootargs = "console=ttyS0,115200";
};

leds {
compatible = "gpio-leds";

led_red: red {
label = "red:status";
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
};

led_green: green {
label = "green:status";
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
};

led_blue: blue {
label = "blue:status";
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
};
};

keys {
compatible = "gpio-keys";

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

wps {
label = "wps";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};

&spi0 {
status = "okay";

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 = "u-boot";
reg = <0x00 0x40000>;
};

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

factory: partition@50000 {
label = "factory";
reg = <0x50000 0x40000>;
};

partition@90000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x90000 0xf70000>;
};
};
};
};

&sdhci {
status = "okay";
};

&pcie {
status = "okay";
};

&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0000>;
};
};

&gmac0 {
nvmem-cells = <&macaddr_factory_3fff4>;
nvmem-cell-names = "mac-address";
};

&switch0 {
ports {
port@1 {
status = "okay";
label = "lan1";
};

port@2 {
status = "okay";
label = "lan2";
};

port@3 {
status = "okay";
label = "lan3";
};

port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&macaddr_factory_3fffa>;
};
};
};

&state_default {
gpio {
groups = "i2c";
function = "gpio";
};
};

&factory {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_factory_3fff4: macaddr@3fff4 {
reg = <0x3fff4 0x6>;
};

macaddr_factory_3fffa: macaddr@3fffa {
reg = <0x3fffa 0x6>;
};
};
10 changes: 10 additions & 0 deletions target/linux/ramips/image/mt7621.mk
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,16 @@ define Device/iptime_t5004
endef
TARGET_DEVICES += iptime_t5004

define Device/jdcloud_re-cp-02
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 15808k
DEVICE_VENDOR := JD-Cloud
DEVICE_MODEL := RE-CP-02
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7615-firmware kmod-sdhci-mt7620
endef
TARGET_DEVICES += jdcloud_re-cp-02

define Device/jcg_jhr-ac876m
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ramips_setup_interfaces()
ampedwireless,ally-r1900k|\
gehua,ghl-r-001|\
hiwifi,hc5962|\
jdcloud,re-cp-02|\
xiaomi,mi-router-3-pro|\
xiaomi,mi-router-ac2100|\
xiaomi,redmi-router-ac2100)
Expand Down

0 comments on commit 7ec11db

Please sign in to comment.