Skip to content

Commit

Permalink
ramips: add HT-JSH-0211 support
Browse files Browse the repository at this point in the history
Replace the boot loader to the breed of K2P.
  • Loading branch information
aiamadeus committed Jun 4, 2023
1 parent 29cf09f commit e56218b
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 1 deletion.
2 changes: 1 addition & 1 deletion target/linux/ramips/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ define Target/Description
endef

include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += kmod-leds-gpio kmod-gpio-button-hotplug
DEFAULT_PACKAGES += kmod-leds-gpio kmod-gpio-button-hotplug -procd-ujail

$(eval $(call BuildTarget))
105 changes: 105 additions & 0 deletions target/linux/ramips/dts/mt7621_ht-jsh_0211.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "mt7621.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
compatible = "ht-jsh,0211", "mediatek,mt7621-soc";
model = "HT-JSH-0211";

keys {
compatible = "gpio-keys";

reset {
label = "reset";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};

&spi0 {
status = "okay";

flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "Bootloader";
reg = <0x0 0x30000>;
read-only;
};

partition@30000 {
label = "Config";
reg = <0x30000 0x10000>;
read-only;
};

factory: partition@40000 {
label = "Factory";
reg = <0x40000 0x10000>;
read-only;
};

partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0xfb0000>;
};
};
};
};

&pcie {
status = "okay";
};

&pcie0 {
mt76@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0>;
};
};

&gmac0 {
mtd-mac-address = <&factory 0xe000>;
};

&gmac1 {
mtd-mac-address = <&factory 0xe006>;
status = "okay";
};

&gsw {
mediatek,portmap = "wllll";
status = "okay";
};

&hnat {
mtketh-wan = "eth1";
mtketh-ppd = "eth0";
mtketh-lan = "eth0";
mtketh-max-gmac = <2>;
/delete-property/ mtkdsa-wan-port;
};

&switch0 {
status = "disabled";
};

&state_default {
gpio {
groups = "i2c";
function = "gpio";
};
};
9 changes: 9 additions & 0 deletions target/linux/ramips/image/mt7621.mk
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,15 @@ define Device/hiwifi_hc5962
endef
TARGET_DEVICES += hiwifi_hc5962

define Device/ht-jsh_0211
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := HT-JSH
DEVICE_MODEL := 0211
DEVICE_PACKAGES := kmod-mt7603
endef
TARGET_DEVICES += ht-jsh_0211

define Device/iodata_wn-ax1167gr
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
Expand Down
4 changes: 4 additions & 0 deletions target/linux/ramips/mt7621/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ ramips_setup_interfaces()
hatlab,gateboard-one)
ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3 eth4" "eth5"
;;
ht-jsh,0211)
ucidef_add_switch "switch0" \
"0:wan" "2:lan" "3:lan" "6u@eth0" "5u@eth1"
;;
linksys,re6500|\
netgear,wac104)
ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
Expand Down

0 comments on commit e56218b

Please sign in to comment.