Skip to content

Commit 20644af

Browse files
Linaro1985hauke
authored andcommitted
mediatek: add support for Keenetic/Netcraze (K/N)AP-630
This commit adds support for Keenetic/Netcraze (K/N)AP-630 Specification: - MT7981 CPU using 2.4GHz and 5GHz WiFi (both AX) - 512MB RAM - 128MB SPI NAND - 1 led with two colors (green, orange) - 1 button (reset) - 1 2.5Gbit POE ethernet port based on Airoha EN8811H phy Serial Interface: - 3 Pins GND, RX, TX - Settings: 115200, 8N1 Notes: - The device supports dual boot mode Flash instruction: The only way to flash OpenWrt image is to use tftp recovery mode in U-Boot: 1. Configure PC with static IP 192.168.1.2/24 and tftp server. 2. Copy image to tftp server. a) Keenetic Rename "openwrt-mediatek-filogic-keenetic_kap-630-squashfs-factory.bin" to "KAP-630_recovery.bin" and place it in tftp server directory. b) Netcraze Rename "openwrt-mediatek-filogic-netcraze_nap-630-squashfs-factory.bin" to "NAP-630_recovery.bin" and place it in tftp server directory. 3. Connect PC with ethernet port, press the reset button, power up the device and keep button pressed until status led start blinking. 4. Device will download file from server, write it to flash and reboot. Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com> Link: openwrt/openwrt#21634 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent 2b4cdb6 commit 20644af

File tree

6 files changed

+301
-1
lines changed

6 files changed

+301
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
3+
#include "mt7981b-keenetic-kap-630.dtsi"
4+
5+
/ {
6+
model = "Keenetic KAP-630";
7+
compatible = "keenetic,kap-630", "mediatek,mt7981";
8+
};
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
// SPDX-License-Identifier: GPL-2.0-only OR MIT
2+
3+
/dts-v1/;
4+
#include "mt7981b.dtsi"
5+
6+
/ {
7+
aliases {
8+
label-mac-device = &gmac0;
9+
led-boot = &status_led_green;
10+
led-failsafe = &status_led_orange;
11+
led-running = &status_led_green;
12+
led-upgrade = &status_led_green;
13+
serial0 = &uart0;
14+
};
15+
16+
chosen {
17+
stdout-path = "serial0:115200n8";
18+
};
19+
20+
gpio-keys {
21+
compatible = "gpio-keys";
22+
23+
button-reset {
24+
label = "reset";
25+
linux,code = <KEY_RESTART>;
26+
gpios = <&pio 24 GPIO_ACTIVE_LOW>;
27+
};
28+
};
29+
30+
gpio-leds {
31+
compatible = "gpio-leds";
32+
33+
status_led_green: led-0 {
34+
color = <LED_COLOR_ID_GREEN>;
35+
function = LED_FUNCTION_STATUS;
36+
gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
37+
};
38+
39+
status_led_orange: led-1 {
40+
color = <LED_COLOR_ID_ORANGE>;
41+
function = LED_FUNCTION_STATUS;
42+
gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
43+
};
44+
};
45+
46+
virtual_flash {
47+
compatible = "mtd-concat";
48+
devices = <&firmware1 &firmware2>;
49+
50+
partitions {
51+
compatible = "fixed-partitions";
52+
#address-cells = <1>;
53+
#size-cells = <1>;
54+
55+
partition@0 {
56+
label = "kernel";
57+
reg = <0x0 0x600000>;
58+
};
59+
60+
partition@400000 {
61+
label = "ubi";
62+
reg = <0x600000 0x0>;
63+
};
64+
};
65+
};
66+
};
67+
68+
&uart0 {
69+
status = "okay";
70+
};
71+
72+
&watchdog {
73+
status = "okay";
74+
};
75+
76+
&eth {
77+
status = "okay";
78+
pinctrl-names = "default";
79+
pinctrl-0 = <&mdio_pins>;
80+
81+
gmac0: mac@0 {
82+
compatible = "mediatek,eth-mac";
83+
reg = <0>;
84+
phy-mode = "2500base-x";
85+
phy-handle = <&phy10>;
86+
87+
nvmem-cell-names = "mac-address";
88+
nvmem-cells = <&macaddr_factory_a>;
89+
};
90+
};
91+
92+
&mdio_bus {
93+
/* Airoha EN8811H */
94+
phy10: ethernet-phy@a {
95+
reg = <0xa>;
96+
interrupt-parent = <&pio>;
97+
interrupts = <38 IRQ_TYPE_EDGE_FALLING>;
98+
reset-gpios = <&pio 22 GPIO_ACTIVE_LOW>;
99+
reset-assert-us = <10000>;
100+
reset-deassert-us = <20000>;
101+
};
102+
};
103+
104+
&pio {
105+
spi0_flash_pins: spi0-pins {
106+
mux {
107+
function = "spi";
108+
groups = "spi0", "spi0_wp_hold";
109+
};
110+
111+
conf-pu {
112+
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
113+
drive-strength = <MTK_DRIVE_8mA>;
114+
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
115+
};
116+
117+
conf-pd {
118+
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
119+
drive-strength = <MTK_DRIVE_8mA>;
120+
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
121+
};
122+
};
123+
};
124+
125+
&spi0 {
126+
pinctrl-names = "default";
127+
pinctrl-0 = <&spi0_flash_pins>;
128+
status = "okay";
129+
130+
/* Winbond W25N01GVZEIG (128M) */
131+
spi_nand@0 {
132+
compatible = "spi-nand";
133+
reg = <0>;
134+
135+
spi-max-frequency = <52000000>;
136+
spi-tx-buswidth = <4>;
137+
spi-rx-buswidth = <4>;
138+
139+
mediatek,nmbm;
140+
mediatek,bmt-max-ratio = <1>;
141+
mediatek,bmt-max-reserved-blocks = <64>;
142+
143+
partitions {
144+
compatible = "fixed-partitions";
145+
#address-cells = <1>;
146+
#size-cells = <1>;
147+
148+
/* bl2 */
149+
partition@0 {
150+
label = "preloader";
151+
reg = <0x0 0x80000>;
152+
read-only;
153+
};
154+
155+
/* fip */
156+
partition@80000 {
157+
label = "u-boot";
158+
reg = <0x80000 0x200000>;
159+
read-only;
160+
};
161+
162+
partition@280000 {
163+
label = "u-config";
164+
reg = <0x280000 0x80000>;
165+
read-only;
166+
};
167+
168+
partition@300000 {
169+
label = "rf-eeprom";
170+
reg = <0x300000 0x200000>;
171+
read-only;
172+
173+
nvmem-layout {
174+
compatible = "fixed-layout";
175+
#address-cells = <1>;
176+
#size-cells = <1>;
177+
178+
eeprom_factory_0: eeprom@0 {
179+
reg = <0x0 0x1000>;
180+
};
181+
182+
macaddr_factory_a: macaddr@a {
183+
reg = <0xa 0x6>;
184+
};
185+
};
186+
};
187+
188+
firmware1: partition@500000 {
189+
label = "firmware_1";
190+
reg = <0x500000 0x3500000>;
191+
};
192+
193+
partition@3a00000 {
194+
label = "config_1";
195+
reg = <0x3a00000 0x80000>;
196+
read-only;
197+
};
198+
199+
partition@3a80000 {
200+
label = "dump";
201+
reg = <0x3a80000 0x80000>;
202+
read-only;
203+
};
204+
205+
partition@3c00000 {
206+
label = "u-state";
207+
reg = <0x3c00000 0x20000>;
208+
read-only;
209+
};
210+
211+
partition@3e80000 {
212+
label = "u-config_res";
213+
reg = <0x3e80000 0x80000>;
214+
read-only;
215+
};
216+
217+
partition@3f00000 {
218+
label = "rf-eeprom_res";
219+
reg = <0x3f00000 0x200000>;
220+
read-only;
221+
};
222+
223+
firmware2: partition@4100000 {
224+
label = "firmware_2";
225+
reg = <0x4140000 0x3500000>;
226+
};
227+
228+
partition@7600000 {
229+
label = "config_2";
230+
reg = <0x7600000 0x80000>;
231+
read-only;
232+
};
233+
};
234+
};
235+
};
236+
237+
&wifi {
238+
nvmem-cell-names = "eeprom";
239+
nvmem-cells = <&eeprom_factory_0>;
240+
status = "okay";
241+
};
242+
243+
&sgmiisys0 {
244+
/delete-node/ mediatek,pnswap;
245+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
3+
#include "mt7981b-keenetic-kap-630.dtsi"
4+
5+
/ {
6+
model = "Netcraze NAP-630";
7+
compatible = "netcraze,nap-630", "mediatek,mt7981";
8+
};

target/linux/mediatek/filogic/base-files/etc/board.d/02_network

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ mediatek_setup_interfaces()
110110
cudy,ap3000-v1|\
111111
cudy,re3000-v1|\
112112
kebidumei,ax3000-u22|\
113+
keenetic,kap-630|\
114+
netcraze,nap-630|\
113115
netgear,eax17|\
114116
netgear,wax220|\
115117
openfi,6c|\

target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ case "$board" in
153153
jdcloud,re-cp-03)
154154
[ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress
155155
;;
156+
keenetic,kap-630|\
156157
keenetic,kn-3711|\
157158
keenetic,kn-3811|\
158-
keenetic,kn-3911)
159+
keenetic,kn-3911|\
160+
netcraze,nap-630)
159161
[ "$PHYNBR" = "1" ] && \
160162
macaddr_setbit_la "$(mtd_get_mac_binary rf-eeprom 0x4)" > /sys${DEVPATH}/macaddress
161163
;;

target/linux/mediatek/image/filogic.mk

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,32 @@ define Device/kebidumei_ax3000-u22
17851785
endef
17861786
TARGET_DEVICES += kebidumei_ax3000-u22
17871787

1788+
define Device/keenetic_kap-630-common
1789+
DEVICE_DTS_DIR := ../dts
1790+
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware \
1791+
kmod-phy-airoha-en8811h
1792+
UBINIZE_OPTS := -E 5
1793+
BLOCKSIZE := 128k
1794+
PAGESIZE := 2048
1795+
KERNEL_SIZE := 6144k
1796+
IMAGE_SIZE := 108544k
1797+
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \
1798+
append-squashfs4-fakeroot
1799+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
1800+
IMAGES += factory.bin
1801+
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \
1802+
append-ubi | check-size | zyimage -d $$(ZYIMAGE_ID) -v "$$(DEVICE_MODEL)"
1803+
endef
1804+
1805+
define Device/keenetic_kap-630
1806+
DEVICE_VENDOR := Keenetic
1807+
DEVICE_MODEL := KAP-630
1808+
DEVICE_DTS := mt7981b-keenetic-kap-630
1809+
ZYIMAGE_ID := 0x810630
1810+
$(call Device/keenetic_kap-630-common)
1811+
endef
1812+
TARGET_DEVICES += keenetic_kap-630
1813+
17881814
define Device/keenetic_kn-1812-common
17891815
DEVICE_DTS_DIR := ../dts
17901816
DEVICE_PACKAGES := kmod-mt7992-firmware kmod-usb3 \
@@ -2228,6 +2254,15 @@ define Device/netcore_n60-pro
22282254
endef
22292255
TARGET_DEVICES += netcore_n60-pro
22302256

2257+
define Device/netcraze_nap-630
2258+
DEVICE_VENDOR := Netcraze
2259+
DEVICE_MODEL := NAP-630
2260+
DEVICE_DTS := mt7981b-netcraze-nap-630
2261+
ZYIMAGE_ID := 0xC10630
2262+
$(call Device/keenetic_kap-630-common)
2263+
endef
2264+
TARGET_DEVICES += netcraze_nap-630
2265+
22312266
define Device/netcraze_nc-1812
22322267
DEVICE_VENDOR := Netcraze
22332268
DEVICE_MODEL := NC-1812

0 commit comments

Comments
 (0)