[OpenWrt-Devel] [PATCH] ramips: add support for Nexx WT1520

John Crispin blogic at openwrt.org
Tue Sep 16 12:19:53 EDT 2014


Hi,

looks much better ... 2 comments inline ...


On 16/09/2014 18:16, rogerpueyo at rogerpueyo.com wrote:
> From: Roger Pueyo Centelles <openwrt at rogerpueyo.com>
>
> ---
>  target/linux/ramips/base-files/etc/board.d/01_leds |   3 +
>  .../linux/ramips/base-files/etc/board.d/02_network |   1 +
>  target/linux/ramips/base-files/etc/diag.sh         |   3 +
>  target/linux/ramips/base-files/lib/ramips.sh       |   3 +
>  .../ramips/base-files/lib/upgrade/platform.sh      |   1 +
>  target/linux/ramips/dts/NEXXWT1520.dts             | 108 +++++++++++++++++++++
>  target/linux/ramips/image/Makefile                 |   9 ++
>  target/linux/ramips/rt305x/profiles/nexx.mk        |  17 ++++
>  8 files changed, 145 insertions(+)
>  create mode 100644 target/linux/ramips/dts/NEXXWT1520.dts
>  create mode 100644 target/linux/ramips/rt305x/profiles/nexx.mk
>
> 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 01e2363..1806ff2 100755
> --- a/target/linux/ramips/base-files/etc/board.d/01_leds
> +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
> @@ -112,6 +112,9 @@ case $board in
>  	hlk-rm04)
>  		set_wifi_led "rt2800pci-phy0::radio"
>  		;;
> +	nexx-wt1520)
> +		set_wifi_led "rt2800pci-phy0::radio"
> +		;;
>  	all0239-3g|\
>  	hw550-3g)
>  		set_usb_led "hw550-3g:green:usb"
> 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 e027b3b..765d398 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -103,6 +103,7 @@ ramips_setup_interfaces()
>  	dir-320-b1 | \
>  	dir-615-h1 | \
>  	hlk-rm04 | \
> +	nexx-wt1520 | \
>  	mzk-w300nh2 | \
>  	mzk-750dhp)
>  		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
> diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
> index 9ad7ccb..472da4b 100755
> --- a/target/linux/ramips/base-files/etc/diag.sh
> +++ b/target/linux/ramips/base-files/etc/diag.sh
> @@ -63,6 +63,9 @@ get_status_led() {
>  	hlk-rm04)
>  		status_led="hlk-rm04:red:power"
>  		;;
> +	nexx-wt1520)
> +		status_led="nexx-wt1520:white:power"
> +		;;
>  	all0239-3g|\
>  	hw550-3g)
>  		status_led="hw550-3g:green:status"
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
> index bb42ace..0a09225 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -157,6 +157,9 @@ ramips_board_detect() {
>  	*"HILINK HLK-RM04")
>  		name="hlk-rm04"
>  		;;
> +	*"Nexx WT1520")
> +		name="nexx-wt1520"
> +		;;
>  	*"HAME MPR-A1")
>   		name="mpr-a1"
>   		;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 407c218..8ff2da6 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -52,6 +52,7 @@ platform_check_image() {
>  	hw550-3g | \
>  	hg255d | \
>  	hlk-rm04 | \
> +	nexx-wt1520 | \
>  	ip2202 | \
>  	m3 | \
>  	m4 | \
> diff --git a/target/linux/ramips/dts/NEXXWT1520.dts b/target/linux/ramips/dts/NEXXWT1520.dts
> new file mode 100644
> index 0000000..c89bea1
> --- /dev/null
> +++ b/target/linux/ramips/dts/NEXXWT1520.dts
> @@ -0,0 +1,108 @@
> +/dts-v1/;
> +
> +/include/ "rt5350.dtsi"
> +
> +/ {
> +	compatible = "NEXXWT1520", "ralink,rt5350-soc";
> +	model = "Nexx WT1520";
> +
> +	memory at 0 {
> +		device_type = "memory";
> +		reg = <0x0 0x2000000>;
> +	};
> +
> +	chosen {
> +		bootargs = "console=ttyS1,57600";
> +	};
> +
> +	palmbus at 10000000 {
> +		uart at 500 {
> +			status = "okay";
> +		};
> +
> +		spi at b00 {
> +			status = "okay";
> +			m25p80 at 0 {
> +				#address-cells = <1>;
> +				#size-cells = <1>;
> +				compatible = "w25q32";
> +				reg = <0 0>;
> +				linux,modalias = "m25p80", "s25fl064k";
> +				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 0x3b0000>;
> +				};
> +			};
> +		};
> +	};
> +
> +	pinctrl {
> +		state_default: pinctrl0 {
> +			gpio {
> +				ralink,group = "jtag";
> +				ralink,function = "gpio";
> +			};
> +		};
> +	};
> +
> +	ethernet at 10100000 {
> +		mtd-mac-address = <&factory 0x4>;
> +	};
> +
> +	wmac at 10180000 {
> +		ralink,mtd-eeprom = <&factory 0>;
> +	};
> +
> +	ehci at 101c0000 {
> +		status = "okay";
> +	};
> +
> +	ohci at 101c1000 {
> +		status = "okay";
> +	};
> +
> +	gpio-keys-polled {
> +		compatible = "gpio-keys-polled";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		poll-interval = <20>;
> +	};
> +
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +		power {
> +			label = "nexx-wt1520:white:power";
> +			gpios = <&gpio0 0 1>;
> +		};
> +	};
> +
> +        gpio_export {
> +                compatible = "gpio-export";
> +                #size-cells = <0>;
> +                usb-mode {
> +                        gpio-export,name = "usb-mode";


is this the usb power on/off gpio ? if so please just call it usb or
usb-power.


> +                        gpio-export,output = <0>;
> +                        gpios = <&gpio0 18 0>;
> +                };
> +        };
> +};
> diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
> index 35057e4..6f7c51c 100644
> --- a/target/linux/ramips/image/Makefile
> +++ b/target/linux/ramips/image/Makefile
> @@ -434,6 +434,14 @@ define BuildFirmware/HLKRM04/initramfs
>  endef
>  Image/Build/Profile/HLKRM04=$(call BuildFirmware/HLKRM04/$(1),$(1),hlk-rm04,HLKRM04,HLK-RM02)
>  
> +BuildFirmware/NEXXWT1520/squashfs=$(call BuildFirmware/Default4M/squashfs,$(1),$(2),$(3),$(4))
> +define BuildFirmware/NEXXWT1520/initramfs
> +	$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
> +	#mkhilinkfw -e -i$(call imgname,$(1),$(2))-uImage.bin -o $(call imgname,$(1),$(2))-factory.bin;

do we need to add this commented out line ?


rest looks fine ...

    John


> +endef
> +
> +Image/Build/Profile/NEXXWT1520=$(call BuildFirmware/NEXXWT1520/$(1),$(1),nexx-wt1520,NEXXWT1520,NEXXWT1520)
> +
>  Image/Build/Profile/M3=$(call BuildFirmware/Poray4M/$(1),$(1),m3,M3)
>  
>  Image/Build/Profile/M4=$(call BuildFirmware/PorayDualSize/$(1),$(1),m4,M4)
> @@ -598,6 +606,7 @@ define Image/Build/Profile/Default
>  	$(call Image/Build/Profile/FREESTATION5,$(1))
>  #	$(call Image/Build/Profile/HG255D,$(1))
>  	$(call Image/Build/Profile/HLKRM04,$(1))
> +	$(call Image/Build/Profile/NEXXWT1520,$(1))
>  	$(call Image/Build/Profile/HW550-3G,$(1))
>  	$(call Image/Build/Profile/IP2202,$(1))
>  	$(call Image/Build/Profile/M3,$(1))
> diff --git a/target/linux/ramips/rt305x/profiles/nexx.mk b/target/linux/ramips/rt305x/profiles/nexx.mk
> new file mode 100644
> index 0000000..45d81ec
> --- /dev/null
> +++ b/target/linux/ramips/rt305x/profiles/nexx.mk
> @@ -0,0 +1,17 @@
> +#
> +# Copyright (C) 2013 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/NEXXWT1520
> +	NAME:=Nexx WT1520
> +	PACKAGES:=kmod-usb2
> +endef
> +
> +define Profile/NEXXWT1520/Description
> +	Package set for NEXXWT1520
> +endef
> +
> +$(eval $(call Profile,NEXXWT1520)
_______________________________________________
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