From patchwork Tue Mar 13 14:50:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 885155 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=openmesh.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=openmesh-com.20150623.gappssmtp.com header.i=@openmesh-com.20150623.gappssmtp.com header.b="YvOg+bRC"; dkim-atps=neutral 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 400yVZ2FXHz9sTR for ; Wed, 14 Mar 2018 01:51:49 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 23D72B9135E; Tue, 13 Mar 2018 15:51:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Tue, 13 Mar 2018 15:51:12 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 33462B91352 for ; Tue, 13 Mar 2018 15:51:08 +0100 (CET) X-policyd-weight: using cached result; rate: -7 Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 13 Mar 2018 15:51:08 +0100 (CET) Received: by mail-qt0-f193.google.com with SMTP id a23so22996994qtn.0 for ; Tue, 13 Mar 2018 07:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openmesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rrMeABtcXPvV+YtU0dxKJNMT5mi8pASp6AdtfA/H1sI=; b=YvOg+bRCtfjICc5teDH9cUep8WEw1VQ2X7F1bwqtD0b5/Ht0ksY5fFl+HMh2rFQuZl 1Pn58FhlZ3xROxk1idtzJdsHWl1bMD/b3CB1IER8tq/HhOsEjOM20hAGBBwJuk7QdSZy jqcQyb9BT4UukNIIFbvm98zYZz1U2Vo/EfzjToB7oxuG3BgVvPHPhqlghQ11cxHclM+Y pa6lJu+o8txhzHkD6Dq2gQ7R1bRvVGlWp08zDYmqmc09mvEOWSwddwZde7p2bmQHhyvt +WoiuG2aze9pZScuARLp/rBBoLm4zZEdBUq734wwx7Q1rqaAYQgTwoNYImgPeWJfuc7/ UVTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rrMeABtcXPvV+YtU0dxKJNMT5mi8pASp6AdtfA/H1sI=; b=f3GL30Gjqd7xcQUafMXX86aPE95auYJlpB7l7wYn9RxGYUBLueUHbr/+cQki3Ap4v3 LKrsUJuuAdmSpk4bAQ7Qea2bZoOBB6C03pUih/UhCwbVM40lublZTS25jsPLfHaxhphb L+MOkVocEBzUo/3zY9TnCV8jBHZ7wRk91T+n9S5aYqfKwyLKMpSvjMibB2A1NtsFOh6g DUb+VRlqGUSKZ+Wic6gr94RdKKMlIs3T/XxVGGo1HlApPJ+5a8i825pG7syvovc12EEy PDViTad8amdpXdIWupJynqNVpYlUtCEVQhG+AqsiG68Ql1Jgr5GlAWodMMx81/i9Gjle HBRA== X-Gm-Message-State: AElRT7Gnosc/A0O65esJ9okgLObrmZGrJnJlw1NpzVQQrWswz+E/ygIy ncalbYxJ1E2H0QKefMDCpal4XRmF X-Google-Smtp-Source: AG47ELs/phLgMlyjljr5/Hjf7RsEZzz9aUADA6ojbWIfrpPCO+iYSFYnnCijoI2FGF2g8fg7aU4A4g== X-Received: by 10.237.59.81 with SMTP id q17mr1451331qte.222.1520952666713; Tue, 13 Mar 2018 07:51:06 -0700 (PDT) Received: from sven-desktop.home.narfation.org (p2003007C6F4830FE000000000000070D.dip0.t-ipconnect.de. [2003:7c:6f48:30fe::70d]) by smtp.gmail.com with ESMTPSA id c4sm283720qtj.86.2018.03.13.07.51.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Mar 2018 07:51:06 -0700 (PDT) From: Sven Eckelmann To: openwrt-devel@lists.openwrt.org Date: Tue, 13 Mar 2018 15:50:17 +0100 Message-Id: <20180313145017.5662-3-sven.eckelmann@openmesh.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180313145017.5662-1-sven.eckelmann@openmesh.com> References: <20180313145017.5662-1-sven.eckelmann@openmesh.com> Subject: [OpenWrt-Devel] [PATCH ipq 2/2] ipq40xx: Fix A42 eth port aliases/mac addresses X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" The OpenMesh A42 uses labels next to the ethernet ports to identify the first and second ethernet port. The first ethernet port's MAC address is also printed prominently on the label in the center of the housing. The board can also be powered up only using POE. It is therefore likely that the ethernet cable to the internet is attached to the first ethernet port which is also the active POE port. For a firmware without automatic internet detection (like OpenWrt), it is therefore logical to use this port as the default WAN port. The configuration for each port are: first ethernet port: * phy_mdio_addr: 4 * QCA8072 port bit: BIT(5) * u-boot mac address entry: ethaddr * active POE second ethernet port: * phy_mdio_addr: 3 * QCA8072 port bit: BIT(4) * u-boot mac address entry: eth1addr As Mark Rutland pointed out [1], user-accessible ports with well defined labels should be mapped accordingly with the aliases. This is mostly done already by qcom-ipq4019.dtsi which maps ethernet0 to &gmac0 and &gmac1. Only the gmac0 and gmac1 entries have to be adjusted accordingly to use the correct configurations for the ports. Not configuring the gmac entries as shown above, doesn't only affect the names of the virtual interface names but also swaps the mac addresses of the ports. The first ethernet port will then no longer use the mac address which is printed on the device. [1] https://patchwork.kernel.org/patch/9133903/ Signed-off-by: Sven Eckelmann --- I was informed that the patch was not actually from Christian Lamparter. His original patch didn't contain the gmac0 <-> gmac1 swap. So I have to apologize to him for wasting his time while trying to discuss changes which he actually didn't do. Btw. I don't have a good picture at the moment but you can check some photo from heise to see some of the labels --- target/linux/ipq40xx/base-files/etc/board.d/02_network | 2 +- .../ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 8e9a1889d1..d25a039f2d 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -33,7 +33,7 @@ glinet,gl-b1300) "0u@eth0" "3:lan" "4:lan" ;; openmesh,a42) - ucidef_set_interfaces_lan_wan "eth0" "eth1" + ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; meraki,mr33) diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts index 3d56a6ef52..fcc22276ba 100644 --- a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts +++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts @@ -210,6 +210,14 @@ }; &gmac0 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <2 0x20>; +}; + +&gmac1 { qcom,phy_mdio_addr = <3>; qcom,poll_required = <1>; qcom,forced_speed = <1000>;