[OpenWrt-Devel] [PATCH] [ramips] HiWiFi HC5661 Support for Openwrt

田韵豪 tianyh2000 at 163.com
Sat Apr 18 07:39:56 EDT 2015


HiWiFi HC5661 (Ji 1s) support.

Signed-off-by: B Tian < tianyh2000 at 163.com>
---

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 56ba3b7..292859d 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -237,6 +237,11 @@ case $board in
set_usb_led "lenovo:blue:usb"
set_wifi_led "lenovo:blue:wifi"
;;
+ hc5661)
+  ucidef_set_led_default "power" "power" "hiwifi:blue:power" "1"
+  set_wifi_led "hiwifi:blue:wifi"
+  ucidef_set_led_interface "br-lan" "hiwifi:blue:network"
+  ;;
zte-q7)
set_wifi_led "zte:blue:status"
;;
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 24e1ba8..505f7d9 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -229,6 +229,14 @@ ramips_setup_interfaces()
ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5 6t"
ucidef_add_switch_vlan "switch0" "2" "0 6t"
;;
+
+ hc5661)
+  ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+  ucidef_add_switch "switch0" "1" "1"
+  ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
+  ucidef_add_switch_vlan "switch0" "2" "0 6t"
+  ;;
+
d105 | \
na930 | \
omni-emb-hpm|\
@@ -310,6 +318,7 @@ ramips_setup_macs()
dir-320-b1 | \
psr-680w |\
sl-r7205 |\
+ hc5661 |\
y1 |\
y1s)
lan_mac=$(cat /sys/class/net/eth0/address)
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 5301593..02b3ee0 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -224,6 +224,9 @@ get_status_led() {
y1s)
status_led="lenovo:blue:power"
;;
+ hc5661)
+  status_led="hiwifi:blue:power"
+  ;;
zte-q7)
status_led="zte:red:status"
;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 616f4a1..8311a5f 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -391,6 +391,9 @@ ramips_board_detect() {
*"Lenovo Y1S")
name="y1s"
;;
+ *"HiWiFi HC5661")
+  name="hc5661"
+  ;;
*"Mediatek MT7621 evaluation board")
name="mt7621"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 17b456b..a913c41 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -115,6 +115,7 @@ platform_check_image() {
xiaomi-miwifi-mini |\
y1 |\
y1s |\
+ hc5661 |\
zte-q7 |\
zbt-wa05)
[ "$magic" != "27051956" ] && {
diff --git a/target/linux/ramips/dts/HC5661.dts b/target/linux/ramips/dts/HC5661.dts
new file mode 100644
index 0000000..873b83c
--- /dev/null
+++ b/target/linux/ramips/dts/HC5661.dts
@@ -0,0 +1,137 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+ compatible = "hiwifi,HC5661", "ralink,mt7620a-soc";
+ model = "HiWiFi HC5661";
+
+ chosen {
+  bootargs = "console=ttyS0,115200";
+ };
+
+ palmbus at 10000000 {
+  sysc at 0 {
+   ralink,gpiomux = "i2c", "jtag";
+   ralink,uartmux = "gpio";
+   ralink,wdtmux = <1>;
+  };
+
+  gpio0: gpio at 600 {
+   status = "okay";
+  };
+
+  gpio2: gpio at 660 {
+   status = "okay";
+  };
+
+  gpio3: gpio at 688 {
+   status = "okay";
+  };
+
+
+  spi at b00 {
+   status = "okay";
+
+   m25p80 at 0 {
+    #address-cells = <1>;
+    #size-cells = <1>;
+    compatible = "w25q128";
+    reg = <0 0>;
+    linux,modalias = "m25p80", "w25q128";
+    spi-max-frequency = <10000000>;
+
+    partition at 0 {
+     label = "u-boot";
+     reg = <0x0 0x30000>;
+     read-only;
+    };
+
+    partition at 30000 {
+     label = "u-boot-env";
+     reg = <0x30000 0x10000>;
+     read-only;
+    };
+
+    factory: partition at 40000 {
+     label = "factory";
+     reg = <0x40000 0x10000>;
+     read-only;
+    };
+
+    partition at 50000 {
+     label = "firmware";
+     reg = <0x50000 0xfb0000>;
+    };
+   };
+  };
+ };
+
+ ehci at 101c0000 {
+  status = "okay";
+ };
+
+ ohci at 101c1000 {
+  status = "okay";
+ };
+
+ sdhci at 10130000 {
+  status = "okay";
+ };
+
+ pcie at 10140000 {
+  status = "okay";
+ };
+
+ wmac at 10180000 {
+  ralink,mtd-eeprom = <&factory 0>;
+ };
+
+ ethernet at 10100000 {
+  pinctrl-names = "default";
+  pinctrl-0 = <&ephy_pins>;
+  mtd-mac-address = <&factory 0x4>;
+  ralink,port-map = "wllll";
+ };
+
+ pinctrl {
+  state_default: pinctrl0 {
+   gpio {
+    ralink,group = "uartf", "wled", "nd_sd";
+    ralink,function = "gpio";
+   };
+   pa {
+    ralink,group = "pa";
+    ralink,function = "pa";
+   };
+  };
+ };
+
+ gpio-keys-polled {
+  compatible = "gpio-keys-polled";
+  #address-cells = <1>;
+  #size-cells = <0>;
+  poll-interval = <20>;
+  reset {
+   label = "reset";
+   gpios = <&gpio0 12 1>;
+   linux,code = <0x198>;
+  };
+ };
+
+ gpio-leds {
+  compatible = "gpio-leds";
+  power1 {
+   label = "hiwifi:blue:power";
+   gpios = <&gpio0 9 1>;
+  };
+  wlan1 {
+   label = "hiwifi:blue:wifi";
+   gpios = <&gpio3 0 1>;
+  };
+  internet {
+   label = "hiwifi:blue:network";
+   gpios = <&gpio0 11 1>;
+  };
+ };
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index e6b5112..b537dd4 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -853,6 +853,7 @@ na930_mtd_size=20971520
Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP)
Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),Lenovo-y1,Y1)
+Image/Build/Profile/HC5661=$(call BuildFirmware/Default16M/$(1),$(1),HiWiFi-hc5661,HC5661)
Image/Build/Profile/Y1S=$(call BuildFirmware/Default16M/$(1),$(1),Lenovo-y1s,Y1S)
Image/Build/Profile/MLW221=$(call BuildFirmware/Default16M/$(1),$(1),mlw221,MLW221)
Image/Build/Profile/MLWG2=$(call BuildFirmware/Default16M/$(1),$(1),mlwg2,MLWG2)
@@ -885,6 +886,7 @@ define Image/Build/Profile/Default
$(call Image/Build/Profile/MZK-750DHP,$(1))
$(call Image/Build/Profile/NA930,$(1))
$(call Image/Build/Profile/Y1,$(1))
+ $(call Image/Build/Profile/HC5661,$(1))
$(call Image/Build/Profile/Y1S,$(1))
$(call Image/Build/Profile/MLW221,$(1))
$(call Image/Build/Profile/MLWG2,$(1))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150418/082348b3/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list