Skip to content

Commit 7cc03d2

Browse files
committed
mediatek: add support for Qihoo 360T7 (UBI layout)
This commit adds support for Qihoo 360T7 (UBI layout). Aims ---- 1. +20 MB additional free space for the packages 2. More reliable storage for the factory and fip partitions (in UBI) Install (from non-UBI OpenWrt) ------------------------------ 1. Navigate http://192.168.1.1/ and download mtd backups 2. Upgrade OpenWrt with installer initramfs image (force upgrade, don't keep settings). Wait until OpenWrt reboots and until installer: - Prepare new factory partition - Format new ubi - Make ubi volumes - Write new fip and bl2 3. Navigate http://192.168.1.1/ and Upgrade with OpenWrt 'sysupgrade.bin' image (don't keep settings) Installer --------- Based on OpenWrt UBI Installer Image Generator for Linksys E8450 and Belkin RT3200 Link: https://github.com/dangowrt/owrt-ubi-installer Ready installer image Link: https://github.com/csharper2005/owrt-ubi-installer/tree/qihoo/bin Installer script Link: https://github.com/csharper2005/owrt-ubi-installer/blob/qihoo/files/ installer/install.sh Committing to the parent Daniel's repository is not yet possible because there are no official images and imagebuilder for Qihoo 360T7 (UBI) yet. Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
1 parent 11b11d1 commit 7cc03d2

7 files changed

Lines changed: 355 additions & 220 deletions

File tree

package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ netis,nx32u|\
4646
nokia,ea0326gmp|\
4747
openwrt,one|\
4848
qihoo,360t7|\
49+
qihoo,360t7-ubi|\
4950
routerich,ax3000-ubootmod|\
5051
routerich,be7200|\
5152
snr,snr-cpe-ax2|\
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
/dts-v1/;
4+
#include <dt-bindings/gpio/gpio.h>
5+
#include <dt-bindings/input/input.h>
6+
#include <dt-bindings/leds/common.h>
7+
#include <dt-bindings/pinctrl/mt65xx.h>
8+
9+
#include "mt7981b.dtsi"
10+
11+
/ {
12+
aliases: aliases {
13+
led-boot = &led_status_red;
14+
led-failsafe = &led_status_red;
15+
led-running = &led_status_green;
16+
led-upgrade = &led_status_green;
17+
18+
serial0 = &uart0;
19+
};
20+
21+
chosen {
22+
bootargs-append = " root=/dev/fit0 rootwait";
23+
rootdisk = <&ubi_rootdisk>;
24+
stdout-path = "serial0:115200n8";
25+
};
26+
27+
memory@40000000 {
28+
reg = <0 0x40000000 0 0x10000000>;
29+
device_type = "memory";
30+
};
31+
32+
gpio-keys {
33+
compatible = "gpio-keys";
34+
35+
button-0 {
36+
label = "wps";
37+
linux,code = <KEY_WPS_BUTTON>;
38+
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
39+
};
40+
41+
button-1 {
42+
label = "reset";
43+
linux,code = <KEY_RESTART>;
44+
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
45+
};
46+
};
47+
48+
leds {
49+
compatible = "gpio-leds";
50+
51+
led_status_red: led-0 {
52+
function = LED_FUNCTION_STATUS;
53+
color = <LED_COLOR_ID_RED>;
54+
gpios = <&pio 3 GPIO_ACTIVE_LOW>;
55+
};
56+
57+
led_status_green: led-1 {
58+
function = LED_FUNCTION_STATUS;
59+
color = <LED_COLOR_ID_GREEN>;
60+
gpios = <&pio 7 GPIO_ACTIVE_LOW>;
61+
};
62+
};
63+
};
64+
65+
&eth {
66+
status = "okay";
67+
68+
gmac0: mac@0 {
69+
compatible = "mediatek,eth-mac";
70+
reg = <0>;
71+
phy-mode = "2500base-x";
72+
73+
fixed-link {
74+
speed = <2500>;
75+
full-duplex;
76+
pause;
77+
};
78+
};
79+
};
80+
81+
&mdio_bus {
82+
switch: switch@1f {
83+
compatible = "mediatek,mt7531";
84+
reg = <31>;
85+
reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
86+
interrupt-controller;
87+
#interrupt-cells = <1>;
88+
interrupt-parent = <&pio>;
89+
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
90+
};
91+
};
92+
93+
&spi0 {
94+
pinctrl-names = "default";
95+
pinctrl-0 = <&spi0_flash_pins>;
96+
status = "okay";
97+
98+
spi_nand@0 {
99+
compatible = "spi-nand";
100+
reg = <0>;
101+
102+
spi-max-frequency = <52000000>;
103+
spi-tx-bus-width = <4>;
104+
spi-rx-bus-width = <4>;
105+
106+
partitions: partitions {
107+
compatible = "fixed-partitions";
108+
#address-cells = <1>;
109+
#size-cells = <1>;
110+
111+
partition@0 {
112+
label = "bl2";
113+
reg = <0x0 0x100000>;
114+
read-only;
115+
};
116+
};
117+
};
118+
};
119+
120+
&switch {
121+
ports {
122+
#address-cells = <1>;
123+
#size-cells = <0>;
124+
125+
port@0 {
126+
reg = <0>;
127+
label = "lan3";
128+
};
129+
130+
port@1 {
131+
reg = <1>;
132+
label = "lan2";
133+
};
134+
135+
port@2 {
136+
reg = <2>;
137+
label = "lan1";
138+
};
139+
140+
wan: port@3 {
141+
reg = <3>;
142+
label = "wan";
143+
};
144+
145+
port@6 {
146+
reg = <6>;
147+
ethernet = <&gmac0>;
148+
phy-mode = "2500base-x";
149+
150+
fixed-link {
151+
speed = <2500>;
152+
full-duplex;
153+
pause;
154+
};
155+
};
156+
};
157+
};
158+
159+
&pio {
160+
spi0_flash_pins: spi0-pins {
161+
mux {
162+
function = "spi";
163+
groups = "spi0", "spi0_wp_hold";
164+
};
165+
166+
conf-pu {
167+
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
168+
drive-strength = <MTK_DRIVE_8mA>;
169+
bias-disable; /* bias-disable */
170+
};
171+
172+
conf-pd {
173+
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
174+
drive-strength = <MTK_DRIVE_8mA>;
175+
bias-disable; /* bias-disable */
176+
};
177+
};
178+
};
179+
180+
&uart0 {
181+
status = "okay";
182+
};
183+
184+
&watchdog {
185+
status = "okay";
186+
};
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
#include "mt7981b-qihoo-360t7-common.dtsi"
4+
5+
/ {
6+
compatible = "qihoo,360t7-ubi", "mediatek,mt7981";
7+
model = "Qihoo 360T7 (UBI)";
8+
9+
aliases {
10+
label-mac-device = &wan;
11+
};
12+
};
13+
14+
&gmac0 {
15+
nvmem-cell-names = "mac-address";
16+
nvmem-cells = <&macaddr_factory_8000 (0)>;
17+
};
18+
19+
&partitions {
20+
partition@100000 {
21+
reg = <0x100000 0x7f00000>;
22+
compatible = "linux,ubi";
23+
label = "ubi";
24+
25+
volumes {
26+
ubi_factory: ubi-volume-factory {
27+
volname = "factory";
28+
};
29+
30+
ubi-volume-fip {
31+
volname = "fip";
32+
};
33+
34+
ubi_rootdisk: ubi-volume-fit {
35+
volname = "fit";
36+
};
37+
38+
ubi_ubootenv: ubi-volume-ubootenv {
39+
volname = "ubootenv";
40+
};
41+
42+
ubi_ubootenv2: ubi-volume-ubootenv2 {
43+
volname = "ubootenv2";
44+
};
45+
};
46+
};
47+
};
48+
49+
&ubi_factory {
50+
nvmem-layout {
51+
compatible = "fixed-layout";
52+
#address-cells = <1>;
53+
#size-cells = <1>;
54+
55+
eeprom_factory_0: eeprom@0 {
56+
reg = <0x0 0x1000>;
57+
};
58+
59+
macaddr_factory_8000: macaddr@8000 {
60+
compatible = "mac-base";
61+
reg = <0x8000 0x6>;
62+
#nvmem-cell-cells = <1>;
63+
};
64+
};
65+
};
66+
67+
&ubi_ubootenv {
68+
nvmem-layout {
69+
compatible = "u-boot,env-redundant-bool";
70+
};
71+
};
72+
73+
&ubi_ubootenv2 {
74+
nvmem-layout {
75+
compatible = "u-boot,env-redundant-bool";
76+
};
77+
};
78+
79+
&wan {
80+
nvmem-cell-names = "mac-address";
81+
nvmem-cells = <&macaddr_factory_8000 (1)>;
82+
};
83+
84+
&wifi {
85+
status = "ok";
86+
87+
#address-cells = <1>;
88+
#size-cells = <0>;
89+
90+
nvmem-cells = <&eeprom_factory_0>;
91+
nvmem-cell-names = "eeprom";
92+
93+
ieee80211-freq-limit = <2400000 2500000>, <5170000 5835000>;
94+
95+
band@0 {
96+
reg = <0>;
97+
98+
nvmem-cells = <&macaddr_factory_8000 (2)>;
99+
nvmem-cell-names = "mac-address";
100+
};
101+
102+
band@1 {
103+
reg = <1>;
104+
105+
nvmem-cells = <&macaddr_factory_8000 (3)>;
106+
nvmem-cell-names = "mac-address";
107+
};
108+
};

0 commit comments

Comments
 (0)