[OpenWrt-Devel] [PATCHv2] ralink: add support for ap699ge8c2

John Crispin blogic at openwrt.org
Fri May 22 09:49:13 EDT 2015


Hi,

what board is this ? the name looks weird.

	John

On 14/05/2015 15:17, Cristian Morales Vega wrote:
> Signed-off-by: Cristian Morales Vega <cristian at samknows.com>
> ---
>  .../linux/ramips/base-files/etc/board.d/02_network |   5 +
>  target/linux/ramips/base-files/lib/ramips.sh       |   3 +
>  .../ramips/base-files/lib/upgrade/platform.sh      |   1 +
>  target/linux/ramips/dts/AP699GE8C2.dts             | 112 +++++++++++++++++++++
>  target/linux/ramips/image/Makefile                 |   6 +-
>  target/linux/ramips/mt7621/profiles/ap699ge8c2.mk  |  18 ++++
>  6 files changed, 144 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/ramips/dts/AP699GE8C2.dts
>  create mode 100644 target/linux/ramips/mt7621/profiles/ap699ge8c2.mk
> 
> 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..ee6aab0 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -116,6 +116,7 @@ ramips_setup_interfaces()
>  		;;
>  
>  	3g-6200n | \
> +	ap699ge8c2 | \
>  	ai-br100 | \
>  	dir-610-a1 | \
>  	dir-300-b7 | \
> @@ -268,6 +269,10 @@ ramips_setup_macs()
>  	local wan_mac=""
>  
>  	case $board in
> +	ap699ge8c2)
> +		wan_mac=$(mtd_get_mac_binary factory 57350)
> +		;;
> +
>  	br-6475nd)
>  		lan_mac=$(cat /sys/class/net/eth0/address)
>  		wan_mac=$(mtd_get_mac_binary devdata 7)
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
> index 616f4a1..c1b7898 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -397,6 +397,9 @@ ramips_board_detect() {
>  	*"Mediatek MT7628AN evaluation board")
>  		name="mt7628"
>  		;;
> +	*"TWSZ AP699GE8C2")
> +		name="ap699ge8c2"
> +		;;
>  	*)
>  		name="generic"
>  		;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 17b456b..b79cca8 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -25,6 +25,7 @@ platform_check_image() {
>  	all0256n | \
>  	all5002 | \
>  	all5003 | \
> +	ap699ge8c2 | \
>  	ar725w | \
>  	asl26555 | \
>  	awapn2403 | \
> diff --git a/target/linux/ramips/dts/AP699GE8C2.dts b/target/linux/ramips/dts/AP699GE8C2.dts
> new file mode 100644
> index 0000000..7157962
> --- /dev/null
> +++ b/target/linux/ramips/dts/AP699GE8C2.dts
> @@ -0,0 +1,112 @@
> +/dts-v1/;
> +
> +/include/ "mt7621.dtsi"
> +
> +/ {
> +	compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc";
> +	model = "TWSZ AP699GE8C2";
> +
> +	memory at 0 {
> +		device_type = "memory";
> +		reg = <0x0 0x4000000>;
> +	};
> +
> +	chosen {
> +		bootargs = "console=ttyS0,57600";
> +	};
> +
> +	palmbus at 1E000000 {
> +		spi at b00 {
> +			status = "okay";
> +
> +			m25p80 at 0 {
> +				#address-cells = <1>;
> +				#size-cells = <1>;
> +				compatible = "mx25l6405d";
> +				reg = <0 0>;
> +				linux,modalias = "m25p80";
> +				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 0x7b0000>;
> +				};
> +
> +			};
> +		};
> +	};
> +
> +	pcie at 1e140000 {
> +		status = "okay";
> +
> +		pcie0 {
> +			mt76 at 0,0 {
> +				reg = <0x0000 0 0 0 0>;
> +				device_type = "pci";
> +				mediatek,mtd-eeprom = <&factory 0x8000>;
> +				mediatek,2ghz = <0>;
> +			};
> +		};
> +
> +		pcie1 {
> +			mt76 at 1,0 {
> +				reg = <0x0000 0 0 0 0>;
> +				device_type = "pci";
> +				mediatek,mtd-eeprom = <&factory 0x0000>;
> +				mediatek,5ghz = <0>;
> +			};
> +		};
> +	};
> +
> +	ethernet at 1e100000 {
> +		mtd-mac-address = <&factory 0xe000>;
> +	};
> +
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +
> +		wps {
> +			label = "twsz:green:wps";
> +			gpios = <&gpio1 14 1>;
> +		};
> +	};
> +
> +	gpio-keys-polled {
> +		compatible = "gpio-keys-polled";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		poll-interval = <20>;
> +		wps {
> +			label = "wps";
> +			gpios = <&gpio1 11 1>;
> +			linux,code = <0x211>;
> +		};
> +	};
> +
> +	pinctrl {
> +		state_default: pinctrl0 {
> +			gpio {
> +				ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
> +				ralink,function = "gpio";
> +			};
> +		};
> +	};
> +};
> diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
> index e6b5112..b024c21 100644
> --- a/target/linux/ramips/image/Makefile
> +++ b/target/linux/ramips/image/Makefile
> @@ -906,7 +906,7 @@ endif
>  #
>  
>  ifeq ($(SUBTARGET),mt7621)
> -  TARGET_DEVICES += mt7621 wsr-600 wsr-1166 dir-860l-b1 firewrt
> +  TARGET_DEVICES += mt7621 wsr-600 wsr-1166 dir-860l-b1 firewrt ap699ge8c2
>  endif
>  
>  define Device/mt7621
> @@ -943,6 +943,10 @@ define Device/firewrt
>    IMAGE_SIZE := $(ralink_default_fw_size_16M)
>  endef
>  
> +define Device/ap699ge8c2
> +  DTS := AP699GE8C2
> +endef
> +
>  #
>  # MT7628 Profiles
>  #
> diff --git a/target/linux/ramips/mt7621/profiles/ap699ge8c2.mk b/target/linux/ramips/mt7621/profiles/ap699ge8c2.mk
> new file mode 100644
> index 0000000..30df15b
> --- /dev/null
> +++ b/target/linux/ramips/mt7621/profiles/ap699ge8c2.mk
> @@ -0,0 +1,18 @@
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/AP699GE8C2
> +	NAME:=AP699GE8C2 Profile
> +	PACKAGES:=\
> +		kmod-usb-core kmod-usb3 \
> +		kmod-ledtrig-usbdev kmod-mt76
> +endef
> +
> +define Profile/AP699GE8C2/Description
> +	Package set optimized for the TWSZ AP699GE8C2
> +endef
> +$(eval $(call Profile,AP699GE8C2))
> 
_______________________________________________
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