Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Commit

Permalink
Trying DTS from Cudy firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
waja committed Nov 28, 2022
1 parent 62f18bf commit 5d3f840
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-openwrt-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
- name: Patch Cudy X6 DTS file
run: cd openwrt && patch -p1<$GITHUB_WORKSPACE/mt7621_cudy_x6_fix_dts_2.patch
run: cd openwrt && patch -p1<$GITHUB_WORKSPACE/mt7621_cudy_x6_fix_dts_3.patch

- name: Load custom feeds
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-openwrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
- name: Patch Cudy X6 DTS file
run: cd openwrt && patch -p1<$GITHUB_WORKSPACE/mt7621_cudy_x6_fix_dts_2.patch
run: cd openwrt && patch -p1<$GITHUB_WORKSPACE/mt7621_cudy_x6_fix_dts_3.patch

- name: Load custom feeds
run: |
Expand Down
139 changes: 139 additions & 0 deletions mt7621_cudy_x6_fix_dts_3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
diff --git a/target/linux/ramips/dts/mt7621_cudy_x6.dts b/target/linux/ramips/dts/mt7621_cudy_x6.dts
index ebb2149172..e486d7fbd8 100644
--- a/target/linux/ramips/dts/mt7621_cudy_x6.dts
+++ b/target/linux/ramips/dts/mt7621_cudy_x6.dts
@@ -2,19 +2,16 @@

#include "mt7621.dtsi"

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

/ {
- compatible = "cudy,x6", "mediatek,mt7621-soc";
+ compatible = "cudy-x6", "mediatek,mt7621-soc";
model = "CUDY X6";

- aliases {
- led-boot = &led_internet_blue;
- led-failsafe = &led_internet_blue;
- led-running = &led_internet_blue;
- led-upgrade = &led_internet_blue;
- label-mac-device = &gmac0;
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x10000000>;
};

chosen {
@@ -40,13 +37,13 @@
leds {
compatible = "gpio-leds";

- led_internet_blue: internet_blue {
- label = "blue:internet";
- gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+ led_blue: blue {
+ label = "blue";
+ gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
};

- internet_red {
- label = "red:internet";
+ led_red: red {
+ label = "red";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};
};
@@ -59,7 +56,8 @@
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
- spi-max-frequency = <50000000>;
+ spi-max-frequency = <80000000>;
+ m25p,fast-read;

partitions {
compatible = "fixed-partitions";
@@ -81,32 +79,29 @@
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- compatible = "denx,uimage";
- label = "firmware";
- reg = <0x50000 0x1f80000>;
};

- partition@1fd0000 {
+ debug: partition@1fd0000 {
label = "debug";
reg = <0x1fd0000 0x10000>;
- read-only;
};

- partition@1fe0000 {
+ backup: partition@1fe0000 {
label = "backup";
reg = <0x1fe0000 0x10000>;
- read-only;
};

- bdinfo: partition@1ff0000 {
+ bdinfo: partition@ff0000 {
label = "bdinfo";
reg = <0x1ff0000 0x10000>;
read-only;
};
+
+ firmware: partition@50000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x50000 0x1f80000>;
+ };
};
};
};
@@ -124,8 +119,7 @@
};

&gmac0 {
- nvmem-cells = <&macaddr_bdinfo_de00>;
- nvmem-cell-names = "mac-address";
+ mtd-mac-address = <&bdinfo 0xDE00>;
};

&switch0 {
@@ -153,26 +147,14 @@
port@4 {
status = "okay";
label = "wan";
- nvmem-cells = <&macaddr_bdinfo_de00>;
- nvmem-cell-names = "mac-address";
- mac-address-increment = <1>;
+ mtd-mac-address = <&factory 0xA>;
};
};
};

&state_default {
gpio {
- groups = "uart3", "jtag";
+ groups = "i2c", "wdt";
function = "gpio";
};
};
-
-&bdinfo {
- compatible = "nvmem-cells";
- #address-cells = <1>;
- #size-cells = <1>;
-
- macaddr_bdinfo_de00: macaddr@de00 {
- reg = <0xde00 0x6>;
- };
-};

0 comments on commit 5d3f840

Please sign in to comment.