openwrt/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi

308 lines
5.4 KiB
Plaintext
Raw Normal View History

ramips: add support for Sercomm CPJ routers This commit adds support for following wireless routers: - Rostelecom RT-FL-1 (Serсomm RT-FL-1) - Rostelecom S1010 (Serсomm S1010.RT) The devices are almost identical and the only difference is one bit in the factory image PID (thanks to Maximilian Weinmann <x1@disroot.org> (@MaxS0niX) for the info and idea to make one PR for two devices at once). Devices specification --------------------- SoC: MediaTek MT7620A, MIPS RAM: 64 MB Flash: 16 MB SPI NOR Wireless 2.4: MT7620 (b/g/n, 2x2) Wireless 5: MT7612EN (a/n/ac, 2x2) Ethernet: 5xFE (WAN, LAN1-4) BootLoader: U-Boot Buttons: 2 (wps, reset) LEDs: 1 amber and 1 green status GPIO leds 5 green ethernet GPIO leds 1 green GPIO 2.4 GHz WLAN led 1 green PHY 5 GHz WLAN led 1 green unmanaged power led USB ports: No Power: 12 VDC, 1 A Connector: Barrel OEM easy installation --------------------- 1. Remove all dots from the factory image filename (except the dot before file extension) 2. Upload and update the firmware via the original web interface 3. Wait until green status led stops blinking (can take several minutes) 4. Login to OpenWrt initramsfs. It's recommended to make a backup of the mtd partitions at this point. 4. Perform sysupgrade using the following command (or use Luci): sysupgrade -n sysupgrade.bin 5. Wait until green status les stops blinking (can take several minutes) 6. Mission acomplished Return to Stock --------------- Option 1. Restore firmware Slot1 from a backup (firmware2.bin): cd /tmp mtd -e Firmware2 write firmware2.bin Firmware2 printf 1 | dd bs=1 seek=$((0x18007)) count=1 of=/dev/mtdblock2 reboot Option 2. Decrypt, ungzip and split stock firmware image into the parts, take Slot1 parts (kernel2.bin, rootfs2.bin) and write them: cd /tmp mtd -e Kernel2 write kernel2.bin Kernel2 mtd -e RootFS2 write rootfs2.bin RootFS2 printf 1 | dd bs=1 seek=$((0x18007)) count=1 of=/dev/mtdblock2 reboot More about stock firmware decryption: Link: https://github.com/Psychotropos/sercomm_fwutils/ Debricking ---------- Use sercomm-recovery tool. You can use "ALL" mtd partition backup as a recovery image. Link: https://github.com/danitool/sercomm-recovery MAC addresses ------------- +---------+-------------------+-----------+ | | MAC | Algorithm | +---------+-------------------+-----------+ | label | 48:3e:xx:xx:xx:1e | label | | LAN | 48:3e:xx:xx:xx:1e | label | | WAN | 48:3e:xx:xx:xx:28 | label+10 | | WLAN 2g | 48:3e:xx:xx:xx:20 | label+2 | | WLAN 5g | 48:3e:xx:xx:xx:24 | label+6 | +---------+-------------------+-----------+ Co-authored-by: Vadzim Vabishchevich <bestmc2009@gmail.com> Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-11-12 07:58:26 +00:00
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
aliases {
label-mac-device = &ethernet;
led-boot = &status_green;
led-failsafe = &status_amber;
led-running = &status_green;
led-upgrade = &status_amber;
};
keys {
compatible = "gpio-keys";
button-0 {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
button-1 {
label = "wps";
linux,code = <KEY_RESTART>;
gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
};
leds {
compatible = "gpio-leds";
status_green: led-0 {
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
};
status_amber: led-1 {
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_AMBER>;
function = LED_FUNCTION_STATUS;
};
led-2 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN;
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
};
led-3 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
};
led-4 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
};
led-5 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <3>;
gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
};
led-6 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <4>;
gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
};
led-7 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WLAN;
function-enumerator = <24>;
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
};
virtual_flash {
compatible = "mtd-concat";
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "openwrt,uimage";
/* sercomm krnl hdr with fw chksums */
openwrt,offset = <0x100>;
label = "firmware";
reg = <0x0 0x0>;
};
};
};
};
&ethernet {
nvmem-cells = <&macaddr_label 0>;
nvmem-cell-names = "mac-address";
};
&gpio1 {
status = "okay";
};
&gpio2 {
status = "okay";
};
&gpio3 {
status = "okay";
};
&pcie {
status = "okay";
};
/* mt7612 */
&pcie0 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
ieee80211-freq-limit = <5000000 6000000>;
nvmem-cells = <&eeprom_factory_8000>, <&macaddr_label 6>;
nvmem-cell-names = "eeprom", "mac-address";
/* 5 GHz WLAN phy green led */
led {
led-sources = <2>;
led-active-low;
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <70000000>;
m25p,fast-read;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* whole flash */
partition@0_all {
label = "ALL";
reg = <0x0 0x1000000>;
read-only;
};
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "ftd_and_bootflag";
reg = <0x30000 0x20000>;
};
partition@50000 {
label = "Factory";
reg = <0x50000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory_0: eeprom@0 {
reg = <0x0 0x200>;
};
eeprom_factory_8000: eeprom@8000 {
reg = <0x8000 0x200>;
};
};
};
partition@60000 {
label = "SC Nvram(permanent data)";
reg = <0x60000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_label: macaddr@0 {
compatible = "mac-base";
reg = <0x0 0x6>;
#nvmem-cell-cells = <1>;
};
};
};
fwconcat0: partition@70000 {
label = "Firmware";
reg = <0x70000 0x790000>;
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "Kernel";
reg = <0x0 0x200000>;
};
partition@200000 {
label = "RootFS";
reg = <0x200000 0x590000>;
};
};
fwconcat1: partition@800000 {
label = "Firmware2";
reg = <0x800000 0x790000>;
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "Kernel2";
reg = <0x0 0x200000>;
};
partition@200000 {
label = "RootFS2";
reg = <0x200000 0x590000>;
};
};
partition@f90000 {
label = "MAC IP";
reg = <0xf90000 0x10000>;
read-only;
};
partition@fa0000 {
label = "Critical Log";
reg = <0xfa0000 0x10000>;
read-only;
};
partition@fb000 {
label = "Critical Log Bak";
reg = <0xfb0000 0x10000>;
read-only;
};
partition@fc0000 {
label = "Xml Config";
reg = <0xfc0000 0x20000>;
read-only;
};
partition@fe0000 {
label = "Xml Config Bak";
reg = <0xfe0000 0x20000>;
read-only;
};
};
};
};
&state_default {
gpio {
groups = "ephy", "rgmii1", "uartf", "wled";
function = "gpio";
};
};
/* mt7620 */
&wmac {
nvmem-cells = <&eeprom_factory_0>, <&macaddr_label 2>;
nvmem-cell-names = "eeprom", "mac-address";
};