[OpenWrt-Devel] [PATCH][ramips]Add support for Aigale Ai-BR100

郭传鈜 gch981213 at gmail.com
Wed Jul 2 22:26:18 EDT 2014


Ai-BR100 is a router with mt7620a chip.Maybe it's only sold in China.
There are only 2 lights on the board (WAN and WLAN) so I used the wlan
light as the status led.
USB is not working normally (only usb2.0 devices can be recognized when I
select kmod-usb2 and kmod-usb-ohci) I don't know if it is caused by my dts
file:-(

Signed-off-by: Chuanhong Guo <gch981213 at gmail.com>


diff -ruN a/target/linux/ramips/base-files/etc/diag.sh
b/target/linux/ramips/base-files/etc/diag.sh
--- a/target/linux/ramips/base-files/etc/diag.sh 2014-07-02
23:06:16.196364942 +0800
+++ b/target/linux/ramips/base-files/etc/diag.sh 2014-07-02
17:50:24.925880926 +0800
@@ -179,6 +179,9 @@
  na930)
  status_led="na930:blue:power"
  ;;
+ ai-br100)
+ status_led="aigale:blue:wlan"
+ ;;
  esac
 }

diff -ruN
a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
--- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
2014-07-02
23:06:16.197364943 +0800
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
2014-07-02
17:50:24.926880924 +0800
@@ -121,6 +121,7 @@
  wr512-3gn | \
  wr6202 | \
  wrtnode | \
+ ai-br100 | \
  mzk-w300nh2 | \
  ur-326n4g | \
  ur-336un | \
diff -ruN a/target/linux/ramips/base-files/etc/uci-defaults/01_leds
b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
--- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds 2014-07-02
23:06:16.197364943 +0800
+++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds 2014-07-02
17:50:24.926880924 +0800
@@ -153,6 +153,10 @@
  set_usb_led "alfa:blue:usb"
  set_wifi_led "rt2800pci-phy0::radio"
  ;;
+ ai-br100)
+ ucidef_set_led_netdev "wan" "wan" "aigale:blue:wan" "eth0.2"
+ set_wifi_led "aigale:blue:wlan"
+ ;;
  wcr-150gn)
  set_usb_led "wcr150gn:amber:user"
  ;;
diff -ruN a/target/linux/ramips/base-files/lib/ramips.sh
b/target/linux/ramips/base-files/lib/ramips.sh
--- a/target/linux/ramips/base-files/lib/ramips.sh 2014-07-02
23:06:16.198364946 +0800
+++ b/target/linux/ramips/base-files/lib/ramips.sh 2014-07-02
17:50:24.926880924 +0800
@@ -304,6 +304,9 @@
  *"Wansview NCS601W")
  name="ncs601w"
  ;;
+ *"Aigale Ai-BR100")
+ name="ai-br100"
+ ;;
  *"Sercomm NA930")
  name="na930"
  ;;
diff -ruN a/target/linux/ramips/base-files/lib/upgrade/platform.sh
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh 2014-07-02
23:06:16.199364951 +0800
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh 2014-07-02
17:50:24.927880922 +0800
@@ -90,6 +90,7 @@
  wr512-3gn |\
  wmr300 |\
  wrtnode |\
+ ai-br100 |\
  x5 |\
  x8)
  [ "$magic" != "27051956" ] && {
diff -ruN a/target/linux/ramips/dts/AIBR100.dts
b/target/linux/ramips/dts/AIBR100.dts
--- a/target/linux/ramips/dts/AIBR100.dts 1970-01-01 08:00:00.000000000
+0800
+++ b/target/linux/ramips/dts/AIBR100.dts 2014-07-02 17:47:58.887491883
+0800
@@ -0,0 +1,100 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+ compatible = "AIBR100", "ralink,mt7620a-soc";
+ model = "Aigale Ai-BR100";
+
+ palmbus at 10000000 {
+ 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 = "en25q64";
+ reg = <0 0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <10000000>;
+
+ partition at 0 {
+ label = "u-boot";
+ reg = <0x0 0x20000>;
+ read-only;
+ };
+
+ partition at 20000 {
+ label = "u-boot-env";
+ reg = <0x20000 0x10000>;
+ read-only;
+ };
+
+ factory: partition at 30000 {
+ label = "factory";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ partition at 40000 {
+ label = "firmware";
+ reg = <0x40000 0x7c0000>;
+ };
+ };
+ };
+ };
+
+ ehci at 101c0000 {
+ status = "okay";
+ };
+
+ ohci at 101c1000 {
+ status = "okay";
+ };
+
+ pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled",
"nd_sd";
+ ralink,function = "gpio";
+ };
+ };
+ };
+
+ ethernet at 10100000 {
+ mtd-mac-address = <&factory 0x4>;
+ ralink,port-map = "llllw";
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+ wan {
+ label = "aigale:blue:wan";
+ gpios = <&gpio2 4 1>;
+ };
+ wlan {
+ label = "aigale:blue:wlan";
+ gpios = <&gpio3 0 1>;
+ };
+ };
+
+ 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>;
+ };
+ };
+};
diff -ruN a/target/linux/ramips/image/Makefile
b/target/linux/ramips/image/Makefile
--- a/target/linux/ramips/image/Makefile 2014-07-02 23:06:16.214364992 +0800
+++ b/target/linux/ramips/image/Makefile 2014-07-02 17:50:24.928880926 +0800
@@ -714,6 +714,8 @@
 Image/Build/Profile/DIR-810L=$(call
BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
 na930_mtd_size=20971520
 Image/Build/Profile/NA930=$(call
BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
+br100_mtd_size=8126464
+Image/Build/Profile/AIBR100=$(call
BuildFirmware/CustomFlash/$(1),$(1),ai-br100,AIBR100,$(br100_mtd_size))

 ifeq ($(SUBTARGET),mt7620a)
 define Image/Build/Profile/Default
@@ -727,6 +729,7 @@
  $(call Image/Build/Profile/WHR600D,$(1))
  $(call Image/Build/Profile/WHR1166D,$(1))
  $(call Image/Build/Profile/NA930,$(1))
+ $(call Image/Build/Profile/AIBR100,$(1))
 endef
 endif

diff -ruN a/target/linux/ramips/mt7620a/profiles/AIBR100.mk
b/target/linux/ramips/mt7620a/profiles/AIBR100.mk
--- a/target/linux/ramips/mt7620a/profiles/AIBR100.mk 1970-01-01
08:00:00.000000000 +0800
+++ b/target/linux/ramips/mt7620a/profiles/AIBR100.mk 2014-04-04
18:52:23.183785000 +0800
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/AIBR100
+ NAME:=Aigale Ai-BR100
+ PACKAGES:=\
+ kmod-usb-core kmod-usb-dwc2 \
+ kmod-ledtrig-usbdev
+endef
+
+define Profile/AIBR100/Description
+ Default package set for Aigale Ai-BR100.
+endef
+$(eval $(call Profile,AIBR100))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20140703/609d114d/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