Skip to content

Commit 05ce829

Browse files
committed
[draft] mediatek: add support Securifi Almond 3S
WIP: - LED - Screen - Zigbee - Sound - Reboot is not working for now 1. Boot into initramfs: In U-Boot press 4, set computer IP to 10.10.10.3, serve via tftp: ``` tftpboot 0x80001000 openwrt-ramips-mt7621-securifi_almond-3s-initramfs-kernel.bin go 0x80001000 ``` 2. Backup all partitions via luci menu 3. Flash uboot-mt7621 by https://github.com/DragonBluep/uboot-mt7621 ``` insmod mtd-rw i_want_a_brick=1 mtd write u-boot-mt7621.bin u-boot ``` 4. Serve sysupgrade via luci, wait 4-5 minutes. 5. Power off / Power on wait for more 11 minutes till the filesystem initialize and enjoy OpenWrt! Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
1 parent e40d416 commit 05ce829

4 files changed

Lines changed: 239 additions & 0 deletions

File tree

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
/*
3+
* Copyright (c) 2026
4+
* Author: Fil Dunsky <filipp.dunsky@gmail.com>
5+
*/
6+
7+
#include "mt7621.dtsi"
8+
9+
#include <dt-bindings/input/input.h>
10+
#include <dt-bindings/leds/common.h>
11+
#include <dt-bindings/gpio/gpio.h>
12+
13+
/ {
14+
model = "Securifi Almond 3S";
15+
compatible = "securifi,almond-3s", "mediatek,mt7621-soc";
16+
17+
chosen {
18+
bootargs = "console=ttyS0,57600n8";
19+
};
20+
21+
keys {
22+
compatible = "gpio-keys";
23+
24+
reset {
25+
label = "reset";
26+
linux,code = <KEY_RESTART>;
27+
gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
28+
debounce-interval = <20>;
29+
};
30+
31+
tamper {
32+
label = "tamper";
33+
linux,code = <BTN_0>;
34+
gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
35+
debounce-interval = <20>;
36+
};
37+
};
38+
39+
leds {
40+
compatible = "gpio-leds";
41+
42+
display_power {
43+
label = "display:power";
44+
gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
45+
};
46+
};
47+
48+
gpio-export {
49+
compatible = "gpio-export";
50+
51+
modem-reset {
52+
gpio-export,name = "modem_reset";
53+
gpio-export,output = <1>;
54+
gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
55+
};
56+
};
57+
};
58+
59+
&i2c {
60+
status = "okay";
61+
};
62+
63+
&gdma {
64+
status = "okay";
65+
};
66+
67+
&i2s {
68+
status = "okay";
69+
#sound-dai-cells = <0>;
70+
};
71+
72+
&spi0 {
73+
status = "okay";
74+
75+
flash@0 { /* MT25QL512AB */
76+
compatible = "jedec,spi-nor";
77+
reg = <0>;
78+
spi-max-frequency = <52000000>;
79+
80+
#address-cells = <1>;
81+
#size-cells = <1>;
82+
83+
partitions: partitions {
84+
compatible = "fixed-partitions";
85+
#address-cells = <1>;
86+
#size-cells = <1>;
87+
88+
partition@0 {
89+
label = "u-boot";
90+
reg = <0x0 0x30000>;
91+
read-only;
92+
};
93+
94+
partition@30000 {
95+
label = "u-boot-env";
96+
reg = <0x30000 0x10000>;
97+
};
98+
99+
partition@40000 {
100+
label = "factory";
101+
reg = <0x40000 0x10000>;
102+
read-only;
103+
104+
nvmem-layout {
105+
compatible = "fixed-layout";
106+
#address-cells = <1>;
107+
#size-cells = <1>;
108+
109+
eeprom_factory_0: eeprom@0 {
110+
reg = <0x0 0x1000>;
111+
};
112+
113+
eeprom_factory_8000: eeprom@8000 {
114+
reg = <0x8000 0x1000>;
115+
};
116+
117+
mac_wifi2g: macaddr@4 {
118+
reg = <0x4 0x6>;
119+
};
120+
121+
mac_lan: macaddr@28 {
122+
reg = <0x28 0x6>;
123+
};
124+
125+
mac_wan: macaddr@2e {
126+
reg = <0x2e 0x6>;
127+
};
128+
129+
mac_wifi5g: macaddr@8004 {
130+
reg = <0x8004 0x6>;
131+
};
132+
};
133+
};
134+
135+
partition@50000 {
136+
compatible = "openwrt,uimage", "denx,uimage";
137+
label = "firmware";
138+
reg = <0x0050000 0x3fb0000>;
139+
};
140+
};
141+
};
142+
};
143+
144+
&pcie {
145+
status = "okay";
146+
};
147+
148+
&pcie0 {
149+
wifi@0,0 {
150+
compatible = "mediatek,mt76";
151+
reg = <0x0000 0 0 0 0>;
152+
ieee80211-freq-limit = <5000000 6000000>;
153+
154+
nvmem-cells = <&eeprom_factory_8000>, <&mac_wifi5g>;
155+
nvmem-cell-names = "eeprom", "mac-address";
156+
};
157+
};
158+
159+
&pcie1 {
160+
wifi@0,0 {
161+
compatible = "mediatek,mt76";
162+
reg = <0x0000 0 0 0 0>;
163+
ieee80211-freq-limit = <2400000 2500000>;
164+
165+
nvmem-cells = <&eeprom_factory_0>, <&mac_wifi2g>;
166+
nvmem-cell-names = "eeprom", "mac-address";
167+
};
168+
};
169+
170+
&gmac0 {
171+
nvmem-cells = <&mac_lan>;
172+
nvmem-cell-names = "mac-address";
173+
};
174+
175+
&ethphy0 {
176+
/delete-property/ interrupts;
177+
};
178+
179+
&ethernet {
180+
pinctrl-0 = <&mdio_pins>;
181+
};
182+
183+
&switch0 {
184+
ports {
185+
port@0 {
186+
status = "okay";
187+
label = "wan";
188+
nvmem-cells = <&mac_wan>;
189+
nvmem-cell-names = "mac-address";
190+
};
191+
192+
port@1 {
193+
status = "okay";
194+
label = "lan2";
195+
};
196+
197+
port@2 {
198+
status = "okay";
199+
label = "lan1";
200+
};
201+
};
202+
};
203+
204+
&uartlite2 {
205+
status = "okay";
206+
current-speed = <57600>;
207+
};
208+
209+
&uartlite3 {
210+
status = "okay";
211+
current-speed = <57600>;
212+
};
213+
214+
&xhci {
215+
status = "okay";
216+
};

target/linux/ramips/image/mt7621.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,6 +2726,23 @@ define Device/samknows_whitebox-v8
27262726
endef
27272727
TARGET_DEVICES += samknows_whitebox-v8
27282728

2729+
define Device/securifi_almond-3s
2730+
$(Device/dsa-migration)
2731+
$(Device/uimage-lzma-loader)
2732+
DEVICE_VENDOR := Securifi
2733+
DEVICE_MODEL := Almond
2734+
DEVICE_VARIANT := 3S
2735+
IMAGE_SIZE := 65216k
2736+
KERNEL_LOADADDR := 0x80001000
2737+
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel
2738+
IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | \
2739+
pad-rootfs | check-size | append-metadata
2740+
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \
2741+
kmod-mt76x2 kmod-usb3 -uboot-envtools \
2742+
kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
2743+
endef
2744+
TARGET_DEVICES += securifi_almond-3s
2745+
27292746
define Device/sercomm_na502
27302747
$(Device/nand)
27312748
$(Device/uimage-lzma-loader)

target/linux/ramips/mt7621/base-files/etc/board.d/02_network

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ ramips_setup_interfaces()
119119
xiaomi,mi-router-4a-gigabit-v2)
120120
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
121121
;;
122+
securifi,almond-3s)
123+
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
124+
ucidef_set_interface "modem" device "/dev/cdc-wdm0" protocol "qmi"
125+
uci add_list firewall.@zone[1].network='modem'
126+
;;
122127
bolt,arion)
123128
ucidef_set_interfaces_lan_wan "lan" "wan"
124129
ucidef_set_interface "eth_data" device "modem.103" protocol "static" ipaddr "10.22.127.222" netmask "255.255.255.255"

target/linux/ramips/mt7621/config-6.12

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ CONFIG_MTD_UBI_BLOCK=y
178178
CONFIG_MTD_UBI_NVMEM=y
179179
CONFIG_MTD_UBI_WL_THRESHOLD=4096
180180
CONFIG_MTD_VIRT_CONCAT=y
181+
CONFIG_MTK_NET_PHYLIB=y
181182
CONFIG_NEED_DMA_MAP_STATE=y
182183
CONFIG_NEED_SRCU_NMI_SAFE=y
183184
# CONFIG_NET_AIROHA is not set

0 commit comments

Comments
 (0)