ramips: jcg q20: drop ubootmod version

This commit is contained in:
AmadeusGhost 2022-06-13 23:09:02 +08:00 committed by AmadeusGhost
parent c78af7bc21
commit d41530dba8
7 changed files with 76 additions and 167 deletions

View File

@ -1,61 +0,0 @@
// 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>
/ {
chosen {
bootargs = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
led_status_red: status_red {
label = "red:status";
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
};
led_status_blue: status_blue {
label = "blue:status";
gpios = <&gpio 15 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 16 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};
&pcie {
status = "okay";
};
&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0>;
};
};
&state_default {
gpio {
groups = "jtag", "wdt";
function = "gpio";
};
};

View File

@ -1,86 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621_jcg_nand_128m.dtsi"
/ {
compatible = "jcg,q20-ubootmod", "mediatek,mt7621-soc";
model = "JCG Q20 (U-Boot mod)";
aliases {
led-boot = &led_status_red;
led-failsafe = &led_status_red;
led-running = &led_status_blue;
led-upgrade = &led_status_blue;
label-mac-device = &ethernet;
};
};
&ethernet {
compatible = "mediatek,ralink-mt7621-eth";
mediatek,switch = <&gsw>;
mtd-mac-address = <&factory 0x3fff4>;
};
&switch0 {
/delete-property/ compatible;
phy-mode = "rgmii";
};
&gsw {
compatible = "mediatek,ralink-mt7621-gsw";
};
&nand {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "Bootloader";
reg = <0x0 0x80000>;
};
partition@80000 {
label = "Nvram";
reg = <0x80000 0x40000>;
read-only;
};
partition@c0000 {
label = "Bdata";
reg = <0xc0000 0x40000>;
read-only;
};
factory: partition@100000 {
label = "Factory";
reg = <0x100000 0x80000>;
read-only;
};
partition@180000 {
label = "crash";
reg = <0x180000 0x40000>;
read-only;
};
partition@1c0000 {
label = "crash_log";
reg = <0x1c0000 0x40000>;
read-only;
};
partition@200000 {
label = "kernel";
reg = <0x200000 0x400000>;
};
partition@600000 {
label = "ubi";
reg = <0x600000 0x7980000>;
};
};
};

View File

@ -1,6 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621_jcg_nand_128m.dtsi"
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "jcg,q20", "mediatek,mt7621-soc";
@ -14,6 +17,40 @@
label-mac-device = &gmac0;
};
chosen {
bootargs = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
led_status_red: status_red {
label = "red:status";
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
};
led_status_blue: status_blue {
label = "blue:status";
gpios = <&gpio 15 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 16 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
ubi-concat {
compatible = "mtd-concat";
devices = <&ubiconcat0 &ubiconcat1>;
@ -94,8 +131,21 @@
};
};
&pcie {
status = "okay";
};
&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0>;
};
};
&gmac0 {
mtd-mac-address = <&factory 0x3fff4>;
nvmem-cells = <&macaddr_factory_3fff4>;
nvmem-cell-names = "mac-address";
};
&switch0 {
@ -103,7 +153,8 @@
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x3fffa>;
nvmem-cells = <&macaddr_factory_3fffa>;
nvmem-cell-names = "mac-address";
};
port@1 {
@ -117,3 +168,24 @@
};
};
};
&state_default {
gpio {
groups = "jtag", "wdt";
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>;
};
};

View File

@ -851,12 +851,6 @@ define Device/jcg_q20
endef
TARGET_DEVICES += jcg_q20
define Device/jcg_q20-ubootmod
$(Device/jcg_q20)
DEVICE_VARIANT := U-Boot mod
endef
TARGET_DEVICES += jcg_q20-ubootmod
define Device/jcg_y2
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)

View File

@ -61,10 +61,6 @@ ramips_setup_interfaces()
gnubee,gb-pc2)
ucidef_set_interface_lan "lan1 lan2"
;;
jcg,q20-ubootmod)
ucidef_add_switch "switch0" \
"1:lan" "4:lan" "0:wan" "6@eth0"
;;
linksys,re6500|\
netgear,wac104)
ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
@ -167,10 +163,6 @@ ramips_setup_macs()
[ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
jcg,q20-ubootmod)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(mtd_get_mac_binary factory 0x3fffa)
;;
iodata,wnpr2600g)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
label_mac=$wan_mac

View File

@ -25,8 +25,7 @@ case "$board" in
[ "$PHYNBR" = "1" ] && \
macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1 > /sys${DEVPATH}/macaddress
;;
jcg,q20|\
jcg,q20-ubootmod)
jcg,q20)
[ "$PHYNBR" = "1" ] && \
macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress
;;

View File

@ -61,7 +61,6 @@ platform_do_upgrade() {
dlink,dir-853-a3|\
hiwifi,hc5962|\
jcg,q20|\
jcg,q20-ubootmod|\
linksys,e5600|\
linksys,ea7300-v1|\
linksys,ea7300-v2|\