diff --git a/files-overlay/hiker_x9/full/etc/banner b/files-overlay/hiker_x9/full/etc/banner new file mode 100644 index 0000000..d2c2f30 --- /dev/null +++ b/files-overlay/hiker_x9/full/etc/banner @@ -0,0 +1,21 @@ + _ _ _ _ _____ _ _ +| | | (_) | | __ \ (_) | | +| |__| |_| | _____ _ __ | |__) | __ _ _ __ | |_ +| __ | | |/ / _ \ '__| | ___/ '__| | '_ \| __| +| | | | | < __/ | | | | | | | | | | |_ +|_| |_|_|_|\_\___|_| |_| |_| |_|_| |_|\__| + ================================================ + Hiker WiFi v0.5 - 全功能无线 ⭐ + ================================================ + OpenWrt 24.10 | Linux 6.6 + 架构: ramips/rt305x + ------------------------------------------------ + 功能: LuCI 中文 + WiFi AP + USB 打印 + HTTPS + 性能: CPU 83% idle, 内存 ~14MB ✅ + 适用: 全功能无线路由器 (推荐) + ------------------------------------------------ + 主机名: Hiker-WiFi + Web 界面: http://192.168.100.1 / https://192.168.100.1 + WiFi SSID: Hiker-WiFi (默认无密码) + ================================================ + diff --git a/files-overlay/hiker_x9/full/etc/rc.button/reset b/files-overlay/hiker_x9/full/etc/rc.button/reset new file mode 100644 index 0000000..df4e3b7 --- /dev/null +++ b/files-overlay/hiker_x9/full/etc/rc.button/reset @@ -0,0 +1,167 @@ +#!/bin/sh +# Hiker Print - Reset Button Handler with LED feedback +# 按住2秒:开始红蓝交替闪,松开红蓝长亮2秒,重启 +# 按住超过5秒:开始红蓝同时闪,松开红蓝长亮2秒,恢复出厂设置 + +. /lib/functions.sh + +LED_R="/sys/class/leds/hiker:red:led_r/brightness" +LED_R_TRIGGER="/sys/class/leds/hiker:red:led_r/trigger" +LED_B="/sys/class/leds/hiker:blue:led_b/brightness" +LED_B_TRIGGER="/sys/class/leds/hiker:blue:led_b/trigger" +PIDFILE="/var/run/reset_button_led.pid" + +# Function to check if LED script is running +stop_led_script() { + if [ -f "$PIDFILE" ]; then + local pid=$(cat "$PIDFILE") + if [ -d "/proc/$pid" ]; then + kill "$pid" 2>/dev/null + fi + rm -f "$PIDFILE" + fi + rm -f /tmp/stop_led_blink +} + +# Function to turn off both LEDs +turn_off_leds() { + echo "none" > "$LED_R_TRIGGER" 2>/dev/null + echo "none" > "$LED_B_TRIGGER" 2>/dev/null + echo 0 > "$LED_R" 2>/dev/null + echo 0 > "$LED_B" 2>/dev/null +} + +# Function to turn on both LEDs +turn_on_leds() { + echo "none" > "$LED_R_TRIGGER" 2>/dev/null + echo "none" > "$LED_B_TRIGGER" 2>/dev/null + echo 1 > "$LED_R" 2>/dev/null + echo 1 > "$LED_B" 2>/dev/null +} + +# Function to alternate red and blue LEDs (for reboot: 2-5s) +led_alternate_blink_loop() { + local period=$1 # Blink period in seconds + + echo "none" > "$LED_R_TRIGGER" 2>/dev/null + echo "none" > "$LED_B_TRIGGER" 2>/dev/null + + local start_time=$(date +%s) + + while [ ! -f /tmp/stop_led_blink ]; do + local now=$(date +%s) + local elapsed=$((now - start_time)) + + # Only start blinking after 2 seconds + if [ $elapsed -lt 2 ]; then + sleep 1 + continue + fi + + # Blue: on, Red: off + echo 1 > "$LED_B" 2>/dev/null + echo 0 > "$LED_R" 2>/dev/null + sleep "$period" + + # Blue: off + echo 0 > "$LED_B" 2>/dev/null + + # Red: on (instant switch) + echo 1 > "$LED_R" 2>/dev/null + sleep "$period" + + # Red: off + echo 0 > "$LED_R" 2>/dev/null + # Blue: on (instant switch, next iteration) + done + + turn_off_leds + rm -f /tmp/stop_led_blink +} + +# Function to blink both LEDs together (for factory reset: 5s+) +led_both_blink_loop() { + local period=$1 # Blink period in seconds + + echo "none" > "$LED_R_TRIGGER" 2>/dev/null + echo "none" > "$LED_B_TRIGGER" 2>/dev/null + + local start_time=$(date +%s) + + while [ ! -f /tmp/stop_led_blink ]; do + local now=$(date +%s) + local elapsed=$((now - start_time)) + + # Only start blinking after 2 seconds + if [ $elapsed -lt 2 ]; then + sleep 1 + continue + fi + + # Check if we've passed 5 seconds - switch from alternate to both blink + if [ $elapsed -lt 5 ]; then + # Still in reboot zone (2-5s): alternate + echo 1 > "$LED_B" 2>/dev/null + echo 0 > "$LED_R" 2>/dev/null + sleep "$period" + echo 0 > "$LED_B" 2>/dev/null + echo 1 > "$LED_R" 2>/dev/null + sleep "$period" + echo 0 > "$LED_R" 2>/dev/null + else + # Factory reset zone (5s+): both blink together + turn_on_leds + sleep "$period" + turn_off_leds + sleep "$period" + fi + done + + turn_off_leds + rm -f /tmp/stop_led_blink +} + +case "${ACTION}" in + pressed) + # Button pressed - wait 2 seconds then start LED feedback loop + stop_led_script + + # Start background LED blink process (alternates 2-5s, both blink 5s+) + rm -f /tmp/stop_led_blink + led_both_blink_loop 1 & + echo $! > "$PIDFILE" + ;; + released) + # Button released - stop LED and execute action + stop_led_script + # Wait for LED to turn off (no sleep - busybox doesn't support decimals) + + logger "$BUTTON pressed for $SEEN seconds" + + if [ "$SEEN" -lt 2 ] + then + # <2秒: 无操作 + echo "No action (<2s)" > /dev/console + turn_off_leds + exit 0 + elif [ "$SEEN" -ge 2 ] && [ "$SEEN" -lt 5 ] + then + # 2-5秒: 红蓝长亮2秒,然后重启 + echo "REBOOT (${SEEN}s pressed)" > /dev/console + turn_on_leds + sleep 2 + sync + reboot + elif [ "$SEEN" -ge 5 ] + then + # >=5秒: 红蓝长亮2秒,然后恢复出厂设置 + echo "FACTORY RESET (${SEEN}s pressed)" > /dev/console + turn_on_leds + sleep 2 + jffs2reset -y && reboot & + fi + ;; +esac + +return 0 + diff --git a/files-overlay/hiker_x9/full/etc/uci-defaults/99-custom-network b/files-overlay/hiker_x9/full/etc/uci-defaults/99-custom-network new file mode 100644 index 0000000..0ee0f84 --- /dev/null +++ b/files-overlay/hiker_x9/full/etc/uci-defaults/99-custom-network @@ -0,0 +1,71 @@ +#!/bin/sh +# Hiker Full-WiFi network configuration +# Execute on first boot + +uci delete network.lan 2>/dev/null + +uci set network.LanBackup=interface +uci set network.LanBackup.proto=static +uci set network.LanBackup.device=br-lan +uci set network.LanBackup.ipaddr=192.168.100.1 +uci set network.LanBackup.netmask=255.255.255.0 + +uci set network.LanPrint=interface +uci set network.LanPrint.proto=dhcp +uci set network.LanPrint.device=br-lan + +idx=0 +lan_zone_idx="" +wan_zone_idx="" + +while uci get firewall.@zone[$idx] >/dev/null 2>&1; do + zone_name=$(uci get firewall.@zone[$idx].name 2>/dev/null) + if [ "$zone_name" = "lan" ] || [ "$zone_name" = "LAN" ]; then + lan_zone_idx=$idx + fi + if [ "$zone_name" = "wan" ] || [ "$zone_name" = "WAN" ]; then + wan_zone_idx=$idx + fi + idx=$((idx + 1)) +done + +if [ -n "$lan_zone_idx" ]; then + uci del firewall.@zone[$lan_zone_idx].network 2>/dev/null + uci add_list firewall.@zone[$lan_zone_idx].network=LanBackup 2>/dev/null + uci add_list firewall.@zone[$lan_zone_idx].network=LanPrint 2>/dev/null +fi + +if [ -f /etc/config/wireless ]; then + uci set wireless.radio0.cell_density=0 2>/dev/null + uci set wireless.radio0.disabled=0 2>/dev/null + uci set wireless.default_radio0.ssid=HikerPrint 2>/dev/null + uci set wireless.default_radio0.encryption=none 2>/dev/null + uci set wireless.default_radio0.network="LanBackup LanPrint" 2>/dev/null +fi + +uci set system.@system[0].hostname=HikerWifi 2>/dev/null +uci set system.@system[0].zonename=Asia/Shanghai 2>/dev/null +uci set system.@system[0].timezone=CST-8 2>/dev/null + +if [ -f /etc/config/p910nd ]; then + uci set p910nd.@p910nd[0].enabled=1 2>/dev/null + uci commit p910nd 2>/dev/null +fi + +led_exists=$(uci show system 2>/dev/null | grep "\.name='led_r'" | cut -d'=' -f1 | cut -d'.' -f1-2 | head -1) +if [ -z "$led_exists" ]; then + uci add system led >/dev/null 2>&1 + uci set system.@led[-1].name=led_r 2>/dev/null + uci set system.@led[-1].sysfs=red:led_r 2>/dev/null + uci set system.@led[-1].trigger=netdev 2>/dev/null + uci set system.@led[-1].dev=br-lan 2>/dev/null + uci add_list system.@led[-1].mode=tx 2>/dev/null + uci add_list system.@led[-1].mode=rx 2>/dev/null +fi + +uci commit network 2>/dev/null +uci commit firewall 2>/dev/null +uci commit wireless 2>/dev/null +uci commit system 2>/dev/null + +exit 0 diff --git a/files-overlay/hiker_x9/print/etc/banner b/files-overlay/hiker_x9/print/etc/banner new file mode 100644 index 0000000..6faf2d4 --- /dev/null +++ b/files-overlay/hiker_x9/print/etc/banner @@ -0,0 +1,21 @@ + _ _ _ _ _____ _ _ +| | | (_) | | __ \ (_) | | +| |__| |_| | _____ _ __ | |__) | __ _ _ __ | |_ +| __ | | |/ / _ \ '__| | ___/ '__| | '_ \| __| +| | | | | < __/ | | | | | | | | | | |_ +|_| |_|_|_|\_\___|_| |_| |_| |_|_| |_|\__| + ================================================ + Hiker Print v0.4 - 打印服务器 ⭐ + ================================================ + OpenWrt 24.10 | Linux 6.6 + 架构: ramips/rt305x + ------------------------------------------------ + 功能: LuCI 中文 + P910ND + USB 打印 + HTTPS + 性能: CPU 83% idle, 内存 ~14MB ✅ + 适用: 网络打印服务器 (推荐) + ------------------------------------------------ + 版本信息: cat /etc/hiker-version + 主机名: Hiker-Print + Web 界面: http://192.168.100.1 / https://192.168.100.1 + 打印管理: 服务 > 打印服务器 + ================================================ diff --git a/files-overlay/hiker_x9/print/etc/rc.button/reset b/files-overlay/hiker_x9/print/etc/rc.button/reset new file mode 100644 index 0000000..df4e3b7 --- /dev/null +++ b/files-overlay/hiker_x9/print/etc/rc.button/reset @@ -0,0 +1,167 @@ +#!/bin/sh +# Hiker Print - Reset Button Handler with LED feedback +# 按住2秒:开始红蓝交替闪,松开红蓝长亮2秒,重启 +# 按住超过5秒:开始红蓝同时闪,松开红蓝长亮2秒,恢复出厂设置 + +. /lib/functions.sh + +LED_R="/sys/class/leds/hiker:red:led_r/brightness" +LED_R_TRIGGER="/sys/class/leds/hiker:red:led_r/trigger" +LED_B="/sys/class/leds/hiker:blue:led_b/brightness" +LED_B_TRIGGER="/sys/class/leds/hiker:blue:led_b/trigger" +PIDFILE="/var/run/reset_button_led.pid" + +# Function to check if LED script is running +stop_led_script() { + if [ -f "$PIDFILE" ]; then + local pid=$(cat "$PIDFILE") + if [ -d "/proc/$pid" ]; then + kill "$pid" 2>/dev/null + fi + rm -f "$PIDFILE" + fi + rm -f /tmp/stop_led_blink +} + +# Function to turn off both LEDs +turn_off_leds() { + echo "none" > "$LED_R_TRIGGER" 2>/dev/null + echo "none" > "$LED_B_TRIGGER" 2>/dev/null + echo 0 > "$LED_R" 2>/dev/null + echo 0 > "$LED_B" 2>/dev/null +} + +# Function to turn on both LEDs +turn_on_leds() { + echo "none" > "$LED_R_TRIGGER" 2>/dev/null + echo "none" > "$LED_B_TRIGGER" 2>/dev/null + echo 1 > "$LED_R" 2>/dev/null + echo 1 > "$LED_B" 2>/dev/null +} + +# Function to alternate red and blue LEDs (for reboot: 2-5s) +led_alternate_blink_loop() { + local period=$1 # Blink period in seconds + + echo "none" > "$LED_R_TRIGGER" 2>/dev/null + echo "none" > "$LED_B_TRIGGER" 2>/dev/null + + local start_time=$(date +%s) + + while [ ! -f /tmp/stop_led_blink ]; do + local now=$(date +%s) + local elapsed=$((now - start_time)) + + # Only start blinking after 2 seconds + if [ $elapsed -lt 2 ]; then + sleep 1 + continue + fi + + # Blue: on, Red: off + echo 1 > "$LED_B" 2>/dev/null + echo 0 > "$LED_R" 2>/dev/null + sleep "$period" + + # Blue: off + echo 0 > "$LED_B" 2>/dev/null + + # Red: on (instant switch) + echo 1 > "$LED_R" 2>/dev/null + sleep "$period" + + # Red: off + echo 0 > "$LED_R" 2>/dev/null + # Blue: on (instant switch, next iteration) + done + + turn_off_leds + rm -f /tmp/stop_led_blink +} + +# Function to blink both LEDs together (for factory reset: 5s+) +led_both_blink_loop() { + local period=$1 # Blink period in seconds + + echo "none" > "$LED_R_TRIGGER" 2>/dev/null + echo "none" > "$LED_B_TRIGGER" 2>/dev/null + + local start_time=$(date +%s) + + while [ ! -f /tmp/stop_led_blink ]; do + local now=$(date +%s) + local elapsed=$((now - start_time)) + + # Only start blinking after 2 seconds + if [ $elapsed -lt 2 ]; then + sleep 1 + continue + fi + + # Check if we've passed 5 seconds - switch from alternate to both blink + if [ $elapsed -lt 5 ]; then + # Still in reboot zone (2-5s): alternate + echo 1 > "$LED_B" 2>/dev/null + echo 0 > "$LED_R" 2>/dev/null + sleep "$period" + echo 0 > "$LED_B" 2>/dev/null + echo 1 > "$LED_R" 2>/dev/null + sleep "$period" + echo 0 > "$LED_R" 2>/dev/null + else + # Factory reset zone (5s+): both blink together + turn_on_leds + sleep "$period" + turn_off_leds + sleep "$period" + fi + done + + turn_off_leds + rm -f /tmp/stop_led_blink +} + +case "${ACTION}" in + pressed) + # Button pressed - wait 2 seconds then start LED feedback loop + stop_led_script + + # Start background LED blink process (alternates 2-5s, both blink 5s+) + rm -f /tmp/stop_led_blink + led_both_blink_loop 1 & + echo $! > "$PIDFILE" + ;; + released) + # Button released - stop LED and execute action + stop_led_script + # Wait for LED to turn off (no sleep - busybox doesn't support decimals) + + logger "$BUTTON pressed for $SEEN seconds" + + if [ "$SEEN" -lt 2 ] + then + # <2秒: 无操作 + echo "No action (<2s)" > /dev/console + turn_off_leds + exit 0 + elif [ "$SEEN" -ge 2 ] && [ "$SEEN" -lt 5 ] + then + # 2-5秒: 红蓝长亮2秒,然后重启 + echo "REBOOT (${SEEN}s pressed)" > /dev/console + turn_on_leds + sleep 2 + sync + reboot + elif [ "$SEEN" -ge 5 ] + then + # >=5秒: 红蓝长亮2秒,然后恢复出厂设置 + echo "FACTORY RESET (${SEEN}s pressed)" > /dev/console + turn_on_leds + sleep 2 + jffs2reset -y && reboot & + fi + ;; +esac + +return 0 + diff --git a/files-overlay/hiker_x9/print/etc/uci-defaults/99-custom-network b/files-overlay/hiker_x9/print/etc/uci-defaults/99-custom-network new file mode 100644 index 0000000..1eb2831 --- /dev/null +++ b/files-overlay/hiker_x9/print/etc/uci-defaults/99-custom-network @@ -0,0 +1,68 @@ +#!/bin/sh +# Hiker P910ND network configuration +# Execute on first boot + +uci delete network.lan 2>/dev/null + +uci set network.LanBackup=interface +uci set network.LanBackup.proto=static +uci set network.LanBackup.device=br-lan +uci set network.LanBackup.ipaddr=192.168.100.1 +uci set network.LanBackup.netmask=255.255.255.0 + +uci set network.LanPrint=interface +uci set network.LanPrint.proto=dhcp +uci set network.LanPrint.device=br-lan + +idx=0 +lan_zone_idx="" +wan_zone_idx="" + +while uci get firewall.@zone[$idx] >/dev/null 2>&1; do + zone_name=$(uci get firewall.@zone[$idx].name 2>/dev/null) + if [ "$zone_name" = "lan" ] || [ "$zone_name" = "LAN" ]; then + lan_zone_idx=$idx + fi + if [ "$zone_name" = "wan" ] || [ "$zone_name" = "WAN" ]; then + wan_zone_idx=$idx + fi + idx=$((idx + 1)) +done + +if [ -n "$lan_zone_idx" ]; then + uci del firewall.@zone[$lan_zone_idx].network 2>/dev/null + uci add_list firewall.@zone[$lan_zone_idx].network=LanBackup 2>/dev/null + uci add_list firewall.@zone[$lan_zone_idx].network=LanPrint 2>/dev/null +fi + +if [ -n "$wan_zone_idx" ]; then + uci del firewall.@zone[$wan_zone_idx].network 2>/dev/null + uci add_list firewall.@zone[$wan_zone_idx].network=wan 2>/dev/null + uci add_list firewall.@zone[$wan_zone_idx].network=wan6 2>/dev/null +fi + +uci set system.@system[0].hostname=HikerPrint 2>/dev/null +uci set system.@system[0].zonename=Asia/Shanghai 2>/dev/null +uci set system.@system[0].timezone=CST-8 2>/dev/null + +if [ -f /etc/config/p910nd ]; then + uci set p910nd.@p910nd[0].enabled=1 2>/dev/null + uci commit p910nd 2>/dev/null +fi + +led_exists=$(uci show system 2>/dev/null | grep "\.name='led_r'" | cut -d'=' -f1 | cut -d'.' -f1-2 | head -1) +if [ -z "$led_exists" ]; then + uci add system led >/dev/null 2>&1 + uci set system.@led[-1].name=led_r 2>/dev/null + uci set system.@led[-1].sysfs=red:led_r 2>/dev/null + uci set system.@led[-1].trigger=netdev 2>/dev/null + uci set system.@led[-1].dev=br-lan 2>/dev/null + uci add_list system.@led[-1].mode=tx 2>/dev/null + uci add_list system.@led[-1].mode=rx 2>/dev/null +fi + +uci commit network 2>/dev/null +uci commit firewall 2>/dev/null +uci commit system 2>/dev/null + +exit 0 diff --git a/target/linux/ramips/dts/rt5350_hiker_x9-full-wifi.dts b/target/linux/ramips/dts/rt5350_hiker_x9-full-wifi.dts new file mode 100644 index 0000000..d63d990 --- /dev/null +++ b/target/linux/ramips/dts/rt5350_hiker_x9-full-wifi.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rt5350_hiker_x9.dtsi" + +/* + * 全功能 Wi-Fi 版本,只调整型号与兼容性,复用基础硬件定义。 + */ +/ { + compatible = "hiker,x9-full", "hiker,x9", "ralink,rt5350-soc"; + model = "Hiker X9 Full"; +}; + diff --git a/target/linux/ramips/dts/rt5350_hiker_x9-minimal.dts b/target/linux/ramips/dts/rt5350_hiker_x9-minimal.dts new file mode 100644 index 0000000..ece9c21 --- /dev/null +++ b/target/linux/ramips/dts/rt5350_hiker_x9-minimal.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rt5350_hiker_x9.dtsi" + +/* + * 仅覆写型号与兼容性字符串,其余硬件定义继承自基础 hiker_x9.dtsi。 + */ +/ { + compatible = "hiker,x9-minimal", "hiker,x9", "ralink,rt5350-soc"; + model = "Hiker X9 Minimal"; +}; + diff --git a/target/linux/ramips/dts/rt5350_hiker_x9-p910nd.dts b/target/linux/ramips/dts/rt5350_hiker_x9-p910nd.dts new file mode 100644 index 0000000..69b006c --- /dev/null +++ b/target/linux/ramips/dts/rt5350_hiker_x9-p910nd.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rt5350_hiker_x9.dtsi" + +/* + * P910ND 打印服务器版本,仅定义自身兼容 ID,硬件细节复用基础 hiker_x9.dtsi。 + */ +/ { + compatible = "hiker,x9-print", "hiker,x9", "ralink,rt5350-soc"; + model = "Hiker X9 Print"; +}; + diff --git a/target/linux/ramips/dts/rt5350_hiker_x9.dtsi b/target/linux/ramips/dts/rt5350_hiker_x9.dtsi new file mode 100644 index 0000000..d10aa05 --- /dev/null +++ b/target/linux/ramips/dts/rt5350_hiker_x9.dtsi @@ -0,0 +1,176 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rt5350.dtsi" + +#include +#include +#include + +/ { + aliases { + led-boot = &led_r; + led-failsafe = &led_r; + led-running = &led_b; + led-upgrade = &led_r; + label-mac-device = ðernet; + }; + + /* + * 内存自动检测 + * U-Boot 会检测实际内存大小并传递给内核 + * 省略 memory 节点,让 bootloader 自动配置 + */ + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + /* 三档切换开关 - 位置编码 */ + mode_switch_usb { + gpio-export,name = "mode_usb"; + gpio-export,input = <0>; + gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; + }; + + mode_switch_wan { + gpio-export,name = "mode_wan"; + gpio-export,input = <0>; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; + + mode_switch_3g { + gpio-export,name = "mode_3g"; + gpio-export,input = <0>; + gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; + }; + + root_hub { + gpio-export,name = "root_hub"; + gpio-export,output = <1>; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + /* + * 前面板可控 LED: + * - 红灯:系统状态指示 + * - 蓝灯:电源 / 运行指示 + * 另有一个硬件自管理的 Wi-Fi 指示灯,无需在 DTS 中定义。 + */ + + led_r: led_r { + label = "red:led_r"; + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; + }; + + led_b: led_b { + label = "blue:led_b"; + function = LED_FUNCTION_POWER; + color = ; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + }; + }; + +}; + + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "jtag", "uartf"; + function = "gpio"; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_4 0>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x2f>; +}; + +&wmac { + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + diff --git a/target/linux/ramips/image/hiker.mk b/target/linux/ramips/image/hiker.mk new file mode 100644 index 0000000..464784c --- /dev/null +++ b/target/linux/ramips/image/hiker.mk @@ -0,0 +1,46 @@ +# Hiker RT5350 Device Profiles +# Include this file in target/linux/ramips/image/rt305x.mk + +# Common configuration for all Hiker profiles +define Device/hiker_hiker-common + SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Hiker +endef + +# Profile 1: Minimal (基础版) +define Device/hiker_x9-minimal + $(call Device/hiker_hiker-common) + DEVICE_MODEL := Hiker X9 Minimal + SUPPORTED_DEVICES := hiker,x9-minimal hiker,x9 HIKER + DEVICE_PACKAGES := luci-light luci-theme-bootstrap \ + luci-i18n-base-zh-cn +endef +TARGET_DEVICES += hiker_x9-minimal + +# Profile 2: P910ND (打印服务器) ⭐ 推荐 +define Device/hiker_x9-p910nd + $(call Device/hiker_hiker-common) + DEVICE_MODEL := Hiker X9 Print + SUPPORTED_DEVICES := hiker,x9-print hiker,x9 HIKER + DEVICE_PACKAGES := luci-light luci-theme-bootstrap \ + luci-i18n-base-zh-cn \ + p910nd luci-app-p910nd luci-i18n-p910nd-zh-cn \ + kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-printer +endef +TARGET_DEVICES += hiker_x9-p910nd + +# Profile 3: Full WiFi (打印+完整WiFi) +define Device/hiker_x9-full + $(call Device/hiker_hiker-common) + DEVICE_MODEL := Hiker X9 Full + SUPPORTED_DEVICES := hiker,x9-full hiker,x9 HIKER + DEVICE_PACKAGES := luci-light luci-theme-bootstrap \ + luci-i18n-base-zh-cn \ + p910nd luci-app-p910nd luci-i18n-p910nd-zh-cn \ + kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-printer \ + kmod-mac80211 kmod-rt2800-lib kmod-rt2800-mmio kmod-rt2800-soc \ + kmod-rt2x00-lib kmod-rt2x00-mmio \ + wpad-mbedtls iw iwinfo +endef +TARGET_DEVICES += hiker_x9-full