add hiker_x9 support

This commit is contained in:
2026-02-12 18:13:56 +08:00
parent cba4212050
commit 957dd9862b
11 changed files with 773 additions and 0 deletions

View File

@@ -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";
};

View File

@@ -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";
};

View File

@@ -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";
};

View File

@@ -0,0 +1,176 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "rt5350.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
aliases {
led-boot = &led_r;
led-failsafe = &led_r;
led-running = &led_b;
led-upgrade = &led_r;
label-mac-device = &ethernet;
};
/*
* 内存自动检测
* U-Boot 会检测实际内存大小并传递给内核
* 省略 memory 节点,让 bootloader 自动配置
*/
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
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 = <LED_COLOR_ID_RED>;
gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
};
led_b: led_b {
label = "blue:led_b";
function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_BLUE>;
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";
};
};
&ethernet {
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";
};