From patchwork Wed Oct 9 08:08:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Jobling X-Patchwork-Id: 1994606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=XOAunV1J; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XNm6228Hqz1xsc for ; Wed, 9 Oct 2024 19:20:09 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type:List-Help: Reply-To:List-Archive:List-Unsubscribe:List-Subscribe:From:List-Post:List-Id: Message-ID:MIME-Version:To:Subject:Date:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=yL6MATVMxwHc18AfCeelXtpQLHXc7RdxGQotYES408o=; b=XOAunV1JUtsdqD+E3DW4GXNehq I5gtJcVFtSuDNKIjwwGGdoLJ8oOL9q/vchtwAozftwMqxiSdP3agKPfhCgnIU8vKBLuDAwjzxWqw5 WrqGoyPOipbKhlJFjkqP9aR9J0oAtW73ejNKhUs6GXUrmVAXAMfOe5OglZqMWa0kpKpcAnm/eprua 5w7XeZkt17yt5GCXRhkDvHfxA5vUgX4YoM+ckEX5Ah5fOPs/l02Y+SinwykBvM+MR2GE0lg+Ml5ZX Aw/3dZUQq/yRWmtpt0jkdAMMYQIA8YjKPQcyB9GarGJQ3zdsCKqT3DIh8hPy1yOJwkXRw2Wgm8hsg kd8Jg1AQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syRu3-00000008PZ2-31qq; Wed, 09 Oct 2024 08:18:39 +0000 Date: Wed, 9 Oct 2024 19:08:08 +1100 Subject: [RFC 5/6] qoriq: dts and board.d changes to fix device names To: openwrt-devel MIME-Version: 1.0 Message-ID: List-Id: OpenWrt Development List List-Post: X-Patchwork-Original-From: Evan Jobling via openwrt-devel From: Evan Jobling Precedence: list X-Mailman-Version: 2.1.34 X-BeenThere: openwrt-devel@lists.openwrt.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Evan Jobling List-Help: Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. initial port naming does not match factory. This required changes to preinit. Altnames being set is future work. Setting DSA conduit master is future work. Initial dsa port names match upstream sw0p for consistency. The only conflicts are p0 and p1 which were previously named sweth3 / sweth4. eth3 and eth4 are renamed conduit1 and conduit0. Switch ports sweth3-sweth7 are renamed eth3-eth7 per factory. Device image compat update as breaking changes to interface naming. Signed-off-by: Evan Jobling --- .../qoriq/base-files/etc/board.d/02_network | 34 +++++++++++++++---- .../base-files/etc/board.d/05_compat-version | 2 +- .../boot/dts/fsl/watchguard-firebox-m300.dts | 10 +++--- target/linux/qoriq/image/generic.mk | 4 +-- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/target/linux/qoriq/base-files/etc/board.d/02_network b/target/linux/qoriq/base-files/etc/board.d/02_network index 355c8d37a4..5e2780ea53 100644 --- a/target/linux/qoriq/base-files/etc/board.d/02_network +++ b/target/linux/qoriq/base-files/etc/board.d/02_network @@ -19,15 +19,37 @@ watchguard,firebox-m300) ucidef_set_interfaces_lan_wan "eth1" "eth0" wg_set_opt_interface "eth2" "2" - sweth_mac_offset=0x186d + ucidef_set_network_device_path "conduit0" "platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet" + ucidef_set_network_device_path "conduit1" "platform/ffe000000.soc/ffe400000.fman/ffe4e4000.ethernet" - for sweth in $(find /sys/class/net/ -name 'sweth*' -print); do - device="$(basename "$sweth")" - mac="$(mtd_get_mac_text wg_cfg0 "$sweth_mac_offset")" + ucidef_set_network_device_label "sw0p0" "eth3" + ucidef_set_network_device_label "sw0p1" "eth4" + ucidef_set_network_device_label "sw0p2" "eth5" + ucidef_set_network_device_label "sw0p3" "eth5" + ucidef_set_network_device_label "sw0p4" "eth7" + + ucidef_set_network_device_altname "eth3" "sweth3" + ucidef_set_network_device_altname "eth4" "sweth4" + ucidef_set_network_device_altname "eth5" "sweth5" + ucidef_set_network_device_altname "eth5" "sweth6" + ucidef_set_network_device_altname "eth7" "sweth7" + + ucidef_set_network_device_conduit "eth3" "conduit0" + ucidef_set_network_device_conduit "eth4" "conduit0" + ucidef_set_network_device_conduit "eth5" "conduit0" + ucidef_set_network_device_conduit "eth6" "conduit0" + ucidef_set_network_device_conduit "eth7" "conduit0" + + + eth_mac_offset=0x186d + + for eth in $(find /sys/class/net/ -name 'eth[3-7]' -print); do + device="$(basename "$eth")" + mac="$(mtd_get_mac_text wg_cfg0 "$eth_mac_offset")" switchports="$switchports $device" ucidef_set_network_device_mac "$device" "$mac" - wg_set_opt_interface "$device" "${device#sweth}" - sweth_mac_offset=$(printf "0x%X\n" $(( $sweth_mac_offset + 0x14))) + wg_set_opt_interface "$device" "${device#eth}" + eth_mac_offset=$(printf "0x%X\n" $(( $eth_mac_offset + 0x14))) done ;; diff --git a/target/linux/qoriq/base-files/etc/board.d/05_compat-version b/target/linux/qoriq/base-files/etc/board.d/05_compat-version index 2036fbcc95..fc9885054a 100644 --- a/target/linux/qoriq/base-files/etc/board.d/05_compat-version +++ b/target/linux/qoriq/base-files/etc/board.d/05_compat-version @@ -7,7 +7,7 @@ board_config_update case "$(board_name)" in watchguard,firebox-m300) - ucidef_set_compat_version "1.1" + ucidef_set_compat_version "1.2" ;; esac diff --git a/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts b/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts index c611263099..abc0f24570 100644 --- a/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts +++ b/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts @@ -235,31 +235,31 @@ port@0 { reg = <0>; - label = "sweth3"; + label = "sw0p0"; phy-handle = <&switch0phy0>; }; port@1 { reg = <1>; - label = "sweth4"; + label = "sw0p1"; phy-handle = <&switch0phy1>; }; port@2 { reg = <2>; - label = "sweth5"; + label = "sw0p2"; phy-handle = <&switch0phy2>; }; port@3 { reg = <3>; - label = "sweth6"; + label = "sw0p3"; phy-handle = <&switch0phy3>; }; port@4 { reg = <4>; - label = "sweth7"; + label = "sw0p4"; phy-handle = <&switch0phy4>; }; diff --git a/target/linux/qoriq/image/generic.mk b/target/linux/qoriq/image/generic.mk index d2b60d2296..5fd43f061c 100644 --- a/target/linux/qoriq/image/generic.mk +++ b/target/linux/qoriq/image/generic.mk @@ -2,8 +2,8 @@ define Device/watchguard_firebox-m300 DEVICE_VENDOR := WatchGuard DEVICE_MODEL := Firebox M300 DEVICE_COMPAT_MESSAGE := \ - Kernel switched to FIT uImage. Update U-Boot environment. - DEVICE_COMPAT_VERSION := 1.1 + Device ethernet naming changed to match factory. + DEVICE_COMPAT_VERSION := 1.2 DEVICE_DTS_DIR := $(DTS_DIR)/fsl DEVICE_PACKAGES := \ kmod-gpio-button-hotplug kmod-hwmon-w83793 kmod-leds-gpio kmod-ptp-qoriq \