From patchwork Tue Jul 7 14:37:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?77ygU1JDSEFDSy5PUkc=?= X-Patchwork-Id: 492312 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7110F1402B0 for ; Wed, 8 Jul 2015 00:38:19 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 8D8E32848DA; Tue, 7 Jul 2015 16:37:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id A0F18280143 for ; Tue, 7 Jul 2015 16:37:48 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-pa0-f54.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 7 Jul 2015 16:37:47 +0200 (CEST) Received: by pabvl15 with SMTP id vl15so114306031pab.1 for ; Tue, 07 Jul 2015 07:38:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:subject:to:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=+YIzZNlM+zrhDxC7nwe/IT9kfrvzyn+IDNM8wkbsf1w=; b=kdugvlCFGzWYRmYOZiBDoxjOci0Z6R6im2LZ+OU0txeIBsTc2w1cJPmga5tStfYmmO 3MIfBP+ttnAb6QzIzdGQGjOvwju7JGbQaLBky5/YOIo98w81bnfIFWHuD2Bb8dfLJuAr dAutBKItBS/5EWEdi7URMhnZZ10P4YqNcDIi9/1GPXAJQKpOrhvz4ThiJQvyNo8g3sEw nryN6mgBhiKp6DCzjR1K2tIJj6/Nka8oDbG4rwmq0Uni9z1simNnERW1ojt6MxayI9IH sPQzq34qJG8jp8KodPDdDj/CZqfk3+9vNWeNpWDLseAMmCTX4y/0YcKKgl9CcHjMd1OH xN5w== X-Received: by 10.66.131.110 with SMTP id ol14mr9743492pab.0.1436279883549; Tue, 07 Jul 2015 07:38:03 -0700 (PDT) Received: from [192.168.73.44] (7c2945b5.i-revonet.jp. [124.41.69.181]) by mx.google.com with ESMTPSA id vy6sm22063937pbc.72.2015.07.07.07.38.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 07:38:02 -0700 (PDT) From: =?UTF-8?Q?=ef=bc=a0SRCHACK.ORG?= To: openwrt-devel@lists.openwrt.org Message-ID: <559BE447.6030306@gmail.com> Date: Tue, 7 Jul 2015 23:37:59 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 Subject: [OpenWrt-Devel] ramips: add support for Planex MZK-DP150N X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Hi, This patch add support for Planex MZK-DP150N. a mini router on the MT7620A SoC with one Ethernet port and a 802.11n 2.4 GHz radio. diff -uprN trunk.ORG/target/linux/ramips/base-files/etc/board.d/01_leds trunk/target/linux/ramips/base-files/etc/board.d/01_leds --- trunk.ORG/target/linux/ramips/base-files/etc/board.d/01_leds 2015-07-07 23:09:18.103418210 +0900 +++ trunk/target/linux/ramips/base-files/etc/board.d/01_leds 2015-07-07 23:10:41.643421592 +0900 @@ -261,6 +261,9 @@ case $board in zte-q7) set_wifi_led "zte:blue:status" ;; + mzk-dp150n) + ucidef_set_led_default "power" "power" "mzkdp150n:green:power" "1" + ;; esac board_config_flush diff -uprN trunk.ORG/target/linux/ramips/base-files/etc/board.d/02_network trunk/target/linux/ramips/base-files/etc/board.d/02_network --- trunk.ORG/target/linux/ramips/base-files/etc/board.d/02_network 2015-07-07 23:09:18.103418210 +0900 +++ trunk/target/linux/ramips/base-files/etc/board.d/02_network 2015-07-07 23:10:41.643421592 +0900 @@ -260,6 +260,13 @@ ramips_setup_interfaces() ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t" ucidef_add_switch_vlan "switch0" "2" "0 5t" ;; + + mzk-dp150n) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0 4 6t" + ;; + *) RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"` if [ -n "${RT3X5X}" ]; then diff -uprN trunk.ORG/target/linux/ramips/base-files/etc/diag.sh trunk/target/linux/ramips/base-files/etc/diag.sh --- trunk.ORG/target/linux/ramips/base-files/etc/diag.sh 2015-07-07 23:09:18.103418210 +0900 +++ trunk/target/linux/ramips/base-files/etc/diag.sh 2015-07-07 23:10:41.643421592 +0900 @@ -249,6 +249,9 @@ get_status_led() { zte-q7) status_led="zte:red:status" ;; + mzk-dp150n) + status_led="mzkdp150n:green:power" + ;; esac } diff -uprN trunk.ORG/target/linux/ramips/base-files/lib/ramips.sh trunk/target/linux/ramips/base-files/lib/ramips.sh --- trunk.ORG/target/linux/ramips/base-files/lib/ramips.sh 2015-07-07 23:09:18.103418210 +0900 +++ trunk/target/linux/ramips/base-files/lib/ramips.sh 2015-07-07 23:10:41.643421592 +0900 @@ -418,6 +418,9 @@ ramips_board_detect() { *"Mediatek MT7628AN evaluation board") name="mt7628" ;; + *"Planex MZK-DP150N") + name="mzk-dp150n" + ;; *) name="generic" ;; diff -uprN trunk.ORG/target/linux/ramips/base-files/lib/upgrade/platform.sh trunk/target/linux/ramips/base-files/lib/upgrade/platform.sh --- trunk.ORG/target/linux/ramips/base-files/lib/upgrade/platform.sh 2015-07-07 23:09:18.103418210 +0900 +++ trunk/target/linux/ramips/base-files/lib/upgrade/platform.sh 2015-07-07 23:13:07.055427477 +0900 @@ -71,6 +71,7 @@ platform_check_image() { mpr-a2 | \ mr-102n | \ mzk-w300nh2 | \ + mzk-dp150n | \ nbg-419n | \ nw718 | \ omni-emb | \ diff -uprN trunk.ORG/target/linux/ramips/dts/MZK-DP150N.dts trunk/target/linux/ramips/dts/MZK-DP150N.dts --- trunk.ORG/target/linux/ramips/dts/MZK-DP150N.dts 1970-01-01 09:00:00.000000000 +0900 +++ trunk/target/linux/ramips/dts/MZK-DP150N.dts 2015-07-07 23:10:41.643421592 +0900 @@ -0,0 +1,98 @@ +/dts-v1/; + +/include/ "rt5350.dtsi" + +/ { + compatible = "MZK-DP150N", "ralink,rt5350-soc"; + model = "Planex MZK-DP150N"; + + palmbus@10000000 { + gpio1: gpio@660 { + status = "okay"; + }; + + spi@b00 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "s25fl064k"; + reg = <0>; + linux,modalias = "m25p80", "s25fl064k"; + spi-max-frequency = <10000000>; + + partition@0 { + label = "uboot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "uboot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x3b0000>; + }; + }; + + spidev@1 { + compatible = "linux,spidev"; + spi-max-frequency = <10000000>; + reg = <1>; + }; + }; + }; + + pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "jtag", "uartf", "led"; + ralink,function = "gpio"; + }; + }; + }; + + ethernet@10100000 { + mtd-mac-address = <&factory 0x4>; + }; + + esw@10110000 { + ralink,portmap = <0x17>; + }; + + wmac@10180000 { + ralink,mtd-eeprom = <&factory 0>; + ralink,led-polarity = <1>; + }; + + gpio-leds { + compatible = "gpio-leds"; + power { + label = "mzkdp150n:green:power"; + gpios = <&gpio0 9 1>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio0 10 1>; + linux,code = <0x198>; + }; + }; +}; diff -uprN trunk.ORG/target/linux/ramips/image/Makefile trunk/target/linux/ramips/image/Makefile --- trunk.ORG/target/linux/ramips/image/Makefile 2015-07-07 23:09:18.123418211 +0900 +++ trunk/target/linux/ramips/image/Makefile 2015-07-07 23:12:13.263425300 +0900 @@ -609,6 +609,8 @@ Image/Build/Profile/W502U=$(call BuildFi Image/Build/Profile/WCR150GN=$(call BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN) +Image/Build/Profile/MZK-DP150N=$(call BuildFirmware/Default4M/$(1),$(1),mzk-dp150n,MZK-DP150N) + buffalo_whrg300n_mtd_size=3801088 define BuildFirmware/WHRG300N/squashfs $(call BuildFirmware/Default4M/$(1),$(1),whr-g300n,WHR-G300N) @@ -772,6 +774,7 @@ define Image/Build/Profile/Default $(call Image/Build/Profile/X5,$(1)) $(call Image/Build/Profile/X8,$(1)) $(call Image/Build/Profile/XDXRN502J,$(1)) + $(call Image/Build/Profile/MZK-DP150N,$(1)) endef endif diff -uprN trunk.ORG/target/linux/ramips/rt305x/profiles/planex.mk trunk/target/linux/ramips/rt305x/profiles/planex.mk --- trunk.ORG/target/linux/ramips/rt305x/profiles/planex.mk 1970-01-01 09:00:00.000000000 +0900 +++ trunk/target/linux/ramips/rt305x/profiles/planex.mk 2015-07-07 23:10:41.647421592 +0900 @@ -0,0 +1,17 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/MZK-DP150N + NAME:=Planex MZK-DP150N + PACKAGES:= kmod-spi-dev +endef + +define Profile/MZK-DP150N/Description + Package set optimized for the Planex MZK-DP150N. +endef + +$(eval $(call Profile,MZK-DP150N))