From patchwork Fri Sep 10 22:40:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 1526661 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=n6rOIbYn; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H5rY12vJYz9sVw for ; Sat, 11 Sep 2021 08:44:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0xJONjayQKJMhl0kBjV8NTOUaZOQYPlo7uUDU3txzhY=; b=n6rOIbYn76eOGO E6apLgIEHL5Sw9+H/g5w9RIgi7rsfOO9fCZnXKzPL/c3DHhHW4tH+zaR+xl60098tt4fiafntWsiN vrNAR3PyPRJwcOOrK7/DoFxX7WRGtb9gWHsitMmVl+B5101BzCigo3fjGkaBdwYlfaKCsvGekwte6 XKtkK6AAAwjxssvHz5tvwh93OK4YA1J6HMa+ko3W3pGbBNEZM5ggnwksmmyA0LqJBT7wEBv2s7ybF S5h1selPYoLHIf5V6AA4tmKxdmEtzepxet0s507bS/wDeZhVTkIfULTZXqKThi6ORCWmKgfJnIKiE JnyWnUwJgw5Nh+uSMOsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOpCi-00DxXc-Ib; Fri, 10 Sep 2021 22:41:04 +0000 Received: from fudo.makrotopia.org ([2a07:2ec0:3002::71]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOpCe-00DxWd-En for openwrt-devel@lists.openwrt.org; Fri, 10 Sep 2021 22:41:01 +0000 Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.94.2) (envelope-from ) id 1mOpCU-0001UR-Bb; Sat, 11 Sep 2021 00:40:54 +0200 Date: Fri, 10 Sep 2021 23:40:38 +0100 From: Daniel Golle To: openwrt-devel@lists.openwrt.org Cc: Zoltan HERPAI , Hauke Mehrtens Subject: [PATCH] sunxi: bring up DSA b53 switch on Lamobo R1 Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210910_154100_543472_2C0361DC X-CRM114-Status: GOOD ( 11.05 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Build cortexa7 subtarget with DSA driver for MDIO-connected Broadcom BCM53xxx switches. This is needed for the Lamobo R1 aka. BananaPi BPi-R1 board which comes with such a switch IC. Remove old swconfig driver from target kernel config as the only board using it is now supported by the DSA driver. Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Build cortexa7 subtarget with DSA driver for MDIO-connected Broadcom BCM53xxx switches. This is needed for the Lamobo R1 aka. BananaPi BPi-R1 board which comes with such a switch IC. Remove old swconfig driver from target kernel config as the only board using it is now supported by the DSA driver. No changes to device tree are needed as upstream DTS already got a DSA switch definition and we are just using that upstream source. Update default network config of the Lamobo R1 to create lan bridge with all 4 lan ports. Introduce DEVICE_COMPAT_VERSION for the board to inform users about having the re-create their network configuration and add device alias as Bananapi BPi-R1 while at it. Signed-off-by: Daniel Golle --- target/linux/sunxi/base-files/etc/board.d/02_network | 3 +-- target/linux/sunxi/config-5.4 | 4 ---- target/linux/sunxi/cortexa7/config-5.4 | 12 ++++++++++++ target/linux/sunxi/image/cortexa7.mk | 5 ++++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/target/linux/sunxi/base-files/etc/board.d/02_network b/target/linux/sunxi/base-files/etc/board.d/02_network index 5b59333b1f..d5c615e7f2 100644 --- a/target/linux/sunxi/base-files/etc/board.d/02_network +++ b/target/linux/sunxi/base-files/etc/board.d/02_network @@ -11,8 +11,7 @@ friendlyarm,nanopi-r1) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; lamobo,lamobo-r1) - ucidef_add_switch "switch0" \ - "4:lan:1" "0:lan:2" "1:lan:3" "2:lan:4" "3:wan" "8@eth0" + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan ;; olimex,a20-olinuxino-micro) ucidef_set_interface_lan "wlan0" diff --git a/target/linux/sunxi/config-5.4 b/target/linux/sunxi/config-5.4 index 377234b828..e01a2cbd5e 100644 --- a/target/linux/sunxi/config-5.4 +++ b/target/linux/sunxi/config-5.4 @@ -523,10 +523,6 @@ CONFIG_SUNXI_SRAM=y CONFIG_SUNXI_WATCHDOG=y CONFIG_SUSPEND=y CONFIG_SUSPEND_FREEZER=y -CONFIG_SWCONFIG=y -CONFIG_SWCONFIG_B53=y -CONFIG_SWCONFIG_B53_PHY_DRIVER=y -CONFIG_SWCONFIG_B53_PHY_FIXUP=y CONFIG_SWIOTLB=y CONFIG_SWPHY=y CONFIG_SWP_EMULATE=y diff --git a/target/linux/sunxi/cortexa7/config-5.4 b/target/linux/sunxi/cortexa7/config-5.4 index 0b3697028f..4ead820881 100644 --- a/target/linux/sunxi/cortexa7/config-5.4 +++ b/target/linux/sunxi/cortexa7/config-5.4 @@ -13,3 +13,15 @@ CONFIG_MDIO_BUS_MUX=y # CONFIG_PINCTRL_SUN50I_H6 is not set # CONFIG_PINCTRL_SUN50I_H6_R is not set CONFIG_UNWINDER_ARM=y +CONFIG_NET_DEVLINK=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_TAG_BRCM=y +CONFIG_NET_DSA_TAG_BRCM_COMMON=y +CONFIG_NET_DSA_TAG_BRCM_PREPEND=y +CONFIG_NET_SWITCHDEV=y +CONFIG_B53=y +CONFIG_B53_MDIO_DRIVER=y +# CONFIG_B53_MMAP_DRIVER is not set +# CONFIG_B53_SERDES is not set +# CONFIG_B53_SPI_DRIVER is not set +# CONFIG_B53_SRAB_DRIVER is not set diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk index 59f11bc83c..ac2dd1bc08 100644 --- a/target/linux/sunxi/image/cortexa7.mk +++ b/target/linux/sunxi/image/cortexa7.mk @@ -64,7 +64,10 @@ TARGET_DEVICES += friendlyarm_zeropi define Device/lamobo_lamobo-r1 DEVICE_VENDOR := Lamobo DEVICE_MODEL := Lamobo R1 - DEVICE_PACKAGES:=kmod-ata-sunxi kmod-rtl8192cu swconfig wpad-basic-wolfssl + DEVICE_ALT0_VENDOR := Bananapi + DEVICE_ALT0_MODEL := BPi-R1 + DEVICE_PACKAGES := kmod-ata-sunxi kmod-rtl8192cu wpad-basic-wolfssl + DEVICE_COMPAT_VERSION := 2.0 SOC := sun7i-a20 endef TARGET_DEVICES += lamobo_lamobo-r1